Datasets:
Add files using upload-large-folder tool
Browse files- md/train/-NEXDKk8gZ/-NEXDKk8gZ.md +414 -0
- md/train/23ZjUGpjcc/23ZjUGpjcc.md +288 -0
- md/train/4dXmpCDGNp7/4dXmpCDGNp7.md +0 -0
- md/train/8xoN9ZdSW8/8xoN9ZdSW8.md +240 -0
- md/train/B1l4SgHKDH/B1l4SgHKDH.md +369 -0
- md/train/B1s6xvqlx/B1s6xvqlx.md +0 -0
- md/train/BJlrSmbAZ/BJlrSmbAZ.md +614 -0
- md/train/BbNIbVPJ-42/BbNIbVPJ-42.md +0 -0
- md/train/BkUDvt5gg/BkUDvt5gg.md +189 -0
- md/train/BkewX2C9tX/BkewX2C9tX.md +253 -0
- md/train/Bkg0u3Etwr/Bkg0u3Etwr.md +561 -0
- md/train/ByYPLJA6W/ByYPLJA6W.md +370 -0
- md/train/ByfyHh05tQ/ByfyHh05tQ.md +418 -0
- md/train/Byl8BnRcYm/Byl8BnRcYm.md +337 -0
- md/train/Byt3oJ-0W/Byt3oJ-0W.md +580 -0
- md/train/DKabt9MFnT/DKabt9MFnT.md +477 -0
- md/train/G1jmxFOtY_/G1jmxFOtY_.md +374 -0
- md/train/Gl8FHfMVTZu/Gl8FHfMVTZu.md +235 -0
- md/train/H1ebTsActm/H1ebTsActm.md +0 -0
- md/train/H1mCp-ZRZ/H1mCp-ZRZ.md +530 -0
- md/train/HJtEm4p6Z/HJtEm4p6Z.md +336 -0
- md/train/HkNEuToge/HkNEuToge.md +404 -0
- md/train/HklJdaNYPH/HklJdaNYPH.md +289 -0
- md/train/Hkxvl0EtDH/Hkxvl0EtDH.md +450 -0
- md/train/Hye9lnCct7/Hye9lnCct7.md +389 -0
- md/train/HyyP33gAZ/HyyP33gAZ.md +607 -0
- md/train/L4cVGxiHRu3/L4cVGxiHRu3.md +377 -0
- md/train/O-XJwyoIF-k/O-XJwyoIF-k.md +0 -0
- md/train/SJeNz04tDS/SJeNz04tDS.md +317 -0
- md/train/SJx63jRqFm/SJx63jRqFm.md +489 -0
- md/train/SkgzYiRqtX/SkgzYiRqtX.md +269 -0
- md/train/SyWvgP5el/SyWvgP5el.md +312 -0
- md/train/SygvZ209F7/SygvZ209F7.md +178 -0
- md/train/SyxeqhP9ll/SyxeqhP9ll.md +468 -0
- md/train/TNkPBBYFkXg/TNkPBBYFkXg.md +252 -0
- md/train/Vfs_2RnOD0H/Vfs_2RnOD0H.md +0 -0
- md/train/Xp5BhDKdil5/Xp5BhDKdil5.md +210 -0
- md/train/aUX5Plaq7Oy/aUX5Plaq7Oy.md +388 -0
- md/train/bFMWXJRn58/bFMWXJRn58.md +450 -0
- md/train/d20KTY2VrNk/d20KTY2VrNk.md +250 -0
- md/train/fmiwLdJCmLS/fmiwLdJCmLS.md +343 -0
- md/train/h3qQzodaAq7/h3qQzodaAq7.md +214 -0
- md/train/iNqrOCPRmYQ/iNqrOCPRmYQ.md +269 -0
- md/train/j9Rv7qdXjd/j9Rv7qdXjd.md +486 -0
- md/train/mAA1SfR_iun/mAA1SfR_iun.md +457 -0
- md/train/rJiaRbk0-/rJiaRbk0-.md +321 -0
- md/train/rkxNh1Stvr/rkxNh1Stvr.md +0 -0
- md/train/ryGvcoA5YX/ryGvcoA5YX.md +353 -0
- md/train/yWkP7JuHX1/yWkP7JuHX1.md +430 -0
- md/train/ypJS_nyu-I/ypJS_nyu-I.md +518 -0
md/train/-NEXDKk8gZ/-NEXDKk8gZ.md
ADDED
|
@@ -0,0 +1,414 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# IMPROVED DENOISING DIFFUSION PROBABILISTIC MODELS
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
We explore denoising diffusion probabilistic models, a class of generative models which have recently been shown to produce excellent samples in the image and audio domains. While these models produce excellent samples, it has yet to be shown that they can achieve competitive log-likelihoods. We show that, with several small modifications, diffusion models can achieve competitive log-likelihoods in the image domain while maintaining high sample quality. Additionally, our models allow for sampling with an order of magnitude fewer diffusion steps with only a modest difference in sample quality. Finally, we explore how sample quality and log-likelihood scale with the number of diffusion steps and the amount of model capacity. We conclude that denoising diffusion probabilistic models are a promising class of generative models with excellent scaling properties and sample quality.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Sohl-Dickstein et al. (2015) introduced diffusion probabilistic models ("diffusion models" for brevity), a class of generative models which match a data distribution by learning to reverse a gradual, multi-step noising process. More recently, Ho et al. (2020) showed an equivalence between these models and score based generative models (Song & Ermon, 2019; 2020), which learn a gradient of the log-density of the data distribution using denoising score matching (Hyvärinen, 2005). It has recently been shown that this class of models can produce high-quality images (Ho et al., 2020; Song & Ermon, 2020; Jolicoeur-Martineau et al., 2020) and audio (Chen et al., 2020b; Kong et al., 2020), but it has yet to be shown that diffusion models can achieve competitive log-likelihoods. Furthermore, while Ho et al. (2020) showed extremely good results on the CIFAR-10 (Krizhevsky, 2009) and LSUN (Yu et al., 2015) datasets, it is unclear how well diffusion models scale to datasets with higher diversity such as ImageNet. Finally, while Chen et al. (2020b) found that diffusion models can efficiently generate audio using a small number of sampling steps, it has yet to be shown that the same is true for images.
|
| 12 |
+
|
| 13 |
+
In this paper, we show that diffusion models can achieve competitive log-likelihoods while maintaining good sample quality, even on high-diversity datasets like ImageNet. Additionally, we show that our improved models can produce competitive samples an order of magnitude faster than those from Ho et al. (2020). We achieve these results by combining a simple reparameterization of the reverse process variance, a hybrid learning objective that combines the variational lower-bound with the simplified objective from Ho et al. (2020), and a novel noise schedule which allows the model to better leverage the entire diffusion process.
|
| 14 |
+
|
| 15 |
+
We find surprisingly that, with our hybrid objective, our models obtain better log-likelihoods than those obtained by optimizing the log-likelihood directly, and discover that the latter objective has much more gradient noise during training. We show that a simple importance sampling technique reduces this noise and allows us to achieve better log-likelihoods than with the hybrid objective. Using our trained models, we study how sample quality and log-likelihood change as we adjust the number of diffusion steps used at sampling time. We demonstrate that our improved models allow us to use an order of magnitude fewer steps at test time with only a modest change in sample quality and log-likelihood, thus speeding up sampling for use in practical applications.
|
| 16 |
+
|
| 17 |
+
Finally, we evaluate the performance of these models as we increase model size, and observe trends that suggest predictable improvements in performance as we increase training compute.
|
| 18 |
+
|
| 19 |
+
# 2 DENOISING DIFFUSION PROBABILISTIC MODELS
|
| 20 |
+
|
| 21 |
+
We briefly review the formulation of diffusion models from Ho et al. (2020). This formulation makes various simplifying assumptions, such as a fixed noising process $q$ which adds diagonal Gaussian noise at each timestep. For a more general derivation, see Sohl-Dickstein et al. (2015).
|
| 22 |
+
|
| 23 |
+
# 2.1 DEFINITIONS
|
| 24 |
+
|
| 25 |
+
Given a data distribution $x _ { 0 } \sim q ( x _ { 0 } )$ , we define a forward noising process $q$ which produces latents $x _ { 1 }$ through $x _ { T }$ by adding Gaussian noise at time $t$ with variance $\beta _ { t } \in ( 0 , 1 )$ as follows:
|
| 26 |
+
|
| 27 |
+
$$
|
| 28 |
+
\begin{array} { r l r } { { q ( x _ { 1 } , . . . , x _ { T } | x _ { 0 } ) : = \prod _ { t = 1 } ^ { T } q ( x _ { t } | x _ { t - 1 } ) } } \\ & { } & { q ( x _ { t } | x _ { t - 1 } ) : = \mathcal { N } ( x _ { t } ; \sqrt { 1 - \beta _ { t } } x _ { t - 1 } , \beta _ { t } \mathbf { I } ) } \end{array}
|
| 29 |
+
$$
|
| 30 |
+
|
| 31 |
+
Given sufficiently large $T$ and a well behaved schedule of $\beta _ { t }$ , the latent $x _ { T }$ is nearly an isotropic Gaussian distribution. Thus, if we know the exact reverse distribution $q ( x _ { t - 1 } | x _ { t } )$ , we can sample $x _ { T } \sim \mathcal { N } ( 0 , \mathbf { I } )$ and run the process in reverse to get a sample from $q ( x _ { 0 } )$ . However, since $q ( x _ { t - 1 } | x _ { t } )$ depends on the entire data distribution, we approximate it using a neural network:
|
| 32 |
+
|
| 33 |
+
$$
|
| 34 |
+
p _ { \theta } ( x _ { t - 1 } | x _ { t } ) : = \mathcal { N } ( x _ { t - 1 } ; \mu _ { \theta } ( x _ { t } , t ) , \Sigma _ { \theta } ( x _ { t } , t ) )
|
| 35 |
+
$$
|
| 36 |
+
|
| 37 |
+
The combination of $q$ and $p$ is a variational auto-encoder (Kingma & Welling, 2013), and we can write the variational lower bound (VLB) as follows:
|
| 38 |
+
|
| 39 |
+
$$
|
| 40 |
+
\begin{array} { r l } & { L _ { \mathrm { v l b } } : = L _ { 0 } + L _ { 1 } + \ldots + L _ { T - 1 } + L _ { T } } \\ & { \quad L _ { 0 } : = - \log p _ { \theta } ( x _ { 0 } | x _ { 1 } ) } \\ & { L _ { t - 1 } : = D _ { K L } ( q ( x _ { t - 1 } | x _ { t } , x _ { 0 } ) \parallel p _ { \theta } ( x _ { t - 1 } | x _ { t } ) ) } \\ & { \quad L _ { T } : = D _ { K L } ( q ( x _ { T } | x _ { 0 } ) \parallel p ( x _ { T } ) ) } \end{array}
|
| 41 |
+
$$
|
| 42 |
+
|
| 43 |
+
Aside from $L _ { 0 }$ , each term of Equation 4 is a $K L$ divergence between two Gaussian distributions, and can thus be evaluated in closed form. To evaluate $L _ { 0 }$ for images, we assume that each color component is divided into 256 bins, and we compute the probability of $p _ { \theta } ( x _ { 0 } | x _ { 1 } )$ landing in the correct bin (which is tractable using the CDF of the Gaussian distribution). Also note that while $L _ { T }$ does not depend on $\theta$ , it will be close to zero if the forward noising process adequately destroys the data distribution so that $q ( x _ { T } | x _ { 0 } ) \approx \mathcal { N } ( 0 , \mathbf { I } )$ .
|
| 44 |
+
|
| 45 |
+
It is useful to define and derive several other quantities which are relevant to the forward noising process, so we repeat them here from Ho et al. (2020):
|
| 46 |
+
|
| 47 |
+
$$
|
| 48 |
+
\begin{array} { c } { { \displaystyle \alpha _ { t } \mapsto 1 - \beta _ { t } } } \\ { { { \displaystyle \bar { \alpha } _ { t } : = \prod _ { s = 0 } ^ { t } \alpha _ { s } } } } \\ { { { \displaystyle \bar { \beta } _ { t } : = \frac { 1 - \bar { \alpha } _ { t - 1 } } { 1 - \bar { \alpha } _ { t } } \beta _ { t } } } } \\ { { { \displaystyle \tilde { \mu } _ { t } ( x _ { t } , x _ { 0 } ) : = \frac { \sqrt { \bar { \alpha } _ { t - 1 } } \beta _ { t } } { 1 - \bar { \alpha } _ { t } } x _ { 0 } + \frac { \sqrt { \alpha _ { t } } ( 1 - \bar { \alpha } _ { t - 1 } ) } { 1 - \bar { \alpha } _ { t } } x _ { t } } } } \\ { { { { \displaystyle q ( x _ { t } | x _ { 0 } ) = \sqrt { ( x _ { t } ; \zeta ) \bar { \alpha } _ { t } } x _ { 0 } } , ~ ( 1 - \bar { \alpha } _ { t } ) } } } \\ { { { \displaystyle q ( x _ { t - 1 } | x _ { t } , x _ { 0 } ) = \sqrt { ( x _ { t - 1 } ; \tilde { \mu } ( x _ { t } , x _ { 0 } ) , \tilde { \beta } _ { t } ] } } } } \end{array}
|
| 49 |
+
$$
|
| 50 |
+
|
| 51 |
+
# 2.2 TRAINING IN PRACTICE
|
| 52 |
+
|
| 53 |
+
Equation 12 provides an efficient way to jump directly to an arbitrary step of the forward noising process. This makes it possible to randomly sample $t$ during training. Ho et al. (2020) uniformly sample $t$ for each image in each mini-batch.
|
| 54 |
+
|
| 55 |
+
There are many different ways to parameterize $\mu _ { \theta } ( x _ { t } , t )$ . The most obvious option is to predict $\mu _ { \theta } ( x _ { t } , t )$ directly with a neural network; alternatively, the network could predict $x _ { 0 }$ , and this output could then be fed through $\tilde { \mu } ( \boldsymbol { x } _ { t } , \boldsymbol { x } _ { 0 } )$ ; finally, the network could predict the noise $\epsilon$ added to $x _ { 0 }$ , and this noise could be used to predict $x _ { 0 }$ via
|
| 56 |
+
|
| 57 |
+
$$
|
| 58 |
+
x _ { 0 } = \frac { 1 } { \sqrt { \alpha _ { t } } } \left( x _ { t } - \frac { \beta _ { t } } { \sqrt { 1 - \bar { \alpha } _ { t } } } \epsilon \right)
|
| 59 |
+
$$
|
| 60 |
+
|
| 61 |
+
Ho et al. (2020) found that predicting $\epsilon$ worked best, especially when combined with a reweighted loss function:
|
| 62 |
+
|
| 63 |
+
$$
|
| 64 |
+
L _ { \mathrm { s i m p l e } } = E _ { t , x _ { 0 } , \epsilon } \left[ | | \epsilon - \epsilon _ { \theta } ( x _ { t } , t ) | | ^ { 2 } \right]
|
| 65 |
+
$$
|
| 66 |
+
|
| 67 |
+
This objective can be seen as a reweighted form of $L _ { \mathrm { v l b } }$ (without the terms affecting $\Sigma _ { \theta }$ ). The authors found that optimizing this reweighted objective resulted in much better sample quality than optimizing $L _ { \mathrm { v l b } }$ directly, and explain this by drawing a connection to generative score matching (Song & Ermon, 2019; 2020).
|
| 68 |
+
|
| 69 |
+
One subtlety is that $L _ { \mathrm { s i m p l e } }$ provides no learning signal for $\Sigma _ { \theta } ( x _ { t } , t )$ . This is irrelevant, however, since Ho et al. (2020) achieved their best results by fixing the variance to $\sigma _ { t } ^ { 2 } \mathbf { I }$ rather than learning it. They found that they achieve similar sample quality using either $\sigma _ { t } ^ { 2 } = \beta _ { t }$ or $\sigma _ { t } ^ { 2 } = \tilde { \beta } _ { t }$ , which are two extremes given by $\boxed { q ( \boldsymbol { x } _ { 0 } ) }$ being either isotropic Gaussian noise or a delta function, respectively.
|
| 70 |
+
|
| 71 |
+
# 3 IMPROVING THE LOG-LIKELIHOOD
|
| 72 |
+
|
| 73 |
+
While Ho et al. (2020) found that diffusion models can generate high-fidelity samples according to FID (Heusel et al., 2017) and Inception Score (Salimans et al., 2016), they were unable to achieve competitive log-likelihoods with these models. Log-likelihood is a widely used metric in generative modeling, and it is generally believed that optimizing log-likelihood forces generative models to capture all of the modes of the data distribution (Razavi et al., 2019). Additionally, recent work (Henighan et al., 2020) has shown that small improvements in log-likelihood can have a dramatic impact on sample quality and learnt feature representations. Thus, it is important to explore why diffusion models seem to perform poorly on this metric, since this may suggest a fundamental shortcoming such as bad mode coverage. This section explores several modifications to the algorithm described in Section 2 that, when combined, allow diffusion models to achieve much better log-likelihoods on image datasets, suggesting that these models enjoy the same benefits as other likelihood-based generative models.
|
| 74 |
+
|
| 75 |
+
To study the effects of different modifications, we train fixed model architectures with fixed hyperparameters (Appendix A) on the ImageNet $6 4 \times 6 4$ (van den Oord et al., 2016a) and CIFAR-10 (Krizhevsky, 2009) datasets. While CIFAR-10 has seen more usage for this class of models, we chose to study ImageNet $6 4 \times 6 4$ as well because it provides a good trade-off between diversity and resolution, allowing us to train models quickly without worrying about overfitting. Additionally, ImageNet $6 4 \times 6 4$ has been studied extensively in the context of generative modeling (van den Oord et al., 2016b; Menick & Kalchbrenner, 2018; Child et al., 2019; Roy et al., 2020), allowing us to compare diffusion models directly to many other generative models.
|
| 76 |
+
|
| 77 |
+
The setup from Ho et al. (2020) (optimizing $\boldsymbol { L } _ { \mathrm { s i m p l e } }$ while setting $\sigma _ { t } ^ { 2 } = \beta _ { t }$ and $T = 1 0 0 0$ ) achieves a log-likelihood of 3.99 bits/dim on ImageNet $6 \dot { 4 } \times 6 4$ after $2 0 0 \mathrm { K }$ training iterations. We found in early experiments that we could get a boost in log-likelihood by increasing $T$ from 1000 to 4000; with this change, the log-likelihood improves to 3.77 bits/dim. For the remainder of this section, we use $T = 4 0 0 0$ , but we explore this choice in Section 4.
|
| 78 |
+
|
| 79 |
+
# 3.1 LEARNING $\Sigma _ { \theta } ( x _ { t } , t )$
|
| 80 |
+
|
| 81 |
+
In Ho et al. (2020), the authors set $\Sigma _ { \theta } ( x _ { t } , t ) = \sigma _ { t } ^ { 2 } \mathbf { I }$ , where $\sigma _ { t }$ is not learned. Oddly, they found that fixing $\sigma _ { t } ^ { 2 }$ to $\beta _ { t }$ yielded roughly the same sample quality as fixing it to $\tilde { \beta } _ { t }$ . Considering that $\beta _ { t }$ and $\tilde { \beta } _ { t }$ represent two opposite extremes, it is reasonable to ask why this choice doesn’t affect samples. One clue is given by Figure 1a, which shows that $\beta _ { t }$ and $\tilde { \beta } _ { t }$ are almost equal except near $t = 0$ , i.e. where the model is dealing with imperceptible details. Furthermore, as we increase the number of diffusion steps, $\beta _ { t }$ and $\tilde { \beta } _ { t }$ seem to remain close to one another for more of the diffusion process.
|
| 82 |
+
|
| 83 |
+

|
| 84 |
+
Figure 1a: The ratio $\tilde { \beta } _ { t } / \beta _ { t }$ for every diffusion step for diffusion processes of different lengths.
|
| 85 |
+
|
| 86 |
+

|
| 87 |
+
Figure 1b: Terms of the VLB vs diffusion step. The first few terms contribute most to NLL.
|
| 88 |
+
|
| 89 |
+

|
| 90 |
+
Figure 2: Latent samples from linear (top) and cosine (bottom) schedules respectively at linearly spaced values of $t$ from 0 to $T$ . The latents in the last quarter of the linear schedule are almost purely noise, whereas the cosine schedule adds noise more slowly
|
| 91 |
+
|
| 92 |
+
This suggests that, in the limit of infinite diffusion steps, the choice of $\sigma _ { t }$ might not matter at all for sample quality. In other words, as we add more diffusion steps, the model mean $\mu _ { \theta } ( x _ { t } , t )$ determines the distribution much more than $\Sigma _ { \theta } ( x _ { t } , t )$ .
|
| 93 |
+
|
| 94 |
+
While the above argument suggests that fixing $\sigma _ { t }$ is a reasonable choice for the sake of sample quality, it says nothing about log-likelihood. In fact, Figure 1b shows that the first few steps of the diffusion process contribute the most to the variational lower bound. Thus, it seems likely that we could improve log-likelihood by using a better choice of $\Sigma _ { \theta } ( x _ { t } , t )$ . To achieve this, we must learn $\Sigma _ { \theta } ( x _ { t } , t ) $ without the instabilities encountered by Ho et al. (2020).
|
| 95 |
+
|
| 96 |
+
Since Figure 1a shows that the reasonable range for $\Sigma _ { \theta } ( x _ { t } , t )$ is very small, it would be hard for a neural network to predict $\Sigma _ { \theta } ( x _ { t } , t )$ directly, even in the log domain, as observed by Ho et al. (2020). Instead, we found it better to parameterize the variance as an interpolation between $\beta _ { t }$ and $\tilde { \beta } _ { t }$ in the log domain. In particular, our model outputs a vector $v$ containing one component per dimension, and we turn this output into variances as follows:
|
| 97 |
+
|
| 98 |
+
$$
|
| 99 |
+
\Sigma _ { \theta } ( x _ { t } , t ) = \exp ( v \log \beta _ { t } + ( 1 - v ) \log \tilde { \beta } _ { t } )
|
| 100 |
+
$$
|
| 101 |
+
|
| 102 |
+
We did not apply any constraints on $v$ , theoretically allowing the model to predict variances outside of the interpolated range. However, we did not observe the network doing this in practice, suggesting that the bounds for $\Sigma _ { \theta } ( x _ { t } , t )$ are indeed expressive enough.
|
| 103 |
+
|
| 104 |
+
Since $L _ { \mathrm { s i m p l e } }$ doesn’t depend on $\Sigma _ { \theta } ( x _ { t } , t )$ , we define a new hybrid objective:
|
| 105 |
+
|
| 106 |
+
$$
|
| 107 |
+
L _ { \mathrm { h y b r i d } } = L _ { \mathrm { s i m p l e } } + \lambda L _ { \mathrm { v l b } }
|
| 108 |
+
$$
|
| 109 |
+
|
| 110 |
+
For our experiments, we set $\lambda = 0 . 0 0 1$ to prevent $L _ { \mathrm { v l b } }$ from overwhelming $L _ { \mathrm { s i m p l e } }$ . Along this same line of reasoning, we also apply a stop-gradient to the $\mu _ { \theta } ( x _ { t } , t )$ output for the $\dot { L } _ { \mathrm { v l b } }$ term. This way, $L _ { \mathrm { v l b } }$ can guide $\Sigma _ { \theta } ( x _ { t } , t )$ while $L _ { \mathrm { s i m p l e } }$ is still the main source of influence over $\mu _ { \theta } ( x _ { t } , t )$ .
|
| 111 |
+
|
| 112 |
+
# 3.2 IMPROVING THE NOISE SCHEDULE
|
| 113 |
+
|
| 114 |
+
We found that the noise schedule used in Ho et al. (2020) was sub-optimal for ImageNet $6 4 \times 6 4$ . In particular, the end of the forward noising process is too noisy, and so doesn’t contribute very
|
| 115 |
+
|
| 116 |
+

|
| 117 |
+
Figure 3a: FID when skipping a prefix of the reverse diffusion process on ImageNet $6 4 \times 6 4$ .
|
| 118 |
+
|
| 119 |
+

|
| 120 |
+
Figure 3b: $\bar { \alpha } _ { t }$ throughout diffusion in the linear schedule and our proposed cosine schedule.
|
| 121 |
+
|
| 122 |
+

|
| 123 |
+
Figure 4a: Learning curves comparing the loglikelihoods achieved by different objectives on ImageNet $6 4 \times 6 4$ .
|
| 124 |
+
|
| 125 |
+

|
| 126 |
+
Figure 4b: Gradient noise scales for the $L _ { \mathrm { v l b } }$ and $L _ { \mathrm { h y b r i d } }$ objectives on ImageNet $6 4 \times 6 4$ .
|
| 127 |
+
|
| 128 |
+
much to sample quality. This can be seen visually in Figure 2. The result of this effect is studied in Figure 3a, where we see that a model trained with the linear schedule does not get much worse (as measured by FID) when we skip up to $20 \%$ of the reverse diffusion process.
|
| 129 |
+
|
| 130 |
+
To address this problem, we construct a different noise schedule in terms of $\bar { \alpha } _ { t }$ :
|
| 131 |
+
|
| 132 |
+
$$
|
| 133 |
+
\bar { \alpha } _ { t } = \frac { f ( t ) } { f ( 0 ) } , f ( t ) = \cos \left( \frac { t / T + s } { 1 + s } \cdot \frac { \pi } { 2 } \right) ^ { 2 } , s = 0 . 0 0 8
|
| 134 |
+
$$
|
| 135 |
+
|
| 136 |
+
To go from this definition to variances $\beta _ { t }$ , we note that $\begin{array} { r } { \beta _ { t } = 1 - \frac { { { { \bar { \alpha } } _ { t } } } } { { { { \bar { \alpha } } _ { t - 1 } } } } } \end{array}$ α¯tα¯ . In practice, we clip βt to be no larger than 0.999 to prevent singularities at the end of the diffusion process near $t = T$ .
|
| 137 |
+
|
| 138 |
+
Our cosine schedule is designed to have a linear drop-off of $\bar { \alpha } _ { t }$ in the middle of the process, while changing very little near the extremes of $t = 0$ and $t = T$ to prevent abrupt changes in noise level. Figure 3b shows how $\bar { \alpha } _ { t }$ progresses for both schedules. We can see that the linear schedule from Ho et al. (2020) falls towards zero much faster, destroying information more quickly than necessary.
|
| 139 |
+
|
| 140 |
+
The small offset $s$ in our schedule prevents $\beta _ { t }$ from being too small near $t = 0$ , since we found that having tiny amounts of noise at the beginning of the process made it hard for the network to√ predict $\epsilon$ accurately enough. In particular, we selected $s$ such that $\sqrt { \beta _ { 0 } }$ was slightly smaller than the pixel bin size, $1 / 1 2 7 . 5$ . We chose to use $c o s ^ { 2 }$ in particular because it is a common mathematical function with the shape we were looking for. This choice was arbitrary, and we expect that many other functions with similar shapes would work as well.
|
| 141 |
+
|
| 142 |
+
# 3.3 REDUCING GRADIENT NOISE
|
| 143 |
+
|
| 144 |
+
We expected to achieve the best log-likelihoods by optimizing $L _ { \mathrm { v l b } }$ directly, rather than by optimizing $L _ { \mathrm { h y b r i d } }$ . However, we were surprised to find that $L _ { \mathrm { v l b } }$ was actually quite difficult to optimize in practice, at least on the diverse ImageNet $6 4 \times 6 4$ dataset. Figure 4a shows the learning curves for both $L _ { \mathrm { v l b } }$ and $L _ { \mathrm { h y b r i d } }$ . Both curves are noisy, but the hybrid objective clearly achieves better log-likelihoods on the training set given the same amount of training time.
|
| 145 |
+
|
| 146 |
+
Table 1: Comparison of NLL and FID for different diffusion models on ImageNet $6 4 \times 6 4 .$ . $L _ { \mathrm { v l b } }$ and $L _ { \mathrm { h y b r i d } }$ were trained with learned sigmas using the parameterization from Section 3.1. For $L _ { \mathrm { v l b } }$ , we used the resampling scheme from Section 3.3. Using our cosine schedule and $L _ { \mathrm { { h y b r i d } } }$ improves both log-likelihood and FID over the baseline from Ho et al. (2020). Optimizing $L _ { \mathrm { v l b } }$ further improves log-likelihood at the cost of a higher FID.
|
| 147 |
+
|
| 148 |
+
<table><tr><td>MODEL</td><td>TRAINITERS.</td><td>T</td><td>SCHEDULE</td><td>OBJECTIVE</td><td>NLL (bits/dim)</td><td>FID</td></tr><tr><td rowspan="2">Baseline</td><td>200K</td><td>1K</td><td>linear</td><td>Lsimple</td><td>3.99</td><td>31.0</td></tr><tr><td>200K</td><td>4K</td><td>linear</td><td>Lsimple</td><td>3.77</td><td>29.7</td></tr><tr><td rowspan="4">Improved</td><td>200K</td><td>4K</td><td>linear</td><td>Lhybrid</td><td>3.66</td><td>30.4</td></tr><tr><td>200K</td><td>4K</td><td>cosine</td><td>Lsimple</td><td>3.68</td><td>25.6</td></tr><tr><td>200K</td><td>4K</td><td>cosine</td><td>Lhybrid</td><td>3.62</td><td>26.6</td></tr><tr><td>200K</td><td>4K</td><td>cosine</td><td>Lvlb</td><td>3.57</td><td>54.7</td></tr><tr><td rowspan="2">Improved</td><td>1.5M</td><td>4K</td><td>cosine</td><td>Lhybrid</td><td>3.57</td><td>18.3</td></tr><tr><td>1.5M</td><td>4K</td><td>cosine</td><td>Lvlb</td><td>3.53</td><td>38.3</td></tr></table>
|
| 149 |
+
|
| 150 |
+
Table 2: Comparison of NLL and FID for different diffusion models on CIFAR-10. Using our cosine schedule and $L _ { \mathrm { h y b r i d } }$ improves log-likelihood with a marginal impact on FID. Optimizing $L _ { \mathrm { v l b } }$ further improves log-likelihood at the cost of a significantly higher FID.
|
| 151 |
+
|
| 152 |
+
<table><tr><td>MODEL</td><td>TRAIN ITERS.</td><td>T</td><td>SCHEDULE</td><td>OBJECTIVE</td><td>NLL (bits/dim)</td><td>FID</td></tr><tr><td rowspan="2">Baseline</td><td>500K</td><td>1K</td><td>linear</td><td>Lsimple</td><td>3.73</td><td>3.29</td></tr><tr><td>500K</td><td>4K</td><td>linear</td><td>Lsimple</td><td>3.37</td><td>2.90</td></tr><tr><td rowspan="4">Improved</td><td>500K</td><td>4K</td><td>linear</td><td>Lhybrid</td><td>3.26</td><td>3.07</td></tr><tr><td>500K</td><td>4K</td><td>cosine</td><td>Lsimple</td><td>3.26</td><td>3.05</td></tr><tr><td>500K</td><td>4K</td><td>cosine</td><td>Lhybrid</td><td>3.17</td><td>3.19</td></tr><tr><td>500K</td><td>4K</td><td>cosine</td><td>Lv1b</td><td>2.94</td><td>11.47</td></tr></table>
|
| 153 |
+
|
| 154 |
+
We hypothesized that the gradient of $L _ { \mathrm { v l b } }$ was much noisier than that of $L _ { \mathrm { h y b r i d } }$ . We confirmed this by evaluating the gradient noise scales (McCandlish et al., 2018) for models trained with both objectives, as shown in Figure 4b. Thus, we sought out a way to reduce the variance of $L _ { \mathrm { v l b } }$ in order to optimize directly for log-likelihood.
|
| 155 |
+
|
| 156 |
+
Noting that different terms of $L _ { \mathrm { v l b } }$ have greatly different magnitudes (Figure 1b), we hypothesized that sampling $t$ uniformly causes unnecessary noise in the $L _ { \mathrm { v l b } }$ objective. To address this, we employ importance sampling:
|
| 157 |
+
|
| 158 |
+
$$
|
| 159 |
+
L _ { \mathrm { v l b } } = E _ { t \sim p _ { t } } \left[ \frac { L _ { t } } { p _ { t } } \right] , \mathrm { w h e r e } p _ { t } \propto \sqrt { E [ L _ { t } ^ { 2 } ] } \mathrm { a n d } \sum p _ { t } = 1
|
| 160 |
+
$$
|
| 161 |
+
|
| 162 |
+
Since $E [ L _ { t } ^ { 2 } ]$ is unknown beforehand and may change throughout training, we maintain a history of the previous 10 values for each loss term, and update this dynamically during training. At the beginning of training, we sample $t$ uniformly until we draw 10 samples for every $t \in [ 0 , T - 1 ]$ .
|
| 163 |
+
|
| 164 |
+
With this importance sampled objective, we are able to achieve our best log-likelihoods by optimizing $L _ { \mathrm { v l b } }$ .1 This can be seen in Figure 4a as the $" L _ { v l b }$ (resampled)" curve. The figure also shows that the importance sampled objective is considerably less noisy than the original, uniformly sampled objective.
|
| 165 |
+
|
| 166 |
+
# 3.4 RESULTS AND ABLATIONS
|
| 167 |
+
|
| 168 |
+
In this section, we ablate the changes we have made to achieve better log-likelihoods. Table 1 summarizes the results of our ablations on ImageNet $6 4 \times 6 4$ , and Table 2 shows them for CIFAR10. We also trained our best ImageNet $6 4 \times 6 4$ models for 1.5M iterations, and report these results as well. Based on the results, we recommend always using the cosine schedule, and the $L _ { \mathrm { { h y b r i d } } }$ objective in most cases. If one is only optimizing for likelihood and not sample quality, the importance sampled $L _ { \mathrm { v l b } }$ is the best objective to use.
|
| 169 |
+
|
| 170 |
+
Table 3: Comparison of diffusion models to other likelihood-based models on CIFAR-10 and Unconditional ImageNet $6 4 \times 6 4$ . On ImageNet $6 4 \times 6 4$ , our model is competitive with the best conventional models, but is worse than fully transformer-based architectures.
|
| 171 |
+
|
| 172 |
+
<table><tr><td rowspan=1 colspan=1>MODEL</td><td rowspan=1 colspan=1>ImageNet 64 × 64NLL (bits/dim)</td><td rowspan=1 colspan=1>CIFAR-10NLL (bits/dim)</td></tr><tr><td rowspan=4 colspan=1>Glow (Kingma & Dhariwal, 2018)Flow++ (Ho et al., 2019)PixelCNN (van den Oord et al., 2016b)PixelSNAIL (Chen et al., 2018)SPN(Menick&Kalchbrenner,2018)Image Transformer (Parmar et al., 2018)Sparse Transformer (Child et al., 2019)Routing Transformer (Roy et al., 2020)</td><td rowspan=1 colspan=1>3.81</td><td rowspan=1 colspan=1>3.35</td></tr><tr><td rowspan=1 colspan=1>3.69</td><td rowspan=1 colspan=1>3.08</td></tr><tr><td rowspan=2 colspan=1>3.573.523.523.483.443.43</td><td rowspan=1 colspan=1>3.14</td></tr><tr><td rowspan=1 colspan=1>2.85=2.902.801</td></tr><tr><td rowspan=2 colspan=1>Diffusion (Ho et al., 2020)Improved Diffusion (ours)</td><td rowspan=1 colspan=1>3.77</td><td rowspan=1 colspan=1>3.70</td></tr><tr><td rowspan=1 colspan=1>3.53</td><td rowspan=1 colspan=1>2.94</td></tr></table>
|
| 173 |
+
|
| 174 |
+
# 4 IMPROVING SAMPLING SPEED
|
| 175 |
+
|
| 176 |
+
All of our models were trained with 4000 diffusion steps, and thus producing a single sample takes several minutes on a modern GPU. In this section, we explore how performance scales if we reduce the steps used during sampling, and find that our pre-trained models can produce high-quality samples with many fewer diffusion steps than they were trained with without any fine-tuning. Reducing the steps in this way makes it possible to sample from our models in a number of seconds rather than minutes, and greatly improves the practical applicability of image diffusion models.
|
| 177 |
+
|
| 178 |
+
For a model trained with $T$ diffusion steps, we would typically sample using the same set of $t$ values $( 1 , 2 , . . . , T )$ as used during training. However, it is also possible to sample using an arbitrary set of $t$ values. We define a sequence $S$ of $t$ values to use for sampling, such as a strided schedule like $S = ( 1 , 3 , 5 , . . . , T - 1 )$ . Given the training noise schedule $\bar { \alpha } _ { t }$ , we can obtain the sampling noise schedule $\bar { \alpha } _ { S _ { t } }$ , which can be used to obtain corresponding sampling variances
|
| 179 |
+
|
| 180 |
+
$$
|
| 181 |
+
\beta _ { S _ { t } } = 1 - \frac { \bar { \alpha } _ { S _ { t } } } { \bar { \alpha } _ { S _ { t - 1 } } } , \quad \tilde { \beta } _ { S _ { t } } = \frac { 1 - \bar { \alpha } _ { S _ { t - 1 } } } { 1 - \bar { \alpha } _ { S _ { t } } } \beta _ { S _ { t } }
|
| 182 |
+
$$
|
| 183 |
+
|
| 184 |
+
We can compute $p ( x _ { S _ { t - 1 } } | x _ { S _ { t } } )$ as $\mathcal { N } ( \mu _ { \theta } ( x _ { S _ { t } } , S _ { t } ) , \Sigma _ { \theta } ( x _ { S _ { t } } , S _ { t } ) )$ . Note that $\Sigma _ { \theta } ( x _ { S _ { t } } , S _ { t } )$ is parameterized as a range between $\beta _ { S _ { t } }$ and $\tilde { \beta } _ { S _ { t } }$ so it will automatically be rescaled for the shorter diffusion process.
|
| 185 |
+
|
| 186 |
+
To evaluate sample quality for reduced numbers of sampling steps, we use a stride $K$ over timesteps to reduce the total number of sampling steps from $T$ to $T / K$ . In Figures 5a and 5c, we evaluate FIDs for an $L _ { \mathrm { { h y b r i d } } }$ model and an $L _ { \mathrm { s i m p l e } }$ model that were trained with 4000 diffusion steps, using 30, 50, 100, 150, 200, 400, and 4000 sampling steps. We do this for multiple checkpoints throughout training. We find that the $L _ { \mathrm { s i m p l e } }$ model suffers much more in sample quality when using a reduced number of sampling steps, whereas our $L _ { \mathrm { h y b r i d } }$ model maintains sample quality. Furthermore, we find that using more sampling steps becomes increasingly beneficial throughout training. However, 100 sampling steps is still sufficient to achieve near-optimal FIDs for our fully trained models.
|
| 187 |
+
|
| 188 |
+
In initial experiments, we found that although constant striding did not significantly affect FID, it drastically reduced log-likelihood. To address this, we use a strided subset of timesteps as for FID (with stride $K .$ ), but we also include every $t$ from 1 to $T / K$ . This requires $T / K$ extra evaluation steps, but greatly improves log-likelihood compared to the uniformly strided schedule. In Figures 5b and 5d we present log-likelihoods with this modified strided schedule.
|
| 189 |
+
|
| 190 |
+
# 5 SCALING MODEL SIZE
|
| 191 |
+
|
| 192 |
+
In the previous sections, we showed algorithmic changes that improved log-likelihood and FID without changing the amount of training compute. However, a trend in modern machine learning is that larger models and more training time tend to improve model performance (Kaplan et al., 2020;
|
| 193 |
+
|
| 194 |
+

|
| 195 |
+
Figure 5b: NLL versus evaluation steps on ImageNet $6 4 \times 6 4$ .
|
| 196 |
+
|
| 197 |
+

|
| 198 |
+
Figure 5a: FID versus sampling steps on ImageNet $6 4 \times 6 4$ .
|
| 199 |
+
|
| 200 |
+

|
| 201 |
+
Figure 5c: FID versus sampling steps on CIFAR10.
|
| 202 |
+
Figure 5d: NLL versus evaluation steps on CIFAR-10.
|
| 203 |
+
|
| 204 |
+
Figure 5: NLL and FID versus number of evaluation/sampling steps, for models trained on ImageNet $6 4 \times 6 4$ and CIFAR-10. All models were trained with 4000 diffusion steps. Models that learn sigmas using our reparametrization and $L _ { \mathrm { h y b r i d } }$ objective (Section 3.1) increase marginally in NLL and FID as we reduce evaluation/sampling steps, while using fixed sigmas as in Ho et al. (2020) results in a larger increase.
|
| 205 |
+
|
| 206 |
+
Chen et al., 2020a; Brown et al., 2020). Given this observation, we investigate how FID and NLL scale as a function of model size. Our results suggest that diffusion models can achieve better and better performance as training compute increases.
|
| 207 |
+
|
| 208 |
+
To measure how performance scales with compute, we train four different models on ImageNet $6 4 \times 6 4$ with the $L _ { \mathrm { { h y b r i d } } }$ objective described in Section 3.1. To change model capacity, we apply a depth multiplier across all layers, such that the first layer has either 64, 96, 128, or 192 channels. Note that our previous experiments used 128 channels in the first layer. Since the depth of each layer affects the scale of the initial weights, we scale the Adam learning rate for each model by√ $1 / \sqrt { }$ channel multiplier, such that the 128 channel model has a learning rate of 0.0001 (as in our other experiments).
|
| 209 |
+
|
| 210 |
+
Figure 6a and 6b show how FID and NLL improve relative to compute. These plots reveal that, to achieve optimal performance for a given amount of compute, it often makes sense to train a larger model for fewer iterations, rather than training a smaller model to convergence. We note that these models do not achieve optimal log-likelihoods because they were trained with our $L _ { \mathrm { h y b r i d } }$ objective and not directly with $L _ { \mathrm { v l b } }$ to keep both good log-likelihoods and sample quality. The $\mathbf { X }$ -axis in both figures is the theoretical amount of training compute, assuming full hardware utilization.
|
| 211 |
+
|
| 212 |
+

|
| 213 |
+
Figure 6a: FID throughout training on ImageNet $6 4 \times 6 4$ for different model sizes.
|
| 214 |
+
|
| 215 |
+

|
| 216 |
+
Figure 6b: NLL throughout training on ImageNet $6 4 \times 6 4$ for different model sizes.
|
| 217 |
+
|
| 218 |
+
# 6 RELATED WORK
|
| 219 |
+
|
| 220 |
+
Chen et al. (2020b) and Kong et al. (2020) are two recent works that use diffusion models to produce high fidelity audio conditioned on mel-spectrograms. Concurrent to our work, Chen et al. (2020b) use a combination of improved schedule and $L _ { 1 }$ loss to allow sampling with fewer steps with very little reduction in sample quality. However, compared to our unconditional image generation task, their generative task has a strong input conditioning signal provided by the mel-spectrograms, and we hypothesize that this makes it easier to sample with fewer diffusion steps.
|
| 221 |
+
|
| 222 |
+
Jolicoeur-Martineau et al. (2020) explored score matching in the image domain, and constructed an adversarial training objective to produce better $x _ { 0 }$ predictions. However, they found that choosing a better network architecture removed the need for this adversarial objective, suggesting that the adversarial objective is not necessary for powerful generative modeling.
|
| 223 |
+
|
| 224 |
+
# 7 CONCLUSION
|
| 225 |
+
|
| 226 |
+
We have shown that, with a few modifications, diffusion models can sample much faster and achieve better log-likelihoods with little impact on sample quality. Here we summarize our main findings:
|
| 227 |
+
|
| 228 |
+
• Our cosine noise schedule improves NLL (and sometimes FID) compared to the linear schedule from Ho et al. (2020).
|
| 229 |
+
• Learning $\Sigma _ { \theta }$ using our parameterization and $L _ { \mathrm { h y b r i d } }$ objective provides a good trade-off between NLL and FID. More importantly, it allows sampling with many fewer steps without decreased sample quality.
|
| 230 |
+
• One can optimize $L _ { \mathrm { v l b } }$ directly using our importance sampling technique to achieve the best possible NLL at the expense of sample quality.
|
| 231 |
+
|
| 232 |
+
The combination of these results makes diffusion models an attractive choice for generative modeling, since they combine good log-likelihoods, high-quality samples, and fast sampling with a wellgrounded, stationary training objective. Furthermore, we have investigated how diffusion models scale with the amount of available training compute, and found that more training compute trivially leads to better sample quality and log-likelihood. These results indicate that diffusion models are a promising direction for future research, especially as the affordability of compute increases over time.
|
| 233 |
+
|
| 234 |
+
# REFERENCES
|
| 235 |
+
|
| 236 |
+
Tom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, Sandhini Agarwal, Ariel Herbert-Voss, Gretchen Krueger, Tom Henighan, Rewon Child, Aditya Ramesh, Daniel M. Ziegler, Jeffrey Wu, Clemens Winter, Christopher Hesse, Mark Chen, Eric Sigler, Mateusz Litwin, Scott Gray, Benjamin Chess, Jack Clark, Christopher Berner, Sam McCandlish, Alec Radford, Ilya Sutskever, and Dario Amodei. Language models are few-shot learners, 2020.
|
| 237 |
+
|
| 238 |
+
Mark Chen, Alec Radford, Rewon Child, Jeff Wu, Heewoo Jun, Prafulla Dhariwal, David Luan, and Ilya Sutskever. Generative pretraining from pixels, 2020a. URL https://cdn.openai. com/papers/Generative_Pretraining_from_Pixels_V2.pdf.
|
| 239 |
+
|
| 240 |
+
Nanxin Chen, Yu Zhang, Heiga Zen, Ron J. Weiss, Mohammad Norouzi, and William Chan. Wavegrad: Estimating gradients for waveform generation, 2020b.
|
| 241 |
+
|
| 242 |
+
Xi Chen, Nikhil Mishra, Mostafa Rohaninejad, and Pieter Abbeel. Pixelsnail: An improved autoregressive generative model. In International Conference on Machine Learning, pp. 864–872. PMLR, 2018.
|
| 243 |
+
|
| 244 |
+
Rewon Child, Scott Gray, Alec Radford, and Ilya Sutskever. Generating long sequences with sparse transformers, 2019.
|
| 245 |
+
|
| 246 |
+
Terrance DeVries, Michal Drozdzal, and Graham W Taylor. Instance selection for gans. arXiv preprint arXiv:2007.15255, 2020.
|
| 247 |
+
|
| 248 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition, 2015.
|
| 249 |
+
|
| 250 |
+
Tom Henighan, Jared Kaplan, Mor Katz, Mark Chen, Christopher Hesse, Jacob Jackson, Heewoo Jun, Tom B. Brown, Prafulla Dhariwal, Scott Gray, Chris Hallacy, Benjamin Mann, Alec Radford, Aditya Ramesh, Nick Ryder, Daniel M. Ziegler, John Schulman, Dario Amodei, and Sam McCandlish. Scaling laws for autoregressive generative modeling, 2020.
|
| 251 |
+
|
| 252 |
+
Martin Heusel, Hubert Ramsauer, Thomas Unterthiner, Bernhard Nessler, and Sepp Hochreiter. Gans trained by a two time-scale update rule converge to a local nash equilibrium. Advances in Neural Information Processing Systems 30 (NIPS 2017), 2017.
|
| 253 |
+
|
| 254 |
+
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, 2019.
|
| 255 |
+
|
| 256 |
+
Jonathan Ho, Ajay Jain, and Pieter Abbeel. Denoising diffusion probabilistic models, 2020.
|
| 257 |
+
|
| 258 |
+
Aapo Hyvärinen. Estimation of non-normalized statistical models by score matching. Journal of Machine Learning Research, 6(Apr):695–709, 2005.
|
| 259 |
+
|
| 260 |
+
Alexia Jolicoeur-Martineau, Rémi Piché-Taillefer, Rémi Tachet des Combes, and Ioannis Mitliagkas. Adversarial score matching and improved sampling for image generation, 2020.
|
| 261 |
+
|
| 262 |
+
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, 2020.
|
| 263 |
+
|
| 264 |
+
Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization, 2014.
|
| 265 |
+
|
| 266 |
+
Diederik P Kingma and Max Welling. Auto-encoding variational bayes, 2013.
|
| 267 |
+
|
| 268 |
+
Durk P Kingma and Prafulla Dhariwal. Glow: Generative flow with invertible 1x1 convolutions. In Advances in neural information processing systems, pp. 10215–10224, 2018.
|
| 269 |
+
|
| 270 |
+
Zhifeng Kong, Wei Ping, Jiaji Huang, Kexin Zhao, and Bryan Catanzaro. Diffwave: A versatile diffusion model for audio synthesis, 2020.
|
| 271 |
+
|
| 272 |
+
Alex Krizhevsky. Learning multiple layers of features from tiny images, 2009. URL http:// www.cs.toronto.edu/\~kriz/learning-features-2009-TR.pdf.
|
| 273 |
+
|
| 274 |
+
Sam McCandlish, Jared Kaplan, Dario Amodei, and OpenAI Dota Team. An empirical model of large-batch training, 2018.
|
| 275 |
+
|
| 276 |
+
Jacob Menick and Nal Kalchbrenner. Generating high fidelity images with subscale pixel networks and multidimensional upscaling, 2018.
|
| 277 |
+
|
| 278 |
+
Niki Parmar, Ashish Vaswani, Jakob Uszkoreit, Łukasz Kaiser, Noam Shazeer, Alexander Ku, and Dustin Tran. Image transformer. arXiv preprint arXiv:1802.05751, 2018.
|
| 279 |
+
|
| 280 |
+
Ali Razavi, Aaron van den Oord, and Oriol Vinyals. Generating diverse high-fidelity images with vq-vae-2, 2019.
|
| 281 |
+
|
| 282 |
+
Aurko Roy, Mohammad Saffar, Ashish Vaswani, and David Grangier. Efficient content-based sparse attention with routing transformers, 2020.
|
| 283 |
+
|
| 284 |
+
Tim Salimans, Ian Goodfellow, Wojciech Zaremba, Vicki Cheung, Alec Radford, and Xi Chen. Improved techniques for training gans, 2016.
|
| 285 |
+
|
| 286 |
+
Tim Salimans, Andrej Karpathy, Xi Chen, and Diederik P. Kingma. Pixelcnn $^ { + + }$ : Improving the pixelcnn with discretized logistic mixture likelihood and other modifications, 2017.
|
| 287 |
+
|
| 288 |
+
Jascha Sohl-Dickstein, Eric A. Weiss, Niru Maheswaranathan, and Surya Ganguli. Deep unsupervised learning using nonequilibrium thermodynamics, 2015.
|
| 289 |
+
|
| 290 |
+
Yang Song and Stefano Ermon. Generative modeling by estimating gradients of the data distribution. In Advances in Neural Information Processing Systems, pp. 11918–11930, 2019.
|
| 291 |
+
|
| 292 |
+
Yang Song and Stefano Ermon. Improved techniques for training score-based generative models. arXiv preprint arXiv:2006.09011, 2020.
|
| 293 |
+
|
| 294 |
+
Aaron van den Oord, Nal Kalchbrenner, Oriol Vinyals, Lasse Espeholt, Alex Graves, and Koray Kavukcuoglu. Conditional image generation with pixelcnn decoders, 2016a. URL http:// image-net.org/small/download.php.
|
| 295 |
+
|
| 296 |
+
Aaron van den Oord, Nal Kalchbrenner, Oriol Vinyals, Lasse Espeholt, Alex Graves, and Koray Kavukcuoglu. Conditional image generation with pixelcnn decoders, 2016b.
|
| 297 |
+
|
| 298 |
+
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need, 2017.
|
| 299 |
+
|
| 300 |
+
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, 2015.
|
| 301 |
+
|
| 302 |
+
Yang Zhao, Chunyuan Li, Ping Yu, Jianfeng Gao, and Changyou Chen. Feature quantization improves gan training. arXiv, pp. arXiv–2004, 2020.
|
| 303 |
+
|
| 304 |
+
# A HYPERPARAMETERS
|
| 305 |
+
|
| 306 |
+
For all of our experiments, we use a UNet model architecture2 similar to that used by Ho et al. (2020). We changed the attention layers to use multi-head attention (Vaswani et al., 2017), and opted to use four attention heads rather than one (while keeping the same total number of channels). We employed attention not only at the 16x16 resolution, but also at the 8x8 resolution. Additionally, we changed the way the model conditions on $t$ . In particular, instead of computing conditioning vector $v$ and injecting it into hidden state $h$ as $\mathrm { G r o u p N o r m } ( h + v )$ , we compute conditioning vectors $w$ and $b$ and inject them into the hidden state as $\mathrm { G r o u p N o r m } ( h ) ( w + 1 ) + b$ . We found in preliminary experiments on ImageNet $6 4 \times 6 4$ that these modifications slightly improved FID.
|
| 307 |
+
|
| 308 |
+
We used a 120M parameter model for all ImageNet $6 4 \times 6 4$ experiments except in Section 5, where we scaled the number of channels in all layers. In this architecture, the downsampling stack performs four steps of downsampling, each with three residual blocks (He et al., 2015). The upsampling stack is setup as a mirror image of the downsampling stack. From highest to lowest resolution, the UNet stages use $[ C , 2 C , 3 C , 4 \bar { C } ]$ channels, respectively. In all experiments except those in Section 5, we set $C = 1 2 8$ . We estimate that, with $C = 1 2 8$ , our model requires roughly 39 billion FLOPs in the forward pass.
|
| 309 |
+
|
| 310 |
+
For our CIFAR-10 experiments, we used a smaller model with three resblocks per downsampling stage and layer widths $[ C , 2 C , 2 C , 2 C ]$ with $C = 1 2 8$ . We swept over dropout values $\{ 0 . 1 , 0 . 2 , \bar { 0 . 3 } \bar \}$ and found that 0.1 worked best for the linear schedule while 0.3 worked best for our cosine schedule (Section 3.2). We expand upon this in Appendix E.
|
| 311 |
+
|
| 312 |
+
For all of our experiments, we used Adam (Kingma & Ba, 2014) with a batch size of 128 and an exponential moving average (EMA) over model parameters with a rate of 0.9999. Except in Section 5, we fixed the learning rate to 0.0001. For quick comparisons in Section 3, we trained models for 200K iterations. This is not enough to reach convergence, but we believe it is enough to fairly compare different modifications. We then trained the best models for 1.5M iterations to achieve better performance.
|
| 313 |
+
|
| 314 |
+
When using the linear noise schedule from Ho et al. (2020), we linearly interpolated from $\beta _ { 1 } =$ $0 . 0 0 0 1 / 4$ to $\beta _ { 4 0 0 0 } = 0 . 0 2 / 4$ in order to preserve the shape of $\bar { \alpha } _ { t }$ for the $T = 4 0 0 0$ schedule.
|
| 315 |
+
|
| 316 |
+
When computing FID for CIFAR-10, we produce 50K samples and compare them against the training set for consistency with other work. When computing FID for ImageNet $6 4 \times 6 4$ , we produce 10K samples and compute FID against 50K validation images unless otherwise stated. Using only 10K samples biases the FID to be worse-than-necessary, but requires much less compute for sampling. Since we mainly use FID for relative comparisons, this bias is acceptable.
|
| 317 |
+
|
| 318 |
+

|
| 319 |
+
|
| 320 |
+

|
| 321 |
+
Figure 7a: 50 sampling steps
|
| 322 |
+
|
| 323 |
+

|
| 324 |
+
Figure 7c: 200 sampling steps
|
| 325 |
+
Figure 7e: 1000 sampling steps
|
| 326 |
+
|
| 327 |
+

|
| 328 |
+
|
| 329 |
+

|
| 330 |
+
Figure 7b: 100 sampling steps
|
| 331 |
+
|
| 332 |
+

|
| 333 |
+
Figure 7d: 400 sampling steps
|
| 334 |
+
Figure 7f: 4000 sampling steps
|
| 335 |
+
|
| 336 |
+
Figure 7: Unconditional ImageNet $6 4 \times 6 4$ samples as we reduce number of sampling steps for a $L _ { \mathrm { h y b r i d } }$ model with $4 K$ diffusion steps trained for $1 . 5 \mathbf { M }$ training iterations.
|
| 337 |
+
|
| 338 |
+

|
| 339 |
+
|
| 340 |
+

|
| 341 |
+
Figure 8a: 50 sampling steps
|
| 342 |
+
|
| 343 |
+

|
| 344 |
+
Figure 8c: 200 sampling steps
|
| 345 |
+
Figure 8e: 1000 sampling steps
|
| 346 |
+
|
| 347 |
+

|
| 348 |
+
|
| 349 |
+

|
| 350 |
+
Figure 8b: 100 sampling steps
|
| 351 |
+
|
| 352 |
+

|
| 353 |
+
Figure 8d: 400 sampling steps
|
| 354 |
+
Figure 8f: 4000 sampling steps
|
| 355 |
+
|
| 356 |
+
Figure 8: Unconditional CIFAR-10 samples as we reduce number of sampling steps for a Lhybrid model with $4 K$ diffusion steps trained for 500K training iterations.
|
| 357 |
+
|
| 358 |
+

|
| 359 |
+
Figure 9a: Samples from $L _ { \mathrm { h y b r i d } }$ model
|
| 360 |
+
|
| 361 |
+

|
| 362 |
+
Figure 9b: Samples from $L _ { \mathrm { v l b } }$ model
|
| 363 |
+
|
| 364 |
+
Figure 9: Unconditional ImageNet $6 4 \times 6 4$ samples generated from an $L _ { \mathrm { h y b r i d } }$ and $L _ { \mathrm { v l b } }$ model respectively using the exact same random noise. Both models were trained for 1.5M training iterations.
|
| 365 |
+
|
| 366 |
+

|
| 367 |
+
Figure 10a: Samples from $L _ { \mathrm { h y b r i d } }$ model
|
| 368 |
+
|
| 369 |
+

|
| 370 |
+
Figure 10b: Samples from $L _ { \mathrm { v l b } }$ model
|
| 371 |
+
|
| 372 |
+
Figure 10: Unconditional CIFAR-10 samples generated from an $L _ { \mathrm { h y b r i d } }$ and $L _ { \mathrm { v l b } }$ model respectively using the exact same random noise. Both models were trained for 500K training iterations.
|
| 373 |
+
|
| 374 |
+

|
| 375 |
+
Figure 11a: The ratio between VLB terms for each diffusion step of $\theta _ { \mathrm { h y b r i d } }$ and $\theta _ { \mathrm { v l b } }$ . Values less than 1.0 indicate that $\theta _ { \mathrm { h y b r i d } }$ is "better" than $\theta _ { \mathrm { v l b } }$ for that timestep of the diffusion process.
|
| 376 |
+
|
| 377 |
+

|
| 378 |
+
Figure 11b: Samples from $\theta _ { \mathrm { v l b } }$ and $\theta _ { \mathrm { h y b r i d } }$ , as well as an ensemble produced by using $\theta _ { \mathrm { v l b } }$ for the first and last 100 diffusion steps. For these samples, the seed was fixed, allowing a direct comparison between models.
|
| 379 |
+
|
| 380 |
+

|
| 381 |
+
Figure 12a: Samples with random noise.
|
| 382 |
+
|
| 383 |
+

|
| 384 |
+
Figure 12b: Samples with same noise in a column
|
| 385 |
+
|
| 386 |
+
Figure 12: Conditional ImageNet $6 4 \times 6 4$ samples generated from an $L _ { \mathrm { h y b r i d } }$ model trained for 1.7M training steps. The classes are 9: ostrich, 11: goldfinch, 130: flamingo, 141: redshank, 154: pekinese, 157: papillon, 97: drake and 28: spotted salamander. On right we fix the random noise seed in each column to see how the class label affects the sampling process.
|
| 387 |
+
|
| 388 |
+
# C COMBINING $L _ { \mathrm { H Y B R I D } }$ AND $L _ { \mathrm { V L B } }$ MODELS
|
| 389 |
+
|
| 390 |
+
To understand the trade-off between $L _ { \mathrm { h y b r i d } }$ and $L _ { \mathrm { v l b } }$ , we show in Figure 11a that the model resulting from $L _ { \mathrm { v l b } }$ (referred to as $\theta _ { \mathrm { v l b } } \mathrm { ~ , ~ }$ ) is better at the start and end of the diffusion process, while the model resulting from $L _ { \mathrm { h y b r i d } }$ (referred to as $\theta _ { \mathrm { h y b r i d } } )$ is better throughout the middle of the diffusion process. This suggests that $\theta _ { \mathrm { v l b } }$ is focusing more on imperceptible details, hence the lower sample quality.
|
| 391 |
+
|
| 392 |
+
Given the above observation, we performed an experiment on ImageNet $6 4 \times 6 4$ to combine the two models by constructing an ensemble that uses $\theta _ { \mathrm { h y b r i d } }$ for $t \in [ 1 0 0 , T - 1 0 0 )$ and $\theta _ { \mathrm { v l b } }$ elsewhere. We found that this model achieved an FID of 18.9 and an NLL of 3.52 bits/dim. As we see from Table 1, this is only slightly worse than $\theta _ { \mathrm { h y b r i d } }$ in terms of FID, while being better than both models in terms of NLL.
|
| 393 |
+
|
| 394 |
+
# D COMPARING SAMPLE QUALITY TO OTHER GENERATIVE MODELS
|
| 395 |
+
|
| 396 |
+
While this paper does not focus on comparing sample quality to other types of generative models, we were curious how diffusion models compared to modern generative models on ImageNet $6 4 \times$ 64. Unfortunately, we did not find any literature which computed FID for unconditional ImageNet
|
| 397 |
+
|
| 398 |
+
Table 4: Sample quality comparison on class conditional ImageNet $6 4 \times 6 4$
|
| 399 |
+
|
| 400 |
+
<table><tr><td>MODEL</td><td>FID</td></tr><tr><td>FQ-GAN (Zhao et al., 2020)</td><td>9.67</td></tr><tr><td>Instance Selection GAN (DeVries et al., 2020)</td><td>9.07</td></tr><tr><td>Improved Diffusion (ours)</td><td>8.43</td></tr></table>
|
| 401 |
+
|
| 402 |
+

|
| 403 |
+
Figure 13a: FID over the course of training.
|
| 404 |
+
|
| 405 |
+

|
| 406 |
+
Figure 13b: Negative log-likelihood over the course of training.
|
| 407 |
+
|
| 408 |
+
Figure 13: Evaluation metrics over the course of training for two CIFAR-10 models, both with dropout 0.1. The model trained with the linear schedule learns more slowly, but does not overfit as quickly. When too much overfitting occurs, we observed overfitting artifacts similar to those from Salimans et al. (2017), which is reflected by increasing FID.
|
| 409 |
+
|
| 410 |
+
$6 4 \times 6 4$ . We ran an additional experiment where we trained a class-conditional diffusion model for 1.7M iterations using the $L _ { \mathrm { h y b r i d } }$ objective. To make the model class-conditional, we inject class information through the same pathway as the timestep $t$ . In particular, we add a class embedding $v _ { i }$ to the timestep embedding $e _ { t }$ , and pass this embedding to residual blocks throughout the model. When computing FID for this task, we generated 50K samples (rather than 10K) to be directly comparable to other works. We found that using more samples led to a decrease in estimated FID of roughly 2 points. This is the only FID we report that was computed using 50K samples. Figure 12 shows our samples, and Table 4 summarizes our results.
|
| 411 |
+
|
| 412 |
+
# E OVERFITTIG ON CIFAR-10
|
| 413 |
+
|
| 414 |
+
On CIFAR-10, we noticed that all models overfit, but tended to reach similar optimal FID at some point during training. Holding dropout constant, we found that models trained with our cosine schedule tended to reach optimal performance (and then overfit) more quickly than those trained with the linear schedule (Figure 13). In our experiments, we corrected for this difference by using more dropout for our cosine models than the linear models. We suspect that the overfitting from the cosine schedule is either due to 1) less noise in the cosine schedule providing less regularization, or 2) the cosine schedule making optimization, and thus overfitting, easier.
|
md/train/23ZjUGpjcc/23ZjUGpjcc.md
ADDED
|
@@ -0,0 +1,288 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# SCALABLE TRANSFER LEARNING WITH EXPERT MODELS
|
| 2 |
+
|
| 3 |
+
Joan Puigcerver∗ Google Research
|
| 4 |
+
|
| 5 |
+
Carlos Riquelme∗ Google Research
|
| 6 |
+
|
| 7 |
+
Basil Mustafa Google Research
|
| 8 |
+
|
| 9 |
+
Cedric Renggli† ETH Zurich
|
| 10 |
+
|
| 11 |
+
André Susano Pinto Google Research
|
| 12 |
+
|
| 13 |
+
Sylvain Gelly Google Research
|
| 14 |
+
|
| 15 |
+
Daniel Keysers Google Research
|
| 16 |
+
|
| 17 |
+
Neil Houlsby Google Research
|
| 18 |
+
|
| 19 |
+
# ABSTRACT
|
| 20 |
+
|
| 21 |
+
Transfer of pre-trained representations can improve sample efficiency and reduce computational requirements for new tasks. However, representations used for transfer are usually generic, and are not tailored to a particular distribution of downstream tasks. We explore the use of expert representations for transfer with a simple, yet effective, strategy. We train a diverse set of experts by exploiting existing label structures, and use cheap-to-compute performance proxies to select the relevant expert for each target task. This strategy scales the process of transferring to new tasks, since it does not revisit the pre-training data during transfer. Accordingly, it requires little extra compute per target task, and results in a speed-up of 2–3 orders of magnitude compared to competing approaches. Further, we provide an adapter-based architecture able to compress many experts into a single model. We evaluate our approach on two different data sources and demonstrate that it outperforms baselines on over 20 diverse vision tasks in both cases.
|
| 22 |
+
|
| 23 |
+
# 1 INTRODUCTION
|
| 24 |
+
|
| 25 |
+
Deep learning has been successful on many computer vision tasks. Unfortunately, this success often requires a large amount of per-task data and compute. To scale deep learning to new vision tasks, practitioners often turn to transfer learning. Transfer learning involves re-using models trained on a large source task, and tuning them on the target task. This can improve both convergence rates (Ben-David et al., 2007; 2010; Blitzer et al., 2008; Du et al., 2017; Kuzborskij & Orabona, 2013; Mansour et al., 2009) and empirical performance (Dai et al., 2007; Donahue et al., 2014; Oquab et al., 2014; Tan et al., 2018). Transfer learning reduces per-task data or compute requirements, given a large one-off pre-training cost. In practice, this one-off down payment may not be made by the practitioner, since pre-trained networks are made available through platforms like PyTorch and TensorFlow $\mathrm { H u b ^ { 1 } }$ . For instance, ImageNet pre-training is popular since it is freely available and works well for many tasks (Donahue et al., 2014; Oquab et al., 2014; Sharif Razavian et al., 2014).
|
| 26 |
+
|
| 27 |
+
In contrast to generic homogeneous models (e.g. most pre-trained ImageNet networks), Mixture of Experts (MoE) include multiple heterogeneous sub-models (“experts”) that specialize to sub-problems of the full task. MoEs have been studied for decades (Eigen et al., 2013; Jacobs & Jordan, 1993), and have also been successful in deep learning (Shazeer et al., 2017). Yet, the application of experts for deep transfer learning has been less explored. We study visual transfer with experts, and present a simple, scalable, yet effective strategy.
|
| 28 |
+
|
| 29 |
+
Transfer of specialist models has been studied before. However, they either require expensive retraining on the source dataset for every target task (Ngiam et al., 2018; Yan et al., 2020), or operate at a small scale where all experts can be applied simultaneously (Dvornik et al., 2020). Further, most of them are tested only on a limited suite of natural single-object classification tasks. We lift these constraints, and present a practical approach that scales to hundreds of large experts, while requiring relatively little compute per target task.
|
| 30 |
+
|
| 31 |
+

|
| 32 |
+
Figure 1: Transfer Learning with Per-Task Routing of Experts. Step 1. A single baseline model B is trained on the entire upstream dataset. Step 2. The upstream data is divided in semantic subsets (possibly overlapping). One expert is trained on each subset using the weights from B as initialization. Step 3. Given a new downstream task $\mathbf { D } _ { T } = ( X _ { T } , Y _ { T } )$ , we compute the image representations $M _ { e } ( X _ { T } )$ from each expert $e$ . We use kNN to compute the accuracy on the supervised problem $\mathbf { D } _ { T , e } = \bar { ( M _ { e } ( X _ { T } ) , Y _ { T } ) }$ , and select the expert $e ^ { * }$ with highest accuracy. Step 4. We add a new head to $e ^ { * }$ and fine-tune its whole network with the downstream data, leading to the final model.
|
| 33 |
+
|
| 34 |
+
Our strategy consists of four stages (fig. 1). (1) Unconditional pre-training. A single baseline model is trained on the entire upstream data. (2) Experts training. Multiple experts are pre-trained by exploiting the label hierarchy present in many large-scale image datasets, such as ImageNet and JFT. In addition to entire expert networks, we explore residual adapters that allow all of the expertise to be packed into a single model that can be loaded into memory. These two stages may be expensive, but are done only once. (3) Expert selection. Applying all experts to each task does not scale well; some sort of sparsification is required. We focus on inexpensive model selection that can be applied to hundreds or thousands of experts. (4) Downstream fine-tuning. We take the output of the model selection phase and tune it on the target task. Importantly, this phase does not require revisiting the source dataset, which may be unavailable or expensive to train on.
|
| 35 |
+
|
| 36 |
+
We show that this approach yields remarkably strong performance on many diverse tasks. We evaluate not only on classic vision tasks, but also on the diverse VTAB benchmark of 19 tasks (Zhai et al., 2019). Our contributions can be summarized as follows.
|
| 37 |
+
|
| 38 |
+
• We propose a transfer learning algorithm with a large number of experts based on per-task routing via nearest neighbors selection. Once we have amortized the pre-training cost, this algorithm requires little compute per target task, achieving an speed-up of $5 0 0 \times - 1 0 0 0 \times$ compared to competing strategies. Also, it can be easily replicated with any large upstream multilabel dataset. • We achieve a mean accuracy improvement of $3 . 6 \%$ over the state-of-the-art performance on 19 VTAB datasets using ResNet50 networks. Our algorithm offers improvements on every group of tasks: natural, specialized, and structured. Figure 2 summarizes these results. • We explore using sub-networks as experts via residual adapters, allowing all experts to be packed into a single model. Surprisingly these perform almost as well as their full-network counterparts.
|
| 39 |
+
|
| 40 |
+
# 2 RELATED WORK
|
| 41 |
+
|
| 42 |
+
Transfer Learning. Tasks with little training data can benefit from other larger datasets, often from a similar domain. Transfer learning concerns the link between the source and target dataset (Pan & Yang, 2009; Weiss et al., 2016; Tan et al., 2018; Wang, 2018). One family of methods creates a single training dataset, where source instances are re-weighted according to their relevance (Dai et al., 2007; Pardoe & Stone, 2010; Wan et al., 2011; Xu et al., 2017). A popular method consists of fine-tuning a model that was pre-trained on the source data (Donahue et al., 2014; Oquab et al., 2014; Sharif Razavian et al., 2014). Some transfer learning algorithms condition the initial source model on the target dataset itself (Ngiam et al., 2018; Xie et al., 2019; Yalniz et al., 2019), while others (like ours) are agnostic about the downstream task when the initial model is trained on the source data (Kolesnikov et al., 2019). We offer an in-depth comparison with (Ngiam et al., 2018) in section 6.6. In the context of few-shot learning, where out-of-the-box fine-tuning may not work, generic representations are sometimes frozen, and simple feature selection (Dvornik et al., 2020) or model training (Chen et al., 2019) techniques are applied on top. Instead of relying on fixed universal representations, (Rebuffi et al., 2017; 2018) use small additional modules, or adapters, that incorporate knowledge from several visual domains. Our work also explores this idea.
|
| 43 |
+
|
| 44 |
+

|
| 45 |
+
Figure 2: Summary of results on the VTAB-1k benchmark, combining experts with different architectures trained on two different data sources (JFT, ImageNet21k). In each of the 19 datasets, we use the median accuracy over 30 runs. The average of the accuracies in each group is shown, as well as (percentile) bootstrap confidence intervals at the $9 5 \%$ level.
|
| 46 |
+
|
| 47 |
+
Multi-task Learning. MTL tries to leverage the common aspects of several learning tasks (Caruana, 1997). A prominent approach uses explicit parameter sharing; for instance, by means of common low-level layers leading to different heads. Among others, this has been successfully applied to vision (Zhang et al., 2014), language (Liu et al., 2015), and reinforcement learning (Fedus et al., 2019) tasks. In addition, a variety of ways to combine task-specific representations have arisen, such as cross-stitch networks (Misra et al., 2016), or lateral connections (Rusu et al., 2016). A different family of methods impose joint constraints on the –possibly different– models corresponding to each task. We can combine the learning problems via regularization and shared sparsity patterns (Argyriou et al., 2007; Lounici et al., 2009), or by imposing some prior knowledge regarding the task structure (Evgeniou et al., 2005; Jacob et al., 2009; Kim et al., 2012).
|
| 48 |
+
|
| 49 |
+
# 3 THE TRANSFER LEARNING FRAMEWORK
|
| 50 |
+
|
| 51 |
+
In this section, we describe our transfer learning setup of interest. The high-level goal is to train strong models for arbitrary downstream tasks, possibly under severe data and compute limitations. To do so efficiently, one can offload computation to a previous upstream phase which is executed a priori, without knowing the downstream tasks in advance. Accordingly, the upstream model should not depend on any specific target data. We are mostly interested in the low data regime where downstream tasks contain few datapoints. These restrictions have a practical motivation: we would like to build and deploy universal representations that are easily transferred to a wide range of downstream settings. Any transfer algorithm must implement the following three stages.
|
| 52 |
+
|
| 53 |
+
Upstream Training. Given the upstream data $\mathbf { D } _ { U }$ , the algorithm first outputs a source model M. The goal is to provide useful initial representations for various new tasks. This stage could actually produce a family of models $\{ { \bf M } _ { e } \}$ rather than a single one. These models might not be disjoint, and could share parameters. The upstream learning problems are auxiliary; accordingly, $\mathbf { D } _ { U }$ could include a diverse set of classification, regression, or even synthetic learning instances.
|
| 54 |
+
|
| 55 |
+
Model Selection. When a new downstream task is given, a selection algorithm is applied to choose the upstream model(s) to transfer, possibly depending on the downstream data. This phase should be computationally cheap; thus, the upstream data is no longer available. Sometimes, there is no choice to make (say, with a single ImageNet representation). Alternatively, in models with a complex structure, one may choose which parts, routes, or modules to keep in a data-dependent fashion.
|
| 56 |
+
|
| 57 |
+
Downstream Training. The final stage fine-tunes the selected model using the downstream data, either fully or partially. For neural nets, a new head is added as the output classes are task-specific.
|
| 58 |
+
|
| 59 |
+
Our overall algorithm is depicted in fig. 1. We give details about each step in the following sections.
|
| 60 |
+
|
| 61 |
+

|
| 62 |
+
Figure 3: (a) ResNet with expert adapters before all blocks. A layer of experts is placed before every block. (b) Each individual adapter including the overall skip connection. N, A, C stand for (Group) Normalization, (ReLU) Activation, and Convolution layers, respectively.
|
| 63 |
+
|
| 64 |
+
# 4 UPSTREAM TRAINING
|
| 65 |
+
|
| 66 |
+
# 4.1 EXPERT ARCHITECTURES
|
| 67 |
+
|
| 68 |
+
Our experts should provide feature extractions that are a good starting point to learn future tasks related to the expert’s upstream training data. We explore two different model architectures to train such experts. As an obvious choice, we first look at ResNets (He et al., 2016b). These are powerful models; however, storing and deploying many of them can be challenging. As an alternative, we also develop more compact adapter modules that can all be assembled in a single architecture. Also, their individual size can be easily customized to meet memory and computational constraints, which makes them an ideal candidate for combining multiple experts in a single model, when needed. We informally refer to these as full and adapter modules (or experts), respectively.
|
| 69 |
+
|
| 70 |
+
Full ResNet Modules. As a base architecture for full experts we use ResNets. In particular, all of our experiments focus on the ResNet50-v2 architecture (R50) (He et al., 2016a), which sequentially stacks a root block and 4 blocks with (3, 4, 6, 3) residual units. The initial step in every experiment consists of training a baseline model B on the whole upstream data (see stage 1 in fig. 1). This baseline is subsequently fine-tuned by both full and adapter experts, but in different ways. A full expert trained on a slice of data is simply the baseline B fine-tuned on that data. The head will later be discarded for transfer. This approach requires as many R50s as there are experts.
|
| 71 |
+
|
| 72 |
+
Adapter Modules. Residual adapters were proposed to adapt a neural network to a particular downstream task without needing to fine-tune the entire network (Rebuffi et al., 2017). Instead, we use them to adapt the baseline architecture to slices of the upstream data. Originally, they were $1 \times 1$ convolutions placed after each $3 \times 3$ convolution, with a residual connection. Instead we place them before each of the R50’s blocks. Finally, our adapters have a bottleneck and are non-linear, as in (Houlsby et al., 2019). We insert several in parallel into the backbone $\mathbf { B }$ . When creating an expert, only the adapters are tuned and the backbone weights are frozen.
|
| 73 |
+
|
| 74 |
+
Figure 3a depicts the ResNet architecture with multiple expert adapters $( a _ { 1 } ^ { ( i ) } , \ldots , a _ { n } ^ { ( i ) } )$ . Let $F _ { i }$ be the function implemented by the $i$ -th block of the backbone network. We adapt its input by computing the output as $x _ { i } : = F _ { i } ( x _ { i - 1 } + a _ { e } ^ { ( i ) } ( x _ { i - 1 } ) )$ , where $e = R ( x )$ is the identity of the selected expert, given by some routing function $R$ , and $x$ is the original input. During upstream training, the function $R$ may also use the labels in addition to the image, as we discuss in section 4.3.
|
| 75 |
+
|
| 76 |
+
Figure 3b shows the adapter’s bottleneck architecture. An adapter sequentially applies components $A _ { 1 }$ and $A _ { 2 }$ . Each component performs a group normalization $( \mathrm { N } )$ (Wu & He, 2018), a ReLU activation (A) (Glorot et al., 2011), and a convolution (C) (LeCun et al., 1989), in that order. Due to the skip connection, the output dimension of $A _ { 2 } \circ A _ { 1 }$ must match that of its input, $c$ . However, we can change the output channels $k$ of $A _ { 1 }$ , in order to limit the amount of parameters. Thus, we set $\begin{array} { r } { k = \frac { c } { 2 } } \end{array}$ so that the number of parameters equals that of a linear adapter. Each adapter only increases the parameter count of the R50 backbone by $6 \%$ . We briefly explored placing these adapters in other locations, or using other variations (Rebuffi et al., 2018), but we did not observe any significant improvement.
|
| 77 |
+
|
| 78 |
+
It is important to emphasize that the names Full and Adapters refer to the parameters that are specialized to a given subset of the upstream data before any downstream fine-tuning. In both cases, we fine-tune the entire network, after the model selection phase, to the downstream task.
|
| 79 |
+
|
| 80 |
+
# 4.2 UPSTREAM DATA AND EXPERT DEFINITION
|
| 81 |
+
|
| 82 |
+
We train our upstream models on large vision datasets with thousands of classes. Moreover, the datasets include an expressive hierarchy, linking classes and ancestor concepts via “is-a” relationships. Our experts’ domains are nodes in this hierarchy, which are selected automatically based on the number of images. Due to the multi-label nature of the datasets, several experts could simultaneously apply to an image. For example, for an image of a lion, all of organism, animal, carnivore, felidae, and lion could be relevant expert domains. In particular, we use two different upstream image datasets, and independently train a set of experts on each. We further describe them in section 6.1.
|
| 83 |
+
|
| 84 |
+
# 4.3 EXPERT TRAINING
|
| 85 |
+
|
| 86 |
+
Recall we denote by B the baseline R50 model trained on the whole upstream dataset $\mathbf { D } _ { U }$ . As shown in fig. 1, the second step of upstream training consists of training each expert individually on different subsets of the upstream dataset. Let $ { \mathbf Ḋ \Gamma Ḍ } _ { e } : = ( X _ { e } , Y _ { e } ) \subseteq { \mathbf Ḋ v Ḍ } _ { U }$ be the data corresponding to expert $e$ The subsets corresponding to different experts may overlap (e.g. for the animal and dog experts).
|
| 87 |
+
|
| 88 |
+
As mentioned before, the full experts completely fine-tune $\mathbf { B }$ on $\mathbf { D } _ { e }$ . For the adapter experts the weights corresponding to the adapter $e$ (modules in red in fig. 3) are trained on $\mathbf { D } _ { e }$ , but the shared blocks and head parameters are frozen. Note that, due to the sharing scheme, we can train all experts independently in parallel. We train all experts for the same number of steps, regardless of the size of $\mathbf { D } _ { e }$ . Instead of learning a routing function, we exploit the structure of the upstream labels and use a hard-coded routing. We found this makes learning easier, and leads to powerful specialized models.
|
| 89 |
+
|
| 90 |
+
# 5 EXPERT SELECTION
|
| 91 |
+
|
| 92 |
+
Given a new downstream dataset $\mathbf { D } _ { T } = ( X _ { T } , Y _ { T } )$ , we must choose an expert to use. We consider three approaches: domain prediction, label matching, and performance proxy.
|
| 93 |
+
|
| 94 |
+
Domain Prediction. This strategy selects the expert solely based on the images $X _ { T }$ . It effectively selects the expert whose domain best matches the target images. We implement this by training an auxiliary network (the “Expert Prediction Network” or EPN) to classify the expert from the image (i.e. learn the hard-coded routing mentioned previously). The EPN is trained upstream using the pre-training data and expert assignments. During transfer, an expert is selected using the highest geometric mean EPN predictive probability across the dataset. Details are in the Appendix A.
|
| 95 |
+
|
| 96 |
+
Label Matching. Matching the task with an expert can be done in the label space as opposed to the input space, by computing the affinity of each expert to a new downstream task in the label space of the upstream dataset. We first use a generic network trained on all upstream labels to predict upstream labels on the downstream images. We compute the KL-divergence between the distribution of labels on the downstream task images, and the prior distribution of labels for each expert. This per-expert prior is computed as the empirical distribution of labels on the images used to train that expert. We select the expert with the smallest KL-divergence. Details are in the Appendix B.
|
| 97 |
+
|
| 98 |
+
Performance Proxy. The aforementioned two strategies are simple, but do not use the training labels $Y _ { T }$ available for downstream tasks, which may contain key information. It would be too expensive to fine-tune every expert to every new task and select the best with hindsight, so we propose a proxy for the final performance. For this, we use a $k$ -nearest neighbors classifier (Altman, 1992) with the image embeddings produced by each expert. In the case of full experts, we simply apply the corresponding full network to compute these embeddings. For adapter-based experts, we apply the specific expert and ignore the remaining ones. Concretely, let $M _ { e } ( x )$ be the embedding corresponding to expert $e$ on input $x$ , and let $\mathbf { D } _ { T } = \{ ( x _ { i } , y _ { i } ) _ { i = 1 } ^ { N _ { T } } \}$ be our downstream task. In order to score each expert, we apply a kNN classifier on the embedded dataset $\mathbf { D } _ { T , e } = \{ ( M _ { e } ( x _ { i } ) , y _ { i } ) _ { i = 1 } ^ { N _ { T } } \}$ , with $k = 1$ and Euclidean distance. The accuracy $\operatorname { a c c } ( \mathbf { D } _ { T , e } )$ is computed via leave-one-out cross-validation. Finally, we select the expert with highest accuracy: $e ^ { * } = \arg \operatorname* { m a x } _ { e } \operatorname { a c c } ( \mathbf { D } _ { T , e } )$ . There are other alternative proxies that are cheaper than full fine-tuning, for example fitting a logistic regression, SVM, or decision trees to the features. Although these proxies may better match the fine-tuning accuracy, we use kNN since it is computationally cheap — it only requires a forward pass through the data, and leave-one-out cross-validation requires no additional inference per-fold — and it performs well (section 6).
|
| 99 |
+
|
| 100 |
+
# 5.1 DOWNSTREAM TRANSFER
|
| 101 |
+
|
| 102 |
+
The expert selection algorithm could choose several experts to be combined to solve any target task. However, we limit the scope of our work to transferring a single expert per task, since this approach is simple and turns out to be effective. Thus, the downstream transfer procedure is straightforward: it simply involves fine-tuning the selected expert model. We fine-tune the entire expert network to the downstream dataset, including the adapters when applicable. While it was valuable to restrict the scope of upstream training to focus on specializing the expert adapter parameters, we found fine-tuning the whole network downstream to be greatly beneficial. This differs from the original residual adapters work (Rebuffi et al., 2017), where only the adapters were fine-tuned.
|
| 103 |
+
|
| 104 |
+
# 6 EXPERIMENTAL RESULTS
|
| 105 |
+
|
| 106 |
+
# 6.1 UPSTREAM TRAINING
|
| 107 |
+
|
| 108 |
+
ImageNet21k (Deng et al., 2009) is a public dataset containing 13 million images, and 14 million labels of 21 843 classes, which are WordNet synsets (Fellbaum, 2012). In addition to the 21k classes, we consider the 1 741 synsets that are their ancestors. We use the 50 synsets of ImageNet21k with the largest number of images to train the expert models. These include e.g. animal, artifact, organism, food, structure, person, vehicle, plan, or instrument. We released 48 of these ImageNet21k models2.
|
| 109 |
+
|
| 110 |
+
JFT (Sun et al., 2017) is an even larger dataset containing 300 million images and 18 291 classes. Each image can belong to multiple classes, and as for ImageNet21k, the classes are organized in a hierarchy. We select as expert domains the classes with a sufficiently large number of examples: the 240 classes with more than 850 000 images. Some of the automatically chosen experts are animal, arts, bird, food, material, person, phenomenon, plant, or product.
|
| 111 |
+
|
| 112 |
+
We pre-train generic models on a Cloud TPUv3-512, as done in (Kolesnikov et al., 2019). Then finetune them briefly on each slice to create the expert models. Check additional details in appendix D.
|
| 113 |
+
|
| 114 |
+
# 6.2 DOWNSTREAM TASKS
|
| 115 |
+
|
| 116 |
+
We evaluate on two suites of tasks, each consisting of several datasets. The first is the Visual Task Adaptation Benchmark (VTAB) (Zhai et al., 2019), which consists of 19 datasets. We evaluate on VTAB-1k, where each task contains only 1k training examples. The tasks are diverse, and divided into three groups: natural images (single object classification), structured tasks (count, estimate distance, etc.), and specialized ones (medical, satellite images). Appendix E.1 contains further details. The second suite is a collection of popular natural datasets commonly used in transfer learning literature and, particularly in (Ngiam et al., 2018), to which we compare our work.
|
| 117 |
+
|
| 118 |
+
# 6.3 TRANSFER EVALUATION PROTOCOL
|
| 119 |
+
|
| 120 |
+
When transferring to new tasks we need to perform expert selection and choose other hyperparameters (e.g. learning rate for fine-tuning). For each downstream task, we use the following three step protocol.
|
| 121 |
+
|
| 122 |
+
Expert Transfer. We select the expert to transfer using one of the methods presented in section 5. In both sets of tasks, we use 1k training examples per dataset. Details are provided in appendix C.1.
|
| 123 |
+
|
| 124 |
+
Hyperparameter Selection. In VTAB-1k we use the recommended hyperparameter sweep and 800-training/200-validation split. We independently repeat the hyperparameter selection procedure 10 times for confidence intervals. For the other datasets we perform a single random search over 36 hyperparameter sets and select the best set based on the validation performance. This is a similar computational budget to that of (Ngiam et al., 2018). See appendices E.2 and F.1 for sweep details.
|
| 125 |
+
|
| 126 |
+
Table 1: VTAB-1k results of different selection algorithms, using full experts trained on JFT. The average accuracy across each group of tasks and across all VTAB is reported. In each dataset, the median accuracy over 30 runs is used. Bootstrapped confidence intervals at $9 5 \%$ level are included.
|
| 127 |
+
|
| 128 |
+
<table><tr><td></td><td>NATURAL</td><td>SPECIALIZED</td><td>STRUCTURED</td><td>ALL</td></tr><tr><td>Baseline (No Experts)</td><td>77.4 [77.3-77.6]</td><td>81.6 [81.5-82.0]</td><td>57.2 [52.8-58.2]</td><td>69.8 [68.0-70.2]</td></tr><tr><td>Random Expert</td><td>60.6 [59.1-63.9]</td><td>81.2 [80.9-81.8]</td><td>56.8 [54.9-57.8]</td><td>63.3 [62.3-64.6]</td></tr><tr><td>Domain Prediction</td><td>75.9 [74.4-77.4]</td><td>81.5 [81.3-82.2]</td><td>57.0 [56.1-57.4]</td><td>69.1 [68.4–69.8]</td></tr><tr><td>Label Matching</td><td>77.6 [77.8-78.1]</td><td>80.3 [79.1-82.5]</td><td>56.9 [55.6-57.2]</td><td>69.6 [68.9-70.0]</td></tr><tr><td>Performance Proxy</td><td>79.7 [79.5-80.0]</td><td>83.6 [83.3-83.8]</td><td>55.3 [52.1-56.3]</td><td>70.2 [68.9-70.6]</td></tr></table>
|
| 129 |
+
|
| 130 |
+
Table 2: VTAB-1k results of the baseline models and different expert architectures using kNN selection, pre-trained on ImageNet21k (IN21k) and JFT. The average accuracy across each group of tasks and across all 19 tasks is shown. In each dataset, the median accuracy over 30 runs is used.
|
| 131 |
+
|
| 132 |
+
<table><tr><td></td><td></td><td>NATURAL</td><td>SPECIALIZED</td><td>STRUCTURED</td><td>ALL</td></tr><tr><td rowspan="4">IN21k</td><td>Baseline</td><td>77.7 [77.4-77.8]</td><td>82.0 [78.4-83.9]</td><td>56.8 55.9-57.2]</td><td>69.8 [68.8-70.3]</td></tr><tr><td>Adapters</td><td>78.1 [78.0-78.3]</td><td>83.5 [83.1-83.6]</td><td>57.5 [56.8-58.2]</td><td>70.6 [70.3–70.9]</td></tr><tr><td>Full</td><td>78.3 [78.1-78.6]</td><td>83.4 [83.2-83.6]</td><td>59.4 [58.7-59.8]</td><td>71.4 [71.1-71.6]</td></tr><tr><td>All Experts</td><td>78.3 [78.1-78.6]</td><td>83.6 [83.4-83.7]</td><td>58.8 [58.0-59.4]</td><td>71.2 [70.8-71.5]</td></tr><tr><td rowspan="4">JFT</td><td>Baseline</td><td>77.4 [77.3-7.6]</td><td>81.6 [81.5-82.0]</td><td>57.2 [52.8-58.2]</td><td>69.8 [68.0-70.2]</td></tr><tr><td>Adapters</td><td>79.0 [78.6-79.1]</td><td>81.3 [79.2-82.5]</td><td>59.1 [58.3-60.1]</td><td>71.1 [70.5-71.6]</td></tr><tr><td>Full</td><td>79.7 [79.5-80.0]</td><td>83.6 [83.3-83.8]</td><td>55.3 [52.2-56.2]</td><td>70.2 [68.9-70.6]</td></tr><tr><td>All Experts</td><td>80.0 [79.2-80.4]</td><td>83.7 [83.6-83.8]</td><td>58.6 [58.0-59.4]</td><td>71.8 [71.3–72.2]</td></tr><tr><td>IN21k + JFT</td><td>All Experts</td><td>80.2 [79.8-80.3]</td><td>84.0 [83.7-84.2]</td><td>59.5 [58.7-60.1]</td><td>72.3 [71.9-72.6]</td></tr></table>
|
| 133 |
+
|
| 134 |
+
Final Re-training. Using the hyperparameters from the previous step, we re-train the selected expert on the entire task (training plus validation set). In VTAB-1k, we repeat this step 3 times for each of the 10 trials of hyperparameter selection and compute the test accuracy, yielding 30 outcomes per method per task. We compute the median of these 30 outcomes as the final accuracy in the dataset.
|
| 135 |
+
|
| 136 |
+
# 6.4 PERFORMANCE OF DIFFERENT EXPERT SELECTION STRATEGIES
|
| 137 |
+
|
| 138 |
+
We first establish which of the expert selection strategies presented in section 5 performs best. As a baseline we also try selecting a random, uniformly drawn, expert per task. Table 1 shows the results on VTAB-1k, using full experts trained on JFT. Table 5 show the results with adapters.
|
| 139 |
+
|
| 140 |
+
Overall, all methods perform better than random selection, particularly on the NATURAL group. This confirms that selecting good experts is essential. Overall, the performance proxy (kNN) selection performs better than the other alternatives. kNN’s average accuracy is $11 \%$ (relative) and $5 . 5 \%$ higher than that of the domain prediction and label matching, respectively. Thus, making use of the downstream labels offers a significant advantage in expert prediction. Therefore, in all subsequent experiments we use the kNN-based selection. We did not see a strong difference for the STRUCTURED datasets. We provide an extensive analysis of the kNN accuracy distribution per expert in appendix C. Appendix G shows how training experts on random subsets of the upstream data does not work well.
|
| 141 |
+
|
| 142 |
+
# 6.5 RESULTS ON VTAB
|
| 143 |
+
|
| 144 |
+
Table 2 shows the average accuracy across all the 19 VTAB-1k datasets broken down by type (natural, specialized, and structured). We summarize our findings as follows:
|
| 145 |
+
|
| 146 |
+
Improvement over Non-expert Baseline. All the algorithms, trained on either JFT or ImageNet21k, improve their corresponding baseline. Differences are most pronounced on the NATURAL datasets. While we also see improvements in SPECIALIZED and STRUCTURED datasets, some of the confidence intervals overlap. The performance of both JFT and ImageNet21k models is fairly similar in general. This is not unexpected; it has been observed before that, with restricted model capacity, they perform very similarly (Kolesnikov et al., 2019). Appendix C.6 shows the selected experts.
|
| 147 |
+
|
| 148 |
+
Table 3: Accuracy on the datasets used by DAT (Ngiam et al., 2018), and their average accuracy. Bootstrapped confidence intervals at $9 5 \%$ level are shown next to the accuracy where available. DAT uses Inception-v3 (In-v3) and a larger network, AmoebaNet-B (Am-B). Models pre-trained on JFT.
|
| 149 |
+
|
| 150 |
+
<table><tr><td></td><td>AIRCRAFT</td><td>BIRDS</td><td>CARS</td><td>CIFAR10</td><td>F0OD</td><td>PETS*</td><td>AVG.</td></tr><tr><td>Baseline</td><td>91.4 [91.0-91.7]</td><td>78.8 [78.0-79.4]</td><td>95.6 [95.4-95.7]</td><td>97.8 [97.7-97.9]</td><td>91.3 [91.2-91.5]</td><td>94.5 [94.4-94.6]</td><td>91.6 [91.4-91.7]</td></tr><tr><td>Adapters</td><td>92.5 [92.2-92.8]</td><td>79.4 [78.7-80.1]</td><td>95.9 [95.8-96.0]</td><td>97.9 [97.8-98.0]</td><td>91.6 [91.5-91.7]</td><td>94.6 [94.4-94.8]</td><td>92.0 [91.9-92.1]</td></tr><tr><td>Full</td><td>94.8 [94.5-95.1]</td><td>83.6[83.1-83.9]</td><td>96.1 [96.0-96.3]</td><td>97.8 [97.7-97.9]</td><td>93.1 [92.8-93.2]</td><td>97.0 [96.9-97.1]</td><td>93.7 [93.6-93.8]</td></tr><tr><td>DAT (In-v3)</td><td>94.1</td><td>81.7</td><td>95.7</td><td>98.3</td><td>94.1</td><td>97.1</td><td>93.5</td></tr><tr><td>DAT (Am-B) </td><td>92.8</td><td>85.1</td><td>95.8</td><td>98.6</td><td>95.3</td><td>96.8</td><td>94.1</td></tr></table>
|
| 151 |
+
|
| 152 |
+
\*Pets results are mean per class accuracy, not accuracy.
|
| 153 |
+
|
| 154 |
+
Quality of Natural Representations. The upstream datasets used to train the experts mostly contain natural images. Consequently, the spectrum of representations offered by our models seem very effective in downstream natural datasets. More concretely, all models lead to improvements over the baseline performance, with average gains ranging from $1 \%$ to over $3 . 3 \%$ on the 7 natural datasets.
|
| 155 |
+
|
| 156 |
+
Full vs. Adapters. JFT Experts. Full models outperform adapters convincingly in NATURAL and SPECIALIZED datasets. However, they do a poor job on STRUCTURED datasets –mainly due to the failure on one specific dataset. ImageNet21k Experts. In this case, the advantage of full experts comes precisely from STRUCTURED datasets. Appendix E provides results broken down by each dataset.
|
| 157 |
+
|
| 158 |
+
Combining All Experts. The previous results suggest adding all types of expert models to the selection pool (full or adapter, trained on JFT or ImageNet), since the optimal expert architecture and upstream data vary per task. Results are remarkable: kNN is able to select good candidates to fine-tune from a pool of almost 600 models, and the relative improvement over the Baseline accuracy across all VTAB datasets is $3 . 6 \%$ , showing gains on all dataset types (see last row in table 2).
|
| 159 |
+
|
| 160 |
+
# 6.6 OUR APPROACH VS. DOMAIN ADAPTIVE TRANSFER
|
| 161 |
+
|
| 162 |
+
Domain Adaptive Transfer (Ngiam et al., 2018) (DAT) also relies on specialist models pre-trained on JFT. First it trains a generalist model on the upstream data, similar to our B. For any new task, then re-weights the upstream images based on a forward pass on the downstream data, and fine-tunes a new specialist model using the re-weighted upstream data. Finally, the model is further tuned on the target task. DAT falls outside of our transfer setup presented in section 5, as the downstream data directly influences the upstream training. This incurs a significant cost learning every new target task.
|
| 163 |
+
|
| 164 |
+
Remarkably, our algorithm works in setups where access to upstream data is not available (e.g. for privacy or proprietary reasons). We also use downstream labels, which proved to carry key information about the task (see section 6.4). And most importantly, our method is more practical by amortizing the cost of expert pre-training as more downstream tasks are served. Under same models and hardware, running kNN (with 240 models) is between $5 0 0 \times - 1 0 0 0 \times$ faster than fine-tuning the baseline model with the re-weighted upstream data. Appendix F includes additional details.
|
| 165 |
+
|
| 166 |
+
Table 3 shows the mean accuracy over 30 trials per dataset, on the same datasets and under a similar hyperparameter budget as DAT. These tasks are close to VTAB’s NATURAL group and yield similar results: full experts outperform adapters. Our results are not directly comparable to those of DAT since they use Inception-v3 (Szegedy et al., 2016), and AmoebaNet-B (Real et al., 2019) architectures. Inception-v3 and R50 are similar in performance and size; the former has 24M parameters, attaining $7 8 . 8 \%$ top-1 on ILSVRC2012 (from-scratch), whereas the latter has 26M parameters and attains $7 6 . 0 \%$ . The AmoebaNet-B $\mathrm { N } { = } 1 8$ , $_ { \mathrm { F } = 5 1 2 }$ ) is 22 times larger, with more than 550M parameters. Despite the differences, our method is competitive and matches or beats DAT in half the datasets.
|
| 167 |
+
|
| 168 |
+
# 7 DISCUSSION
|
| 169 |
+
|
| 170 |
+
Algorithm. Our results suggest that there are strong potential benefits to using smartly routed pretrained experts when the domain of the experts broadly matches that of the downstream tasks. We have clearly seen this with natural images. Instead, as expected, when there is a skill mismatch (e.g. trying to solve a counting task with diverse single-object recognition experts) we have not observed any significant gain or loss. Still, in these cases, the expert selector can fall back on the generic model or representation. When there is an extremely relevant expert for a task –say, our flower or plant models for the Oxford Flowers 102 task–, using full network experts proved beneficial. In contrast, many datasets did not have a perfect match, and adapters seemed easier to fine-tune in these cases.
|
| 171 |
+
|
| 172 |
+
Impact. In the near future, we foresee large computer vision systems composed by a wide range of pre-trained specialist modules. These modules may be based on huge amounts of data, small but high-quality curated repositories, or even on private and proprietary content, and they would cover a diverse spectrum of canonical tasks (object recognition, some way of narrow reasoning, counting, sorting, etc.). Some of them may not even need to be end-to-end learned from data.
|
| 173 |
+
|
| 174 |
+
Future Directions. There are a number of exciting follow-up research directions. Selecting and combining multiple experts for any downstream task is a natural extension of our work. This could be especially useful for tasks that require understanding several concepts, not necessarily captured by a single expert. Per-example routing (i.e. applying routes tailored to each individual data-point) could also lead to improvements based on targeted processing, for example, in the context of tasks with instances of various difficulties. Finally, moving beyond our experts based on label hierarchies, and towards automatic discovering and training of experts could unlock even further gains.
|
| 175 |
+
|
| 176 |
+
# ACKNOWLEDGMENTS
|
| 177 |
+
|
| 178 |
+
We would like to thank Alexander Kolesnikov, Lucas Beyer, Xiaohua Zhai and Jessica Yung, who worked on the original BiT, that we use as baseline, and shared their insights with us. Josip Djolonga and Maxim Neumann provided very useful feedback on an earlier version of this work. Finally, we thank whole Google Brain team in Zürich for many useful discussions and support.
|
| 179 |
+
|
| 180 |
+
# REFERENCES
|
| 181 |
+
|
| 182 |
+
Naomi S Altman. An introduction to kernel and nearest-neighbor nonparametric regression. The American Statistician, 46(3):175–185, 1992.
|
| 183 |
+
|
| 184 |
+
Andreas Argyriou, Theodoros Evgeniou, and Massimiliano Pontil. Multi-task feature learning. In Advances in neural information processing systems, pp. 41–48, 2007.
|
| 185 |
+
|
| 186 |
+
Shai Ben-David, John Blitzer, Koby Crammer, and Fernando Pereira. Analysis of representations for domain adaptation. In Advances in neural information processing systems, pp. 137–144, 2007.
|
| 187 |
+
|
| 188 |
+
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.
|
| 189 |
+
|
| 190 |
+
John Blitzer, Koby Crammer, Alex Kulesza, Fernando Pereira, and Jennifer Wortman. Learning bounds for domain adaptation. In Advances in neural information processing systems, pp. 129–136, 2008.
|
| 191 |
+
|
| 192 |
+
Rich Caruana. Multitask learning. Machine learning, 28(1):41–75, 1997.
|
| 193 |
+
|
| 194 |
+
Wei-Yu Chen, Yen-Cheng Liu, Zsolt Kira, Yu-Chiang Frank Wang, and Jia-Bin Huang. A closer look at few-shot classification. arXiv preprint arXiv:1904.04232, 2019.
|
| 195 |
+
|
| 196 |
+
Wenyuan Dai, Qiang Yang, Gui-Rong Xue, and Yong Yu. Boosting for transfer learning. In Proceedings of the 24th international conference on Machine learning, pp. 193–200, 2007.
|
| 197 |
+
|
| 198 |
+
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.
|
| 199 |
+
|
| 200 |
+
Jeff Donahue, Yangqing Jia, Oriol Vinyals, Judy Hoffman, Ning Zhang, Eric Tzeng, and Trevor Darrell. Decaf: A deep convolutional activation feature for generic visual recognition. In International conference on machine learning, pp. 647–655, 2014.
|
| 201 |
+
|
| 202 |
+
Simon S Du, Jayanth Koushik, Aarti Singh, and Barnabás Póczos. Hypothesis transfer learning via transformation functions. In Advances in neural information processing systems, pp. 574–584, 2017.
|
| 203 |
+
|
| 204 |
+
Nikita Dvornik, Cordelia Schmid, and Julien Mairal. Selecting relevant features from a universal representation for few-shot classification. arXiv preprint arXiv:2003.09338, 2020.
|
| 205 |
+
|
| 206 |
+
David Eigen, Marc’Aurelio Ranzato, and Ilya Sutskever. Learning factored representations in a deep mixture of experts. arXiv preprint arXiv:1312.4314, 2013.
|
| 207 |
+
|
| 208 |
+
Theodoros Evgeniou, Charles A Micchelli, and Massimiliano Pontil. Learning multiple tasks with kernel methods. Journal of machine learning research, 6(Apr):615–637, 2005.
|
| 209 |
+
|
| 210 |
+
William Fedus, Carles Gelada, Yoshua Bengio, Marc G Bellemare, and Hugo Larochelle. Hyperbolic discounting and learning over multiple horizons. arXiv preprint arXiv:1902.06865, 2019.
|
| 211 |
+
|
| 212 |
+
Christiane Fellbaum. Wordnet. The encyclopedia of applied linguistics, 2012.
|
| 213 |
+
|
| 214 |
+
Xavier Glorot, Antoine Bordes, and Yoshua Bengio. Deep sparse rectifier neural networks. In Proceedings of the fourteenth international conference on artificial intelligence and statistics, pp. 315–323, 2011.
|
| 215 |
+
|
| 216 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Identity mappings in deep residual networks. In European Conference on Computer Vision (ECCV), pp. 630–645, 2016a.
|
| 217 |
+
|
| 218 |
+
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, 2016b.
|
| 219 |
+
|
| 220 |
+
Neil Houlsby, Andrei Giurgiu, Stanislaw Jastrzebski, Bruna Morrone, Quentin De Laroussilhe, Andrea Gesmundo, Mona Attariyan, and Sylvain Gelly. Parameter-efficient transfer learning for NLP. arXiv preprint arXiv:1902.00751, 2019.
|
| 221 |
+
|
| 222 |
+
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.
|
| 223 |
+
|
| 224 |
+
Robert A Jacobs and Michael I Jordan. Learning piecewise control strategies in a modular neural network architecture. IEEE Transactions on Systems, Man, and Cybernetics, 23(2):337–345, 1993.
|
| 225 |
+
|
| 226 |
+
Seyoung Kim, Eric P Xing, et al. Tree-guided group lasso for multi-response regression with structured sparsity, with an application to eqtl mapping. The Annals of Applied Statistics, 6(3): 1095–1117, 2012.
|
| 227 |
+
|
| 228 |
+
Alexander Kolesnikov, Lucas Beyer, Xiaohua Zhai, Joan Puigcerver, Jessica Yung, Sylvain Gelly, and Neil Houlsby. Big transfer (BiT): General visual representation learning. arXiv preprint arXiv:1912.11370, 2019.
|
| 229 |
+
|
| 230 |
+
Ilja Kuzborskij and Francesco Orabona. Stability and hypothesis transfer learning. In International Conference on Machine Learning, pp. 942–950, 2013.
|
| 231 |
+
|
| 232 |
+
Yann LeCun, Bernhard Boser, John S Denker, Donnie Henderson, Richard E Howard, Wayne Hubbard, and Lawrence D Jackel. Backpropagation applied to handwritten zip code recognition. Neural computation, 1(4):541–551, 1989.
|
| 233 |
+
|
| 234 |
+
Xiaodong Liu, Jianfeng Gao, Xiaodong He, Li Deng, Kevin Duh, and Ye-Yi Wang. Representation learning using multi-task deep neural networks for semantic classification and information retrieval. In Proceedings of the Annual Conference of the North American Chapter of the Association for Computational Linguistics, 2015.
|
| 235 |
+
|
| 236 |
+
Karim Lounici, Massimiliano Pontil, Alexandre B Tsybakov, and Sara Van De Geer. Taking advantage of sparsity in multi-task learning. arXiv preprint arXiv:0903.1468, 2009.
|
| 237 |
+
|
| 238 |
+
Yishay Mansour, Mehryar Mohri, and Afshin Rostamizadeh. Domain adaptation with multiple sources. In Advances in neural information processing systems, pp. 1041–1048, 2009.
|
| 239 |
+
|
| 240 |
+
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.
|
| 241 |
+
|
| 242 |
+
Jiquan Ngiam, Daiyi Peng, Vijay Vasudevan, Simon Kornblith, Quoc V Le, and Ruoming Pang. Domain adaptive transfer learning with specialist models. arXiv preprint arXiv:1811.07056, 2018.
|
| 243 |
+
|
| 244 |
+
Maxime Oquab, Leon Bottou, Ivan Laptev, and Josef Sivic. Learning and transferring mid-level image representations using convolutional neural networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 1717–1724, 2014.
|
| 245 |
+
|
| 246 |
+
Sinno Jialin Pan and Qiang Yang. A survey on transfer learning. IEEE Transactions on knowledge and data engineering, 22(10):1345–1359, 2009.
|
| 247 |
+
|
| 248 |
+
David Pardoe and Peter Stone. Boosting for regression transfer. In Proceedings of the 27th International Conference on International Conference on Machine Learning, pp. 863–870, 2010.
|
| 249 |
+
|
| 250 |
+
Esteban Real, Alok Aggarwal, Yanping Huang, and Quoc V Le. Regularized evolution for image classifier architecture search. In Proceedings of the aaai conference on artificial intelligence, volume 33, pp. 4780–4789, 2019.
|
| 251 |
+
|
| 252 |
+
Sylvestre-Alvise Rebuffi, Hakan Bilen, and Andrea Vedaldi. Learning multiple visual domains with residual adapters. In Advances in Neural Information Processing Systems, pp. 506–516, 2017.
|
| 253 |
+
|
| 254 |
+
Sylvestre-Alvise Rebuffi, Hakan Bilen, and Andrea Vedaldi. Efficient parametrization of multidomain deep neural networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 8119–8127, 2018.
|
| 255 |
+
|
| 256 |
+
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.
|
| 257 |
+
|
| 258 |
+
Ali Sharif Razavian, Hossein Azizpour, Josephine Sullivan, and Stefan Carlsson. CNN features off-the-shelf: an astounding baseline for recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition workshops, pp. 806–813, 2014.
|
| 259 |
+
|
| 260 |
+
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.
|
| 261 |
+
|
| 262 |
+
Chen Sun, Abhinav Shrivastava, Saurabh Singh, and Abhinav Gupta. Revisiting unreasonable effectiveness of data in deep learning era. In Proceedings of the IEEE international conference on computer vision, pp. 843–852, 2017.
|
| 263 |
+
|
| 264 |
+
Christian Szegedy, Wei Liu, Yangqing Jia, Pierre Sermanet, Scott Reed, Dragomir Anguelov, Dumitru Erhan, Vincent Vanhoucke, and Andrew Rabinovich. Going deeper with convolutions. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2015.
|
| 265 |
+
|
| 266 |
+
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.
|
| 267 |
+
|
| 268 |
+
Chuanqi Tan, Fuchun Sun, Tao Kong, Wenchang Zhang, Chao Yang, and Chunfang Liu. A survey on deep transfer learning. In International conference on artificial neural networks, pp. 270–279. Springer, 2018.
|
| 269 |
+
|
| 270 |
+
Chang Wan, Rong Pan, and Jiefei Li. Bi-weighting domain adaptation for cross-language text classification. In Twenty-Second International Joint Conference on Artificial Intelligence, 2011.
|
| 271 |
+
|
| 272 |
+
Zirui Wang. Theoretical guarantees of transfer learning. arXiv preprint arXiv:1810.05986, 2018.
|
| 273 |
+
|
| 274 |
+
Karl Weiss, Taghi M Khoshgoftaar, and DingDing Wang. A survey of transfer learning. Journal of Big data, 3(1):9, 2016.
|
| 275 |
+
|
| 276 |
+
Yuxin Wu and Kaiming He. Group normalization. In European Conference on Computer Vision (ECCV), September 2018.
|
| 277 |
+
|
| 278 |
+
Qizhe Xie, Eduard Hovy, Minh-Thang Luong, and Quoc V Le. Self-training with noisy student improves imagenet classification. arXiv preprint arXiv:1911.04252, 2019.
|
| 279 |
+
|
| 280 |
+
Yonghui Xu, Sinno Jialin Pan, Hui Xiong, Qingyao Wu, Ronghua Luo, Huaqing Min, and Hengjie Song. A unified framework for metric transfer learning. IEEE Transactions on Knowledge and Data Engineering, 29(6):1158–1171, 2017.
|
| 281 |
+
|
| 282 |
+
I Zeki Yalniz, Hervé Jégou, Kan Chen, Manohar Paluri, and Dhruv Mahajan. Billion-scale semisupervised learning for image classification. arXiv preprint arXiv:1905.00546, 2019.
|
| 283 |
+
|
| 284 |
+
Xi Yan, David Acuna, and Sanja Fidler. Neural data server: A large-scale search engine for transfer learning data, 2020.
|
| 285 |
+
|
| 286 |
+
Xiaohua Zhai, Joan Puigcerver, Alexander Kolesnikov, Pierre Ruyssen, Carlos Riquelme, Mario Lucic, Josip Djolonga, Andre Susano Pinto, Maxim Neumann, Alexey Dosovitskiy, et al. The visual task adaptation benchmark. arXiv preprint arXiv:1910.04867, 2019.
|
| 287 |
+
|
| 288 |
+
Zhanpeng Zhang, Ping Luo, Chen Change Loy, and Xiaoou Tang. Facial landmark detection by deep multi-task learning. In European conference on computer vision, pp. 94–108. Springer, 2014.
|
md/train/4dXmpCDGNp7/4dXmpCDGNp7.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/train/8xoN9ZdSW8/8xoN9ZdSW8.md
ADDED
|
@@ -0,0 +1,240 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Multimodal Virtual Point 3D Detection
|
| 2 |
+
|
| 3 |
+
Tianwei Yin UT Austin yintianwei@utexas.edu
|
| 4 |
+
|
| 5 |
+
Xingyi Zhou UT Austin zhouxy@cs.utexas.edu
|
| 6 |
+
|
| 7 |
+
Philipp Krähenbühl UT Austin philkr@cs.utexas.edu
|
| 8 |
+
|
| 9 |
+
# Abstract
|
| 10 |
+
|
| 11 |
+
Lidar-based sensing drives current autonomous vehicles. Despite rapid progress, current Lidar sensors still lag two decades behind traditional color cameras in terms of resolution and cost. For autonomous driving, this means that large objects close to the sensors are easily visible, but far-away or small objects comprise only one measurement or two. This is an issue, especially when these objects turn out to be driving hazards. On the other hand, these same objects are clearly visible in onboard RGB sensors. In this work, we present an approach to seamlessly fuse RGB sensors into Lidar-based 3D recognition. Our approach takes a set of 2D detections to generate dense 3D virtual points to augment an otherwise sparse 3D point cloud. These virtual points naturally integrate into any standard Lidar-based 3D detectors along with regular Lidar measurements. The resulting multi-modal detector is simple and effective. Experimental results on the large-scale nuScenes dataset show that our framework improves a strong CenterPoint baseline by a significant $6 . 6 \ \mathrm { m A P }$ , and outperforms competing fusion approaches. Code and more visualizations are available at https://tianweiy.github.io/mvp/.
|
| 12 |
+
|
| 13 |
+
# 1 Introduction
|
| 14 |
+
|
| 15 |
+
3D perception is a core component in safe autonomous driving [1, 55]. A 3D Lidar sensor provides accurate depth measurements of the surrounding environment [23, 49, 75], but is costly and has low resolution at long range. A top-of-the-line 64-lane Lidar sensor can easily cost more than a small car with an input resolution that is at least two orders of magnitude lower than a $\$ 50\mathrm { \text R G B }$ sensor. This Lidar sensor receives one or two measurements for small or far away objects, whereas a corresponding RGB sensor sees hundreds of pixels. However, the RGB sensor does not perceive the depth and cannot directly place its measurements into a scene.
|
| 16 |
+
|
| 17 |
+
In this paper, we present a simple and effective framework to fuse 3D Lidar and high-resolution color measurements. We lift RGB measurements into 3D virtual points by mapping them into the scene using close-by depth measurements of a Lidar sensor (See Figure 1 for an example). Our Multi-modal Virtual Point detector, MVP, generates high-resolution 3D point-cloud near target objects. A center-based 3D detector [66] then identifies all objects in the scene. Specifically, MVP uses 2D object detections to crop the original point cloud into instance frustums. MVP then generates dense 3D virtual points near these foreground points by lifting 2D pixels into 3D space. We use depth completion in image space to infer the depth of each virtual point. Finally, MVP combines virtual points with the original Lidar measurements as input to a standard center-based 3D detector [66].
|
| 18 |
+
|
| 19 |
+
Our multi-modal virtual point method has several key advantages: First, 2D object detections are well optimized [17, 74] and highly accurate even for small objects. See Figure 2 for a comparison of two state-of-the-art 2D and 3D detectors on the same scene. The 2D detector has a significantly higher 2D detection accuracy but lacks the necessary 3D information used in the downstream driving task. Secondly, virtual points reduce the density imbalance between close and faraway objects. MVP augments objects at different distances with the same number of virtual points, making the point cloud measurement of these objects more consistent. Finally, our framework is a plug-andplay module to any existing or new 2D or 3D detectors. We test our model on the large-scale nuScenes dataset [2]. Adding multi-modal virtual points brings ${ \bf 6 . 6 \ m A P }$ improvements over a strong CenterPoint baseline [66]. Without any ensembles or test-time augmentation, our best model achieves ${ \bf 6 6 . 4 \ m A P }$ and ${ \bf 7 0 . 5 N D S }$ on nuScenes, outperforming all competing non-ensembled methods on the nuScenes leaderboard at the time of submission.
|
| 20 |
+
|
| 21 |
+

|
| 22 |
+
Figure 1: We augment sparse Lidar point cloud with dense semantic virtual points generated from 2D detections. Left: the augmented point-cloud in the scene. We show the original points in gray and augmented points in red. Right: three cutouts with the origial points on top and virtual points below. The virtual points are up to two orders of magnitude denser.
|
| 23 |
+
|
| 24 |
+
# 2 Related work
|
| 25 |
+
|
| 26 |
+
2D Object Detection has great progress in recent years. Standard approaches include the RCNN family [13, 17, 43] which first predict class-agnostic bounding boxes based on predefined anchor boxes and then classify and refine them in a two-stage fashion with deep neural networks. YOLO [42], SSD [33], and RetinaNet [30] predicts the class specific bounded boxes in one shot. Recent anchorfree detectors like CornerNet [24] and CenterNet [74] directly localize objects through keypoints without the need of predefined anchors. In our approach, we use CenterNet [74] as our 2D detector for its simplicity and superior performance for detecting small objects. See Figure 2 for an example of a 2D detectors output.
|
| 27 |
+
|
| 28 |
+
Lidar-based 3D Object Detection estimates rotated 3D bounding boxes from 3D point clouds [7, 12, 23, 37, 60–63, 65, 76]. 3D detectors share a common output representation and network structure with 2D detectors but encode the input differently. VoxelNet [75] uses a PointNe-based feature extractor to generate a voxel-wise feature representation from which a backbone consisted of sparse 3D convolutions and bird-eye view 2D convolution produces detection outputs. SECOND [60] introduces more efficient sparse convolution operations. PIXOR [61] and PointPillars [23] directly process point clouds in bird-eye view, further improving efficiency. Two-stage 3D detectors [8, 45– 47, 63] use a PointNet-based set abstraction layer [39] to aggregate RoI-specifc features inside first stage proposals to refine outputs. Anchor-free approaches [5, 36, 57, 59, 61, 66] remove the need for axis-aligned bird-eye view anchor boxes. VoteNet [36] detects 3D objects through Hough voting and clustering. CenterPoint [66] proposes a center-based representation for 3D object detection and tracking and achieved state-of-the-art performance on nuScenes and Waymo benchmarks. However, as Figure 2 shows a Lidar-only detector still misses small or far-away objects due to the sparsity of depth measurements. In this work, we build upon the CenterPoint detector and demonstrate significant ${ \bf 6 . 6 \ m A P }$ improvements by adding our multi-modal virtual point approach.
|
| 29 |
+
|
| 30 |
+
Camera-based 3D Object Detection Camera-based 3D object detection predicts 3D bounding boxes from camera images. Mono3D [6] uses the ground-plane assumption to generate 3D candidate boxes and scores the proposals using 2D semantic cues. CenterNet [74] first detects 2D objects in images and predicts the corresponding 3D depth and bounding box attributes using center features. Despite rapid progress, monocular 3D object detectors still perform far behind the Lidar-based methods. On state-of-the-art 3D detection benchmarks [2, 12], state-of-the-art monocular methods [26, 41] achieve about half the mAP detection accuracy, of standard Lidar based baselines [60]. PseudoLidar [56] based methods produce a virtual point cloud from RGB images, similar to our approach. However, they rely on noisy stereo depth estimates [25, 40, 56] while we use more accurate Lidar measurements. Again, the performance of purely color-based approaches lags slightly behind Lidar or fusion-based methods [2, 12].
|
| 31 |
+
|
| 32 |
+

|
| 33 |
+
Figure 2: Comparison between state-of-the-art image-based 2D detector [73] and point cloud based 3D detector [66]. We show detection from the 2D detector in blue and detection from 3D detector in green. For the 3D detector, we project the predicted 3D bounding boxes into images to get the 2D detections. For the 2D detector, we train the model using projected 2D boxes from 3D annotations. Compared to 2D detector, 3D detector often misses faraway or small objects.A quantitative comparison between 2D and 3D detectors is included in Section 5.2.
|
| 34 |
+
|
| 35 |
+
Multi-modal 3D Object Detection fuses information of Lidar and color cameras [20, 28, 28, 29, 35, 37, 53, 67, 71, 72]. Frustum PointNet [38] and Frustum ConvNet [58] first detect objects in image space to identify regions of interest in the point cloud for further processing. It improves the efficiency and precision of 3D detection but is fundamentally limited by the quality of 2D detections. In contrast, we adopt a standard 3D backbone [75] to process the augmented Lidar point cloud, combining the benefit of both sensor modalities. MV3D [7] and AVOD [22] performs object-centric fusion in a two-stage framework. Objects are first detected in each sensor and fused at the proposal stage using RoIPooling [43]. Continuous fusion [20, 29] shares image and Lidar features between their backbones. Closest to our approach are MVX-Net [48], PointAugmenting [54], and PointPainting [52], which utilize point-wise correspondence to annotate each lidar point with image-based segmentation or CNN features. We instead augment the 3D lidar point cloud with additional points surrounding 3D measurements. These additional points make full use of the higher dimensional RGB measurements.
|
| 36 |
+
|
| 37 |
+
Point Cloud Augmentation generates denser point clouds from sparse Lidar measurements. Lidarbased methods like PUNet [69], PUGAN [27], and Wang et al. [64] learn high level point-wise features from raw Lidar scans. They then reconstruct multiple upsampled point clouds from each high dimensional feature vector. Image-based methods [18, 21, 51] perform depth completion from sparse measurements. We build upon these depth completion methods and demonstrate state-of-the-art 3D detection results through point upsampling.
|
| 38 |
+
|
| 39 |
+
# 3 Preliminary
|
| 40 |
+
|
| 41 |
+
Our framework relies on both 2D detection, existing 3D detectors, and a mapping between 2D and 3D. We introduce the necessary concepts and notations below.
|
| 42 |
+
|
| 43 |
+
2D Detection. Let $I$ be a camera image. A 2D object detector aims to localize and classify all objects in $I$ . A bounding-box $b _ { i } \in \mathbb { R } ^ { 4 }$ describes the objects location. A class score $s _ { i } ( c )$ predicts the likelihood of detection $b _ { i }$ to be of class $c$ . An optional instance mask $m _ { i } \in [ 0 , 1 ] ^ { W \times H }$ predicts a pixel-level segmentation of each object. In this paper, we use the popular CenterNet [74] detector. CenterNet detects objects through keypoint estimation. It takes the input image $I$ and predicts a heatmap for each class $c$ . Peaks (local maxima) of the heatmap corresponds to an object. The model regresses to other bounding box attributes using peak features with an L1 [74] or box IoU [44] objective. For instance segmentation, we use CenterNet2 [73] which adds a cascade RoI heads [3] on top of the first stage proposal network. The overall network runs at 40 FPS and achieves 43.3 instance segmentation mAP on the nuScenes image dataset [2].
|
| 44 |
+
|
| 45 |
+
3D Detection. Let $P = \{ ( x , y , z , r ) _ { i } \}$ be a point cloud with 3D location $( x , y , z )$ and reflectance $r$ . The goal of a 3D detector is to predict a set of 3D bounding boxes $\{ b _ { i } \}$ from the point cloud $P$ . The bounding box $b = ( u , v , o , w , \bar { l } , h , \theta )$ includes the 3D center location $( u , v , o )$ , object size $( w , l , h )$ and the yaw rotation along $\mathbf { Z }$ axis $\theta$ . In this paper, we build upon the state-of-the-art CenterPoint [66] detector. We experiment with two popular 3D backbones: VoxelNet [75] and PointPillars [23]. VoxelNet quantizes the irregular point clouds into regular bins followed by a simple average pooling to extract features from all points inside a bin [60]. After that, a backbone consisted of sparse 3D convolutions [14] processes the quantized 3D feature volumes and the output is a map view feature map $M \in \mathbb { R } ^ { \bar { W } \times \bar { H } \times F }$ . PointPillar directly processes point clouds as bird-eye view pillar, a single elongated voxel per map location, and extracts features with fast 2D convolution to get the map view feature map $M$ .
|
| 46 |
+
|
| 47 |
+
With the map view features, a detection head inspired by CenterNet [74] localizes objects in bird-eye view and regress to other box parameters using center features.
|
| 48 |
+
|
| 49 |
+
2D-3D Correspondence. Multi-modal fusion approaches [48, 52, 53, 72] often rely on a pointwise correspondence between 3D point clouds and 2D pixels. In absence of calibration noise, the projection from the 3D Lidar coordinate into a 2D image coordinate involves an SE(3) transformation from the Lidar measurement to the camera frame and a perspective projection from the camera frame into image coordinates. All transformations may be described with homogeneous, time-dependent transformations. Let $t _ { 1 }$ and $t _ { 2 }$ be the capture time of the Lidar measurement and RGB image respectively. Let $T _ { \mathrm { ( c a r l i d a r ) } }$ be the transformation from the Lidar sensor to the reference frame of the car. Let $T _ { ( t _ { 1 } t _ { 2 } ) }$ be the transformation of the car between $t _ { 2 }$ and $t _ { 1 }$ . Let $T _ { \mathrm { ( r g b c a r ) } }$ be the transformation from the cars reference frame to the RGB sensor. Finally, let $P _ { \mathrm { r g b } }$ be the projection matrix of the RGB camera defined by the camera intrinsic. The transformation from the Lidar to RGB sensor is then defined by
|
| 50 |
+
|
| 51 |
+
$$
|
| 52 |
+
T _ { \mathrm { r g b } \mathrm { l i d a r } } ^ { t _ { 1 } t _ { 2 } } = T _ { ( \mathrm { r g b } c a r ) } T _ { ( t _ { 1 } t _ { 2 } ) } T _ { ( \mathrm { c a r } \mathrm { l i d a r } ) } ,
|
| 53 |
+
$$
|
| 54 |
+
|
| 55 |
+
followed by a perspective projection with camear matrix $P _ { \mathrm { r g b } }$ and a perspective division. The perspective division makes the mapping from Lidar to RGB surjective and non-invertible. In the next section, we show how to recover an inverse mapping by using depth measurements of Lidar when mapping RGB to Lidar.
|
| 56 |
+
|
| 57 |
+
# 4 Multimodal Virtual Point
|
| 58 |
+
|
| 59 |
+
Given a set of 2D object detections, we want to generate dense virtual points $\boldsymbol { v } _ { i } = ( x , y , z , \mathbf { e } )$ where $( x , y , z )$ is the 3D location and $\mathbf { e }$ is the semantic feature from the 2D detector. For simplicity, we use the 2D detectors class scores as semantic features. For each detection $b _ { j }$ with associated instance mask $\mathbf { m } _ { j }$ we generate a fixed number $\tau$ multimodal virtual points.
|
| 60 |
+
|
| 61 |
+
Virtual Point Generation. We start by projecting the 3D Lidar point cloud onto our detection. Specifically, we transform each Lidar point $( x , y , z , r ) _ { i }$ into the reference frame of the RGB camera following Equation (1), then project it into image coordinates $\mathbf { p } _ { i }$ with associated depth $d _ { i }$ using a perspective projection. Let the collection of all projected points and depth values for a single detection $j$ be the objects frustum $\mathbf { F } _ { j } = \{ ( \mathbf { p } _ { i } , d _ { i } ) | \mathbf { p } _ { i } \overset { \cdot } { \in } \bar { \mathbf { m } } _ { j } \forall _ { i } \}$ . The frustum only considers projected 3D points $\mathbf { p } _ { i }$ that fall within a detection mask $\mathbf { m } _ { j }$ . Any Lidar measurement outside detection masks is discarded. Next, we generate virtual points from each frustum $\mathbf { F } _ { j }$ .
|
| 62 |
+
|
| 63 |
+
We start by randomly sampling 2D points $\mathbf s \in \mathbf m$ from each instance mask m. We sample $\tau$ points uniformly at random without repetition. For each sampled point $\mathbf { s } _ { k }$ , we retrieve a depth estimate $d _ { k }$ from its nearest neighbor in the frustum $F _ { j }$ : $d _ { k } = \arg \operatorname* { m i n } _ { d _ { i } } \left\| \mathbf { p } _ { i } - \mathbf { s } _ { k } \right\|$ . Given the depth estimate, we unproject the point back into 3D and append the object’s semantic feature $e _ { j }$ to the virtual point. We concatenate the one-hot encoding of the detected class and the detections objectness score in the semantic feature.
|
| 64 |
+
|
| 65 |
+
Algorithm 1: Multi-modal Virtual Point Generation
|
| 66 |
+
|
| 67 |
+
<table><tr><td>Input Hyper parameters :Number of virtual points per object T Output</td><td>:Lidar point cloud L = {(x,y, z,r)i}. Instance masks {m1,...,mn} for n objects. Semantic features {e1,..,en} with ej ∈ RD</td></tr><tr><td>Fj←の ∀j∈{1...n}; for(xi,yi,zi,ri) ∈Ldo /* Perspective projection to 2D point p depth d p,d←Project(PrgbTtda(myi,,1)T);</td><td>: Multi-modal 3D virtual points V ∈ Rn Xτ×(3+D) // Point cloud instance frustums */</td></tr><tr><td>for j ∈{1...n} do ifp∈mj then</td><td></td></tr><tr><td>Fj←FjU{(p,d)}; end</td><td>// Add point to frustum</td></tr><tr><td>end end</td><td></td></tr><tr><td>for j ∈{1...n} do</td><td></td></tr><tr><td>S ← Sample,(mj);</td><td></td></tr><tr><td></td><td></td></tr><tr><td>for s ∈Sdo</td><td></td></tr><tr><td></td><td>// Uniformly sample T 2d points in instance mask</td></tr><tr><td>(p,d) ← NN(s,Fj);</td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td>// Find closest projected 3D point</td></tr><tr><td></td><td></td></tr><tr><td>(PrgbTtiar)</td><td>/* Unproject the 2D point s using the nearest neighbors depth d*/</td></tr><tr><td>q↑(</td><td></td></tr><tr><td></td><td>Unproject(s,d);</td></tr><tr><td>Add (q,ej) to Vj;</td><td></td></tr><tr><td></td><td></td></tr><tr><td>end</td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td>end</td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr></table>
|
| 68 |
+
|
| 69 |
+
The virtual point generation is summarized in Algorithm 1 and Figure 3. Next, we show how to incorporate virtual points into a point-based 3D detector.
|
| 70 |
+
|
| 71 |
+
Virtual Point 3D detection. Voxel-based 3D detectors [60, 66] first voxelize 3D points $( x , y , z ) _ { i }$ and average all point features $( x , y , z , t , r ) _ { i }$ within a voxel. Here $r _ { i }$ is a reflectance measure and $t _ { i }$ is the capture time. A standard 3D convolutional network uses these voxelized features in further processing. For virtual points, this creates an issue. The feature dimensions of real points $( x , y , z , t , r )$ and virtual points differ $( x , y , z , t , \mathbf { e } )$ . A simple solution could be to either concatenate virtual and real points into a larger feature $( x , y , z , t , r , \mathbf { e } )$ and set any missing information to zero. However, this is both wasteful, as the dimension of real points grows by $3 \times$ , and it creates an imbalanced ratio between virtual and real points in different parts of the scene. Furthermore, real measurements are often a bit more precise than virtual points and simple averaging of the two blurs out the information contained in real measurements. To solve this, we modify the average pooling approach by separately averaging features of virtual and real points and concatenating the final averaged features together as input to 3D convolution. For the rest of the architecture, we follow CenterPoint [66].
|
| 72 |
+
|
| 73 |
+
We further use virtual points in a second-stage refinement. Our MVP model generates dense virtual points near target objects which help two-stage refinement [45, 66]. Here, we follow Yin et al. [66] to extract bird-eye view features from all outward surfaces of the predicted 3D box. The main difference to Yin et al. is that our input is much denser around objects, and hence the second stage refinement has access to richer information.
|
| 74 |
+
|
| 75 |
+
# 5 Experiments
|
| 76 |
+
|
| 77 |
+
We evaluate our proposed multimodal virtual point method on the challenging nuScenes benchmark.
|
| 78 |
+
|
| 79 |
+
nuScenes [2] is a popular multimodal autonomous driving datasets for 3D object detection in urban scenes. The dataset contains 1000 driving sequences, with each 20s long and annotated with 3D bounding boxes. The Lidar frequency is $2 0 \mathrm { H z }$ and the dataset provides sensor and vehicle pose information for each Lidar frame but only includes object annotation every ten frames (0.5s). The dataset hides any personally identifiable information, blurs faces and license plates in color images. There are in total 6 RGB cameras at a resolution of $1 6 0 0 \times 9 0 0$ and a capture frequency of $1 2 \mathrm { H z }$ . We follow the official dataset split to use 700, 150, 150 sequences for training, validation, and testing. This in total results in 28130 frames for training, 6019 frames for validation, and 6008 frames for testing. The annotations include a fine-grained label space of ten classes with a long-tail distribution. For 3D object detection, the official evaluation metrics include the mean Average Precision (mAP)[11] and nuScenes detection score (NDS) [2]. mAP measures the localization precision using a threshold based on the birds-eye view center distance $< 0 . 5 \mathrm { m }$ , 1m, 2m, 4m. NDS is a weighted combination of mAP and regression accuracy of other object attributes including box size, orientation, translation, and class-specific attributes [2]. NDS is the main ranking metric for the benchmark.
|
| 80 |
+
|
| 81 |
+

|
| 82 |
+
(a) 2D instance segmentation
|
| 83 |
+
|
| 84 |
+

|
| 85 |
+
(c) Sampling and nearest neighbor matching
|
| 86 |
+
|
| 87 |
+

|
| 88 |
+
(b) Lidar point cloud projection
|
| 89 |
+
|
| 90 |
+

|
| 91 |
+
(d) Reprojected virtual points
|
| 92 |
+
Figure 3: Overview of our mlutimodal virtual point generation framework. We start by extracting 2D instance masks for each object in a color image (a). We then project all Lidar measurements into the reference frame of the RGB camera (b). For visualization purposes, points inside the objects are black, other points are grey. We then sample random points inside each 2D instance mask and retrieve a depth estimate from their nearest neighbor Lidar projection (c). For visualization clarity, (c) only shows a subset of virtual points. Finally, all virtual points are reprojected into the original point-cloud (d).
|
| 93 |
+
|
| 94 |
+
Implementation Details. Our implementation is based on the opensourced code of CenterPoint 1 [66] for 3D detection and CenterNet2 $[ 7 3 ]$ for 2D Detection.
|
| 95 |
+
|
| 96 |
+
For 2D detection, we train a CenterNet [74] detector on the nuScenes image dataset [2]. We use the DLA-34 [68] backbone with deformable convolutions [10]. We add cascade RoI heads [3] for instance segmentation following Zhou et al. [73]. We train the detector on the nuScenes dataset using the SGD optimizer with a batch size of 16 and a learning rate of 0.02 for 90000 iterations.
|
| 97 |
+
|
| 98 |
+
For 3D detection, we use the same VoxelNet [75] and PointPillars [23] architectures following [23, 66, 76]. For VoxelNet, the detection range is $[ - 5 4 m , 5 4 m ]$ for the $X$ , $Y$ axis and $[ - 5 m , 3 m ]$ for the $Z$ axis while the range is $[ - 5 1 . 2 m , 5 1 . 2 m ]$ for the $X$ , $Y$ axis for the PointPillar architecture. The voxel size is $( 0 . 0 7 5 m , 0 . 0 7 5 m , 0 . 2 m )$ and $( 0 . 2 m , 0 . 2 m , 8 m )$ for VoxelNet and PointPillar respectively. For data augmentation, we follow CenterPoint and use global random rotations between $[ - \bar { \pi } / 4 , \pi / 4 ]$ , global random scaling between [0.9, 1.1] and global translations between $[ - 0 . 5 m , 0 . 5 m ]$ . To deal with the long-tail class distribution in nuScenes, we use the ground truth sampling in [60] to randomly paste objects into the current frame [60, 76]. We also adopt the class-balanced resampling and class-grouped heads in [76] to improve the average density of rare classes. We train the model for 20 epochs with the AdamW [34] optimizer using the one-cycle policy [16], with a max learning rate of 3e-3 following [66]. The training takes 2.5 days on 4 V100 GPUs with a batch size of 16 (4 frames per GPU).
|
| 99 |
+
|
| 100 |
+
Table 1: Comparisons with previous methods on nuScenes test set. We show the NDS, mAP, and mAP for each class. Abbreviations are construction vehicle (CV), pedestrian (Ped), motorcycle (Motor), and traffic cone (TC).
|
| 101 |
+
|
| 102 |
+
<table><tr><td>Method</td><td>mAP</td><td>NDS</td><td>Car</td><td>Truck</td><td>Bus</td><td>Trailer</td><td>CV</td><td>Ped</td><td>Motor</td><td>Bicycle</td><td>TC</td><td>Barrier</td></tr><tr><td>PointPillars [23]</td><td>30.5</td><td>45.3</td><td>68.4</td><td>23.0</td><td>28.2</td><td>23.4</td><td>4.1</td><td>59.7</td><td>27.4</td><td>1.1</td><td>30.8</td><td>38.9</td></tr><tr><td>WYSIWYG[19]</td><td>35.0</td><td>41.9</td><td>79.1</td><td>30.4</td><td>46.6</td><td>40.1</td><td>7.1</td><td>65.0</td><td>18.2</td><td>0.1</td><td>28.8</td><td>34.7</td></tr><tr><td>3DSSD [62]</td><td>42.6</td><td>56.4</td><td>81.2</td><td>47.2</td><td>61.4</td><td>30.5</td><td>12.6</td><td>70.2</td><td>36.0</td><td>8.6</td><td>31.1</td><td>47.9</td></tr><tr><td>PMPNet [65]</td><td>45.4</td><td>53.1</td><td>79.7</td><td>33.6</td><td>47.1</td><td>43.1</td><td>18.1</td><td>76.5</td><td>40.7</td><td>7.9</td><td>58.8</td><td>48.8</td></tr><tr><td>PointPainting [52]</td><td>46.4</td><td>58.1</td><td>77.9</td><td>35.8</td><td>36.2</td><td>37.3</td><td>15.8</td><td>73.3</td><td>41.5</td><td>24.1</td><td>62.4</td><td>60.2</td></tr><tr><td>CBGS [76]</td><td>52.8</td><td>63.3</td><td>81.1</td><td>48.5</td><td>54.9</td><td>42.9</td><td>10.5</td><td>80.1</td><td>51.5</td><td>22.3</td><td>70.9</td><td>65.7</td></tr><tr><td>CVCNet [4]</td><td>55.3</td><td>64.4</td><td>82.7</td><td>46.1</td><td>46.6</td><td>49.4</td><td>22.6</td><td>79.8</td><td>59.1</td><td>31.4</td><td>65.6</td><td>69.6</td></tr><tr><td>HotSpotNet [5]</td><td>59.3</td><td>66.0</td><td>83.1</td><td>50.9</td><td>56.4</td><td>53.3</td><td>23.0</td><td>81.3</td><td>63.5</td><td>36.6</td><td>73.0</td><td>71.6</td></tr><tr><td>CenterPoint [66]</td><td>58.0</td><td>65.5</td><td>84.6</td><td>51.0</td><td>60.2</td><td>53.2</td><td>17.5 83.4</td><td></td><td>53.7</td><td>28.7</td><td>76.7</td><td>70.9</td></tr><tr><td>MVP (Ours)</td><td>66.4</td><td>70.5</td><td>86.8</td><td>58.5</td><td>67.4</td><td>57.3</td><td>26.1</td><td>89.1</td><td>70.0</td><td>49.3</td><td>85.0</td><td>74.8</td></tr></table>
|
| 103 |
+
|
| 104 |
+
During the testing, we set the output threshold to be 0.05 for the 2D detector and generate 50 virtual points for each 2D object in the scene. We use an output threshold of 0.1 for the 3D detector after performing non-maxima suppression with an IoU threshold of 0.2 following CenterPoint [66].
|
| 105 |
+
|
| 106 |
+
# 5.1 State-of-the-art Comparison
|
| 107 |
+
|
| 108 |
+
We first compare with state-of-the-art approaches on the nuScenes test set. We obtain all results on the public leaderboard by submitting our predictions to an online evaluation server. The submission uses a single MVP model without any ensemble or test-time augmentations. We compare to other methods under the same setting. Table 1 summarizes our results. On the nuScenes dataset, MVP achieves state-of-the-art results of $6 6 . 4 \ : \mathrm { m A P }$ and $7 0 . 5 \ : \mathrm { N D S }$ , outperforming the strong CenterPoint baseline by $8 . 4 \mathrm { m A P }$ and 5.0 NDS. MVP shows consistent improvements across all object categories with significant $1 1 \mathrm { m A P }$ accuracy boosts for small objects $( + 2 0 . 6$ for Bicycle and $+ 1 6 . 3$ for motorcycle). These results clearly verify the effectiveness of our multi-modal virtual point approach.
|
| 109 |
+
|
| 110 |
+
# 5.2 Ablation Studies
|
| 111 |
+
|
| 112 |
+
Comparison of 2D and 3D Detector. We first validate the superior detection performance of the camera-based 2D detector compared to the Lidar-based 3D detector. Specifically, we use two state-ofthe-art object detectors: CenterPoint [66] for Lidar-based 3D detection, and CenterNet [74] for imagebased 2D detection. To compare the performance of detectors working in different modalities, we project the predicted 3D bounding boxes into the image space to get the corresponding 2D detections. The 2D CenterNet detector is trained with projected 2D boxes from ground truth 3D annotations. Table 2 summarizes the results over the whole nuScenes validation set. 2D CenterNet [74] significantly outperforms the CenterPoint model by $9 . 8 \mathrm { m A P }$ (using 2D overlap). The improvements are larger for smaller objects with a $1 2 . 6 \mathrm { m A P }$ improvement for objects of medium size and more than $3 \times$ accuracy improvements for small objects $6 . 9 \mathrm { m A P }$ vs. $1 . 6 \mathrm { m A P }$ ). See Figure 2 for a qualitative visualization of these two detectors’ outputs. These results support our motivations for utilizing high-resolution image information to improve 3D detection models with sparse Lidar input.
|
| 113 |
+
|
| 114 |
+
Table 2: Quantitative comparison between state-of-the-art image-based 2D detector [74] and point cloud based 3D detector [66] on the nuScenes validation set measuring 2D detection accuracy (AP). The comparison use the COCO [31] style mean average precision with 2D IoU threshold between 0.5 and 0.95 in image coordinates. For 3D CenterPoint [66] detector, we project the predicted 3D bounding boxes into images to get the 2D detections. The results show that the 2D detector performs significantly better than Lidar-based 3D detector at localizing small or medium size objects due to high resolution camera input.
|
| 115 |
+
|
| 116 |
+
<table><tr><td>Method</td><td>APsmall</td><td>APmedium</td><td>APlarge</td><td>AP</td></tr><tr><td>CenterPoint [66]</td><td>1.6</td><td>11.7</td><td>34.5</td><td>22.7</td></tr><tr><td>CenterNet [74]</td><td>6.9</td><td>24.3</td><td>42.6</td><td>32.5</td></tr></table>
|
| 117 |
+
|
| 118 |
+
Table 3: Component analysis of our MVP model with VoxelNet [60, 75] and PointPillars [23] backbones on nuScenes validation set.
|
| 119 |
+
|
| 120 |
+
<table><tr><td>Encoder</td><td>Baseline</td><td>Virtual Point</td><td>Split Voxelization</td><td>Two-stage</td><td>mAP↑</td><td>NDS↑</td></tr><tr><td rowspan="5">VoxelNet</td><td>?</td><td></td><td></td><td></td><td>59.6</td><td>66.8</td></tr><tr><td></td><td></td><td></td><td>√</td><td>60.5</td><td>67.4</td></tr><tr><td>√</td><td>√</td><td></td><td></td><td>65.9</td><td>69.6</td></tr><tr><td>√</td><td>√</td><td></td><td></td><td>66.0</td><td>70.0</td></tr><tr><td>√</td><td>√</td><td>√</td><td>厂</td><td>67.1</td><td>70.8</td></tr><tr><td rowspan="2">PointPillars</td><td>广</td><td></td><td></td><td></td><td>52.3</td><td>61.3</td></tr><tr><td></td><td>√</td><td></td><td></td><td>62.7</td><td>66.1</td></tr></table>
|
| 121 |
+
|
| 122 |
+
Component Analysis. Next, we ablate our contributions on the nuScenes validation set. We use the Lidar-only CenterPoint [74] model as our baseline. All hyperparameters and training procedures are the same between all baselines. We change inputs (MVP or regular points), voxelization, or an optional second stage. Table 3 shows the importance of each component of our MVP model. Simply augmenting the Lidar point cloud with multi-modal virtual points gives a $6 . 3 \ \mathrm { m A P }$ and $1 0 . 4 \ \mathrm { m A P }$ improvements for VoxelNet and PointPillars encoder, respectively. For the VoxelNet encoder, split voxelization gives another $0 . 4 ~ \mathrm { N D S }$ improvements due to the better modeling of features inside a voxel. Moreover, two-stage refinement with surface center features brings another $1 . 1 \ \mathrm { m A P }$ and $0 . 8 ~ \mathrm { N D S }$ improvements over our first stage models with small overheads $( 1 - 2 \mathrm { m s } )$ . The improvement of two-stage refinement is slightly larger with virtual points than without. This highlights the effectiveness of our virtual point method to create a finer local structure for better localization and regression using two-stage point-based detection.
|
| 123 |
+
|
| 124 |
+
Performance Breakdown. To better understand the improvements of our MVP model, we show the performance comparisons on different subsets of the nuScenes validation set based on object distances to the ego-vehicle. We divide all ground truth annotations and predictions into three ranges: $0 { - } 1 5 \mathrm { m }$ , $1 5 { - } 3 0 \mathrm { m }$ , and $3 0 { - } 5 0 \mathrm { m }$ . The baselines include both the Lidar-only two-stage CenterPoint [66] model and the state-of-the-art multi-modal fusion method PointPainting [52]. We reimplement PointPainting using the same 2D detections, backbones, and tricks (including two-stage) as our MVP approach. The main difference to PointPainting [52] is our denser Lidar inputs with multimodal virtual points. Table 4 shows the results. Our MVP model outperforms the Lidar-only baseline by $6 . 6 \mathrm { m A P }$ while achieving a significant $1 0 . 1 \mathrm { m A P }$ improvement for faraway objects. Compared to PointPainting [52], our model achieve a $1 . 1 \mathrm { m A P }$ improvement for faraway objects and performs comparatively for closer objects. This improvement comes from the dense and fine-grained 3D structure generated from our MVP framework. Our method makes better use of the higher dimensional RGB measurements than the simple point-wise semantic feature concatenation as used in prior works [48, 52].
|
| 125 |
+
|
| 126 |
+
Robustness to 2D Detection We investigate the impact of 2D instance segmentation quality on the final 3D detection performance. With the same image network, we simulate the degradation of 2D segmentation performance with smaller input resolutions. We show the results in Table 5. Our
|
| 127 |
+
|
| 128 |
+
MVP model is robust to the quality of 2D instance segmentation. The 3D detection performance only decreases by $0 . 8 \mathrm { N D S }$ with a 9 point worse instance segmentation inputs.
|
| 129 |
+
|
| 130 |
+
Depth Estimation Accuracy We further quantify the depth estimation quality of our nearest neighbor-based depth interpolation algorithm. We choose objects with at least 15 lidar points and randomly mask out $80 \%$ of the points. We then generate virtual points from the projected locations of the masked out lidar points and compute the a bi-directional pointwise chamfer distance between virtual points and masked out real lidar points. Our nearest neighbor approach has bi-directional chamfer distance of 0.33 meter on the nuScenes validation set. We believe more advanced learning based approaches like [18] and [21] may further improve the depth completion and 3D detection performance.
|
| 131 |
+
|
| 132 |
+
KITTI Results To test the generalization of our method, we add an experiment on the popular KITTI dataset [12]. For 2D detection, we use a pretrained MaskFormer [9] model to generate the instance segmentation masks and create 100 virtual points for each 2D object in the scene. For 3D detection, we use the popular PointPillars [23] detector with augmented point cloud inputs. All other parameters are the same as the default PointPillars model. As shown in Table 6, augmenting the Lidar point cloud with our multimodal virtual points gives a $0 . 5 \mathrm { m A P }$ and $2 . 3 \mathrm { m A P }$ for vehicle and cyclist class, respectively. We didn’t notice an improvement for the pedestrian class, presumable due to inconsistent pedestrian definition between our image model (trained on COCO [32]) and the 3D detector. On COCO, people inside a vehicle or on top of a bike are all considered to be pedestrians while KITTI 3D detectors treat them as vehicle or cyclist.
|
| 133 |
+
|
| 134 |
+
Table 4: Comparisons between Lidar-only CenterPoint [66] method, fusion-based PointPainting [52] method (denoted as CenterPoint $^ +$ Ours(w/o virtual)), and our multimodal virtual point method for detecting objects of different ranges. All three entries use the VoxelNet backbone. We split the nuScenes validation set into three subsets containing objects at different ranges.
|
| 135 |
+
|
| 136 |
+
<table><tr><td rowspan="2">Method</td><td colspan="4">nuScenes mAP</td></tr><tr><td>0-15m</td><td>15-30m</td><td>30-50m</td><td>Overall</td></tr><tr><td>CenterPoint [66]</td><td>76.2</td><td>60.3</td><td>37.2</td><td>60.5</td></tr><tr><td>CenterPoint + Ours(w/o virtual)</td><td>78.2</td><td>67.4</td><td>46.2</td><td>66.5</td></tr><tr><td>CenterPoint + Ours</td><td>78.1</td><td>67.7</td><td>47.3</td><td>67.1</td></tr></table>
|
| 137 |
+
|
| 138 |
+
Table 5: Influence of 2D instance segmentation quality for the final 3D detection performance. We show the input resolution, 2D detection mAP, and 3D detection nuScenes detection score (NDS).
|
| 139 |
+
|
| 140 |
+
<table><tr><td>Resolution</td><td>2D mAP</td><td>NDS</td></tr><tr><td>900</td><td>43.3</td><td>70.0</td></tr><tr><td>640</td><td>39.5</td><td>69.6</td></tr><tr><td>480</td><td>34.2</td><td>69.2</td></tr></table>
|
| 141 |
+
|
| 142 |
+
Table 6: Comparison between Lidar-only PointPillars detector and our multimodal virtual point method for 3D detection on KITTI dataset. We show the 3D detection mean average precision for each class under the moderate difficulty level.
|
| 143 |
+
|
| 144 |
+
<table><tr><td>Method</td><td>Car</td><td>Cyclist</td><td>Pedestrian</td></tr><tr><td>PointPillars [23]</td><td>77.3</td><td>62.7</td><td>52.3</td></tr><tr><td>PointsPillars+Ours</td><td>77.8</td><td>65.0</td><td>50.5</td></tr></table>
|
| 145 |
+
|
| 146 |
+
# 6 Discussion and conclusions
|
| 147 |
+
|
| 148 |
+
We proposed a simple multi-modal virtual point approach for outdoor 3D object detection. The main innovation is a multi-modal virtual point generation algorithm that lifts RGB measurements into
|
| 149 |
+
|
| 150 |
+

|
| 151 |
+
Figure 4: Example qualitative results of MVP on the nuScenes validation set. We show the raw point-cloud in blue, our detected objects in green bounding boxes, and Lidar points inside bounding boxes in red. Best viewed on screen.
|
| 152 |
+
|
| 153 |
+
3D virtual points using close-by measurements of a Lidar sensor. Our MVP framework generates high-resolution 3D point clouds near target objects and enables more accurate localization and regression, especially for small and faraway objects. The model significantly improves the strong Lidar-only CenterPoint detector and sets a new state-of-the-art on the nuScenes benchmark. Our framework seamlessly integrates into any current or future 3D detection algorithms.
|
| 154 |
+
|
| 155 |
+
There are still certain limitations with the current approach. Firstly, we assume that virtual points have the same depth as close-by Lidar measurements. This may not hold in the real world. Objects like cars don’t have a planar shape vertical to the ground plane. In the future, we plan to apply learning-based methods [50, 70] to infer the detailed 3D shape and pose from both Lidar measurements and image features. Secondly, our current two-stage refinement modules only use features from the bird-eye view which may not take full advantage of the high-resolution virtual points generated from our algorithm. We believe point or voxel-based two-stage 3D detectors like PVRCNN [45] and M3Detr [15] may give more significant improvements. Finally, the point-based abstraction connecting 2D and 3D detection may introduce too large of a bottleneck to transmit information from 2D to 3D. For example, no pose information is contained in our current position $^ +$ class based MVP features.
|
| 156 |
+
|
| 157 |
+
Overall, we believe future methods for scalable 3D perception can benefit from the interplay of camera and Lidar sensor inputs via dense semantic virtual points.
|
| 158 |
+
|
| 159 |
+
Societal Impacts. First and foremost better 3D detection and tracking will lead to safer autonomous vehicles. However, in the short term, it may lead to earlier adoption of potentially not-yet safe autonomous vehicles, and misleading error rates in 3D detection may lead to real-world accidents. Fusing multiple modalities may also increase the iteration cycle and safety testing requirements of autonomous vehicles, as different modalities clearly adapt differently to changes in weather, geographic locations, or even day-night cycles. A low sun may uniquely distract an RGB sensor, and hence unnecessarily distract a 3D detector through MVPs.
|
| 160 |
+
|
| 161 |
+
Furthermore, increasing the reliance of autonomous vehicles on color sensors introduces privacy issues. While most human beings look indistinguishable in 3D Lidar measurements, they are clearly identifiable in color images. In the wrong hands, this additional data may be used for mass surveillance.
|
| 162 |
+
|
| 163 |
+
Acknowledgement We thank the anonymous reviewers for the constructive comments. This material is based upon work supported by the National Science Foundation under Grant No. IIS-1845485 and IIS-2006820.
|
| 164 |
+
|
| 165 |
+
References
|
| 166 |
+
[1] Mayank Bansal, Alex Krizhevsky, and Abhijit Ogale. Chauffeurnet: Learning to drive by imitating the best and synthesizing the worst. RSS, 2019.
|
| 167 |
+
[2] Holger Caesar, Varun Bankiti, Alex H. Lang, Sourabh Vora, Venice Erin Liong, Qiang Xu, Anush Krishnan, Yu Pan, Giancarlo Baldan, and Oscar Beijbom. nuscenes: A multimodal dataset for autonomous driving. CVPR, 2020.
|
| 168 |
+
[3] Zhaowei Cai and Nuno Vasconcelos. Cascade r-cnn: Delving into high quality object detection. CVPR, 2018. [4] Qi Chen, Lin Sun, Ernest Cheung, Kui Jia, and Alan Yuille. Every view counts: Cross-view consistency in 3d object detection with hybrid-cylindrical-spherical voxelization. NeurIPS, 2020.
|
| 169 |
+
[5] Qi Chen, Lin Sun, Zhixin Wang, Kui Jia, and Alan Yuille. Object as hotspots: An anchor-free 3d object detection approach via firing of hotspots. ECCV, 2020.
|
| 170 |
+
[6] Xiaozhi Chen, Kaustav Kundu, Ziyu Zhang, Huimin Ma, Sanja Fidler, and Raquel Urtasun. Monocular 3d object detection for autonomous driving. CVPR, 2016.
|
| 171 |
+
[7] Xiaozhi Chen, Huimin Ma, Ji Wan, Bo Li, and Tian Xia. Multi-view 3d object detection network for autonomous driving. CVPR, 2017.
|
| 172 |
+
[8] Yilun Chen, Shu Liu, Xiaoyong Shen, and Jiaya Jia. Fast point r-cnn. ICCV, 2019.
|
| 173 |
+
[9] Bowen Cheng, Alexander G Schwing, and Alexander Kirillov. Per-pixel classification is not all you need for semantic segmentation. arXiv preprint arXiv:2107.06278, 2021.
|
| 174 |
+
[10] Jifeng Dai, Haozhi Qi, Yuwen Xiong, Yi Li, Guodong Zhang, Han Hu, and Yichen Wei. Deformable convolutional networks. ICCV, 2017.
|
| 175 |
+
[11] Mark Everingham, Luc Van Gool, Christopher KI Williams, John Winn, and Andrew Zisserman. The pascal visual object classes (voc) challenge. IJCV, 2010.
|
| 176 |
+
[12] Andreas Geiger, Philip Lenz, and Raquel Urtasun. Are we ready for autonomous driving? the kitti vision benchmark suite. CVPR, 2012.
|
| 177 |
+
[13] Ross Girshick. Fast r-cnn. ICCV, 2015.
|
| 178 |
+
[14] Benjamin Graham, Martin Engelcke, and Laurens van der Maaten. 3d semantic segmentation with submanifold sparse convolutional networks. CVPR, 2018.
|
| 179 |
+
[15] Tianrui Guan, Jun Wang, Shiyi Lan, Rohan Chandra, Zuxuan Wu, Larry Davis, and Dinesh Manocha. M3detr: Multi-representation, multi-scale, mutual-relation 3d object detection with transformers. arXiv preprint arXiv:2104.11896, 2021.
|
| 180 |
+
[16] Sylvain Gugger. The 1cycle policy. https://sgugger.github.io/the-1cycle-policy. html, 2018.
|
| 181 |
+
[17] Kaiming He, Georgia Gkioxari, Piotr Dollár, and Ross Girshick. Mask r-cnn. ICCV, 2017.
|
| 182 |
+
[18] Mu Hu, Shuling Wang, Bin Li, Shiyu Ning, Li Fan, and Xiaojin Gong. Penet: Towards precise and efficient image guided depth completion. 2021.
|
| 183 |
+
[19] Peiyun Hu, Jason Ziglar, David Held, and Deva Ramanan. What you see is what you get: Exploiting visibility for 3d object detection. CVPR, 2020.
|
| 184 |
+
[20] Tengteng Huang, Zhe Liu, Xiwu Chen, and Xiang Bai. Epnet: Enhancing point features with image semantics for 3d object detection. ECCV, 2020.
|
| 185 |
+
[21] Saif Imran, Xiaoming Liu, and Daniel Morris. Depth completion with twin surface extrapolation at occlusion boundaries. pages 2583–2592, 2021.
|
| 186 |
+
[22] Jason Ku, Melissa Mozifian, Jungwook Lee, Ali Harakeh, and Steven L Waslander. Joint 3d proposal generation and object detection from view aggregation. IROS, 2018.
|
| 187 |
+
[23] Alex H. Lang, Sourabh Vora, Holger Caesar, Lubing Zhou, Jiong Yang, and Oscar Beijbom. Pointpillars: Fast encoders for object detection from point clouds. CVPR, 2019.
|
| 188 |
+
[24] Hei Law and Jia Deng. Cornernet: Detecting objects as paired keypoints. ECCV, 2018.
|
| 189 |
+
[25] Peiliang Li, Xiaozhi Chen, and Shaojie Shen. Stereo r-cnn based 3d object detection for autonomous driving. CVPR, 2019.
|
| 190 |
+
[26] Peixuan Li, Huaici Zhao, Pengfei Liu, and Feidao Cao. Rtm3d: Real-time monocular 3d detection from object keypoints for autonomous driving. arXiv preprint arXiv:2001.03343, 2, 2020.
|
| 191 |
+
[27] Ruihui Li, Xianzhi Li, Chi-Wing Fu, Daniel Cohen-Or, and Pheng-Ann Heng. Pu-gan: a point cloud upsampling adversarial network. pages 7203–7212, 2019.
|
| 192 |
+
[28] Ming Liang, Bin Yang, Yun Chen, Rui Hu, and Raquel Urtasun. Multi-task multi-sensor fusion for 3d object detection. CVPR, 2019.
|
| 193 |
+
[29] Ming Liang, Bin Yang, Shenlong Wang, and Raquel Urtasun. Deep continuous fusion for multi-sensor 3d object detection. ECCV, 2018.
|
| 194 |
+
[30] Tsung-Yi Lin, Priya Goyal, Ross Girshick, Kaiming He, and Piotr Dollar. Focal loss for dense object detection. ICCV, 2017.
|
| 195 |
+
[31] 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. ECCV, 2014.
|
| 196 |
+
[32] 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. ECCV, 2014.
|
| 197 |
+
[33] Wei Liu, Dragomir Anguelov, Dumitru Erhan, Christian Szegedy, Scott Reed, Cheng-Yang Fu, and Alexander C Berg. Ssd: Single shot multibox detector. ECCV, 2016.
|
| 198 |
+
[34] Ilya Loshchilov and Frank Hutter. Decoupled weight decay regularization. ICLR, 2019.
|
| 199 |
+
[35] Su Pang, Daniel Morris, and Hayder Radha. Clocs: Camera-lidar object candidates fusion for 3d object detection. arXiv preprint arXiv:2009.00784, 2020.
|
| 200 |
+
[36] Charles R. Qi, Or Litany, Kaiming He, and Leonidas Guibas. Deep hough voting for 3d object detection in point clouds. ICCV, 2019.
|
| 201 |
+
[37] Charles R. Qi, Wei Liu, Chenxia Wu, Hao Su, and Leonidas J. Guibas. Frustum pointnets for 3d object detection from rgb-d data. CVPR, 2018.
|
| 202 |
+
[38] Charles R Qi, Wei Liu, Chenxia Wu, Hao Su, and Leonidas J Guibas. Frustum pointnets for 3d object detection from rgb-d data. CVPR, 2018.
|
| 203 |
+
[39] Charles Ruizhongtai Qi, Li Yi, Hao Su, and Leonidas J Guibas. Pointnet++: Deep hierarchical feature learning on point sets in a metric space. NeurIPS, 2017.
|
| 204 |
+
[40] Rui Qian, Divyansh Garg, Yan Wang, Yurong You, Serge Belongie, Bharath Hariharan, Mark Campbell, Kilian Q Weinberger, and Wei-Lun Chao. End-to-end pseudo-lidar for image-based 3d object detection. CVPR, 2020.
|
| 205 |
+
[41] Cody Reading, Ali Harakeh, Julia Chae, and Steven L Waslander. Categorical depth distribution network for monocular 3d object detection. arXiv preprint arXiv:2103.01100, 2021.
|
| 206 |
+
[42] Joseph Redmon and Ali Farhadi. Yolo9000: better, faster, stronger. CVPR, 2017.
|
| 207 |
+
[43] Shaoqing Ren, Kaiming He, Ross Girshick, and Jian Sun. Faster r-cnn: Towards real-time object detection with region proposal networks. NIPS, 2015.
|
| 208 |
+
[44] Hamid Rezatofighi, Nathan Tsoi, JunYoung Gwak, Amir Sadeghian, Ian Reid, and Silvio Savarese. Generalized intersection over union: A metric and a loss for bounding box regression. CVPR, 2019.
|
| 209 |
+
[45] Shaoshuai Shi, Chaoxu Guo, Li Jiang, Zhe Wang, Jianping Shi, Xiaogang Wang, and Hongsheng Li. Pv-rcnn: Point-voxel feature set abstraction for 3d object detection. CVPR, 2020.
|
| 210 |
+
[46] Shaoshuai Shi, Xiaogang Wang, and Hongsheng Li. Pointrcnn: 3d object proposal generation and detection from point cloud. CVPR, 2019.
|
| 211 |
+
[47] Shaoshuai Shi, Zhe Wang, Jianping Shi, Xiaogang Wang, and Hongsheng Li. From points to parts: 3d object detection from point cloud with part-aware and part-aggregation network. TPAMI, 2020.
|
| 212 |
+
[48] Vishwanath A Sindagi, Yin Zhou, and Oncel Tuzel. Mvx-net: Multimodal voxelnet for 3d object detection. ICRA, 2019.
|
| 213 |
+
[49] Pei Sun, Henrik Kretzschmar, Xerxes Dotiwalla, Aurelien Chouard, Vijaysai Patnaik, Paul Tsui, James Guo, Yin Zhou, Yuning Chai, Benjamin Caine, et al. Scalability in perception for autonomous driving: An open dataset benchmark. CVPR, 2020.
|
| 214 |
+
[50] Shubham Tulsiani, Abhishek Kar, João Carreira, and Jitendra Malik. Learning category-specific deformable 3d models for object reconstruction. TPAMI, 2017.
|
| 215 |
+
[51] Jonas Uhrig, Nick Schneider, Lukas Schneider, Uwe Franke, Thomas Brox, and Andreas Geiger. Sparsity invariant cnns. pages 11–20, 2017.
|
| 216 |
+
[52] Sourabh Vora, Alex H Lang, Bassam Helou, and Oscar Beijbom. Pointpainting: Sequential fusion for 3d object detection. CVPR, 2020.
|
| 217 |
+
[53] Chunwei Wang, Chao Ma, Ming Zhu, and Xiaokang Yang. Pointaugmenting: Cross-modal augmentation for 3d object detection. CVPR, 2021.
|
| 218 |
+
[54] Chunwei Wang, Chao Ma, Ming Zhu, and Xiaokang Yang. Pointaugmenting: Cross-modal augmentation for 3d object detection. pages 11794–11803, June 2021.
|
| 219 |
+
[55] Dequan Wang, Coline Devin, Qi-Zhi Cai, Philipp Krähenbühl, and Trevor Darrell. Monocular plan view networks for autonomous driving. IROS, 2019.
|
| 220 |
+
[56] Yan Wang, Wei-Lun Chao, Divyansh Garg, Bharath Hariharan, Mark Campbell, and Kilian Q Weinberger. Pseudo-lidar from visual depth estimation: Bridging the gap in 3d object detection for autonomous driving. CVPR, 2019.
|
| 221 |
+
[57] Yue Wang, Alireza Fathi, Abhijit Kundu, David Ross, Caroline Pantofaru, Tom Funkhouser, and Justin Solomon. Pillar-based object detection for autonomous driving. ECCV, 2020.
|
| 222 |
+
[58] Zhixin Wang and Kui Jia. Frustum convnet: Sliding frustums to aggregate local point-wise features for amodal 3d object detection. arXiv preprint arXiv:1903.01864, 2019.
|
| 223 |
+
[59] Kelvin Wong, Shenlong Wang, Mengye Ren, Ming Liang, and Raquel Urtasun. Identifying unknown instances for autonomous driving. CORL, 2019.
|
| 224 |
+
[60] Yan Yan, Yuxing Mao, and Bo Li. Second: Sparsely embedded convolutional detection. Sensors, 2018.
|
| 225 |
+
[61] Bin Yang, Wenjie Luo, and Raquel Urtasun. Pixor: Real-time 3d object detection from point clouds. CVPR, 2018.
|
| 226 |
+
[62] Zetong Yang, Yanan Sun, Shu Liu, and Jiaya Jia. 3dssd: Point-based 3d single stage object detector. CVPR, 2020.
|
| 227 |
+
[63] Zetong Yang, Yanan Sun, Shu Liu, Xiaoyong Shen, and Jiaya Jia. Std: Sparse-to-dense 3d object detector for point cloud. ICCV, 2019.
|
| 228 |
+
[64] Wang Yifan, Shihao Wu, Hui Huang, Daniel Cohen-Or, and Olga Sorkine-Hornung. Patch-based progressive 3d point set upsampling. pages 5958–5967, 2019.
|
| 229 |
+
[65] Junbo Yin, Jianbing Shen, Chenye Guan, Dingfu Zhou, and Ruigang Yang. Lidar-based online 3d video object detection with graph-based message passing and spatiotemporal transformer attention. CVPR, 2020.
|
| 230 |
+
[66] Tianwei Yin, Xingyi Zhou, and Philipp Krähenbühl. Center-based 3d object detection and tracking. CVPR, 2021.
|
| 231 |
+
[67] Jin Hyeok Yoo, Yecheol Kim, Ji Song Kim, and Jun Won Choi. 3d-cvf: Generating joint camera and lidar features using cross-view spatial feature fusion for 3d object detection. arXiv preprint arXiv:2004.12636, 3, 2020.
|
| 232 |
+
[68] Fisher Yu, Dequan Wang, Evan Shelhamer, and Trevor Darrell. Deep layer aggregation. CVPR, 2018.
|
| 233 |
+
[69] Lequan Yu, Xianzhi Li, Chi-Wing Fu, Daniel Cohen-Or, and Pheng-Ann Heng. Pu-net: Point cloud upsampling network. pages 2790–2799, 2018.
|
| 234 |
+
[70] Wentao Yuan, Tejas Khot, David Held, Christoph Mertz, and Martial Hebert. Pcn: Point completion network. 3DV, 2018.
|
| 235 |
+
[71] Haolin Zhang, Dongfang Yang, Ekim Yurtsever, Keith A Redmill, and Ümit Özgüner. Farawayfrustum: Dealing with lidar sparsity for 3d object detection using fusion. arXiv preprint arXiv:2011.01404, 2020.
|
| 236 |
+
[72] Wenwei Zhang, Zhe Wang, and Chen Change Loy. Multi-modality cut and paste for 3d object detection. arXiv preprint arXiv:2012.12741, 2020.
|
| 237 |
+
[73] Xingyi Zhou, Vladlen Koltun, and Philipp Krähenbühl. Probabilistic two-stage detection. arXiv preprint arXiv:2103.07461, 2021.
|
| 238 |
+
[74] Xingyi Zhou, Dequan Wang, and Philipp Krähenbühl. Objects as points. arXiv:1904.07850, 2019.
|
| 239 |
+
[75] Yin Zhou and Oncel Tuzel. Voxelnet: End-to-end learning for point cloud based 3d object detection. CVPR, 2018.
|
| 240 |
+
[76] Benjin Zhu, Zhengkai Jiang, Xiangxin Zhou, Zeming Li, and Gang Yu. Class-balanced grouping and sampling for point cloud 3d object detection. arXiv:1908.09492, 2019.
|
md/train/B1l4SgHKDH/B1l4SgHKDH.md
ADDED
|
@@ -0,0 +1,369 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# RESIDUAL ENERGY-BASED MODELS FOR TEXT GENERATION
|
| 2 |
+
|
| 3 |
+
Yuntian Deng1, Anton Bakhtin2, Myle $\mathbf { O t t } ^ { 2 }$ , Arthur Szlam2, Marc’Aurelio Ranzato2
|
| 4 |
+
Harvard University1
|
| 5 |
+
Facebook AI Research2
|
| 6 |
+
dengyuntian@seas.harvard.edu {yolo,myleott,aszlam,ranzato}@fb.com
|
| 7 |
+
|
| 8 |
+
# ABSTRACT
|
| 9 |
+
|
| 10 |
+
Text generation is ubiquitous in many NLP tasks, from summarization, to dialogue and machine translation. The dominant parametric approach is based on locally normalized models which predict one word at a time. While these work remarkably well, they are plagued by exposure bias due to the greedy nature of the generation process. In this work, we investigate un-normalized energy-based models (EBMs) which operate not at the token but at the sequence level. In order to make training tractable, we first work in the residual of a pretrained locally normalized language model and second we train using noise contrastive estimation. Furthermore, since the EBM works at the sequence level, we can leverage pretrained bi-directional contextual representations, such as BERT and RoBERTa. Our experiments on two large language modeling datasets show that residual EBMs yield lower perplexity compared to locally normalized baselines. Moreover, generation via importance sampling is very efficient and of higher quality than the baseline models according to human evaluation.
|
| 11 |
+
|
| 12 |
+
# 1 INTRODUCTION
|
| 13 |
+
|
| 14 |
+
The dominant approach to parametric text generation is based on large neural auto-regressive models (Radford et al., 2019). These models can be trained efficiently via maximum likelihood and they can efficiently generate samples of remarkable quality. Key to their success is local normalization, i.e. they are defined in terms of a product of conditional distributions, one for each token in the sequence. Such distributions are relatively cheap to compute with modern hardware given the limited vocabulary size of common sub-word units like BPE (Sennrich et al., 2015).
|
| 15 |
+
|
| 16 |
+
Unfortunately, local normalization also brings some drawbacks. First, the designer of the model needs to specify the order in which tokens are generated. Second, at training time the model is conditioned on ground truth context while at test time it is conditioned on its own generations, a discrepancy referred to as exposure bias (Ranzato et al., 2016). Finally, while heuristics like beam search somewhat help rescore at the sequence level, generation generally lacks long-range coherency because it is produced by the greedy selection of one token at a time without lookahead.
|
| 17 |
+
|
| 18 |
+
Energy-based models (EBMs) (Hinton, 2002; LeCun et al., 2006; Ranzato et al., 2007) are a more general framework which potentially address all these issues, as they do not require any local normalization. They only require the definition of an energy function defined over the whole input sequence. Training aims at shaping the energy function such that regions of high density of training data points have lower energy than elsewhere. In principle, EBMs are ideal for modeling text as they can score the whole input at once, they are not prone to label bias (Bottou, 1991) and they may enable generation of large chunks of text, which should help improve coherency.
|
| 19 |
+
|
| 20 |
+
However, so far EBMs had limited application in text generation, because sampling from the model is intractable, and so is maximum likelihood training. The problem is that shaping the energy function is accomplished by updating the model parameters such that the energy is decreased at the training data points (a.k.a. positive examples) and increased at other data points (a.k.a. negative examples). In maximum likelihood training negatives are generated from the model, but in text application we cannot use gradient-based MCMC methods (Teh et al., 2003; Du & Mordatch, 2019) and Gibbs sampling (Welling et al., 2005) is too slow to be practical. Generating negatives by local perturbations of the ground truth would be efficient but hardly useful for generation purposes, when at test time the model needs to generate from scratch.
|
| 21 |
+
|
| 22 |
+
Recently, Bakhtin et al. (2019) carefully studied the problem of training a discriminator to distinguish human written text from language model generations. They experimented with different language model and discriminator architectures, training/test time corpora and concluded that the discriminator can generalize rather well to weaker language models when the training/test corpora match. Bakhtin et al. (2019) found that the learned discriminator is not robust to random perturbations, and argued that the discriminator operates in the “residual” space of the language model.
|
| 23 |
+
|
| 24 |
+
Concurrently, Grover et al. (2019) proposed a general approach to “de-bias” a generator, by simply training a discriminator and using its output for importance sampling.
|
| 25 |
+
|
| 26 |
+
In this work, we build upon these two works. First, we formalize the residual interpretation by Bakhtin et al. (2019) and use a generative model of the form:
|
| 27 |
+
|
| 28 |
+
$$
|
| 29 |
+
P _ { \theta } ( x ) \propto P _ { L M } ( x ) \exp ( - E _ { \theta } ( x ) )
|
| 30 |
+
$$
|
| 31 |
+
|
| 32 |
+
where $P _ { L M } ( x )$ is a locally normalized language model which is fixed during training, and $E _ { \theta }$ is the energy function parameterized by $\theta$ . The resulting model $P _ { \theta } ( x )$ is globally normalized due to the energy term. Note that the same residual formulation was also used in Rosenfeld et al. (2001); Wang & Ou (2018b); Parshakova et al. (2019).
|
| 33 |
+
|
| 34 |
+
This formulation has multi-fold benefits. First, by incorporating a locally normalized language model, we can leverage recent advancements in locally normalized language modeling. Second, the language model provides a natural proposal distribution for training (Bakhtin et al., 2019), and training can be made efficient by using the conditional noise contrastive estimation objective (Gutmann & Hyvarinen, 2010) as we shall see in ¨ $\ S 3$ . Lastly, this formulation enables efficient evaluation and generation via importance sampling (Horvitz & Thompson, 1952; Grover et al., 2019).
|
| 35 |
+
|
| 36 |
+
In some sense, this last point is perhaps the central contribution of the paper, as it allows estimating perplexity of the residual EBM, and thus allows these EBMs to be compared in a standard way to other models. Indeed, in $\ S 4$ we show that our joint model decreases perplexity on two large datasets, when compared to various auto-regressive language model baselines. Finally, the EBM generations are significantly preferred by humans according to our qualitative evaluation. To the best of our knowledge, this is the first time that an EBM has demonstrated improved generation ability against very strong auto-regressive baselines, both in terms of estimated perplexity and through human evaluation.
|
| 37 |
+
|
| 38 |
+
# 2 RELATED WORK
|
| 39 |
+
|
| 40 |
+
Energy-based models have a long history in machine learning (Hopfield, 1982; Hinton, 2002; LeCun et al., 2006; Ranzato et al., 2007). The key challenge of training is mining for good negatives. This can be accomplished explicitly by fantasizing inputs where the energy should be increased or implicitly via global constraints such as sparsity (Ranzato et al., 2007). Methods attempting at maximizing the likelihood of the data require to sample from the distribution induced by the model. Unfortunately, gradient-based MCMC approaches like Hybrid Monte Carlo (Teh et al., 2003) and Langevyn dynamics (Ranzato et al., 2007; Du & Mordatch, 2019; Xie et al., 2016; 2017; 2019; 2018; Gao et al., 2018; Nijkamp et al., 2019) are not applicable when the input is discrete like in text applications. Other approaches like Gibbs sampling (Hinton, 2002) were applied to binary inputs but do not scale well to large dictionaries once the energy function is a large bidirectional transformer model like the one used in this work. Several variants of auto-encoders have also been investigated for representing and generating text (Bowman et al., 2016; Zhao et al., 2018), but they have not shown significant improvements in terms of perplexity and they have so far been applied to relatively small datasets only.
|
| 41 |
+
|
| 42 |
+
Our approach appears similar to discriminative reranking approaches used in the parsing and machine translation community (Shen et al., 2004). However, our approach provides a generative model, and parameters/hyper-parameters are directly tuned to close the gap between the model distribution and the data distribution, rather than relying on surrogate ranking losses. This approach is also related to other sequence level training objectives (Edunov et al., 2018), with the major difference that in those works training aims at improving the baseline model, but generation at test time is still greedy.
|
| 43 |
+
|
| 44 |
+
Energy Networks have been used for sequence modeling (Rosenfeld et al., 2001; Wang et al., 2015; 2017; Wang & Ou, 2017; 2018a; Parshakova et al., 2019). In particular, our residual modeling form and the training algorithm is the same as in Wang & Ou (2018b), where they used an LSTM as the generator and a CNN-LSTM as the energy function, and showed significant gains compared to LSTM baselines in speech recognition. Our work builds on these prior works and develops new lower and upper bounds for the log-probability under the joint model, which makes it possible to show that the residual EBM approach gets better perplexity. We also develop an importance weighting sampling scheme used at generation time, which is focused on conditional generation as opposed to rescoring in speech recognition (Wang & Ou, 2018b). The residual EBM formalism makes it very natural to use BERT for language modeling, and we show that empirically this type of approach can outperform modern state-of-the-art language modeling baselines, both in terms of perplexity, and through human evaluation.
|
| 45 |
+
|
| 46 |
+
Generative Adversarial Networks (Goodfellow et al., 2014) also relate to EBMs, except that in EBMs the generator is implicit and negatives samples are produced by the discriminator itself. In our work, the pretrained locally normalized language model can be seen as a fixed generator, like in Bakhtin et al. (2019). Azadi et al. (2018) also share our same goal but their generator is not locally normalized and they propose to improve the sampling from the generator by using the discriminator for rejection sampling. Similar to our work, Grover et al. (2019) propose to use the discriminator to de-bias the pretrained generator using importance sampling. We adapt this work to the application of text generation. In particular, we adopt the conditional noise contrastive estimation (NCE) objective (Ma & Collins, 2018; Gutmann & Hyvarinen, 2010) to our residual model energy function and ¨ then sample from the joint model using importance sampling. We want to note that the same formulation has been proposed in (Wang & Ou, 2018b; Parshakova et al., 2019). While Ma & Collins (2018) used conditional NCE to predict the next word in a sequence, we apply it to produce a whole sequence at once with the pretrained auto-regressive language model as the noise distribution.
|
| 47 |
+
|
| 48 |
+
# 3 RESIDUAL ENERGY-BASED MODELS
|
| 49 |
+
|
| 50 |
+
We study the problem of conditional generation of discrete sequences. Given a prefix $x _ { 1 } , \cdots , x _ { p }$ with $x _ { j } \in V$ where $V$ is the vocabulary, we want to model the probabilities of generating a sequence of total length $T > p ^ { 1 }$ . The generative model is:
|
| 51 |
+
|
| 52 |
+
$$
|
| 53 |
+
P _ { \theta } ( x _ { p + 1 } , \cdot \cdot \cdot , x _ { T } | x _ { 1 } , \cdot \cdot \cdot , x _ { p } ) = \frac { P _ { L M } ( x _ { p + 1 } , \cdot \cdot \cdot , x _ { T } | x _ { 1 } , \cdot \cdot \cdot , x _ { p } ) \exp ( - E _ { \theta } ( x _ { 1 } , \cdot \cdot \cdot , x _ { T } ) ) } { Z _ { \theta } ( x _ { 1 } , \cdot \cdot \cdot , x _ { p } ) }
|
| 54 |
+
$$
|
| 55 |
+
|
| 56 |
+
where $Z _ { \theta } ( x _ { 1 } , \cdots , x _ { p } )$ is a normalizing factor known as partition function. Computing the partition function is intractable in our case since it involves a sum over $| V | ^ { T - p }$ terms which grow exponentially with the sequence length: in our experiments the size of the vocabulary is 50,096 and the length of the generation is 40 tokens. We call $P _ { \theta }$ the joint model, and $E _ { \theta }$ the residual energy function since $P _ { L M }$ is fixed throughout training. The goal of training is to learn the parameters of the energy function such that the joint model distribution gets close to the data distribution. For the sake of reducing clutter in the notation, we will drop the conditioning variables in the following discussion.
|
| 57 |
+
|
| 58 |
+
# 3.1 TRAINING
|
| 59 |
+
|
| 60 |
+
When the partition function is intractable, Maximum Likelihood Estimation (MLE) requires samples from the model distribution, which is usually approximated with Monte Carlo sampling or mean field inference (Hinton, 2012; LeCun et al., 2006) for globally normalized models. Unfortunately, both approaches are too computationally expensive for text applications when using large bidirectional transformer models. For instance, if we were to employ Gibbs sampling exactly, we would need to perform at every position as many forward passes as words in the dictionary to compute each conditional distribution. On large datasets where training locally normalized models on multiple machines already takes days, having such additional overhead means that the model would learn from much less data for the same amount of time, and this is seldom a beneficial strategy for learning models that generalize well. Therefore, we do not use either MCMC nor mean field methods, as the latter would introduce additional variational parameters or an inference network which anyway yields an approximation to MLE learning.
|
| 61 |
+
|
| 62 |
+
Instead, we train our residual energy function using Noise Contrastive Estimation (NCE) (Gutmann & Hyvarinen, 2010), and more specifically its conditional version (Ma & Collins, 2018). NCE ¨ requires two distributions: The model distribution and a noise distribution. In our case, the model distribution is the joint model of Eq. 2, $P _ { \theta }$ , while the noise distribution is the pretrained language model, $P _ { L M }$ . NCE then trains a binary classifier on the difference of log-probability scores of these two models. Since our joint model is the product of the energy function (whose parameters we want to learn) with $P _ { L M }$ , the difference reduces to: $\log P _ { \theta } - \log P _ { L M } = - E _ { \theta }$ . Therefore, under these modeling assumptions of residual learning and noise model, the objective function becomes:
|
| 63 |
+
|
| 64 |
+
$$
|
| 65 |
+
\operatorname* { m a x } \mathbb { E } _ { x _ { + } \sim P _ { d a t a } } \log { \frac { 1 } { 1 + \exp ( E _ { \theta } ( x _ { + } ) ) } } + \mathbb { E } _ { x _ { - } \sim P _ { L M } } \log { \frac { 1 } { 1 + \exp ( - E _ { \theta } ( x _ { - } ) ) } }
|
| 66 |
+
$$
|
| 67 |
+
|
| 68 |
+
where $x _ { + }$ is a positive sequence taken from the human generated training set, and $x _ { - }$ is a negative sequence drawn from $P _ { L M }$ (for a given ground truth prefix). In other words, training the energy function reduces to training a binary classifier to discriminate between real text and text generated by an auto-regressive language model. The aim of training is to assign as negative energy as possible to real data, and as positive energy as possible to machine generated data. Interestingly, the role of positive and negative samples is totally symmetric in this loss function, $\ S 5$ will discuss the consequences of this.
|
| 69 |
+
|
| 70 |
+
With the theoretical guarantee of NCE, we can show that the optimum of the above objective is reached at data distribution with infinite amount of data and model with enough capacity, which is also proved in Ma & Collins $( 2 0 1 8 ) ^ { 2 }$ .
|
| 71 |
+
|
| 72 |
+
Theorem 1. If $P _ { L M }$ has the same support as $P _ { d a t a }$ , then the objective function in Eq. 3 reaches its maximum at $\log P _ { L M } ( x ) - E _ { \theta } ( x ) = \log P _ { d a t a } ,$ , if there exists such $\theta$ .
|
| 73 |
+
|
| 74 |
+
Proof. This theorem directly follows from the proof in Gutmann & Hyvarinen (2010). Note that at ¨ optimum, $P _ { L M } ( x ) \exp ( - \dot { E _ { \theta } } ( x ) )$ is self-normalizing: instead of $P _ { \theta } ( \dot { x } ) \propto P _ { L M } ( x ) \exp ( - E _ { \theta } ( x ) )$ , we have $P _ { \theta } ( x ) = P _ { L M } ( x ) \exp ( - E _ { \theta } ( x ) )$ . However, we still need to estimate the partition function throughout the rest of this paper, since we cannot guarantee that this optimum can be reached.
|
| 75 |
+
|
| 76 |
+
# 3.2 EVALUATION
|
| 77 |
+
|
| 78 |
+
A commonly used protocol for evaluating generative sequence models, especially language models, is perplexity (PPL), which is equal to $\begin{array} { r } { 2 ^ { - } \frac { \overline { { 1 } } } { T - p } \sum _ { i = p + 1 } ^ { T } \log _ { 2 } ^ { - } P ( x _ { i } | x _ { i - 1 } , \cdots , x _ { 1 } ) } \end{array}$ . PPL can be interpreted as the average number of tokens the model is uncertain of at every time step. Since the log-likelihood required by PPL relies on estimating the partition function $\begin{array} { r } { \dot { Z } _ { \theta } = \dot { \sum _ { x } ^ { } } \dot { P _ { L M } } ( x ) \exp ( - E _ { \theta } ( x ) ) = } \end{array}$ $\mathbb { E } _ { x \sim P _ { L M } } \exp ( - E _ { \theta } ( x ) )$ , we derive two estimators for the log-partition function $\log Z _ { \theta }$ based on the work of Nowozin (2018).
|
| 79 |
+
|
| 80 |
+
Theorem 2. Denote $P _ { L M } ( i = 1 , \cdots , n )$ : $T _ { n }$ $\begin{array} { r } { T _ { n } = \log \frac { 1 } { n } \sum _ { i = 1 } ^ { n } \exp ( - E ( \dot { x } _ { i } ) ) } \end{array}$ as the empirical estimate of l $\begin{array} { r } { \log \mathbb { E } _ { x \sim P _ { L M } } \exp ( - E ( x ) ) } \end{array}$ x∼, then $\forall \epsilon > 0$ , $\exists N > 0$ such that with n samples $\forall n > N$ $x _ { i } \sim$ i we have
|
| 81 |
+
|
| 82 |
+
$$
|
| 83 |
+
Z _ { \theta } - \epsilon < \mathbb { E } [ T _ { n } ] < Z _ { \theta } < \mathbb { E } [ ( 2 n - 1 ) T _ { n } - 2 ( n - 1 ) T _ { n - 1 } ] < Z _ { \theta } + \epsilon
|
| 84 |
+
$$
|
| 85 |
+
|
| 86 |
+
The proof is given in Appendix A.2.
|
| 87 |
+
|
| 88 |
+
We can use the above two estimators to estimate the lower and upper bounds of the partition function, but we want to emphasize that they are true only asymptotically (when $n$ is sufficiently large). We also want to note that to get lower variance estimates we use leave-one-out strategy to estimate $T _ { n - 1 }$ . See Nowozin (2018) for implementation details and methods to improve numeric stability.
|
| 89 |
+
|
| 90 |
+
Similarly to locally normalized models, we can also factorize the probabilities of an entire sequence step by step, as $\begin{array} { r } { P ( x ) \ = \ \prod _ { t = 1 } ^ { T } P ( x _ { t } | x _ { < t } ) } \end{array}$ , and evaluate the PPL for each generation step. By marginalizing over the future, we can derive the following per step probabilities:
|
| 91 |
+
|
| 92 |
+
Algorithm 1: Top-k Joint Sampling
|
| 93 |
+
|
| 94 |
+
<table><tr><td>Input:number of samples n drawn from PLM,value of k in top-k // Get a set of samples from PLM sample n samples {x1,... ,xn} from PLm with top-k sampling calculate energies si = Eθ(x𝑖) for each xt ∈ {x1,.. ,xn}</td></tr><tr><td>// Resample from the set of LM samples exp(-s²)</td></tr><tr><td>sample x = x² with probability∑=p(s) return x</td></tr></table>
|
| 95 |
+
|
| 96 |
+
$$
|
| 97 |
+
P ( x _ { t } | x _ { < t } ) = P _ { L M } ( x _ { t } | x _ { < t } ) \frac { \mathbb { E } _ { x _ { t + 1 } ^ { \prime } , \cdots , x _ { T } ^ { \prime } \sim P _ { L M } ( \cdot | x _ { \le t } ) } [ \exp ( - E _ { \theta } ( x _ { \le t } , x _ { t + 1 } ^ { \prime } , \cdots , x _ { T } ^ { \prime } ) ) ] } { \mathbb { E } _ { x _ { t } ^ { \prime } , \cdots , x _ { T } ^ { \prime } \sim P _ { L M } ( \cdot | x _ { \le t - 1 } ) } [ \exp ( - E _ { \theta } ( x _ { \le t - 1 } , x _ { t } ^ { \prime } , \cdot \cdot \cdot , x _ { T } ^ { \prime } ) ) ] } .
|
| 98 |
+
$$
|
| 99 |
+
|
| 100 |
+
The step-wise probabilities in Eq. 5 are an instance of importance sampling (Horvitz & Thompson, 1952). The basic $P _ { L M }$ distribution is adjusted by the probability assigned to token $x _ { t }$ by the energy function (numerator is clamped at $x _ { t }$ while denominator sums over all the possible values of the token at position t), with the additional marginalization over all subsequent tokens up to the horizon $T$ . Since the summation involves exponentially many terms, unless $t = T$ , this is approximated by samples drawn by $P _ { L M }$ . Since both the numerator and the denominator take the same form as the partition function, we also use Eq. 4 to estimate the upper and lower bounds. E.g., the lower bound of $\log P ( x _ { t } | x _ { < t } )$ can be obtained by using the lower bound of the numerator and the upper bound of the denominator.
|
| 101 |
+
|
| 102 |
+
For $t = T$ , we can calculate the log probability by exhaustive enumeration. This gives us an idea of the true performance of our model at the last step, and it also provides a sanity-check of the tightness of our estimators.
|
| 103 |
+
|
| 104 |
+
# 3.3 GENERATION
|
| 105 |
+
|
| 106 |
+
Generating from the joint model is a non-trivial task. A naive way is to generate from the joint model auto-regressively, by marginalizing the future as in Eq. 5, which we term Top-k auto-regressive sampling. However, doing so is computationally expensive and impractical, and we only use this method for a qualitative analysis of the joint model in Appendix A.1.
|
| 107 |
+
|
| 108 |
+
In order to generate efficiently, we use self-normalizing importance sampling (Owen, 2013; Grover et al., 2019). Under the assumptions that the model from which we wish to draw samples is the joint model, which is the product of the auto-regressive model and the energy function, and that the proposal distribution is the auto-regressive model itself, sampling proceeds simply by: a) sampling from the auto-regressive language model, followed by b) resampling according to the energy function. The algorithm is shown in Algorithm 1, where we introduce an optional top- $\mathbf { \nabla } \cdot \mathbf { k }$ constraint on the pretrained language model to improve the quality of samples in the set3. Without the top- $\mathbf { \nabla } \cdot \mathbf { k }$ constraint, as the number of samples goes to infinity, we would recover exact samples from the joint model distribution.
|
| 109 |
+
|
| 110 |
+
# 4 EXPERIMENTS
|
| 111 |
+
|
| 112 |
+
In this section, we describe the experimental set up and the results we obtained by using the residual EBM for text generation, both in terms of perplexity and generation quality.
|
| 113 |
+
|
| 114 |
+
# 4.1 EXPERIMENTAL SETUP
|
| 115 |
+
|
| 116 |
+
Datasets We consider two datasets: the Toronto Book Corpus (Zhu et al., 2015; Kiros et al., 2015) and CC-News (Bakhtin et al., 2019). The former dataset consists of fiction books in 16 different genres, totaling about half a billion words. The latter is a de-duplicated subset of the English portion of the CommonCrawl news dataset (Nagel, 2016), which totals around 16 Billion words. The book corpus is more challenging because the range of style and topics is more diverse than CC-News. Also, the book corpus is 30 times smaller than CC-News and may pose generalization challenges because of its smaller size.
|
| 117 |
+
|
| 118 |
+
In all our experiments we use a prefix of size 120 tokens and we generate the following 40 tokens; with the notation of Eq. 2, $p = 1 2 0$ and $T = 1 6 0$ . For training the joint models, for efficiency we generated 16/128 samples per prefix for CC-News/Book Corpus offline, and sample uniformly from those samples at training time.
|
| 119 |
+
|
| 120 |
+
Baselines We consider as base language model (BASE LM) used to generate negatives for the residual EBM, a transformer language model with 12 layers, $h = 1 6$ , $d _ { m o d e l } = 1 0 2 4$ , $d _ { f f } = 4 0 9 6$ (we refer to Vaswani et al. (2017) for notations). This is also our first baseline model.
|
| 121 |
+
|
| 122 |
+
The joint model has as many parameters as the sum of the number of parameters in the base LM and the number of parameters in the energy network. To make a fair comparison, we consider two additional baselines that have the same number of parameters as our joint model.
|
| 123 |
+
|
| 124 |
+
The first baseline is a Residual Auto-regressive Language Model baseline (RALM):
|
| 125 |
+
|
| 126 |
+
$$
|
| 127 |
+
\log P _ { R A L M } ( x _ { t } | \boldsymbol x _ { < t } ) = \log P _ { L M } ( x _ { t } | \boldsymbol x _ { < t } ) + \log P _ { \phi } ( x _ { t } | \boldsymbol x _ { < t } ) + c o n s t
|
| 128 |
+
$$
|
| 129 |
+
|
| 130 |
+
where $P _ { \phi }$ takes the form of another auto-regressive language model. The parameters of $P _ { \phi }$ are trained by exact maximum likelihood training of $P _ { R A L M }$ .
|
| 131 |
+
|
| 132 |
+
The second baseline is an auto-regressive language model of the same size of our joint model (sum of the base LM and energy function parameters), we dub this model Big Auto-regressive Language Model (BALM). BALM has 12 layers, $h = 1 6$ , $d _ { m o d e l } = 1 5 6 8$ , $d _ { f f } = 6 2 7 2$ , and is trained by standard token level cross-entropy loss.
|
| 133 |
+
|
| 134 |
+
Residual EBM Architecture We consider two architectures for our residual EBM, both of them are based on transformers (Vaswani et al., 2017; Devlin et al., 2018). The first version uses causal self-attention and is derived from the base LM, a unidirectional transformer (UNIT). It is of the same architecture as BASE LM, except that in the final layer we project the mean-pooled hidden states to a scalar energy value. We initialize its parameters with a language model trained on the same dataset.
|
| 135 |
+
|
| 136 |
+
The second version is instead bi-directional (BIT), and the energy function is computed by projecting the mean-pooled top hidden states down to a single scalar value. We consider three variants, a BIT-BASE following the architecture of RoBERTa-Base, and a BIT-LARGE $^ *$ following RoBERTaLarge (Liu et al., 2019), and a BIT-MED with the same number of parameters as UNIT (such that JOINT BIT-MED has roughly the same number of parameters as $\mathrm { B A L M } ) ^ { 4 }$ . We initialize the parameters with a trained BERT, and we use $^ *$ to mark usage of external data, otherwise it means that BERT was trained on our training set. Notice how our model can be interpreted as a natural way to finetune large bidirectional pretrained models for the text generation task.
|
| 137 |
+
|
| 138 |
+
While we expect BIT to yield better results because it can fully leverage context also for intermediate tokens, we also consider UNIT to compare to the RALM baseline, which uses the same architecture and only differs in the way parameters are trained and in the presence of local normalization.
|
| 139 |
+
|
| 140 |
+
We train our models on 8 DGX nodes, each with 8 Nvidia V100s. To improve training speed, we use mixed precision training5. We use the Adam optimizer, with cosine learning rate decay and learning rate warmup. To stabilize training we used gradient norm clipping (Pascanu et al., 2013). Detailed hyper-parameter settings can be found in Appendix A.3.
|
| 141 |
+
|
| 142 |
+
For generation, we use top-k sampling with $k = 1 0$ for all human evaluations. We take 10,000 samples from BASE LM for our joint sampling.
|
| 143 |
+
|
| 144 |
+
# 4.2 RESULTS
|
| 145 |
+
|
| 146 |
+
<table><tr><td rowspan="2">Model (#parameters)</td><td colspan="2">CC-News</td><td colspan="2">Toronto Book Corpus</td></tr><tr><td>Val</td><td>Test</td><td>Val</td><td>Test</td></tr><tr><td>BASE LM (203M)</td><td>18.41</td><td>17.57</td><td>16.16</td><td>18.29</td></tr><tr><td>RALM (LM+203M)</td><td>17.01</td><td>16.17</td><td>15.71</td><td>17.85</td></tr><tr><td>BALM (408M)</td><td>16.50</td><td>15.74</td><td>15.00</td><td>16.99</td></tr><tr><td>JOINT UNIT (LM+203M)</td><td>16.42-16.44</td><td>15.57-15.58</td><td>15.12-15.13</td><td>16.98-17.00</td></tr><tr><td>JOINT BIT-BASE (LM+125M)</td><td>15.32-15.35</td><td>14.61-14.64</td><td>-</td><td>=</td></tr><tr><td>JOINT BIT-BASE*(LM+125M)</td><td>15.11-15.17</td><td>14.37-14.42</td><td>14.14-14.16</td><td>15.72-15.74</td></tr><tr><td>JOINT BIT-LARGE* (LM+355M)</td><td>14.59-14.61</td><td>13.97-14.00</td><td>13.80-13.83</td><td>15.33-15.36</td></tr><tr><td>BASE LM-24L (203M)</td><td>15.71</td><td>14.89</td><td>15.61</td><td>18.14</td></tr><tr><td>RALM-24L (LM-24L+203M)</td><td>15.70</td><td>14.89</td><td>15.63</td><td>18.17</td></tr><tr><td>BALM-24L (408M)</td><td>14.58</td><td>13.92</td><td>15.20</td><td>18.24</td></tr><tr><td>JOINT UNIT (LM-24L+203M)</td><td>14.59-14.61</td><td>13.81-13.82</td><td>15.12- 15.16</td><td>17.46-17.48</td></tr><tr><td>JOINT BIT-BASE (LM-24L+125M)</td><td>13.68-13.69</td><td>13.01-13.03</td><td>1</td><td></td></tr><tr><td>JOINT BIT-BASE* (LM-24L+125M)</td><td>13.60-13.62</td><td>12.93-12.95</td><td>14.11-14.12</td><td>16.17-16.18</td></tr><tr><td>JOINT BIT-MED (LM-24L+203M)</td><td>12.97-13.01</td><td>12.38-12.42</td><td>1</td><td>=</td></tr><tr><td>JOINT BIT-LARGE* (LM-24L+355M)</td><td>12.71-12.77</td><td>12.10-12.16</td><td>13.30-13.34</td><td>15.17-15.22</td></tr></table>
|
| 147 |
+
|
| 148 |
+
Table 1: Validation and test perplexity on CC-News and Toronto Book Corpus. \* denotes models initialized with RoBERTa trained on additional data. The joint model perplexity ranges are estimated using 100,000 samples, see Eq. 4. The number of parameters of each model is shown in parentheses.
|
| 149 |
+
|
| 150 |
+

|
| 151 |
+
Figure 1: Perplexity gain of JOINT BIT-MED and JOINT BIT-LARGE $^ *$ (using BASE LM-24L) at each position relative to BASE LM-24L on the test set of CC-News. At each position the lower and upper bounds (Eq. 5 estimated using the method in Eq. 4, see $\ S 3 . 2$ for more details) are estimated using 20,000 samples. The shorter the horizon (moving to the right), the tighter the estimation is but also the more limited the gains compared to base LM as un-normalized models are most useful on longer generations.
|
| 152 |
+
|
| 153 |
+
Automatic Evaluation Our main result is reported in Table 1 where we compare models in terms of their perplexity. We can see that on both datasets, residual EBMs with causal attention JOINT UNIT outperforms the baseline RALM with approximately the same number of parameters. The non-residual baseline BALM performs similarly to JOINT UNIT, which might be due to the limitation that $P _ { L M }$ is not trained jointly with the residual model in both JOINT UNIT and RALM. However, by using our EBM approach, we can remove the causal attention mask and use bi-directional models, which achieves better performance than baselines and JOINT UNIT: without external data, JOINT BIT-BASE reaches a higher performance than JOINT UNIT with fewer parameters. By initializing from the state-of-the-art pretrained bi-directional transformers RoBERTa-Base and RoBERTaLarge, JOINT BIT-BASE\* and JOINT BIT-LARGE\* reach even better performance than JOINT BITBASE.
|
| 154 |
+
|
| 155 |
+
Table 2: Human evaluation results on a subset of 333 sentences on the CC-News test set. The rate is computed as the percentage of sentences where the number of turkers preferring Model1 is strictly less than (denoted with $< )$ or not greater than (denoted with $\leq$ ) those preferring Model2. Attention check is used to drop some votes, so there might exist ties. p-value is based on single-sided binomial test.
|
| 156 |
+
|
| 157 |
+
<table><tr><td>Modell (baseline)</td><td>Model2 (compared model)</td><td>Rate</td><td>p-value</td></tr><tr><td>BASE LM</td><td>JOINT UNIT</td><td>52.85%</td><td>0.16</td></tr><tr><td>BASE LM</td><td>JOINT BIT-BASE</td><td>56.25%</td><td>0.015</td></tr><tr><td>BASE LM</td><td>JOINT BIT-LARGE*</td><td>58.93%</td><td>0.00084</td></tr><tr><td>BASE LM</td><td>BALM</td><td>46.77%</td><td>0.88</td></tr><tr><td>BALM <</td><td>JOINT UNIT</td><td>50.00%</td><td>0.52</td></tr><tr><td>BALM</td><td>JOINT1 BIT-BASE</td><td>57.89%</td><td>0.0027</td></tr><tr><td>BALM</td><td>JOINT BIT-LARGE*</td><td>59.89%</td><td>0.00020</td></tr><tr><td>BALM-24L</td><td> JOINT BIT-MED (24L)</td><td>56.23%</td><td>0.015</td></tr><tr><td>JOINT BIT-LARGE* (24L)</td><td>HUMAN</td><td>55.21%</td><td>0.036</td></tr><tr><td>BASE LM ≤</td><td>BALM</td><td>54.85%</td><td>0.050</td></tr></table>
|
| 158 |
+
|
| 159 |
+
In the lower part of the table, we show that if we make the big language model baseline BALM deeper (BALM-24L) (24 layers instead of 12, for the same number of parameters) we attain lower perplexity. However, training the joint model JOINT BIT-BASE on the residual of a deeper language model BASE LM-24L yields even lower perplexity, despite having fewer parameters. By using the same number of parameters as BALM-24L, JOINT BIT-MED further decreases perplexity. Finally, by initializing from RoBERTa-Large, JOINT BIT-BASE\* obtains the best results.
|
| 160 |
+
|
| 161 |
+
One caveat of our evaluation protocol is that the perplexity bounds are only estimates, which might not reflect the true value, particularly since the number of possible sequences grows exponentially with the number of words that are generated. We therefore break down perplexity per position in the generated sequences as in Eq. 5, and compare the estimated PPLs to the true enumerated PPLs at the last position, as shown in Figure 1. We find that at the final generation step, the estimated bounds agree remarkably well with the exact values, proving that our method at least gets a reasonable PPL estimate at the last generation step, and that JOINT BIT-MED outperforms baselines at the last generation step for sure.
|
| 162 |
+
|
| 163 |
+
Human Evaluation Better perplexity results do not necessarily imply better generations. Besides, since generation from the residual EBM requires approximations as in Algorithm 1, the limited sample size might induce approximation errors compared to truly sampling from the joint distribution. Therefore, we conducted human evaluations to compare generations from the residual EBM model to generations from the baseline language models.
|
| 164 |
+
|
| 165 |
+
For each prefix, we present one completion from each model, and ask humans to select the one that is a better continuation. More details about human evaluation can be found in the Appendix A.4. The preference rates reported in Table 2 confirm that indeed the generation quality of JOINT BIT-BASE and JOINT BIT-LARGE $^ *$ is better than both language model baselines. Depending on the model variant, our joint model (with bidirectional EBM) is preferred between $56 \%$ and almost $60 \%$ of the times; interestingly, the preference rate does not change much as we compare against base LM as opposed to BALM. In fact, humans do not seem to have a strong preference for BALM over base LM, despite the former scores two perplexity points lower. Similarly, JOINT UNIT is not strongly preferred over BASE LM despite its lower perplexity score. We surmise that unidirectional scoring functions and auto-regressive models exhibit generation artifacts which are easily detected by humans, and these may overshadow the improvements brought by perplexity gains.
|
| 166 |
+
|
| 167 |
+
# 4.3 ANALYSES
|
| 168 |
+
|
| 169 |
+
In this section, we analyze some of the results we obtained. First, we check whether we used a sufficient number of samples in our perplexity estimates. Second, we assess whether the joint model produces fewer repetitions compared to the base language model, and finally we check how well some statistics of the model and data distributions match.
|
| 170 |
+
|
| 171 |
+

|
| 172 |
+
Figure 2: Left: PPL estimation for joint BIT-BASE on CC-News validation set as we vary the number of samples. Right: Percentage of Unique n-grams found in real data, samples from the joint model BIT-BASE and samples from the base language model. The joint sampling is done with 10,000 samples.
|
| 173 |
+
|
| 174 |
+

|
| 175 |
+
Figure 3: Density plot of log-probability scores using the base language model (left) or the joint model (right). The red curve corresponds to real samples, the black curve to samples from BASE LM and the green curve to samples from BIT-BASE. The joint model provides a much better fit than the base language model.
|
| 176 |
+
|
| 177 |
+
Number of samples. In Figure 2, we vary the number of samples we take in order to estimate PPL upper and lower bounds. Beyond 20,000 samples the upper estimate becomes very stable, although we have to emphasize that these estimates might be biased even though the gap between lower and upper bound closes as we take more samples.
|
| 178 |
+
|
| 179 |
+
Repetitions. A typical artifact of auto-regressive language models is their tendency to repeat phrases. It is then interesting to check whether the joint model is able to alleviate this artifact. Fig. 2 shows that indeed the joint model has a slightly higher percentage of unique n-grams compared to the baseline language model with $n = 2 , 3 , 4$ , although still not as high as the original human generated text.
|
| 180 |
+
|
| 181 |
+
A necessary condition for the model to match the data distribution. If the joint model $p _ { \theta }$ matches the data distribution $p _ { d }$ , then statistics computed on a large population of samples from the two distributions should also match. In particular, Fig. 3 show the density plots of log-likelihood scores of the baseline language model (left) and joint model (right) when fed with their own samples versus samples from the test set. We observe that the histogram of samples from the joint model matches the real data distribution more closely: The difference of means in the LM BASE case is 21.64 whereas the difference is 6.20 in the joint approach.
|
| 182 |
+
|
| 183 |
+
# 5 LIMITATIONS
|
| 184 |
+
|
| 185 |
+
In the previous sections we highlighted the strengths of residual EBMs, namely their simplicity, efficiency both at training and test time, and their improved perplexity scores against strong autoregressive language model baselines. In this section, we comment on their limitations to caution the reader about when these methods are more likely to succeed and to inform other researchers about what future avenues of research may naturally derive from this work.
|
| 186 |
+
|
| 187 |
+
In order to make training efficient and side step costly negative mining using the energy function itself, the current approach uses negatives generated from a pretrained auto-regressive language model. Therefore, our model works as long as the base language model from which we draw samples is strong enough, and as long as the ground truth and other plausible sequences are reachable by the baseline language model.
|
| 188 |
+
|
| 189 |
+
If the base language model has poor quality, then generation from our joint model is going to be poor as well, as the joint model merely resamples generations from the original language model. Moreover, training is going to be trivial if the base language model is poor, because the residual energy function merely needs to detect trivial generation artifacts from the base language model. In fact, observe that the role of positive and negative samples is symmetric in the loss of Eq. 3. This means that the energy function can choose to minimize the loss by either modeling the true data or the negative samples; since the latter have much simpler structure, it is going to model the negative samples. Therefore, importance sampling amounts to mostly down-weighing the worst samples from the base language model. The consequence of this is that search with a poor base language model is going to be catastrophically inefficient, as we would need to sample an impractically large number of negatives in order to find samples that are reasonably close to the true data manifold.
|
| 190 |
+
|
| 191 |
+
To summarize, this work makes a rather strong implicit assumption on the quality of the base language model, and it is expected to work well only when this is rather strong. In our application, this assumption is met quite well in practice as large auto-regressive language models trained on large datasets have improved significantly in recent years (Radford et al., 2019). In general however, residual learning always carries liability to its base model.
|
| 192 |
+
|
| 193 |
+
# 6 CONCLUSIONS AND FUTURE WORK
|
| 194 |
+
|
| 195 |
+
We investigated an EBM trained on the residual of a pretrained autoregressive language model (Wang & Ou, 2018b; Parshakova et al., 2019). The resulting joint model scores sequences holistically, thanks to the energy function. Training is very efficient and consists of a binary classification task between positives from the training set and pregenerated negatives from the fixed language model. Generation is also very efficient as it amounts to resampling from the large set of negatives produced by the base language model. Our estimates show that the resulting model has lower perplexity than the base language model. Finally, this approach may be interpreted as a natural way to finetune a large bidirectional transformer like BERT for text generation applications.
|
| 196 |
+
|
| 197 |
+
In the future, we plan to investigate other ways to generate negatives that may strike a better tradeoff between the amount of compute each negative requires and their closeness to the joint model distribution. It would also be interesting to explore other loss functions and the generation of longer pieces of text by using this model auto-regressively at the chunk level, as opposed to the token level.
|
| 198 |
+
|
| 199 |
+
# REFERENCES
|
| 200 |
+
|
| 201 |
+
Samaneh Azadi, Catherine Olsson, Trevor Darrell, Ian Goodfellow, and Augustus Odena. Discriminator rejection sampling. arXiv preprint arXiv:1810.06758, 2018.
|
| 202 |
+
Anton Bakhtin, Sam Gross, Myle Ott, Yuntian Deng, Marc’Aurelio Ranzato, and Arthur Szlam. Real or fake? learning to discriminate machine from human generated text. arXiv preprint arXiv:1906.03351, 2019.
|
| 203 |
+
Leon Bottou. Une approche th ´ eorique de l’apprentissage connexionniste: Applications ´ a la recon- \` naissance de la parole, 1991. Ph.D. thesis, Universite de Paris XI, Orsay, France. ´
|
| 204 |
+
Samuel R. Bowman, Luke Vilnis, Oriol Vinyals, Andrew M. Dai, Rafal Jozefowicz, and Samy Bengio. Generating sentences from a continuous space. In SIGNLL Conference on Computational Natural Language Learning, 2016.
|
| 205 |
+
Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: pre-training of deep bidirectional transformers for language understanding. CoRR, abs/1810.04805, 2018. URL http://arxiv.org/abs/1810.04805.
|
| 206 |
+
|
| 207 |
+
Yilun Du and Igor Mordatch. Implicit generation and generalization in energy-based models. CoRR, abs/1903.08689, 2019. URL http://arxiv.org/abs/1903.08689.
|
| 208 |
+
|
| 209 |
+
Sergey Edunov, Myle Ott, Michael Auli, David Grangier, and Marc’Aurelio Ranzato. Classical structured prediction losses for sequence to sequence learning. In North American Chapter of the Association for Computational Linguistics, 2018.
|
| 210 |
+
|
| 211 |
+
Ruiqi Gao, Yang Lu, Junpei Zhou, Song-Chun Zhu, and Ying Nian Wu. Learning generative convnets via multi-grid modeling and sampling. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 9155–9164, 2018.
|
| 212 |
+
|
| 213 |
+
Ian J. Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. In NIPS, 2014.
|
| 214 |
+
|
| 215 |
+
Aditya Grover, Jiaming Song, Alekh Agarwal, Kenneth Tran, Ashish Kapoor, Eric Horvitz, and Stefano Ermon. Bias correction of learned generative models using likelihood-free importance weighting. arXiv preprint arXiv:1906.09531, 2019.
|
| 216 |
+
|
| 217 |
+
Michael Gutmann and Aapo Hyvarinen. Noise-contrastive estimation: A new estimation principle ¨ for unnormalized statistical models. In Proceedings of the Thirteenth International Conference on Artificial Intelligence and Statistics, pp. 297–304, 2010.
|
| 218 |
+
|
| 219 |
+
Geoffrey E. Hinton. Training products of experts by minimizing contrastive divergence. Neural Computation, 14:1771–1800, 2002.
|
| 220 |
+
|
| 221 |
+
Geoffrey E Hinton. A practical guide to training restricted boltzmann machines. In Neural networks: Tricks of the trade, pp. 599–619. Springer, 2012.
|
| 222 |
+
|
| 223 |
+
Ari Holtzman, Jan Buys, Maxwell Forbes, and Yejin Choi. The curious case of neural text degeneration. arXiv preprint arXiv:1904.09751, 2019.
|
| 224 |
+
|
| 225 |
+
John Hopfield. Neural networks and physical systems with emergent collective computational abilities. In National Academy of Sciences of the USA, volume 79, pp. 2554––2558, 1982.
|
| 226 |
+
|
| 227 |
+
Daniel G. Horvitz and Donovan J. Thompson. A generalization of sampling without replacement from a finite universe. Journal of the American Statistical Association, 1952.
|
| 228 |
+
|
| 229 |
+
Ryan Kiros, Yukun Zhu, Ruslan Salakhutdinov, Richard S Zemel, Antonio Torralba, and Sanja Urtasun, Raquel an d Fidler. Skip-thought vectors. arXiv preprint arXiv:1506.06726, 2015.
|
| 230 |
+
|
| 231 |
+
Yann LeCun, Sumit Chopra, Raia Hadsell, Marc’Aurelio Ranzato, and Fu-Jie Huang. A tutorial on energy-based learning. Predicting Structured Outputs, 2006. MIT Press.
|
| 232 |
+
|
| 233 |
+
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.
|
| 234 |
+
|
| 235 |
+
Zhuang Ma and Michael Collins. Noise contrastive estimation and negative sampling for conditional models: Consistency and statistical efficiency. In Empirical Methods for Natural Language Processing, 2018.
|
| 236 |
+
|
| 237 |
+
Sebastian Nagel. Cc-news. http://web.archive.org/save/http://commoncrawl. org/2016/10/news-dataset-available/, 2016.
|
| 238 |
+
|
| 239 |
+
Erik Nijkamp, Mitch Hill, Song-Chun Zhu, and Ying Nian Wu. Learning non-convergent nonpersistent short-run mcmc toward energy-based model. In Advances in Neural Information Processing Systems, pp. 5233–5243, 2019.
|
| 240 |
+
|
| 241 |
+
Sebastian Nowozin. Debiasing evidence approximations: On importance-weighted autoencoders and jackknife variational inference. In International Conference on Learning Representations, 2018.
|
| 242 |
+
|
| 243 |
+
Art B. Owen. Monte Carlo theory, methods and examples. 2013. URL https://statweb. stanford.edu/˜owen/mc/. chapter 9.
|
| 244 |
+
|
| 245 |
+
Tetiana Parshakova, Jean-Marc Andreoli, and Marc Dymetman. Global autoregressive models for data-efficient sequence learning. In Conference on Computational Natural Language Learning, 2019.
|
| 246 |
+
|
| 247 |
+
Razvan Pascanu, Tomas Mikolov, and Yoshua Bengio. On the difficulty of training recurrent neural networks. In International conference on machine learning, pp. 1310–1318, 2013.
|
| 248 |
+
|
| 249 |
+
Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever. Language models are unsupervised multitask learners. OpenAI Blog, 1(8), 2019.
|
| 250 |
+
|
| 251 |
+
Marc’Aurelio Ranzato, Y-Lan Boureau, Sumit Chopra, and Yann LeCun. A unified energy-based framework for unsupervised learning. In 11-th International Workshop on Artificial Intelligence and Statistics (AISTATS), 2007.
|
| 252 |
+
|
| 253 |
+
Marc’Aurelio Ranzato, Sumit Chopra, Michael Auli, and Wojciech Zaremba. Sequence level training with recurrent neural networks. In International Conference on Learning Representation, 2016.
|
| 254 |
+
|
| 255 |
+
Ronald Rosenfeld, Stanley F Chen, and Xiaojin Zhu. Whole-sentence exponential language models: a vehicle for linguistic-statistical integration. Computer Speech & Language, 15(1):55–73, 2001.
|
| 256 |
+
|
| 257 |
+
Rico Sennrich, Barry Haddow, and Alexandra Birch. Neural machine translation of rare words with subword units. arXiv preprint arXiv:1508.07909, 2015.
|
| 258 |
+
|
| 259 |
+
Libin Shen, Anoop Sarkar, and Franz Josef Och. Discriminative reranking for machine translation. In Human Language Technology Conference of the North American Chapter of the Association for Computational Linguistics: HLT-NAACL 2004, pp. 177–184, 2004.
|
| 260 |
+
|
| 261 |
+
Y. W. Teh, M. Welling, S. Osindero, and Hinton G. E. Energy-based models for sparse overcomplete representations. Journal of Machine Learning Research, 4:1235–1260, 2003.
|
| 262 |
+
|
| 263 |
+
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.
|
| 264 |
+
|
| 265 |
+
Bin Wang and Zhijian Ou. Language modeling with neural trans-dimensional random fields. In 2017 IEEE Automatic Speech Recognition and Understanding Workshop (ASRU), pp. 294–300. IEEE, 2017.
|
| 266 |
+
|
| 267 |
+
Bin Wang and Zhijian Ou. Improved training of neural trans-dimensional random field language models with dynamic noise-contrastive estimation. In 2018 IEEE Spoken Language Technology Workshop (SLT), pp. 70–76. IEEE, 2018a.
|
| 268 |
+
|
| 269 |
+
Bin Wang and Zhijian Ou. Learning neural trans-dimensional random field language models with noise-contrastive estimation. In 2018 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pp. 6134–6138. IEEE, 2018b.
|
| 270 |
+
|
| 271 |
+
Bin Wang, Zhijian Ou, and Zhiqiang Tan. Trans-dimensional random fields for language modeling. In Proceedings of the 53rd Annual Meeting of the Association for Computational Linguistics and the 7th International Joint Conference on Natural Language Processing (Volume 1: Long Papers), pp. 785–794, 2015.
|
| 272 |
+
|
| 273 |
+
Bin Wang, Zhijian Ou, and Zhiqiang Tan. Learning trans-dimensional random fields with applications to language modeling. IEEE transactions on pattern analysis and machine intelligence, 40 (4):876–890, 2017.
|
| 274 |
+
|
| 275 |
+
Max Welling, Michal Rosen-Zvi, and Geoffrey E. Hinton. Exponential family harmoniums with an application to information retrieval. In Neural Information Processing Systems, 2005.
|
| 276 |
+
|
| 277 |
+
Jianwen Xie, Yang Lu, Song-Chun Zhu, and Yingnian Wu. A theory of generative convnet. In International Conference on Machine Learning, pp. 2635–2644, 2016.
|
| 278 |
+
|
| 279 |
+
Jianwen Xie, Song-Chun Zhu, and Ying Nian Wu. Synthesizing dynamic patterns by spatialtemporal generative convnet. In Proceedings of the ieee conference on computer vision and pattern recognition, pp. 7093–7101, 2017.
|
| 280 |
+
|
| 281 |
+
Jianwen Xie, Zilong Zheng, Ruiqi Gao, Wenguan Wang, Song-Chun Zhu, and Ying Nian Wu. Learning descriptor networks for 3d shape synthesis and analysis. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 8629–8638, 2018.
|
| 282 |
+
|
| 283 |
+
Jianwen Xie, Song-Chun Zhu, and Ying Nian Wu. Learning energy-based spatial-temporal generative convnets for dynamic patterns. IEEE transactions on pattern analysis and machine intelligence, 2019.
|
| 284 |
+
|
| 285 |
+
Junbo Zhao, Yoon Kim, Kelly Zhang, Alexander M. Rush, and Yann LeCun. Adversarially regularized autoencoders. In International Conference in Machine Learning, 2018.
|
| 286 |
+
|
| 287 |
+
Yukun Zhu, Ryan Kiros, Rich Zemel, Ruslan Salakhutdinov, Raquel Urtasun, Antonio Torralba, and Sanja Fidler. Aligning books and movies: Towards story-like visual explanations by watching movies and reading books. In The IEEE International Conference on Computer Vision (ICCV), December 2015.
|
| 288 |
+
|
| 289 |
+
# A APPENDIX
|
| 290 |
+
|
| 291 |
+
# A.1 TOP-K AUTO-REGRESSIVE SAMPLING
|
| 292 |
+
|
| 293 |
+
In this subsection, we factorize the joint model BIT-BASE auto-regressively, and compare its differences with BASE LM. Since even estimating the per step probabilities according to Eq. 5 is too computationally expensive, we further approximate it by only considering the top 128 words predicted by BASE LM, where we sample 10,000 completions for each of them to estimate $P ( x _ { t } | x _ { < t } )$ . Then we take the top 10 entries and re-normalize, and compare it to the top 10 probabilities of BASE LM.
|
| 294 |
+
|
| 295 |
+
Our initial explorations suggested that the joint model tends to generate fewer repetitions. Therefore we picked a few LM samples where there are repetitions at $x _ { t }$ , and use the same context $x _ { < t }$ to estimate $P ( x _ { t } | x _ { < t } )$ for the joint model. Some examples of $P ( x _ { t } | x _ { < t } )$ of BASE LM and BIT-BASE are presented in Table 3. Indeed BIT-BASE usually assigns lower probabilities to repetitions even though the top $\mathbf { k }$ words remain the same, which is not surprising given that the existence of repetition is a strong indicator of coming from the LM, which would lead to a higher energy value hence lower joint probability.
|
| 296 |
+
|
| 297 |
+
Table 3: Comparison of $P ( x _ { t } | x _ { < t } )$ between BASE LM and BIT-BASE on a few examples. Repetitions are marked with red. Only the top 5 probabilities are shown.
|
| 298 |
+
|
| 299 |
+
<table><tr><td>Context x<t</td><td>Model</td><td>Rank</td><td>Ct</td><td>P(xtlx<t)</td></tr><tr><td rowspan="4">6... is aimed at setting common benchmarks for orderly migration practices,thereby reducing irregular flows.The Global Compact contains ten guiding principles,including that migrants</td><td rowspan="4">BASE LM</td><td>0 1</td><td>binding legally</td><td>0.39 0.33</td></tr><tr><td>2</td><td>internationally</td><td>0.06</td></tr><tr><td></td><td></td><td></td></tr><tr><td>3 4</td><td>comprehensive transparent</td><td>0.05 0.04</td></tr><tr><td rowspan="4">cannot be settled by countries with better integration policies and a fair and sustainable development."For the first time in our history,</td><td rowspan="4">BIT-BASE</td><td>0</td><td>binding</td><td>0.18</td></tr><tr><td>1</td><td>legally</td><td>0.17</td></tr><tr><td>2</td><td>internationally</td><td>0.12</td></tr><tr><td>3</td><td>comprehensive</td><td>0.09</td></tr><tr><td rowspan="7">7... companies that land their first-choice candidates 90-100% of the time,24% of them have "thoroughly defined”their high performer attitudes.By contrast,only 1% of companies that struggle to land their first-choice candidates "thoroughly defined’their high</td><td rowspan="7">BASE LM</td><td>4 0</td><td>transparent</td><td>0.08</td></tr><tr><td>1</td><td>able</td><td>0.66</td></tr><tr><td></td><td> willing</td><td>0.09</td></tr><tr><td>2</td><td>eager ready</td><td>0.07</td></tr><tr><td>3</td><td>well</td><td>0.05</td></tr><tr><td>4</td><td>able</td><td>0.04</td></tr><tr><td>0 1</td><td> willing</td><td>0.75 0.05</td></tr><tr><td rowspan="7">candidates are not always as willing and 8... it reveals a key skill needed to lead the Fed. "You need to know what you don't know. And you need to be willing to listen when you don't</td><td rowspan="7"></td><td>2 3</td><td>eager ready</td><td>0.05</td></tr><tr><td>4</td><td></td><td>0.04</td></tr><tr><td></td><td>well</td><td>0.03</td></tr><tr><td>0</td><td>banking</td><td>0.64</td></tr><tr><td>1</td><td>financial</td><td>0.10</td></tr><tr><td>2</td><td>insurance</td><td>0.09</td></tr><tr><td>3</td><td>technology</td><td>0.05</td></tr><tr><td rowspan="4">know something," said Karen Dynan,who as an assistant Treasury Secretary in Barack Obama's second administration would</td><td rowspan="4"></td><td>4</td><td>IT</td><td>0.04</td></tr><tr><td></td><td>banking</td><td>0.92</td></tr><tr><td>0 1</td><td>financial</td><td></td></tr><tr><td></td><td></td><td>0.06</td></tr><tr><td rowspan="2">regularly meet Fed governors. iEOSi New Delhi Dec 5 The following are mergers under</td><td rowspan="2">BIT-BASE</td><td>2</td><td>insurance</td><td>0.01</td></tr><tr><td>3</td><td>technology</td><td>0.00</td></tr><tr><td rowspan="2">review by India's financial services and</td><td rowspan="2"></td><td>4</td><td>IT</td><td>0.00</td></tr><tr><td></td><td></td><td></td></tr></table>
|
| 300 |
+
|
| 301 |
+
6Excerpt from https://www.swissinfo.ch/eng/multinational-principles_ swiss-government-gives-green-light-for-un-migration-accord/44464186. 7Excerpt from https://www.forbes.com/sites/markmurphy/2018/05/11/ this-is-the-one-piece-of-data-that-85-of-recruiters-are-missing/ #25917c765dad. 8Excerpt from https://www.reuters.com/article/us-usa-fed-powell/ fed-nominee-powell-once-hawkish-now-champions-yellens-focus-on-jobs-idUSKBN1DS0FG
|
| 302 |
+
|
| 303 |
+
# A.2 PROOF OF THEOREM 2
|
| 304 |
+
|
| 305 |
+
Theorem 2. Denote $T _ { n }$ as the empirical estimate of log $\mathbb { E } _ { x \sim P _ { L M } } \exp ( - E ( x ) )$ with $n$ samples $x _ { i } \sim$ $P _ { L M } ( i = 1 , \cdot \cdot \cdot , n ) $ , and let $\begin{array} { r } { T _ { n } ^ { \phantom { - } } = \log \frac { 1 } { n } \sum _ { i = 1 } ^ { n } \mathrm { e x p } ( - E ( x _ { i } ) ) , } \end{array}$ , then $\forall \epsilon > 0$ , $\exists N > 0$ such that $\forall n > N$ we have
|
| 306 |
+
|
| 307 |
+
$$
|
| 308 |
+
Z _ { \theta } - \epsilon < \mathbb { E } [ T _ { n } ] < Z _ { \theta } < \mathbb { E } [ ( 2 n - 1 ) T _ { n } - 2 ( n - 1 ) T _ { n - 1 } ] < Z _ { \theta } + \epsilon
|
| 309 |
+
$$
|
| 310 |
+
|
| 311 |
+
Proof. From Nowozin (2018) Eq. 35, we can write $\mathbb { E } [ T _ { n } ]$ as
|
| 312 |
+
|
| 313 |
+
$$
|
| 314 |
+
\begin{array} { c } { { \displaystyle \mathbb { E } [ T _ { n } ] = Z _ { \theta } - \frac { \mu _ { 2 } } { 2 \mu ^ { 2 } } \frac { 1 } { n } + \frac { 1 } { 3 \mu ^ { 3 } } \frac { \mu _ { 3 } } { n ^ { 2 } } - \frac { 1 } { 4 \mu ^ { 4 } } ( \frac { 3 } { n ^ { 2 } } \mu _ { 2 } ^ { 2 } + \frac { 1 } { n ^ { 3 } } ( \mu _ { 4 } - 3 \mu _ { 2 } ^ { 2 } ) ) } } \\ { { + \displaystyle \frac { 1 } { 5 \mu ^ { 5 } } ( \frac { 1 0 } { n ^ { 3 } } \mu _ { 3 } \mu _ { 2 } + \frac { 1 } { n ^ { 4 } } ( \mu _ { 5 } - 1 0 \mu _ { 3 } \mu _ { 2 } ) ) + o ( n ^ { - 3 } ) } } \end{array}
|
| 315 |
+
$$
|
| 316 |
+
|
| 317 |
+
Where $\mu = \mathbb { E } [ T _ { n } ]$ , $\mu _ { k } = \mathbb { E } [ ( T _ { n } - \mu ) ^ { k } ]$ . Equivalently,
|
| 318 |
+
|
| 319 |
+
$$
|
| 320 |
+
\mathbb { E } [ T _ { n } ] = Z _ { \theta } - \frac { \mu _ { 2 } } { 2 \mu ^ { 2 } } \frac { 1 } { n } + o ( n ^ { - 1 } )
|
| 321 |
+
$$
|
| 322 |
+
|
| 323 |
+
Therefore, $\begin{array} { r } { \operatorname* { l i m } _ { n \to \infty } \mathbb { E } [ T _ { n } ] = Z _ { \theta } } \end{array}$ . $\mathrm { S o } \forall \epsilon > 0$ , $\exists N _ { 1 } > 0$ such that when $n > N _ { 1 }$ , $\mathbb { E } [ T _ { n } ] > Z _ { \theta } - \epsilon$ . On the other hand, $\begin{array} { r } { \operatorname* { l i m } _ { n \to \infty } \bar { n } ( Z _ { \theta } - \mathbb { E } [ T _ { n } ] ) = \operatorname* { l i m } _ { n \to \infty } \frac { \mu _ { 2 } } { 2 \mu ^ { 2 } } + o ( 1 ) = \frac { \mu _ { 2 } } { 2 \mu ^ { 2 } } > 0 } \end{array}$ , so $\exists N _ { 2 } > 0$ such that when $n > N _ { 2 }$ we have $Z _ { \theta } > \mathbb { E } [ T _ { n } ]$ . Up to this point, we have proved that $Z _ { \theta } - \epsilon < \mathbb { E } [ T _ { n } ] < Z _ { \theta }$ .
|
| 324 |
+
|
| 325 |
+
For the other half part of the proof, using Eq. 8 we have
|
| 326 |
+
|
| 327 |
+
$$
|
| 328 |
+
\mathbb { E } [ T _ { n } ] = Z _ { \theta } - \frac { \mu _ { 2 } } { 2 \mu ^ { 2 } } \frac { 1 } { n } + \frac { c } { n ^ { 2 } } + o ( n ^ { - 2 } )
|
| 329 |
+
$$
|
| 330 |
+
|
| 331 |
+
$\begin{array} { r } { 1 ) \mathbb { E } [ T _ { n - 1 } ] = Z _ { \theta } + \frac { \mu _ { 2 } } { 2 \mu ^ { 2 } } \frac { 1 } { n } + o ( n ^ { - 1 } ) } \end{array}$ where $c$ is a constant. Therefore, ${ \mathbb E } [ ( 2 n - 1 ) T _ { n } - 2 ( n - 1 ) T _ { n - 1 } ] = ( 2 n - 1 ) { \mathbb E } [ T _ { n } ] - 2 ( n - $ . Therefore $\begin{array} { r } { \operatorname* { l i m } _ { n \to \infty } \mathbb { E } [ ( 2 n - 1 ) T _ { n } - 2 ( n - 1 ) T _ { n - 1 } ] = Z _ { \theta } . } \end{array}$ hence $\forall \epsilon > 0$ , $\exists N _ { 3 } > 0$ such that $\forall n > N _ { 3 } \mathbb { E } [ ( 2 n - 1 ) T _ { n } - 2 ( n - 1 ) T _ { n - 1 } ] < Z _ { \theta } + \mathcal { O }$ . Furthermore, $\begin{array} { r } { \operatorname* { l i m } _ { n \to \infty } n ( \mathbb { E } [ ( 2 n - 1 ) T _ { n } - 2 ( n - 1 ) T _ { n - 1 } ] - Z _ { \theta } ) = \operatorname* { l i m } _ { n \to \infty } \frac { \mu _ { 2 } } { 2 u ^ { 2 } } + o ( 1 ) > } \end{array}$ 0, so $\exists N _ { 4 } > 0$ such that when $n > N _ { 4 }$ we have $\mathbb { E } [ ( 2 n - 1 ) T _ { n } - 2 ( n - 1 ) T _ { n - 1 } > Z _ { \theta }$ .
|
| 332 |
+
|
| 333 |
+
Putting the above together, $\forall \epsilon > 0$ , let $N = \operatorname* { m a x } \{ N _ { 1 } , N _ { 2 } , N _ { 3 } , N _ { 4 } \}$ , then $\forall n > N$ ,
|
| 334 |
+
|
| 335 |
+
$$
|
| 336 |
+
Z _ { \theta } - \epsilon < \mathbb { E } [ T _ { n } ] < Z _ { \theta } < \mathbb { E } [ ( 2 n - 1 ) T _ { n } - 2 ( n - 1 ) T _ { n - 1 } ] < Z _ { \theta } + \epsilon
|
| 337 |
+
$$
|
| 338 |
+
|
| 339 |
+
A.3 OPTIMIZATION SETTINGS
|
| 340 |
+
|
| 341 |
+
<table><tr><td>Model</td><td>fp16</td><td>batch size</td><td>warmup steps</td><td>max steps</td><td>max lr</td><td>max grad norm</td></tr><tr><td>BASE LM</td><td>1</td><td>32</td><td>2,000</td><td>180,000</td><td>0.0001</td><td>10</td></tr><tr><td>RALM</td><td></td><td>64</td><td>2.000</td><td>180,000</td><td>0.0001</td><td>10</td></tr><tr><td>BALM</td><td>=</td><td>32</td><td>2.000</td><td>180.000</td><td>0.0001</td><td>10</td></tr><tr><td>JOINTUNIT</td><td>+</td><td>64</td><td>2.000</td><td>180,000</td><td>0.0003</td><td>10</td></tr><tr><td>JOINT BIT-BASE</td><td>=</td><td>60</td><td>2.000</td><td>90,000</td><td>0.00005</td><td>0.25</td></tr><tr><td>JOINT BIT-BASE*</td><td>/</td><td>60</td><td>2.000</td><td>90,000</td><td>0.00005</td><td>0.25</td></tr><tr><td>JOINT BIT-LARGE*</td><td>+</td><td>64</td><td>2,000</td><td>90,000</td><td>0.0003</td><td>10</td></tr><tr><td>BASELM-24L</td><td>=</td><td>50</td><td>2.000</td><td>90.000</td><td>0.0003</td><td>0.25</td></tr><tr><td>RALM-24L</td><td></td><td>28</td><td>1,000</td><td>90,000</td><td>0.00015</td><td>0.25</td></tr><tr><td>BALM-24L</td><td>=</td><td>28</td><td>2.000</td><td>90,000</td><td>0.0003</td><td>0.25</td></tr><tr><td>JOINT UNIT (LM-24L)</td><td>+</td><td>64</td><td>2.000</td><td>180,000</td><td>0.0003</td><td>10</td></tr><tr><td>JOINT BIT-BASE (LM-24L)</td><td>=</td><td>60</td><td>2.000</td><td>90.000</td><td>0.00005</td><td>0.25</td></tr><tr><td>JOINT BIT-BASE* (LM-24L)</td><td></td><td>60</td><td>2.000</td><td>90.000</td><td>0.00005</td><td>0.25</td></tr><tr><td>JOINT BIT-MED (LM-24L)</td><td></td><td>32</td><td>2.000</td><td>90.000</td><td>0.00005</td><td>0.25</td></tr><tr><td>JOINT BIT-LARGE* (LM-24L)</td><td></td><td>20</td><td>2,000</td><td>90.000</td><td>0.00005</td><td>0.25</td></tr></table>
|
| 342 |
+
|
| 343 |
+
Table 4: Optimization settings. We use the same setting for CC-News and Toronto Book Corpus.
|
| 344 |
+
|
| 345 |
+
The optimization settings are presented in Table 4.
|
| 346 |
+
|
| 347 |
+
Readeachof the threepairsof textbelowand decide which isamorereasonable extensionof theinitial words.Note:do not worry if one or both extensions is incomplete.
|
| 348 |
+
|
| 349 |
+
$\bigcirc$ .. lf you try to tinker with this without the tools that onlyCongress has,you are as likelyto break the cloud as you are tofixit,'hesaid.Google,which has waged similar battes with the government,andanarrayof other leading tech companies are supporting Microsoft in the case.Justices Sonia Sotomayor and Ruth Bader Ginsburg suggested the wait-for-Congressapproach had some appeal.'Wouldn't itbe wiser justtosay,'Let's leavethingsas theyare-ifCongress wants toregulatein thisbravenewworld,itshouldjust give itup, Ginsburg said,according to asummary of the opinion written for the high court's concurrence.The tech companies have a history of fighting government regulations in court, and have...
|
| 350 |
+
|
| 351 |
+
$\bigcirc$ .. lf you tryto tinker with this without the tools thatonly Congresshas,you are as likely to break the cloud as you are tofixit,'he said.Google,which has waged similar battes with the government,andanarray of other leading tech companies are supporting Microsoft in thecase.Justices Sonia Sotomayor and Ruth Bader Ginsburg suggested the wait-for-Congressapproach had some appeal.'Wouldn't it be wiser just to say,'Let's leavethingsastheyare-ifCongresswantstoregulateinthisbravenewworld,itshouldberegulatinginthis brave newworld?'wroteSotomayorand BaderGinsburg.Aruling isdueby theendof June.Ifit'sapprovedby Congress, the court could...
|
| 352 |
+
|
| 353 |
+
Figure 4: Screenshot of the human evaluation.
|
| 354 |
+
|
| 355 |
+
# A.4 HUMAN EVALUATION
|
| 356 |
+
|
| 357 |
+
A screenshot of the human evaluation experiments can be found in Fig 4. Every page asks for 4 comparisons, one of which we know what the ground truth answer is. We subsampled 333 sentences from the test set of CC-News, and asked 3 Amazon Mechanical turkers to vote. We consider one continuation better if it gets more votes. To check the quality of the received ratings, we performed a qualification task beforehand, where one of the continuations is real text, and we kept the top half performing turkers for further evaluation (corresponding to higher than $6 6 . 6 7 \%$ accuracy for discriminating real from LM samples – for a total of 26 qualified turkers). Then in the actual experiment, we use one out of every four comparisons as an attention check and drop responses if the turker did not pass the check.
|
| 358 |
+
|
| 359 |
+
# A.5 QUALITATIVE ANALYSIS
|
| 360 |
+
|
| 361 |
+
We present generation examples when our approach BASE LM outperforms baseline BALM in Table 5, and when our approach underperforms in Table 6. Here the judgment is based on human evaluation when all three turkers unanimously voted in favor of one model over the other.
|
| 362 |
+
|
| 363 |
+
<table><tr><td>Prefix</td><td>Model</td><td>Generation</td></tr><tr><td rowspan="5">9the timing of the donation couldn't be better,and even went on to say that no one is more relevant than Chance right now. Thank you to Doug and @jewelosco for donating $1,Ooo,OoO to The New Chance Arts& Literature Fund, which will ensure more students have access to arts enrichment education! #supportcps pic.twitter.com/MXZtpscU5b- SocialWorks</td><td>BASE LM</td><td>.And the fact that the money is coming from the govern- ment,it makesa big difference,”he said.“We're not the biggest donor of arts education, so to</td></tr><tr><td>BALM</td><td>,and it doesn't even have the kind of resources or funding for the arts or literary programs that we need to do the things that people want to support,” said Chance.</td></tr><tr><td>BIT-BASE- WORST</td><td>saidCpl.Chris Bissonnete of the Stony Brook Police Department.“So the reason is,as Ithink about the impact of these grants and these grants to schools</td></tr><tr><td>BIT-BASE</td><td>tofund programming.So,I think that it’sa great time forus to do something to support that,” said Chance.“We want to make sure that our programs</td></tr><tr><td>GOLD</td><td>and charitable armsand organizations because there's been a past of corrupt activity in the city of Chicago," Chance said. "And so,when it comes down to it, it</td></tr><tr><td rowspan="5">10quarter.The penalties are stillsomewhat of a problem but tight ends TravisKelce andDemetriusHarrismade some impressive grown-man football plays. -It was nice to see running back Kareem Hunt get in the end zone for the first time since Week 3.He must feel good to end the drought. -Kelce was visibly frustrated on the sidelinesand rightfully so. The officials seem to be leaning toward Oakland with calls today. Still,Kelce should've caught that easy pass that he dropped. -Quarterback Alex Smith has delivered a couple of nice deep balls to</td><td>BASE LM</td><td>get his hands on the ball this week.He threw two touchdown passes on Thursday.He should get another touchdown as the season goes on.He's got a good chance to be one of</td></tr><tr><td>BALM</td><td>the Chiefs and the Chiefs defense has made them pay for it. The offense has done a nice job with the ball,and they's been a factor. It's nice to have</td></tr><tr><td>BIT-BASE- WORST</td><td>tight endMartavisBryant to gettheballback,but the throw from Smith to Davis Webb is incomplete,which could lead to an incompletion. -The Chiefs are now 5-2 after winning</td></tr><tr><td>BIT-BASE</td><td>help the Chiefs win this game.His completion of a deep ball to wide receiver Sammy Watkins is a nice sign. -Jalen Ramsey should be back in the lineup today.The Jaguars are going</td></tr><tr><td>GOLD</td><td>receivers AlbertWilsonand Tyreek Hill.The footwork by Wilson on the deep ball was amazing and Hill's ball-tracking skills were on point as usual. Good things happen when Smith trusts</td></tr><tr><td rowspan="5">llhas anamazing ability to detoxify itself namely by the liver, kidneys,and skin,”she says.Detox programs and diets do sometimes make people feel better, but that happens more often if you're eating and/or drinking things that make feel like crap (something it doesn't sound like Kardashian was doing in the first place). And if, somehow,you discover that you have elevated levels of mercury orlead in yourbody likeKardashian said she had, it's important to figure out why,Dr. Wider says.“Finding the source is extremely important for</td><td>BASE LM</td><td>can't say 'no or I've never seen something of that value, so I'll try and find it again and see what happens.” So don't be afraid to find a way to detox or</td></tr><tr><td>BALM</td><td>want to get the full picture and not just have to look at the whole picture,”she says.“It can be a great idea to talk to your doctor to determine what's causing your symptoms."</td></tr><tr><td>BIT-BASE- WORST</td><td>can get rid of toxins that are found in foods like whole wheat bread, nuts like walnuts,walnuts and walnuts,”she says."If a source of the metals has elevated levels of</td></tr><tr><td>BIT-BASE</td><td>can't say,Oh my God, it'sa lead,but Im fine.’But it's definitely a problem in our bodies,’she says.“And if it's a problem in</td></tr><tr><td>GOLD</td><td>canlower your exposure over time,”she says.Meaning,a detox diet probably isn't going to help you as much as,say, reducing your intake of foods that are high in mercury (like</td></tr></table>
|
| 364 |
+
|
| 365 |
+
Table 5: Example generations when BIT-BASE outperforms BALM according to human evaluation. BITBASE-WORST shows the LM sample with the highest energy score.
|
| 366 |
+
|
| 367 |
+
<table><tr><td>Prefix</td><td>Model</td><td>Generation</td></tr><tr><td rowspan="5">l2but as the audio only came on halfway through the incident, it did not record his initial words to the girl or her response.It was also dropped in the hallway during their interaction,so it did not record any of what happened once the two left the library. Jones brought heroutside to the library's front steps,where he waited for responding officers to arrive.They did not call for an ambulance,according to the lawsuit.Rather, when the officers arrived, they told her to spit blood on the grass instead of the concrete,and to move from the steps to a bench. Some 2O minutes</td><td>BASE LM</td><td>later, she was dead,according to the lawsuit.“It's not uncom- mon for an oficer to spit blood on an unarmed,vulnerable adult.The use of spit is illegal in a public place,”</td></tr><tr><td>BALM</td><td>later,Joneswasarrested for disorderlyconductand released after posting bond, the suit said. She was arrested again on May 2.In the suit,Jones is seeking more than $1 million.A later,he walked up on the ground,where theybegan to yell</td></tr><tr><td>BIT-BASE- WORST</td><td>and yell again.When Jones refused, the officers ordered him not to leave or leave any more.Jones then pulled his gun on after the officersarrival, Jonesand the girl left the library</td></tr><tr><td>BIT-BASE to</td><td>and headed to the parking lot of a nearby apartment complex. “This is the type of behavior that is most likely to cause harm</td></tr><tr><td>GOLD</td><td>later,J.G'smotherarrived and took herdaughter to Cleveland Clinic in Lakewood,where she was treated fora dislocated jaw,ahead injury,andaninjuryto herknee.</td></tr><tr><td rowspan="6">13,Bronson said.“The initiative provides a variety of supports to early childhood programs'children, families and staff.The resources provided through this partnership increase the quality of the participating programs,which benefits the community and impacts our future in such a positive way,” Scott said. Visit PNCGrowUpGreat.com/donorschoose.\nHere are Varsity sports headlines for April 13,20i8.Refresh to get the latest as we add news throughout the night as we collect scores:Best of the best in track and field Our Sentinel coverage area top performers lists for girls track and field 14leaders meeting November 17-18 in Papua New</td><td>BASE LM</td><td>atthe Varsity Track&Field Invite.\nThe U.S.Army Corps of Engineers has approved $2 billion in construction work along the U.S.-Mexico boundary as a way to</td></tr><tr><td>BALM</td><td>.Check back frequently forupdates.The Sentinel also hasa feature on the boys basketball and wrestling teams.Boys golf The Sentinel boys golf and wrestling teams have been one of those teams who has had some</td></tr><tr><td>BIT-BASE- WORST</td><td>.nLONDON,April 13 (IFR) - The following are some of the main factors expected to affect Spanish corporate bond prices on Wednesday.BAML: Spanish sovereign wealth fund PPV</td></tr><tr><td>BIT-BASE</td><td>.nAfewweeksback,it's beenrumored thattheHTCDesire was going to be the company's last flagship phone,and now, a new leak has confirmed that it</td></tr><tr><td>GOLD</td><td>and boys trackand field areupdated goinginto the Saturday district meets.The season is heating up with more district and region races coming up next week. Click these links for girls top performers and boys top</td></tr><tr><td>BASE LM</td><td>UAA),General Motors (NYSE:GM) on November 4;and Procter & Gamble (NYSE:PG) for October.On the retail</td></tr><tr><td rowspan="5">Guinea as potential Xi-Trump meet dates. If all else fails,Trump and Xi are also expected to meet fora bit at the G2O meeting at the end of November. On the economic calendar next week, the update on jobs and the U.S.trade deficit are the headliners on November2. Notable earnings reports:Akamai Technologies (NASDAQ:AKAM),Mondelez International (NASDAQ:MDLZ) and Olin Corp.(NYSE:OLN) on October 29;Under Armour (NYSE:</td><td>BALM</td><td>front,Lowe's Companies (NYSE:L UA)on October 30;CVS Health(NASDAQ:CVS)on November 27;Intel Corporation (NASDAQ:INTC) on Oc-</td></tr><tr><td>BIT-BASE-</td><td>tober 28;and Verizon Communications (NYSE:V UAA) and Adidas (OTCPK:ADDYYF; OTCQX:ADDYYFGF;OLYMP),on November 30;and</td></tr><tr><td>WORST BIT-BASE</td><td>Qualcomm Incorporated (NASDAQ: UAA),Johnson Controls(NYSE:JCI) and Cisco Systems (NASDAQ:CSCO) on November 6.\nA woman who had to</td></tr><tr><td></td><td>have her nose and mouth taped as punishment UAA), eBay (NASDAQ:EBAY), General Electric</td></tr><tr><td>GOLD</td><td>(NYSE:GE), Coca-Cola (NYSE:KO),Pfizer (NYSE:PFE) and Electronic Arts (NAS</td></tr></table>
|
| 368 |
+
|
| 369 |
+
Table 6: Example generations when BIT-BASE underperforms BALM according to human evaluation. BITBASE-WORST shows the LM sample with the highest energy score.
|
md/train/B1s6xvqlx/B1s6xvqlx.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/train/BJlrSmbAZ/BJlrSmbAZ.md
ADDED
|
@@ -0,0 +1,614 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# BAYESIAN UNCERTAINTY ESTIMATION FOR BATCH NORMALIZED DEEP NETWORKS
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Deep neural networks have led to a series of breakthroughs, dramatically improving the state-of-the-art in many domains. The techniques driving these advances, however, lack a formal method to account for model uncertainty. While the Bayesian approach to learning provides a solid theoretical framework to handle uncertainty, inference in Bayesian-inspired deep neural networks is difficult. In this paper, we provide a practical approach to Bayesian learning that relies on a regularization technique found in nearly every modern network, batch normalization. We show that training a deep network using batch normalization is equivalent to approximate inference in Bayesian models, and we demonstrate how this finding allows us to make useful estimates of the model uncertainty. Using our approach, it is possible to make meaningful uncertainty estimates using conventional architectures without modifying the network or the training procedure. Our approach is thoroughly validated in a series of empirical experiments on different tasks and using various measures, showing it to outperform baselines on a majority of datasets with strong statistical significance.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Deep learning has dramatically advanced the state of the art in a number of domains, and now surpasses human-level performance for certain tasks such as recognizing the contents of an image (He et al., 2015) and playing Go (Silver et al., 2017). But, despite their unprecedented discriminative power, deep networks are prone to make mistakes. Sometimes, the consequences of mistakes are minor – misidentifying a food dish or a species of flower (Liu et al., 2016) may not be life threatening. But deep networks can already be found in settings where errors carry serious repercussions such as autonomous vehicles (Chen et al., 2016) and high frequency trading. In medicine, we can soon expect automated systems to screen for skin cancer (Esteva et al., 2017), breast cancer (Shen, 2017), and to diagnose biopsies (Djuric et al., 2017). As autonomous systems based on deep learning are increasingly deployed in settings with the potential to cause physical or economic harm, we need to develop a better understanding of when we can be confident in the estimates produced by deep networks, and when we should be less certain.
|
| 12 |
+
|
| 13 |
+
Standard deep learning techniques used for supervised learning lack methods to account for uncertainty in the model, although sometimes the classification network’s output vector is mistakenly understood to represent the model’s uncertainty. The lack of a confidence measure can be especially problematic when the network encounters conditions it was not exposed to during training. For example, if a network trained to recognize dog breeds is given an image of a cat, it may predict it to belong to a breed of small dog with high probability. When exposed to data outside of the distribution it was trained on, the network is forced to extrapolate, which can lead to unpredictable behavior. In such cases, if the network can provide information about its uncertainty in addition to its point estimate, disaster may be avoided. This work focuses on estimating such predictive uncertainties in deep networks (Figure 1).
|
| 14 |
+
|
| 15 |
+
The Bayesian approach provides a solid theoretical framework for modeling uncertainty (Ghahramani, 2015), which has prompted several attempts to extend neural networks (NN) into a Bayesian setting. Most notably, Bayesian neural networks (BNNs) have been studied since the 1990’s (Neal, 2012). Although they are simple to formulate, BNNs require substantially more computational resources than their non-Bayesian counterparts, and inference is difficult. Importantly, BNNs do not scale well and struggle to compete with modern deep learning architectures. Recently, Gal & Ghahramani (2015) developed a practical solution to obtain uncertainty estimates by casting dropout training in conventional deep networks as an approximate Bayesian model. They showed that any network trained with dropout is an approximate Bayesian model, and uncertainty estimates can be obtained by computing the variance on multiple predictions with different dropout masks.
|
| 16 |
+
|
| 17 |
+

|
| 18 |
+
Figure 1: We propose a method to estimate uncertainty in any network using batch normalization (MCBN). Here, we show results on a toy dataset from networks with three hidden layers (30 units per layer). The solid line is the predictive mean of 500 stochastic forward passes. The outer area depicts the model’s uncertainty as the $9 5 \%$ CI of the predictive distribution for each $x$ value (inner shaded area is $50 \%$ CI). On the right, we show a similar plot using dropout to estimate uncertainty (MCDO) (Gal & Ghahramani, 2015). The bottom row depicts a minimally useful baseline – the same networks but with a constant uncertainty (CUBN, CUDO).
|
| 19 |
+
|
| 20 |
+
This technique, called Monte Carlo Dropout (MCDO), has a very attractive quality: it can be applied to existing NNs without any modification to the architecture or the way the network is trained. Uncertainty estimates come (nearly) for free. However, in recent years dropout has fallen out of favor, limiting MCDO’s utility. Google’s Inception network, which won ILSVRC in 2014, did not use dropout (Szegedy et al., 2015), nor did the ILSVRC 2015 winner, Microsoft’s residual learning network (He et al., 2016). In place of traditional techniques like dropout, most modern networks such as Inception and ResNet have adopted other regularization techniques. In particular, batch normalization (BN) has become widespread thanks to its ability to stabilize learning with improved generalization (Ioffe & Szegedy, 2015).
|
| 21 |
+
|
| 22 |
+
An interesting aspect of BN is that the mini-batch statistics used for training each iteration depend on randomly selected batch members. We exploit this stochasticity and show that training using batch normalization, like dropout, is equivalent to approximate inference in Bayesian models1. We demonstrate how this finding allows us to make meaningful estimates of the model uncertainty in a technique we call Monte Carlo Batch Normalization (MCBN) (Figure 1). The method we propose makes no simplifying assumptions on the use of batch normalization, and applies to any network using BN as it appears in practical applications.
|
| 23 |
+
|
| 24 |
+
We validate our approach by empirical experiments on eight standard datasets used for uncertainty estimation. We measure uncertainty quality relative to a baseline of fixed uncertainty, and show that MCBN outperforms the baseline on nearly all datasets with strong statistical significance. We also show that the uncertainty quality of MCBN is on par with that of MCDO. As a practical demonstration of MCBN, we apply our method to estimate segmentation uncertainty using a conventional segmentation network (Badrinarayanan et al., 2015). Finally, as part of our evaluation, we make contributions to the methodology of measuring uncertainty quality by defining performance bounds on existing metrics and proposing a new visualization that provides an intuitive understanding of uncertainty quality.
|
| 25 |
+
|
| 26 |
+
# 2 RELATED WORK
|
| 27 |
+
|
| 28 |
+
Bayesian models provide a natural framework for modeling uncertainty, and several approaches have been developed to adapt NNs to Bayesian reasoning. A common approach is to place a prior distribution (often a Gaussian) over each weight. For infinite weights, the resulting model corresponds to a Gaussian process (Neal, 1995), and for a finite number of weights it corresponds to a Bayesian neural network (MacKay, 1992). Although simple to formulate, inference in BNNs is difficult (Gal, 2016). Therefore, focus has shifted to techniques to approximate the posterior distribution, leading to approximate BNNs. Methods based on variational inference (VI) typically rely on a fully factorized approximate distribution (Kingma & Welling, 2014; Hinton & Van Camp, 1993) but these methods do not scale easily. To alleviate these difficulties, Graves (2011) proposed a model using sampling methods to estimate a factorized posterior. Another approach, probabilistic backpropagation (PBP), also estimates a factorized posterior based on expectation propagation (Hernandez-Lobato & Adams, 2015). ´
|
| 29 |
+
|
| 30 |
+
Deep Gaussian Processes (DGPs) formulate GPs as Bayesian models capable of working on large datasets with the aid of a number of strategies to address scaling and complexity requirements (Bui et al., 2016). The authors compare DGP with a number of state-of-the-art approximate BNNs, showing superior performance in terms of RMSE and uncertainty quality2. Another recent approach to Bayesian learning, Bayesian hypernetworks, use a neural network to learn a distribution of paramaters over another neural network (Krueger et al., 2017). Although these recent techniques address some of the difficulties with approximate BNNs, they all require modifications to the architecture or the way networks are trained, as well as specialized knowledge from practitioners.
|
| 31 |
+
|
| 32 |
+
Recently, Gal (2016) showed that a network trained with dropout implicitly performs the VI objective. Therefore any network trained with dropout can be treated as an approx. Bayesian model by making multiple predictions as forward passes through the network while sampling different dropout masks for each prediction. An estimate of the posterior can be obtained by computing the mean and variance of the predictions. This technique, referred to here as MCDO, has been empirically demonstrated to be competitive with other approx. BNN methods and DGPs in terms of RMSE and uncertainty quality (Li & Gal, 2017). However, as the name implies, MCDO depends on dropout. While once ubiquitous in training deep learning models, dropout has largely been replaced by batch normalization in modern networks, limiting its usefulness.
|
| 33 |
+
|
| 34 |
+
# 3 METHOD
|
| 35 |
+
|
| 36 |
+
The methodology of this work is to pose a deep network trained with batch normalization as a Bayesian model in order to obtain uncertainty estimates associated with its predictions. In the following, we briefly introduce Bayesian models and a variational approximation to it using KullbackLeibler (KL) divergence following Gal & Ghahramani (2015). We continue by showing a batch normalized deep network can be seen as an approximate Bayesian model. Then, by employing theoretical insights as well as empirical analysis, we study the induced prior on the parameters when using batch normalization. Finally, we describe the procedure we use for estimating uncertainty of batch normalized deep networks’ output.
|
| 37 |
+
|
| 38 |
+
# 3.1 BAYESIAN MODELING
|
| 39 |
+
|
| 40 |
+
We assume a finite training set $\mathbf { D } = \{ ( \mathbf { x } _ { i } , \mathbf { y } _ { i } ) \} _ { i = 1 : N }$ where each $\left( \mathbf { x } _ { i } , \mathbf { y } _ { i } \right)$ is a sample-label pair. Using $\mathbf { D }$ , we are interested in learning an inference function $f _ { \omega } ( { \bf x } , { \bf y } )$ with parameters $\omega$ . In deterministic models, the estimated label $\hat { \mathbf { y } }$ is obtained as follows:
|
| 41 |
+
|
| 42 |
+
$$
|
| 43 |
+
\hat { \mathbf { y } } = \arg \operatorname* { m a x } _ { \mathbf { y } } f _ { \omega } ( \mathbf { x } , \mathbf { y } )
|
| 44 |
+
$$
|
| 45 |
+
|
| 46 |
+
We assume $f _ { \omega } ( \mathbf { x } , \mathbf { y } ) = p ( \mathbf { y } | \mathbf { x } , \omega )$ (e.g. in soft-max classifiers), and is normalized to a proper probability distribution. In Bayesian modeling, in contrast to finding a point estimate of the model parameters, the idea is to estimate an (approximate) posterior distribution of the model parameters
|
| 47 |
+
|
| 48 |
+
$p ( \omega | \mathbf { D } )$ to be used for probabilistic prediction:
|
| 49 |
+
|
| 50 |
+
$$
|
| 51 |
+
p ( \mathbf { y } | \mathbf { x } , \mathbf { D } ) = \int f _ { \omega } ( \mathbf { x } , \mathbf { y } ) p ( \omega | \mathbf { D } ) d \omega
|
| 52 |
+
$$
|
| 53 |
+
|
| 54 |
+
The predicted label, $\hat { \mathbf { y } }$ , can then be accordingly obtained by sampling $p ( \mathbf { y } | \mathbf { x } , \mathbf { D } )$ or takings its maxima.
|
| 55 |
+
|
| 56 |
+
Variational Approximation In approximate Bayesian modeling, it is a common approach to learn a parametrized approximating distribution $q _ { \pmb { \theta } } ( \pmb { \omega } )$ that minimizes $\mathrm { K L } ( q _ { \boldsymbol { \theta } } ( \omega ) | | p ( \omega | \mathbf { D } ) )$ ; the Kullback-Leibler (KL) divergence of posterior w.r.t. its approximation, instead of the true posterior. Minimizing this KL divergence is equivalent to the following minimization while being free of the data term $\bar { p ( \mathbf { D } ) }$ 3 :
|
| 57 |
+
|
| 58 |
+
$$
|
| 59 |
+
\mathcal { L } _ { \mathrm { V A } } ( \pmb { \theta } ) : = - \sum _ { i = 1 } ^ { N } \int q _ { \pmb { \theta } } ( \pmb { \omega } ) \ln f _ { \omega } ( \mathbf { x } _ { i } , \mathbf { y } _ { i } ) \mathrm { d } \pmb { \omega } + \mathrm { K L } \big ( q _ { \pmb { \theta } } ( \pmb { \omega } ) \big | \big | p ( \pmb { \omega } ) \big )
|
| 60 |
+
$$
|
| 61 |
+
|
| 62 |
+
Using Monte Carlo integration to approximate the integral with one realized $\hat { \omega } _ { i }$ for each sample $i ^ { 4 }$ and optimizing over mini-batches of size $M$ , the approximated objective becomes:
|
| 63 |
+
|
| 64 |
+
$$
|
| 65 |
+
\hat { \mathcal { L } } _ { \mathrm { V A } } ( \pmb { \theta } ) : = - \frac { N } { M } \sum _ { i = 1 } ^ { M } \ln f _ { \pmb { \omega } _ { i } } ( \mathbf { x } _ { i } , \mathbf { y } _ { i } ) + \mathrm { K L } \big ( q _ { \pmb { \theta } } ( \pmb { \omega } ) \big | \big | p ( \pmb { \omega } ) \big )
|
| 66 |
+
$$
|
| 67 |
+
|
| 68 |
+
The first term is the data likelihood and the second term is divergence of the model prior w.r.t. the approximated distribution.
|
| 69 |
+
|
| 70 |
+
We now describe the optimization procedure of a deep network with batch normalization and draw the resemblance to the approximate Bayesian modeling in Eq (1).
|
| 71 |
+
|
| 72 |
+
# 3.2 BATCH NORMALIZED DEEP NETS AS BAYESIAN MODELING
|
| 73 |
+
|
| 74 |
+
The inference function of a feed-forward deep network with $L$ layers can be described as:
|
| 75 |
+
|
| 76 |
+
$$
|
| 77 |
+
f _ { \omega } ( \mathbf { x } ) = \mathbf { W } ^ { L } { a } ( \mathbf { W } ^ { L - 1 } . . . a ( \mathbf { W } ^ { 2 } { a } ( \mathbf { W } ^ { 1 } \mathbf { x } ) )
|
| 78 |
+
$$
|
| 79 |
+
|
| 80 |
+
where $a ( . )$ is an element-wise nonlinearity function and $\mathbf { W } ^ { l }$ is the weight vector at layer $l$ . Furthermore, we denote the input to layer $l$ as $\mathbf { x } ^ { l }$ with $\mathbf { x } ^ { 1 } = \mathbf { x }$ and we then set $\mathbf { h } ^ { l } = \mathbf { W } ^ { l } \mathbf { x } ^ { l }$ . Parenthesized super-index for matrices (e.g. $\mathbf { W } ^ { ( j ) }$ ) and vectors (e.g. $x ^ { ( j ) }$ ) indicates $j$ th row and element respectively. Super-index $u$ refers to a specific unit at layer $l$ , (e.g. $\mathbf { W } ^ { u } = \mathbf { W } ^ { l , ( j ) } , h ^ { u } = h ^ { l , ( j ) } )$ . 5
|
| 81 |
+
|
| 82 |
+
Batch Normalization Each layer of a deep network is constructed by several linear units whose parameters are the rows of the weight matrix $\mathbf { W }$ . Batch normalization is a unit-wise operation proposed in Ioffe & Szegedy (2015) to standardize the distribution of each unit’s input. It essentially converts a unit’s output $h ^ { u }$ in the following way:
|
| 83 |
+
|
| 84 |
+
$$
|
| 85 |
+
\hat { h } ^ { u } = \frac { h ^ { u } - \mathbb { E } [ h ^ { u } ] } { \sqrt { \operatorname { V a r } [ h ^ { u } ] } }
|
| 86 |
+
$$
|
| 87 |
+
|
| 88 |
+
where the expectations are computed over the training $\mathrm { s e t } ^ { 6 }$ . However, often in deep networks, the weight matrices are optimized using back-propagated errors calculated on mini-batches of data. Therefore, during training, the estimated mean and variance on the mini-batch $\mathbf { B }$ is used, which we denote by $\pmb { \mu _ { \mathrm { B } } }$ and $\pmb { \sigma _ { \mathbf { B } } }$ respectively. This makes the inference at training time for a sample $\mathbf { x }$ a stochastic process, varying based on other samples in the mini-batch.
|
| 89 |
+
|
| 90 |
+
Loss Function and Optimization Training deep networks with mini-batch optimization involves a (regularized) risk minimization with the following form:
|
| 91 |
+
|
| 92 |
+
$$
|
| 93 |
+
\mathcal { L } _ { \mathrm { R R } } ( \omega ) : = \frac { 1 } { M } \sum _ { i = 1 } ^ { M } l ( \hat { \bf y } _ { i } , { \bf y } _ { i } ) + \Omega ( \omega )
|
| 94 |
+
$$
|
| 95 |
+
|
| 96 |
+
Where the first term is the empirical loss on the training data and the second term is a regularization penalty acting as a prior on model parameters $\omega$ . If the loss $l$ is cross-entropy for classification or sum-of-squares for regression problems (assuming i.i.d. Gaussian noise on labels), the first term is equivalent to minimizing the negative log-likelihood:
|
| 97 |
+
|
| 98 |
+
$$
|
| 99 |
+
\mathcal { L } _ { \mathrm { R R } } ( \omega ) : = - \frac { 1 } { M \tau } \sum _ { i = 1 } ^ { M } \ln f _ { \omega } ( \mathbf { x } _ { i } , \mathbf { y } _ { i } ) + \Omega ( \omega ) .
|
| 100 |
+
$$
|
| 101 |
+
|
| 102 |
+
$\tau { \it \Delta \phi } = 1$ normalized network thhe learnable parameters , we get the following ob $\{ \mathbf { W } ^ { 1 : L } , \gamma ^ { 1 : L } , \beta ^ { 1 : L } , \mu _ { \mathbf { B } } ^ { 1 : L } , \pmb { \sigma _ { \mathbf { B } } ^ { 1 : L } } \}$ $\pmb { \theta } = \{ \mathbf { W } ^ { 1 : L } , \gamma ^ { 1 : L } , \beta ^ { 1 : L } \}$ $\boldsymbol \omega = \{ \mu _ { \mathrm { B } } ^ { 1 : L } , \sigma _ { \mathrm { B } } ^ { 1 : L } \}$ mini-batch optimization of a batch normalized network:
|
| 103 |
+
|
| 104 |
+
$$
|
| 105 |
+
\mathcal { L } _ { \mathrm { R R } } ( \pmb { \theta } ) : = - \frac { 1 } { M \tau } \sum _ { i = 1 } ^ { M } \ln f _ { \{ \pmb { \theta } , \hat { \pmb { \omega } } _ { i } \} } ( \mathbf { x } _ { i } , \mathbf { y } _ { i } ) + \Omega ( \pmb { \theta } )
|
| 106 |
+
$$
|
| 107 |
+
|
| 108 |
+
where $\hat { \omega } _ { i }$ is the mean and variances for sample $i$ ’s mini-batch at a certain training step. Note that while $\hat { \omega } _ { i }$ formally needs to be i.i.d. for each training example, a batch normalized network samples the stochastic parameters once per training step (mini-batch). For a large number of epochs, however, the distribution of sampled batch members for a given training example converges to the i.i.d. case.
|
| 109 |
+
|
| 110 |
+
Comparing Eq. (1) and Eq. (2) reveals that the optimization objectives are identical, if there exists a prior $p ( \omega )$ corresponding to $\Omega ( \theta )$ such that $\begin{array} { r } { \frac { \partial } { \partial \theta } \mathrm { K L } ( q _ { \theta } ( \omega ) | | \overline { { p } } ( \omega ) ) = N \tau \frac { \partial } { \partial \theta } \Omega ( \pmb { \theta } ) } \end{array}$ . In a batch normalized network, $q _ { \pmb { \theta } } ( \pmb { \omega } )$ corresponds to the joint distribution of the normalization parameters $\mu _ { \mathbf { B } } ^ { 1 : L } , \sigma _ { \mathbf { B } } ^ { 1 : L }$ , as implied by the repeated sampling from $\mathbf { D }$ during training. This is an approximation of the true posterior, where we have restricted the posterior to lie within the domain of our parametric network and source of randomness. With that we can use a pre-trained batch normalized network to estimate the uncertainty of its prediction using the inherent stochasticity of BN. Before that, we briefly discuss what Bayesian prior is induced in a typical batch normalized network.
|
| 111 |
+
|
| 112 |
+
# 3.3 PRIOR $p ( \omega )$
|
| 113 |
+
|
| 114 |
+
The purpose of $\Omega ( \theta )$ is to reduce variance in deep networks. L2-regularization, also referred to as weight decay $\begin{array} { r } { ( \Omega ( \pmb { \theta } ) = \lambda \sum _ { l = 1 : L } | | W ^ { l } | | ^ { 2 } ) } \end{array}$ , is a popular technique in deep learning. The induced prior from L2-regularization is studied in Appendix 6.5. Under some approximations as outlined in the Appendix, we find that BN for a deep network with FC layers and ReLU activations induce Gaussian distributions over BN unit’s means and standard deviations, centered around the population values given by $\mathbf { D }$ (Eq. (6), details in Appendix 6.3). Factorizing this distribution across all stochastic parameters and assuming Gaussian priors, we find the approximate corresponding priors:
|
| 115 |
+
|
| 116 |
+
$$
|
| 117 |
+
\begin{array} { l } { { \displaystyle p ( { \boldsymbol \mu } _ { \mathbf { B } } ^ { u } ) = \mathcal { N } ( 0 , \frac { J _ { l - 1 } x ^ { 2 } } { 2 N \tau \lambda _ { l } } ) } } \\ { { \displaystyle p ( \boldsymbol \sigma _ { \mathbf { B } } ^ { u } ) = \mathcal { N } ( \mu _ { p } , \sigma _ { p } ^ { 2 } ) } } \end{array}
|
| 118 |
+
$$
|
| 119 |
+
|
| 120 |
+
where $J _ { l - 1 }$ is the dimensionality of the layer’s inputs and $x$ is the average input over $\mathbf { D }$ for all input units. In the absence of scale and shift transformations from the previous BN layer, it converges towards an exact prior for large training datasets and deep networks (under the assumptions of the factorized distribution). The mean and variance for the BN unit’s standard deviation, $\mu _ { p }$ and $\sigma _ { p } ^ { 2 }$ have no relevance for the reconciliation of the optimization objectives of Eq. (1) and (2).
|
| 121 |
+
|
| 122 |
+
# 3.4 PREDICTIVE UNCERTAINTY IN BATCH NORMALIZED DEEP NETS
|
| 123 |
+
|
| 124 |
+
In the absence of the true posterior we rely on the approximate posterior to express an approximate predictive distribution:
|
| 125 |
+
|
| 126 |
+
$$
|
| 127 |
+
p ^ { * } ( \mathbf { y } | \mathbf { x } , \mathbf { D } ) : = \int f _ { \omega } ( \mathbf { x } , \mathbf { y } ) q _ { \pmb { \theta } } ( \omega ) d \omega
|
| 128 |
+
$$
|
| 129 |
+
|
| 130 |
+
Following Gal & Ghahramani (2015) we estimate the first and second moment of the predictive distribution empirically (see Appendix 6.4 for details). For regression, the first two moments are:
|
| 131 |
+
|
| 132 |
+
$$
|
| 133 |
+
\begin{array} { r l } & { \displaystyle \mathbb { E } _ { p ^ { * } } [ \mathbf { y } ] \approx \frac { 1 } { T } \sum _ { i = 1 } ^ { T } f _ { \boldsymbol { \hat { \omega } } _ { i } } ( \mathbf { x } ) } \\ & { \displaystyle \mathbf { C o v } _ { p ^ { * } } [ \mathbf { y } ] \approx \tau ^ { - 1 } \mathbf { I } + \frac { 1 } { T } \sum _ { i = 1 } ^ { T } f _ { \boldsymbol { \hat { \omega } } _ { i } } ( \mathbf { x } ) ^ { \top } f _ { \boldsymbol { \hat { \omega } } _ { i } } ( \mathbf { x } ) - \mathbb { E } _ { p ^ { * } } [ \mathbf { y } ] ^ { \top } \mathbb { E } _ { p ^ { * } } [ \mathbf { y } ] } \end{array}
|
| 134 |
+
$$
|
| 135 |
+
|
| 136 |
+
where each way as duri $\hat { \omega } _ { i }$ corresponds to sam training. Sampling ng the net’s stochastic parameters therefore involves sampling a b $\boldsymbol \omega = \{ \mu _ { \mathbf { B } } ^ { 1 : L } , \sigma _ { \mathbf { B } } ^ { 1 : L } \}$ σ1:L} the sameaining set $\hat { \omega } _ { i }$ $\mathbf { B }$ and updating the parameters in the BN units, just as if we were taking a training step with B. Recall that from a VA perspective, training the network amounted to minimizing $\mathrm { K L } ( q _ { \boldsymbol { \theta } } ( \omega ) | | p ( \omega | \mathbf { D } ) )$ wrt $\pmb { \theta }$ . Sampling $\hat { \omega } _ { i }$ from the training set, and keeping the size of $\mathbf { B }$ consistent with the mini-batch size used during training, ensures that $q _ { \boldsymbol { \theta } } ( \omega )$ during inference remains identical to the approximate posterior optimized during training.
|
| 137 |
+
|
| 138 |
+
After each update of the net’s stochastic parameters, we take a forward pass with input $\mathbf { x }$ , producing output $f _ { \hat { \omega } _ { i } } ( \mathbf { x } )$ . After $T$ such stochastic forward passes, we compute the mean and sample variance of outputs to find the mean $\mathbb { E } _ { p ^ { * } } [ \mathbf { y } ]$ and variance $\bar { \mathrm { C o v } } _ { p ^ { * } } [ \mathbf { y } ]$ of the approximate predictive distribution. Note that $\mathrm { C o v } _ { p ^ { * } } [ \mathbf { y } ]$ also requires addition of constant variance from observation noise, ${ \boldsymbol { \tau } } ^ { - 1 } \mathbf { I }$ .
|
| 139 |
+
|
| 140 |
+
The network is trained just as a regular BN network. The difference is in using the trained network for prediction. Instead of replacing $\omega = \{ \mu _ { \mathrm { B } } ^ { 1 : L } , \sigma _ { \mathrm { B } } ^ { 1 : L } \}$ with population values from $\mathbf { D }$ , we update these parameters stochastically, once for each forward pass .7
|
| 141 |
+
|
| 142 |
+
The form of $p ^ { * }$ can be approximated by a Gassuian for each output dimension (for regression). We assume bounded domains for each input dimension, wide layers throughout the network, and a unimodal distribution of weights centered at 0. By the Liapounov CLT condition, the first layer then receives approximately Gaussian inputs (a proof can be found in Lehmann (1999)). Having sampled $\mu _ { \mathbf { B } } ^ { u }$ and $\sigma _ { \mathbf { B } } ^ { u }$ from a mini-batch, each BN unit’s output is bounded. CLT thereby continues to hold for deeper layers, including $f _ { \omega } ( \mathbf { x } ) = \mathbf { W } ^ { L } \mathbf { x } ^ { L }$ . A similar motivation for a Gaussian approximation of Dropout has been presented by Wang & Manning (2013).
|
| 143 |
+
|
| 144 |
+
The actual form of $p ^ { * }$ is likely to be highly multimodal, as can be seen immediately from $f _ { \omega } ( { \bf x } ) =$ $\mathbf { W } ^ { L } \mathbf { x } ^ { L }$ with elements in $\mathbf { x } ^ { L }$ normalized, scaled and shifted differently. Gal & Ghahramani (2015) note the multimodality as well, since MCDO implies a bimodal variational distribution over each weight matrix column.
|
| 145 |
+
|
| 146 |
+
# 4 EXPERIMENTS AND RESULTS
|
| 147 |
+
|
| 148 |
+
We assess the uncertainty quality of MCBN quantitatively and qualitatively. Our quantitative analysis relies on eight standard regression datasets, listed in Table 1. Publicly available from the UCI Machine Learning Repository (University of California, 2017) and Delve (Ghahramani, 1996), these datasets have been used to benchmark comparative models in recent related literature (see Hernandez-Lobato & Adams (2015), Gal & Ghahramani (2015), Bui et al. (2016) and Li & Gal ´ (2017)). We report results using standard metrics, and also propose useful upper and lower bounds to normalize these metrics for a more meaningful interpretation in Section 4.2.
|
| 149 |
+
|
| 150 |
+
<table><tr><td>Dataset name</td><td>N</td><td>Q</td><td>Target Feature</td></tr><tr><td>Boston Housing</td><td>506</td><td>13</td><td rowspan="6">Heating Load</td></tr><tr><td>Concrete Compressive Strength</td><td>1,030</td><td>8</td></tr><tr><td>Energy Efficiency</td><td>768</td><td>8</td></tr><tr><td>Kinematics 8nm</td><td>8,192</td><td>8</td></tr><tr><td>Power Plant</td><td>9,568</td><td>4</td></tr><tr><td>Protein Tertiary Structure</td><td>45,730</td><td>9</td></tr><tr><td>Wine Quality (Red)</td><td>1,599</td><td>11</td></tr><tr><td>Yacht Hydrodynamics</td><td>308</td><td>6</td></tr></table>
|
| 151 |
+
|
| 152 |
+
Table 1: Properties of the eight regression datasets used to evaluate MCBN. $N$ is the dataset size and $Q$ is the n.o. input features. Only one target feature was used. In cases where the raw datasets contain more than one target feature, the feature used is specified by target feature.
|
| 153 |
+
|
| 154 |
+
Our qualitative results consist of three parts. First, in Figure 1 we demonstrate that MCBN produces reasonable uncertainty bounds on a toy dataset in the style of (Karpathy, 2015). Second, we develop a new visualization of uncertainty quality by plotting test errors sorted by predicted variance in Figure 2. Finally, we apply MCBN to SegNet (Kendall et al., 2015), demonstrating the benefits of MCBN in an existing batch normalized network.
|
| 155 |
+
|
| 156 |
+
# 4.1 METRICS
|
| 157 |
+
|
| 158 |
+
We evaluate uncertainty quality based on two metrics, described below: Predictive Log Likelihood (PLL) and Continuous Ranked Probability Score (CRPS). We also propose upper and lower bounds for these metrics which can be used to normalize them and provide a more meaningful interpretation.
|
| 159 |
+
|
| 160 |
+
Predictive Log Likelihood (PLL) Predictive Log Likelihood is a widely accepted metric for uncertainty quality, used as the main uncertainty quality metric for regression (e.g. (Hernandez-Lobato ´ & Adams, 2015), (Gal & Ghahramani, 2015), (Bui et al., 2016) and (Li & Gal, 2017)). A key property is that PLL makes no assumtions about the form of the distribution. The measure is defined for a probabilistic model $f _ { \omega } ( \mathbf { x } )$ and a single observation $\left( \mathbf { y } _ { i } , \mathbf { x } _ { i } \right)$ as:
|
| 161 |
+
|
| 162 |
+
$$
|
| 163 |
+
\operatorname { P L L } ( f _ { \omega } ( \mathbf { x } ) , ( \mathbf { y } _ { i } , \mathbf { x } _ { i } ) ) = \log p ( \mathbf { y } _ { i } | f _ { \omega } ( \mathbf { x } _ { i } ) )
|
| 164 |
+
$$
|
| 165 |
+
|
| 166 |
+
where $p ( \mathbf { y } _ { i } | f _ { \omega } ( \mathbf { x } _ { i } ) )$ is the model’s predicted PDF evaluated at $\mathbf { y } _ { i }$ , given the input $x _ { i }$ . A more detailed description is given in Appendix 6.4. The metric is unbounded and maximized by a perfect prediction (mode at $\mathbf { y } _ { i }$ ) with no variance. As the predictive mode moves away from $\mathbf { y } _ { i }$ , increasing the variance tends to increase PLL (by maximizing probability mass at $\mathbf { y } _ { i }$ ). While PLL is an elegant measure, it has been criticized for allowing outliers to have an overly negative effect on the score (Selten, 1998).
|
| 167 |
+
|
| 168 |
+
Continuous Ranked Probability Score (CRPS) Continuous Ranked Probability Score is a less sensitive measure that takes the full predicted PDF into account. A prediction with low variance that is slightly offset from the true observation will receive a higher score form CRPS than PLL. In order for CRPS to be analytically tractable, we need to assume a Gaussian unimodal predictive distribution. CRPS is defined as
|
| 169 |
+
|
| 170 |
+
$$
|
| 171 |
+
\mathrm { C R P S } ( f _ { \omega } ( x _ { i } ) , ( y _ { i } , x _ { i } ) ) = \int _ { - \infty } ^ { \infty } \big ( F ( y ) - \mathbb { 1 } ( y \ge y _ { i } ) \big ) ^ { 2 } \mathrm { d } y
|
| 172 |
+
$$
|
| 173 |
+
|
| 174 |
+
where $F ( y )$ is the predictive CDF, and $\mathbb { 1 } ( y \geq y _ { i } ) = 1$ if $y \geq y _ { i }$ and 0 otherwise (for univariate distributions) (Gneiting $\&$ Raftery, 2007). CRPS is interpreted as the sum of the squared area between the CDF and 0 where $y < y _ { i }$ and between the CDF and 1 where $y \geq y _ { i }$ . A perfect prediction with no variance yields a CRPS of 0; for all other cases the value is larger. CRPS has no upper bound.
|
| 175 |
+
|
| 176 |
+
# 4.2 BENCHMARK MODELS AND NORMALIZED METRICS
|
| 177 |
+
|
| 178 |
+
In order to establish a lower bound on useful performance for uncertainty estimates, we define a baseline that predicts constant variance regardless of input. This benchmark model produces identical point estimates as MCBN, which yield the same predictive means. The variance is set to a fixed value that optimizes CRPS on validation data. This model reflects our best guess of constant variance on test data - any improvement in uncertainty quality from MCBN would indicate a sensible estimate of uncertainty. We call this model Constant Uncertainty BN (CUBN). Implementing MCDO as a comparative model, we similarly define a baseline for dropout, Constant Uncertainty Dropout (CUDO). The difference in variance modeling between MCBN, CUBN, MCDO and CUDO are visualized in plots of uncertainty bounds on toy data in Figure 1.
|
| 179 |
+
|
| 180 |
+
For a probabilistic model $f$ , an upper bound on uncertainty performance can also be defined for CRPS and PLL. For each observation $( y _ { i } , x _ { i } )$ , a value for the predictive variance $T _ { i }$ can be chosen that maximizes PLL or minimizes $\mathrm { C R P S } ^ { 8 }$ . Using CUBN as a lower bound and the optimized CRPS score as the upper bound, uncertainty estimates can be normalized between these bounds (1 indicating optimal performance, and 0 indicating performance on par with fixed uncertainty). We call this normalized measure $\begin{array} { r } { \overline { { \mathrm { C R P S } } } ~ = ~ \frac { \mathrm { C R P S } ( f , \overline { { ( y _ { i } , x _ { i } ) } } ) - \mathrm { C R P S } ( f _ { C U } , ( y _ { i } , x _ { i } ) ) } { \operatorname* { m i n } _ { T } \mathrm { C R P S } ( f , ( y _ { i } , x _ { i } ) ) - \mathrm { C R P S } ( f _ { C U } , ( y _ { i } , x _ { i } ) ) } \times 1 0 0 \ } \end{array}$ , and the PLL analogue $\begin{array} { r } { \overline { { \mathrm { P L L } } } = \frac { \mathrm { P L L } \left( f , ( y _ { i } , x _ { i } ) \right) - \mathrm { P L L } \left( f _ { C U } , ( y _ { i } , x _ { i } ) \right) } { \operatorname* { m a x } _ { T } \mathrm { P L L } \left( f , ( y _ { i } , x _ { i } ) \right) - \mathrm { P L L } \left( f _ { C U } , ( y _ { i } , x _ { i } ) \right) } \times 1 0 0 } \end{array}$ . This normalized measure gives an intuitive understanding of how close a Bayesian model is to estimating the perfect uncertainty for each prediction.
|
| 181 |
+
|
| 182 |
+
We also evaluate CRPS and $\overline { { \mathrm { P L L } } }$ for an adaptation of the authors’ implementation of Multiplicative Normalizing Flows (MNF) for variational Bayesian networks (Louizos & Welling, 2017). This is a recent model specialized to allow a more flexible posterior what is achievable by e.g. MCDO’s bimodal variational over weight columns. MNF uses auxillary variables on which the posterior is a latent. By applying normalizing flows to the auxillary variable such that it can take on complex distributions, the approximate posterior becomes highly flexible.
|
| 183 |
+
|
| 184 |
+
# 4.3 TEST SETUP
|
| 185 |
+
|
| 186 |
+
Our evaluation of MCBN and MCDO is largely comparable to that of Hernandez-Lobato & Adams ´ (2015), in that we use similar datasets and metrics. This setup was later also followed by Gal & Ghahramani (2015), where we in comparison implement a different hyperparameter selection, allow for a larger range of dropout rates, and use larger networks with two hidden layers.
|
| 187 |
+
|
| 188 |
+
With the exception of Protein Tertiary Structure9, all our models share a similar architecture: two hidden layers with 50 units each, using ReLU activations. Input and output data were normalized during training. Results were averaged over five random splits of $2 0 \%$ test and $8 0 \%$ training and cross-validation (CV) data. For each split, 5-fold CV by grid search with a RMSE minimization objective was used to find training hyperparameters and optimal n.o. epochs. For BN-based models, the hyperparameter grid consisted of a weight decay factor ranging from 0.1 to $1 ^ { - 1 5 }$ by a $\log 1 0$ scale, and a batch size range from 32 to 1024 by a $\log 2$ scale. For DO-based models, the hyperparameter grid consisted of the same weight decay range, and dropout probabilities in $\{ 0 . 2 , \bar { 0 . 1 } , \bar { 0 . 0 5 } , 0 . 0 1 , \bar { 0 . 0 0 5 } , 0 . 0 0 1 \}$ . DO-based models used a batch size of 32 in all evaluations.
|
| 189 |
+
|
| 190 |
+
The model with optimal training hyperparameters was used to optimize $\tau$ numerically. This optimization was made in terms of average CV CRPS for MCBN, CUBN, MCDO, and CUDO respectively, before evaluation on the test data.
|
| 191 |
+
|
| 192 |
+
All estimates for the predictive distribution were obtained by taking 500 stochastic forward passes through the network, throughout training and testing. The implementation was done with TensorFlow. The Adam optimizer was used to train all networks, with a learning rate of 0.001. The extensive part of the experiments (i.e. training and cross validation) was done on Amazon web services using 3000 machine-hours. All code necessary for reproducing both the quantitative and qualitative results is released in an anonymous github repository (https://github.com/iclr-mcbn/mcbn).
|
| 193 |
+
|
| 194 |
+
# 4.4 TEST RESULTS
|
| 195 |
+
|
| 196 |
+
A summary of the results measuring uncertainty quality of MCBN, MCDO and MNF are provided in Table 2. Tests are run over eight datasets using 5 random 80-20 splits of the data with 5 different random seeds each split. We report CRPS and PLL, expressed as a percentage, which reflects how close the model is to the upper bound. The upper bounds and lower bounds for each metric are de
|
| 197 |
+
|
| 198 |
+
<table><tr><td></td><td colspan="4">CRPS</td><td colspan="6">PLL</td></tr><tr><td>Dataset</td><td colspan="2">MCBN</td><td colspan="2">MCDO</td><td colspan="2">MCBN</td><td colspan="2">MCDO</td><td colspan="2">MNF</td></tr><tr><td>Boston</td><td>8.50 ****</td><td></td><td>3.06 ****</td><td>8.30 ****</td><td></td><td>10.49 ****</td><td></td><td>5.51 ****</td><td>3.58</td><td>***</td></tr><tr><td>Concrete</td><td>3.91 ****</td><td>0.93</td><td>*</td><td>6.05 ****</td><td>-36.36</td><td>**</td><td>10.92</td><td>****</td><td>9.71</td><td>****</td></tr><tr><td>Energy</td><td>5.75 ****</td><td></td><td>1.37 ns</td><td>3.45</td><td>ns</td><td>10.89 ****</td><td>-14.28</td><td>*</td><td>2.62</td><td>ns</td></tr><tr><td>Kin8nm</td><td>2.85 ****</td><td></td><td>1.82 ****</td><td>1.01</td><td>*</td><td>1.68 ***</td><td>-0.26</td><td>ns</td><td>-0.44</td><td>ns</td></tr><tr><td>Power</td><td>0.24 ***</td><td></td><td>-0.44 ****</td><td>-0.83</td><td>***</td><td>0.33 **</td><td>3.52</td><td>****</td><td></td><td>-1.38 ****</td></tr><tr><td>Protein</td><td>2.66 ****</td><td></td><td>0.99 ****</td><td>TBU</td><td></td><td>2.56 ****</td><td>6.23</td><td>****</td><td>TBU</td><td></td></tr><tr><td>Wine (Red)</td><td>0.26 **</td><td></td><td>2.00 ****</td><td>TBU</td><td></td><td>0.19 *</td><td></td><td>2.91 ****</td><td>TBU</td><td></td></tr><tr><td>Yacht</td><td>-56.39</td><td>***</td><td>21.42 ****</td><td>-54.18 ****</td><td></td><td>45.58 ****</td><td></td><td>-41.54 ns</td><td></td><td>71.18 ****</td></tr></table>
|
| 199 |
+
|
| 200 |
+
Table 2: Uncertainty quality measured on eight datasets. MCBN, MCDO and MNF are compared over 5 random 80-20 splits of the data with 5 different random seeds each split. Reported values are uncertainty metrics CRPS and PLL normalized to a lower bound of constant variance and upper bound that maximizes the metric. CRPS and PLL are expressed as a percentage, reflecting how close the model is to the upper bound. We check to see if CRPS and PLL significantly exceed the baseline using a one sample t-test (significance level indicated by \*’s). Best performer versus their baseline for each dataset and metric is marked by bold. See text for further details.
|
| 201 |
+
|
| 202 |
+

|
| 203 |
+
Figure 2: Errors in predictions (gray dots) sorted by estimated uncertainty on select datasets. The shaded areas show MCBN’s (blue) and MCDO’s (red) model uncertainty (light area $9 5 \%$ CI, dark area $50 \%$ CI). Gray dots show absolute prediction errors on the test set, and the gray line depicts a running mean of the errors. The dashed line indicates the optimized constant uncertainty. A correlation between estimated uncertainty (shaded area) and mean error (gray) indicates the uncertainty estimates are meaningful for estimating errors. See Appendix for complete results.
|
| 204 |
+
|
| 205 |
+
scribed in Section 4.2. We check to see if the reported values of CRPS and PLL significantly exceed the lower bound models (CUBN and CUDO) using a one sample t-test, where the significance level is indicated by ${ \bf \Psi } ^ { * } { \bf \dot { s } } .$ . Further details from the experiment are available in Appendix 6.6.
|
| 206 |
+
|
| 207 |
+
In Figure 2, we provide a novel visualization of uncertainty quality visualization in regression datasets. Errors in the model predictions are sorted by estimated uncertainty. The shaded areas show the model uncertainty and gray dots show absolute prediction errors on the test set. A gray line depicts a running mean of the errors. The dashed line indicates the optimized constant uncertainty. In these plots, we can see a correlation between estimated uncertainty (shaded area) and mean error (gray). This trend indicates that the model uncertainty estimates can recognize samples with larger (or smaller) potential for predictive errors.
|
| 208 |
+
|
| 209 |
+
Qualitative results for Bayesian SegNet using MCBN was produced by using the main CamVid model in Kendall et al. (2015). The pre-trained model was obtained from the online model zoo and was used without modification. 10 instances of mini-batches with size 6 were used to estimate the mean and variance of MCBN. Qualitative results can be found in Figure 3 depicting intuitive uncertainty at object boundaries. Quantitative measures on various segmentation datasets can be obtained and is beyond the scope of this work.
|
| 210 |
+
|
| 211 |
+

|
| 212 |
+
Figure 3: Results applying MCBN to Bayesian SegNet (Kendall et al., 2015). In the upper left, a scene from the CamVid driving scenes dataset. In the upper right, the Bayesian estimated segmentation. In the lower left, estimated uncertainty using MCBN for the car class. In the lower right, the estimated uncertainty of MCBN for all 11 classes.
|
| 213 |
+
|
| 214 |
+
We provide additional experimental results in Appendix 6.6. In Tables 3 and 4, we show the mean CRPS and PLL values for MCBN and MCDO. These results indicate that MCBN performs on par with MCDO across several datasets. In Table 6 we provide RMSE results of the MCBN and MCDO networks in comparison with non-stochastic BN and DO networks. These results indicate that the procedure of multiple forward passes in MCBN and MCDO show slight improvements in the predictive accuracy of the network.
|
| 215 |
+
|
| 216 |
+
# 5 DISCUSSION
|
| 217 |
+
|
| 218 |
+
The results presented in Table 2 and Appendix 6.6 indicate that MCBN generates meaningful uncertainty estimates which correlate with actual errors in the model’s prediction. We show statistically significant improvements over CUBN in the majority of the datasets, both in terms of CRPS and PLL. The visualizations in Figure 2 and in Appendix 6.6 show clear correlations between the estimated model uncertainty and actual errors produced by the network. We perform the same experiments using MCDO, and find that MCBN generally performs on par with MCDO. Looking closer, in terms of CRPS, MCBN performs better than MCDO in more cases than not. However, care must be used when comparing different models. The learned network parameters are different, leading to different predictive means which can confound direct comparison.
|
| 219 |
+
|
| 220 |
+
The results on the Yacht Hydrodynamics dataset seem contradictory. The CRPS score for MCBN is extremely negative, while the PLL score is extremely positive. The opposite trend is observed for MCDO. To add to the puzzle, the visualization in Figure 2 depicts an extremely promising uncertainty estimation that models the predictive errors with high fidelity. We hypothesize that this strange behavior is due to the small size of the data set, which only contains 60 test samples, or due to the Gaussian assumption of CRPS. There is also a large variability in the model’s accuracy on this dataset, which further confounds the measurements for such limited data.
|
| 221 |
+
|
| 222 |
+
One might criticize the overall quality of the uncertainty estimates of MCBN and MCDO based on the magnitude of the CRPS and PLL scores in Table 2. The scores rarely exceed $10 \%$ improvement over the lower bound. However, we caution that these measures should be taken in context. The upper bound is very difficult to achieve in practice (it is optimized for each test sample individually), and the lower bound is a quite reasonable estimate for uncertainty. We have further compared against the recent work of Louizos & Welling (2017), and find comparable results to their MNF-based variational technique specifically targeted to increase the flexibility of the approximate posterior.
|
| 223 |
+
|
| 224 |
+
Our approximation of the implied prior in Appendix 6.5 also provides a new interpretation of the empirical evidence that significantly lower $\lambda$ should be used in batch normalized networks (Ioffe & Szegedy, 2015). From a VA perspective, too strong a regularization for a given dataset size could be seen as constraining the prior distribution of BN units’ means, effectively narrowing the approximate posterior.
|
| 225 |
+
|
| 226 |
+
In this work, we have shown that training a deep network using batch normalization is equivalent to approximate inference in Bayesian models. Using our approach, it is possible to make meaningful uncertainty estimates using conventional architectures without modifying the network or the training procedure. We show evidence that the uncertainty estimates from MCBN correlate with actual errors in the model’s prediction, and are useful for practical tasks such as regression or semantic image segmentation. Our experiments show that MCBN yields an improvement over the baseline of optimized constant uncertainty on par with MCDO and MNF. Finally, we make contributions to the evaluation of uncertainty quality by suggesting new evaluation metrics based on useful baselines and upper bounds, and proposing a new visualization tool which gives an intuitive visual explanation of uncertainty quality. Finally, it should be noted that, over the past few years, batch normalization has become an integral part of most-if-not-all cutting edge deep networks which signifies the relevance of our work for estimating model uncertainty.
|
| 227 |
+
|
| 228 |
+
# REFERENCES
|
| 229 |
+
|
| 230 |
+
Vijay Badrinarayanan, Alex Kendall, and Roberto Cipolla. Segnet: A deep convolutional encoderdecoder architecture for image segmentation. arXiv preprint arXiv:1511.00561, 2015.
|
| 231 |
+
Thang D. Bui, Daniel Hernandez-Lobato, Yingzhen Li, Jos ´ e Miguel Hern ´ andez-Lobato, and ´ Richard E. Turner. Deep Gaussian Processes for Regression using Approximate Expectation Propagation. In ICML, 2016.
|
| 232 |
+
Xiaozhi Chen, Kaustav Kundu, Ziyu Zhang, Huimin Ma, Sanja Fidler, and Raquel Urtasun. Monocular 3d object detection for autonomous driving. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 2147–2156, 2016.
|
| 233 |
+
Ugljesa Djuric, Gelareh Zadeh, Kenneth Aldape, and Phedias Diamandis. Precision histology: how deep learning is poised to revitalize histomorphology for personalized cancer care. npj Precision Oncology, 1(1):22, 2017.
|
| 234 |
+
Andre Esteva, Brett Kuprel, Roberto A. Novoa, Justin Ko, Susan M. Swetter, Helen M. Blau, and Sebastian Thrun. Dermatologist-level classification of skin cancer with deep neural networks. Nature, Feb 2017.
|
| 235 |
+
Yarin Gal. Uncertainty in Deep Learning. PhD thesis, University of Cambridge, 2016.
|
| 236 |
+
Yarin Gal and Zoubin Ghahramani. Dropout as a Bayesian Approximation $:$ Representing Model Uncertainty in Deep Learning. ICML, 48:1–10, 2015.
|
| 237 |
+
Zoubin Ghahramani. Delve Datasets. University of Toronto, 1996. URL http://www.cs. toronto.edu/{˜}delve/data/kin/desc.html.
|
| 238 |
+
Zoubin Ghahramani. Probabilistic machine learning and artificial intelligence. Nature, 521(7553): 452–459, May 2015.
|
| 239 |
+
Tilmann Gneiting and Adrian E Raftery. Strictly Proper Scoring Rules, Prediction, and Estimation. Journal of the American Statistical Association, 102(477):359–378, 2007.
|
| 240 |
+
Alex Graves. Practical Variational Inference for Neural Networks. NIPS, 2011.
|
| 241 |
+
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.
|
| 242 |
+
|
| 243 |
+
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.
|
| 244 |
+
|
| 245 |
+
Jose Miguel Hern ´ andez-Lobato and Ryan Adams. Probabilistic backpropagation for scalable learn- ´ ing of bayesian neural networks. In International Conference on Machine Learning, pp. 1861– 1869, 2015.
|
| 246 |
+
|
| 247 |
+
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.
|
| 248 |
+
|
| 249 |
+
Sergey Ioffe and Christian Szegedy. Batch Normalization: Accelerating Deep Network Training by Reducing Internal Covariate Shift. Arxiv, 2015. URL http://arxiv.org/abs/1502. 03167.
|
| 250 |
+
|
| 251 |
+
Andrej Karpathy. Convnetjs demo: toy 1d regression, 2015. URL http://cs.stanford. edu/people/karpathy/convnetjs/demo/regression.html.
|
| 252 |
+
|
| 253 |
+
Alex Kendall, Vijay Badrinarayanan, and Roberto Cipolla. Bayesian SegNet: Model Uncertainty in Deep Convolutional Encoder-Decoder Architectures for Scene Understanding. CoRR, abs/1511.0, 2015. URL http://arxiv.org/abs/1511.02680.
|
| 254 |
+
|
| 255 |
+
Diederik P Kingma and Max Welling. Auto-Encoding Variational Bayes. In ICLR, 2014.
|
| 256 |
+
|
| 257 |
+
David Krueger, Chin-Wei Huang, Riashat Islam, Ryan Turner, Alexandre Lacoste, and Aaron Courville. Bayesian hypernetworks. arXiv preprint arXiv:1710.04759, 2017.
|
| 258 |
+
|
| 259 |
+
Erich Leo Lehmann. Elements of Large-Sample Theory. Springer Verlag, New York, 1999. ISBN 0387985956.
|
| 260 |
+
|
| 261 |
+
Yingzhen Li and Yarin Gal. Dropout Inference in Bayesian Neural Networks with Alphadivergences. arXiv, 2017.
|
| 262 |
+
|
| 263 |
+
Xiao Liu, Tian Xia, Jiang Wang, Yi Yang, Feng Zhou, and Yuanqing Lin. Fully convolutional attention networks for fine-grained recognition. arXiv preprint arXiv:1603.06765, 2016.
|
| 264 |
+
|
| 265 |
+
Christos Louizos and Max Welling. Multiplicative normalizing flows for variational Bayesian neural networks. In Doina Precup and Yee Whye Teh (eds.), Proceedings of the 34th International Conference on Machine Learning, volume 70 of Proceedings of Machine Learning Research, pp. 2218–2227, International Convention Centre, Sydney, Australia, 06–11 Aug 2017. PMLR. URL http://proceedings.mlr.press/v70/louizos17a.html.
|
| 266 |
+
|
| 267 |
+
David JC MacKay. A practical bayesian framework for backpropagation networks. Neural computation, 4(3):448–472, 1992.
|
| 268 |
+
|
| 269 |
+
Radford M Neal. BAYESIAN LEARNING FOR NEURAL NETWORKS. PhD thesis, University of Toronto, 1995.
|
| 270 |
+
|
| 271 |
+
Radford M Neal. Bayesian learning for neural networks, volume 118. Springer Science & Business Media, 2012.
|
| 272 |
+
|
| 273 |
+
Reinhard Selten. Axiomatic characterization of the quadratic scoring rule. Experimental Economics, 1(1):43–62, 1998.
|
| 274 |
+
|
| 275 |
+
Li Shen. End-to-end training for whole image breast cancer diagnosis using an all convolutional design. arXiv preprint arXiv:1708.09427, 2017.
|
| 276 |
+
|
| 277 |
+
David Silver, Julian Schrittwieser, Karen Simonyan, Ioannis Antonoglou, Aja Huang, Arthur Guez, Thomas Hubert, Lucas Baker, Matthew Lai, Adrian Bolton, Yutian Chen, Timothy Lillicrap, Fan Hui, Laurent Sifre, George van den Driessche, Thore Graepel, and Demis Hassabis. Mastering the game of go without human knowledge. Nature, 550(7676):354–359, Oct 2017.
|
| 278 |
+
|
| 279 |
+
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.
|
| 280 |
+
|
| 281 |
+
Irvine University of California. UC Irvine Machine Learning Repository, 2017. URL https: //archive.ics.uci.edu/ml/index.html.
|
| 282 |
+
|
| 283 |
+
Sida I Wang and Christopher D Manning. Fast dropout training. Proceedings of the 30th International Conference on Machine Learning, 28:118–126, 2013. URL http:// machinelearning.wustl.edu/mlpapers/papers/wang13a.
|
| 284 |
+
|
| 285 |
+
# 6 APPENDIX
|
| 286 |
+
|
| 287 |
+
# 6.1 VARIATIONAL APPROXIMATION
|
| 288 |
+
|
| 289 |
+
Assume we were to come up with a faimly of distributions parametrised by $\pmb \theta$ in order to approximate the posterior, $q _ { \boldsymbol { \theta } } ( \omega )$ . Our goal is to set $\pmb \theta$ such that $q _ { \boldsymbol { \theta } } ( \omega )$ is as similar to $p ( \omega | \mathbf { D } )$ as possible.
|
| 290 |
+
|
| 291 |
+
One strategy is to minimizing $\mathrm { K L } ( q _ { \boldsymbol { \theta } } ( \omega ) | | p ( \omega | \mathbf { D } ) )$ , the KL divergence of $p ( \omega | \mathbf { D } )$ wrt $q _ { \pmb { \theta } } ( \omega )$ . Minimizing $\bar { \mathrm { K L } } \bar { \big ( } q _ { \pmb { \theta } } ( \omega ) | | p ( \omega | \mathbf { D } ) \big )$ is equivalent to maximizing the ELBO:
|
| 292 |
+
|
| 293 |
+
$$
|
| 294 |
+
\int _ { \omega } q _ { \theta } ( \omega ) \ln p ( \mathbf { Y } | \mathbf { X } , \omega ) \mathrm { d } \omega - \mathrm { K L } ( q _ { \theta } ( \omega ) | | p ( \omega ) )
|
| 295 |
+
$$
|
| 296 |
+
|
| 297 |
+
Assuming i.i.d. observation noise, this is equivalent to minimizing:
|
| 298 |
+
|
| 299 |
+
$$
|
| 300 |
+
\mathcal { L } _ { \mathrm { V A } } ( \pmb { \theta } ) : = - \sum _ { n = 1 } ^ { N } \int q _ { \pmb { \theta } } ( \pmb { \omega } ) \ln p ( \mathbf { y } _ { i } | f _ { \omega } ( \mathbf { x } _ { i } ) ) \mathrm { d } \omega + \mathrm { K L } ( q _ { \pmb { \theta } } ( \pmb { \omega } ) | | p ( \pmb { \omega } ) )
|
| 301 |
+
$$
|
| 302 |
+
|
| 303 |
+
Instead of making the optimization on the full training set, we can use a subsampling (yielding an unbiased estimate of ${ \mathcal { L } } _ { \mathrm { V A } } ( \pmb \theta ) )$ for iterative optimization (as in mini-batch optimization):
|
| 304 |
+
|
| 305 |
+
$$
|
| 306 |
+
\hat { \mathcal { L } } _ { \mathrm { V A } } ( \pmb { \theta } ) : = - \frac { N } { M } \sum _ { i \in B } \int _ { \omega } q _ { \theta } ( \omega ) \ln p ( \mathbf { y } _ { i } | f _ { \omega } ( \mathbf { x } _ { i } ) ) \mathrm { d } \omega + \mathrm { K L } ( q _ { \theta } ( \omega ) | | p ( \omega ) )
|
| 307 |
+
$$
|
| 308 |
+
|
| 309 |
+
We now make a reparametrisation: set $\omega = g ( \theta , \epsilon )$ where $\epsilon$ is a RV. The function $g$ and the distribution of $\epsilon$ must be such that $p ( g ( \pmb { \theta } , \epsilon ) ) = q _ { \pmb { \theta } } ( \omega )$ . Assume $q _ { \pmb { \theta } } ( \omega )$ can be written $\begin{array} { r } { \int _ { \epsilon } q _ { \pmb { \theta } } ( \pmb { \omega } | \epsilon ) p ( \epsilon ) \mathrm { d } \epsilon } \end{array}$ where $q _ { \pmb { \theta } } ( \pmb { \omega } | \epsilon ) = \delta ( \pmb { \omega } - g ( \pmb { \theta } , \epsilon ) )$ . Using this reparametrisation we get:
|
| 310 |
+
|
| 311 |
+
$$
|
| 312 |
+
\hat { \mathcal { L } } _ { \mathrm { V A } } ( \pmb { \theta } ) = - \frac { N } { M } \sum _ { i \in B } \int _ { \epsilon } p ( \epsilon ) \ln p ( \mathbf { y } _ { i } | f _ { g ( \pmb { \theta } , \epsilon ) } ( \mathbf { x } _ { i } ) ) \mathrm { d } \epsilon + \mathrm { K L } ( q _ { \pmb { \theta } } ( \omega ) | | p ( \omega ) )
|
| 313 |
+
$$
|
| 314 |
+
|
| 315 |
+
# 6.2 KL DIVERGENCE OF FACTORIZED GAUSSIANS
|
| 316 |
+
|
| 317 |
+
If $q _ { \pmb { \theta } } ( \omega )$ and $p ( \omega )$ factorize over all stochastic parameters:
|
| 318 |
+
|
| 319 |
+
$$
|
| 320 |
+
\begin{array} { r l } { \mathrm { K L } \{ \varphi ( \omega ) \} | p ( \omega ) \rangle = } & { - \displaystyle \int _ { \omega } \displaystyle \prod _ { i } [ \{ \mu ( \omega _ { i } ) \} \ln \frac { p ( \omega _ { i } ) } { \prod _ { i } \varphi ( \omega _ { i } ) } ] \ln \frac { \prod _ { i } | \omega _ { i } \rangle } { \prod _ { i } \varphi ( \omega _ { i } ) } \mathrm { d } \omega } \\ & { = - \displaystyle \int _ { \omega } \displaystyle \prod _ { i } [ \{ \ a \omega ( \omega _ { i } ) \} \sum _ { \nu } [ \ln \frac { p ( \omega _ { i } ) } { q ( \omega _ { i } ) } ] \displaystyle \prod _ { i } \mathrm { d } \omega _ { i } } \\ & { = \displaystyle \sum _ { j } \Big [ - \int _ { \omega } \displaystyle \prod _ { i } [ \mu ( \omega ( \omega ) ) ] \ln \frac { p ( \omega _ { j } ) } { q ( \omega _ { i } ) } \Big [ \displaystyle \prod _ { i } \mathrm { d } \omega _ { i } \Big ] } \\ & { = \displaystyle \sum _ { j } \Big [ - \int _ { \omega } \displaystyle q ( \omega ( \omega _ { j } ) ) \ln \frac { p ( \omega _ { j } ) } { q ( \omega _ { i } ) } \Big ) \mathrm { d } \omega _ { j } \displaystyle \prod _ { i = j , i \neq j } \mathrm { d } \omega ( \omega _ { i } ) \mathrm { d } \omega _ { i } \Big ] } \\ & { = \displaystyle \sum _ { j } - \int _ { \omega } \displaystyle q \omega ( \omega _ { i } ) \ln \frac { p ( \omega _ { j } ) } { q ( \omega _ { i } ) } \mathrm { d } \omega _ { i } } \\ & { = \displaystyle \sum _ { j } \mathrm { K L } ( \varphi _ { i } ) \Big ( \Big | p ( \omega _ { i } ) \Big \rangle \Big ) } \end{array}
|
| 321 |
+
$$
|
| 322 |
+
|
| 323 |
+
such that $\mathrm { K L } ( q _ { \pmb { \theta } } ( \omega ) | | p ( \omega ) )$ is the sum of the $\mathrm { K L }$ divergence terms for the individual stochastic parameters $\omega _ { i }$ . If the factorized distributions are Gaussians, where ${ q } _ { \pmb { \theta } } ( \omega _ { i } ) = \mathcal { N } ( \mu _ { q } , \sigma _ { q } ^ { 2 } )$ and $p ( \omega _ { i } ) =$
|
| 324 |
+
|
| 325 |
+
$\mathcal { N } ( \mu _ { p } , \sigma _ { p } ^ { 2 } )$ we get:
|
| 326 |
+
|
| 327 |
+
$$
|
| 328 |
+
\begin{array} { r l } { { \operatorname { K L } \{ \varphi ( \omega _ { 2 } ) \} \| \varphi ( \alpha _ { 2 } ) \} = \int _ { \omega } \varphi ( \omega ( \omega ) ) \ln \frac { \mathrm { d } g ( \omega ( \omega ) ) } { \displaystyle \beta ( \omega ( \omega ) ) } \mathrm { d } \omega _ { i } } } \\ & { = - H ( \varphi ( \omega ( \omega ) ) ) - \int _ { \omega _ { 1 } } \varphi ( \omega ( \omega _ { 1 } ) \ln p ( \omega _ { 2 } ) \mathrm { d } \omega _ { 1 } } \\ & { = - \frac { 1 } { 2 } ( 1 + \mathrm { i n f } ( 2 \pi \sigma _ { \sigma _ { \sigma _ { \sigma _ { 1 } } ^ { \prime } } } ^ { \prime } ) ) } \\ & { \phantom { = } - \int _ { \omega _ { 1 } } \varphi ( \omega ( \omega ; \omega ) ) \frac { 1 } { \displaystyle ( 2 \pi \sigma _ { \sigma _ { \sigma _ { 1 } } ^ { \prime } } ^ { \prime } ) ^ { 1 / 2 } } \exp \big \{ - \frac { ( \omega _ { i } - \beta _ { \sigma _ { \sigma } } ) ^ { 2 } } { 2 \sigma _ { \sigma } ^ { 2 } } \big \} \mathrm { d } \omega _ { i } } \\ & { = - \frac { 1 } { 2 } ( 1 + \mathrm { i n f } ( 2 \pi \sigma _ { \sigma _ { \sigma _ { \sigma } ^ { \prime } } } ^ { \prime } ) ) } \\ & { \phantom { = } + \frac { 1 } { 2 } \ln ( 2 \pi \sigma _ { p } ^ { 2 } ) + \frac { \frac { \mathrm { d } } { \mathrm { d } \omega _ { 1 } } \big [ \sigma _ { 1 } ^ { 2 } \big ] - 2 \mu _ { p } \mathrm { L } _ { p } ^ { \prime } ( \omega _ { 1 } ) + \mu _ { p } ^ { 2 } } { 2 \sigma _ { p } ^ { 2 } } } \\ & { = \ln \frac { \sigma _ { p } } { \sigma _ { \sigma } } + \frac { \sigma _ { p } ^ { 2 } + ( \mu _ { \sigma } - \mu _ { p } ) ^ { 2 } } { 2 \sigma _ { \sigma } ^ { 2 } } - \frac { 1 } { 2 } } \end{array}
|
| 329 |
+
$$
|
| 330 |
+
|
| 331 |
+
for each KL divergence term. Here $H ( q _ { \theta } ( \omega _ { i } ) ) = \textstyle { \frac { 1 } { 2 } } ( 1 + \ln ( 2 \pi \sigma _ { q } ^ { 2 } ) )$ is the differential entropy of $q _ { \pmb { \theta } } ( \omega _ { i } )$ .
|
| 332 |
+
|
| 333 |
+
# 6.3 DISTRIBUTION OF $\mu _ { \mathbf { B } } ^ { u } , \sigma _ { \mathbf { B } } ^ { u }$
|
| 334 |
+
|
| 335 |
+
Here we approximate the distribution of mean and standard deviation of a mini-batch, separately to two Gaussians. For the mean we get:
|
| 336 |
+
|
| 337 |
+
$$
|
| 338 |
+
\mu _ { \mathrm { B } } = \frac { \sum _ { \mathrm { m = 1 } } ^ { \mathrm { M } } \mathbf { W } ^ { ( j ) } \mathbf { x } _ { \mathrm { m } } } { \mathbf { M } }
|
| 339 |
+
$$
|
| 340 |
+
|
| 341 |
+
where $\mathbf { x } _ { \mathrm { m } }$ are the examples in the sampled batch. We will assume these are sampled i.i.d.10. Samples of the random variable $\mathbf { W } ^ { ( j ) } \mathbf { x } _ { \mathrm { m } }$ are then i.i.d.. Then by central limit theorem (CLT) the following holds for sufficiently large M (often $\geq 3 0$ ):
|
| 342 |
+
|
| 343 |
+
$$
|
| 344 |
+
\mu _ { \mathrm { B } } \sim \mathcal { N } ( \mu , \frac { \sigma ^ { 2 } } { \bf M } )
|
| 345 |
+
$$
|
| 346 |
+
|
| 347 |
+
For standard deviation:
|
| 348 |
+
|
| 349 |
+
$$
|
| 350 |
+
\sigma _ { \mathrm { B } } = \sqrt { \frac { \Sigma _ { \mathrm { m = 1 } } ^ { \mathrm { M } } ( \mathbf { W } ^ { ( j ) } \mathbf { x } _ { \mathrm { m } } - \mu _ { \mathrm { B } } ) ^ { 2 } } { M } }
|
| 351 |
+
$$
|
| 352 |
+
|
| 353 |
+
Then
|
| 354 |
+
|
| 355 |
+
$$
|
| 356 |
+
\sqrt { M } ( \sigma _ { \mathrm { B } } - \sigma ) = \sqrt { M } \Big ( \sqrt { \frac { \Sigma _ { \mathrm { m } = 1 } ^ { \mathrm { M } } \big ( { \bf W } ^ { ( j ) } { \bf x } _ { \mathrm { m } } - \mu _ { \mathrm { B } } \big ) ^ { 2 } } { M } } - \sqrt { \sigma ^ { 2 } } \Big )
|
| 357 |
+
$$
|
| 358 |
+
|
| 359 |
+
We wWith $\sqrt { \frac { \Sigma _ { \mathrm { m } = 1 } ^ { \bf M } ( { \bf W } ^ { ( j ) } { \bf x } _ { \mathrm { m } } - \mu _ { \mathrm { B } } ) ^ { 2 } } { M } }$ . We take a Taylor expansion of $f ( x ) = { \sqrt { x } }$ around $a = \sigma ^ { 2 }$ . $\begin{array} { r } { x = \frac { \Sigma _ { \mathrm { m = 1 } } ^ { \mathrm { M } } ( \mathbf { W } ^ { ( j ) } \mathbf { x } _ { \mathrm { m } } - \mu _ { \mathrm { B } } ) ^ { 2 } } { M } } \end{array}$
|
| 360 |
+
|
| 361 |
+
$$
|
| 362 |
+
{ \sqrt { x } } = { \sqrt { \sigma ^ { 2 } } } + { \frac { 1 } { 2 { \sqrt { \sigma ^ { 2 } } } } } ( x - \sigma ^ { 2 } ) + { \mathcal { O } } [ ( x - \sigma ^ { 2 } ) ^ { 2 } ]
|
| 363 |
+
$$
|
| 364 |
+
|
| 365 |
+
$$
|
| 366 |
+
\begin{array} { r l } { \sqrt { \mathcal { M } } ( \sigma _ { \mathfrak { p } } - \sigma ) = \sqrt { M } \Bigg ( \frac { 1 } { 2 \sqrt { \sigma } ^ { 2 } } \Big ( \frac { \sum _ { m = 1 } ^ { N } \big ( \mathbf { W } ^ { ( j ) } \mathbf { x } _ { m } - \mu \mathbf { b } \big ) ^ { 2 } } { \mathcal { M } } - \sigma ^ { 2 } \Big ) + } & { } \\ { \mathcal { O } \Bigg [ \Big ( \frac { \sum _ { m = 1 } ^ { N } \big ( \mathbf { W } ^ { ( j ) } \mathbf { x } _ { m } - \mu \mathbf { b } \big ) ^ { 2 } } { \mathcal { M } } - \sigma ^ { 2 } \Big ) ^ { 2 } \Bigg ] \Bigg ) } & { } \\ { = \frac { \sqrt { M } } { 2 \sigma } \Big ( \frac { 1 } { M } \sum _ { m = 1 } ^ { N } ( \mathbf { W } ^ { ( j ) } \mathbf { x } _ { m } - \mu \mathbf { b } ) ^ { 2 } - \sigma ^ { 2 } \Big ) + } & { } \\ { \mathcal { O } \Bigg [ \sqrt { M } \Big ( \frac { \sum _ { m = 1 } ^ { N } \big ( \mathbf { W } ^ { ( j ) } \mathbf { x } _ { m } - \mu \mathbf { b } \big ) ^ { 2 } } { \mathcal { M } } - \sigma ^ { 2 } \Big ) ^ { 2 } \Bigg ] } & { } \\ { = \frac { 1 } { 2 \sigma \sqrt { M } } \Big ( \mathbf { S } _ { z z } ^ { \mathbf { M } } - ( \mathbf { W } ^ { ( j ) } \mathbf { x } _ { m } - \mu \mathbf { b } ) ^ { 2 } - \mathcal { M } \sigma ^ { 2 } \Big ) + } & { } \\ { \mathcal { O } \Bigg [ \sqrt { M } \Big ( \frac { \sum _ { m = 1 } ^ { N } \big ( \mathbf { W } ^ { ( j ) } \mathbf { x } _ { m } - \mu \mathbf { b } \big ) ^ { 2 } } { \mathcal { M } } - \sigma ^ { 2 } \Big ) ^ { 2 } \Bigg ] } & { } \end{array}
|
| 367 |
+
$$
|
| 368 |
+
|
| 369 |
+
consider $\Sigma _ { \mathrm { m } = 1 } ^ { \mathrm { M } } ( \mathbf { W } ^ { ( j ) } \mathbf { x } _ { \mathrm { m } } - \mu _ { \mathrm { B } } ) ^ { 2 }$ . We know that $E [ \mathbf { W } ^ { ( j ) } \mathbf { x } _ { \mathrm { m } } ] = \mu$ and write
|
| 370 |
+
|
| 371 |
+
$$
|
| 372 |
+
\begin{array} { r l } & { \quad \sum _ { \mathbf { m } = 1 } ^ { \mathbf { M } } ( \mathbf { W } ^ { ( j ) } \mathbf { x _ { m } } - \mu _ { \mathrm { B } } ) ^ { 2 } } \\ & { = \sum _ { \mathbf { m } = 1 } ^ { \mathbf { M } } ( \bigl ( \mathbf { W } ^ { ( j ) } \mathbf { x _ { m } } - \boldsymbol { \mu } \bigr ) - \bigl ( \mu _ { \mathrm { B } } - \boldsymbol { \mu } \bigr ) \bigr ) ^ { 2 } } \\ & { = \sum _ { \mathbf { m } = 1 } ^ { \mathbf { M } } \bigl ( \bigl ( \mathbf { W } ^ { ( j ) } \mathbf { x _ { m } } - \boldsymbol { \mu } \bigr ) ^ { 2 } + \bigl ( \mu _ { \mathrm { B } } - \boldsymbol { \mu } \bigr ) ^ { 2 } - 2 \bigl ( \mathbf { W } ^ { ( j ) } \mathbf { x _ { m } } - \boldsymbol { \mu } \bigr ) \bigl ( \mu _ { \mathrm { B } } - \boldsymbol { \mu } \bigr ) \bigr ) } \\ & { = \sum _ { \mathbf { m } = 1 } ^ { \mathbf { M } } \bigl ( \mathbf { W } ^ { ( j ) } \mathbf { x _ { m } } - \boldsymbol { \mu } \bigr ) ^ { 2 } + M \bigl ( \mu _ { \mathrm { B } } - \boldsymbol { \mu } \bigr ) ^ { 2 } - 2 \bigl ( \mu _ { \mathrm { B } } - \boldsymbol { \mu } \bigr ) \boldsymbol { \Sigma } _ { \mathbf { m } = 1 } ^ { \mathbf { M } } \bigl ( \mathbf { W } ^ { ( j ) } \mathbf { x _ { m } } - \boldsymbol { \mu } \bigr ) } \\ & { = \sum _ { \mathbf { m } = 1 } ^ { \mathbf { M } } \bigl ( \mathbf { W } ^ { ( j ) } \mathbf { x _ { m } } - \boldsymbol { \mu } \bigr ) ^ { 2 } - M \bigl ( \mu _ { \mathrm { B } } - \boldsymbol { \mu } \bigr ) ^ { 2 } } \\ & { = \sum _ { \mathbf { m } = 1 } ^ { \mathbf { M } } \bigl ( \bigl ( \mathbf { W } ^ { ( j ) } \mathbf { x _ { m } } - \boldsymbol { \mu } \bigr ) ^ { 2 } - \bigl ( \mu _ { \mathrm { B } } - \boldsymbol { \mu } \bigr ) ^ { 2 } \bigr ) } \end{array}
|
| 373 |
+
$$
|
| 374 |
+
|
| 375 |
+
then
|
| 376 |
+
|
| 377 |
+
$$
|
| 378 |
+
\begin{array} { r l } { \sqrt { \lambda ^ { 2 } ( \gamma _ { 2 } - \alpha ) } = } & { - \frac { 1 } { 2 } - \frac { \lambda ^ { 2 } } { \lambda ^ { 2 } } \frac { \lambda ^ { 2 } } { \lambda ^ { 2 } } \frac { \lambda ^ { 2 } } { \lambda ^ { 2 } } \left. \nabla ^ { 2 } \overline { { \lambda } } _ { x } \cdot \partial ^ { 2 } ^ { 2 } - \partial ^ { 2 } u _ { x } \partial ^ { 2 } - \partial u _ { y } - \partial u _ { z } ^ { 2 } \right. + \mathcal { U } _ { 2 } ^ { 2 } } \\ & { \quad - \frac { \lambda ^ { 2 } } { \lambda ^ { 2 } } \frac { \lambda ^ { 2 } } { \lambda ^ { 2 } } \frac { \lambda ^ { 2 } } { \lambda ^ { 2 } } \frac { \lambda ^ { 2 } } { \lambda ^ { 2 } } \frac { \lambda ^ { 2 } } { \lambda ^ { 2 } } \frac { \lambda ^ { 2 } } { \lambda ^ { 2 } } \frac { \lambda ^ { 2 } } { \lambda ^ { 2 } } } \\ & { \quad - \frac { \lambda ^ { 2 } } { \lambda ^ { 2 } } \frac { \lambda ^ { 2 } } { \lambda ^ { 2 } } \frac { \lambda ^ { 2 } } { \lambda ^ { 2 } } \frac { \lambda ^ { 2 } } { \lambda ^ { 3 } } \frac { \lambda ^ { 2 } } { \lambda ^ { 3 } } - \frac { \lambda ^ { 2 } } { \lambda ^ { 2 } } \frac { \lambda ^ { 2 } } { \lambda ^ { 3 } } ( \lambda ^ { 2 } - \omega ^ { 2 } - \partial ^ { 2 } u _ { x } ^ { 2 } - \partial u _ { y } ^ { 2 } ) } \\ & { \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad } \\ & { \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad } \\ & { \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad } \\ & \quad \quad \quad \quad \ \end{array}
|
| 379 |
+
$$
|
| 380 |
+
|
| 381 |
+
We go through each term in turn
|
| 382 |
+
|
| 383 |
+
# Term A
|
| 384 |
+
|
| 385 |
+
We have
|
| 386 |
+
|
| 387 |
+
$$
|
| 388 |
+
\mathrm { T e r m } \mathrm { \bf ~ A } = \frac { 1 } { 2 \sigma \sqrt { M } } \Sigma _ { \mathrm { m } = 1 } ^ { \mathrm { M } } \big ( \big ( \mathbf { W } ^ { ( j ) } \mathbf { x } _ { \mathrm { m } } - \mu \big ) ^ { 2 } - \sigma ^ { 2 } \big )
|
| 389 |
+
$$
|
| 390 |
+
|
| 391 |
+
where $\Sigma _ { \mathrm { m } = 1 } ^ { \mathrm { M } } ( \mathbf { W } ^ { ( j ) } \mathbf { x } _ { \mathrm { m } } - \mu ) ^ { 2 }$ is the sum of $M$ RVs $( \mathbf { W } ^ { ( j ) } \mathbf { x } _ { \mathrm { m } } - \mu ) ^ { 2 }$ . Note that since $E [ \mathbf { W } ^ { ( j ) } \mathbf { x } _ { \mathrm { m } } ] = \mu$ it holds that $E [ ( \mathbf { W } ^ { ( j ) } \mathbf { x } _ { \mathrm { m } } - \mu ) ^ { 2 } ] = \sigma ^ { 2 }$ . Since $( \mathbf { W } ^ { ( j ) } \mathbf { x } _ { \mathrm { m } } - \mu ) ^ { 2 }$ is sampled approximately iid (by assumptions above), for large enough M by CLT it holds approximately that
|
| 392 |
+
|
| 393 |
+
$$
|
| 394 |
+
\Sigma _ { \mathrm { m } = 1 } ^ { \mathrm { M } } ( \mathbf { W } ^ { ( j ) } \mathbf { x } _ { \mathrm { m } } - \mu ) ^ { 2 } \sim { \mathcal { N } } ( M \sigma ^ { 2 } , M \mathrm { V a r } ( ( \mathbf { W } ^ { ( j ) } \mathbf { x } _ { \mathrm { m } } - \mu ) ^ { 2 } ) )
|
| 395 |
+
$$
|
| 396 |
+
|
| 397 |
+
where
|
| 398 |
+
|
| 399 |
+
$$
|
| 400 |
+
\begin{array} { r l } & { \mathrm { V a r } ( ( \mathbf { W } ^ { ( j ) } \mathbf { x } _ { \mathrm { m } } - \mu ) ^ { 2 } ) = E [ ( \mathbf { W } ^ { ( j ) } \mathbf { x } _ { \mathrm { m } } - \mu ) ^ { 2 * 2 } ] - E [ ( \mathbf { W } ^ { ( j ) } \mathbf { x } _ { \mathrm { m } } - \mu ) ^ { 2 } ] ^ { 2 } } \\ & { \quad \quad \quad = E [ ( \mathbf { W } ^ { ( j ) } \mathbf { x } _ { \mathrm { m } } - \mu ) ^ { 4 } ] - \sigma ^ { 4 } } \end{array}
|
| 401 |
+
$$
|
| 402 |
+
|
| 403 |
+
Then
|
| 404 |
+
|
| 405 |
+
$$
|
| 406 |
+
\Sigma _ { \mathrm { m } = 1 } ^ { \mathrm { M } } \big ( \big ( \mathbf { W } ^ { ( j ) } \mathbf { x } _ { \mathrm { m } } - \mu \big ) ^ { 2 } - \sigma ^ { 2 } \big ) \sim \mathcal { N } ( 0 , M * E [ \big ( \mathbf { W } ^ { ( j ) } \mathbf { x } _ { \mathrm { m } } - \mu \big ) ^ { 4 } ] - M \sigma ^ { 4 } )
|
| 407 |
+
$$
|
| 408 |
+
|
| 409 |
+
so
|
| 410 |
+
|
| 411 |
+
$$
|
| 412 |
+
\mathrm { T e r m } \mathrm { \bf A } \sim \mathcal { N } ( 0 , \frac { E [ ( \mathrm { \bf W } ^ { ( j ) } \mathbf { x } _ { \mathrm { m } } - \mu ) ^ { 4 } ] - \sigma ^ { 4 } } { 4 \sigma ^ { 2 } } )
|
| 413 |
+
$$
|
| 414 |
+
|
| 415 |
+
# Term B
|
| 416 |
+
|
| 417 |
+
We have
|
| 418 |
+
|
| 419 |
+
$$
|
| 420 |
+
{ \mathrm { T e r m ~ B } } = { \frac { \sqrt { M } } { 2 \sigma } } ( \mu _ { \mathrm { B } } - \mu ) ^ { 2 } = { \frac { 1 } { 2 \sigma } } { \sqrt { M } } ( \mu _ { \mathrm { B } } - \mu ) ( \mu _ { \mathrm { B } } - \mu )
|
| 421 |
+
$$
|
| 422 |
+
|
| 423 |
+
Consider $\left( \mu _ { \mathrm { B } } - \mu \right)$ . As $\mu _ { \mathrm { B } } \ { \stackrel { p } { \to } } \ \mu$ when $M \to \infty$ we have $\mu _ { \mathrm { B } } - \mu \overset { p } { } 0$ . We also have
|
| 424 |
+
|
| 425 |
+
$$
|
| 426 |
+
\sqrt { M } ( \mu _ { \mathrm { B } } - \mu ) = \frac { \Sigma _ { \mathrm { m = 1 } } ^ { \mathrm { M } } \mathbf { W } ^ { ( j ) } \mathbf { x } _ { \mathrm { m } } } { \sqrt { M } } - \sqrt { M } \mu
|
| 427 |
+
$$
|
| 428 |
+
|
| 429 |
+
which by CLT is approximately Gaussian for large $M$ . We can then make use of the Cramer-Slutzky Theorem, which states that if $( X _ { n } ) _ { n \geq 1 }$ and $( Y _ { n } ) _ { n \geq 1 }$ are two sequences such that $X _ { n } \stackrel { d } { \to } X$ and $Y _ { n } \overset { p } { } a$ as $n \infty$ where $a$ is a constant, then as $n \infty$ , it holds that $X _ { n } * Y _ { n } \stackrel { d } { \to } X * a$ . Thus, Term B is approximately 0 for large $\mathbf { M }$ .
|
| 430 |
+
|
| 431 |
+
# Term C
|
| 432 |
+
|
| 433 |
+
We have
|
| 434 |
+
|
| 435 |
+
$$
|
| 436 |
+
\mathrm { T e r m } { \cal { C } } = \mathcal { O } \left[ \sqrt { M } \Big ( \frac { \sum _ { \mathrm { m = 1 } } ^ { \mathrm { M } } \bigl ( \mathbf { W } ^ { ( j ) } \mathbf { x } _ { \mathrm { m } } - \mu _ { \mathrm { B } } \bigr ) ^ { 2 } } { M } - \sigma ^ { 2 } \Big ) ^ { 2 } \right]
|
| 437 |
+
$$
|
| 438 |
+
|
| 439 |
+
Since $E [ ( \mathbf { W } ^ { ( j ) } \mathbf { x } _ { \mathrm { m } } - \mu ) ^ { 2 } ] = \sigma ^ { 2 }$ we can make the same use of Cramer-Slutzky as for Term $B$ , such that Term $\textrm { C }$ is approximately 0 for large $\mathbf { M }$ .
|
| 440 |
+
|
| 441 |
+
# Finalizing the distribution
|
| 442 |
+
|
| 443 |
+
We have approximately
|
| 444 |
+
|
| 445 |
+
so
|
| 446 |
+
|
| 447 |
+
$$
|
| 448 |
+
\begin{array} { r l } & { \sqrt { M } ( \sigma _ { \mathrm { B } } - \sigma ) \sim \mathcal { N } ( 0 , \frac { E \left[ ( \mathbf { W } ^ { ( j ) } \mathbf { x } _ { \mathrm { m } } - \mu ) ^ { 4 } \right] - \sigma ^ { 4 } } { 4 \sigma ^ { 2 } } ) } \\ & { \quad \quad \quad \sigma _ { \mathrm { B } } \sim \mathcal { N } ( \sigma , \frac { E \left[ ( \mathbf { W } ^ { ( j ) } \mathbf { x } _ { \mathrm { m } } - \mu ) ^ { 4 } \right] - \sigma ^ { 4 } } { 4 \sigma ^ { 2 } M } ) } \end{array}
|
| 449 |
+
$$
|
| 450 |
+
|
| 451 |
+
# 6.4 PREDICTIVE DISTRIBUTION PROPERTIES
|
| 452 |
+
|
| 453 |
+
This section provides derivations of properties of the predictive distribution $p ^ { * } ( \mathbf { y } \vert \mathbf { x } , \mathbf { D } )$ in section 3.4, following Gal (2016). We first find the approximate predictive mean and variance for the approximate predictive distribution, then show how to estimate the predictive log likelihood, a measure of uncertainty quality used in the evaluation 4.
|
| 454 |
+
|
| 455 |
+
Predictive mean Assuming Gaussian iid noise defined by model precision $\tau$ , i.e. $f _ { \omega } ( { \bf x } , { \bf y } ) =$ $p ( \mathbf { y } \vert f _ { \omega } ( \mathbf { x } ) ) = \mathcal { N } ( \mathbf { y } ; f _ { \omega } ( \mathbf { x } ) , \bar { \tau } ^ { - 1 } \mathbf { I } )$ :
|
| 456 |
+
|
| 457 |
+
$$
|
| 458 |
+
\begin{array} { r l } & { \mathbf { E } _ { \rho ^ { * } } [ \mathbf { y } ] = \int \mathbf { y } p ^ { * } ( \mathbf { y } | \mathbf { x } , \mathbf { D } ) \mathrm { d } \mathbf { y } } \\ & { \quad = \int _ { \mathbf { y } } \mathbf { y } \Bigg ( \int _ { \omega } \int _ { \omega } ( \mathbf { x } , \mathbf { y } ) q \theta ( \omega ) d \omega \Bigg ) \mathrm { d } \mathbf { y } } \\ & { \quad = \int _ { \mathbf { y } } \mathbf { y } \Bigg ( \int _ { \omega } N ( \mathbf { y } ; f _ { \omega } ( \mathbf { x } ) , \tau ^ { - 1 } ) q \theta ( \omega ) \mathrm { d } \omega \Bigg ) \mathrm { d } \mathbf { y } } \\ & { \quad = \int _ { \omega } \Big ( \int _ { \mathbf { y } } \mathbf { y } N ( \mathbf { y } ; f _ { \omega } ( \mathbf { x } ) , \tau ^ { - 1 } ) \mathrm { d } \mathbf { y } \Big ) q \theta ( \omega ) \mathrm { d } \omega } \\ & { \quad = \int _ { \omega } f _ { \omega } ( \mathbf { x } ) q \theta ( \omega ) \mathrm { d } \omega } \\ & { \quad \approx \frac { 1 } { T } \frac { \gamma } { \int _ { \omega } f _ { \omega } ( \mathbf { x } ) } f _ { \omega , \mathbf { ( x } ) } } \end{array}
|
| 459 |
+
$$
|
| 460 |
+
|
| 461 |
+
where we take the MC Integral with $T$ samples of $\omega$ for the approximation in the final step.
|
| 462 |
+
|
| 463 |
+
Predictive variance Our goal is to estimate:
|
| 464 |
+
|
| 465 |
+
$$
|
| 466 |
+
\mathrm { C o v } _ { p ^ { * } } [ \mathbf { y } ] = \mathbb { E } _ { p ^ { * } } [ \mathbf { y } ^ { \mathsf { T } } \mathbf { y } ] - \mathbb { E } _ { p ^ { * } } [ \mathbf { y } ] ^ { \mathsf { T } } \mathbb { E } _ { p ^ { * } } [ \mathbf { y } ]
|
| 467 |
+
$$
|
| 468 |
+
|
| 469 |
+
We find that:
|
| 470 |
+
|
| 471 |
+
$$
|
| 472 |
+
\begin{array} { r l } { \mathbb { E } _ { p ^ { * } } [ \mathbf { y } ^ { * } ] = \displaystyle \int _ { y } \mathbf { y } ^ { * } \mathbf { y } ^ { p ^ { * } } ( \mathbf { y } | \mathbf { x } , \mathbf { D } ) \mathrm { d } \mathbf { y } } \\ & { = \displaystyle \int _ { y } \mathbf { y } ^ { * } \Big ( \int _ { \omega } I _ { \omega } ( \mathbf { x } , \mathbf { y } ) \mathrm { d } \theta \Big ( \omega ) \mathrm { d } \omega \Big ) \mathrm { d } \mathbf { y } } \\ & { = \displaystyle \int _ { \omega } \Big ( \int _ { y } \mathbf { y } ^ { * } \mathbf { y } _ { \omega } ( \mathbf { x } , \mathbf { y } ) \mathrm { d } \mathbf { y } \Big ) \mathrm { d } \omega } \\ & { = \displaystyle \int _ { \omega } \Big ( \mathrm { c o v } _ { j , \langle \mathbf { x } , \mathbf { x } \rangle } ( \mathbf { y } ) + \mathbb { E } _ { j , \langle \mathbf { x } , \mathbf { z } \rangle } [ \mathbf { y } ] ^ { \top } \mathbb { E } _ { j , \langle \mathbf { z } , \mathbf { z } \rangle } [ \mathbf { y } ] \Big ) \mathrm { d } \omega \Big \omega } \\ & { = \displaystyle \int _ { \omega } \Big ( \tau ^ { - 1 } + I _ { \omega } ( \mathbf { x } ) ^ { \top } \rho _ { \omega } ( \mathbf { x } ) \Big ) \mathrm { d } \omega \omega \Big ) \mathrm { d } \omega } \\ & { = \tau ^ { - 1 } + I _ { \omega } ( \omega ) [ \int _ { \omega } ( \mathbf { x } ) ^ { \top } \mathrm { d } \omega \mathbf { \Sigma } ( \mathbf { x } ) ] } \\ & { \approx \tau ^ { - 1 } \mathbf { I } + \frac { 1 } { T } \sum _ { j = 1 } ^ { T } / \omega _ { \mathrm { s } } ( \mathbf { x } ) ^ { \top } f _ { \omega , \mathrm { s } } ( \mathbf { x } ) } \end{array}
|
| 473 |
+
$$
|
| 474 |
+
|
| 475 |
+
where we use MC integration with $T$ samples for the final step. The predictive covariance matrix is given by:
|
| 476 |
+
|
| 477 |
+
$$
|
| 478 |
+
\mathrm { C o v } _ { p ^ { * } } [ \mathbf { y } ] \approx \tau ^ { - 1 } \mathbf { I } + \frac { 1 } { T } \sum _ { i = 1 } ^ { T } f _ { \hat { \omega } _ { i } } ( \mathbf { x } ) ^ { \top } f _ { \hat { \omega } _ { i } } ( \mathbf { x } ) - \mathbb { E } _ { p ^ { * } } [ \mathbf { y } ] ^ { \top } \mathbb { E } _ { p ^ { * } } [ \mathbf { y } ]
|
| 479 |
+
$$
|
| 480 |
+
|
| 481 |
+
which is the sum of the variance from observation noise and the sample covariance from $T$ stochastic forward passes though the network.
|
| 482 |
+
|
| 483 |
+
Predictive Log Likelihood We use the Predictive Log Likelihood (PLL) as a measure to estimate the model’s uncertainty quality. For a certain test point $\left( \mathbf { y } _ { i } , \mathbf { x } _ { i } \right)$ , the PLL definition and approximation can be expressed as:
|
| 484 |
+
|
| 485 |
+
$$
|
| 486 |
+
\begin{array} { r l } { \displaystyle \mathrm { P L L } ( f _ { \omega } ( \mathbf { x } ) , ( \mathbf { y } _ { i } , \mathbf { x } _ { i } ) ) = \log p ( \mathbf { y } _ { i } | f _ { \omega } ( \mathbf { x } _ { i } ) ) } & { } \\ { \displaystyle } & { = \log \int f _ { \omega } ( \mathbf { x } _ { i } , \mathbf { y } _ { i } ) p ( \omega | \mathbf { D } ) \mathrm { d } \omega } \\ { \displaystyle } & { \approx \log \int f _ { \omega } ( \mathbf { x } _ { i } , \mathbf { y } _ { i } ) q _ { \theta } ( \omega ) \mathrm { d } \omega } \\ { \displaystyle } & { \approx \log \sum _ { j = 1 } ^ { T } p ( \mathbf { y } _ { i } | f _ { \omega _ { j } } ( \mathbf { x } _ { i } ) ) } \end{array}
|
| 487 |
+
$$
|
| 488 |
+
|
| 489 |
+
where $\hat { \omega } _ { j }$ represents a sampled set of stochastic parameters from the approximate posterior distrubtion $q _ { \pmb { \theta } } ( \omega )$ and we take a MC integration with $T$ samples. For regression, due to the iid Gaussian noise, we can further develop the derivation into the form we use when sampling:
|
| 490 |
+
|
| 491 |
+
$$
|
| 492 |
+
\begin{array} { r l } { { \operatorname { P L L } \bigl ( f _ { \omega } ( \mathbf { x } ) , ( \mathbf { y } _ { i } , \mathbf { x } _ { i } ) \bigr ) = \log \sum _ { i = 1 } ^ { T } \mathcal { N } ( \mathbf { y } _ { i } | f _ { \hat { \omega } _ { j } } ( \mathbf { x } _ { i } ) , { \boldsymbol \tau } ^ { - 1 } \mathbf { I } ) } } \\ & { = \log \operatorname { s u m e x p } _ { j = 1 , \dots , T } \big ( - \frac { 1 } { 2 } | | \mathbf { y } _ { i } - f _ { \hat { \omega } _ { j } } ( \mathbf { x } _ { i } ) | | ^ { 2 } \big ) } \\ & { + \log T - \frac { 1 } { 2 } \log 2 \pi + \frac { 1 } { 2 } \log \tau } \end{array}
|
| 493 |
+
$$
|
| 494 |
+
|
| 495 |
+
Note that PLL makes no assumption on the form of the approximate predictive distribution. The measure is based on repeated sampling $\hat { \omega } _ { j }$ from $q _ { \pmb { \theta } } ( \omega )$ , which may be highly multimodal (see section 3.4).
|
| 496 |
+
|
| 497 |
+
# 6.5 PRIOR
|
| 498 |
+
|
| 499 |
+
We assume training by SGD with mini-batch size $M$ , L2-regularization on weights and Fully Connected layers. With $\theta _ { k } \in \pmb \theta$ , equivalence between the objectives of Eq. (1) and (2) then requires:
|
| 500 |
+
|
| 501 |
+
$$
|
| 502 |
+
\begin{array} { l } { \displaystyle \frac { \partial } { \partial { \boldsymbol { \theta } } _ { k } } \mathrm { K L } \big ( { \boldsymbol { q } } _ { \pmb { \theta } } ( \omega ) | | { \boldsymbol { p } } ( \omega ) \big ) = N \tau \frac \partial { \partial { \boldsymbol { \theta } } _ { k } } \Omega ( { \pmb { \theta } } ) } \\ { \displaystyle = N \tau \frac \partial { \partial { \boldsymbol { \theta } } _ { k } } \sum _ { l = 1 } ^ { L } \lambda _ { l } | | \mathbf { W } ^ { l } | | ^ { 2 } } \end{array}
|
| 503 |
+
$$
|
| 504 |
+
|
| 505 |
+
To proceed with the LHS of Eq. (5) we first need to find the approximate posterior $q _ { \pmb { \theta } } ( \omega )$ that batch normalization induces. As shown in Appendix 6.3, with some weak assumptions and approximations the Central Limit Theorem (CLT) yields Gaussian distributions of the stochastic variables $\mu _ { \mathbf { B } } ^ { u } , \sigma _ { \mathbf { B } } ^ { u }$ , for large enough $M$ :
|
| 506 |
+
|
| 507 |
+
$$
|
| 508 |
+
\begin{array} { l } { \displaystyle \mu _ { \bf B } ^ { u } \underset { \sim } { \propto } \mathcal { N } ( \mu ^ { u } , \frac { ( \sigma ^ { u } ) ^ { 2 } } { M } ) , } \\ { \displaystyle \sigma _ { \bf B } ^ { u } \underset { \sim } { \propto } \mathcal { N } ( \sigma ^ { u } , \frac { \mathbb { E } [ ( h ^ { u } - \mu ^ { u } ) ^ { 4 } ] - ( \sigma ^ { u } ) ^ { 4 } } { 4 ( \sigma ^ { u } ) ^ { 2 } M } ) } \end{array}
|
| 509 |
+
$$
|
| 510 |
+
|
| 511 |
+
where $\mu ^ { u }$ and $\sigma ^ { u }$ are the population-level moments (i.e. moments over $\mathbf { D }$ ), and $h ^ { u }$ is the BN unit’s input. We use $i$ as an index of the set of stochastic variables, i.e. $\omega _ { i } \in \{ \mu _ { \mathrm { B } } ^ { 1 : L } , \sigma _ { \mathrm { B } } ^ { 1 : L } \}$ , and denote by $\omega _ { i } ^ { l }$ the stochastic variables in a certain layer, $\omega _ { i } ^ { l } \in \{ \mu _ { \mathrm { B } } ^ { l } , \sigma _ { \mathrm { B } } ^ { l } \}$ . We assume $q _ { \boldsymbol { \theta } } ( \omega )$ and $p ( \omega )$ factorize over all individual $\omega _ { i }$ , i.e. independence between all stochastic variables.11 As shown in Eq. (3) in Appendix 6.2, the factorized distributions yield:
|
| 512 |
+
|
| 513 |
+
$$
|
| 514 |
+
\mathrm { K L } ( q _ { \theta } ( \boldsymbol { \omega } ) | | p ( \boldsymbol { \omega } ) ) = \sum _ { i } \mathrm { K L } ( q _ { \theta } ( \boldsymbol { \omega } _ { i } ) | | p ( \boldsymbol { \omega } _ { i } ) )
|
| 515 |
+
$$
|
| 516 |
+
|
| 517 |
+
Note that each BN unit produces two ${ \mathrm { K L } } ( q _ { \pmb { \theta } } ( \omega _ { i } ) | | p ( \omega _ { i } ) )$ terms: one for $\omega _ { i } ~ = ~ \mu _ { \mathbf { B } } ^ { u }$ and one for $\omega _ { i } = \sigma _ { \mathbf { B } } ^ { u }$ .
|
| 518 |
+
|
| 519 |
+
We assume a Gaussian prior $p ( \omega _ { i } ) = \mathcal N ( \mu _ { p } , \sigma _ { p } ^ { 2 } )$ and, for consistency, use the notation $q _ { \pmb { \theta } } ( \omega _ { i } ) =$ $\mathcal { N } ( \mu _ { q } , \sigma _ { q } ^ { 2 } )$ . As shown in Eq. (4) in Appendix 6.2:
|
| 520 |
+
|
| 521 |
+
$$
|
| 522 |
+
\mathrm { K L } ( q _ { \theta } ( \omega _ { i } ) | | p ( \omega _ { i } ) ) = \ln \frac { \sigma _ { p } } { \sigma _ { q } } + \frac { \sigma _ { q } ^ { 2 } + ( \mu _ { q } - \mu _ { p } ) ^ { 2 } } { 2 \sigma _ { p } ^ { 2 } } - \frac { 1 } { 2 }
|
| 523 |
+
$$
|
| 524 |
+
|
| 525 |
+
Then, letting $( \cdot ) ^ { \prime }$ denote $\frac { \partial } { \partial \theta _ { k } } ( \cdot )$ :
|
| 526 |
+
|
| 527 |
+
$$
|
| 528 |
+
\begin{array} { r l } & { \displaystyle \frac { \partial } { \partial \theta _ { k } } \mathrm { K L } \big ( q _ { \theta } ( \omega _ { i } ) | | p ( \omega _ { i } ) \big ) = \frac { 2 \sigma _ { q } \sigma _ { p } \sigma _ { q } ^ { \prime } - \sigma _ { p } ^ { \prime } \big ( 2 \sigma _ { q } ^ { 2 } - ( \mu _ { q } - \mu _ { p } ) ^ { 2 } \big ) } { \sigma _ { p } ^ { 3 } } + \frac { ( \mu _ { q } - \mu _ { p } ) \big ( \mu _ { q } ^ { \prime } - \mu _ { p } ^ { \prime } \big ) } { \sigma _ { p } ^ { 2 } } } \\ & { \displaystyle \quad \quad = \frac { 2 \sigma _ { p } \sigma _ { q } \sigma _ { q } ^ { \prime } } { \sigma _ { p } ^ { 3 } } + \frac { \big ( \mu _ { q } - \mu _ { p } \big ) \mu _ { q } ^ { \prime } } { \sigma _ { p } ^ { 2 } } } \end{array}
|
| 529 |
+
$$
|
| 530 |
+
|
| 531 |
+
where the last step makes use of the fact that $\mu _ { p } ^ { \prime } = 0$ and $\sigma _ { p } ^ { \prime } = 0$ (as $p ( \omega _ { i } )$ cannot depend on $\theta _ { k }$ which changes during training).
|
| 532 |
+
|
| 533 |
+
We assume that only parameters preceding a BN unit in the same layer affects the unit’s stochastic parameters, such that the stochastic variables in the $j$ :th BN unit are only affected by weights in $\mathcal { \bar { \theta } } _ { k } \in W ^ { l , ( j ) }$ . Let the vector of average inputs over $\mathbf { D }$ from the preceding layers be denoted by $\bar { \mathbf { x } }$ . We denote a weight connecting the $m$ :th input unit to the $j$ :th BN unit by $\mathbf { W } ^ { ( j , m ) }$ . For such weights, we need to derive $\mu _ { q } ^ { \prime }$ and $\sigma _ { q } ^ { \prime }$ , for both $\omega _ { i } = \mu _ { \mathbf { B } } ^ { u }$ and $\omega _ { i } = \sigma _ { \mathbf { B } } ^ { u }$ . Starting with $\omega _ { i } = \mu _ { \mathbf { B } } ^ { u }$
|
| 534 |
+
|
| 535 |
+

|
| 536 |
+
Figure 4: Batch statistics used to train the network are normal. A one-sample Kolmogorov-Smirnov test checks that $\mu _ { \mathbf { B } }$ and $\sigma _ { \mathbf { B } }$ come from a standard normal distribution. More examples are available in Appendix 6.7.
|
| 537 |
+
|
| 538 |
+
$$
|
| 539 |
+
\begin{array} { l } { { \displaystyle { \mu _ { q } ^ { \prime } = \frac { \partial } { \partial { \bf W } ^ { ( j , m ) } } \frac { \sum _ { { \pmb x } \in { \bf D } } { \bf W } ^ { ( j ) } { \pmb x } } { N } = \bar { \bf x } ^ { ( m ) } } } } \\ { { \displaystyle { \sigma _ { q } ^ { \prime } = \frac { \partial } { \partial { \bf W } ^ { ( j , m ) } } \left[ \frac { \sum _ { { \pmb x } \in { \bf D } } \left( { \bf W } ^ { ( j ) } { \pmb x } - \mu _ { q } \right) ^ { 2 } } { N M } \right] ^ { \frac 1 2 } } } } \\ { { \displaystyle { \mathrm { \cfrac { 1 } { 2 } \left[ \frac { \sum _ { { \pmb x } \in { \bf D } } \left( { \bf W } ^ { ( j ) } { \pmb x } - \mu _ { q } \right) ^ { 2 } } { N M } \right] ^ { - \frac 1 2 } \frac { \sum _ { { \pmb x } \in { \bf D } } 2 \left( { \bf W } ^ { ( j ) } { \pmb x } - \mu _ { q } \right) \left( { \pmb x } ^ { ( m ) } - \bar { \bf x } ^ { ( m ) } \right) } } = 0 } } } \end{array}
|
| 540 |
+
$$
|
| 541 |
+
|
| 542 |
+
Using the result that $\sigma _ { q } ^ { \prime } = 0$ , one can easily find for $\omega _ { i } = \sigma _ { \mathbf { B } } ^ { u }$ that $\mu _ { q } ^ { \prime } = 0$ and $\sigma _ { q } ^ { \prime } = 0$ , nullifying Eq. (7). We need only consider the partial derivatives of the KL divergence terms where $\omega _ { i } = \mu _ { \mathbf { B } } ^ { u }$ . If we let $\mu _ { p } = 0$ , Eq. (7) reduces to:
|
| 543 |
+
|
| 544 |
+
$$
|
| 545 |
+
\frac { \partial } { \partial \mathbf { W } ^ { ( j , m ) } } \mathrm { K L } \big ( q _ { \theta } ( \omega _ { i } ) | | p ( \omega _ { i } ) \big ) = \frac { \mu _ { q } \bar { \mathbf { x } } ^ { ( m ) } } { \sigma _ { p } ^ { 2 } } = \frac { \bar { \mathbf { x } } ^ { ( m ) } \mathbf { W } ^ { ( j ) } \bar { \mathbf { x } } } { \sigma _ { p } ^ { 2 } }
|
| 546 |
+
$$
|
| 547 |
+
|
| 548 |
+
for each BN unit and connecting weights from the previous layer, $\mathbf { W } ^ { ( j , m ) }$ . Taking partial derivatives for all ${ \mathrm { K L } } ( q _ { \pmb { \theta } } ( \omega _ { i } ) | | p ( \omega _ { i } ) )$ components in the layer:
|
| 549 |
+
|
| 550 |
+
$$
|
| 551 |
+
\sum _ { \omega _ { i } ^ { l } } \sum _ { j } \sum _ { m } \frac { \partial } { \partial \mathbf { W } ^ { ( j , m ) } } \mathrm { K L } ( q _ { \theta } ( \omega _ { i } ) | | p ( \omega _ { i } ) ) = \sum _ { m } \left[ \bar { \pmb { x } } ^ { ( m ) } \right] \ast \sum _ { j } \sum _ { m } \frac { \mathbf { W } ^ { ( j , m ) } \bar { \pmb { x } } ^ { ( m ) } } { \sigma _ { p } ^ { 2 } }
|
| 552 |
+
$$
|
| 553 |
+
|
| 554 |
+
We consider ReLU activations, such that for large $N$ $, \bar { \pmb x } ^ { ( m ) } > 0 \forall m .$ . Note that this does not hold for the first layer (which is possibly normalized), but the effect of including these weights in the L2-regularization would be smaller the deeper the network. We assume most outputs from previous layer’s BN units remain normalized through the scale and shift transformation, such that we can approximate $\bar { \pmb x } ^ { ( m ) }$ by the average of all input units over test data, $x$ in Eq. (8). With $J _ { l - 1 }$ units in the input layer, setting $\begin{array} { r } { \sigma _ { p } ^ { 2 } = \frac { J _ { l - 1 } x ^ { 2 } } { 2 N \lambda _ { l } } } \end{array}$ Jl−1x22Nλl , such that p(µuB) = N (0 2 , Jl−1x2 ) would then reconcile Eq. (5), for any Gaussian $p ( \sigma _ { \mathbf { B } } ^ { u } )$ .
|
| 555 |
+
|
| 556 |
+
# 6.6 EXTENDED EXPERIMENTAL RESULTS
|
| 557 |
+
|
| 558 |
+
Below, we provide extended results measuring uncertainty quality. In Tables 3 and 4, we provide tables showing the mean CRPS and $\overline { { \mathrm { P L L } } }$ values for MCBN and MCDO. These results indicate that MCBN performs on par or better than MCDO across several datasets. In Table 5 we provide the raw PLL and CRPS results for MCBN and MCDO. In Table 6 we provide RMSE results of the MCBN and MCDO networks in comparison with non-stochastic BN and DO networks. These results indicate that the procedure of multiple forward passes in MCBN and MCDO show slight improvements in the accuracy of the network.
|
| 559 |
+
|
| 560 |
+
In Figure 5 and Figure 6, we provide a full set of our uncertainty quality visualization plots, where errors in predictions are sorted by estimated uncertainty. The shaded areas show the model uncertainty and gray dots show absolute prediction errors on the test set. A gray line depicts a running
|
| 561 |
+
|
| 562 |
+
mean of the errors. The dashed line indicates the optimized constant uncertainty. In these plots, we can see a correlation between estimated uncertainty (shaded area) and mean error (gray). This trend indicates that the model uncertainty estimates can recognize samples with larger (or smaller) potential for predictive errors.
|
| 563 |
+
|
| 564 |
+
<table><tr><td></td><td colspan="4">CRPS</td></tr><tr><td>Dataset</td><td>MCBN</td><td>p-value</td><td>MCDO</td><td>p-value</td></tr><tr><td>Boston Housing</td><td>8.50 ±0.86</td><td>6.39e-10</td><td>3.06 ±0.33</td><td>1.64e-9</td></tr><tr><td>Concrete</td><td>3.91 ±0.25</td><td>4.53e-14</td><td>0.93 ±0.41</td><td>3.13e-2</td></tr><tr><td>Energy Efficiency</td><td>5.75 ±0.52</td><td>6.71e-11</td><td>1.37 ±0.89</td><td>1.38e-1</td></tr><tr><td>Kinematics 8nm</td><td>2.85 ±0.18</td><td>2.33e-14</td><td>1.82 ±0.14</td><td>1.64e-12</td></tr><tr><td>Power Plant</td><td>0.24 ±0.05</td><td>2.32e-4</td><td>-0.44 ±0.05</td><td>2.17e-8</td></tr><tr><td>Protein</td><td>2.66 ±0.10</td><td>2.77-12</td><td>0.99 ±0.08</td><td>2.34e-12</td></tr><tr><td>Wine Quality (Red)</td><td>0.26 ±0.07</td><td>1.26e-3</td><td>2.00 ±0.21</td><td>1.83e-9</td></tr><tr><td>Yacht Hydrodynamics</td><td>-56.39 ±14.27</td><td>5.94e-4</td><td>21.42 ±2.99</td><td>2.16e-7</td></tr></table>
|
| 565 |
+
|
| 566 |
+
Table 3: CRPS measured on eight datasets over 25 random 80-20 splits of the data. Mean values for MCBN and MCDO are reported along with standard error. A significance test was performed to check if CRPS significantly exceeds the baseline. The $p$ -value from a one sample t-test is reported. Marked in bold is the best performing method versus its baseline.
|
| 567 |
+
|
| 568 |
+
<table><tr><td rowspan="2">Dataset</td><td colspan="4">PLL</td></tr><tr><td>MCBN</td><td>p-value</td><td>MCDO</td><td>p-value</td></tr><tr><td>Boston Housing</td><td>10.49 ±1.35</td><td>5.41e-8</td><td>5.51 ±1.05</td><td>2.20e-5</td></tr><tr><td>Concrete</td><td>-36.36 ±12.12</td><td>6.19e-3</td><td>10.92 ±1.78</td><td>2.34e-6</td></tr><tr><td>Energy Efficiency</td><td>10.89 ±1.16</td><td>1.79e-9</td><td>-14.28 ±5.15</td><td>1.06e-2</td></tr><tr><td>Kinematics 8nm</td><td>1.68 ±0.37</td><td>1.29e-4</td><td>-0.26 ±0.18</td><td>1.53e-1</td></tr><tr><td>Power Plant</td><td>0.33 ±0.14</td><td>2.72e-2</td><td>3.52 ±0.23</td><td>1.12e-13</td></tr><tr><td>Protein</td><td>2.56 ±0.23</td><td>4.28e-11</td><td>6.23 ±0.19</td><td>2.57e-21</td></tr><tr><td>Wine Quality (Red)</td><td>0.19 ±0.09</td><td>3.72e-2</td><td>2.91 ±0.35</td><td>1.84e-8</td></tr><tr><td>Yacht Hydrodynamics</td><td>45.58 ±5.18</td><td>5.67e-9</td><td>-41.54 ±31.37</td><td>1.97e-1</td></tr></table>
|
| 569 |
+
|
| 570 |
+
Table 4: PLL measured on eight datasets over 25 random 80-20 splits of the data. Mean values for MCBN and MCDO are reported along with standard error. A significance test was performed to check if PLL significantly exceeds the baseline. The $p$ -value from a one sample t-test is reported. Marked in bold is the best performing method versus its baseline.
|
| 571 |
+
|
| 572 |
+
<table><tr><td></td><td colspan="2">CRPS</td><td colspan="2">PLL</td></tr><tr><td>Dataset</td><td>MCBN</td><td>MCDO</td><td>MCBN</td><td>MCDO</td></tr><tr><td>Boston Housing</td><td>1.45±0.02</td><td>1.41±0.02</td><td>-2.38±0.02</td><td>-2.35±0.02</td></tr><tr><td>Concrete</td><td>2.40±0.04</td><td>2.42±0.04</td><td>-3.45±0.11</td><td>-2.94±0.02</td></tr><tr><td>Energy Efficiency</td><td>0.33±0.01</td><td>0.26±0.00</td><td>-0.94±0.04</td><td>-0.80±0.04</td></tr><tr><td>Kinematics 8nm</td><td>0.04±0.00</td><td>0.04±0.00</td><td>1.21±0.01</td><td>1.24±0.00</td></tr><tr><td>Power Plant</td><td>2.00±0.01</td><td>2.00±0.01</td><td>-2.75±0.00</td><td>-2.72±0.01</td></tr><tr><td>Protein Tertiary Structure</td><td>1.95±0.01</td><td>1.95±0.00</td><td>-2.73±0.00</td><td>-2.70±0.00</td></tr><tr><td>Wine Quality (Red)</td><td>0.34±0.00</td><td>0.33±0.00</td><td>-0.95±0.01</td><td>-0.89±0.01</td></tr><tr><td>Yacht Hydrodynamics</td><td>0.68±0.02</td><td>0.32±0.01</td><td>-1.39±0.03</td><td>-2.57±0.69</td></tr></table>
|
| 573 |
+
|
| 574 |
+
Table 5: CRPS and PLL measured on eight datasets over 25 random 80-20 splits of the data. Mean values and standard errors are reported for MCBN and MCDO. Marked in bold is the best performing method for each metric.
|
| 575 |
+
|
| 576 |
+
# 6.7 BATCH NORMALIZATION STATISTICS
|
| 577 |
+
|
| 578 |
+
In Figure 7 and Figure 8, we provide statistics on the batch normalization parameters used for training. The plots show the distribution of BN mean and BN variance over different mini-batches
|
| 579 |
+
|
| 580 |
+
Table 6: RMSE measured on eight datasets over 25 random 80-20 splits of the data. Mean values and standard errors are reported for MCBN and MCDO as well as conventional non-Bayesian models BN and DO. Marked in bold is the best performing method overall.
|
| 581 |
+
|
| 582 |
+
<table><tr><td></td><td colspan="4">RMSE</td></tr><tr><td>Dataset</td><td>MCBN</td><td>BN</td><td>MCDO</td><td>DO</td></tr><tr><td>Boston Housing</td><td>2.75 ±0.05</td><td>2.77 ±0.05</td><td>2.65 ±0.05</td><td>2.69 ±0.05</td></tr><tr><td>Concrete</td><td>4.78 ±0.09</td><td>4.89 ±0.08</td><td>4.80 ±0.10</td><td>4.99 ±0.10</td></tr><tr><td>Energy Efficiency</td><td>0.59 ±0.02</td><td>0.57 ±0.01</td><td>0.47 ±0.01</td><td>0.49 ±0.01</td></tr><tr><td>Kinematics 8nm</td><td>0.07 ±0.00</td><td>0.07 ±0.00</td><td>0.07 ±0.00</td><td>0.07 ±0.00</td></tr><tr><td>Power Plant</td><td>3.74 ±0.01</td><td>3.74 ±0.01</td><td>3.74 ±0.02</td><td>3.72 ±0.02</td></tr><tr><td>Protein</td><td>3.66 ±0.01</td><td>3.69 ±0.01</td><td>3.66 ±0.01</td><td>3.68 ±0.01</td></tr><tr><td>Wine Quality (Red)</td><td>0.62 ±0.00</td><td>0.62 ±0.00</td><td>0.60 ±0.00</td><td>0.61 ±0.00</td></tr><tr><td>Yacht Hydrodynamics</td><td>1.23 ±0.05</td><td>1.28 ±0.06</td><td>0.75 ±0.03</td><td>0.72 ±0.04</td></tr></table>
|
| 583 |
+
|
| 584 |
+
of an actual training of Yacht dataset for one unit in the first hidden layer and the second hidden layer. Data is provided for different epochs and for different batch sizes.
|
| 585 |
+
|
| 586 |
+

|
| 587 |
+
Figure 5: Errors in predictions (gray dots) sorted by estimated uncertainty on select datasets. The shaded areas show MCBN’s (blue) and MCDO’s (red) model uncertainty (light area $9 5 \%$ CI, dark area $50 \%$ CI). Gray dots show absolute prediction errors on the test set, and the gray line depicts a running mean of the errors. The dashed line indicates the optimized constant uncertainty. A correlation between estimated uncertainty (shaded area) and mean error (gray) indicates the uncertainty estimates are meaningful for estimating errors.
|
| 588 |
+
|
| 589 |
+

|
| 590 |
+
Figure 6: Errors in predictions (gray dots) sorted by estimated uncertainty on select datasets. The shaded areas show MCBN’s (blue) and MCDO’s (red) model uncertainty (light area $9 5 \%$ CI, dark area $50 \%$ CI). Gray dots show absolute prediction errors on the test set, and the gray line depicts a running mean of the errors. The dashed line indicates the optimized constant uncertainty. A correlation between estimated uncertainty (shaded area) and mean error (gray) indicates the uncertainty estimates are meaningful for estimating errors.
|
| 591 |
+
|
| 592 |
+

|
| 593 |
+
|
| 594 |
+

|
| 595 |
+
batch mean (unit-1, layer-1, batch size=128, epoch=10)
|
| 596 |
+
|
| 597 |
+

|
| 598 |
+
|
| 599 |
+

|
| 600 |
+
|
| 601 |
+
Figure 7: The distribution of means of mini-batches during training of one of our datasets. The distribution closely follows our analytically approximated Gaussian distribution. The data is collected for one unit of each layer and is provided for different epochs and for different batch sizes.
|
| 602 |
+
|
| 603 |
+

|
| 604 |
+
batch mean (unit-1, layer-1, batch size=32, epoch=100)
|
| 605 |
+
|
| 606 |
+

|
| 607 |
+
|
| 608 |
+

|
| 609 |
+
, epoch=100)
|
| 610 |
+
|
| 611 |
+

|
| 612 |
+
|
| 613 |
+

|
| 614 |
+
Figure 8: The distribution of standard deviation of mini-batches during training of one of our datasets. The distribution closely follows our analytically approximated Gaussian distribution. The data is collected for one unit of each layer and is provided for different epochs and for different batch sizes.
|
md/train/BbNIbVPJ-42/BbNIbVPJ-42.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/train/BkUDvt5gg/BkUDvt5gg.md
ADDED
|
@@ -0,0 +1,189 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# WAV2LETTER: AN END-TO-END CONVNET-BASED SPEECH RECOGNITION SYSTEM
|
| 2 |
+
|
| 3 |
+
Ronan Collobert Facebook AI Research, Menlo Park locronan@fb.com
|
| 4 |
+
|
| 5 |
+
Christian Puhrsch Facebook AI Research, Menlo Park cpuhrsch@fb.com
|
| 6 |
+
|
| 7 |
+
Gabriel Synnaeve
|
| 8 |
+
Facebook AI Research, New York
|
| 9 |
+
gab@fb.com
|
| 10 |
+
|
| 11 |
+
# ABSTRACT
|
| 12 |
+
|
| 13 |
+
This paper presents a simple end-to-end model for speech recognition, combining a convolutional network based acoustic model and a graph decoding. It is trained to output letters, with transcribed speech, without the need for force alignment of phonemes. We introduce an automatic segmentation criterion for training from sequence annotation without alignment that is on par with CTC (Graves et al., 2006) while being simpler. We show competitive results in word error rate on the Librispeech corpus (Panayotov et al., 2015) with MFCC features, and promising results from raw waveform.
|
| 14 |
+
|
| 15 |
+
# 1 INTRODUCTION
|
| 16 |
+
|
| 17 |
+
We present an end-to-end system to speech recognition, going from the speech signal (e.g. MelFrequency Cepstral Coefficients (MFCC), power spectrum, or raw waveform) to the transcription. The acoustic model is trained using letters (graphemes) directly, which take out the need for an intermediate (human or automatic) phonetic transcription. Indeed, the classical pipeline to build state of the art systems for speech recognition consists in first training an HMM/GMM model to force align the units on which the final acoustic model operates (most often context-dependent phone states). This approach takes its roots in HMM/GMM training (Woodland & Young, 1993). The improvements brought by deep neural networks (DNNs) (Mohamed et al., 2012; Hinton et al., 2012) and convolutional neural networks (CNNs) (Sercu et al., 2015; Soltau et al., 2014) for acoustic modeling only extend this training pipeline.
|
| 18 |
+
|
| 19 |
+
The current state of the art on Librispeech (the dataset that we used for our evaluations) uses this approach too (Panayotov et al., 2015; Peddinti et al., 2015b), with an additional step of speaker adaptation (Saon et al., 2013; Peddinti et al., 2015a). Recently, Senior et al. (2014) proposed GMMfree training, but the approach still requires to generate a force alignment. An approach that cut ties with the HMM/GMM pipeline (and with force alignment) was to train with a recurrent neural network (RNN) (Graves et al., 2013) for phoneme transcription. There are now competitive end-to-end approaches of acoustic models toppled with RNNs layers as in (Hannun et al., 2014; Miao et al., 2015; Saon et al., 2015; Amodei et al., 2015), trained with a sequence criterion (Graves et al., 2006). However these models are computationally expensive, and thus take a long time to train.
|
| 20 |
+
|
| 21 |
+
Compared to classical approaches that need phonetic annotation (often derived from a phonetic dictionary, rules, and generative training), we propose to train the model end-to-end, using graphemes directly. Compared to sequence criterion based approaches that train directly from speech signal to graphemes (Miao et al., 2015), we propose a simple(r) architecture (23 millions of parameters for our best model, vs. 100 millions of parameters in (Amodei et al., 2015)) based on convolutional networks for the acoustic model, toppled with a graph transformer network (Bottou et al., 1997), trained with a simpler sequence criterion. Our word-error-rate on clean speech is slightly better than (Hannun et al., 2014), and slightly worse than (Amodei et al., 2015), in particular factoring that they train on 12,000 hours while we only train on the 960h available in LibriSpeech’s train set. Finally, some of our models are also trained on the raw waveform, as in (Palaz et al., 2013; 2015; Sainath et al., 2015). The rest of the paper is structured as follows: the next section presents the convolutional networks used for acoustic modeling, along with the automatic segmentation criterion. The following section shows experimental results comparing different features, the criterion, and our current best word error rates on LibriSpeech.
|
| 22 |
+
|
| 23 |
+
# 2 ARCHITECTURE
|
| 24 |
+
|
| 25 |
+
Our speech recognition system is a standard convolutional neural network (LeCun & Bengio, 1995) fed with various different features, trained through an alternative to the Connectionist Temporal Classification (CTC) (Graves et al., 2006), and coupled with a simple beam search decoder. In the following sub-sections, we detail each of these components.
|
| 26 |
+
|
| 27 |
+
# 2.1 FEATURES
|
| 28 |
+
|
| 29 |
+
We consider three types of input features for our model: MFCCs, power-spectrum, and raw wave. MFCCs are carefully designed speech-specific features, often found in classical HMM/GMM speech systems (Woodland & Young, 1993) because of their dimensionality compression (13 coefficients are often enough to span speech frequencies). Power-spectrum features are found in most recent deep learning acoustic modeling features (Amodei et al., 2015). Raw wave has been somewhat explored in few recent work (Palaz et al., 2013; 2015). ConvNets have the advantage to be flexible enough to be used with either of these input feature types. Our acoustic models output letter scores (one score per letter, given a dictionary $\mathcal { L }$ ).
|
| 30 |
+
|
| 31 |
+
# 2.2 CONVNET ACOUSTIC MODEL
|
| 32 |
+
|
| 33 |
+
The acoustic models we considered in this paper are all based on standard 1D convolutional neural networks (ConvNets). ConvNets interleave convolution operations with pointwise non-linearity operations. Often ConvNets also embark pooling layers: these type of layers allow the network to “see” a larger context, without increasing the number of parameters, by locally aggregating the previous convolution operation output. Instead, our networks leverage striding convolutions. Given $\mathbf { \bar { \rho } } ( x _ { t } ) _ { t = 1 \dots T _ { x } }$ an input sequence with $T _ { x }$ frames of $d _ { x }$ dimensional vectors, a convolution with kernel width $k w$ , stride $d w$ and $d _ { y }$ frame size output computes the following:
|
| 34 |
+
|
| 35 |
+
$$
|
| 36 |
+
y _ { t } ^ { i } = b _ { i } + \sum _ { j = 1 } ^ { d _ { x } } \sum _ { k = 1 } ^ { k w } w _ { i , j , k } x _ { d w \times ( t - 1 ) + k } ^ { j } \quad \forall 1 \leq i \leq d _ { y } ,
|
| 37 |
+
$$
|
| 38 |
+
|
| 39 |
+
where $b \in \mathbb { R } ^ { d _ { y } }$ and $w \in \mathbb { R } ^ { d _ { y } \times d _ { x } \times k w }$ are the parameters of the convolution (to be learned).
|
| 40 |
+
|
| 41 |
+
Pointwise non-linear layers are added after convolutional layers. In our experience, we surprisingly found that using hyperbolic tangents, their piecewise linear counterpart HardTanh (as in (Palaz et al., 2015)) or ReLU units lead to similar results.
|
| 42 |
+
|
| 43 |
+
There are some slight variations between the architectures, depending on the input features. MFCC-based networks need less striding, as standard MFCC filters are applied with large strides on the input raw sequence. With power spectrum-based and raw wave-based networks, we observed that the overall stride of the network was more important than where the convolution with strides were placed. We found thus preferrable to set the strided convolutions near the first input layers of the network, as it leads to the fastest architectures: with power spectrum features or raw wave, the input sequences are very long and the first convolutions are thus the most expensive ones.
|
| 44 |
+
|
| 45 |
+

|
| 46 |
+
Figure 1: Our neural network architecture for raw wave. First two layers are convolutions with strides. Last two layers are convolutions with $\begin{array} { r l r } { k w } & { { } = } & { 1 } \end{array}$ , which are equivalent to fully connected layers. Power spectrum and MFCC based networks do not have the first layer.
|
| 47 |
+
|
| 48 |
+
The last layer of our convolutional network outputs one score per letter in the letter dictionary $( d _ { y } = | \mathcal { L } | )$ . Our architecture for raw wave is shown in Figure 1 and is inspired by (Palaz et al., 2015). The architectures for both power spectrum and MFCC features do not include the first layer. The full network can be seen as a non-linear convolution, with a kernel width of size 31280 and stride equal to 320; given the sample rate of our data is 16KHz, label scores are produced using a window of $1 9 5 5 \mathrm { m s }$ , with steps of $2 0 \mathrm { m s }$ .
|
| 49 |
+
|
| 50 |
+
# 2.3 INFERRING SEGMENTATION WITH AUTOSEGCRITERION
|
| 51 |
+
|
| 52 |
+
Most large labeled speech databases provide only a text transcription for each audio file. In a classification framework (and given our acoustic model produces letter predictions), one would need the segmentation of each letter in the transcription to train properly the model. Unfortunately, manually labeling the segmentation of each letter would be tedious. Several solutions have been explored in the speech community to alleviate this issue: HMM/GMM models use an iterative EM procedure: (i) during the Estimation step, the best segmentation is inferred, according to the current model, by maximizing the joint probability of the letter (or any sub-word unit) transcription and input sequence. (ii) During the Maximization step the model is optimized by minimizing a frame-level criterion, based on the (now fixed) inferred segmentation. This approach is also often used to boostrap the training of neural network-based acoustic models.
|
| 53 |
+
|
| 54 |
+
Other alternatives have been explored in the context of hybrid HMM/NN systems, such as the MMI criterion (Bahl et al., 1986) which maximizes the mutual information between the acoustic sequence and word sequences or the Minimum Bayse Risk (MBR) criterion (Gibson & Hain, 2006).
|
| 55 |
+
|
| 56 |
+
More recently, standalone neural network architectures have been trained using criterions which jointly infer the segmentation of the transcription while increase the overall score of the right transcription (Graves et al., 2006; Palaz et al., 2014). The most popular one is certainly the Connectionist Temporal Classification (CTC) criterion, which is at the core of Baidu’s Deep Speech architecture (Amodei et al., 2015). CTC assumes that the network output probability scores, normalized at the frame level. It considers all possible sequence of letters (or any sub-word units), which can lead to a to a given transcription. CTC also allow a special “blank” state to be optionally inserted between each letters. The rational behind the blank state is two-folds: (i) modeling “garbage” frames which might occur between each letter and (ii) identifying the separation between two identical consecutive letters in a transcription. Figure 2a shows an example of the sequences accepted by CTC for a given transcription. In practice, this graph is unfolded as shown in Figure 2b, over the available frames output by the acoustic model. We denote ${ \mathcal { G } } _ { c t c } ( \theta , T )$ an unfolded graph over $T$ frames for a given transcription $\theta$ , and $\pi = \pi _ { 1 }$ , . . . , $\pi _ { T } \in \mathcal G _ { c t c } ( \theta , T )$ a path in this graph representing a (valid) sequence of letters for this transcription. At each time step $t$ , each node of the graph is assigned with the corresponding log-probability letter (that we denote $f _ { t } ( \cdot ) )$ output by the acoustic model. CTC aims at maximizing the “overall” score of paths in ${ \mathcal { G } } _ { c t c } ( \theta , T )$ ; for that purpose, it minimizes the Forward score:
|
| 57 |
+
|
| 58 |
+
$$
|
| 59 |
+
\mathit { C T C } ( \theta , T ) = - \operatorname * { l o g a d d } _ { \pi \in \mathcal { G } _ { c t c } ( \theta , T ) } \sum _ { t = 1 } ^ { T } f _ { \pi _ { t } } ( x ) ,
|
| 60 |
+
$$
|
| 61 |
+
|
| 62 |
+
where the “logadd” operation, also often called “log-sum-exp” is defined as $\mathrm { l o g a d d } ( a , b ) \ =$ $\exp ( \log ( a ) + { \bar { \log } } ( b ) )$ . This overall score can be efficiently computed with the Forward algorithm. To put things in perspective, if one would replace the logadd $( \cdot )$ by a $\operatorname* { m a x } ( { \mathord { \cdot } } )$ in (2) (which can be then efficiently computed by the Viterbi algorithm, the counterpart of the Forward algorithm), one would then maximize the score of the best path, according to the model belief. The logadd $( \cdot )$ can be seen as a smooth version of the $\operatorname* { m a x } ( { \mathord { \cdot } } )$ : paths with similar scores will be attributed the same weight in the overall score (and hence receive the same gradient), and paths with much larger score will have much more overall weight than paths with low scores. In practice, using the logadd(·) works much better than the $\operatorname* { m a x } ( { \mathord { \cdot } } )$ . It is also worth noting that maximizing (2) does not diverge, as the acoustic model is assumed to output normalized scores (log-probabilities) $f _ { i } ( \cdot )$ .
|
| 63 |
+
|
| 64 |
+

|
| 65 |
+
Figure 2: The CTC criterion graph. (a) Graph which represents all the acceptable sequences of letters (with the blank state denoted $^ { 6 6 } \varnothing ^ { , 9 }$ ), for the transcription “cat”. (b) Shows the same graph unfolded over 5 frames. There are no transitions scores. At each time step, nodes are assigned a conditional probability output by the neural network acoustic model.
|
| 66 |
+
|
| 67 |
+
In this paper, we explore an alternative to CTC, with three differences: (i) there are no blank labels, (ii) un-normalized scores on the nodes (and possibly un-normalized transition scores on the edges) (iii) global normalization instead of per-frame normalization:
|
| 68 |
+
|
| 69 |
+
• The advantage of (i) is that it produces a much simpler graph (see Figure 3a and Figure 3b). We found that in practice there was no advantage of having a blank class to model the possible “garbage” frames between letters. Modeling letter repetitions (which is also an important quality of the blank label in CTC) can be easily replaced by repetition character labels (we used two extra labels for two and three repetitions). For example “caterpillar” could be written as “caterpil2ar”, where “2” is a label to represent the repetition of the previous letter. Not having blank labels also simplifies the decoder. With (ii) one can easily plug an external language model, which would insert transition scores on the edges of the graph. This could be particularly useful in future work, if one wanted to model representations more high-level than letters. In that respect, avoiding normalized transitions is important to alleviate the problem of “label bias” Bottou (1991); Lafferty et al. (2001). In this work, we limited ourselves to transition scalars, which are learned together with the acoustic model. The normalization evoked in (iii) is necessary when using un-normalized scores on nodes or edges; it insures incorrect transcriptions will have a low confidence.
|
| 70 |
+
|
| 71 |
+
In the following, we name our criterion “Auto Segmentation Criterion” (ASG). Considering the same notations than for CTC in (2), and an unfolded graph $\mathcal { G } _ { a s g } ( \boldsymbol { \theta } , T )$ over $T$ frames for a given transcription $\theta$ (as in Figure 3b), as well as a fully connected graph $\mathcal { G } _ { f u l l } ( \boldsymbol { \theta } , T )$ over $T$ frames (representing all possible sequence of letters, as in Figure 3c), ASG aims at minimizing:
|
| 72 |
+
|
| 73 |
+
$$
|
| 74 |
+
4 S G ( \theta , T ) = - \operatorname * { l o g a d d } _ { \pi \in \mathcal { G } _ { a s g } ( \theta , T ) } \sum _ { t = 1 } ^ { T } ( f _ { \pi _ { t } } ( x ) + g _ { \pi _ { t - 1 } , \pi _ { t } } ( x ) ) + \operatorname * { l o g a d d } _ { \pi \in \mathcal { G } _ { f u l l } ( \theta , T ) } \sum _ { t = 1 } ^ { T } ( f _ { \pi _ { t } } ( x ) + g _ { \pi _ { t - 1 } , \pi _ { t } } ( x ) ) ,
|
| 75 |
+
$$
|
| 76 |
+
|
| 77 |
+
where $g _ { i , j } ( \cdot )$ is a transition score model to jump from label $i$ to label $j$ . The left-hand part of 3 promotes sequences of letters leading to the right transcription, and the right-hand part demotes all sequences of letters. As for CTC, these two parts can be efficiently computed with the Forward algorithm. Derivatives with respect to $f _ { i } ( \cdot )$ and $g _ { i , j } ( \cdot )$ can be obtained (maths are a bit tedious) by applying the chain rule through the Forward recursion.
|
| 78 |
+
|
| 79 |
+
# 2.4 BEAM-SEARCH DECODER
|
| 80 |
+
|
| 81 |
+
We wrote our own one-pass decoder, which performs a simple beam-search with beam threholding, histogram pruning and language model smearing Steinbiss et al. (1994). We kept the decoder as simple as possible (under 1000 lines of C code). We did not implement any sort of model adaptation before decoding, nor any word graph rescoring. Our decoder relies on KenLM Heafield et al. (2013) for the language modeling part. It also accepts un-normalized acoustic scores (transitions and emissions from the acoustic model) as input. The decoder attempts to maximize the following:
|
| 82 |
+
|
| 83 |
+

|
| 84 |
+
Figure 3: The ASG criterion graph. (a) Graph which represents all the acceptable sequences of letters for the transcription “cat”. (b) Shows the same graph unfolded over 5 frames. (c) Shows the corresponding fully connected graph, which describe all possible sequences of letter; this graph is used for normalization purposes. Un-normalized transitions scores are possible on the edges. At each time step, nodes are assigned a conditional un-normalized score, output by the neural network acoustic model.
|
| 85 |
+
|
| 86 |
+
$$
|
| 87 |
+
\mathcal { L } ( \theta ) = \mathop { \mathrm { l o g a d d } } _ { \pi \in \mathcal { G } _ { a s g } ( \theta , T ) } \sum _ { t = 1 } ^ { T } ( f _ { \pi _ { t } } ( x ) + g _ { \pi _ { t - 1 } , \pi _ { t } } ( x ) ) + \alpha \log P _ { l m } ( \theta ) + \beta | \theta | ,
|
| 88 |
+
$$
|
| 89 |
+
|
| 90 |
+
where $P _ { l m } ( \theta )$ is the probability of the language model given a transcription $\theta , \alpha$ and $\beta$ are two hyper-parameters which control the weight of the language model and the word insertion penalty respectively.
|
| 91 |
+
|
| 92 |
+
# 3 EXPERIMENTS
|
| 93 |
+
|
| 94 |
+
# 3.1 SETUP
|
| 95 |
+
|
| 96 |
+
We implemented everything using Torch71. The ASG criterion as well as the decoder were implemented in C (and then interfaced into Torch).
|
| 97 |
+
|
| 98 |
+
We consider as benchmark LibriSpeech, a large speech database freely available for download (Panayotov et al., 2015). LibriSpeech comes with its own train, validation and test sets. Except when specified, we used all the available data (about 1000h of audio files) for training and validating our models. We use the original $1 6 \mathrm { K H z }$ sampling rate. The vocabulary $\mathcal { L }$ contains 30 graphemes: the standard English alphabet plus the apostrophe, silence, and two special “repetition” graphemes which encode the duplication (once or twice) of the previous letter (see Section 2.3).
|
| 99 |
+
|
| 100 |
+
The architecture hyper-parameters, as well the decoder ones were tuned using the validation set. In the following, we either report letter-error-rates (LERs) or word-error-rates (WERs). WERs have been obtained by using our own decoder (see Section 2.4), with the standard 4-gram language model provided with LibriSpeech2.
|
| 101 |
+
|
| 102 |
+
Table 1: CTC vs ASG. CTC is Baidu’s implementation. ASG is implemented on CPU (C with OpenMP). Timings (in ms) for small sequences (input frames: 150, letter vocabulary size: 28, transcription size: 40) and long sequences (input frames: 700, letter vocabulary size: 28, transcription size: 200) are reported in (a) and (b) respectively. (c) reports performance in LER. Timings include both forward and backward passes. CPU implementations use 8 threads.
|
| 103 |
+
|
| 104 |
+
<table><tr><td colspan="3">(a)</td></tr><tr><td>batch size</td><td>CTC CPU GPU</td><td>ASG CPU</td></tr><tr><td>1</td><td>1.9</td><td>5.9 2.5</td></tr><tr><td>4</td><td>2.0 6.0</td><td>2.8</td></tr><tr><td>8</td><td>2.0 6.1</td><td>2.8</td></tr></table>
|
| 105 |
+
|
| 106 |
+
<table><tr><td colspan="3">(b)</td></tr><tr><td>batch size</td><td>CTC CPU GPU</td><td>ASG CPU</td></tr><tr><td>1</td><td>40.9 97.9</td><td>16.0</td></tr><tr><td>4</td><td>41.6 99.6</td><td>17.7</td></tr><tr><td>8</td><td>41.7 100.3</td><td>19.2</td></tr><tr><td></td><td></td><td></td></tr></table>
|
| 107 |
+
|
| 108 |
+
(c)
|
| 109 |
+
|
| 110 |
+
<table><tr><td></td><td>ASG</td><td>CTC</td></tr><tr><td>dev-clean</td><td>10.4</td><td>10.7</td></tr><tr><td>test-clean</td><td>10.1</td><td>10.5</td></tr></table>
|
| 111 |
+
|
| 112 |
+
MFCC features are computed with 13 coefficients, a $2 5 ~ \mathrm { m s }$ sliding window and $1 0 \mathrm { m s }$ stride. We included first and second order derivatives. Power spectrum features are computed with a $2 5 ~ \mathrm { m s }$ window, $1 0 \mathrm { m s }$ stride, and have 257 components. All features are normalized (mean 0, std 1) per input sequence.
|
| 113 |
+
|
| 114 |
+
# 3.2 RESULTS
|
| 115 |
+
|
| 116 |
+
Table 1 reports a comparison between CTC and ASG, in terms of LER and speed. Our ASG criterion is implemented in C (CPU only), leveraging SSE instructions when possible. Our batching is done with an OpenMP parallel for. We picked the CTC criterion implementation provided by Baidu3. Both criteria lead to the same LER. For comparing the speed, we report performance for sequence sizes as reported initially by Baidu, but also for longer sequence sizes, which corresponds to our average use case. ASG appears faster on long sequences, even though it is running on CPU only. Baidu’s GPU CTC implementation seems more aimed at larger vocabularies (e.g. 5000 Chinese characters).
|
| 117 |
+
|
| 118 |
+
We also investigated the impact of the training size on the dataset, as well as the effect of a simple data augmentation procedure, where shifts were introduced in the input frames, as well as stretching. For that purpose, we tuned the size of our architectures (given a particular size of the dataset), to avoid over-fitting. Figure 4a shows the augmentation helps for small training set size. However, with enough training data, the effect of data augmentation vanishes, and both type of features appear to perform similarly. Figure 4b reports the WER with respect to the available training data size. We observe that we compare very well against Deep Speech 1 & 2 which were trained with much more data Hannun et al. (2014); Amodei et al. (2015).
|
| 119 |
+
|
| 120 |
+
Finally, we report in Table 2 the best results of our system so far, trained on 1000h of speech, for each type of features. The overall stride of architectures is 320 (see Figure 1), which produces a label every $2 0 \mathrm { m s }$ . We found that one could squeeze out about $1 \%$ in performance by refining the precision of the output. This is efficiently achieved by shifting the input sequence, and feeding it to the network several times. Results in Table 2 were obtained by a single extra shift of $1 0 \mathrm { m s }$ . Both power spectrum and raw features are performing slightly worse than MFCCs. One could expect, however, that with enough data (see Figure 4) the gap would vanish.
|
| 121 |
+
|
| 122 |
+

|
| 123 |
+
Figure 4: Valid LER (a) and WER (b) v.s. training set size (10h, 100h, 200h, 1000h). This compares MFCC-based and power spectrum-based (POW) architectures. AUG experiments include data augmentation. In (b) we provide Baidu Deep Speech 1 and 2 numbers on LibriSpeech, as a comparison Hannun et al. (2014); Amodei et al. (2015).
|
| 124 |
+
|
| 125 |
+
Table 2: LER/WER of the best sets of hyper-parameters for each feature types.
|
| 126 |
+
|
| 127 |
+
<table><tr><td rowspan="2"></td><td colspan="2">MFCC</td><td colspan="2">PS</td><td colspan="2">Raw</td></tr><tr><td>LER</td><td>WER</td><td>LER</td><td>WER</td><td>LER</td><td>WER</td></tr><tr><td>dev-clean</td><td>6.9</td><td></td><td>9.3</td><td></td><td>10.3</td><td></td></tr><tr><td>test-clean</td><td>6.9</td><td>7.2</td><td>9.1</td><td>9.4</td><td>10.6</td><td>10.1</td></tr></table>
|
| 128 |
+
|
| 129 |
+
# 4 CONCLUSION
|
| 130 |
+
|
| 131 |
+
We have introduced a simple end-to-end automatic speech recognition system, which combines a standard 1D convolutional neural network, a sequence criterion which can infer the segmentation, and a simple beam-search decoder. The decoding results are competitive on the LibriSpeech corpus with MFCC features $7 . 2 \%$ WER), and promising with power spectrum and raw speech $9 . 4 \%$ WER and $1 0 . 1 \%$ WER respectively). We showed that our AutoSegCriterion can be faster than CTC (Graves et al., 2006), and as accurate (table 1). Our approach breaks free from HMM/GMM pre-training and force-alignment, as well as not being as computationally intensive as RNN-based approaches (Amodei et al., 2015) (on average, one LibriSpeech sentence is processed in less than 60ms by our ConvNet, and the decoder runs at $8 . 6 \mathrm { x }$ on a single thread).
|
| 132 |
+
|
| 133 |
+
# REFERENCES
|
| 134 |
+
|
| 135 |
+
Dario Amodei, Rishita Anubhai, Eric Battenberg, Carl Case, Jared Casper, Bryan Catanzaro, Jingdong Chen, Mike Chrzanowski, Adam Coates, Greg Diamos, et al. Deep speech 2: End-to-end speech recognition in english and mandarin. arXiv preprint arXiv:1512.02595, 2015.
|
| 136 |
+
|
| 137 |
+
L. R. Bahl, P. F. Brown, P. V. de Souza, and R. L. Mercer. Maximum mutual information estimation of hidden markov model parameters for speech recognition. In Acoustics, Speech and Signal Processing (ICASSP), 1986 IEEE International Conference on, pp. 49–52. IEEE, 1986.
|
| 138 |
+
|
| 139 |
+
Leon Bottou. Une approche theorique de l’apprentissage connexionniste et applications a la reconnaissance de la parole. PhD thesis, 1991.
|
| 140 |
+
|
| 141 |
+
Léon Bottou, Yoshua Bengio, and Yann Le Cun. Global training of document processing systems using graph transformer networks. In Computer Vision and Pattern Recognition, 1997. Proceedings., 1997 IEEE Computer Society Conference on, pp. 489–494. IEEE, 1997.
|
| 142 |
+
|
| 143 |
+
M. Gibson and T. Hain. Hypothesis spaces for minimum bayes risk training in large vocabulary speech recognition. In Proceedings of INTERSPEECH, pp. 2406—-2409. IEEE, 2006.
|
| 144 |
+
|
| 145 |
+
Alan Graves, Abdel-rahman Mohamed, and Geoffrey Hinton. Speech recognition with deep recurrent neural networks. In Acoustics, Speech and Signal Processing (ICASSP), 2013 IEEE International Conference on, pp. 6645–6649. IEEE, 2013.
|
| 146 |
+
|
| 147 |
+
Alex Graves, Santiago Fernández, Faustino Gomez, and Jürgen Schmidhuber. Connectionist temporal classification: labelling unsegmented sequence data with recurrent neural networks. In Proceedings of the 23rd international conference on Machine learning, pp. 369–376. ACM, 2006.
|
| 148 |
+
|
| 149 |
+
Awni Hannun, Carl Case, Jared Casper, Bryan Catanzaro, Greg Diamos, Erich Elsen, Ryan Prenger, Sanjeev Satheesh, Shubho Sengupta, Adam Coates, et al. Deep speech: Scaling up end-to-end speech recognition. arXiv preprint arXiv:1412.5567, 2014.
|
| 150 |
+
|
| 151 |
+
Kenneth Heafield, Ivan Pouzyrevsky, Jonathan H Clark, and Philipp Koehn. Scalable modified kneser-ney language model estimation. In ACL (2), pp. 690–696, 2013.
|
| 152 |
+
|
| 153 |
+
Geoffrey Hinton, Li Deng, Dong Yu, George E Dahl, Abdel-rahman Mohamed, Navdeep Jaitly, Andrew Senior, Vincent Vanhoucke, Patrick Nguyen, Tara N Sainath, et al. Deep neural networks for acoustic modeling in speech recognition: The shared views of four research groups. Signal Processing Magazine, IEEE, 29(6):82–97, 2012.
|
| 154 |
+
|
| 155 |
+
J. Lafferty, A. McCallum, and F. Pereira. Conditional random fields: Probabilistic models for segmenting and labeling sequence data. In Eighteenth International Conference on Machine Learning, ICML, 2001.
|
| 156 |
+
|
| 157 |
+
Yann LeCun and Yoshua Bengio. Convolutional networks for images, speech, and time series. The handbook of brain theory and neural networks, 3361(10):1995, 1995.
|
| 158 |
+
|
| 159 |
+
Yajie Miao, Mohammad Gowayyed, and Florian Metze. Eesen: End-to-end speech recognition using deep rnn models and wfst-based decoding. arXiv preprint arXiv:1507.08240, 2015.
|
| 160 |
+
|
| 161 |
+
Abdel-rahman Mohamed, George E Dahl, and Geoffrey Hinton. Acoustic modeling using deep belief networks. Audio, Speech, and Language Processing, IEEE Transactions on, 20(1):14–22, 2012.
|
| 162 |
+
|
| 163 |
+
Dimitri Palaz, Ronan Collobert, and Mathew Magimai Doss. Estimating phoneme class conditional probabilities from raw speech signal using convolutional neural networks. arXiv preprint arXiv:1304.1018, 2013.
|
| 164 |
+
|
| 165 |
+
Dimitri Palaz, Mathew Magimai-Doss, and Ronan Collobert. Joint phoneme segmentation inference and classification using crfs. In Signal and Information Processing (GlobalSIP), 2014 IEEE Global Conference on, pp. 587–591. IEEE, 2014.
|
| 166 |
+
|
| 167 |
+
Dimitri Palaz, Ronan Collobert, et al. Analysis of cnn-based speech recognition system using raw speech as input. In Proceedings of Interspeech, number EPFL-CONF-210029, 2015.
|
| 168 |
+
|
| 169 |
+
Vassil Panayotov, Guoguo Chen, Daniel Povey, and Sanjeev Khudanpur. Librispeech: an asr corpus based on public domain audio books. In Acoustics, Speech and Signal Processing (ICASSP), 2015 IEEE International Conference on, pp. 5206–5210. IEEE, 2015.
|
| 170 |
+
|
| 171 |
+
Vijayaditya Peddinti, Guoguo Chen, Vimal Manohar, Tom Ko, Daniel Povey, and Sanjeev Khudanpur. Jhu aspire system: Robust lvcsr with tdnns, i-vector adaptation, and rnn-lms. In Proceedings of the IEEE Automatic Speech Recognition and Understanding Workshop, 2015a.
|
| 172 |
+
|
| 173 |
+
Vijayaditya Peddinti, Daniel Povey, and Sanjeev Khudanpur. A time delay neural network architecture for efficient modeling of long temporal contexts. In Proceedings of INTERSPEECH, 2015b.
|
| 174 |
+
|
| 175 |
+
Tara N Sainath, Ron J Weiss, Andrew Senior, Kevin W Wilson, and Oriol Vinyals. Learning the speech front-end with raw waveform cldnns. In Proc. Interspeech, 2015.
|
| 176 |
+
|
| 177 |
+
George Saon, Hagen Soltau, David Nahamoo, and Michael Picheny. Speaker adaptation of neural network acoustic models using i-vectors. In ASRU, pp. 55–59, 2013.
|
| 178 |
+
|
| 179 |
+
George Saon, Hong-Kwang J Kuo, Steven Rennie, and Michael Picheny. The ibm 2015 english conversational telephone speech recognition system. arXiv preprint arXiv:1505.05899, 2015.
|
| 180 |
+
|
| 181 |
+
Andrew Senior, Georg Heigold, Michiel Bacchiani, and Hank Liao. Gmm-free dnn training. In Proceedings of ICASSP, pp. 5639–5643, 2014.
|
| 182 |
+
|
| 183 |
+
Tom Sercu, Christian Puhrsch, Brian Kingsbury, and Yann LeCun. Very deep multilingual convolutional neural networks for lvcsr. arXiv preprint arXiv:1509.08967, 2015.
|
| 184 |
+
|
| 185 |
+
Hagen Soltau, George Saon, and Tara N Sainath. Joint training of convolutional and non-convolutional neural networks. In ICASSP, pp. 5572–5576, 2014.
|
| 186 |
+
|
| 187 |
+
Volker Steinbiss, Bach-Hiep Tran, and Hermann Ney. Improvements in beam search. In ICSLP, volume 94, pp. 2143–2146, 1994.
|
| 188 |
+
|
| 189 |
+
Philip C Woodland and Steve J Young. The htk tied-state continuous speech recogniser. In Eurospeech, 1993.
|
md/train/BkewX2C9tX/BkewX2C9tX.md
ADDED
|
@@ -0,0 +1,253 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ANALYZING FEDERATED LEARNING THROUGH AN ADVERSARIAL LENS
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Federated learning distributes model training among a multitude of agents, who, guided by privacy concerns, perform training using their local data but share only model parameter updates, for iterative aggregation at the server. In this work, we explore the threat of model poisoning attacks on federated learning initiated by a single, non-colluding malicious agent where the adversarial objective is to cause the model to mis-classify a set of chosen inputs with high confidence. We explore a number of strategies to carry out this attack, starting with simple boosting of the malicious agent’s update to overcome the effects of other agents’ updates. To increase attack stealth, we propose an alternating minimization strategy, which alternately optimizes for the training loss and the adversarial objective. We follow up by using parameter estimation for the benign agents’ updates to improve on attack success. Finally, we use a suite of interpretability techniques to generate visual explanations of model decisions for both benign and malicious models, and show that the explanations are nearly visually indistinguishable. Our results indicate that even a highly constrained adversary can carry out model poisoning attacks while simultaneously maintaining stealth, thus highlighting the vulnerability of the federated learning setting and the need to develop effective defense strategies.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Federated learning introduced by McMahan et al. (2017) has recently emerged as a popular implementation of distributed stochastic optimization for large-scale deep neural network training. It is formulated as a multi-round strategy in which the training of a neural network model is distributed between multiple agents. In each round, a random subset of agents, with local data and computational resources, is selected for training. The selected agents perform model training and share only the parameter updates with a centralized parameter server, that facilitates aggregation of the updates. Motivated by privacy concerns, the server is designed to have no visibility into an agents’ local data and training process. The aggregation algorithm is agnostic to the data distribution at the agents.
|
| 12 |
+
|
| 13 |
+
In this work, we exploit this lack of transparency in the agent updates, and explore the possibility of a single malicious agent performing a model poisoning attack. The malicious agent’s objective is to cause the jointly trained global model to misclassify a set of chosen inputs with high confidence, i.e., it seeks to introduce a targeted backdoor in the global model. In each round, the malicious agent generates its update by optimizing for a malicious objective different than the training loss for federated learning. It aims to achieve this by generating its update by directly optimizing for the malicious objective. However, the presence of a multitude of other agents which are simultaneously providing updates makes this challenging. Further, the malicious agent must ensure that its update is undetectable as aberrant.
|
| 14 |
+
|
| 15 |
+
Contributions: To this end, we propose a sequence of model poisoning attacks, with the aim of achieving the malicious objective while maintaining attack stealth. For each strategy, we consider both attack strength as well as stealth. We start with malicious update boosting, designed to negate the combined effect of the benign agents, which enables the adversary to achieve its malicious objective with $100 \%$ confidence. However, we show that boosted updates can be detected as aberrant using two measures of stealth, accuracy checking on the benign objective and parameter update statistics. Observing that the only parameter updates that need to be boosted are those that contribute to the malicious objective, we design an alternating minimization strategy that improves attack stealth. This strategy alternates between training loss minimization and the boosting of updates for the malicious objective and is able to achieve high success rate on both the benign and malicious objectives. In addition, we show that estimating the other agents’ updates improves attack success rates. Finally, we use a suite of interpretability techniques to generate visual explanations of the decisions made by a global model with and without a targeted backdoor. Interestingly, we observe that the explanations are nearly visually indistinguishable. This establishes the attack stealth along yet another axis of measurement and indicates that backdoors can be inserted without drastic changes in model focus at the input.
|
| 16 |
+
|
| 17 |
+
Summary of Empirical Results: In our experiments, we consider adversaries which only control a single malicious agent and at a given time step, have no visibility into the updates that will be provided by the other agents. We demonstrate that these adversaries can influence the global model to misclassify particular examples with high confidence. We work with both the Fashion-MNIST Xiao et al. (2017) and Adult Census1, datasets and for settings with both 10 and 100 agents, our attacks are able to ensure the global model misclassifies a particular example in a target class with $100 \%$ confidence. Our alternating minimization attack further ensures that the global model converges to the same test set accuracy as the case with no adversaries present. We also show that a simple estimation of the benign agents’ updates as being identical over two consecutive rounds aids in improving attack success.
|
| 18 |
+
|
| 19 |
+
Related Work: While data poisoning attacks (Biggio et al., 2012; Rubinstein et al., 2009; Mei & Zhu, 2015; Xiao et al., 2015; Mei & Zhu, 2015; Koh & Liang, 2017; Chen et al., 2017a; Jagielski et al., 2018) have been widely studied, model poisoning attacks are largely unexplored. A number of works on defending against Byzantine adversaries consider a threat model where Byzantine agents send arbitrary gradient updates (Blanchard et al., 2017; Chen et al., 2017b; Mhamdi et al., 2018; Chen et al., 2018; Yin et al., 2018). However, the adversarial goal in these cases is to ensure a distributed implementation of the Stochastic Gradient Descent (SGD) algorithm converges to ‘suboptimal to utterly ineffective models’, quoting from Mhamdi et al. (2018). In complete constrast, our goal is to ensure convergence to models that are effective on the test set but misclassify certain examples. In fact, we show that the Byzantine-resilient aggregation mechanism ‘Krum’ Blanchard et al. (2017) is not resilient to our attack strategies (Appendix C). Concurrent work by Bagdasaryan et al. (2018) considers multiple colluding agents performing poisoning via model replacement at convergence time. In contrast, our goal is to induce targeted misclassification in the global model by a single malicious agent even when it is far from convergence while maintaining its accuracy for most tasks. In fact, we show that updates generated by their strategy fail to achieve either malicious or benign objectives in the settings we consider.
|
| 20 |
+
|
| 21 |
+
# 2 FEDERATED LEARNING AND MODEL POISONING
|
| 22 |
+
|
| 23 |
+
In this section, we formulate both the learning paradigm and the threat model that we consider throughout the paper. Operating in the federated learning paradigm, where model weights are shared instead of data, gives rise to the model poisoning attacks that we investigate.
|
| 24 |
+
|
| 25 |
+
# 2.1 FEDERATED LEARNING
|
| 26 |
+
|
| 27 |
+
The federated learning setup consists of $K$ agents, each with access to data $\mathcal { D } _ { i }$ , where $| \mathcal { D } _ { i } | = l _ { i }$ . The total number of samples is $\textstyle \sum _ { i } l _ { i } = l$ . Each agent keeps its share of the data (referred to as a shard) private, i.e. ${ \mathcal { D } } _ { i } = \{ \mathbf { x } _ { 1 } ^ { i } \cdot \cdot \cdot \mathbf { x } _ { l _ { i } } ^ { i } \}$ is not shared with the server $S$ . The objective of the server is to learn a global parameter vector $\dot { \mathbf { w } } _ { G } \in \mathbb { R } ^ { n }$ , where $n$ is the dimensionality of the parameter space. This parameter vector minimizes the $\mathrm { l o s s } ^ { 2 }$ over $\mathcal { D } = \cup _ { i } \mathcal { D } _ { i }$ and the aim is to generalize well over $\mathcal { D } _ { \mathrm { t e s t } }$ , the test data. Federated learning is designed to handle non-i.i.d partitioning of training data among the different agents.
|
| 28 |
+
|
| 29 |
+
At each time step $t$ , a random subset of $k$ agents is chosen for aggregation. Every agent $i \in [ k ]$ , minimizes the empirical loss over its own data shard $\mathcal { D } _ { i }$ , by starting from the global weight vector $\mathbf { w } _ { G } ^ { t }$ and running an algorithm such as SGD for $E$ epochs with a batch size of $B$ . At the end of its run, each agent obtains a local weight vector $\mathbf { w } _ { i } ^ { t + 1 }$ and computes its local update $\delta _ { i } ^ { t + 1 } =$ $\mathbf { w } _ { i } ^ { t + 1 } - \mathbf { w } _ { G } ^ { t }$ , which is sent back to the server. To obtain the global weight vector $\mathbf { w } _ { G } ^ { t + 1 }$ for the next iteration, any aggregation mechanism can be used. Following McMahan et al. (2017), we use synchronous training (i.e., server waits till it has received updates from all the agents selected for the time step) and weighted averaging based aggregation: wt+G $\begin{array} { r } { \mathbf { \dot { w } } _ { G } ^ { t + 1 } = \mathbf { w } _ { G } ^ { t } + \sum _ { i \in [ k ] } \alpha _ { i } \pmb { \delta } _ { i } ^ { t + 1 } } \end{array}$ , where $\begin{array} { r } { \frac { l _ { i } } { l } = \alpha _ { i } } \end{array}$ and $\textstyle \sum _ { i } \alpha _ { i } = 1$ . We also experiment with the Byzantine-resilient aggregation mechanism ‘Krum’ (Blanchard et al., 2017). Details are in Appendix C.
|
| 30 |
+
|
| 31 |
+
# 2.2 THREAT MODEL: MODEL POISONING
|
| 32 |
+
|
| 33 |
+
Traditional poisoning attacks deal with a malicious agent who poisons some fraction of the data in order to ensure that the learned model satisfies some adversarial goal. We consider instead an agent who poisons the model updates it sends back to the server. This attack is a plausible threat in the federated learning setting as the model updates from the agents can (i) directly influence the parameters of the global model via the aggregation algorithm; and (ii) display high variability, due to the non-i.i.d local data at the agents, making it harder to isolate the benign updates from the malicious ones.
|
| 34 |
+
|
| 35 |
+
Adversary Model: We make the following assumptions regarding the adversary: (i) there is exactly one non-colluding, malicious agent with index $m$ (limited effect of malicious updates on the global model); (ii) the data is distributed among the agents in an i.i.d fashion (making it easier to discriminate between benign and possible malicious updates and harder to achieve attack stealth); (iii) the malicious agent has access to a subset of the training data $\mathcal { D } _ { m }$ as well as to auxiliary data $\mathcal { D } _ { \mathrm { a u x } }$ drawn from the same distribution as the training and test data that are part of its adversarial objective. Our aim is to explore the possibility of a successful model poisoning attack even for a highly constrained adversary.
|
| 36 |
+
|
| 37 |
+
A malicious agent can have one of two objectives with regard to the loss and/or classification of a data subset at any time step $t$ in the model poisoning setting:
|
| 38 |
+
|
| 39 |
+
1. Increase the overall loss: In this case, the malicious agent wishes to increase the overall loss on a subset $\mathcal { D } _ { \mathrm { a u x } } ~ = ~ \{ \mathbf { x } _ { i } , y _ { i } \} _ { i = 1 } ^ { r }$ of the data. The adversarial objective is in this setting is $\begin{array} { r } { \boldsymbol { \mathcal { A } } ( \mathcal { D } _ { m } , \{ \mathbf { x } _ { i } , y _ { i } \} _ { i = 1 } ^ { r } , \mathbf { w } _ { G } ^ { t } ) = \operatorname { a r g m a x } _ { \mathbf { w } _ { G } ^ { t } } L ( \{ \mathbf { x } _ { i } , y _ { i } \} _ { i = 1 } ^ { r } , \mathbf { w } _ { G } ^ { t } ) } \end{array}$ , where $L ( \cdot , \cdot )$ is an appropriately defined loss function. This objective corresponds to the malicious agent attempting to cause untargeted misclassification.
|
| 40 |
+
|
| 41 |
+
2. Obtain desired classification outcome: The malicious agent has data samples $\{ { \bf x } _ { i } \} _ { i = 1 } ^ { r }$ with true labels $\{ y _ { i } \} _ { i = 1 } ^ { r }$ that have to be classified as desired target classes $\{ \tau _ { i } \} _ { i = 1 } ^ { r }$ , implying that the adversarial objective is $\begin{array} { r } { A ( \mathcal { D } _ { m } , \{ \mathbf { x } _ { i } , \tau _ { i } \} _ { i = 1 } ^ { r } , \mathbf { w } _ { G } ^ { t } ) = \operatorname * { a r g m i n } _ { \mathbf { w } _ { G } ^ { t } } L ( \{ \mathbf { x } _ { i } , \tilde { \tau _ { i } } \} _ { i = 1 } ^ { r } , \mathbf { w } _ { G } ^ { t } ) . } \end{array}$ . This corresponds to a targeted misclassification attempt by the malicious agent.
|
| 42 |
+
|
| 43 |
+
In this paper, we will focus on malicious agents trying to attain the second objective, i.e. targeted misclassification. At first glance, the problem seems like a simple one for the malicious agent to solve. However, it does not have access to the global parameter vector ${ \bf w } _ { G } ^ { t }$ for the current iteration as is the case in standard poisoning attacks (Munoz-Gonz ˜ alez et al., 2017; Koh´ $\&$ Liang, 2017) and can only influence it though the weight update $\delta _ { m } ^ { t }$ it provides to the server $S$ . The simplest formulation of the optimization problem the malicious agent has to solve such that her objective is achieved on the $t ^ { \mathrm { { t h } } }$ iteration is then
|
| 44 |
+
|
| 45 |
+
$$
|
| 46 |
+
\begin{array} { r l r } & { \underset { \delta _ { m } ^ { t } } { \mathrm { a r g m i n } } L ( \{ \mathbf { x } _ { i } , \tau _ { i } \} _ { i = 1 } ^ { r } , \mathbf { w } _ { G } ^ { t } ) , } & \\ & { \mathrm { s . t . } } & { \mathbf { w } _ { G } ^ { t } = \mathbf { w } _ { G } ^ { t - 1 } + \displaystyle \sum _ { i \in [ k ] \backslash m } \alpha _ { i } \delta _ { i } ^ { t } + \alpha _ { m } \delta _ { m } ^ { t } . } \end{array}
|
| 47 |
+
$$
|
| 48 |
+
|
| 49 |
+
# 2.3 EXPERIMENTAL SETUP
|
| 50 |
+
|
| 51 |
+
In order to illustrate how our attack strategies work with actual data and models, we use two qualitatively different datasets. The first is an image dataset, Fashion-MNIST 3 (Xiao et al., 2017) which consists of $2 8 \times 2 8$ grayscale images of clothing and footwear items and has 10 output classes. The training set contains 60,000 data samples while the test set has 10,000 samples. We use a Convolutional Neural Network achieving $9 1 . 7 \%$ accuracy on the test set for the model architecture.
|
| 52 |
+
|
| 53 |
+

|
| 54 |
+
(a) Metrics of interest for baseline (left) and simultaneous training attacks (right). Unified legend in right plot.
|
| 55 |
+
|
| 56 |
+

|
| 57 |
+
(b) Baseline attack weight update distribu- (c) Simultaneous training weight update distion at $t = 4$ . tribution at $t = 4$ .
|
| 58 |
+
Figure 1: Metrics of interest and representative weight update distributions for the baseline and simultaneous training attacks. Figures 1b and 1c show weight update distributions for both benign (left) and malicious agents (right).
|
| 59 |
+
|
| 60 |
+
The second dataset is the UCI Adult dataset4, which has over 40,000 samples containing information about adults from the 1994 US Census. The classification problem is to determine if the income for a particular individual is greater (class $\cdot _ { 0 } \cdot \mathrm { \ }$ ) or less (class ‘1’) than $\$ 50,000$ a year. For this dataset, we use a fully connected neural network achieving $8 4 . 8 \%$ accuracy on the test set (Fernandez-Delgado ´ et al., 2014) for the model architecture. Owing to space constraints, all results for this dataset are in the Appendix.
|
| 61 |
+
|
| 62 |
+
For both datasets, we study the case with the number of agents $k$ set to 10 and 100. When $k = 1 0$ , all the agents are chosen at every iteration, while with $k = 1 0 0$ , a tenth of the agents are chosen at random every iteration. We run federated learning till a pre-specified test accuracy $91 \%$ for Fashion MNIST and $84 \%$ for the Adult Census data) is reached or the maximum number of time steps have elapsed (40 for $k = 1 0$ and 50 for $k = 1 0 0 .$ ). For most of our experiments, we consider the case when $r = 1$ , which implies that the malicious agent aims to misclassify a single example in a desired target class. For both datasets, a random sample from the test set is chosen as the example to be misclassified. For the Fashion-MNIST dataset, the sample belongs to class $\cdot 5 '$ (sandal) with the aim of misclassifying it in class $\bullet _ { 7 } \cdot$ (sneaker) and for the Adult dataset it belongs to class $\cdot _ { 0 } \cdot \mathrm { \ }$ with the aim of misclassifying it in class ‘1’.
|
| 63 |
+
|
| 64 |
+
# 3 STRATEGIES FOR MODEL POISONING ATTACKS
|
| 65 |
+
|
| 66 |
+
We begin by investigating baseline attacks which do not conform to any notion of stealth. We then show how simple detection methods at the server may expose the malicious agent and explore the extent to which modifications to the baseline attack can bypass these methods.
|
| 67 |
+
|
| 68 |
+
In order to solve the exact optimization problem needed to achieve their objective, the malicious agent needs access to the current value of the overall parameter vector $\mathbf { w } _ { G } ^ { t }$ , which is inaccessible. This occurs due to the nature of the federated learning algorithm, where $S$ computes ${ \bf w } _ { G } ^ { t }$ once it has received updates from all agents. In this case, they have to optimize over an estimate of the value of $\mathbf { w } _ { G } ^ { t }$ :
|
| 69 |
+
|
| 70 |
+
$$
|
| 71 |
+
\begin{array} { r l } & { \boldsymbol { \mathcal { A } } ( \mathcal { D } _ { m } , \{ \mathbf { x } _ { i } , \tau _ { i } \} _ { i = 1 } ^ { r } , \hat { \mathbf { w } } _ { G } ^ { t } ) , } \\ { \mathrm { s . t . } } & { \hat { \mathbf { w } } _ { G } ^ { t } = \boldsymbol { f } ( \mathbb { Z } _ { m } ^ { t } ) , } \end{array}
|
| 72 |
+
$$
|
| 73 |
+
|
| 74 |
+
where $f ( \cdot )$ is an estimator for $\hat { \mathbf { w } } _ { G } ^ { t }$ based on all the information $\mathcal { T } _ { m } ^ { t }$ available to the adversary. We refer to this as the limited information poisoning objective. The problem of choosing a good estimator is deferred to Section 4 and the strategies discussed in the remainder of this section make the assumption that $\hat { \mathbf { w } } _ { G } ^ { t } \approx \mathbf { w } _ { G } ^ { t - 1 } + \alpha _ { m } \delta _ { m } ^ { t }$ . In other words, the malicious agent ignores the effects of other agents. As we shall see, this assumption is often enough to ensure the attack works in practice.
|
| 75 |
+
|
| 76 |
+
# 3.2 BASELINE ATTACK
|
| 77 |
+
|
| 78 |
+
Using the approximation that $\hat { \mathbf { w } } _ { G } ^ { t } \approx \mathbf { w } _ { G } ^ { t - 1 } + \alpha _ { m } \delta _ { m } ^ { t }$ , the malicious agent just has to meet the G G adversarial objective argminδtm L({xi, τi}ri=1, wˆ tG). Depending on the exact structure of the loss, an appropriate optimizer can be chosen. For our experiments, we will rely on gradient-based optimizers such as SGD which work well for neural networks. In order to overcome the effect of scaling by $\alpha _ { m }$ at the server, the final update $\tilde { \delta } _ { m } ^ { t }$ that is returned, has to be boosted.
|
| 79 |
+
|
| 80 |
+
Explicit Boosting: Mimicking a benign agent, the malicious agent can run $E _ { m }$ steps of a gradientbased optimizer starting from $\mathbf { \overline { { w } } } _ { G } ^ { t - 1 }$ to obtain $\tilde { \mathbf { w } } _ { m } ^ { t }$ which minimizes the loss over $\{ { \mathbf x } _ { i } , \tau _ { i } \} _ { i = 1 } ^ { r }$ . The malicious agent then obtains an initial update $\tilde { \delta } _ { m } ^ { t } = \tilde { \mathbf { w } } _ { m } ^ { t } - \mathbf { w } _ { G } ^ { t - 1 }$ . However, since the malicious agent’s update tries to ensure that the model learns labels different from the true labels for the data of its choice $( \mathcal { D } _ { \mathrm { a u x } } )$ , it has to overcome the effect of scaling, which would otherwise mostly nullify the desired classification outcomes. This happens because the learning objective for all the other agents is very different from that of the malicious agent, especially in the i.i.d. case. The final weight update sent back by the malicious agent is then the malicious agent boosts the initial update. Note tha $\delta _ { m } ^ { t } = \lambda \tilde { \delta } _ { m } ^ { t }$ , where umption $\lambda$ $\hat { \mathbf { w } } _ { G } ^ { t } \approx \mathbf { w } _ { G } ^ { t - 1 } + \alpha _ { m } \delta _ { m } ^ { t }$ holds, and $\begin{array} { r } { \lambda = \frac { 1 } { \alpha _ { m } } } \end{array}$ , then $\hat { \mathbf { w } } _ { G } ^ { t } \approx \mathbf { w } _ { m } ^ { t }$ , implying that the global weight vector should now satisfy the malicious agent’s objective. This method indirectly accounts for the presence of the other agents when using a boosting factor of $\frac { 1 } { \alpha _ { m } }$
|
| 81 |
+
|
| 82 |
+
Implicit Boosting: While the loss is a function of a weight vector w, we can use the chain rule to obtain the gradient of the loss with respect to the weight update $\pmb { \delta }$ , i.e. $\nabla _ { \delta } L = \alpha _ { m } \nabla _ { \mathbf { w } } L$ . Then, initializing $\delta$ to some appropriate $\delta _ { \mathrm { i n i } }$ , the malicious agent can directly minimize with respect to $\pmb { \delta }$ .
|
| 83 |
+
|
| 84 |
+
Results: In the attack with explicit boosting, the malicious agent runs $E _ { m } = 5$ steps of the Adam optimizer (Kingma & Ba, 2015) to obtain $\tilde { \delta } _ { m } ^ { t }$ , and then boosts it by $\begin{array} { r } { \frac { { \check { \Pi } } } { \alpha _ { m } } = k } \end{array}$ . The results for the case with $k = 1 0$ are shown in the plot on the left in Figure 1a. The attack is clearly successful at causing the global model to classify the chosen example in the target class. In fact, after $t = 3$ , the global model is highly confident in its (incorrect) prediction. The baseline attack using implicit boosting (Figure 2) is much less successful than the explicit boosting baseline, with the adversarial objective only being achieved in 4 of 10 iterations. Further, it is computationally more expensive, taking an average of 2000 steps to converge at each time step, which is about $4 \times$ longer than a benign agent. Since consistently delayed updates from the malicious agent might lead to it being dropped from the system in practice, we focus on explicit boosting attacks for the remainder of the paper as they do not add as much overhead.
|
| 85 |
+
|
| 86 |
+

|
| 87 |
+
Figure 2: Implicit boosting attack metrics
|
| 88 |
+
|
| 89 |
+
# 3.2.1 MEASURING ATTACK STEALTH AT SERVER
|
| 90 |
+
|
| 91 |
+
While the baseline attack is successful at meeting the malicious agent’s objective, there are methods the server can employ in order to detect if an agent’s update is malicious. We now discuss two possible methods and their implication for the baseline attack. We note that neither of these methods are part of the standard federated learning algorithm nor do they constitute a full defense at the server. They are merely metrics that may be utilized in a secure system.
|
| 92 |
+
|
| 93 |
+
Accuracy checking: When any agent sends a weight update to the server, it can check the validation accuracy of $\mathbf { w } _ { i } ^ { t } = \mathbf { \bar { w } } _ { G } ^ { t - 1 } + \delta _ { i } ^ { t }$ , the model obtained by adding that update to the current state of the global model. If the resulting model has a validation accuracy much lower than that of the other agents, the server may be able to detect that model as coming from a malicious agent. This would be particularly effective in the case where the agents have i.i.d. data.
|
| 94 |
+
|
| 95 |
+
In Figure 1a, the left plot shows the accuracy of the malicious model on the validation data (Acc. Mal) at each iteration. This is much lower than the accuracy of the global model (Acc. Global) and is no better than random for the first few iterations.
|
| 96 |
+
|
| 97 |
+
Weight update statistics: There are both qualitative and quantitative methods the server can apply in order to detect weight updates which are malicious, or at the least, different from a majority of the other agents. We investigate the effectiveness of two such methods. The first, qualitative method, is the visualization of weight update distributions for each agent. Since the adversarial objective function is different from the training loss objective used by all the benign agents, we expect the distribution of weight updates to be very different.
|
| 98 |
+
|
| 99 |
+
This is borne out by the representative weight update distribution at $t \ = \ 4$ observed for the baseline attack in Figure 1b. Compared to the weight update from a benign agent, the update from the malicious agent is much sparser and has a smaller range. This difference is more pronounced for later time steps (see Figure $9 \mathrm { a }$ in Appendix B).
|
| 100 |
+
|
| 101 |
+

|
| 102 |
+
Figure 3: Minimum and maximum $L _ { 2 }$ distances between weight updates. For each strategy, we show the spread of $L _ { 2 }$ distances between all the benign agents and between the malicious agent and the benign agents. Going from the baseline attack to the alternating minimization attack with and without distance constraints, we see that the gap in the spread of distances reduces, making the attack stealthier. The benign agents behave almost identically across strategies, indicating that the malicious agent does not interfere much with their training.
|
| 103 |
+
|
| 104 |
+
The second, quantitative method uses the spread of pairwise $L _ { p }$ distances between weight update vectors to identify outliers. At each time step, the server computes the pairwise distances between all the weight updates it receives, and
|
| 105 |
+
|
| 106 |
+
flags those weight updates which are either much closer or much farther away than the others. In Figure 3, the spread of $L _ { 2 }$ distances between all benign updates and between the malicious update and the benign updates is plotted. For the baseline attack, both the minimum and maximum distance away from any of the benign updates keeps decreasing over time steps, while it remains relatively constant for the other agents. This can enable detection of the malicious agent.
|
| 107 |
+
|
| 108 |
+
# 3.3 ATTACK WITH SIMULTANEOUS TRAINING
|
| 109 |
+
|
| 110 |
+
To bypass the two detection methods discussed in the previous section, the malicious agent can try to simultaneously optimize over the adversarial objective and training loss for its local data shard $\mathcal { D } _ { m }$ . The resulting objective function is then $\begin{array} { r } { \operatorname * { a r g m i n } _ { \delta _ { m } ^ { t } } L ( \{ \mathbf { x } _ { i } , \tau _ { i } \} _ { i = 1 } ^ { r } , \hat { \mathbf { w } } _ { G } ^ { t } ) + \kappa L ( \mathcal { D } _ { m } , \mathbf { w } _ { m } ^ { t } ) . } \end{array}$ . Note that for the training loss, the optimization is just performed with respect to $\mathbf { w } _ { m } ^ { t }$ , as a benign agent would do. When doing explicit boosting, $\hat { \mathbf { w } } _ { G } ^ { t }$ is replaced by $\mathbf { w } _ { m } ^ { t }$ as well, and the initial weight update $\tilde { \delta } _ { m } ^ { t }$ is boosted by $\lambda$ before being sent to the server. This is the only attack strategy explored in concurrent and independent work by Bagdasaryan et al. (2018).
|
| 111 |
+
|
| 112 |
+

|
| 113 |
+
(a) Metrics of interest for alternating minimization attack without (left) and with distance constraints(right).
|
| 114 |
+
|
| 115 |
+

|
| 116 |
+
Figure 4: Metrics of interest and representative weight update distributions for the alternating minimization attack with and without distance constraints.
|
| 117 |
+
|
| 118 |
+
Results: In practice, we optimize over batches of $\mathcal { D } _ { m }$ and concatenate each batch with the single instance $\{ { \bf x } , \tau \}$ to be misclassified, ensuring that the adversarial objective is satisfied. In fact, as seen in Figure 1 in the plot on the right, the adversarial objective is satisfied with high confidence from the first time step $t = 1$ .
|
| 119 |
+
|
| 120 |
+
Effect on stealth: Since the entire weight update corresponding to both adversarial and training objectives is boosted, the accuracy of $\mathbf { w } _ { m } ^ { t ^ { - } }$ on the validation is low throughout the federated learning process. Thus, this attack can easily be detected using the accuracy checking method. Further, while the weight update distribution for this attack (Figure 1c) is visually similar to that of benign agents, its range differs, again enabling detection.
|
| 121 |
+
|
| 122 |
+
# 3.4 ALTERNATING MINIMIZATION FORMULATION
|
| 123 |
+
|
| 124 |
+
The malicious agent only needs to boost the part of the weight update that corresponds to the adversarial objective. In the baseline attack, in spite of this being the entire update, the resulting distribution is sparse and of low magnitude compared to a benign agent’s updates. This indicates that the weights update needed to meet the adversarial objective could be hidden in an update that resembled that of a benign agent. However, as we saw in the previous section, boosting the entire weight update when the training loss is included leads to low validation accuracy. Further, the concatenation strategy does not allow for parts of the update corresponding to the two different objectives to be decoupled.
|
| 125 |
+
|
| 126 |
+
To overcome this, we propose an alternating minimization attack strategy which works as follows for iteration $t$ . For each epoch $i$ , the adversarial objective is first minimized starting from $\mathbf { w } _ { m } ^ { i - 1 , t }$ , giving an update vector $\tilde { \delta } _ { m } ^ { i , t }$ . This is then boosted by a factor $\lambda$ and added to $\mathbf { w } _ { m } ^ { i - 1 , t }$ . Finally, the training loss for that epoch is minimized starting from i,t $\tilde { \mathbf { w } } _ { m } ^ { i , t } = \mathbf { w } _ { m } ^ { i - 1 , t } + \lambda \tilde { \delta } _ { m } ^ { i , t }$ , providing the malicious weight vector for the next epoch. The malicious agent can run this alternating minimization until both the adversarial objective and training loss have sufficiently low values.
|
| 127 |
+
|
| 128 |
+
Results: In Figure 4a, the plot on the left shows the evolution of the metrics of interest over iterations. The alternating minimization attack is able to achieve its goals as the accuracy of the malicious model closely matches that of the global model even as the adversarial objective is met with high confidence for all time steps starting from $t = 3$ .
|
| 129 |
+
|
| 130 |
+
Effect on stealth: This attack can bypass the accuracy checking method as the accuracy on test data of the malicious model is close to that of the global model. Qualitatively, the distribution of the malicious weight update (Figure 4b) is much more similar to that of the benign weights as compared to the baseline attack. Further, in Figure 3, we can see that the spread in distances between the malicious updates and benign updates much closer to that between benign agents compared to the baseline attack. Thus, this attack is stealthier than the baseline.
|
| 131 |
+
|
| 132 |
+
# 3.5 CONSTRAINING THE WEIGHT UPDATE
|
| 133 |
+
|
| 134 |
+
To increase the attack stealth, the malicious agent can also add a distance-based constraint on which is the intermediate weight vector generated in the alternating minimization strategy. $\tilde { \mathbf { w } } _ { m } ^ { i , t }$ could be multiple local minima which lead to low training loss, but the malicious agent needs to send back a weight update that is as close as possible (in an appropriate distance metric) to the update they would have sent had they been benign. So, $\mathbf { w } _ { m } ^ { i , t }$ is constrained with respect to $\mathbf { w } _ { m , b e n } ^ { t }$ , obtained by minimizing the training loss over $\mathcal { D } _ { m }$ starting from $\mathbf { w } _ { G } ^ { t - 1 }$ , i.e. with the malicious agent mimicking a benign one.
|
| 135 |
+
|
| 136 |
+
For our experiments, we use the $L _ { 2 }$ norm as a constraint on $\mathbf { w } _ { m } ^ { i , t }$ , the weight vector obtained at the end of the training loss minimization phase, so $\rho \| \mathbf { w } _ { m , b e n } ^ { t } - \mathbf { w } _ { m } ^ { i , t } \| _ { 2 }$ is added to the loss function. Constraints based on the empirical distribution of weights such as the Wasserstein or total variation distances may also be used.
|
| 137 |
+
|
| 138 |
+
Results and Effect on stealth: The adversarial objective is achieved at the global model with high confidence starting from time step $t \ : = \ : 2$ and the success of the malicious model on the benign objective closely tracks that of the global model throughout. The weight update distribution for this attack (Figure 4c) is again similar to that of a benign agent. Further, in Figure 3, we can see that the distance spread for this attack closely follows and even overlaps that of benign updates throughout, making it hard to detect using the $L _ { 2 }$ distance metric.
|
| 139 |
+
|
| 140 |
+
# 4 IMPROVING ATTACK PERFORMANCE THROUGH ESTIMATION
|
| 141 |
+
|
| 142 |
+
In this section, we look at how the malicious agent can choose a better estimate for the effect of the other agents’ updates at each time step that it is chosen. In the case when the malicious agent is not chosen at every time step, this estimation is made challenging by the fact that it may not have been chosen for many iterations.
|
| 143 |
+
|
| 144 |
+
# 4.1 ESTIMATION SETUP
|
| 145 |
+
|
| 146 |
+
The malicious agent’s goal is to choose an appropriate estimate for $\begin{array} { r } { \delta _ { [ k ] \backslash m } ^ { t } = \sum _ { i \in [ k ] \backslash m } \alpha _ { i } \delta _ { i } ^ { t } } \end{array}$ from Eq. 1. At a time step to them from the prev $t$ when the malicious agent is chosen, the following inus time steps they were chosen: i) Global parameter v atrs e; $\mathbf { w } _ { G } ^ { t _ { 0 } } \ldots , \mathbf { w } _ { G } ^ { t - 1 }$ ii) Malicious weight updates $\mathcal { D } _ { m }$ G , where $t _ { 0 }$ G is the first time step at which the malicious agent is chosen. Given this information, the malicious agent computes an estimate $\hat { \delta } _ { [ k ] \setminus m } ^ { t }$ which it can use to correct for the effect of other agents in two ways:
|
| 147 |
+
|
| 148 |
+
Post-optimization correction: In this method, once the malicious agent computes its weight update $\delta _ { m } ^ { t }$ , it subtracts $\lambda \hat { \delta } _ { [ k ] \backslash m } ^ { t }$ from it before sending it to the server. If $\hat { \pmb { \delta } } _ { [ k ] \backslash m } ^ { t } = \pmb { \delta } _ { [ k ] \backslash m } ^ { t }$ and $\begin{array} { r } { \lambda = \frac { 1 } { \alpha _ { m } } } \end{array}$ this will negate the effects of the other agents. However, due to estimation inaccuracy and the fact that the optimizer has not accounted for this correction, this method leads to poor empirical performance.
|
| 149 |
+
|
| 150 |
+
Pre-optimization correction: Here, the malicious agent assumes that $\hat { \mathbf { w } } _ { G } ^ { t } = \mathbf { w } _ { G } ^ { t - 1 } + \hat { \delta } _ { [ k ] \backslash m } ^ { t } +$ $\alpha _ { m } \delta _ { m } ^ { T + 1 }$ . In other words, the malicious agent optimizes for $\delta _ { m } ^ { t }$ assuming it has an accurate estimate $\mathbf { w } _ { G } ^ { t - 1 } + \hat { \delta } _ { [ k ] \setminus m } ^ { t }$ ents’ updates.instead of just $\mathbf { w } _ { G } ^ { t - 1 }$ ttacks which use explicit boosting, this involves starting from.
|
| 151 |
+
|
| 152 |
+

|
| 153 |
+
Figure 5: Metrics of interest for the baseline and alternating minimization attacks with explicit boosting and previous step estimation.
|
| 154 |
+
|
| 155 |
+
# 4.2 ESTIMATION STRATEGIES AND RESULTS
|
| 156 |
+
|
| 157 |
+
When the malicious agent is chosen at time step $t$ 5, information regarding the probable updates from the other agents can be obtained from the previous time steps at which the malicious agent was chosen.
|
| 158 |
+
|
| 159 |
+
Previous step estimate: In this method, the malicious agent’s estimate $\hat { \delta } _ { [ k ] \setminus m } ^ { t }$ assumes that the other agents’ cumulative updates were the same at each step since $t ^ { \prime }$ (the last time step at which at the malicious agent was chosen), i.e. $\begin{array} { r } { \hat { \delta } _ { [ k ] \backslash m } ^ { t } = \frac { \mathbf { w } _ { G } ^ { t } - \mathbf { w } _ { G } ^ { t ^ { \prime } } - \delta _ { m } ^ { t ^ { \prime } } } { t - t ^ { \prime } } } \end{array}$ t0G −δt0mt0 . In the case when the malicious agent is chosen at every time step, this reduces to $\hat { \pmb { \delta } } _ { [ k ] \backslash m } ^ { t } = \pmb { \delta } _ { [ k ] \backslash m } ^ { t - 1 }$ .
|
| 160 |
+
|
| 161 |
+
Results: Attacks using previous step estimation with the pre-optimization correction are more effective at achieving the adversarial objective for both the baseline and alternating minimization attacks. In Figure 5, the global model misclassifies the desired sample with a higher confidence for both the baseline and alternating minimization attacks at $t = 2$ .
|
| 162 |
+
|
| 163 |
+
# 5 INTERPRETING POISONED MODELS
|
| 164 |
+
|
| 165 |
+
Neural networks are often treated as black boxes with little transparency into their internal representation or understanding of the underlying basis for their decisions. Interpretability techniques are designed to alleviate these problems by analyzing various aspects of the network. These include (i) identifying the relevant features in the input pixel space for a particular decision via Layerwise Relevance Propagation (LRP) techniques (Montavon et al. (2015)); (ii) visualizing the association between neuron activations and image features (Guided Backprop (Springenberg et al. (2014)), DeConvNet (Zeiler & Fergus (2014))); (iii) using gradients for attributing prediction scores to input features (e.g., Integrated Gradients (Sundararajan et al. (2017)), or generating sensitivity and saliency maps (SmoothGrad (Smilkov et al. (2017)), Gradient Saliency Maps (Simonyan et al. (2013))) and so on. The semantic relevance of the generated visualization, relative to the input, is then used to explain the model decision.
|
| 166 |
+
|
| 167 |
+
These interpretability techniques, in many ways, provide insights into the internal feature representations and working of a neural network. Therefore, we used a suite of these techniques to try and discriminate between the behavior of a benign global model and one that has been trained to satisfy the adversarial objective of misclassifying a single example. Figure 6 compares the output of the various techniques for both the benign and malicious models on a random auxiliary data sample. Targeted perturbation of the model parameters coupled with tightly bounded noise ensures that the internal representations, and relevant input features used by the two models, for the same input, are almost visually imperceptible. This reinforces the stealth achieved by our attacks along with respect to another measure of stealth, namely various interpretability-based detection techniques.
|
| 168 |
+
|
| 169 |
+

|
| 170 |
+
Figure 6: Interpretation of benign $( 5 5$ ) and malicious $\mathrm { ( 5 7 }$ ) model decisions via visualization of feature relevance and representations for a randomly chosen auxiliary data sample.
|
| 171 |
+
|
| 172 |
+
# 6 DISCUSSION
|
| 173 |
+
|
| 174 |
+
In this paper, we have started an exploration of the vulnerability of multi-party machine learning algorithms such as federated learning to model poisoning adversaries, who can take advantage of the very privacy these models are designed to provide. In future work, we plan to explore more sophisticated detection strategies at the server, which can provide guarantees against the type of attacker we have considered here. In particular, notions of distances between weight distributions are promising defensive tools. Our attacks in this paper demonstrate that federated learning in its basic form is very vulnerable to model poisoning adversaries, as are recently proposed Byzantine resilient aggregation mechanisms. While detection mechanisms can make these attacks more challenging, they can be overcome, demonstrating that multi-party machine learning algorithms robust to attackers of the type considered here must be developed.
|
| 175 |
+
|
| 176 |
+
# REFERENCES
|
| 177 |
+
|
| 178 |
+
Eugene Bagdasaryan, Andreas Veit, Yiqing Hua, Deborah Estrin, and Vitaly Shmatikov. How to backdoor federated learning. arXiv preprint arXiv:1807.00459, 2018.
|
| 179 |
+
Battista Biggio, Blaine Nelson, and Pavel Laskov. Poisoning attacks against support vector machines. In Proceedings of the 29th International Conference on Machine Learning (ICML-12), pp. 1807–1814, 2012.
|
| 180 |
+
Peva Blanchard, El Mahdi El Mhamdi, Rachid Guerraoui, and Julien Stainer. Machine learning with adversaries: Byzantine tolerant gradient descent. Advances in Neural Information Processing Systems, 2017.
|
| 181 |
+
Lingjiao Chen, Hongyi Wang, Zachary B. Charles, and Dimitris S. Papailiopoulos. DRACO: byzantine-resilient distributed training via redundant gradients. In Proceedings of the 35th International Conference on Machine Learning, ICML, 2018.
|
| 182 |
+
Xinyun Chen, Chang Liu, Bo Li, Kimberly Lu, and Dawn Song. Targeted backdoor attacks on deep learning systems using data poisoning. arXiv preprint arXiv:1712.05526, 2017a.
|
| 183 |
+
Yudong Chen, Lili Su, and Jiaming Xu. Distributed statistical machine learning in adversarial settings: Byzantine gradient descent. Proc. ACM Meas. Anal. Comput. Syst., 1(2), 2017b.
|
| 184 |
+
Manuel Fernandez-Delgado, Eva Cernadas, Sen ´ en Barro, and Dinani Amorim. Do we need hun- ´ dreds of classifiers to solve real world classification problems? The Journal of Machine Learning Research, 15(1):3133–3181, 2014.
|
| 185 |
+
Matthew Jagielski, Alina Oprea, Battista Biggio, Chang Liu, Cristina Nita-Rotaru, and Bo Li. Manipulating machine learning: Poisoning attacks and countermeasures for regression learning. In IEEE Security and Privacy, 2018.
|
| 186 |
+
Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In International Conference on Learning Representations, 2015.
|
| 187 |
+
|
| 188 |
+
Pang Wei Koh and Percy Liang. Understanding black-box predictions via influence functions. In ICML, 2017.
|
| 189 |
+
|
| 190 |
+
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.
|
| 191 |
+
|
| 192 |
+
Brendan McMahan, Eider Moore, Daniel Ramage, Seth Hampson, and Blaise Aguera y Arcas. Communication-Efficient Learning of Deep Networks from Decentralized Data. In Proceedings of the 20th International Conference on Artificial Intelligence and Statistics, 2017.
|
| 193 |
+
|
| 194 |
+
Shike Mei and Xiaojin Zhu. Using machine teaching to identify optimal training-set attacks on machine learners. In AAAI, 2015.
|
| 195 |
+
|
| 196 |
+
El Mahdi El Mhamdi, Rachid Guerraoui, and Sebastien Rouault. The hidden vulnerability of dis- ´ tributed learning in byzantium. In ICML, 2018.
|
| 197 |
+
|
| 198 |
+
Gregoire Montavon, Sebastian Bach, Alexander Binder, Wojciech Samek, and Klaus-Robert M ´ uller.¨ Explaining nonlinear classification decisions with deep taylor decomposition. arXiv preprint arXiv:1512.02479, 2015.
|
| 199 |
+
|
| 200 |
+
Luis Munoz-Gonz ˜ alez, Battista Biggio, Ambra Demontis, Andrea Paudice, Vasin Wongrassamee, ´ Emil C Lupu, and Fabio Roli. Towards poisoning of deep learning algorithms with back-gradient optimization. In Proceedings of the 10th ACM Workshop on Artificial Intelligence and Security. ACM, 2017.
|
| 201 |
+
|
| 202 |
+
Benjamin IP Rubinstein, Blaine Nelson, Ling Huang, Anthony D Joseph, Shing-hon Lau, Satish Rao, Nina Taft, and JD Tygar. Stealthy poisoning attacks on pca-based anomaly detectors. ACM SIGMETRICS Performance Evaluation Review, 37(2):73–74, 2009.
|
| 203 |
+
|
| 204 |
+
Karen Simonyan, Andrea Vedaldi, and Andrew Zisserman. Deep inside convolutional networks: Visualising image classification models and saliency maps. arXiv preprint arXiv:1312.6034, 2013.
|
| 205 |
+
|
| 206 |
+
Daniel Smilkov, Nikhil Thorat, Been Kim, Fernanda B. Viegas, and Martin Wattenberg. Smooth-´ grad: removing noise by adding noise. arXiv preprint arXiv:1706.03825, 2017.
|
| 207 |
+
|
| 208 |
+
Jost Tobias Springenberg, Alexey Dosovitskiy, Thomas Brox, and Martin A. Riedmiller. Striving for simplicity: The all convolutional net. arXiv preprint arXiv:1412.6806, 2014.
|
| 209 |
+
|
| 210 |
+
Mukund Sundararajan, Ankur Taly, and Qiqi Yan. Axiomatic attribution for deep networks. arXiv preprint arXiv:1703.01365, 2017.
|
| 211 |
+
|
| 212 |
+
Han Xiao, Kashif Rasul, and Roland Vollgraf. Fashion-mnist: a novel image dataset for benchmarking machine learning algorithms. arXiv preprint arXiv:1708.07747, 2017.
|
| 213 |
+
|
| 214 |
+
Huang Xiao, Battista Biggio, Gavin Brown, Giorgio Fumera, Claudia Eckert, and Fabio Roli. Is feature selection secure against training data poisoning? In ICML, 2015.
|
| 215 |
+
|
| 216 |
+
Dong Yin, Yudong Chen, Kannan Ramchandran, and Peter Bartlett. Byzantine-robust distributed learning: Towards optimal statistical rates. arXiv preprint arXiv:1803.01498, 2018.
|
| 217 |
+
|
| 218 |
+
Matthew D. Zeiler and Rob Fergus. Visualizing and understanding convolutional networks. In Computer Vision, ECCV 2014 - 13th European Conference, Proceedings, 2014.
|
| 219 |
+
|
| 220 |
+
# A FURTHER RESULTS
|
| 221 |
+
|
| 222 |
+
# A.1 RESULTS ON ADULT CENSUS DATASET
|
| 223 |
+
|
| 224 |
+
Results for the 4 different attack strategies on the Adult Census dataset (Figure 7) confirm the broad conclusions we derived from the Fashion MNIST data. The baseline attack is able to induce high confidence targeted misclassification for a random test example but affects performance on the benign objective, which drops from $8 4 . 8 \%$ in the benign case to just around $80 \%$ . The alternating minimization attack is able to ensure misclassification with a confidence of around 0.7 while maintaining $84 \%$ accuracy on the benign objective.
|
| 225 |
+
|
| 226 |
+

|
| 227 |
+
Figure 7: Metrics of interest for 4 different attack strategies with the Adult Census dataset.
|
| 228 |
+
|
| 229 |
+

|
| 230 |
+
Figure 8: Metrics of interest for the baseline and alternating minization attack with $k = 1 0 0$ agents for the Fashion-MNIST dataset.
|
| 231 |
+
|
| 232 |
+
# A.2 RANDOMIZED AGENT SELECTION
|
| 233 |
+
|
| 234 |
+
When the number of agents increases to $k = 1 0 0$ , the malicious agent is not selected in every step. Further, the size of $| \mathcal { D } _ { m } |$ decreases, which makes the benign training step in the alternating minimization attack more challenging. The challenges posed in this setting are reflected in Figure 8, where although the baseline attack is able to introduce a targeted backdoor, it cannot ensure it for every step due to steps where only benign agents provide updates. The alternating minimization attack is also able to introduce the backdoor, as well as increase the classification accuracy of the malicious model on test data. However, the improvement in performance is limited by the paucity of data for the malicious agent. It is an open question if data augmentation could help improve this accuracy.
|
| 235 |
+
|
| 236 |
+
# B VISUALIZATION OF WEIGHT UPDATE DISTRIBUTIONS
|
| 237 |
+
|
| 238 |
+
Figure B shows the evolution of weight update distributions for the 4 different attack strategies on the CNN trained on the Faishon MNIST dataset. Time slices of this evolution were shown in the main text of the paper. The baseline and concatenated training attacks lead to weight update distributions that differ widely for benign and malicious agents. The alternating minimization attack without distance constraints reduces this qualitative difference somewhat but the closest weight update distributions are obtained with the alternating minimization attack with distance constraints.
|
| 239 |
+
|
| 240 |
+

|
| 241 |
+
(c) Alternating minimization attack weight update dis-(d) Alternating minimization attack with distance contribution straints weight update distribution
|
| 242 |
+
Figure 9: Weight update distribution evolution over time for all attacks on a CNN for the Fashion MNIST dataset.
|
| 243 |
+
|
| 244 |
+
# C BYPASSING BYZANTINE-RESILIENT AGGREGATION MECHANISMS
|
| 245 |
+
|
| 246 |
+
Blanchard et al. (2017) recently proposed a gradient aggregation mechanism known as ‘Krum’ that is provably resilient to Byzantine adversaries. We choose to evaluate Krum as it is efficient, provably resilient and can be used a building block for better mechanisms Mhamdi et al. (2018). As stated in the introduction, the aim of Byzantine adversaries considered in this work and others (Chen et al. (2017b); Mhamdi et al. (2018); Chen et al. (2018); Yin et al. (2018)) is to ensure convergence to ineffective models. The goals of the adversary in this paper are to ensure convergence to effective models with targeted backdoors. This difference in objectives leads to ‘Krum’ being ineffective against our attacks.
|
| 247 |
+
|
| 248 |
+
We now briefly describe Krum. Given $n$ agents of which $f$ are Byzantine, Krum requires that $n \geq 2 f + 3$ . At any time step $t$ , updates $( \delta _ { 1 } ^ { \check { t } } , \dots , \delta _ { n } ^ { t } )$ are received at the server. For each $\delta _ { i } ^ { t }$ , the $n - f - 2$ closest (in terms of $L _ { p }$ norm) other updates are chosen to form a set $C _ { i }$ and their distances added up to give a score $\begin{array} { r } { S ( \delta _ { i } ^ { t } ) \dot { = } \sum _ { \delta \in { \cal C } _ { i } } \| \delta _ { i } ^ { t } - \delta \| } \end{array}$ . Krum then chooses $\delta _ { \mathbf { k r u m } } = \delta _ { i } ^ { t }$ with the lowest score to add to $\mathbf { w } _ { i } ^ { t }$ to give $\mathbf { w } _ { i } ^ { t + 1 } = \mathbf { w } _ { i } ^ { t } + \delta _ { \mathbf { k r u m } }$ .
|
| 249 |
+
|
| 250 |
+
In Figure 10, we see the effect of our attack strategies on Krum with a boosting factor of $\lambda = 2$ for a federated learning setup with 10 agents. Since there is no need to overcome the constant scaling factor $\alpha _ { m }$ , the attacks can use a much smaller boosting factor $\lambda$ to ensure the global model has the targeted backdoor. Even with the baseline attack, the malicious agent’s update is the one chosen by Krum for 34 of 40 time steps but the global model is unable to attain high test accuracy. The alternating minimization attack ensures that the global model maintains relatively high test accuracy while the malicious agent is chosen for 26 of 40 time steps. These results conclusively demonstrate the effectiveness of model poisoning attacks against Krum.
|
| 251 |
+
|
| 252 |
+

|
| 253 |
+
Figure 10: Metrics of interest for 2 different attack strategies with the Krum aggregation mechanism.
|
md/train/Bkg0u3Etwr/Bkg0u3Etwr.md
ADDED
|
@@ -0,0 +1,561 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# MAXMIN Q-LEARNING: CONTROLLING THE ESTIMATION BIAS OF Q-LEARNING
|
| 2 |
+
|
| 3 |
+
Qingfeng Lan, Yangchen Pan, Alona Fyshe, Martha White
|
| 4 |
+
|
| 5 |
+
Department of Computing Science
|
| 6 |
+
University of Alberta
|
| 7 |
+
Edmonton, Alberta, Canada
|
| 8 |
+
{qlan3,pan6,alona,whitem}@ualberta.ca
|
| 9 |
+
|
| 10 |
+
# ABSTRACT
|
| 11 |
+
|
| 12 |
+
Q-learning suffers from overestimation bias, because it approximates the maximum action value using the maximum estimated action value. Algorithms have been proposed to reduce overestimation bias, but we lack an understanding of how bias interacts with performance, and the extent to which existing algorithms mitigate bias. In this paper, we 1) highlight that the effect of overestimation bias on learning efficiency is environment-dependent; 2) propose a generalization of Q-learning, called Maxmin $Q$ -learning, which provides a parameter to flexibly control bias; 3) show theoretically that there exists a parameter choice for Maxmin Q-learning that leads to unbiased estimation with a lower approximation variance than Q-learning; and 4) prove the convergence of our algorithm in the tabular case, as well as convergence of several previous Q-learning variants, using a novel Generalized Q-learning framework. We empirically verify that our algorithm better controls estimation bias in toy environments, and that it achieves superior performance on several benchmark problems. 1
|
| 13 |
+
|
| 14 |
+
# 1 INTRODUCTION
|
| 15 |
+
|
| 16 |
+
Q-learning (Watkins, 1989) is one of the most popular reinforcement learning algorithms. One of the reasons for this widespread adoption is the simplicity of the update. On each step, the agent updates its action value estimates towards the observed reward and the estimated value of the maximal action in the next state. This target represents the highest value the agent thinks it could obtain from the current state and action, given the observed reward.
|
| 17 |
+
|
| 18 |
+
Unfortunately, this simple update rule has been shown to suffer from overestimation bias (Thrun & Schwartz, 1993; van Hasselt, 2010). The agent updates with the maximum over action values might be large because an action’s value actually is high, or it can be misleadingly high simply because of the stochasticity or errors in the estimator. With many actions, there is a higher probability that one of the estimates is large simply due to stochasticity and the agent will overestimate the value. This issue is particularly problematic under function approximation, and can significant impede the quality of the learned policy (Thrun & Schwartz, 1993; Szita & Lorincz, 2008; Strehl et al., 2009) ˝ or even lead to failures of Q-learning (Thrun & Schwartz, 1993). More recently, experiments across several domains suggest that this overestimation problem is common (Hado van Hasselt et al., 2016).
|
| 19 |
+
|
| 20 |
+
Double Q-learning (van Hasselt, 2010) is introduced to instead ensure underestimation bias. The idea is to maintain two unbiased independent estimators of the action values. The expected action value of estimator one is selected for the maximal action from estimator two, which is guaranteed not to overestimate the true maximum action value. Double DQN (Hado van Hasselt et al., 2016), the extension of this idea to Q-learning with neural networks, has been shown to significantly improve performance over Q-learning. However, this is not a complete answer to this problem, because trading overestimation bias for underestimation bias is not always desirable, as we show in our experiments.
|
| 21 |
+
|
| 22 |
+
Several other methods have been introduced to reduce overestimation bias, without fully moving towards underestimation. Weighted Double Q-learning (Zhang et al., 2017) uses a weighted combination of the Double Q-learning estimate, which likely has underestimation bias, and the Q-learning estimate, which likely has overestimation bias. Bias-corrected Q-Learning (Lee et al., 2013) reduces the overestimation bias through a bias correction term. Ensemble Q-learning and Averaged Q-learning (Anschel et al., 2017) take averages of multiple action values, to both reduce the overestimation bias and the estimation variance. However, with a finite number of actionvalue functions, the average operation in these two algorithms will never completely remove the overestimation bias, as the average of several overestimation biases is always positive. Further, these strategies do not guide how strongly we should correct for overestimation bias, nor how to determine—or control—the level of bias.
|
| 23 |
+
|
| 24 |
+
The overestimation bias also appears in the actor-critic setting (Fujimoto et al., 2018; Haarnoja et al., 2018). For example, Fujimoto et al. (2018) propose the Twin Delayed Deep Deterministic policy gradient algorithm (TD3) which reduces the overestimation bias by taking the minimum value between two critics. However, they do not provide a rigorous theoretical analysis for the effect of applying the minimum operator. There is also no theoretical guide for choosing the number of estimators such that the overestimation bias can be reduced to 0.
|
| 25 |
+
|
| 26 |
+
In this paper, we study the effects of overestimation and underestimation bias on learning performance, and use them to motivate a generalization of Q-learning called Maxmin Q-learning. Maxmin Q-learning directly mitigates the overestimation bias by using a minimization over multiple action-value estimates. Moreover, it is able to control the estimation bias varying from positive to negative which helps improve learning efficiency as we will show in next sections. We prove that, theoretically, with an appropriate number of action-value estimators, we are able to acquire an unbiased estimator with a lower approximation variance than Q-learning. We empirically verify our claims on several benchmarks. We study the convergence properties of our algorithm within a novel Generalized Q-learning framework, which is suitable for studying several of the recently proposed Q-learning variants. We also combine deep neural networks with Maxmin Q-learning (Maxmin DQN) and demonstrate its effectiveness in several benchmark domains.
|
| 27 |
+
|
| 28 |
+
# 2 PROBLEM SETTING
|
| 29 |
+
|
| 30 |
+
We formalize the problem as a Markov Decision Process (MDP), $( S , { \mathcal { A } } , \mathrm { P } , r , \gamma )$ , where $s$ is the state space, $\mathcal { A }$ is the action space, $\operatorname { P } : S \times A \times S [ 0 , 1 ]$ is the transition probabilities, $r : S \times \mathcal { A } \times \mathcal { S } \mathbb { R }$ is the reward mapping, and $\gamma \in [ 0 , 1 ]$ is the discount factor. At each time step $t$ , the agent observes a state $S _ { t } \in { S }$ and takes an action $A _ { t } \in { \mathcal { A } }$ and then transitions to a new state $S _ { t + 1 } \in S$ according to the transition probabilities $\mathrm { P }$ and receives a scalar reward $R _ { t + 1 } = r ( S _ { t } , A _ { t } , S _ { t + 1 } ) \in \mathbb { R }$ . The goal of the agent is to find a policy $\pi : S \times A \to [ 0 , 1 ]$ that maximizes the expected return starting from some initial state.
|
| 31 |
+
|
| 32 |
+
Q-learning is an off-policy algorithm which attempts to learn the state-action values $Q : { \mathcal { S } } \times { \mathcal { A } } \mathbb { R }$ for the optimal policy. It tries to solve for
|
| 33 |
+
|
| 34 |
+
$$
|
| 35 |
+
Q ^ { * } ( s , a ) = \mathbb { E } \Big [ R _ { t + 1 } + \operatorname* { m a x } _ { a ^ { \prime } \in \mathcal { A } } Q ^ { * } ( S _ { t + 1 } , a ^ { \prime } ) ~ \Big | ~ S _ { t } = s , A _ { t } = a \Big ]
|
| 36 |
+
$$
|
| 37 |
+
|
| 38 |
+
The optimal policy is to act greedily with respect to these action values: from each $s$ select $a$ from arg $\operatorname* { m a x } _ { a \in \mathcal { A } } Q ^ { * } ( s , a )$ . The update rule for an approximation $Q$ for a sampled transition $s _ { t } , a _ { t } , r _ { t + 1 } , s _ { t + 1 }$ is:
|
| 39 |
+
|
| 40 |
+
$$
|
| 41 |
+
Q ( s _ { t } , a _ { t } ) \gets Q ( s _ { t } , a _ { t } ) + \alpha ( Y _ { t } ^ { Q } - Q ( s _ { t } , a _ { t } ) ) \qquad \mathrm { f o r } Y _ { t } ^ { Q } \stackrel { \mathrm { d e f } } { = } r _ { t + 1 } + \gamma \operatorname* { m a x } _ { a ^ { \prime } \in A } Q ( s _ { t + 1 } , a ^ { \prime } )
|
| 42 |
+
$$
|
| 43 |
+
|
| 44 |
+
where $\alpha$ is the step-size. The transition can be generated off-policy, from any behaviour that sufficiently covers the state space. This algorithm is known to converge in the tabular setting (Tsitsiklis, 1994), with some limited results for the function approximation setting (Melo & Ribeiro, 2007).
|
| 45 |
+
|
| 46 |
+
# 3 UNDERSTANDING WHEN OVERESTIMATION BIAS HELPS AND HURTS
|
| 47 |
+
|
| 48 |
+
In this section, we briefly discuss the estimation bias issue, and empirically show that both overestimation and underestimation bias may improve learning performance, depending on the environment. This motivates our Maxmin Q-learning algorithm described in the next section, which allows us to flexibly control the estimation bias and reduce the estimation variance.
|
| 49 |
+
|
| 50 |
+
The overestimation bias occurs since the target $\operatorname* { m a x } _ { a ^ { \prime } \in A } Q ( s _ { t + 1 } , a ^ { \prime } )$ is used in the Q-learning update. Because $Q$ is an approximation, it is probable that the approximation is higher than the true value for one or more of the actions. The maximum over these estimators, then, is likely to be skewed towards an overestimate. For example, even unbiased estimates $Q ( s _ { t + 1 } , a ^ { \prime } )$ for all $a ^ { \prime }$ , will vary due to stochasticity. $Q ( s _ { t + 1 } , a ^ { \prime } ) = Q ^ { * } \bar { ( } s _ { t + 1 } , a ^ { \prime } ) + e _ { a ^ { \prime } }$ , and for some actions, $e _ { a ^ { \prime } }$ will be positive. As a result, $\begin{array} { r } { \mathbb { E } [ \operatorname* { m a x } _ { a ^ { \prime } \in \mathcal { A } } Q ( s _ { t + 1 } , a ^ { \prime } ) ] \geq \operatorname* { m a x } _ { a ^ { \prime } \in \mathcal { A } } \mathbb { E } [ Q ( s _ { t + 1 } , a ^ { \prime } ) ] = \operatorname* { m a x } _ { a ^ { \prime } \in \mathcal { A } } Q ^ { * } ( s _ { t + 1 } , a ^ { \prime } ) } \end{array}$ .
|
| 51 |
+
|
| 52 |
+
This overestimation bias, however, may not always be detrimental. And, further, in some cases, erring towards an underestimation bias can be harmful. Overestimation bias can help encourage exploration for overestimated actions, whereas underestimation bias might discourage exploration. In particular, we expect more overestimation bias in highly stochastic areas of the world; if those highly stochastic areas correspond to high-value regions, then encouraging exploration there might be beneficial. An underestimation bias might actually prevent an agent from learning that a region is high-value. Alternatively, if highly stochastic areas also have low values, overestimation bias might cause an agent to over-explore a low-value region.
|
| 53 |
+
|
| 54 |
+
We show this effect in the simple MDP, shown in Figure 1. The MDP for state $A$ has only two actions: Left and Right. It has a deterministic neutral reward for both the Left action and the Right action. The Left action transitions to state $B$ where there are eight actions transitions to a terminate state with a highly stochastic reward. The mean of this stochastic reward is $\mu$ . By selecting $\mu > 0$ , the stochastic region becomes high-value, and we expect overestimation bias to help and underestimation bias to hurt. By selecting $\mu < 0$ , the stochastic region becomes low-value, and we expect overestimation bias to hurt and underestimation bias to help.
|
| 55 |
+
|
| 56 |
+

|
| 57 |
+
Figure 1: A simple episodic MDP, adapted from Figure 6.5 in Sutton & Barto (2018) which is used to highlight the difference between Double Q-learning and $\mathbf { Q }$ -learning. This MDP has two nonterminal states $A$ and $B$ . Every episode starts from $A$ which has two actions: Left and Right. The Right action transitions to a terminal state with reward 0. The Left action transitions to state $B$ with reward 0. From state $B$ , there are 8 actions that all transition to a terminal state with a reward $\mu + \xi$ , where $\xi$ is drawn from a uniform distribution $U ( - 1 , 1 )$ . When $\mu > 0$ , the optimal action in state $A$ is Left; when $\mu < 0$ , it is Right.
|
| 58 |
+
|
| 59 |
+
We test Q-learning, Double Q-learning and our new algorithm Maxmin Q-learning in this environment. Maxmin Q-learning (described fully in the next section) uses $N$ estimates of the action values in the targets. For $N = 1$ , it corresponds to Q-learning; otherwise, it progresses from overestimation bias at $N = 1$ towards underestimation bias with increasing $N$ . In the experiment, we used a discount factor $\gamma = 1$ ; a replay buffer with size 100; an $\epsilon$ -greedy behaviour with $\epsilon = 0 . 1$ ; tabular action-values, initialized with a Gaussian distribution $\mathcal { N } ( 0 , 0 . \mathrm { \bar { 0 } 1 } )$ ; and a step-size of 0.01 for all algorithms.
|
| 60 |
+
|
| 61 |
+
The results in Figure 2 verify our hypotheses for when overestimation and underestimation bias help and hurt. Double Q-learning underestimates too much for $\mu = + 1$ , and converges to a suboptimal policy. Q-learning learns the optimal policy the fastest, though for all values of $N = 2 , 4 , 6 , 8$ , Maxmin Q-learning does progress towards the optimal policy. All methods get to the optimal policy for $\mu = - 1$ , but now Double Q-learning reaches the optimal policy the fastest, and followed by Maxmin Q-learning with larger $N$ .
|
| 62 |
+
|
| 63 |
+
# 4 MAXMIN Q-LEARNING
|
| 64 |
+
|
| 65 |
+
In this section, we develop Maxmin Q-learning, a simple generalization of Q-learning designed to control the estimation bias, as well as reduce the estimation variance of action values. The idea is to maintain $N$ estimates of the action values, $Q ^ { i }$ , and use the minimum of these estimates in the Q-learning target: $\begin{array} { r } { \operatorname* { m a x } _ { a ^ { \prime } } \operatorname* { m i n } _ { i \in \{ 1 , . . . , N \} } Q ^ { i } ( s ^ { \prime } , a ^ { \prime } ) } \end{array}$ . For $N = 1$ , the update is simply Q-learning, and so likely has overestimation bias. As $N$ increase, the overestimation decreases; for some $N > 1$ , this maxmin estimator switches from an overestimate, in expectation, to an underestimate. We characterize the relationship between $N$ and the expected estimation bias below in Theorem 1. Note that Maxmin Q-learning uses a different mechanism to reduce overestimation bias than Double Qlearning; Maxmin Q-learning with $N = 2$ is not Double Q-learning.
|
| 66 |
+
|
| 67 |
+

|
| 68 |
+
Figure 2: Comparison of three algorithms using the simple MDP in Figure 1 with different values of $\mu$ , and thus different expected rewards. For $\mu = + 0 . 1$ , shown in (a), the optimal $\epsilon$ -greedy policy is to take the Left action with $9 5 \%$ probability. For $\mu = - 0 . 1$ , shown in in (b), the optimal policy is to take the Left action with $5 \%$ probability. The reported distance is the absolute difference between the probability of taking the Left action under the learned policy compared to the optimal $\epsilon$ -greedy policy. All results were averaged over 5, 000 runs.
|
| 69 |
+
|
| 70 |
+
The full algorithm is summarized in Algorithm 1, and is a simple modification of Q-learning with experience replay. We use random subsamples of the observed data for each of the $N$ estimators, to make them nearly independent. To do this training online, we keep a replay buffer. On each step, a random estimator $i$ is chosen and updated using a mini-batch from the buffer. Multiple such updates can be performed on each step, just like in experience replay, meaning multiple estimators can be updated per step using different random mini-batches. In our experiments, to better match DQN, we simply do one update per step. Finally, it is also straightforward to incorporate target networks to get Maxmin DQN, by maintaining a target network for each estimator.
|
| 71 |
+
|
| 72 |
+
We now characterize the relation between the number of action-value functions used in Maxmin Q-learning and the estimation bias of action values. For compactness, we write $Q _ { s a } ^ { i }$ instead of $Q ^ { i } ( s , a )$ . Each $Q _ { s a } ^ { i }$ has random approximation error $e _ { s a } ^ { i }$
|
| 73 |
+
|
| 74 |
+
$$
|
| 75 |
+
Q _ { s a } ^ { i } = Q _ { s a } ^ { * } + e _ { s a } ^ { i } .
|
| 76 |
+
$$
|
| 77 |
+
|
| 78 |
+
We assume that $e _ { s a } ^ { i }$ is a uniform random variable $U ( - \tau , \tau )$ for some $\tau > 0$ . The uniform random assumption was used by Thrun $\&$ Schwartz (1993) to demonstrate bias in Q-learning, and reflects that non-negligible positive and negative $e _ { s a } ^ { i }$ are possible. Notice that for $N$ estimators with $ { n _ { s a } }$ samples, the $\tau$ will be proportional to some function of $n _ { s a } / N$ , because the data will be shared amongst the $N$ estimators. For the general theorem, we use a generic $\tau$ , and in the following corollary provide a specific form for $\tau$ in terms of $N$ and $ { n _ { s a } }$ .
|
| 79 |
+
|
| 80 |
+
Recall that $M$ is the number of actions applicable at state $s ^ { \prime }$ . Define the estimation bias $Z _ { M N }$ for transition $s , a , r , s ^ { \prime }$ to be
|
| 81 |
+
|
| 82 |
+
$$
|
| 83 |
+
\begin{array} { c } { { Z _ { M N } \overset { \mathrm { d e f } } { = } ( r + \gamma \underset { a ^ { \prime } } { \operatorname* { m a x } } Q _ { s ^ { \prime } a ^ { \prime } } ^ { m i n } ) - ( r + \gamma \underset { a ^ { \prime } } { \operatorname* { m a x } } Q _ { s ^ { \prime } a ^ { \prime } } ^ { * } ) } } \\ { { = \gamma ( \underset { a ^ { \prime } } { \operatorname* { m a x } } Q _ { s ^ { \prime } a ^ { \prime } } ^ { m i n } - \underset { a ^ { \prime } } { \operatorname* { m a x } } Q _ { s ^ { \prime } a ^ { \prime } } ^ { * } ) } } \end{array}
|
| 84 |
+
$$
|
| 85 |
+
|
| 86 |
+
# Algorithm 1: Maxmin Q-learning
|
| 87 |
+
|
| 88 |
+
<table><tr><td>Input: step-size α, exploration parameter ε > O, number of action-value functions N Initialize N action-value functions {Q1,..., QN} randomly Initialize empty replay buffer D Observe initial state s</td><td></td></tr><tr><td>while Agent is interacting with the Environment do Qmin(s,a) ← mink∈{1.,.N)} Q𝑘(s,a),∀a ∈ A</td><td></td></tr><tr><td>Choose action a by E-greedy based on Qmin</td><td></td></tr><tr><td></td><td></td></tr><tr><td>Take action a,observe r,s'</td><td></td></tr><tr><td>Store transition (s,a,r,s') in D</td><td></td></tr><tr><td>fori∈Sdo</td><td> Select a subset S from {1,...,N} (e.g.,randomly select one i to update)</td></tr><tr><td>Sample random mini-batch of transitions (s D,aD,rD,s'D) from D</td><td></td></tr><tr><td>Get update target: YMQ ← rD + γ maxa'∈A Qmin (s'D,a')</td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td>Update action-value Qi: Qi(sD,aD) ← Qi(sD,aD) + α[YMQ - Qi(sD,aD)]</td></tr><tr><td>end</td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td>s↑s`</td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr></table>
|
| 89 |
+
|
| 90 |
+
where
|
| 91 |
+
|
| 92 |
+
$$
|
| 93 |
+
Q _ { s a } ^ { m i n } \ { \stackrel { \mathrm { d e f } } { = } } \ \operatorname* { m i n } _ { i \in \{ 1 , \dots , N \} } Q _ { s a } ^ { i } = Q _ { s a } ^ { * } + \operatorname* { m i n } _ { i \in \{ 1 , \dots , N \} } e _ { s a } ^ { i }
|
| 94 |
+
$$
|
| 95 |
+
|
| 96 |
+
We now show how the expected esti tion bias $E [ Z _ { M N } ]$ and the variance of $Q _ { s a } ^ { m i n }$ are related to the number of action-value functions $N$ in Maxmin Q-learning.
|
| 97 |
+
|
| 98 |
+
Theorem 1 Under the conditions stated above,
|
| 99 |
+
|
| 100 |
+
(i) the expected estimation bias is
|
| 101 |
+
|
| 102 |
+
$$
|
| 103 |
+
E [ Z _ { M N } ] = \gamma \tau [ 1 - 2 t _ { M N } ] \qquad w h e r e \ t _ { M N } = \frac { M ( M - 1 ) \cdot \cdot \cdot 1 } { ( M + \frac { 1 } { N } ) ( M - 1 + \frac { 1 } { N } ) \cdot \cdot \cdot ( 1 + \frac { 1 } { N } ) } .
|
| 104 |
+
$$
|
| 105 |
+
|
| 106 |
+
${ \bf \Pi } _ { ( i i ) } ^ { E [ Z _ { M N } ] }$ decreases as $N$ increases: $\begin{array} { r } { E [ Z _ { M , N = 1 } ] = \gamma \tau _ { M + 1 } ^ { M - 1 } } \end{array}$ and $E [ Z _ { M , N \infty } ] = - \gamma \tau$
|
| 107 |
+
|
| 108 |
+
$$
|
| 109 |
+
V a r [ Q _ { s a } ^ { m i n } ] = \frac { 4 N \tau ^ { 2 } } { ( N + 1 ) ^ { 2 } ( N + 2 ) } .
|
| 110 |
+
$$
|
| 111 |
+
|
| 112 |
+
$V a r [ Q _ { s a } ^ { m i n } ]$ decreases as $N$ increases: $V a r [ Q _ { s a } ^ { m i n } ] = { \frac { \tau ^ { 2 } } { 3 } }$ for $N { = } I$ and $V a r [ Q _ { s a } ^ { m i n } ] = 0$ for $N \to \infty$
|
| 113 |
+
|
| 114 |
+
Theorem 1 is a generalization of the first lemma in Thrun $\&$ Schwartz (1993); we provide the proof in Appendix A as well as a visualization of the expected bias for varying $M$ and $N$ . This theorem shows that the average estimation bias $E [ Z _ { M N } ]$ , decreases as $N$ increases. Thus, we can control the bias by changing the number of estimators in Maxmin Q-learning. Specifically, the average estimation bias can be reduced from positive to negative as $N$ increases. Notice that $E [ Z _ { M N } ] = 0$ when $\begin{array} { r } { t _ { M N } = \frac { 1 } { 2 } } \end{array}$ . This suggests that by choosing $N$ such that $\begin{array} { r } { t _ { M N } \approx \frac { 1 } { 2 } } \end{array}$ , we can reduce the bias to near 0.
|
| 115 |
+
|
| 116 |
+
Furthermore, $V a r [ Q _ { s a } ^ { m i n } ]$ decreases as $N$ increases. This indicates that we can control the estimation variance of target action value through $N$ . We show just this in the following Corollary. The subtlety is that with increasing $N$ , each estimator will receive less data. The fair comparison is to compare the variance of a single estimator that uses all of the data, as compared to the maxmin estimator which shares the samples across $N$ estimators. We show that there is an $N$ such that the variance is lower, which arises largely due to the fact that the variance of each estimator decreases linearly in $n$ , but the $\tau$ parameter for each estimator only decreases at a square root rate in the number of samples.
|
| 117 |
+
|
| 118 |
+
Corollary 1 Assuming the $ { n _ { s a } }$ samples are evenly allocated amongst the $N$ estimators, then $\tau =$ $\sqrt { 3 \sigma ^ { 2 } N / n _ { s a } }$ where $\sigma ^ { 2 }$ is the variance of samples for $( s , a )$ and, for $Q _ { s a }$ the estimator that uses all
|
| 119 |
+
|
| 120 |
+

|
| 121 |
+
Figure 3: Comparison of four algorithms on Mountain Car under different reward variances. The lines in $( a )$ show the average number of steps taken in the last episode with one standard error. The lines in $( b )$ show the number of steps to reach the goal position during training when the reward variance $\sigma ^ { 2 } = 1 0 $ . All results were averaged across 100 runs, with standard errors. Additional experiments with further elevated $\sigma ^ { 2 }$ can be found in Appendix C.2.
|
| 122 |
+
|
| 123 |
+
$ { n _ { s a } }$ samples for a single estimate,
|
| 124 |
+
|
| 125 |
+
$$
|
| 126 |
+
V a r [ Q _ { s a } ^ { m i n } ] = \frac { 1 2 N ^ { 2 } } { ( N + 1 ) ^ { 2 } ( N + 2 ) } V a r [ Q _ { s a } ] .
|
| 127 |
+
$$
|
| 128 |
+
|
| 129 |
+
Under this uniform random noise assumption, for $N \geq 8 , V a r [ Q _ { s a } ^ { m i n } ] < V a r [ Q _ { s a } ] ,$ .
|
| 130 |
+
|
| 131 |
+
# 5 EXPERIMENTS
|
| 132 |
+
|
| 133 |
+
In this section, we first investigate robustness to reward variance, in a simple environment (Mountain Car) in which we can perform more exhaustive experiments. Then, we investigate performance in seven benchmark environments.
|
| 134 |
+
|
| 135 |
+
Robustness under increasing reward variance in Mountain Car Mountain Car (Sutton & Barto, 2018) is a classic testbed in Reinforcement Learning, where the agent receives a reward of $- 1$ per step with $\gamma = 1$ , until the car reaches the goal position and the episode ends. In our experiment, we modify the rewards to be stochastic with the same mean value: the reward signal is sampled from a Gaussian distribution $\mathcal { N } ( - 1 , \sigma ^ { 2 } )$ on each time step. An agent should learn to reach the goal position in as few steps as possible.
|
| 136 |
+
|
| 137 |
+
The experimental setup is as follows. We trained each algorithm with $1 , 0 0 0$ episodes. The number of steps to reach the goal position in the last training episode was used as the performance measure. The fewer steps, the better performance. All experimental results were averaged over 100 runs. The key algorithm settings included the function approximator, step-sizes, exploration parameter and replay buffer size. All algorithm used $\epsilon$ -greedy with $\epsilon = 0 . 1$ and a buffer size of 100. For each algorithm, the best step-size was chosen from $\{ 0 . 0 0 5 , 0 . 0 1 , 0 . 0 2 , 0 . 0 4 , 0 . 0 8 \}$ , separately for each reward setting. Tile-coding was used to approximate the action-value function, where we used 8 tilings with each tile covering $1 / 8 \mathrm { t h }$ of the bounded distance in each dimension. For Maxmin Q-learning, we randomly chose one action-value function to update at each step.
|
| 138 |
+
|
| 139 |
+
As shown in Figure 3, when the reward variance is small, the performance of Q-learning, Double Qlearning, Averaged Q-learning, and Maxmin Q-learning are comparable. However, as the variance increases, Q-learning, Double Q-learning, and Averaged Q-learning became much less stable than Maxmin Q-learning. In fact, when the variance was very high $( \sigma = 5 0 $ , see Appendix C.2), Qlearning and Averaged Q-learning failed to reach the goal position in $5 , 0 0 0$ steps, and Double Qlearning produced runs $> 4 0 0$ steps, even after many episodes.
|
| 140 |
+
|
| 141 |
+
Results on Benchmark Environments To evaluate Maxmin DQN, we choose seven games from Gym (Brockman et al., 2016), PyGame Learning Environment (PLE) (Tasfi, 2016), and MinAtar (Young & Tian, 2019): Lunarlander, Catcher, Pixelcopter, Asterix, Seaquest, Breakout, and Space Invaders. For games in MinAtar (i.e. Asterix, Seaquest, Breakout, and Space Invaders), we reused the hyper-parameters and settings of neural networks in (Young & Tian, 2019). And the step-size was chosen from $[ 3 * 1 0 ^ { - 3 } , 1 0 ^ { - 3 } , 3 * 1 0 ^ { - 4 } , 1 0 ^ { - 4 } , 3 * 1 0 ^ { - 5 } ]$ . For Lunarlander, Catcher, and Pixelcopter, the neural network was a multi-layer perceptron with hidden layers fixed to [64, 64]. The discount factor was 0.99. The size of the replay buffer was 10, 000. The weights of neural networks were optimized by RMSprop with gradient clip 5. The batch size was 32. The target network was updated every 200 frames. $\epsilon$ -greedy was applied as the exploration strategy with $\epsilon$ decreasing linearly from 1.0 to 0.01 in $1 , 0 0 0$ steps. After 1, 000 steps, $\epsilon$ was fixed to 0.01. For Lunarlander, the best step-size was chosen from $[ 3 * 1 0 ^ { - 3 } , 1 0 ^ { - 3 } , 3 * 1 0 ^ { - 4 } , 1 0 ^ { - 4 } , 3 * 1 0 ^ { - 5 } ] .$ . For Catcher and Pixelcopter, the best step-size was chosen from $[ 1 0 ^ { - 3 } , 3 * 1 0 ^ { - 4 } , 1 0 ^ { - 4 } , 3 * 1 0 ^ { - 5 } , \bar { 1 } 0 ^ { - 5 } ]$ .
|
| 142 |
+
|
| 143 |
+
For both Maxmin DQN and Averaged DQN, the number of target networks $N$ was chosen from $[ 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 ]$ . And we randomly chose one action-value function to update at each step. We first trained each algorithm in a game for certain number of steps. After that, each algorithm was tested by running 100 test episodes with $\epsilon$ -greedy where $\epsilon = 0 . 0 1$ . Results were averaged over 20 runs for each algorithm, with learning curves shown for the best hyper-parameter setting (see Appendix C.3 for the parameter sensitivity curves).
|
| 144 |
+
|
| 145 |
+
We see from Figure 4 that Maxmin DQN performs as well as or better than other algorithms. In environments where final performance is noticeably better—-Pixelcopter, Lunarlander and Asterix—the initial learning is slower. A possible explanation for this is that the Maxmin agent more extensively explored early on, promoting better final performance. We additionally show on Pixelcopter and Asterix that for smaller $N$ , Maxmin DQN learns faster but reaches suboptimal performance—behaving more like Q-learning—and for larger $N$ learns more slowly but reaches better final performance.
|
| 146 |
+
|
| 147 |
+
# 6 CONVERGENCE ANALYSIS OF MAXMIN Q-LEARNING
|
| 148 |
+
|
| 149 |
+
In this section, we show Maxmin Q-learning is convergent in the tabular setting. We do so by providing a more general result for what we call Generalized Q-learning: Q-learning where the bootstrap target uses a function $G$ of $N$ action values. The main condition on $G$ is that it maintains relative maximum values, as stated in Assumption 1. We use this more general result to prove Maxmin Q-learning is convergent, and then discuss how it provides convergence results for $\mathrm { Q }$ - learning, Ensemble Q-learning, Averaged Q-learning and Historical Best Q-learning as special cases.
|
| 150 |
+
|
| 151 |
+
Many variants of Q-learning have been proposed, including Double Q-learning (van Hasselt, 2010), Weighted Double Q-learning (Zhang et al., 2017), Ensemble Q-learning (Anschel et al., 2017), Averaged Q-learning (Anschel et al., 2017), and Historical Best Q-learning (Yu et al., 2018). These algorithms differ in their estimate of the one-step bootstrap target. To encompass all variants, the target action-value of Generalized Q-learning $Y ^ { \hat { G } Q }$ is defined based on action-value estimates from both dimensions:
|
| 152 |
+
|
| 153 |
+
$$
|
| 154 |
+
Y ^ { G Q } = r + \gamma Q _ { s ^ { \prime } } ^ { G Q } ( t - 1 )
|
| 155 |
+
$$
|
| 156 |
+
|
| 157 |
+
where $t$ is the current time step and the action-value function $Q _ { s } ^ { G Q } ( t )$ is a function of $Q _ { s } ^ { 1 } ( t -$ $K ) , \ldots , Q _ { s } ^ { 1 } ( t - 1 ) , \ldots , Q _ { s } ^ { N } ( t - K ) , \ldots , Q _ { s } ^ { N } ( t - 1 )$ :
|
| 158 |
+
|
| 159 |
+
$$
|
| 160 |
+
Q _ { s } ^ { G Q } ( t ) = G \left( \begin{array} { c c c c } { Q _ { s } ^ { 1 } ( t - K ) } & { \ldots } & { Q _ { s } ^ { 1 } ( t - 1 ) } \\ { Q _ { s } ^ { 2 } ( t - K ) } & { \ldots } & { Q _ { s } ^ { 2 } ( t - 1 ) } \\ { \vdots } & { \ddots } & { \vdots } \\ { Q _ { s } ^ { N } ( t - K ) } & { \ldots } & { Q _ { s } ^ { N } ( t - 1 ) } \end{array} \right)
|
| 161 |
+
$$
|
| 162 |
+
|
| 163 |
+
For simplicity, the vector $( Q _ { s a } ^ { G Q } ( t ) ) _ { a \in \mathcal { A } }$ is denoted as $Q _ { s } ^ { G Q } ( t )$ , same for $Q _ { s } ^ { i } ( t )$ . The corresponding update rule is
|
| 164 |
+
|
| 165 |
+
$$
|
| 166 |
+
Q _ { s a } ^ { i } ( t ) \gets Q _ { s a } ^ { i } ( t - 1 ) + \alpha _ { s a } ^ { i } ( t - 1 ) ( Y ^ { G Q } - Q _ { s a } ^ { i } ( t - 1 ) )
|
| 167 |
+
$$
|
| 168 |
+
|
| 169 |
+
For different $G$ functions, Generalized Q-learning reduces to different variants of $\mathrm { Q }$ -learning, including Q-learning itself. For example, Generalized Q-learning can be reduced to Q-learning
|
| 170 |
+
|
| 171 |
+

|
| 172 |
+
Figure 4: Learning curves on the seven benchmark environments. The depicted return is averaged over the last 100 episodes, and the curves are smoothed using an exponential average, to match previous reported results (Young & Tian, 2019). The results were averaged over 20 runs, with the shaded area representing one standard error. Plots $( h )$ and $( i )$ show the performance of Maxmin DQN on Pixelcopter and Asterix, with different $N$ , highlighting that larger $N$ seems to result in slower early learning but better final performance in both environments.
|
| 173 |
+
|
| 174 |
+
simply by setting $K = 1$ , $N = 1$ with $G ( Q _ { s } ) = \operatorname* { m a x } _ { a \in A } Q _ { s a }$ . Double Q-learning can be specified with K = 1, N = 2, and G(Q1s, Q2s) = Q2s,arg maxa0∈A Q1 0 .
|
| 175 |
+
|
| 176 |
+
We first introduce Assumption 1 for function $G$ in Generalized Q-learning, and then state the theorem. The proof can be found in Appendix B.
|
| 177 |
+
|
| 178 |
+
Assumption 1 (Conditions on $G$ ) Let $G : \mathbb { R } ^ { n N K } \mapsto \mathbb { R }$ and $G ( Q ) = q$ where $Q \ = \ ( Q _ { a } ^ { i j } ) \ \in$ $\mathbb { R } ^ { n N K }$ , $a \in { \mathcal { A } }$ and $| { \mathcal { A } } | = n$ $= n , i \in \{ 1 , \ldots , N \} , j \in \{ 0 , \ldots , K - 1 \}$ and $q \in \mathbb { R }$ .
|
| 179 |
+
|
| 180 |
+
(i) If $Q _ { a } ^ { i j } = Q _ { a } ^ { k l } , \forall i , k , \forall j , l$ , and $\forall a$ , then $q = \operatorname* { m a x } _ { a } Q _ { a } ^ { i j }$ . $\begin{array} { r } { ( i i ) ~ \forall Q , Q ^ { \prime } \in \mathbb { R } ^ { n N K } , \mid G ( Q ) - G ( Q ^ { \prime } ) \mid \leq \operatorname* { m a x } _ { a , i , j } \mid Q _ { a } ^ { i j } - Q _ { ~ a } ^ { \prime i j } ~ \mid . } \end{array}$
|
| 181 |
+
|
| 182 |
+
We can verify that Assumption 1 holds for Maxmin Q-learning. Set $K = 1$ and set $N$ to be a positive integer. Let $Q _ { s } = \overline { { ( Q _ { s } ^ { 1 } , \ldots , Q _ { s } ^ { N } ) } }$ and define $\begin{array} { r } { G ^ { M Q } ( Q _ { s } ) ^ { \mathbf { \bar { \alpha } } } = \operatorname* { m a x } _ { a \in A } \operatorname* { m i n } _ { i \in \{ 1 , \dots , N \} } Q _ { s a } ^ { i } } \end{array}$ . It is easy to check that part (i) of Assumption 1 is satisfied. Part (ii) is also satisfied because
|
| 183 |
+
|
| 184 |
+
$$
|
| 185 |
+
\mid G ( Q _ { s } ) - G ( Q _ { s } ^ { \prime } ) \mid \leq \mid \operatorname * { m a x } _ { a } \operatorname * { m i n } _ { i } Q _ { s a } ^ { i } - \operatorname * { m a x } _ { a ^ { \prime } } \operatorname * { m i n } _ { i ^ { \prime } } Q _ { s a ^ { \prime } } ^ { \prime i ^ { \prime } } \mid \leq \operatorname * { m a x } _ { a , i } \mid Q _ { s a } ^ { i } - Q _ { s a } ^ { \prime i } \mid .
|
| 186 |
+
$$
|
| 187 |
+
|
| 188 |
+
Assumption 2 (Conditions on the step-sizes) There exists some (deterministic) constant $C$ such that for every $( s , a ) \in \mathcal { S } \times \mathcal { A } , i \in \{ 1 , . . . , N \}$ , $0 \leq \alpha _ { s a } ^ { i } ( t ) \leq 1$ , and with probability 1,
|
| 189 |
+
|
| 190 |
+
$$
|
| 191 |
+
\sum _ { t = 0 } ^ { \infty } ( \alpha _ { s a } ^ { i } ( t ) ) ^ { 2 } \leq C , \quad \sum _ { t = 0 } ^ { \infty } \alpha _ { s a } ^ { i } ( t ) = \infty
|
| 192 |
+
$$
|
| 193 |
+
|
| 194 |
+
Theorem 2 Assume a finite MDP $( { \boldsymbol { S } } , { \mathcal { A } } , { \boldsymbol { \mathrm { P } } } , { \boldsymbol { R } } )$ and that Assumption $I$ and 2 hold. Then the actionvalue functions in Generalized $Q$ -learning, using the tabular update in Equation (3), will converge to the optimal action-value function with probability 1, in either of the following cases: $( i ) \gamma < 1$ , or $( i i ) \gamma = 1$ , $\forall a \in \mathcal { A } , Q _ { s _ { 1 } a } ^ { i } \big ( t = 0 \big ) = 0$ where $s _ { 1 }$ is an absorbing state and all policies are proper.
|
| 195 |
+
|
| 196 |
+
As shown above, because the function $G$ for Maxmin Q-learning satisfies Assumption 1, then by Theorem 2 it converges. Next, we apply Theorem 2 to Q-learning and its variants, proving the convergence of these algorithms in the tabular case. For Q-learning, set $K = 1$ and $N = 1$ . Let $G ^ { Q } ( Q _ { s } ^ { - } ) = \operatorname* { m a x } _ { a \in A } Q _ { s a } ^ { - }$ . It is straightforward to check that Assumption 1 holds for function $G ^ { Q }$ . For Ensemble Q-learning, set $K = 1$ and set $N$ to be a positive integer. Let $G ^ { E Q } ( ( Q _ { s } ^ { 1 } , \dots , Q _ { s } ^ { N } ) ) =$ $\begin{array} { r } { \operatorname* { m a x } _ { a \in A } \frac { 1 } { N } \sum _ { i = 1 } ^ { N } Q _ { s a } ^ { i } } \end{array}$ . Easy to check that Assumption 1 is satisfied. For Averaged Q-learning, the proof is similar to Ensemble Q-learning except that $N = 1$ and $K$ is a positive integer. For Historical Best Q-learning, set $N = 1$ and $K$ to be a positive integer. We assume that all auxiliary action-value functions are selected from action-value functions at most $K$ updates ago. Define $G ^ { \tilde { H } B Q }$ to be the largest action-value among $Q _ { s a } ( t - 1 ) , \ldots , Q _ { s a } ( t - K )$ for state $s$ . Assumption 1 is satisfied and the convergence is guaranteed.
|
| 197 |
+
|
| 198 |
+
# 7 CONCLUSION
|
| 199 |
+
|
| 200 |
+
Overestimation bias is a byproduct of Q-learning, stemming from the selection of a maximal value to estimate the expected maximal value. In practice, overestimation bias leads to poor performance in a variety of settings. Though multiple Q-learning variants have been proposed, Maxmin Qlearning is the first solution that allows for a flexible control of bias, allowing for overestimation or underestimation determined by the choice of $N$ and the environment. We showed theoretically that we can decrease the estimation bias and the estimation variance by choosing an appropriate number $N$ of action-value functions. We empirically showed that advantages of Maxmin Q-learning, both on toy problems where we investigated the effect of reward noise and on several benchmark environments. Finally, we introduced a new Generalized Q-learning framework which we used to prove the convergence of Maxmin Q-learning as well as several other Q-learning variants that use $N$ action-value estimates.
|
| 201 |
+
|
| 202 |
+
# ACKNOWLEDGMENTS
|
| 203 |
+
|
| 204 |
+
We would like to thank Huizhen Yu and Yi Wan for their valuable feedback and helpful discussion.
|
| 205 |
+
|
| 206 |
+
REFERENCES
|
| 207 |
+
Oron Anschel, Nir Baram, and Nahum Shimkin. Averaged-DQN: Variance Reduction and Stabilization for Deep Reinforcement Learning. In International Conference on Machine Learning, pp. 176–185, 2017.
|
| 208 |
+
Dimitri P Bertsekas and John N Tsitsiklis. Parallel and Distributed Computation: Numerical Methods, volume 23. Prentice hall Englewood Cliffs, NJ, 1989.
|
| 209 |
+
Dimitri P Bertsekas and John N Tsitsiklis. Neuro-dynamic Programming, volume 5. Athena Scientific Belmont, MA, 1996.
|
| 210 |
+
Greg Brockman, Vicki Cheung, Ludwig Pettersson, Jonas Schneider, John Schulman, Jie Tang, and Wojciech Zaremba. OpenAI Gym. arXiv preprint arXiv:1606.01540, 2016.
|
| 211 |
+
Herbert Aron David and Haikady Navada Nagaraja. Order Statistics. Encyclopedia of Statistical Sciences, 2004.
|
| 212 |
+
Scott Fujimoto, Herke Hoof, and David Meger. Addressing function approximation error in actorcritic methods. In International Conference on Machine Learning, pp. 1587–1596, 2018.
|
| 213 |
+
Tuomas Haarnoja, Aurick Zhou, Pieter Abbeel, and Sergey Levine. Soft actor-critic: Offpolicy maximum entropy deep reinforcement learning with a stochastic actor. In International Conference on Machine Learning, pp. 1861–1870, 2018.
|
| 214 |
+
Hado Hado van Hasselt, Arthur Guez, and David Silver. Deep Reinforcement Learning with Double Q-learning. In AAAI Conference on Artificial Intelligence, 2016.
|
| 215 |
+
Donghun Lee, Boris Defourny, and Warren B. Powell. Bias-corrected Q-learning to Control Maxoperator Bias in Q-learning. In IEEE Symposium on Adaptive Dynamic Programming and Reinforcement Learning, pp. 93–99, 2013.
|
| 216 |
+
Francisco S Melo and M Isabel Ribeiro. Q-learning with Linear Function Approximation. In International Conference on Computational Learning Theory, pp. 308–322, 2007.
|
| 217 |
+
Alexander L. Strehl, Lihong Li, and Michael L. Littman. Reinforcement Learning in Finite MDPs: PAC Analysis. Journal of Machine Learning Research, 10(Nov):2413–2444, 2009.
|
| 218 |
+
Richard S Sutton and Andrew G Barto. Reinforcement Learning: An Introduction. MIT Press, second edition, 2018.
|
| 219 |
+
Istvan Szita and Andr ´ as L ´ orincz. The Many Faces of Optimism: A Unifying Approach. In ˝ International Conference on Machine learning, pp. 1048–1055. ACM, 2008.
|
| 220 |
+
Norman Tasfi. Pygame learning environment. https://github.com/ntasfi/ PyGame-Learning-Environment, 2016.
|
| 221 |
+
Sebastian Thrun and Anton Schwartz. Issues in Using Function Approximation for Reinforcement Learning. In Fourth Connectionist Models Summer School, 1993.
|
| 222 |
+
John N Tsitsiklis. Asynchronous Stochastic Approximation and Q-learning. Machine learning, 1994.
|
| 223 |
+
Hado van Hasselt. Double Q-learning. In Advances in Neural Information Processing Systems, pp. 2613–2621, 2010.
|
| 224 |
+
Chris Watkins. Learning from Delayed Rewards. PhD thesis, King’s College, Cambridge, 1989.
|
| 225 |
+
Kenny Young and Tian Tian. MinAtar: An Atari-inspired Testbed for More Efficient Reinforcement Learning Experiments. arXiv preprint arXiv:1903.03176, 2019.
|
| 226 |
+
Wenwu Yu, Rui Wang, Ruiying Li, Jing Gao, and Xiaohui Hu. Historical Best Q-Networks for Deep Reinforcement Learning. In International Conference on Tools with Artificial Intelligence, pp. 6–11, 2018.
|
| 227 |
+
Zongzhang Zhang, Zhiyuan Pan, and Mykel J. Kochenderfer. Weighted Double Q-learning. In International Joint Conference on Artificial Intelligence, pp. 3455–3461, 2017.
|
| 228 |
+
|
| 229 |
+
# A THE PROOF OF THEOREM 1
|
| 230 |
+
|
| 231 |
+
We first present Lemma 1 here as a tool to prove Theorem 1. Note that the first three properties in this lemma are well-known results of order statistics (David & Nagaraja, 2004).
|
| 232 |
+
|
| 233 |
+
Lemma 1 Let $X _ { 1 } , \ldots , X _ { N }$ be $N$ i.i.d. random variables from an absolutely continuous distribution with probability density function $P D F )$ $f ( x )$ and cumulative distribution function $( C D F )$ $F ( x )$ . Denote $\mu \ { \stackrel { \mathrm { d e f } } { = } } \ E [ X _ { i } ]$ and $\sigma ^ { 2 } \ { \stackrel { \mathrm { d e f } } { = } } \ V a r [ X _ { i } ] < + \infty .$ . Set $X _ { 1 : N } \ { \stackrel { \mathrm { d e f } } { = } } \ m i n _ { i \in \{ 1 , . . . , N \} } X _ { i }$ and $X _ { N : N } \ { \stackrel { \mathrm { d e t } } { = } }$ $m a x _ { i \in \{ 1 , . . . , N \} } X _ { i }$ . Denote the PDF and $C D F$ of $X _ { 1 : N }$ as $f _ { 1 : N } ( x )$ and $F _ { 1 : N } ( x )$ , respectively. Similarly, denote the PDF and CDF of $X _ { N : N }$ as $f _ { N : N } ( x )$ and $F _ { N : N } ( x )$ , respectively. We then have
|
| 234 |
+
|
| 235 |
+
(i) (N−1)σ √2n−1 ≤ E[X1:N ] ≤ µ and E[X1:N+1] ≤ E[X1:N ].
|
| 236 |
+
(ii) $F _ { 1 : N } ( x ) = 1 - ( 1 - F ( x ) ) ^ { N } . \ f _ { 1 : N } ( x ) = N f ( x ) ( 1 - F ( x ) ) ^ { N - 1 } .$
|
| 237 |
+
(iii) $F _ { N : N } ( x ) = ( F ( x ) ) ^ { N }$ . $f _ { N : N } ( x ) = N f ( x ) ( F ( x ) ) ^ { N - 1 } .$
|
| 238 |
+
(iv) If X1, . . . , XN ∼ U (−τ, τ ), we have V ar(X1:N ) = 4N τ2(N+1)2(N+2) and $V a r ( X _ { 1 : N + 1 } ) <$ $V a r ( X _ { 1 : N } ) \le V a r ( X _ { 1 : 1 } ) = \sigma ^ { 2 }$ for any positive integer $N$ .
|
| 239 |
+
|
| 240 |
+
# Proof.
|
| 241 |
+
|
| 242 |
+
(i) By the definition of $X _ { 1 : N }$ , we have $X _ { 1 : N + 1 } \le X _ { 1 : N }$ . Thus $E [ X _ { 1 : N + 1 } ] \leq E [ X _ { 1 : N } ]$ . Since $E [ X _ { 1 : 1 } ] = E [ X _ { 1 } ] = \mu$ , $E [ X _ { 1 : N } ] \leq E [ X _ { 1 : 1 } ] = \mu$ . The proof of $\begin{array} { r } { \mu - \frac { ( N - 1 ) \sigma } { \sqrt { 2 N - 1 } } \leq E [ X _ { 1 : N } ] } \end{array}$ can be found in (David & Nagaraja, 2004, Chapter 4 Section 4.2).
|
| 243 |
+
|
| 244 |
+
(ii) We first consider the cdf of $X _ { 1 : N }$ . $F _ { 1 : N } ( x ) : = P ( X _ { 1 : N } \leq x ) = 1 - P ( X _ { 1 : N } > x ) =$ $1 - P ( X _ { 1 } > x , \ldots , X _ { M } > x ) = 1 - P ( X _ { 1 } > x ) \cdots P ( X _ { N } > x ) =$ 1 − (1 − F (x))N . Then the pdf of $X _ { 1 : N }$ is $\begin{array} { r } { f _ { 1 : N } ( x ) : = \frac { d F _ { 1 : N } } { d x } = N f ( x ) ( 1 - F ( x ) ) ^ { N - 1 } } \end{array}$ .
|
| 245 |
+
|
| 246 |
+
(iii) Similar to (ii), we first consider cdf of $X _ { N : N }$ . $F _ { N : N } ( x ) : = P ( X _ { N : N } \leq x ) = P ( X _ { 1 } \leq$ $x , \ldots , X _ { N } \leq x ) = P ( X _ { 1 } \leq x ) \cdot \cdot \cdot P ( X _ { M } \leq x ) = ( { \dot { F } } ( x ) ) ^ { N }$ . Then the pdf of $X _ { N : N }$ is $\begin{array} { r } { f _ { N : N } ( x ) : = \frac { d F _ { N : N } } { d x } = N f ( x ) ( F ( x ) ) ^ { N - 1 } } \end{array}$ .
|
| 247 |
+
|
| 248 |
+
(iv) Since $X _ { 1 , . . . , X _ { N } } \sim U n i f o r m ( - \tau , \tau )$ , we have $\begin{array} { r } { F ( x ) \ = \ \frac { 1 } { 2 } + \ \frac { x } { 2 \tau } } \end{array}$ and $\begin{array} { r } { f ( x ) \ = \ \frac { 1 } { 2 \tau } } \end{array}$ V ar(X1:N ) = E[X1:N 2] − E[X1:N ]2 = 4τ 2( 2(N+1)(N+2) − 1(N+1)2 ) = 4nτ2(N+1)2(N+2) . It is easy to check that $V a r ( X _ { 1 : N + 1 } ) < V a r ( X _ { 1 : N } ) \leq V a r ( X _ { 1 : 1 } ) = \sigma ^ { 2 } \mathrm { ~ f ~ }$ or any positive integer $N$ .
|
| 249 |
+
|
| 250 |
+
Next, we prove Theorem 1.
|
| 251 |
+
|
| 252 |
+
Proof. Let $f ( x )$ and $F ( x )$ be the cdf and pdf of $e _ { s a }$ , respectively. Similarly, Let $f _ { N } ( x )$ and $F _ { N } ( x )$ be the cdf and pdf of $\mathrm { { m i n } } _ { i \in \{ 1 , . . . , N \} } e _ { s a } ^ { i }$ . Since $e _ { s a }$ is sampled from $U n i f o r m ( - \tau , \tau )$ , it is easy to get $\begin{array} { r } { f ( x ) = \frac { 1 } { 2 \tau } } \end{array}$ and $\begin{array} { r } { F ( x ) = \frac { 1 } { 2 } + \frac { x } { 2 \tau } } \end{array}$ . By Lemma 1, we have $f _ { N } ( x ) = N f ( x ) [ 1 - F ( x ) ] ^ { N - 1 } =$ $\begin{array} { r } { \frac { N } { 2 \tau } ( \frac { 1 } { 2 } - \frac { x } { 2 \tau } ) ^ { N - 1 } } \end{array}$ and $\begin{array} { r } { F _ { N } ( x ) = 1 - ( 1 - F ( x ) ) ^ { N } = 1 - ( \frac { 1 } { 2 } - \frac { x } { 2 \tau } ) ^ { N } } \end{array}$ . The expectation of $Z _ { M N }$ is
|
| 253 |
+
|
| 254 |
+
$$
|
| 255 |
+
\begin{array} { r l } { E [ Z _ { M N } ] = \gamma \mathbb { E } [ \operatorname* { m a x } _ { 0 } ^ { \alpha } \frac { W ^ { 2 } w ^ { 2 } } { \alpha ^ { 3 } } - \operatorname* { m a x } \mathcal { Q } _ { s e } ^ { \alpha } \mathcal { Q } _ { s e } ^ { 2 } ] \mathbb { I } } \\ { = \gamma E [ \operatorname* { m a x } _ { 0 } ^ { \alpha } \cdot \operatorname* { m i n } _ { \alpha ^ { 3 } } ^ { \alpha } ] } \\ { = \gamma \int _ { - 1 } ^ { \infty } M r f _ { N } ( x ) P r ( x ) ^ { M - 1 } d x } \\ { = \gamma \int _ { - 1 } ^ { \infty } M r f _ { N } x ^ { \alpha } \Gamma _ { 0 } ^ { 1 } \sum _ { \underline { { \tau } } ^ { \prime } } ^ { \alpha } N ^ { - 1 } \mathbb { I } [ - ( \frac { 1 } { 2 } - \frac { x } { 2 \tau } ) ^ { N } ] ^ { M - 1 } d x } \\ { = \gamma \int _ { - 1 } ^ { \infty } \alpha H [ - ( \frac { 1 } { 2 } - \frac { x } { 2 \tau } ) ^ { N } ] ^ { M } } \\ { = \gamma \tau - \gamma \int _ { - 1 } ^ { \infty } [ 1 - ( \frac { 1 } { 2 } - \frac { x } { 2 \tau } ) ^ { N } ] ^ { M } d x } \\ { = \gamma \tau [ 1 - 2 \int _ { 0 } ^ { 1 } ( 1 - \gamma ^ { N } ) ^ { M } d y ] \quad \scriptstyle ( y = \frac { 1 } { 2 } - \frac { x } { 2 \tau } ) } \end{array}
|
| 256 |
+
$$
|
| 257 |
+
|
| 258 |
+
Let $\begin{array} { r } { t _ { M N } = \int _ { 0 } ^ { 1 } ( 1 - y ^ { N } ) ^ { M } d y } \end{array}$ , so that $E [ Z _ { M N } ] = \gamma \tau [ 1 - 2 t _ { M N } ]$ . Substitute $y$ by $t$ where $t = y ^ { N }$ , then
|
| 259 |
+
|
| 260 |
+
$$
|
| 261 |
+
\begin{array} { l } { { t _ { M N } = \displaystyle \frac { 1 } { N } \int _ { 0 } ^ { 1 } t ^ { \frac { 1 } { N } - 1 } ( 1 - t ) ^ { M } d t } } \\ { { \ } } \\ { { \ } } \\ { { \displaystyle = \frac { 1 } { N } \beta ( \frac { 1 } { N } , M + 1 ) } } \\ { { \ } } \\ { { \displaystyle = \frac { 1 } { N } \frac { \Gamma ( M + 1 ) \Gamma ( \frac { 1 } { N } ) } { \Gamma ( M + \frac { 1 } { N } + 1 ) } } } \\ { { \ } } \\ { { \displaystyle = \frac { \Gamma ( M + 1 ) \Gamma ( 1 + \frac { 1 } { N } ) } { \Gamma ( M + \frac { 1 } { N } + 1 ) } } } \\ { { \ } } \\ { { \displaystyle = \frac { M ( M - 1 ) \cdot \cdot \cdot 1 } { ( M + \frac { 1 } { N } ) ( M - 1 + \frac { 1 } { N } ) \cdot \cdot \cdot ( 1 + \frac { 1 } { N } ) } } } \end{array}
|
| 262 |
+
$$
|
| 263 |
+
|
| 264 |
+
Each term in the denominator decreases as $N$ increases, because $1 / N$ gets smaller. Therefore, tM,N=1 = 1M+1 and $t _ { M , N \to \infty } = 1$ . Using this, we conclude that $E [ Z _ { M N } ]$ decreases as $N$ increases and $\begin{array} { r } { E [ Z _ { M , N = 1 } ] = \gamma \tau _ { M + 1 } ^ { M - 1 } } \end{array}$ and $E [ Z _ { M , N \infty } ] = - \gamma \tau$ .
|
| 265 |
+
|
| 266 |
+
$Q _ { s a } ^ { m i n }$
|
| 267 |
+
|
| 268 |
+
$$
|
| 269 |
+
V a r [ Q _ { s a } ^ { m i n } ] = \frac { 4 N \tau ^ { 2 } } { ( N + 1 ) ^ { 2 } ( N + 2 ) }
|
| 270 |
+
$$
|
| 271 |
+
|
| 272 |
+
$V a r [ Q _ { s a } ^ { m i n } ]$ decreases as $N$ increases. In particular, $\begin{array} { r } { V a r [ Q _ { s a } ^ { m i n } ] = \frac { \tau ^ { 2 } } { 3 } } \end{array}$ for $N = 1$ and $V a r [ Q _ { s a } ^ { m i n } ] =$ 0 for $N \to \infty$ .
|
| 273 |
+
|
| 274 |
+
The bias-variance trade-off of Maxmin Q-learning is illustrated by the empirical results in Figure 5, which support Theorem 1. For each $M$ , $N$ can be selected such that the absolute value of the expected estimation bias is close to 0 according to Theorem 1. As $M$ increases, we can adjust $N$ to reduce both the estimation variance and the estimation bias.
|
| 275 |
+
|
| 276 |
+
Finally, we prove the result of the Corollary.
|
| 277 |
+
|
| 278 |
+
Corollary 1 Assuming the $ { n _ { s a } }$ samples are evenly allocated amongst the $N$ estimators, then $\tau =$ $\sqrt { 3 \sigma ^ { 2 } N / n _ { s a } }$ where $\sigma ^ { 2 }$ is the variance of samples for $( s , a )$ and, for $Q _ { s a }$ the estimator that uses all $ { n _ { s a } }$ samples for a single estimate,
|
| 279 |
+
|
| 280 |
+
$$
|
| 281 |
+
V a r [ Q _ { s a } ^ { m i n } ] = \frac { 1 2 N ^ { 2 } } { ( N + 1 ) ^ { 2 } ( N + 2 ) } V a r [ Q _ { s a } ] .
|
| 282 |
+
$$
|
| 283 |
+
|
| 284 |
+
Under this uniform random noise assumption, for $N \geq 8$ , $V a r [ Q _ { s a } ^ { m i n } ] < V a r [ Q _ { s a } ]$ .
|
| 285 |
+
|
| 286 |
+

|
| 287 |
+
Figure 5: Empirical results of Theorem 1. $M$ is the number of available actions for some state $s$ . $N$ is the number of action-value functions in Maxmin Q-learning. In Figure 5 $( a )$ , we show a heat map of bias control in Maxmin Q-learning. In Figure 5 $( b )$ , we show how the variance ratio of $Q _ { s a } ^ { m i n }$ and $Q _ { s a }$ (i.e. $V a r [ Q _ { s a } ^ { m i n } ] / V a r [ Q _ { s a } ] )$ reduces as increases. For a better comparison, we set $\gamma \tau = 1$ .
|
| 288 |
+
|
| 289 |
+
Proof. Because $Q _ { s a } ^ { i }$ is a sample mean, its variance is $\sigma ^ { 2 } N / n _ { s a }$ where $\sigma ^ { 2 }$ is the variance of samples for $( s , a )$ and its mean is $Q _ { s a } ^ { * }$ (because it is an unbiased sample average). Consequently, $e _ { s a }$ has mean zero and variance $\sigma ^ { 2 } N / n _ { s a }$ . Because $e _ { s a }$ is a uniform random variable which has variance ${ \scriptstyle { \frac { 1 } { 3 } } } \tau ^ { 2 }$ , we know that $\tau = \sqrt { 3 \sigma ^ { 2 } N / n _ { s a } }$ . Plugging this value into the variance formula in Theorem 1, we get that
|
| 290 |
+
|
| 291 |
+
$$
|
| 292 |
+
\begin{array} { c } { { V a r [ Q _ { s a } ^ { m i n } ] = \displaystyle \frac { 4 N \tau ^ { 2 } } { ( N + 1 ) ^ { 2 } ( N + 2 ) } } } \\ { { = \displaystyle \frac { 1 2 N ^ { 2 } \sigma ^ { 2 } / n _ { s a } } { ( N + 1 ) ^ { 2 } ( N + 2 ) } } } \\ { { = \displaystyle \frac { 1 2 N ^ { 2 } } { ( N + 1 ) ^ { 2 } ( N + 2 ) } V a r [ Q _ { s a } ] } } \end{array}
|
| 293 |
+
$$
|
| 294 |
+
|
| 295 |
+
because $V a r [ Q _ { s a } ] = \sigma ^ { 2 } / n _ { s a }$ for the sample average $Q _ { s a }$ that uses all the samples for one estimator.
|
| 296 |
+
Easy to verify that for $N \geq 8$ , $V a r [ Q _ { s a } ^ { m i n } ] < V a r [ Q _ { s a } ]$ .
|
| 297 |
+
|
| 298 |
+
# B THE CONVERGENCE PROOF OF GENERALIZED Q-LEARNING
|
| 299 |
+
|
| 300 |
+
The convergence proof of Generalized Q-learning is based on Tsitsiklis (1994). The key steps to use this result for Generalized Q-learning include showing that the operator is a contraction and verifying the noise conditions. We first show these two steps in Lemma 2 and Lemma 3. We then use these lemmas to make the standard argument for convergence.
|
| 301 |
+
|
| 302 |
+
# B.1 PROBLEM SETTING FOR GENERALIZED Q-LEARNING
|
| 303 |
+
|
| 304 |
+
Consider a Markov decision problem defined on a finite state space $s$ . For every state $s \in S$ , there is a finite set $\mathcal { A }$ of possible actions for state $s$ and a set of non-negative scalars $p _ { s s ^ { \prime } } ( a )$ , $a \in { \mathcal { A } }$ , $s ^ { \prime } \in \mathcal { S }$ , such that $\begin{array} { r } { \sum _ { j \in S } p _ { s s ^ { \prime } } ( a ) = 1 } \end{array}$ for all $a \in { \mathcal { A } }$ . The scalar $p _ { s s ^ { \prime } } ( a )$ is interpreted as the probability of a transition to $s ^ { \prime }$ , given that the current state is $s$ and action $a$ is applied. Furthermore, for every state $s$ and action $a$ , there is a random variable $r _ { s a }$ which represents the reward if action $a$ is applied at state $s$ . We assume that the variance of $r _ { s a }$ is finite for every $s$ and $a \in { \mathcal { A } }$ .
|
| 305 |
+
|
| 306 |
+
A stationary policy is a function $\pi$ defined on $s$ such that $\pi ( s ) \in { \mathcal { A } }$ for all $s \in S$ . Given a stationary policy, we obtain a discrete-time Markov chain $f ^ { \pi } ( t )$ with transition probabilities
|
| 307 |
+
|
| 308 |
+
$$
|
| 309 |
+
\operatorname* { P r } ( f ^ { \pi } ( t + 1 ) = s ^ { \prime } | f ^ { \pi } ( t ) = s ) = p _ { s s ^ { \prime } } ( \pi ( s ) )
|
| 310 |
+
$$
|
| 311 |
+
|
| 312 |
+
Let $\gamma \in [ 0 , 1 ]$ be a discount factor. For any stationary policy $\pi$ and initial state $s$ , the state value $V _ { s } ^ { \pi }$ is defined by
|
| 313 |
+
|
| 314 |
+
$$
|
| 315 |
+
V _ { s } ^ { \pi } = \operatorname* { l i m } _ { T \to \infty } E [ \sum _ { t = 0 } ^ { T } \gamma ^ { t } r _ { f ^ { \pi } ( t ) , \pi ( f ^ { \pi } ( t ) ) } | f ^ { \pi } ( 0 ) = s ]
|
| 316 |
+
$$
|
| 317 |
+
|
| 318 |
+
The optimal state value function $V ^ { * }$ is defined by
|
| 319 |
+
|
| 320 |
+
$$
|
| 321 |
+
V _ { s } ^ { \ast } = \operatorname* { s u p } _ { \pi } V _ { s } ^ { \pi } , \quad s \in S
|
| 322 |
+
$$
|
| 323 |
+
|
| 324 |
+
The Markov decision problem is to evaluate the function $V ^ { * }$ . Once this is done, an optimal policy is easily determined.
|
| 325 |
+
|
| 326 |
+
Markov decision problems are easiest when the discount $\gamma$ is strictly smaller than 1. For the undiscounted case $( \gamma = 1 )$ ), we will assume throughout that there is a reward-free state, say state 1, which is absorbing; that is, $p _ { 1 1 } ( a ) = 1$ and $r _ { 1 u } = 0$ for all $a \in { \mathcal { A } }$ . The objective is then to reach that state at maximum expected reward. We say that a stationary policy is proper if the probability of being at the absorbing state converges to 1 as time converges to infinity; otherwise, we say that the policy is improper.
|
| 327 |
+
|
| 328 |
+
We define the dynamic programming operator $T : \mathbb { R } ^ { | s | } \mapsto \mathbb { R } ^ { | s | }$ , with components $T _ { i }$ , by letting
|
| 329 |
+
|
| 330 |
+
$$
|
| 331 |
+
T _ { s } ( V ) = \operatorname* { m a x } _ { a \in \mathcal { A } } \{ E [ r _ { s a } ] + \gamma \sum _ { s ^ { \prime } \in \mathcal { S } } p _ { s s ^ { \prime } } ( a ) V _ { s ^ { \prime } } \}
|
| 332 |
+
$$
|
| 333 |
+
|
| 334 |
+
It is well known that if $\gamma < 1$ , then $T$ is a contraction with respect to the norm $\| \cdot \| _ { \infty }$ and $V ^ { * }$ is its unique fixed point.
|
| 335 |
+
|
| 336 |
+
For Generalized Q-learning algorithm, assume that there are $N$ estimators of action-values $Q ^ { 1 } , \ldots , Q ^ { N }$ . Let $m$ be the cardinality of $s$ and $n$ be the cardinality of $\mathcal { A }$ . We use a discrete index variable $t$ in order to count iterations. Denote $Q ^ { i j } ( t ) = Q ^ { i } ( t + j )$ . After $t$ iterations, we have a vector $Q ( t ) \in \mathbb { R } ^ { w }$ and $w = m n N K$ , with components $Q _ { s a } ^ { i j } ( t ) , ( s , a ) \in \mathcal { S } \times \mathcal { A } , i \in \{ 1 , \dots , N \}$ , and $j \in \{ 0 , \ldots , K - 1 \}$ .
|
| 337 |
+
|
| 338 |
+
By definition, for $j \in \{ 1 , \dots , K - 1 \}$ , we have
|
| 339 |
+
|
| 340 |
+
$$
|
| 341 |
+
Q _ { s a } ^ { i j } ( t + 1 ) = Q _ { s a } ^ { i , j - 1 } ( t ) .
|
| 342 |
+
$$
|
| 343 |
+
|
| 344 |
+
$j = 0$ , we have $Q _ { s a } ^ { i 0 } = Q _ { s a } ^ { i }$ . And we update according to the formula
|
| 345 |
+
|
| 346 |
+
$$
|
| 347 |
+
Q _ { s a } ^ { i } ( t + 1 ) = Q _ { s a } ^ { i } ( t ) + \alpha _ { s a } ^ { i } ( t ) [ Y ^ { G Q } ( t ) - Q _ { s a } ^ { i } ( t ) ]
|
| 348 |
+
$$
|
| 349 |
+
|
| 350 |
+
where
|
| 351 |
+
|
| 352 |
+
$$
|
| 353 |
+
Y ^ { G Q } ( t ) = r _ { s a } + \gamma Q _ { f ( s , a ) } ^ { G Q } ( t ) .
|
| 354 |
+
$$
|
| 355 |
+
|
| 356 |
+
Here, each $\alpha _ { s a } ^ { i } ( t )$ is a nonnegative step-size coefficient which is set to zero for those $( s , a ) \in \mathcal { S } \times \mathcal { A }$ and $i \in \{ 1 , \ldots , N \}$ for which $Q _ { s a } ^ { i }$ is not to be updated at the current iteration. Furthermore, $r _ { s a }$ is a random sample of the immediate reward if action $a$ is applied at state $s$ . $f ( s , a )$ is a random successor state which is equal to $s ^ { \prime }$ with probability $p _ { s s ^ { \prime } } ( a )$ . Finally, $Q _ { s } ^ { G Q } ( t )$ is defined as
|
| 357 |
+
|
| 358 |
+
$$
|
| 359 |
+
Q _ { s } ^ { G Q } ( t ) = G ( Q _ { s } ( t ) )
|
| 360 |
+
$$
|
| 361 |
+
|
| 362 |
+
where $G$ is a mapping from $\mathbb { R } ^ { n N K }$ to $\mathbb { R }$ . It is understood that all random samples that are drawn in the course of the algorithm are drawn independently.
|
| 363 |
+
|
| 364 |
+
Since for $j \in \{ 1 , \dots , K - 1 \}$ , we just preserve current available action-values, we only focus on the case that $j = 0$ in the sequel. Let $F$ be the mapping from $\mathbb { R } ^ { m n N K }$ into $\mathbb { R } ^ { m n N }$ with components $F _ { s a } ^ { i }$ defined by
|
| 365 |
+
|
| 366 |
+
$$
|
| 367 |
+
F _ { s a } ^ { i } ( Q ) = E [ r _ { s a } ] + \gamma E [ Q _ { f ( s , a ) } ^ { G Q } ]
|
| 368 |
+
$$
|
| 369 |
+
|
| 370 |
+
and note that
|
| 371 |
+
|
| 372 |
+
$$
|
| 373 |
+
E [ Q _ { s } ^ { G Q } ] = \sum _ { s ^ { \prime } \in \cal S } p _ { s s ^ { \prime } } ( a ) Q _ { s ^ { \prime } } ^ { G Q }
|
| 374 |
+
$$
|
| 375 |
+
|
| 376 |
+
If $F _ { s a } ^ { i } ( Q ( t ) ) = Q ( t ) _ { s a } ^ { i }$ , we can do $K$ more updates such that $Q ( t ) _ { a } ^ { i j } = Q ( t ) _ { a } ^ { k l } , \forall i , k \in \{ 1 , \dots , N \}$ , $\forall j , l \in \{ 0 , \ldots , K - 1 \}$ , and $\forall a \in { \mathcal { A } }$ .
|
| 377 |
+
|
| 378 |
+
In view of Equation 13, Equation 10 can be written as
|
| 379 |
+
|
| 380 |
+
$$
|
| 381 |
+
Q _ { s a } ^ { i } ( t + 1 ) = Q _ { s a } ^ { i } ( t ) + \alpha _ { s a } ^ { i } ( t ) [ F _ { s a } ^ { i } ( Q ( t ) ) - Q _ { s a } ^ { i } ( t ) + w _ { s a } ^ { i } ( t ) ]
|
| 382 |
+
$$
|
| 383 |
+
|
| 384 |
+
where
|
| 385 |
+
|
| 386 |
+
$$
|
| 387 |
+
w _ { s a } ^ { i } ( t ) = r _ { s a } - E [ r _ { s a } ] + \gamma ( Q _ { f ( s , a ) } ^ { G Q } ( t ) - E [ Q _ { f ( s , a ) } ^ { G Q } ( t ) | \mathcal { F } ( t ) ] )
|
| 388 |
+
$$
|
| 389 |
+
|
| 390 |
+
and $\mathcal { F } ( t )$ represents the history of the algorithm during the first $t$ iterations. The expectation in the expression $E [ Q _ { f ( s , a ) } ^ { G Q } ( t ) | \mathcal { F } ( t ) ]$ is with respect to $f ( s , a )$ .
|
| 391 |
+
|
| 392 |
+
# B.2 KEY LEMMAS AND THE PROOFS
|
| 393 |
+
|
| 394 |
+
Lemma 2 Assume Assumption 1 holds for function $G$ in Generalized $Q$ -learning. Then we have
|
| 395 |
+
|
| 396 |
+
$$
|
| 397 |
+
E [ w _ { s a } ^ { 2 } ( t ) | \mathcal { F } ( t ) ] \leq V a r ( r _ { s a } ) + \operatorname* { m a x } _ { i \in \{ 1 , \ldots , N \} } \operatorname* { m a x } _ { \tau \leq t } \operatorname* { m a x } _ { ( s , a ) \in S \times \mathcal { A } } \big | Q _ { s a } ^ { i } ( \tau ) \big | ^ { 2 } .
|
| 398 |
+
$$
|
| 399 |
+
|
| 400 |
+
Proof. Under Assumption 1, the conditional variance of $Q _ { f ( s , a ) } ^ { G Q }$ given $\mathcal { F } ( t )$ , is bounded $\begin{array} { r } { \operatorname* { m a x } _ { i \in \{ 1 , \dots , N \} } \operatorname* { m a x } _ { j \in \{ 0 , \dots , K - 1 \} } \operatorname* { m a x } _ { ( s , a ) \in S \times \mathcal { A } } \left| Q _ { s a } ^ { i } ( t - j ) \right| ^ { 2 } } \end{array}$ . We then take the conditional variance of both sides of Equation 16, to obtain
|
| 401 |
+
|
| 402 |
+
$$
|
| 403 |
+
E [ w _ { s a } ^ { 2 } ( t ) | \mathcal { F } ( t ) ] \leq V a r ( r _ { s a } ) + \operatorname* { m a x } _ { i \in \{ 1 , \ldots , N \} } \operatorname* { m a x } _ { \tau \leq t } \operatorname* { m a x } _ { ( s , a ) \in \mathcal { S } \times \mathcal { A } } \left| Q _ { s a } ^ { i } ( \tau ) \right| ^ { 2 }
|
| 404 |
+
$$
|
| 405 |
+
|
| 406 |
+
We have assumed here that $r _ { s a }$ is independent from $f ( s , a )$ . If it is not, the right-hand side in the last inequality must be multiplied by 2, but the conclusion does not change.
|
| 407 |
+
|
| 408 |
+
Lemma 3 $F$ is a contraction mapping, in each of the following cases:
|
| 409 |
+
|
| 410 |
+
(i) $\gamma < 1$ .
|
| 411 |
+
(ii) $\gamma = 1$ and $\forall a \in \mathcal { A } , Q _ { s _ { 1 } a } ^ { i } ( t = 0 ) = 0$ where $s _ { 1 }$ is an absorbing state. All policies are proper.
|
| 412 |
+
|
| 413 |
+
Proof. For discounted problems $( \gamma < 1 )$ ), Equation 13 easily yields $\forall Q , Q ^ { \prime }$ ,
|
| 414 |
+
|
| 415 |
+
$$
|
| 416 |
+
| F _ { s a } ^ { i } ( Q ) - F _ { s a } ^ { i } ( Q ^ { \prime } ) | \leq \gamma \operatorname* { m a x } _ { s \in S } | Q _ { s } ^ { G Q } - Q _ { s } ^ { \prime \ G Q } |
|
| 417 |
+
$$
|
| 418 |
+
|
| 419 |
+
In particular, $F$ is a contraction mapping, with respect to the maximum norm $\| \cdot \| _ { \infty }$ .
|
| 420 |
+
|
| 421 |
+
For undiscounted problems $( \gamma = 1 )$ ), our assumptions on the absorbing state $s _ { 1 }$ imply that the update equation for $Q _ { s _ { 1 } a } ^ { i }$ degenerates to $Q _ { s _ { 1 } a } ^ { i } ( t { + } 1 ) = \stackrel { \textstyle \cdot } { Q } _ { s _ { 1 } a } ^ { i } ( t )$ , for all $t$ . We will be assuming in the sequel, that $Q _ { s _ { 1 } a } ^ { i }$ is initialized at zero. This leads to an equivalent description of the algorithm in which the mappings $F _ { s a } ^ { i }$ of Equation 13 are replaced by mappings $\tilde { F } _ { s a } ^ { i }$ satisfying $\tilde { F } _ { s a } ^ { i } = F _ { s a } ^ { i }$ if $s \neq s _ { 1 }$ and $\tilde { F } _ { s _ { 1 } a } ^ { i } ( Q ) = 0$ for all $a \in { \mathcal { A } }$ , $i \in \{ 1 , \ldots , N \}$ and $Q \in \mathbb { R } ^ { n }$ .
|
| 422 |
+
|
| 423 |
+
Let us consider the special case where every policy is proper. By Proposition 2.2 in the work of (Bertsekas & Tsitsiklis, 1996), there exists a vector $v > 0$ such that $T$ is a contraction with respect to the norm $\| \cdot \| _ { v }$ . In fact, a close examination of the proof of this Proposition 2.2 shows that this proof is easily extended to show that the mapping $\tilde { F }$ (with components $\tilde { F } _ { s a } ^ { i } )$ is a contraction with respect to the norm $\| \cdot \| _ { z }$ , where $z _ { s a } ^ { i } = v _ { s }$ for every $a \in { \mathcal { A } }$ and $i \in \{ 1 , \ldots , N \}$ .
|
| 424 |
+
|
| 425 |
+
In this section, we describe the algorithmic model to be employed and state some assumptions that will be imposed.
|
| 426 |
+
|
| 427 |
+
The algorithm consists of noisy updates of a vector $\boldsymbol { x } ~ \in ~ \mathbb { R } ^ { n }$ , for the purpose of solving a system of equations of the form $F ( x ) = x$ . Here $F$ is assumed to be a mapping from $\mathbb { R } ^ { n }$ into itself. Let $F _ { 1 } , \ldots , F _ { n }$ : $\mathbb { R } ^ { n } \mapsto \mathbb { R }$ be the corresponding component mappings; that is, $F ( x ) =$ $( F _ { 1 } ( x ) , \ldots , F _ { n } ( x ) )$ for all $x \in \mathbb { R } ^ { n }$ .
|
| 428 |
+
|
| 429 |
+
Let $\mathcal { N }$ be the set of non-negative integers. We employ a discrete ”time” variable $t$ , taking values in $\mathcal { N }$ . This variable need not have any relation with real time; rather, it is used to index successive updates. Let $x ( t )$ be the value of the vector $x$ at time $t$ and let $x _ { i } ( t )$ denote its $i$ th component. Let $\hat { T ^ { i } }$ be an infinite subset of $\mathcal { N }$ indicating the set of times at which an update of $x _ { i }$ is performed. We assume that
|
| 430 |
+
|
| 431 |
+
$$
|
| 432 |
+
x _ { i } ( t + 1 ) = x _ { i } ( t ) , \quad t \notin T ^ { i }
|
| 433 |
+
$$
|
| 434 |
+
|
| 435 |
+
Regarding the times that $x _ { i }$ is updated, we postulate an update equation of the form
|
| 436 |
+
|
| 437 |
+
$$
|
| 438 |
+
x _ { i } ( t + 1 ) = x _ { i } ( t ) + \alpha _ { i } ( t ) ( F _ { i } ( x ^ { i } ( t ) ) - x _ { i } ( t ) + w _ { i } ( t ) ) , \quad t \in T ^ { i }
|
| 439 |
+
$$
|
| 440 |
+
|
| 441 |
+
Here, $\alpha ( t )$ is a step-size parameter belonging to $[ 0 , 1 ]$ , $w _ { i } ( t )$ is a noise term, and $x _ { i } ( t )$ is a vector of possibly outdated components of $x$ . In particular, we assume that
|
| 442 |
+
|
| 443 |
+
$$
|
| 444 |
+
x ^ { i } ( t ) = ( x _ { 1 } ( \tau _ { 1 } ^ { i } ( t ) ) , \dots , x _ { n } ( \tau _ { n } ^ { i } ( t ) ) ) , \quad t \in T ^ { i }
|
| 445 |
+
$$
|
| 446 |
+
|
| 447 |
+
where each $\tau _ { j } ^ { i } ( t )$ is an integer satisfying $0 \leq \tau _ { j } ^ { i } ( t ) \leq t$ . If no information is outdated, we have $\tau _ { j } ^ { i } ( t ) = t$ and $x ^ { i } ( t ) = x ( t )$ for all $t$ ; the reader may wish to think primarily of this case. For an interpretation of the general case, see (Bertsekas $\&$ Tsitsiklis, 1989). In order to bring Eqs. 19 and 20 into a unified form, it is convenient to assume that $\alpha _ { i } ( t ) , w _ { i } ( t )$ , and $\tau _ { j } ^ { i } ( t )$ are defined for every $i$ , $j$ , and $t$ , but that $\alpha _ { i } ( t ) = 0$ and $\tau _ { j } ^ { i } ( t ) = t$ for $t \not \in T ^ { i }$ .
|
| 448 |
+
|
| 449 |
+
We will now continue with our assumptions. All variables introduced so far $( x ( t ) , \tau _ { j } ^ { i } ( t ) , \alpha _ { i } ( t ) , w _ { i } ( t ) )$ are viewed as random variables defined on a probability space $( \Omega , { \mathcal { F } } , { \mathcal { P } } )$ and the assumptions deal primarily with the dependencies between these random variables. Our assumptions also involve an increasing sequence $\{ \mathcal { F } ( t ) \} _ { t = 0 } ^ { \infty }$ of subfields of $\mathcal { F }$ . Intuitively, $\mathcal { F } ( t )$ is meant to represent the history of the algorithm up to, and including the point at which the step-sizes $\alpha _ { i } ( t )$ for the tth iteration are selected, but just before the noise term $w _ { i } ( t )$ is generated. Also, the measure-theoretic terminology that ”a random variable $Z$ is $\mathcal { F } ( t )$ -measurable” has the intuitive meaning that $Z$ is completely determined by the history represented by $\mathcal { F } ( t )$ .
|
| 450 |
+
|
| 451 |
+
The first assumption, which is the same as the total asynchronism assumption of Bertsekas & Tsitsiklis (1989), guarantees that even though information can be outdated, any old information is eventually discarded.
|
| 452 |
+
|
| 453 |
+
Assumption 3 For any $i$ and $j$ , $\begin{array} { r } { \operatorname* { l i m } _ { t \infty } \tau _ { j } ^ { i } ( t ) = \infty } \end{array}$ , with probability 1.
|
| 454 |
+
|
| 455 |
+
Our next assumption refers to the statistics of the random variables involved in the algorithm.
|
| 456 |
+
|
| 457 |
+
Assumption 4 Let $\{ \mathcal { F } ( t ) \} _ { t = 0 } ^ { \infty }$ be an increasing sequence of subfields of $\mathcal { F }$ .
|
| 458 |
+
|
| 459 |
+
(i) $x ( 0 )$ is $\mathcal { F } ( 0 )$ -measurable.
|
| 460 |
+
|
| 461 |
+
(ii) For every $i$ and t, $w _ { i } ( t )$ is $\mathcal { F } ( t + 1 )$ -measurable.
|
| 462 |
+
|
| 463 |
+
(iii) For every i, $j$ and $t$ , $\alpha _ { i } ( t )$ and $\tau _ { j } ^ { i } ( t )$ are $\mathcal { F } ( t )$ -measurable.
|
| 464 |
+
|
| 465 |
+
(iv) For every $i$ and $t$ , we have $E [ w _ { i } ( t ) | \mathcal { F } ( t ) ] = 0 .$ .
|
| 466 |
+
|
| 467 |
+
(v) There exist (deterministic) constants $A$ and $B$ such that
|
| 468 |
+
|
| 469 |
+
$$
|
| 470 |
+
E [ w _ { i } ^ { 2 } ( t ) | \mathcal { F } ( t ) ] \leq A + B \operatorname* { m a x } _ { j } \operatorname* { m a x } _ { \tau \leq t } | x _ { j } ( \tau ) | ^ { 2 } , \quad \forall i , t
|
| 471 |
+
$$
|
| 472 |
+
|
| 473 |
+
Assumption 4 allows for the possibility of deciding whether to update a particular component $x _ { i }$ at time $t$ , based on the past history of the process. In this case, the step-size $\alpha _ { i } ( t )$ becomes a random variable. However, part $( i i i )$ of the assumption requires that the choice of the components to be updated must be made without anticipatory knowledge of the noise variables $w _ { i }$ that have not yet been realized.
|
| 474 |
+
|
| 475 |
+
Finally, we introduce a few alternative assumptions on the structure of the iteration mapping $F$ . We first need some notation: if $x , y \in \mathbb { R } ^ { n }$ , the inequality $x \leq y$ is to be interpreted as $x _ { i } \le y _ { i }$ for all $i$ . Furthermore, for any positive vector $v = ( v _ { 1 } , \ldots , v _ { n } )$ , we define a norm $\| \cdot \| _ { v }$ on $\mathbb { R } ^ { n }$ by letting
|
| 476 |
+
|
| 477 |
+
$$
|
| 478 |
+
\| x \| _ { v } = \operatorname* { m a x } _ { i } { \frac { | x _ { i } | } { v _ { i } } } , \quad x \in \mathbb { R } ^ { n }
|
| 479 |
+
$$
|
| 480 |
+
|
| 481 |
+
Notice that in the special case where all components of $v$ are equal to 1, $\| \cdot \| _ { v }$ is the same as the maximum norm $\| \cdot \bar { \| } _ { \infty }$ .
|
| 482 |
+
|
| 483 |
+
Assumption 5 Let $F : \mathbb { R } ^ { n } \mapsto \mathbb { R } ^ { n }$ .
|
| 484 |
+
|
| 485 |
+
(i) The mapping $F$ is monotone; that is, if $x \leq y$ , then $F ( x ) \leq F ( y )$ .
|
| 486 |
+
|
| 487 |
+
(ii) The mapping $F$ is continuous.
|
| 488 |
+
|
| 489 |
+
(iii) The mapping $F$ has a unique fixed point $x ^ { * }$ .
|
| 490 |
+
|
| 491 |
+
(iv) If $e \in \mathbb { R } ^ { n }$ is the vector with all components equal to $1$ , and $r$ is a positive scalar, then
|
| 492 |
+
|
| 493 |
+
$$
|
| 494 |
+
F ( x ) - r e \leq F ( x - r e ) \leq F ( x + r e ) \leq F ( x ) + r e
|
| 495 |
+
$$
|
| 496 |
+
|
| 497 |
+
Assumption 6 There exists a vector $x ^ { * } \in \mathbb { R } ^ { n }$ , a positive vector $v$ , and a scalar $\beta \in [ 0 , 1 )$ , such that
|
| 498 |
+
|
| 499 |
+
$$
|
| 500 |
+
\| F ( x ) - x ^ { * } \| _ { v } \leq \beta \| x - x ^ { * } \| _ { v } , \quad \forall x \in \mathbb { R } ^ { n }
|
| 501 |
+
$$
|
| 502 |
+
|
| 503 |
+
Assumption 7 There exists a positive vector $v$ , a scalar $\beta \in [ 0 , 1 )$ , and a scalar $D$ such that
|
| 504 |
+
|
| 505 |
+
$$
|
| 506 |
+
\| F ( { \boldsymbol { x } } ) \| _ { v } \leq \beta \| { \boldsymbol { x } } \| _ { v } + D , \quad \forall { \boldsymbol { x } } \in \mathbb { R } ^ { n }
|
| 507 |
+
$$
|
| 508 |
+
|
| 509 |
+
Assumption 8 There exists at least one proper stationary policy. Every improper stationary policy yields infinite expected cost for at least one initial state.
|
| 510 |
+
|
| 511 |
+
Theorem 3 Let Assumptions 3, 4, 2, and 7 hold. Then the sequence $x ( t )$ is bounded with probability 1.
|
| 512 |
+
|
| 513 |
+
Theorem 4 Let Assumptions 3, 4, 2, and 5 hold. Furthermore, suppose that $x ( t )$ is bounded with probability 1. Then $x ( t )$ converges to $x ^ { * }$ with probability 1.
|
| 514 |
+
|
| 515 |
+
Theorem 5 Let Assumptions 3, 4, 2, and 6 hold. Then $x ( t )$ converges to $x ^ { * }$ with probability 1.
|
| 516 |
+
|
| 517 |
+
Detailed proofs of Theorems 3, 4, and 5 can be found in the work of Bertsekas & Tsitsiklis (1989).
|
| 518 |
+
|
| 519 |
+
B.4 PROOF OF THEOREM 2
|
| 520 |
+
|
| 521 |
+
We first state Theorem 2 here again and then show the proof.
|
| 522 |
+
|
| 523 |
+
Theorem 2 Assume a finite MDP $( { \boldsymbol { S } } , { \boldsymbol { A } } , { \boldsymbol { P } } , { \boldsymbol { R } } )$ and that Assumption 1 and 2 hold. Then the action-value functions in Generalized $\mathbf { Q }$ -learning, using tabular update in Equation (3), will converge to the optimal action-value function with probability 1, in each of the following cases:
|
| 524 |
+
|
| 525 |
+
(i) $\gamma < 1 .$ .
|
| 526 |
+
(ii) $\gamma = 1$ and $\forall a \in \mathcal { A } , Q _ { s _ { 1 } a } ^ { i } ( t = 0 ) = 0$ where $s _ { 1 }$ is an absorbing state. All policies are proper.
|
| 527 |
+
|
| 528 |
+
Proof. We first check Assumptions 3, 4, 2, and 6 in Section B.3 are satisfied. Then we simply apply Theorem 5 to Generalized Q-learning.
|
| 529 |
+
|
| 530 |
+
Assumption 3 is satisfied in the special case where $\tau _ { j } ^ { i } ( t ) = t$ , which is what was implicitly assumed in Equation 10, but can be also satisfied even if we allow for outdated information.
|
| 531 |
+
|
| 532 |
+
Regarding Assumption 4, parts $( i )$ and $( i i )$ of the assumption are then automatically valid. Part $( i i i )$ is quite natural: in particular, it assumes that the required samples are generated after we decide which components to update during the current iteration. Part $( i v )$ is automatic from Equation 16. Part $( v )$ is satisfied by Lemma 2.
|
| 533 |
+
|
| 534 |
+
Assumption 2 needs to be imposed on the step-sizes employed by the Generalized Q-learning algorithm. This assumption is standard for stochastic approximation algorithms. In particular, it requires that every state-action pair $( s , a )$ is simulated an infinite number of times.
|
| 535 |
+
|
| 536 |
+
By Lemma 3, $F$ is a contraction mapping. Assumption 6 is satisfied.
|
| 537 |
+
|
| 538 |
+
All assumptions required by Theorem 5 are verified, convergence then follows from Theorem 5.
|
| 539 |
+
|
| 540 |
+
# C ADDITIONAL EMPIRICAL RESULTS
|
| 541 |
+
|
| 542 |
+
C.1 MDP RESULTS
|
| 543 |
+
|
| 544 |
+
Comparison of three algorithms using the simple MDP in Figure 1 with different values of $\mu$ is shown in Figure 6. For $\mu = + 0 . 1$ , the learning curves of action value $Q ( A , { \mathrm { L e f t } } )$ are shown in $( a )$ . Here, the true action value $Q ( A , { \mathrm { L e f t } } )$ is $+ 0 . 1$ . For $\mu = - 0 . 1$ , the learning curves of action value $Q ( A , { \mathrm { L e f t } } )$ are shown in $( b )$ . The true action value $Q ( A , { \mathrm { L e f t } } )$ is $- 0 . 1$ . All results were averaged over $5 , 0 0 0$ runs.
|
| 545 |
+
|
| 546 |
+

|
| 547 |
+
Figure 6: MDP results
|
| 548 |
+
|
| 549 |
+
# C.2 MOUNTAIN CAR RESULTS
|
| 550 |
+
|
| 551 |
+
Comparison of four algorithms on Mountain Car under different reward settings is shown in Figure 7. All experimental results were averaged over 100 runs. Note that for reward variance $\sigma ^ { 2 } = 5 0$ , both Q-learning and Averaged Q-learning fail to reach the goal position in 5, 000 steps so there are no learning curves shown in Figure 7 $( d )$ for these two algorithms.
|
| 552 |
+
|
| 553 |
+
# C.3 BENCHMARK ENVIRONMENT RESULTS
|
| 554 |
+
|
| 555 |
+
The sensitivity analysis results of seven benchmark environment are shown in Figure 8.
|
| 556 |
+
|
| 557 |
+

|
| 558 |
+
Figure 7: Mountain Car results
|
| 559 |
+
|
| 560 |
+

|
| 561 |
+
Figure 8: Sensitivity analysis
|
md/train/ByYPLJA6W/ByYPLJA6W.md
ADDED
|
@@ -0,0 +1,370 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# DISTRIBUTION REGRESSION NETWORK
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
We introduce our Distribution Regression Network (DRN) which performs regression from input probability distributions to output probability distributions. Compared to existing methods, DRN learns with fewer model parameters and easily extends to multiple input and multiple output distributions. On synthetic and real-world datasets, DRN performs similarly or better than the state-of-the-art. Furthermore, DRN generalizes the conventional multilayer perceptron (MLP). In the framework of MLP, each node encodes a real number, whereas in DRN, each node encodes a probability distribution.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
The field of regression analysis is largely established with methods ranging from linear least squares to multilayer perceptrons. However, the scope of the regression is mostly limited to real valued inputs and outputs (Fiori et al., 2015; Marquardt, 1963). In this paper, we perform distribution-todistribution regression where one regresses from input probability distributions to output probability distributions.
|
| 12 |
+
|
| 13 |
+
Distribution-to-distribution regression (see work by Oliva et al. (2013)) has not been as widely studied compared to the related task of functional regression (Ferraty & Vieu, 2006). Nevertheless, regression on distributions has many relevant applications. In the study of human populations, probability distributions capture the collective characteristics of the people. Potential applications include predicting voting outcomes of demographic groups (Flaxman et al., 2016) and predicting economic growth from income distribution (Perotti, 1996). In particular, distribution-to-distribution regression is very useful in predicting future outcomes of phenomena driven by stochastic processes. For instance, the Ornstein-Uhlenbeck process, which exhibits a mean-reverting random walk, has wide-ranging applications. In the commodity market, prices exhibit mean-reverting patterns due to market forces (Schwartz & Smith, 2000). It is also used in quantitative biology to model phenotypic traits evolution (Bartoszek et al., 2016).
|
| 14 |
+
|
| 15 |
+
Variants of the distribution regression task have been explored in literature (Poczos et al., 2013; Oliva ´ et al., 2014). For the distribution-to-distribution regression task, Oliva et al. (2013) proposed an instance-based learning method where a linear smoother estimator (LSE) is applied across the inputoutput distributions. However, the computation time of LSE scales badly with the size of the dataset. To that end, Oliva et al. (2015) developed the Triple-Basis Estimator (3BE) where the prediction time is independent of the number of data by using basis representations of distributions and Random Kitchen Sink basis functions. Lampert (2015) proposed the Extrapolating the Distribution Dynamics (EDD) method which predicts the future state of a time-varying probability distribution given a sequence of samples from previous time steps. However, it is unclear how it can be used for the general case of regressing distributions of different objects.
|
| 16 |
+
|
| 17 |
+
Our proposed Distribution Regression Network (DRN) is based on a completely different scheme of network learning, motivated by spin models in statistical physics and similar to artificial neural networks. In many variants of the artificial neural network, the network encodes real values in the nodes (Rumelhart et al., 1985; LeCun et al., 1989; Bengio, 2009). DRN is novel in that it generalizes the conventional multilayer perceptron (MLP) by encoding a probability distribution in each node. Each distribution in DRN is treated as a single object which is then processed by the connecting weights. Hence, the propagation behavior in DRN is much richer, enabling DRN to represent distribution regression mappings with fewer parameters than MLP. We experimentally demonstrate that compared to existing methods, DRN achieves comparable or better regression performance with fewer model parameters.
|
| 18 |
+
|
| 19 |
+

|
| 20 |
+
Figure 1: (Left) An example DRN with multiple input probability distributions and multiple hidden layers mapping to an output probability distribution. (Right) A connection unit in the network, with 3 input nodes in layer $l - 1$ connecting to a node in layer $l$ . Each node encodes a probability distribution, as illustrated by the probability density function $P _ { k } ^ { ( l ) }$ . The tunable parameters are the connecting weights and the bias parameters at the output node.
|
| 21 |
+
|
| 22 |
+
# 2 DISTRIBUTION REGRESSION NETWORK
|
| 23 |
+
|
| 24 |
+
Given a training dataset with $M$ data points $\mathcal { D } = \{ ( X _ { 1 } ^ { 1 } , \cdot \cdot \cdot , X _ { 1 } ^ { K } , Y _ { 1 } ) , \cdot \cdot \cdot , ( X _ { M } ^ { 1 } , \cdot \cdot \cdot , X _ { M } ^ { K } , Y _ { M } ) \}$ where $X _ { i } ^ { k }$ and $Y _ { i }$ are univariate continuous distributions with compact support, the regression task is to learn the function $f$ which maps the input distributions to the output distribution.
|
| 25 |
+
|
| 26 |
+
$$
|
| 27 |
+
Y _ { i } = f ( X _ { i } ^ { 1 } , \cdots , X _ { i } ^ { K } )
|
| 28 |
+
$$
|
| 29 |
+
|
| 30 |
+
No further assumptions are made on the form of the distribution. It is trivial to generalize our method to regress to multiple output distributions but for simplicity of explanation we shall restrict to single output regressions in the following discussions.
|
| 31 |
+
|
| 32 |
+
# 2.1 FORWARD PROPAGATION
|
| 33 |
+
|
| 34 |
+
Fig. 1 illustrates how the regression in Eq. (1) is realized. DRN generalizes the traditional neural network structure by encoding each node with a probability distribution and connecting the nodes with real-valued weights. The input data consists of one or more probability distributions which are fed into the first layer and propagated layerwise through the hidden layers. We emphasize our network is not a Bayesian network even though each node encodes a probability. Unlike bayes net where the conditional probability among variables are learnt by maximizing the likelihood over observed data, DRN regresses probability distributions using a feedforward network, similar to MLP.
|
| 35 |
+
|
| 36 |
+
At each node in the hidden layer, the probability distribution is computed from the probability distributions of the incoming nodes in the previous layer and the network parameters consisting of the weights and bias parameters (see right of Fig. 1). $P _ { k } ^ { ( l ) }$ represents the probability density function (pdf) of the $k ^ { \mathrm { { t h } } }$ node in the $l ^ { \mathrm { t h } }$ layer and $P _ { k } ^ { ( l ) } ( s _ { k } ^ { ( l ) } )$ is the density of the pdf when the node variable is $s _ { k } ^ { ( l ) }$ .
|
| 37 |
+
|
| 38 |
+
Before obtaining the probability distribution $P _ { k } ^ { ( l ) }$ , we first compute its unnormalized form $\tilde { P } _ { k } ^ { ( l ) }$ . $\tilde { P } _ { k } ^ { ( l ) }$ is computed by marginalizing over the product of the unnormalized conditional probability $\tilde { Q } ( s _ { k } ^ { ( l ) } | s _ { 1 } ^ { ( l - 1 ) } , \cdot \cdot \cdot , s _ { n } ^ { ( l - 1 ) } )$ and the incoming node probabilities.
|
| 39 |
+
|
| 40 |
+
$$
|
| 41 |
+
\tilde { P } _ { k } ^ { ( l ) } \left( s _ { k } ^ { ( l ) } \right) = \int _ { s _ { 1 } ( l - 1 ) } \cdots \int _ { s _ { n } ( l - 1 ) } \tilde { Q } \left( s _ { k } ^ { ( l ) } | s _ { 1 } ^ { ( l - 1 ) } , \cdots , s _ { n } ^ { ( l - 1 ) } \right) \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad
|
| 42 |
+
$$
|
| 43 |
+
|
| 44 |
+
$$
|
| 45 |
+
\tilde { Q } \left( s _ { k } ^ { ( l ) } | s _ { 1 } ^ { ( l - 1 ) } , \cdots , s _ { n } ^ { ( l - 1 ) } \right) = \exp \left[ - E \left( s _ { k } ^ { ( l ) } | s _ { 1 } ^ { ( l - 1 ) } , \cdots , s _ { n } ^ { ( l - 1 ) } \right) \right]
|
| 46 |
+
$$
|
| 47 |
+
|
| 48 |
+
$s _ { 1 } ^ { ( l - 1 ) } , \cdot \cdot \cdot , s _ { n } ^ { ( l - 1 ) }$ represent the variables of the lower layer nodes and $E$ is the energy given a set of node variables, which we define later in Eq. (4). The unnormalized conditional probability has the same form as the Boltzmann distribution in statistical mechanics, except that the partition function is omitted. This omission reduces the computational complexity of our model through factorization, shown later in Eq. (5).
|
| 49 |
+
|
| 50 |
+
Our energy function formulation is motivated by work on spin models in statistical physics where spin alignment to coupling fields and critical phenomena are studied (Lee et al., 2002; 2003; Katsura, 1962; Wu, 1982). Energy functions are also used in other network models where a scalar energy is associated to each configuration of the nodes (Teh et al., 2003; LeCun et al., 2007). In such energybased models, the parameters are learnt such that the observed configurations of the variables have lower energies than unobserved ones. However, the energy function used in DRN is part of the forward propagation process and is not directly optimized. For a given set of node variables, the energy function is
|
| 51 |
+
|
| 52 |
+
$$
|
| 53 |
+
\begin{array} { r } { E \left( s _ { k } ^ { ( l ) } | s _ { 1 } ^ { ( l - 1 ) } , \cdots , s _ { n } ^ { ( l - 1 ) } \right) = \displaystyle \sum _ { i } ^ { n } w _ { k i } ^ { ( l ) } \left( \frac { s _ { k } ^ { ( l ) } - s _ { i } ^ { ( l - 1 ) } } { \Delta } \right) ^ { 2 } + b _ { q , k } ^ { ( l ) } \left( \frac { s _ { k } ^ { ( l ) } - \lambda _ { q , k } ^ { ( l ) } } { \Delta } \right) ^ { 2 } } \\ { + b _ { a , k } ^ { ( l ) } \displaystyle \left. \frac { s _ { k } ^ { ( l ) } - \lambda _ { a , k } ^ { ( l ) } } { \Delta } \right. } \end{array}
|
| 54 |
+
$$
|
| 55 |
+
|
| 56 |
+
$w _ { k i } ^ { ( l ) }$ is the weight connecting the are the values of the quadratic $i ^ { \mathrm { { t h } } }$ node in the lower layer to the upper layer nd absolute bias terms which act at the positions b(l) b(l)a,k $\lambda _ { q , k } ^ { ( l ) }$ )k and λ(l)a,k respectively. The support length of the distribution is given by . All terms in Eq. (4) are normalized by the support length so that the energy function is invariant with respect to the support. Eq. (2) can be factorized such that instead of having multidimensional integrals, there are $n$ univariate integrals:
|
| 57 |
+
|
| 58 |
+
$$
|
| 59 |
+
\begin{array} { r l r } & { } & { \tilde { P } _ { k } ^ { ( l ) } \left( s _ { k } ^ { ( l ) } \right) = \exp \left( B \left( s _ { k } ^ { ( l ) } \right) \right) \displaystyle \int _ { s _ { 1 } ( l - 1 ) } \cdots \int _ { s _ { n } ^ { ( l - 1 ) } } P _ { 1 } ^ { ( l - 1 ) } \left( s _ { 1 } ^ { ( l - 1 ) } \right) \cdots P _ { n } ^ { ( l - 1 ) } \left( s _ { n } ^ { ( l - 1 ) } \right) } \\ & { } & { \exp \left[ - \displaystyle \sum _ { i } ^ { n } w _ { k i } ^ { ( l ) } \left( \frac { s _ { k } ^ { ( l ) } - s _ { i } ^ { ( l - 1 ) } } { \Delta } \right) ^ { 2 } \right] d s _ { 1 } ^ { ( l - 1 ) } \cdot \cdot d s _ { n } ^ { ( l - 1 ) } } \\ & { } & { = \exp \left( B \left( s _ { k } ^ { ( l ) } \right) \right) \prod _ { i } ^ { n } \left\{ \int _ { s _ { i } ^ { ( l - 1 ) } } P _ { i } ^ { ( l - 1 ) } \left( s _ { i } ^ { ( l - 1 ) } \right) \exp \left[ - w _ { k i } ^ { ( l ) } \left( \frac { s _ { k } ^ { ( l ) } - s _ { i } ^ { ( l - 1 ) } } { \Delta } \right) ^ { 2 } \right] d s _ { i } ^ { ( l - 1 ) } \right\} } \end{array}
|
| 60 |
+
$$
|
| 61 |
+
|
| 62 |
+
$B ( s _ { k } ^ { ( l ) } )$ captures the bias terms of the energy function in Eq. (4).
|
| 63 |
+
|
| 64 |
+
$$
|
| 65 |
+
B \left( s _ { k } ^ { ( l ) } \right) = - b _ { q , k } ^ { ( l ) } \left( \frac { s _ { k } ^ { ( l ) } - \lambda _ { q , k } ^ { ( l ) } } { \Delta } \right) ^ { 2 } - b _ { a , k } ^ { ( l ) } \left| \frac { s _ { k } ^ { ( l ) } - \lambda _ { a , k } ^ { ( l ) } } { \Delta } \right|
|
| 66 |
+
$$
|
| 67 |
+
|
| 68 |
+
Finally, the probability distribution from Eq. (2) is normalized.
|
| 69 |
+
|
| 70 |
+
$$
|
| 71 |
+
P _ { k } ^ { ( l ) } \left( s _ { k } ^ { ( l ) } \right) = \frac { \tilde { P } _ { k } ^ { ( l ) } \left( s _ { k } ^ { ( l ) } \right) } { \int _ { s _ { k } ^ { ( l ) ^ { \prime } } } \tilde { P } _ { k } ^ { ( l ) } \left( s _ { k } ^ { ( l ) ^ { \prime } } \right) d s _ { k } ^ { ( l ) ^ { \prime } } }
|
| 72 |
+
$$
|
| 73 |
+
|
| 74 |
+
The propagation of probability distributions within a connection unit forms the basis for forward propagation. Forward propagation is performed layerwise from the input layer using Eq. (2) to (7).
|
| 75 |
+
|
| 76 |
+
# 2.1.1 PROPAGATION PROPERTIES
|
| 77 |
+
|
| 78 |
+
The forward propagation in DRN has some important properties. Fig. behavior for a connection unit with one input node where the bias values $b _ { a , k } ^ { ( l ) }$ l),k and b(l)q,k he propagationare set as zero.
|
| 79 |
+
|
| 80 |
+

|
| 81 |
+
Figure 2: Propagation behavior for a connection unit with one input node. The biases are set as zero in these examples. When weight is zero, the output distribution is flat. Positive weights causes the output distribution to have the same peak position as the input distribution while negative weights causes the output pdf to ‘repel’ away from the input peak. When the weight is a sufficiently large positive number, the propagation tends towards the identity mapping.
|
| 82 |
+
|
| 83 |
+
When the weight is zero, the output distribution is flat and the output distribution is independent of the input. With a positive weight, the output distribution is ‘attracted’ to the peak of the input distribution whereas a negative weight causes the output distribution to be ‘repelled’ away from the input peak. In addition, the weight magnitude represents the strength of the ‘attraction’ or ‘repulsion’. When the weight is a sufficiently large positive number, the propagation tends towards the identity mapping (top right example in Fig. 2). The implication is that like in neural networks, a deeper network should have at least the same complexity as a shallow one, as the added layers can produce the identity function. Conversely, a small positive weight causes the output peak to be at the same position as the input peak, but with more spread (second example on left column of Fig. 2).
|
| 84 |
+
|
| 85 |
+
The remaining absolute and quadratic bias terms in Eq. (4) have a similar role as the bias in a traditional neural network. Depending on the bias values b(l)a,k and b(l) , the bias terms act as attractors or repellers from the positions defined by $\lambda _ { a , k } ^ { ( l ) }$ ),k and λ(l)q,k respectively. The weight and bias values play a similar role as the inverse temperature in the Boltzmann distribution in statistical physics (Lee et al., 2002; Wu, 1982).
|
| 86 |
+
|
| 87 |
+
# 2.2 NETWORK COST FUNCTION
|
| 88 |
+
|
| 89 |
+
The cost function of the network given a set network parameters is measured by the Jensen-Shannon (JS) divergence between the label $( Y _ { i } )$ and predicted $( \hat { Y } _ { i } )$ distributions. The JS divergence is given by $\begin{array} { r } { D _ { J S } ( \bar { Y _ { i } } | | \hat { Y _ { i } } ) = \frac { 1 } { 2 } D _ { K L } ( Y _ { i } | | W _ { i } ) + \frac { 1 } { 2 } D _ { K L } ( \hat { Y _ { i } } | | W _ { i } ) } \end{array}$ , where $\begin{array} { r } { W _ { i } = \frac { 1 } { 2 } ( Y _ { i } + \hat { Y } _ { i } ) } \end{array}$ and $D _ { K L }$ is the Kullback-Liebler divergence. The Jensen-Shannon divergence is a suitable cost function as it is symmetric and bounded. The network cost function $C _ { n e t }$ is the average $D _ { J S }$ over all $M$ training $\begin{array} { r } { C _ { n e t } = \frac { 1 } { M } \sum _ { i } ^ { M } D _ { J S } ( Y _ { i } | | \hat { Y _ { i } } ) } \end{array}$ .
|
| 90 |
+
|
| 91 |
+
# 2.3 DISCRETIZATION OF PROBABILITY DISTRIBUTIONS
|
| 92 |
+
|
| 93 |
+
In our experiments, the integrals in Eq. (5) and (7) are performed numerically. This is done through discretization from continuous probability density functions (pdf) to discrete probability mass functions (pmf). Given a continuous pdf with finite support, the range of the continuous variable is partitioned into $q$ equal widths and the probability distribution is binned into the $q$ states. The estimation error arising from the discretization step will decrease with larger $q$ .
|
| 94 |
+
|
| 95 |
+
# 2.4 OPTIMIZATION BY BACKPROPAGATION
|
| 96 |
+
|
| 97 |
+
The network cost is a differentiable function over the network parameters. We derive the cost gradients similar to backpropagation in neural networks (Rumelhart et al., 1988). We use chain rule to derive at each node a $q$ -by- $q$ matrix which denotes the derivative of the final layer node distribution with respect to the current node distribution.
|
| 98 |
+
|
| 99 |
+
$$
|
| 100 |
+
\frac { \partial P _ { 1 } ^ { ( L ) } \left( s _ { 1 } ^ { ( L ) } \right) } { \partial P _ { k } ^ { ( l ) } \left( s _ { k } ^ { ( l ) } \right) } = \sum _ { i } ^ { n } \sum _ { s _ { i } ^ { ( l + 1 ) } } \frac { \partial P _ { 1 } ^ { ( L ) } \left( s _ { 1 } ^ { ( L ) } \right) } { \partial P _ { i } ^ { ( l + 1 ) } \left( s _ { i } ^ { ( l + 1 ) } \right) } \frac { \partial P _ { i } ^ { ( l + 1 ) } \left( s _ { i } ^ { ( l + 1 ) } \right) } { \partial P _ { k } ^ { ( l ) } \left( s _ { k } ^ { ( l ) } \right) }
|
| 101 |
+
$$
|
| 102 |
+
|
| 103 |
+
where $P _ { 1 } ^ { ( L ) } \left( s _ { 1 } ^ { ( L ) } \right)$ is the final layer output probability distribution. From the derivative $\frac { \partial P _ { 1 } ^ { ( L ) } \left( s _ { 1 } ^ { ( L ) } \right) } { \partial P _ { k } ^ { ( l ) } \left( s _ { k } ^ { ( l ) } \right) }$ , the cost gradients for all network parameters can be obtained. Detailed derivations of the cost gradients are included in Appendix A. The network weights $w _ { k i } ^ { ( l ) }$ and bias magnitudes $b _ { a , k } ^ { ( l ) } , b _ { q , k } ^ { ( l ) }$ are randomly initialized with a uniform distribution, though other initialization methods are also feasible. The bias positions λ(l)a,k and λ(l)q,k are uniformly sampled from the range corresponding to the support of the distributions.
|
| 104 |
+
|
| 105 |
+
# 3 EXPERIMENTS
|
| 106 |
+
|
| 107 |
+
We evaluate DRN on synthetic and real-world datasets and compare its performance to the state-ofthe-art 3BE method and a fully-connected multilayer perceptron (MLP). For each of the datasets, DRN achieves similar or higher accuracy with fewer model parameters.
|
| 108 |
+
|
| 109 |
+
In MLP, each discretized probability mass function is represented by $q$ nodes. The MLP consists of fully connected hidden layers with ReLU units and a softmax final layer, and is optimized with mean squared error using Adam. Unlike DRN and MLP where the distribution pdfs are directly used by the methods, 3BE assumes the input and output distributions are observed through i.i.d. samples. Hence, for the first two datasets we provide 3BE with sufficient samples from the underlying distribution such that errors from density estimation are minimal.
|
| 110 |
+
|
| 111 |
+
# 3.1 SYNTHETIC DATA
|
| 112 |
+
|
| 113 |
+
The first experiment involves a synthetic dataset similar to the one used by Oliva et al. (2013) but with increased complexity. We first generate two truncated gaussians by sampling their means $\mu _ { 1 } ~ \sim ~ \mathrm { U n i f } [ 0 . 1 , 0 . 4 ]$ , $\mu _ { 2 } ^ { - } \sim \mathrm { U n i f } [ 0 . { \overset { \cdot } { 6 } } , 0 . 9 ]$ and standard deviations $\sigma _ { 1 } , \sigma _ { 2 } ~ \sim ~ \mathrm { U n i f } [ 0 . 0 5 , 0 . 1 ]$ . The input pdf is $X ( s ) ~ = ~ \gamma g ( s ; \mu _ { 1 } , \sigma _ { 1 } ) + ( 1 - \gamma ) g ( s ; \mu _ { 2 } , \sigma _ { 2 } )$ and the output pdf is $Y ( s ) \ =$ $\gamma g ( s ; h ( \mu _ { 1 } , 0 . 1 , 0 . 4 ) , h ( \sigma _ { 1 } , 0 . 0 5 , 0 . 1 ) ) + ( 1 - \gamma ) g ( s ; h ( \mu _ { 2 } , 0 . 6 , 0 . 9 ) , h ( \sigma _ { 2 } , 0 . 0 5 , 0 . 1 ) )$ where $g$ is the truncated normal pdf with support of [0,1], $\gamma \sim \mathrm { U n i f } [ 0 , 1 ]$ , and $h$ is
|
| 114 |
+
|
| 115 |
+
$$
|
| 116 |
+
h ( \nu , \nu _ { m i n } , \nu _ { m a x } ) = \nu _ { m i n } + \frac { \sin \left( 2 \pi \frac { \nu - \nu _ { m i n } } { \nu _ { m a x } - \nu _ { m i n } } \right) + 1 } { 2 } \times \left( \nu _ { m a x } - \nu _ { m i n } \right)
|
| 117 |
+
$$
|
| 118 |
+
|
| 119 |
+
The function $h$ transforms the means and standard deviations using the non-linear function shown in Fig. 3a. The transformation is such that the two gaussian means will remain in their respective ranges. The sample input-output data pairs in Fig. 3b shows the complexity of the regression task with various behavior like peak splitting and peak spreading. 1000 training data and 1000 testing data were created to evaluate the regression methods.
|
| 120 |
+
|
| 121 |
+
For DRN and MLP, the pdfs are discretized into $q = 1 0 0$ states and for 3BE, 10,000 samples from each data distribution are generated. While 3BE gives a continuous distribution as the output, DRN and MLP output the discrete pmf and require conversion to continuous pdf. Following Oliva et al. (2014), the regression performance on the test set is measured by the $L 2$ loss between the continuous predicted distribution, $\hat { Y } ( s )$ and the true distribution.
|
| 122 |
+
|
| 123 |
+
We study how the regression accuracy varies with respect to the number of model parameters. For DRN and MLP, the number of parameters are varied using different depths and widths of the networks and for 3BE, we vary the number of Random Kitchen Sink features. We present the detailed
|
| 124 |
+
|
| 125 |
+

|
| 126 |
+
Figure 3: (a) Nonlinear transformation of the input means and standard deviations of gaussians for the synthetic dataset. (b) Example input-output pairs from the synthetic data, illustrating the complexity of the regression task.
|
| 127 |
+
|
| 128 |
+

|
| 129 |
+
Figure 4: (a) Comparison of $L 2$ loss on the synthetic data test set. Note that the $\mathbf { X }$ -axis denotes the number of model parameters using the log scale. (b) Train and test loss for the individual methods as number of model parameters increases. There is no overfitting as the gaps between train and test losses are not significant.
|
| 130 |
+
|
| 131 |
+
DRN architecture in Appendix B. Fig. 4a shows the $L 2$ loss on the test set as we vary the number of model parameters. Note that the $\mathbf { X }$ -axis is presented on the log scale. DRN’s test performance is comparable to the other methods and uses fewer model parameters to attain reasonable performance. We note there is little overfitting for the three methods, as shown in the plots comparing train and test loss in Fig. 4b, though 3BE starts to exhibit overfitting when the number of model parameters approaches 10,000.
|
| 132 |
+
|
| 133 |
+
# 3.2 ORNSTEIN-UHLENBECK PROCESS
|
| 134 |
+
|
| 135 |
+
Because of the Boltzmann distribution term (ref. Eq. 3), DRN models the diffusion process very well. For this experiment, we evaluate our model on data generated from the stochastic OrnsteinUhlenbeck (OU) process (Uhlenbeck & Ornstein, 1930) which combines the notion of random walk with a drift towards a long-term mean. The OU process has wide-ranging applications. In the commodity market, prices exhibit mean-reverting patterns due to market forces and hence modelling the prices with the OU process helps form valuation strategies (Schwartz & Smith, 2000; Zhang et al., 2012).
|
| 136 |
+
|
| 137 |
+
The OU process is described by a time-varying gaussian pdf. With the long-term mean set at zero, the pdf has a mean of µ(t) = y exp(−θt) and variance of σ2(t) = D(1−e−2θt)θ . t represents time, y is the initial point mass position, and $D$ and $\theta$ are the diffusion and drift coefficients respectively. The regression task is to map from an initial gaussian distribution at $t _ { i n i t }$ to the resulting distribution after some time step $\Delta t$ . The gaussian distributions are truncated with support of [0, 1]. With different sampled values for $y \in [ 0 . 3 , 0 . 9 ]$ and $t _ { i n i t } \in [ 0 . 0 1 , 2 ]$ , pairs of distributions are created for $\Delta t = 1$ , $D = 0 . 0 0 3$ and $\theta = 0 . 1$ . For DRN and MLP, $q = 1 0 0$ was used for discretization of the pdfs while 10,000 samples were taken for each distribution to train 3BE.
|
| 138 |
+
|
| 139 |
+
Table 1: Comparison of $L 2$ test loss and the number of model parameters used for the OrnsteinUhlenbeck data.
|
| 140 |
+
|
| 141 |
+
<table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>L2 test loss</td><td rowspan=1 colspan=1>Model description</td><td rowspan=1 colspan=1>No. of parameters</td></tr><tr><td rowspan=1 colspan=1>DRN</td><td rowspan=1 colspan=1>0.1441 ± 0.0010</td><td rowspan=1 colspan=1>No hidden layer</td><td rowspan=1 colspan=1>5</td></tr><tr><td rowspan=1 colspan=1>MLP</td><td rowspan=1 colspan=1>0.1475士0.0005</td><td rowspan=1 colspan=1>1 hiddenlayer of 3 nodes</td><td rowspan=1 colspan=1>703</td></tr><tr><td rowspan=1 colspan=1>3BE</td><td rowspan=1 colspan=1>0.1255 ± 0.0083</td><td rowspan=1 colspan=1>16 projection coefficients,17 Random Kitchen Sink features</td><td rowspan=1 colspan=1>272</td></tr></table>
|
| 142 |
+
|
| 143 |
+
We compare the number of model parameters required to achieve a small $L 2$ test loss with 100 training data. We also increased the training size to 1000 and attained similar results. Table 1 and Fig. 5b show that a simple DRN of one input node connecting to one output node with 5 parameters performs similarly as MLP and 3BE. MLP requires 1 fully-connected hidden layer with 3 nodes, with a total of 703 network parameters. 3BE requires 64 projection coefficients for both input and output distributions and 17 Random Kitchen Sink features, resulting in 272 model parameters.
|
| 144 |
+
|
| 145 |
+

|
| 146 |
+
Figure 5: (a) The regression by DRN on two test samples. (b) The learnt parameters for DRN are interpreted as follows. The positive weight of 75.3 reflects the positive correlation between input and output peak positions and that the peak spreads out over time. The negative position of the absolute bias $( \lambda _ { a } )$ shows that the output peak is displaced leftwards of the input peak.
|
| 147 |
+
|
| 148 |
+
The regression by DRN on two random test samples are shown in Fig. 5a and we see that DRN is able to demonstrate the OU process. Fig. 5b shows the 5 DRN parameters after training. The values of these parameters are interpreted as follows. The weight parameter is positive, hence the output peak position is positively correlated to the input peak position. Moreover, $w = 7 5 . 3$ is such that the network mimics the diffusion property of the OU process. The bias position $\lambda _ { a }$ is negative and its magnitude is 5 times the distribution support, causing the output peak to be displaced leftwards of the input peak. These two observations reflect the random walk and mean-reverting properties of the OU process.
|
| 149 |
+
|
| 150 |
+
Table 2: Comparison of log-likelihood on the stock data and the number of model parameters.
|
| 151 |
+
|
| 152 |
+
<table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>Log-likelihood on test set</td><td rowspan=1 colspan=1>Model description</td><td rowspan=1 colspan=1>No.of parameters</td></tr><tr><td rowspan=1 colspan=1>DRN</td><td rowspan=1 colspan=1>474.43 ± 0.01</td><td rowspan=1 colspan=1>No hidden layer (Fig. 6)</td><td rowspan=1 colspan=1>7</td></tr><tr><td rowspan=1 colspan=1>MLP</td><td rowspan=1 colspan=1>471.50 ± 0.08</td><td rowspan=1 colspan=1>1 hidden layer of10 nodes</td><td rowspan=1 colspan=1>4110</td></tr><tr><td rowspan=1 colspan=1>3BE</td><td rowspan=1 colspan=1>466.76 ± 0.73</td><td rowspan=1 colspan=1>18 projection coefficients,450 Random Kitchen Sink features</td><td rowspan=1 colspan=1>8100</td></tr></table>
|
| 153 |
+
|
| 154 |
+

|
| 155 |
+
Figure 6: Single-layer network used in DRN for the stock dataset with 7 model parameters (3 weights, 4 bias parameters).
|
| 156 |
+
|
| 157 |
+
# 3.3 STOCK DATA
|
| 158 |
+
|
| 159 |
+
We demonstrate that DRN can be useful for an important real-world problem and outperforms 3BE and MLP in terms of prediction accuracy. With greater integration of the global stock markets, there is significant co-movement of stock indices (Hamao et al., 1990; Chong et al., 2008). In a study by Vega & Smolarski (2012), it was found that the previous day stock returns of the Nikkei and Dow Jones Industrial Average (Dow) are good predictors of the FTSE return. Modelling the co-movement of global stock indices has its value as it facilitates investment decisions.
|
| 160 |
+
|
| 161 |
+
Stock indices are weighted average of the constituent companies’ prices in a stock exchange, and existing research has primarily focused on the movement of returns of the indices. However, for our experiment, we predict the future distribution of returns over the constituent companies in the index as it provides more information than just a weighted average. Our regression task is as follows. Given the current day’s distribution of returns of constituent companies in FTSE, Dow and Nikkei, predict the distribution of returns for constituent companies in FTSE $k$ days later. The logarithmic return for the company’s stock at day $t$ is given by $\ln ( V _ { t } / V _ { t - 1 } )$ , where $V _ { t }$ and $V _ { t - 1 }$ represent its closing price at day $t$ and $t - 1$ respectively.
|
| 162 |
+
|
| 163 |
+
The stock data consists of 9 years of daily returns from January 2007 to December 2015. To adapt to changing market conditions, we use a sliding-window training scheme where the data is split into windows of training, validation and test sets and moved foward in time (Kaastra & Boyd, 1996). A new window is created and the network is retrained after every 300 days (which is the size of test set). For each test set, the previous 500 and 100 days were used for training and validation. To reduce the noise in the data, we performed exponential window averaging on the price series for each stock with a window of 50 days following common practice (Murphy, 1999). The logarithmic returns of the constituent company stocks form the samples for the distributions of the returns.
|
| 164 |
+
|
| 165 |
+
For DRN and MLP, the pdf is estimated using kernel density estimation with a gaussian kernel function with bandwidth of 0.001 and $q = 1 0 0$ was used for discretization of the pdf. The authors of 3BE have extended their method for multiple input functions (see joint motion prediction experiment in Oliva et al. (2015)). We followed their method and concatenated the basis coefficients obtained from the three input distributions. In addition, for 3BE we scale the return samples to [0, 1] before applying cosine basis projection. The predicted distribution is then scaled back to the original range for quantification of the regression performance.
|
| 166 |
+
|
| 167 |
+
First, we performed evaluations for the task of predicting the next-day distributions. As we do not have the underlying true pdf for this real-world dataset, the regression performance is measured by the log-likelihood of the test samples. Table 2 shows the test log-likelihoods, where higher loglikelihood is favorable. Interestingly, the single-layer network in DRN (see Fig. 6) was sufficient to perform well, using just 7 network parameters. In comparison, MLP and 3BE require 4110 and 8100 parameters respectively.
|
| 168 |
+
|
| 169 |
+

|
| 170 |
+
Figure 7: Comparison of the (a) mean and (b) variance of the label distributions and predicted distributions on the test set, for various $k$ -days ahead predictions. The diagonal line represents a perfect fit where the predicted and labelled moments are equal. DRN outperforms the rest as its data points are closest to the diagonal line and it has the highest correlation coefficient (denoted by R) for all experiments.
|
| 171 |
+
|
| 172 |
+
To visualize the regression results on the test set, we compare for each day the first two moments (mean and variance) of the predicted distribution and the ground truth (see 1-day ahead panels of Fig. 7a and Fig. 7b). Each point represents one test data and we show the Pearson correlation coefficients between the predicted and labelled moments. DRN has the best regression performance as the points lie closest to the diagonal line where the predicted and labelled moments are equal, and its correlation values are highest.
|
| 173 |
+
|
| 174 |
+
# 3.3.1 PREDICTING SEVERAL DAYS AHEAD
|
| 175 |
+
|
| 176 |
+
As an extension, we predict the FTSE returns distribution several days ahead. The second and third rows of Fig. 7a and Fig. 7b show the moment plots for 5 and 10 days ahead respectively. Expectedly, the performance deterioriates as the number of days increases. Still, DRN outperforms the rest as shown by the moment plots and the correlation values. Fig. 8 summarizes the results by showing the average absolute error of the mean and variance as the number of days-ahead increases. For all experiments, DRN consistently has the lowest error.
|
| 177 |
+
|
| 178 |
+

|
| 179 |
+
Figure 8: The average absolute error of mean and variance across the three methods for prediction with varying number of days-ahead. DRN’s error is consistently the lowest compared to the benchmark methods. The standard errors are smaller than the data point symbols.
|
| 180 |
+
|
| 181 |
+
# 4 CELL LENGTH DATA
|
| 182 |
+
|
| 183 |
+
Finally, we conducted experiments on a real-world cell dataset similar to the one used in Oliva et al. (2013). The dataset is a time-series of images of NIH3T3 fibroblast cells. There are 277 time frames taken at 5-minute intervals, containing 176 to 222 cells each. In each frame, we measured the long and short-axis nuclear length of the cells and scaled the lengths to [0, 1]. At each time-frame, given the distribution of long-axis length, we predict the distribution of the short-axis length. The first 200 frames were used for training and last 77 for testing. For DRN and MLP, the pdf is estimated using kernel density estimation with a gaussian kernel of bandwidth 0.02 and $q = 1 0 0$ was used for discretization. We compare the log-likelihood on test data in Table 3. DRN had the best loglikelihood with a simple network of one input node connecting to one output node. In contrast, MLP and 3BE used more model parameters but achieved lower log-likelihoods. This validated DRN’s advantage at learning distribution regressions on real-world data with fewer model parameters.
|
| 184 |
+
|
| 185 |
+
Table 3: Comparison of log-likelihood on the cell data and the number of model parameters.
|
| 186 |
+
|
| 187 |
+
<table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>Log-likelihood on test set</td><td rowspan=1 colspan=1>Model description</td><td rowspan=1 colspan=1>No. of parameters</td></tr><tr><td rowspan=1 colspan=1>DRN</td><td rowspan=1 colspan=1>148.50 ± 0.46</td><td rowspan=1 colspan=1>No hidden layer</td><td rowspan=1 colspan=1>5</td></tr><tr><td rowspan=1 colspan=1>MLP</td><td rowspan=1 colspan=1>147.80 ± 0.10</td><td rowspan=1 colspan=1>1 hidden layer of 20 nodes</td><td rowspan=1 colspan=1>4120</td></tr><tr><td rowspan=1 colspan=1>3BE</td><td rowspan=1 colspan=1>139.75 ± 3.73</td><td rowspan=1 colspan=1>9 projection coefficients,5 Random Kitchen Sink features</td><td rowspan=1 colspan=1>45</td></tr></table>
|
| 188 |
+
|
| 189 |
+
# 5 DISCUSSION
|
| 190 |
+
|
| 191 |
+
The distribution-to-distribution regression task has many useful applications ranging from population studies to stock market prediction. In this paper, we propose our Distribution Regression Network which generalizes the MLP framework by encoding a probability distribution in each node.
|
| 192 |
+
|
| 193 |
+
Our DRN is able to learn the regression mappings with fewer model parameters compared to MLP and 3BE. MLP has not been used for distribution-to-distribution regression in literature and we have adapted it for this task. Though both DRN and MLP are network-based methods, they encode the distribution very differently. By generalizing each node to encode a distribution, each distribution in DRN is treated as a single object which is then processed by the connecting weight. Thus, the propagation behavior in DRN is much richer, enabling DRN to represent the regression mappings with fewer parameters. In 3BE, the number of model parameters scales linearly with the number of projection coefficients of the distributions and number of Random Kitchen Sink features. In our experiments, DRN is able to achieve similar or better regression performance using less parameters than 3BE. Furthermore, the runtime for DRN is competitive with other methods (see comparison of mean prediction times in Appendix C).
|
| 194 |
+
|
| 195 |
+
For future work, we look to extend DRN for variants of the distribution regression task such as distribution-to-real regression and distribution classification. Extensions may also be made for regressing multivariate distributions.
|
| 196 |
+
|
| 197 |
+
# REFERENCES
|
| 198 |
+
|
| 199 |
+
Krzysztof Bartoszek, Sylvain Glemin, Ingemar Kaj, and Martin Lascoux. The ornstein-uhlenbeck ´ process with migration: evolution with interactions. arXiv preprint arXiv:1607.07970, 2016.
|
| 200 |
+
|
| 201 |
+
Yoshua Bengio. Learning deep architectures for ai. Foundations and trends $\textsuperscript { \textregistered }$ in Machine Learning, 2(1):1–127, 2009.
|
| 202 |
+
|
| 203 |
+
Terence Tai-Leung Chong, Ying-Chiu Wong, and Isabel Kit-Ming Yan. International linkages of the japanese stock market. Japan and the World Economy, 20(4):601–621, 2008.
|
| 204 |
+
|
| 205 |
+
Fred´ eric Ferraty and Philippe Vieu. ´ Nonparametric functional data analysis: theory and practice. Springer Science & Business Media, 2006.
|
| 206 |
+
|
| 207 |
+
Simone Fiori, Tianxia Gong, and Hwee Kuan Lee. Bivariate nonisotonic statistical regression by a lookup table neural system. Cognitive Computation, 7(6):715–730, 2015.
|
| 208 |
+
|
| 209 |
+
Seth Flaxman, Dougal Sutherland, Yu-Xiang Wang, and Yee Whye Teh. Understanding the 2016 us presidential election using ecological inference and distribution regression with census microdata. arXiv preprint arXiv:1611.03787, 2016.
|
| 210 |
+
|
| 211 |
+
Yasushi Hamao, Ronald W Masulis, and Victor Ng. Correlations in price changes and volatility across international stock markets. Review of Financial studies, 3(2):281–307, 1990.
|
| 212 |
+
|
| 213 |
+
Iebeling Kaastra and Milton Boyd. Designing a neural network for forecasting financial and economic time series. Neurocomputing, 10(3):215–236, 1996.
|
| 214 |
+
|
| 215 |
+
Shigetoshi Katsura. Statistical mechanics of the anisotropic linear heisenberg model. Physical Review, 127(5):1508, 1962.
|
| 216 |
+
|
| 217 |
+
Christoph H Lampert. Predicting the future behavior of a time-varying probability distribution. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 942–950, 2015.
|
| 218 |
+
|
| 219 |
+
Yann LeCun, Bernhard Boser, John S Denker, Donnie Henderson, Richard E Howard, Wayne Hubbard, and Lawrence D Jackel. Backpropagation applied to handwritten zip code recognition. Neural computation, 1(4):541–551, 1989.
|
| 220 |
+
|
| 221 |
+
Yann LeCun, Sumit Chopra, Marc’Aurelio Ranzato, and Fu Jie Huang. Energy-based models in document recognition and computer vision. In ICDAR, volume 7, pp. 337–341, 2007.
|
| 222 |
+
|
| 223 |
+
Hwee Kuan Lee, Thomas C Schulthess, David P Landau, Gregory Brown, John Philip Pierce, Z Gai, GA Farnan, and J Shen. Monte carlo simulations of interacting magnetic nanoparticles. Journal of applied physics, 91(10):6926–6928, 2002.
|
| 224 |
+
|
| 225 |
+
Hwee Kuan Lee, David P Landau, and Thomas C Schulthess. Monte carlo simulations of phase transitions in $\mathrm { R b _ { 2 } M n F _ { 4 } }$ . Journal of applied physics, 93(10):7643–7645, 2003.
|
| 226 |
+
|
| 227 |
+
Donald W Marquardt. An algorithm for least-squares estimation of nonlinear parameters. Journal of the society for Industrial and Applied Mathematics, 11(2):431–441, 1963.
|
| 228 |
+
|
| 229 |
+
John J Murphy. Technical analysis of the futures markets: A comprehensive guide to trading methods and applications, New York Institute of Finance, 1999.
|
| 230 |
+
|
| 231 |
+
Junier Oliva, William Neiswanger, Barnabas P ´ oczos, Eric Xing, Hy Trac, Shirley Ho, and Jeff ´ Schneider. Fast function to function regression. In Artificial Intelligence and Statistics, pp. 717– 725, 2015.
|
| 232 |
+
|
| 233 |
+
Junier B Oliva, Barnabas P ´ oczos, and Jeff G Schneider. Distribution to distribution regression. In ´ ICML (3), pp. 1049–1057, 2013.
|
| 234 |
+
|
| 235 |
+
Junier B Oliva, Willie Neiswanger, Barnabas P ´ oczos, Jeff G Schneider, and Eric P Xing. Fast ´ distribution to real regression. In AISTATS, pp. 706–714, 2014.
|
| 236 |
+
|
| 237 |
+
Roberto Perotti. Growth, income distribution, and democracy: what the data say. Journal of Economic growth, 1(2):149–187, 1996.
|
| 238 |
+
Barnabas P ´ oczos, Aarti Singh, Alessandro Rinaldo, and Larry A Wasserman. Distribution-free ´ distribution regression. In AISTATS, pp. 507–515, 2013.
|
| 239 |
+
David E Rumelhart, Geoffrey E Hinton, and Ronald J Williams. Learning internal representations by error propagation. Technical report, DTIC Document, 1985.
|
| 240 |
+
David E Rumelhart, Geoffrey E Hinton, and Ronald J Williams. Learning representations by backpropagating errors. Cognitive modeling, 5(3):1, 1988.
|
| 241 |
+
Eduardo Schwartz and James E Smith. Short-term variations and long-term dynamics in commodity prices. Management Science, 46(7):893–911, 2000.
|
| 242 |
+
Yee Whye Teh, Max Welling, Simon Osindero, and Geoffrey E Hinton. Energy-based models for sparse overcomplete representations. Journal of Machine Learning Research, 4(Dec):1235–1260, 2003.
|
| 243 |
+
George E Uhlenbeck and Leonard S Ornstein. On the theory of the brownian motion. Physical review, 36(5):823, 1930.
|
| 244 |
+
Jose G Vega and Jan M Smolarski. Forecasting ftse index using global stock markets. International Journal of Economics and Finance, 4(4):3, 2012.
|
| 245 |
+
Fa-Yueh Wu. The potts model. Reviews of modern physics, 54(1):235, 1982.
|
| 246 |
+
Bowen Zhang, Lech Aleksander Grzelak, and Cornelis Willebrordus Oosterlee. Efficient pricing of commodity options with early-exercise under the ornstein–uhlenbeck process. Applied Numerical Mathematics, 62(2):91–111, 2012.
|
| 247 |
+
|
| 248 |
+
# A DERIVATIONS OF COST GRADIENTS
|
| 249 |
+
|
| 250 |
+
In Section 2.4, we presented the key equation for deriving backpropagation gradients:
|
| 251 |
+
|
| 252 |
+
$$
|
| 253 |
+
\frac { \partial P _ { 1 } ^ { ( L ) } \left( s _ { 1 } ^ { ( L ) } \right) } { \partial P _ { k } ^ { ( l ) } \left( s _ { k } ^ { ( l ) } \right) } = \sum _ { j } ^ { n } \sum _ { s _ { j } ^ { ( l + 1 ) } } \frac { \partial P _ { 1 } ^ { ( L ) } \left( s _ { 1 } ^ { ( L ) } \right) } { \partial P _ { j } ^ { ( l + 1 ) } \left( s _ { j } ^ { ( l + 1 ) } \right) } \frac { \partial P _ { j } ^ { ( l + 1 ) } \left( s _ { j } ^ { ( l + 1 ) } \right) } { \partial P _ { k } ^ { ( l ) } \left( s _ { k } ^ { ( l ) } \right) }
|
| 254 |
+
$$
|
| 255 |
+
|
| 256 |
+
To derive the cost gradients for optimization, we need the derivative of the final output node distribution with respect to the network parameters. For instance, for the network weights:
|
| 257 |
+
|
| 258 |
+
$$
|
| 259 |
+
\frac { \partial P _ { 1 } ^ { ( L ) } \left( s _ { 1 } ^ { ( L ) } \right) } { \partial w _ { k i } ^ { ( l ) } } = \sum _ { s _ { k } ^ { ( l ) } } \frac { \partial P _ { 1 } ^ { ( L ) } \left( s _ { 1 } ^ { ( L ) } \right) } { \partial P _ { k } ^ { ( l ) } \left( s _ { k } ^ { ( l ) } \right) } \frac { \partial P _ { k } ^ { ( l ) } \left( s _ { k } ^ { ( l ) } \right) } { \partial w _ { k i } ^ { ( l ) } }
|
| 260 |
+
$$
|
| 261 |
+
|
| 262 |
+
We first derive the intermediate gradient terms required to obtain the gradients in Eq. (10) and proceed to derive gradients for the network parameters. All of the equations work on the discretized distributions, where the integrals are now expressed in summations.
|
| 263 |
+
|
| 264 |
+
# A.1 DERIVATION OF INTERMEDIATE BACKPROPAGATION TERMS
|
| 265 |
+
|
| 266 |
+
We start with deriving the final term of Eq. (10) which is the gradient of the upper layer node distribution with respect to the incoming lower node distribution. The subscripts and superscripts are renamed for ease of explanation in later derivations.
|
| 267 |
+
|
| 268 |
+
$$
|
| 269 |
+
\frac { \partial P _ { k } ^ { ( l ) } \left( s _ { k } ^ { ( l ) } \right) } { \partial P _ { i } ^ { ( l - 1 ) } \left( s _ { i } ^ { ( l - 1 ) } \right) } = \sum _ { s _ { k } ^ { ( l ) ^ { \prime } } } \frac { \partial P _ { k } ^ { ( l ) } \left( s _ { k } ^ { ( l ) } \right) } { \partial \tilde { P } _ { k } ^ { ( l ) } \left( s _ { k } ^ { ( l ) ^ { \prime } } \right) } \frac { \partial \tilde { P } _ { k } ^ { ( l ) } \left( s _ { k } ^ { ( l ) ^ { \prime } } \right) } { \partial P _ { i } ^ { ( l - 1 ) } \left( s _ { i } ^ { ( l - 1 ) } \right) }
|
| 270 |
+
$$
|
| 271 |
+
|
| 272 |
+
The above derivative is a consequence of the normalization step taken in Eq. (7). At each node, we need to compute the derivative of the normalized distribution with respect to the unnormalized distribution. Recall $\begin{array} { r } { { P } _ { k } ^ { ( l ) } \left( s _ { k } ^ { ( l ) } \right) = \frac { \tilde { P } _ { k } ^ { ( l ) } \left( s _ { k } ^ { ( l ) } \right) } { Z _ { k } ^ { ( l ) } } } \end{array}$ , where $\begin{array} { r } { Z _ { k } ^ { ( l ) } = \sum _ { s _ { k } ^ { ( l ) ^ { \prime } } } \tilde { P } _ { k } ^ { ( l ) } \left( s _ { k } ^ { ( l ) ^ { \prime } } \right) . } \end{array}$
|
| 273 |
+
|
| 274 |
+
$$
|
| 275 |
+
\frac { \partial P _ { k } ^ { ( l ) } \left( s _ { k } ^ { ( l ) } \right) } { \partial \tilde { P } _ { k } ^ { ( l ) } \left( s _ { k } ^ { ( l ) \prime } \right) } = \left\{ \begin{array} { l l } { \frac { 1 } { Z _ { k } ^ { ( l ) } } - \frac { \tilde { P } _ { k } ^ { ( l ) } \left( s _ { k } ^ { ( l ) } \right) } { \left( Z _ { k } ^ { ( l ) } \right) ^ { 2 } } \quad } & { \mathrm { i f } s _ { k } ^ { ( l ) } = s _ { k } ^ { ( l ) ^ { \prime } } } \\ { - \frac { \tilde { P } _ { k } ^ { ( l ) } \left( s _ { k } ^ { ( l ) } \right) } { \left( Z _ { k } ^ { ( l ) } \right) ^ { 2 } } \quad } & { \mathrm { o t h e r w i s e } } \end{array} \right.
|
| 276 |
+
$$
|
| 277 |
+
|
| 278 |
+
For the final term of Eq. (12), $\frac { \partial \tilde { P } _ { k } ^ { ( l ) } \left( s _ { k } ^ { ( l ) ^ { \prime } } \right) } { \partial P _ { i } ^ { ( l - 1 ) } \left( s _ { i } ^ { ( l - 1 ) } \right) }$ , the derivation proceeds from the propagation step in Eq. (5), reproduced here in discrete form.
|
| 279 |
+
|
| 280 |
+
$$
|
| 281 |
+
\tilde { P } _ { k } ^ { ( l ) } \left( s _ { k } ^ { ( l ) } \right) = \exp \left( B \left( s _ { k } ^ { ( l ) } \right) \right) \prod _ { i } ^ { n } \left\{ \sum _ { s _ { i } ^ { ( l - 1 ) } } P _ { i } ^ { ( l - 1 ) } \left( s _ { i } ^ { ( l - 1 ) } \right) \exp \left[ - w _ { k i } ^ { ( l ) } \left( \frac { s _ { k } ^ { ( l ) } - s _ { i } ^ { ( l - 1 ) } } { \Delta } \right) ^ { 2 } \right] \right\}
|
| 282 |
+
$$
|
| 283 |
+
|
| 284 |
+
By substituting
|
| 285 |
+
|
| 286 |
+
$$
|
| 287 |
+
\begin{array} { c } { { \beta \left( s _ { k } ^ { ( l ) } \right) = \exp \left( B \left( s _ { k } ^ { ( l ) } \right) \right) , } } \\ { { \gamma _ { i } \left( s _ { k } ^ { ( l ) } \right) = \displaystyle \sum _ { s _ { i } ^ { ( l - 1 ) } } P _ { i } ^ { ( l - 1 ) } \left( s _ { i } ^ { ( l - 1 ) } \right) \exp \left[ - w _ { k i } ^ { ( l ) } \left( \frac { s _ { k } ^ { ( l ) } - s _ { i } ^ { ( l - 1 ) } } { \Delta } \right) ^ { 2 } \right] , } } \end{array}
|
| 288 |
+
$$
|
| 289 |
+
|
| 290 |
+
we obtain
|
| 291 |
+
|
| 292 |
+
$$
|
| 293 |
+
\tilde { P } _ { k } ^ { ( l ) } \left( s _ { k } ^ { ( l ) } \right) = \beta \left( s _ { k } ^ { ( l ) } \right) \prod _ { i } ^ { n } \gamma _ { i } \left( s _ { k } ^ { ( l ) } \right) .
|
| 294 |
+
$$
|
| 295 |
+
|
| 296 |
+
Eq. (15) is a product of variables and its derivative with respect to any variable is obtained by product rule.
|
| 297 |
+
|
| 298 |
+
$$
|
| 299 |
+
\frac { \partial \tilde { P } _ { k } ^ { ( l ) } \left( s _ { k } ^ { ( l ) } \right) } { \partial x } = \tilde { P } _ { k } ^ { ( l ) } \left( s _ { k } ^ { ( l ) } \right) \left( \frac { \partial \beta \left( s _ { k } ^ { ( l ) } \right) } { \partial \left( s _ { k } ^ { ( l ) } \right) } + \sum _ { i } ^ { n } \frac { \partial \gamma _ { i } \left( s _ { k } ^ { ( l ) } \right) } { \partial x } \right) ,
|
| 300 |
+
$$
|
| 301 |
+
|
| 302 |
+
where x can be one of the lower layer node probabilities P (l−1)i $P _ { i } ^ { ( l - 1 ) } \left( s _ { i } ^ { ( l - 1 ) } \right)$ , or one of the network parameters $( w _ { k i } ^ { ( l ) } , b _ { a , k } ^ { ( l ) } , b _ { q , k } ^ { ( l ) } , \lambda _ { a , k } ^ { ( l ) } , \lambda _ { q , k } ^ { ( l ) } )$ . Now we can derive the final term of Eq. (12).
|
| 303 |
+
|
| 304 |
+
$$
|
| 305 |
+
\begin{array} { r l r } { { \frac { \partial \tilde { P } _ { k } ^ { ( l ) } ( s _ { k } ^ { ( l ) } ) } { \partial P _ { i } ^ { ( l - 1 ) } ( s _ { i } ^ { ( l - 1 ) } ) } = \tilde { P } _ { k } ^ { ( l ) } ( s _ { k } ^ { ( l ) } ) \frac { \frac { \partial \gamma _ { * i } ( s _ { k } ^ { ( l ) } ) } { \partial P _ { i } ^ { ( l - 1 ) } ( s _ { i } ^ { ( l - 1 ) } ) } } { \gamma _ { i } ( s _ { k } ^ { ( l ) } ) } } } \\ & { } & { = \tilde { P } _ { k } ^ { ( l ) } ( s _ { k } ^ { ( l ) } ) \frac { \exp [ - w _ { k i } ^ { ( l ) } ( \frac { s _ { k } ^ { ( l ) } - s _ { i } ^ { ( l - 1 ) } } { \Delta } ) ^ { 2 } ] } { \gamma _ { i } ( s _ { k } ^ { ( l ) } ) } } \end{array}
|
| 306 |
+
$$
|
| 307 |
+
|
| 308 |
+
# A.2 DERIVATION OF GRADIENTS WITH RESPECT TO NETWORK PARAMETERS
|
| 309 |
+
|
| 310 |
+
The derivatives of the unnormalized probability distribution of a node with respect to the connecting weights and bias parameters can be derived from Eq. (16).
|
| 311 |
+
|
| 312 |
+
First, for each node, we compute the derivative of its unnormalized distribution with respect to an incoming weight.
|
| 313 |
+
|
| 314 |
+
$$
|
| 315 |
+
\frac { \partial \tilde { P } _ { k } ^ { ( l ) } \left( s _ { k } ^ { ( l ) } \right) } { \partial w _ { k i } ^ { ( l ) } } = \frac { \tilde { P } _ { k } ^ { ( l ) } } { \gamma _ { i } \left( s _ { k } ^ { ( l ) } \right) } \frac { \partial \gamma _ { i } \left( s _ { k } ^ { ( l ) } \right) } { \partial w _ { k i } ^ { ( l ) } } ,
|
| 316 |
+
$$
|
| 317 |
+
|
| 318 |
+
where
|
| 319 |
+
|
| 320 |
+
$$
|
| 321 |
+
\frac { \partial \gamma _ { i } \left( s _ { k } ^ { ( l ) } \right) } { \partial w _ { k i } ^ { ( l ) } } = \sum _ { s _ { i } ^ { ( l - 1 ) } } P _ { i } ^ { ( l - 1 ) } \left( s _ { i } ^ { ( l - 1 ) } \right) \exp \left[ - w _ { k i } ^ { ( l ) } \left( \frac { s _ { k } ^ { ( l ) } - s _ { i } ^ { ( l - 1 ) } } { \Delta } \right) ^ { 2 } \right] \left[ - \left( \frac { s _ { k } ^ { ( l ) } - s _ { i } ^ { ( l - 1 ) } } { \Delta } \right) ^ { 2 } \right] .
|
| 322 |
+
$$
|
| 323 |
+
|
| 324 |
+
Similarly, for the bias parameters, we derive the gradients from Eq. (16). Here we show for $b _ { a , k } ^ { ( l ) }$
|
| 325 |
+
|
| 326 |
+
$$
|
| 327 |
+
\frac { \partial \tilde { P } _ { k } ^ { ( l ) } \left( s _ { k } ^ { ( l ) } \right) } { \partial b _ { a , k } ^ { ( l ) } } = \frac { \tilde { P } _ { k } ^ { ( l ) } \left( s _ { k } ^ { ( l ) } \right) } { \beta \left( s _ { k } ^ { ( l ) } \right) } \frac { \partial \beta \left( s _ { k } ^ { ( l ) } \right) } { \partial b _ { a , k } ^ { ( l ) } } ,
|
| 328 |
+
$$
|
| 329 |
+
|
| 330 |
+
where
|
| 331 |
+
|
| 332 |
+
$$
|
| 333 |
+
\frac { \partial \beta \left( s _ { k } ^ { ( l ) } \right) } { \partial b _ { a , k } ^ { ( l ) } } = \frac { \partial \exp \left( \boldsymbol { B } \left( s _ { k } ^ { ( l ) } \right) \right) } { \partial b _ { a , k } ^ { ( l ) } } = \frac { \partial \boldsymbol { B } \left( s _ { k } ^ { ( l ) } \right) } { \partial b _ { a , k } ^ { ( l ) } } \beta \left( s _ { k } ^ { ( l ) } \right) ,
|
| 334 |
+
$$
|
| 335 |
+
|
| 336 |
+
and
|
| 337 |
+
|
| 338 |
+
$$
|
| 339 |
+
\frac { \partial B \left( s _ { k } ^ { ( l ) } \right) } { \partial b _ { a , k } ^ { ( l ) } } = \left\{ \begin{array} { l l } { - \frac { s _ { k } ^ { ( l ) } - \lambda _ { a , k } ^ { ( l ) } } { \Delta } \quad } & { \mathrm { i f } s _ { k } ^ { ( l ) } > \lambda _ { a , k } ^ { ( l ) } } \\ { \frac { s _ { k } ^ { ( l ) } - \lambda _ { a , k } ^ { ( l ) } } { \Delta } \quad } & { \mathrm { o t h e r w i s e } } \end{array} \right.
|
| 340 |
+
$$
|
| 341 |
+
|
| 342 |
+
The derivatives for the other bias parameters can be obtained similarly.
|
| 343 |
+
|
| 344 |
+
$$
|
| 345 |
+
\frac { \partial B \left( s _ { k } ^ { ( l ) } \right) } { \partial b _ { q , k } ^ { ( l ) } } = - \left( \frac { s _ { k } ^ { ( l ) } - \lambda _ { q , k } ^ { ( l ) } } { \Delta } \right) ^ { 2 }
|
| 346 |
+
$$
|
| 347 |
+
|
| 348 |
+
$$
|
| 349 |
+
\frac { \partial B \left( s _ { k } ^ { ( l ) } \right) } { \partial \lambda _ { a , k } ^ { ( l ) } } = \left\{ b _ { a , k } ^ { ( l ) } \qquad \mathrm { i f ~ } s _ { k } ^ { ( l ) } > \lambda _ { a , k } ^ { ( l ) } \right. \qquad { \partial \mathrm { t h e r w i s e } }
|
| 350 |
+
$$
|
| 351 |
+
|
| 352 |
+
$$
|
| 353 |
+
\begin{array} { c l l } { \displaystyle \frac { \partial B \left( s _ { k } ^ { ( l ) } \right) } { \partial \lambda _ { q , k } ^ { ( l ) } } = - 2 b _ { q , k } ^ { ( l ) } \left( \frac { s _ { k } ^ { ( l ) } - \lambda _ { q , k } ^ { ( l ) } } { \Delta } \right) \left( - \frac { 1 } { \Delta } \right) } \\ { \displaystyle } & { = \frac { 2 b _ { q , k } ^ { ( l ) } } { \Delta ^ { 2 } } \left( s _ { k } ^ { ( l ) } - \lambda _ { q , k } ^ { ( l ) } \right) } \end{array}
|
| 354 |
+
$$
|
| 355 |
+
|
| 356 |
+
# B DRN NETWORK ARCHITECTURE FOR SYNTHETIC DATASET
|
| 357 |
+
|
| 358 |
+
In this section, show the DRN network architecture used for the synthetic dataset results presented in Fig. 4a. There is one input node and one output node connected by a number of hidden layers of arbitrary width. All layers are fully-connected.
|
| 359 |
+
|
| 360 |
+
Table 4: DRN network architecture for the models presented in Fig. 4a. The network architecture is denoted as such: Eg. $1 \cdot 4 \mathrm { x } 3 \textrm { - } 1 \colon 1$ input node, followed by 4 layers each having 3 nodes, and 1 output node
|
| 361 |
+
|
| 362 |
+
<table><tr><td rowspan=1 colspan=1>No. of model parameters</td><td rowspan=1 colspan=1>L2 test loss</td><td rowspan=1 colspan=1>DRN network architecture</td></tr><tr><td rowspan=1 colspan=1>85</td><td rowspan=1 colspan=1>0.69</td><td rowspan=1 colspan=1>1 - 4x3 - 1</td></tr><tr><td rowspan=1 colspan=1>340</td><td rowspan=1 colspan=1>0.45</td><td rowspan=1 colspan=1>1-4x8-1</td></tr><tr><td rowspan=1 colspan=1>624</td><td rowspan=1 colspan=1>0.42</td><td rowspan=1 colspan=1>1- 5x10 -1</td></tr><tr><td rowspan=1 colspan=1>2044</td><td rowspan=1 colspan=1>0.37</td><td rowspan=1 colspan=1>1 - 5x20-1</td></tr><tr><td rowspan=1 colspan=1>3484</td><td rowspan=1 colspan=1>0.37</td><td rowspan=1 colspan=1>1- 8x20- 1</td></tr></table>
|
| 363 |
+
|
| 364 |
+
# C COMPARISON OF PREDICTION TIMES
|
| 365 |
+
|
| 366 |
+
We compare the mean prediction time per data for DRN and the baseline methods. All runs were conducted on the CPU. For the synthetic dataset, we have shown the test loss for varying parameter sizes. For a fair comparison of runtime, for each method we chose a model size which gave a test L2 loss of about 0.37. For all the datasets, MLP has the fastest prediction time, followed by DRN and then 3BE.
|
| 367 |
+
|
| 368 |
+
Table 5: Comparison of mean prediction time per data for the experiments.
|
| 369 |
+
|
| 370 |
+
<table><tr><td rowspan=2 colspan=1></td><td rowspan=1 colspan=4>Mean prediction time per data/ms</td></tr><tr><td rowspan=1 colspan=1>Synthetic data</td><td rowspan=1 colspan=1>Ornstein-Uhlenbeck process</td><td rowspan=1 colspan=1>Stock data</td><td rowspan=1 colspan=1>Cell data</td></tr><tr><td rowspan=1 colspan=1>DRN</td><td rowspan=1 colspan=1>1.65</td><td rowspan=1 colspan=1>0.64</td><td rowspan=1 colspan=1>0.59</td><td rowspan=1 colspan=1>0.29</td></tr><tr><td rowspan=1 colspan=1>MLP</td><td rowspan=1 colspan=1>0.03</td><td rowspan=1 colspan=1>0.01</td><td rowspan=1 colspan=1>0.01</td><td rowspan=1 colspan=1>0.06</td></tr><tr><td rowspan=1 colspan=1>3BE</td><td rowspan=1 colspan=1>4.69</td><td rowspan=1 colspan=1>0.98</td><td rowspan=1 colspan=1>0.88</td><td rowspan=1 colspan=1>0.32</td></tr></table>
|
md/train/ByfyHh05tQ/ByfyHh05tQ.md
ADDED
|
@@ -0,0 +1,418 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# L E A R N I N G T O D E S I G N R N A
|
| 2 |
+
|
| 3 |
+
Frederic Runge1∗, Danny Stoll1∗, Stefan Falkner1,2 & Frank Hutter1 1Department of Computer Science, University of Freiburg 2Bosch Center for Artificial Intelligence, Robert Bosch GmbH {runget,stolld,sfalkner,fh}@cs.uni-freiburg.de
|
| 4 |
+
|
| 5 |
+
# A B S T R A C T
|
| 6 |
+
|
| 7 |
+
Designing RNA molecules has garnered recent interest in medicine, synthetic biology, biotechnology and bioinformatics since many functional RNA molecules were shown to be involved in regulatory processes for transcription, epigenetics and translation. Since an RNA’s function depends on its structural properties, the RNA Design problem is to find an RNA sequence which satisfies given structural constraints. Here, we propose a new algorithm for the RNA Design problem, dubbed LEARNA. LEARNA uses deep reinforcement learning to train a policy network to sequentially design an entire RNA sequence given a specified target structure. By meta-learning across 65 000 different RNA Design tasks for one hour on 20 CPU cores, our extension Meta-LEARNA constructs an RNA Design policy that can be applied out of the box to solve novel RNA Design tasks. Methodologically, for what we believe to be the first time, we jointly optimize over a rich space of architectures for the policy network, the hyperparameters of the training procedure and the formulation of the decision process. Comprehensive empirical results on two widely-used RNA Design benchmarks, as well as a third one that we introduce, show that our approach achieves new state-of-the-art performance on the former while also being orders of magnitudes faster in reaching the previous state-of-the-art performance. In an ablation study, we analyze the importance of our method’s different components.
|
| 8 |
+
|
| 9 |
+
# 1 I N T R O D U C T I O N
|
| 10 |
+
|
| 11 |
+
RNA is one of the major classes of information-carrying biopolymers in the cells of living organisms. Recent studies revealed a key role of functional non-protein-coding RNAs (ncRNAs) in regulatory processes and transcription control, which have also been connected to certain diseases like Parkinson’s disease and Alzheimer’s disease (ENCODE Project Consortium and others, 2004; Gstir et al., 2014; Kaushik et al., 2018). Functional ncRNAs are involved in the modulation of epigenetic marks, altering of messenger RNA (mRNA) stability, mRNA translation, alternative splicing, signal transduction and scaffolding of large macromolecular complexes (Vandivier et al., 2016). Therefore, engineering of ncRNA molecules is of growing importance with applications ranging from biotechnology and medicine to synthetic biology (Delebecque et al., 2011; 2012; Guo et al., 2010; Meyer et al., 2015). In fact, successful attempts to create functional RNA sequences in vitro and in vivo have been reported (Dotu et al., 2014; Wachsmuth et al., 2013).
|
| 12 |
+
|
| 13 |
+
At its most basic structural form, RNA is a sequence of the four nucleotides Adenine (A), Guanine $( G )$ , Cytosine $( C )$ and Uracile $( U )$ . This nucleotide sequence is called the RNA sequence, or primary structure. While the RNA sequence serves as the blueprint, the functional structure of the RNA molecule is determined by the folding translating the RNA sequence into its 3D tertiary structure. The intrinsic thermodynamic properties of the sequence dictate the resulting fold. The hydrogen bonds formed between two corresponding nucleotides constitute one of the driving forces in the thermodynamic model and influence the tertiary structure heavily. The structure that encompasses these hydrogen bonds is commonly referred to as the secondary structure of RNA. Many algorithms for RNA tertiary structure design directly work on RNA secondary structures (Kerpedjiev et al., 2015; Zhao et al., 2012; Reinharz et al., 2012). Therefore, fast and accurate algorithms for RNA secondary structure design could advance the current state of the art in RNA engineering.
|
| 14 |
+
|
| 15 |
+

|
| 16 |
+
Figure 1: Illustration of the RNA Design problem using a folding algorithm $\mathcal { F }$ and the dot-bracket notation. Given the desired RNA secondary structure represented in the dot-bracket notation (a), the task is to design an RNA sequence (b) that folds into the desired secondary structure (c).
|
| 17 |
+
|
| 18 |
+
The problem of finding an RNA sequence that folds into a desired secondary structure is known as the RNA Design problem or RNA inverse folding (Hofacker et al., 1994). Most algorithms for RNA Design focus on search strategies that start with an initial nucleotide sequence and modify it to find a solution for the given secondary structure (Hofacker et al., 1994; Andronescu et al., 2004; Taneda, 2011; Esmaili-Taheri et al., 2014; Eastman et al., 2018). In contrast, in this paper we describe a novel generative deep reinforcement learning (RL) approach to this problem. Our contributions are as follows:
|
| 19 |
+
|
| 20 |
+
• We describe LEARNA, a deep RL algorithm for RNA Design. LEARNA trains a policy network that, given a target secondary structure, can be rolled out to sequentially predict the entire RNA sequence. After generating an RNA sequence, our approach folds this sequence, locally adapts it, and uses the distance of the resulting structure to the target structure as an error signal for the RL agent.
|
| 21 |
+
We describe Meta-LEARNA, a version of LEARNA that learns a single policy across many RNA Design tasks directly applicable to new RNA Design tasks. Specifically, it learns a conditional generative model from which we can sample candidate RNA sequences for a given RNA target structure, solving many problems with the first sample.
|
| 22 |
+
• Since validation in RNA Design literature is often done using undisclosed data sources (Eastman et al., 2018; Yang et al., 2017) and previous benchmarks do not have a training split associated with them (Taneda, 2011; Anderson-Lee et al., 2016; Kleinkauf et al., 2015), we introduce a new benchmark dataset with an explicit training, validation and test split.
|
| 23 |
+
• We jointly optimize the architecture of the policy network together with training hyperparameters and the state representation. By assessing the importance of these choices, we show that this is essential to achieve best results. To the best of our knowledge, this is the first application of architecture search (AS) to RL, the first application of AS to metalearning, and the first time AS is used to choose the best combination of convolutional and recurrent layers.
|
| 24 |
+
• A comprehensive empirical analysis shows that our approach achieves new state-of-the-art performance on the two most commonly used RNA Design benchmark datasets: RfamTaneda (following Taneda (2011)) and Eterna100 (following Anderson-Lee et al. (2016)). Furthermore, Meta-LEARNA achieves the results of the previous state-of-the-art approaches $6 3 \times$ and $1 7 6 5 \times$ faster, respectively.
|
| 25 |
+
|
| 26 |
+
# 2 T H E R N A D E S I G N P R O B L E M
|
| 27 |
+
|
| 28 |
+
RNA folding algorithms $\mathcal { F }$ map from an RNA sequence to a representation of its secondary structure. The RNA Design problem aims to find an inverse mapping for a given RNA folding algorithm $\mathcal { F }$ :
|
| 29 |
+
|
| 30 |
+
Definition 1 (RNA Design). Given a folding algorithm $\mathcal { F }$ and a target RNA secondary structure $\omega$ the RNA Design problem is to find an RNA sequence $\phi \in N ^ { | \omega | } = \{ A , G , C , U \} ^ { | \omega | }$ that satisfies $\omega = \mathcal { F } ( \phi )$ .
|
| 31 |
+
|
| 32 |
+
In this paper, we employ the most common folding algorithm: the Zuker algorithm (Zuker & Stiegler, 1981; Zuker & Sankoff, 1984), which uses a thermodynamic model to minimize the free energy to find the most stable conformation of the RNA secondary structure. We note, however, that our approach is not limited to it and would also directly apply for any other RNA folding algorithm.
|
| 33 |
+
|
| 34 |
+
RNA secondary structures are often represented using the dot-bracket notation, where dots stand for unbound sites and nucleotides connected by a hydrogen bond are marked by opening and closing brackets.1 Figure 1 illustrates the RNA Design problem and the dot-bracket notation.
|
| 35 |
+
|
| 36 |
+
Most algorithms for RNA Design employ a structural loss function $L _ { \omega } ( \mathcal { F } ( \phi ) )$ to quantify the difference between the target structure $\omega$ and the structure resulting from folding an RNA sequence $\phi$ . A minimizer of this loss corresponds to a solution to the RNA Design problem for a specified target structure $\omega$ :
|
| 37 |
+
|
| 38 |
+
$$
|
| 39 |
+
\phi ^ { * } \in \arg \operatorname* { m i n } _ { \phi \in N ^ { | \omega | } } L _ { \omega } ( \mathcal { F } ( \phi ) ) \qquad .
|
| 40 |
+
$$
|
| 41 |
+
|
| 42 |
+
A common loss function, which we also employ in this work, is the Hamming distance (Hamming, 1950) between two structures. We note that multiple RNA sequences may fold to the same secondary structure, such that the RNA Design problem does not generally have a unique solution; one could distinguish between solutions by preferring more stable folds, targeting a specific GC content, or satisfying other constraints; all of these could be incorporated into the loss function being optimized.
|
| 43 |
+
|
| 44 |
+
# 3 L E A R N I N G T O D E S I G N R N A
|
| 45 |
+
|
| 46 |
+
In this section we describe our novel generative approach for the RNA Design problem based on reinforcement learning. We first formulate RNA Design as a decision process and then propose several strategies to yield agents that learn to design RNA end-to-end.
|
| 47 |
+
|
| 48 |
+
# 3 . 1 M O D E L L I N G R N A D E S I G N A S A D E C I S I O N P R O C E S S
|
| 49 |
+
|
| 50 |
+
We propose to model the RNA Design problem with respect to a given target structure $\omega$ as the undiscounted decision process $D _ { \omega } : = ( S , { \mathcal { A } } , { \mathcal { R } } _ { \omega } , { \mathcal { P } } _ { \omega } )$ ; its components (the state space $s$ , the action space $\mathcal { A }$ , the reward function $\mathcal { R } _ { \omega }$ and the transition function $\mathcal { P } _ { \omega }$ ) are specified in the paragraphs below. The RNA Design problem is defined with respect to a folding algorithm, which we denote as $\mathcal F ( \cdot )$ ; further, we denote the set of dot-bracket encoded RNA secondary structures with $\Omega$ .
|
| 51 |
+
|
| 52 |
+
Action space In each episode, the agent has the task to design an RNA sequence that folds into the given $\omega \in \Omega$ . To design a candidate solution $\phi \in N ^ { | \omega | }$ , the agent places nucleotides by choosing an action $a ^ { t }$ at each time step $t$ . For unpaired sites, $a ^ { t }$ corresponds to one of the four RNA nucleotides (G, C, A or U); for paired sites, two nucleotides are placed simultaneously. In our formulation, these two nucleotides correspond to one of the Watson-Crick base pairs (GC, CG, AU, or UA). At time step $t$ , the action space can then be defined as
|
| 53 |
+
|
| 54 |
+
$$
|
| 55 |
+
\mathcal { A } : = \{ 0 , 1 , 2 , 3 \} \equiv \left\{ \begin{array} { l l } { \{ A , G , C , U \} } & { \mathrm { f o r ~ } \mathcal { C } _ { \omega } ( t ) = . } \\ { \{ G C , C G , A U , ~ U A \} } & { \mathrm { f o r ~ } \mathcal { C } _ { \omega } ( t ) = ( } & { \mathrm { [ ^ { * } o p e n i n g ~ b r a c k e t " ] } } \end{array} \right.
|
| 56 |
+
$$
|
| 57 |
+
|
| 58 |
+
where $\mathcal { C } _ { \omega } ( t )$ is the t-th character of the target structure $\omega$ . There is no action for closing brackets, as the associated sites are assigned nucleotides when encountering the corresponding opening bracket. See Figure 2 for an illustration of the action rollout.
|
| 59 |
+
|
| 60 |
+
State space The agent chooses an action $a ^ { t }$ based on the state $s ^ { t }$ provided by the environment. We formulated states to provide local information to the agent. For this we set $s ^ { \dot { t } }$ to the $( 2 \kappa + 1 )$ -gram centered around the t-th site of the target structure $\omega$ , where $\kappa$ is a hyperparameter we dub the state radius. To be able to construct this centered $\mathbf { n }$ -gram at all sites, we introduced $\kappa$ padding characters at the start and the end of the target structure. Formally, the state space can then be written as
|
| 61 |
+
|
| 62 |
+
$$
|
| 63 |
+
S : = \{ 0 , 1 , 2 , 3 \} ^ { 2 \kappa + 1 } \equiv ( \mathcal { B } \cup \{ \mathrm { p a d d i n g } \} ) ^ { 2 \kappa + 1 } \qquad ,
|
| 64 |
+
$$
|
| 65 |
+
|
| 66 |
+
where $\boldsymbol { B }$ is the set of symbols in the dot-bracket notation: a dot, an opening and a closing bracket.
|
| 67 |
+
|
| 68 |
+

|
| 69 |
+
Figure 2: Illustration of an action rollout in the proposed decision process. The agent sequentially builds a candidate solution by choosing actions to place nucleotides. At paired sites, as indicated by a pair of brackets, two nucleotides are placed simultaneously $t = 0$ and $t = 1$ ); while at unpaired sites a single nucleotide is placed $t = 2$ ).
|
| 70 |
+
|
| 71 |
+
Transition Function Since at each time step $t$ the state $s ^ { t }$ is set to a fixed $( 2 \kappa + 1 )$ -gram, the transition function $\mathcal { P } _ { \omega }$ is deterministic and defined accordingly.
|
| 72 |
+
|
| 73 |
+
Reward Function At the terminal time step $T$ the agent has assigned nucleotides to all sites of the candidate solution $\phi$ and the environment generates the (only non-zero) reward $\mathcal { R } _ { \omega } ^ { T } ( \phi )$ . This reward is based on the Hamming distance $\mathrm { d } _ { \mathrm { H } } ( \mathcal { F } ( \bar { \phi } ) , \omega )$ between the folded candidate solution ${ \mathcal { F } } ( \phi )$ and the target structure $\omega$ . We normalize this distance with respect to the sequence length $| \omega |$ to formulate the loss function $L _ { \omega } ( \mathcal { F } ( \phi ) ) : = \mathrm { d _ { H } } ( \mathcal { F } ( \phi ) , \omega ) / \left| \omega \right|$ . To solve the optimization problem in Equation 1, we set
|
| 74 |
+
|
| 75 |
+
$$
|
| 76 |
+
\begin{array} { r } { \mathcal { R } _ { \omega } ^ { T } ( \phi ) : = \left( 1 - L _ { \omega } ( \mathcal { F } ( \phi ) ) \right) ^ { \alpha } \qquad , } \end{array}
|
| 77 |
+
$$
|
| 78 |
+
|
| 79 |
+
where $\alpha > 1$ is a hyperparameter to shape the reward. Additionally, we include a local improvement step to increase sample efficiency and boost performance of the stochastic RL agent as follows: If $\mathrm { d } _ { \mathrm { H } } ( \mathcal { F } ( \phi ) , \omega ) < \xi$ , where $\xi$ is a hyperparameter, we search through neighboring primary sequences by exhaustively trying all combinations for the mismatched sites, returning the minimum Hamming distance observed. In our experiments, we set $\xi = 5$ , which corresponds to at most $4 ^ { 4 } = 2 5 { \bar { 6 } }$ neighboring sequences. Pseudocode for computing $\mathcal { R } _ { \omega } ^ { T } ( \phi )$ can be found in Appendix A.
|
| 80 |
+
|
| 81 |
+
# 3 . 2 O B T A I N I N G P O L I C I E S F O R R N A D E S I G N
|
| 82 |
+
|
| 83 |
+
We use deep reinforcement learning to learn the parameters $\theta$ of policy networks $\pi ^ { \theta }$ . Our policy networks consist of an embedding layer for the input state and a deep neural network; this neural network optionally contains convolutional, recurrent and fully-connected layers, and its precise architecture is jointly optimized together with the hyperparameters as described in Section 4. We propose several strategies to learn the parameters $\theta$ of a given policy network as detailed below.
|
| 84 |
+
|
| 85 |
+
LEARNA The LEARNA strategy learns to design a sequence for the target structure $\omega$ in an online fashion, from scratch. The parameters $\theta$ are randomly initialized before the agent episodically interacts with the decision process $\mathcal { D } _ { \omega }$ . For updating the parameters we use the policy gradient method PPO (Schulman et al., 2017), which was recently successfully applied to several other problems (Heess et al., 2017; Bansal et al., 2018; Zoph et al., 2018).
|
| 86 |
+
|
| 87 |
+
Meta-LEARNA Meta-LEARNA uses a meta-learning approach (Lemke et al., 2015) that views the RNA Design problems associated with the target structures in the training set $\Omega _ { \mathrm { t r a i n } }$ as tasks and learns to transfer knowledge across them. Each of the target structures $\omega _ { i } \in \Omega _ { \operatorname { t r a i n } }$ defines a different decision process $\mathcal { D } _ { \omega _ { i } }$ ; using asynchronous parallel PPO updates, we train a single policy network on all of these. Once the training is finished, the parameters $\theta$ are fixed and $\pi ^ { \theta }$ can be applied to the decision process $\mathcal { D } _ { \omega }$ by sampling from the learned generative model.
|
| 88 |
+
|
| 89 |
+
Meta-LEARNA-Adapt Meta-LEARNA-Adapt combines the previous two strategies: First, we obtain an initialization for the parameters $\theta$ by running Meta-LEARNA on $\Omega _ { \mathrm { t r a i n } }$ . Then, when applied to the decision process $\mathcal { D } _ { \omega }$ , the parameters $\theta$ are further adapted using the LEARNA strategy.
|
| 90 |
+
|
| 91 |
+
# 4 J O I N T A R C H I T E C T U R E A N D H Y P E R P A R A M E T E R S E A R C H
|
| 92 |
+
|
| 93 |
+
One problem of current deep reinforcement learning methods is that their performance can be very sensitive to choices regarding the architecture of the policy network, the training hyperparameters, and the formulation of the problem as a decision process (Henderson et al., 2017). Therefore, we propose to use techniques from the field of automatic machine learning (Hutter et al., 2019), in particular an efficient Bayesian optimization method (Falkner et al., 2018), to address the problems of architecture search (AS) (Zoph & Le, 2017; Elsken et al., 2018) and hyperparameter optimization as a joint optimization problem. To automatically select the best neural architecture based on data, we define a search space that includes both elements of convolutional neural networks (CNNs) and recurrent neural networks (RNNs) and let the optimizer choose the best combination of the two.
|
| 94 |
+
|
| 95 |
+
In this section, we present our representation of the search space and describe our approach to optimizing performance.
|
| 96 |
+
|
| 97 |
+
# 4 . 1 S E A R C H S P A C E
|
| 98 |
+
|
| 99 |
+
Our search space has three components described in the following: choices about the policy network’s architecture, environment parameters (including the representation of the state and the reward), and training hyperparameters.
|
| 100 |
+
|
| 101 |
+
Neural Architecture We construct the architecture of our policy network as follows: (1) the dot bracket representation of the state is either binary encoded (distinguishing between paired and unpaired sites) or processed by an embedding layer that converts the symbol-based representation into a learnable numerical one for each site. Then, (2) an optional CNN with at most two layers can be selected, followed by (3) an optional LSTM with at most two layers. Finally, we always add (4) a shallow fully-connected network with one or two layers, which outputs the distribution over actions. This parameterization covers a broad range of possible neural architectures while keeping the dimensionality of the search space relatively modest (similar to what is achieved by the focus on cell spaces (Zoph et al., 2018) in the recent literature on architecture search).
|
| 102 |
+
|
| 103 |
+
Environment Parameters Since our ultimate goal is not to solve a specific decision process (DP), but to use the best DP for solving our problem, we also optimize parameters concerning the state representation and the reward: We optimize the number of sites symmetrically centered around the current one via the state radius $\kappa$ (see Section 3.1), and the shape of the reward via the parameter $\alpha$ (see Equation 4).
|
| 104 |
+
|
| 105 |
+
Training Hyperparameters Since the performance of neural networks strongly depends on the training hyperparameters governing optimization and regularization, we optimized some of the parameters of PPO, which we employ for training the network: learning rate, batch size, and strength of the entropy regularization.
|
| 106 |
+
|
| 107 |
+
Overall, these design choices yield a 14-dimensional search space comprising mostly integer variables. The complete list of parameters, their types, ranges, and the priors we used over them can be found in Appendix E. We used almost identical search spaces for LEARNA and Meta-LEARNA, but adapted the ranges for the learning rate and the entropy regularization slightly based on preliminary experiments. Please refer to Tables 3 and 4 in Appendix E for more details.
|
| 108 |
+
|
| 109 |
+
# 4 . 2 S E A R C H P R O C E D U R E
|
| 110 |
+
|
| 111 |
+
We now describe how we optimized performance in the search space described above. We chose the recently-proposed optimizer BOHB (Falkner et al., 2018) to find good configurations, because it can handle mixed discrete/continuous spaces, utilize parallel resources, and additionally can exploit cheap approximations of the objective function to speed up the optimization. These so-called lowfidelity approximations can be achieved in numerous ways, e.g., limiting the training time, the number of independent repetitions of the evaluations, or using only fractions of the data. In our setting, we decided to limit the wall-clock time for training (Meta-LEARNA) or the evaluations (LEARNA). For a detailed description of the limits, we refer to Appendix E.
|
| 112 |
+
|
| 113 |
+
Datasets To properly optimize the listed design choices without overfitting, we needed a designated training and validation dataset. However, previous benchmarks used in the RNA Design literature do not provide a train/validation/test split. This led us to create the benchmark Rfam-Learn based on the Rfam database version 13.0 (Kalvari et al., 2017), by employing the protocol described in Appendix B. All datasets we used for this paper are listed in detail in Appendix D, however, we note that all our approaches were optimized using only our newly introduced training and validation sets (Rfam-Learn-Train and Rfam-Learn-Validation).
|
| 114 |
+
|
| 115 |
+
Budgets Due to the very different standardized evaluation timeouts of the benchmarks we report on (10 minutes for Rfam-Taneda and up to 24 hours for Eterna100), we experimented with different budgets for LEARNA. In particular, we ran our optimization with a 10-minute and a 30-minute evaluation timeout (the former matching the Rfam-Taneda limit, the latter being larger, but still computationally far more manageable than a 24 hour budget per sequence). After the optimization, we evaluated both alternatives on our full validation set with a limit of 1 hour with the following modification that we also used when evaluating on the Eterna100 and Rfam-Learn-Test benchmarks: matching the evaluation timeout during optimization, every 10 or 30 minutes, the policy network and all internal variables of PPO are reinitialized, i.e., we perform a restart of the algorithm to overcome occasional stagnation of PPO. We found the 30-minute variant to perform better, and refer to this as LEARNA throughout the rest of the paper.
|
| 116 |
+
|
| 117 |
+
Objective Despite the fact that RL is known to often yield noisy or unreliable outcomes in single optimization runs (Henderson et al., 2017), we actively decided to only use a single optimization run and a single validation set for each configuration to keep the optimization manageable. To counteract the problems associated with single (potentially) noisy observations, we studied three different loss functions for the hyperparameter optimization: (a) The number of unsolved sequences, (b) the sum of mean distances, and (c) the sum of minimum distances to the target structure. While we ultimately seek to minimize (a), this is a rather noisy and discrete quantity. In preliminary experiments, optimizing (b) turned out to be inferior to (c), presumably because the former punishes exploration by the agent more, while the latter rewards ultimately getting close to the solution. Therefore, we used (c) during the optimization, but picked the final configuration using (a) among the top five configurations. All of these evaluations were based on the validation set.
|
| 118 |
+
|
| 119 |
+
# 5 R E L AT E D W O R K
|
| 120 |
+
|
| 121 |
+
Architecture and Hyperparameter Search Mendoza et al. (2016) and Zela et al. (2018) previously studied joint architecture search and hyperparameter optimization. Here, we adapted this approach for the use in deep RL and to a richer space of architectures. Although RL has been used for performing architecture search (Zoph & Le, 2017; Mortazi & Bagci, 2018) and joint architecture and hyperparameter search (Wong et al., 2018), to the best of our knowledge, this paper is the first application of the reverse: architecture search for RL. For detailed reviews on architecture search and hyperparameter optimization, we refer to Elsken et al. (2018) and Feurer & Hutter (2018), respectively.
|
| 122 |
+
|
| 123 |
+
Matter Engineering Variational autoencoders, generative adversarial networks and reinforcement learning have recently shown promising results in protein design and other related problems in matter engineering (Gupta & Zou, 2018; Greener et al., 2018; Olivecrona et al., 2017). For a detailed review on machine learning approaches in the field of matter engineering, we refer to Sanchez-Lengeling & Aspuru-Guzik (2018). In recent work related to RNA Design, a convolutional neural network based auto-encoder with additional supervised fine tuning was proposed to score on-target and off-target efficacy of guide RNAs for the genome editing technique CRISPR/CAS9 (Chuai et al., 2018). This automated efficacy scoring could inform future endeavours in designing guide RNAs. Our work adds evidence for the competitiveness of generative machine learning methods in this general problem domain.
|
| 124 |
+
|
| 125 |
+
RNA Design Most algorithms targeting the RNA Design problem are either local or global algorithms. Local approaches commonly operate on a single sequence and try to find a solution by changing a small number of nucleotides at a time, guided by the loss function (RNAInverse (Hofacker et al., 1994), RNA-SSD (Andronescu et al., 2004), INFO-RNA (Busch & Backofen, 2006), NUPACK (Dirks & Pierce, 2004; Zadeh et al., 2010), ERD (Esmaili-Taheri et al., 2014) and the approach by Eastman et al. (2018)). Global methods, on the other hand, either have a large number of candidates being manipulated, or model a global distribution from which samples are generated (MODENA (Taneda, 2011), antaRNA (Kleinkauf et al., 2015) and MCTS-RNA (Yang et al., 2017)). A more detailed review can be found in Churkin et al. (2017).
|
| 126 |
+
|
| 127 |
+
RNA Design Using Human Solutions Very recently, another, less general direction to RNA Design imposed a prior of human knowledge onto the agent (Shi et al., 2018). In this approach, a large ensemble of models is trained on human solutions to manually designed RNA Design problems. Further, for refinement of the candidate solution, an adaptive walk procedure using human strategies is used, incorporating deep domain-knowledge guiding the agent’s behaviour. Totalized results over all models of the ensemble were reported on the Eterna100 benchmark (Anderson-Lee et al., 2016), which solely consists of manually designed RNA Design problems, and which we also report on here. Although the approach showed good results in this one benchmark, human solutions and strategies were not available for our further benchmarks derived from natural RNA structures, and due to computational costs we could not include this work in our comparison.
|
| 128 |
+
|
| 129 |
+
RL for Combinatorial Problems The work by Bello et al. (2016) heavily influenced our work. In it, the authors apply RL to combinatorial problems, namely the Traveling Salesman Problem. The agent proposes complete solutions rather than manipulating an existing one, and it is trained using an episodic reward, in this case the negative tour length. Inspired by this work, we propose to frame the RNA Design problem as a RL problem where each candidate solution is designed from scratch. In our approach, the agent predicts which nucleotides to place next into the sequence, learning to design RNA end-to-end.
|
| 130 |
+
|
| 131 |
+
RL for RNA Design Our generative approach is in stark contrast to the recent work Eastman et al. (2018) carried out in parallel to and independently from ours. Eastman et al. used RL to perform a local search starting from a randomly initialized sequence. The RL agent applies local modifications to design a solution that folds into the desired target structure. The current sequence constitutes the state and each action represents changing an unpaired nucleotide or a pair of nucleotides. After each action the current sequence is evaluated utilizing the Zuker algorithm (Zuker & Stiegler, 1981; Zuker & Sankoff, 1984) and the agent only receives a nonzero reward signal once it finds a correct sequence. The agent’s policy is a convolutional neural network pre-trained on fixed-length, randomly generated sequences. In the remainder of the paper, we refer to this approach as RL-LS, since the RL agent performs a local search.
|
| 132 |
+
|
| 133 |
+
# 6 E X P E R I M E N T S
|
| 134 |
+
|
| 135 |
+
We evaluate our approaches against state-of-the-art methods and perform an ablation study to assess the importance of our method’s components. We report results on two established benchmarks from the literature and on our own benchmark. Full information on the three benchmarks is given in Appendix D. For each benchmark, we followed its standard evaluation protocol, performing multiple attempts (in the following referred to as evaluation runs) with a fixed time limit for each target structure. For each benchmark, we report the accumulated number of solved targets across all evaluation runs and provide means and standard deviations around the mean for all experiments. All methods were compared on the same hardware, each allowed one CPU core per evaluation of a single target structure. The methods we compare to either do not have clear/exposed hyperparameters (RNAinverse), or were optimized by the original authors (antaRNA, RL-LS, and MCTS-RNA); all methods – including our own – might benefit from further optimization of their hyperparameters for specific benchmarks. Details concerning the used software and hardware are listed in Appendix C.
|
| 136 |
+
|
| 137 |
+
# 6 . 1 C O M P A R AT I V E S T U D Y
|
| 138 |
+
|
| 139 |
+
The results of our comparative study, summarized in Table 1 and Figure 3, are as follows.
|
| 140 |
+
|
| 141 |
+
Table 1: Fraction of solved target structures for MCTS-RNA, antaRNA, RL-LS, RNAInverse, LEARNA, Meta-LEARNA, and Meta-LEARNA-Adapt on the two benchmarks from the literature (Eterna100 and Rfam-Taneda), as well as on our newly introduced benchmark (Rfam-Learn-Test). A target structure counts as solved if a solution was found in any of the evaluation runs.
|
| 142 |
+
|
| 143 |
+
<table><tr><td rowspan="2">METHOD</td><td colspan="3">SOLVED SEQUENCES [%]</td></tr><tr><td>ETERNA100</td><td>RFAM-TANEDA</td><td>RFAM-LEARN-TEST</td></tr><tr><td>MCTS-RNA</td><td>57</td><td>79</td><td>97</td></tr><tr><td>ANTARNA</td><td>58</td><td>66</td><td>100</td></tr><tr><td>RL-LS</td><td>59</td><td>62</td><td>62</td></tr><tr><td>RNAINVERSE</td><td>60</td><td>59</td><td>95</td></tr><tr><td>LEARNA</td><td>67</td><td>79</td><td>97</td></tr><tr><td>META-LEARNA</td><td>68</td><td>83</td><td>100</td></tr><tr><td>META-LEARNA-ADAPT</td><td>68</td><td>83</td><td>99</td></tr></table>
|
| 144 |
+
|
| 145 |
+
Eterna100 Solving up to $68 \%$ (Meta-LEARNA and Meta-LEARNA-Adapt) of the target structures, all our approaches achieve clear new state-of-the-art results on the Eterna100 benchmark. Additionally, Meta-LEARNA only needs about 25 seconds to reach the final performance of any other method $( \approx 1 7 6 5 \times$ faster) and achieves new state-of-the-art results in less than 30 seconds. This performance is stable through all of the five evaluation runs performed. Remarkably, all versions of our approach already achieve new state-of-the-art performance in each single evaluation run (see Appendix I).
|
| 146 |
+
|
| 147 |
+
Rfam-Taneda Concerning the Rfam-Taneda benchmark, LEARNA is on par with the current stateof-the-art results of MCTS-RNA after 110 seconds $\approx 2 \times$ faster). Meta-LEARNA and Meta-LEARNAAdapt achieve this previous state-of-the-art performance in less than 5 seconds $( \approx 6 3 \times$ faster) and new state-of-the-art results after 400 seconds and 90 seconds, respectively (see Appendix J), solving $83 \%$ of the target structures.
|
| 148 |
+
|
| 149 |
+
Rfam-Learn Only Meta-LEARNA and antaRNA were able to solve all of the target structures (in 29 minutes and 20 minutes, respectively). Except for RL-LS, all algorithms could solve at least $9 5 \%$ of the target structures.
|
| 150 |
+
|
| 151 |
+
In summary, our novel deep reinforcement learning algorithm achieved the best performance on all of the three benchmarks while being much faster than all other algorithms on the two benchmarks from the literature (Eterna100 and Rfam-Taneda). Our meta-learning approach Meta-LEARNA learned a representation of the dynamics underlying RNA Design and is capable of transferring this knowledge to new RNA Design tasks. As our additional analysis in Appendix H shows, it also scales better with sequence length than existing approaches. For a detailed list of the performance of all algorithms on specific target structures, we refer to the detail tables in Appendix K.
|
| 152 |
+
|
| 153 |
+
# 6 . 2 A B L AT I O N S T U D Y A N D P A R A M E T E R I M P O R T A N C E
|
| 154 |
+
|
| 155 |
+
To study the influence of the different components and parameters on the performance of our approach, we performed an ablation study and a functional analysis of variance (fANOVA) (Hooker, 2007; Hutter et al., 2014).
|
| 156 |
+
|
| 157 |
+
Ablation Study For the ablation, we excluded either the adaptation option, the local improvement step, or the restart option. For all variants of our approach we observed a clear boost in performance from the local improvement step, while the other components tended to have a smaller impact (see Figure 8 in Appendix G). We note that we believe the local improvement step could also benefit other generative approaches, such as MCTS-RNA. The restart option only boosted performance on the Eterna100 benchmark, with considerably harder instances and a much longer runtime (see Figure 9 in Appendix G). As already apparent from our comparative study (Section 6.1), the continued adaptation (Meta-LEARNA-Adapt) of the learned parameters did not improve performance. This might be due to us not having optimized hyperparameters for this variant, but simply having reused the same settings as for Meta-LEARNA.
|
| 158 |
+
|
| 159 |
+

|
| 160 |
+
Figure 3: Performance across the time spent on each particular target structure for all methods on the Eterna100 benchmark (top), the Rfam-Taneda benchmark (middle), and the Rfam-Learn-Test benchmark (bottom). On the left we show the total number of target structures that were solved in at least one evaluation run, while the right panels show the average number of solved target structures and the standard deviation around the mean.
|
| 161 |
+
|
| 162 |
+
Parameter Importance The fANOVA results highlight the importance of parameters from all three components of the search space mentioned in Section 4. This emphasizes the importance of the joint optimization of the policy network’s architecture, the environment parameters and the training hyperparameters.
|
| 163 |
+
|
| 164 |
+
All results and a more detailed discussion of our ablation study and the fANOVA results can be found in Appendix G and F, respectively.
|
| 165 |
+
|
| 166 |
+
# 7 C O N C L U S I O N
|
| 167 |
+
|
| 168 |
+
We proposed the deep reinforcement learning algorithm LEARNA for the RNA Design problem to sequentially construct candidate solutions in an end-to-end fashion. By pre-training on a large corpus of biological sequences, a local improvement step to aid the agent, and extensive architecture and hyperparameter optimization, we arrived at Meta-LEARNA, a ready-to-use agent that achieves stateof-the-art results on the Eterna100 (Anderson-Lee et al., 2016) and the Rfam-Taneda benchmark (Taneda, 2011). Our ablation study shows the importance of all components, suggesting that RL with an additional local improvement step can solve the RNA Design problem efficiently. Code and data for reproducing our results is available at https://github.com/automl/learna.
|
| 169 |
+
|
| 170 |
+
# A C K N O W L E D G M E N T S
|
| 171 |
+
|
| 172 |
+
This work was supported by the European Research Council (ERC) under the European Union’s Horizon 2020 research and innovation programme under grant no. 716721, and by the German Research Foundation (DFG), under the BrainLinksBrainTools Cluster of Excellence (grant number EXC 1086). The authors acknowledge support by the state of Baden-Württemberg through bwHPC and the DFG through grant no. INST 39/963-1 FUGG.
|
| 173 |
+
|
| 174 |
+
# R E F E R E N C E S
|
| 175 |
+
|
| 176 |
+
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, Dandelion Mané, Rajat Monga, Sherry Moore, Derek Murray, Chris Olah, Mike Schuster, Jonathon Shlens, Benoit Steiner, Ilya Sutskever, Kunal Talwar, Paul Tucker, Vincent Vanhoucke, Vijay Vasudevan, Fernanda Viégas, Oriol Vinyals, Pete Warden, Martin Wattenberg, Martin Wicke, Yuan Yu, and Xiaoqiang Zheng. TensorFlow: Large-scale machine learning on heterogeneous systems, 2015. URL https://www.tensorflow.org/. Software available from tensorflow.org.
|
| 177 |
+
|
| 178 |
+
Jeff Anderson-Lee, Eli Fisker, Vineet Kosaraju, Michelle Wu, Justin Kong, Jeehyung Lee, Minjae Lee, Mathew Zada, Adrien Treuille, and Rhiju Das. Principles for predicting RNA secondary structure design difficulty. Journal of molecular biology, 428(5):748–757, 2016.
|
| 179 |
+
|
| 180 |
+
Mirela Andronescu, Anthony P. Fejes, Frank Hutter, Holger H. Hoos, and Anne Condon. A New Algorithm for RNA Secondary Structure Design. Journal of Molecular Biology, 336(3): 607–624, 2004. ISSN 0022-2836. doi: https://doi.org/10.1016/j.jmb.2003.12.041. URL http: //www.sciencedirect.com/science/article/pii/S0022283603015596.
|
| 181 |
+
|
| 182 |
+
Trapit Bansal, Jakub Pachocki, Szymon Sidor, Ilya Sutskever, and Igor Mordatch. Emergent complexity via multi-agent competition. In Proceedings of the International Conference on Learning Representations (ICLR’18), 2018. Published online: iclr.cc.
|
| 183 |
+
|
| 184 |
+
Irwan Bello, Hieu Pham, Quoc V Le, Mohammad Norouzi, and Samy Bengio. Neural combinatorial optimization with reinforcement learning. arXiv preprint arXiv:1611.09940, 2016.
|
| 185 |
+
|
| 186 |
+
Anke Busch and Rolf Backofen. INFO-RNA—a fast approach to inverse RNA folding. Bioinformatics, 22(15):1823–1831, 2006. doi: 10.1093/bioinformatics/btl194. URL http: //dx.doi.org/10.1093/bioinformatics/btl194.
|
| 187 |
+
|
| 188 |
+
Guohui Chuai, Hanhui Ma, Jifang Yan, Ming Chen, Nanfang Hong, Dongyu Xue, Chi Zhou, Chenyu Zhu, Ke Chen, Bin Duan, Feng Gu, Sheng Qu, Deshuang Huang, Jia Wei, and Qi Liu. Deepcrispr: optimized crispr guide rna design by deep learning. Genome Biology, 19(1):80, Jun 2018. ISSN 1474-760X. doi: 10.1186/s13059-018-1459-4. URL https://doi.org/10.1186/s13059-018-1459-4.
|
| 189 |
+
|
| 190 |
+
Alexander Churkin, Matan Drory Retwitzer, Vladimir Reinharz, Yann Ponty, Jérôme Waldispühl, and Danny Barash. Design of rnas: comparing programs for inverse rna folding. Briefings in bioinformatics, 19(2):350–358, 2017.
|
| 191 |
+
|
| 192 |
+
Camille J. Delebecque, Ariel B. Lindner, Pamela A. Silver, and Faisal A. Aldaye. Organization of Intracellular Reactions with Rationally Designed RNA Assemblies. Science, 333(6041):470– 474, 2011. ISSN 0036-8075. doi: 10.1126/science.1206938. URL http://science. sciencemag.org/content/333/6041/470.
|
| 193 |
+
|
| 194 |
+
CJ Delebecque, PA Silver, and AB Lindner. Designing and using RNA scaffolds to assemble proteins in vivo. Nature Protocols, 7(10):1797–807, 2012. doi: 10.1038/nprot.2012.102.
|
| 195 |
+
|
| 196 |
+
Robert M. Dirks and Niles A. Pierce. An Algorithm for Computing Nucleic Acid Base-Pairing Probabilities Including Pseudoknots. Journal of Computational Chemistry, 25(10):295—-1304, 2004. doi: 10.1002/jcc.20057.
|
| 197 |
+
|
| 198 |
+
Ivan Dotu, Juan Antonio Garcia-Martin, Betty L. Slinger, Vinodh Mechery, Michelle M. Meyer, and Peter Clote. Complete RNA inverse folding: computational design of functional hammerhead ribozymes. Nucleic Acids Research, 42(18):11752–11762, 2014. doi: 10.1093/nar/gku740. URL http://dx.doi.org/10.1093/nar/gku740.
|
| 199 |
+
|
| 200 |
+
Peter Eastman, Jade Shi, Bharath Ramsundar, and Vijay S Pande. Solving the RNA design problem with reinforcement learning. PLoS computational biology, 14(6):e1006176, 2018.
|
| 201 |
+
|
| 202 |
+
Thomas Elsken, Jan Hendrik Metzen, and Frank Hutter. Neural Architecture Search: A Survey. ArXiv e-prints, August 2018.
|
| 203 |
+
|
| 204 |
+
ENCODE Project Consortium and others. The ENCODE (encyclopedia of DNA elements) project. Science, 306(5696):636–640, 2004.
|
| 205 |
+
|
| 206 |
+
Ali Esmaili-Taheri, Mohammad Ganjtabesh, and Morteza Mohammad-Noori. Evolutionary solution for the RNA design problem. Bioinformatics, 30(9):1250–1258, 2014. doi: 10. 1093/bioinformatics/btu001. URL http://dx.doi.org/10.1093/bioinformatics/ btu001.
|
| 207 |
+
|
| 208 |
+
Stefan Falkner, Aaron Klein, and Frank Hutter. BOHB: Robust and efficient hyperparameter optimization at scale. In Proceedings of the 35th International Conference on Machine Learning (ICML 2018), pp. 1436–1445, July 2018.
|
| 209 |
+
|
| 210 |
+
Matthias Feurer and Frank Hutter. Hyperparameter optimization. In Frank Hutter, Lars Kotthoff, and Joaquin Vanschoren (eds.), AutoML: Methods, Sytems, Challenges, chapter 1, pp. 3–37. Springer, December 2018. To appear.
|
| 211 |
+
|
| 212 |
+
Walter Fontana, Peter F. Stadler, Erich G. Bornberg-Bauer, Thomas Griesmacher, Ivo L. Hofacker, Manfred Tacker, Pedro Tarazona, Edward D. Weinberger, and Peter Schuster. Rna folding and combinatory landscapes. Phys. Rev. E, 47:2083–2099, Mar 1993. doi: 10.1103/PhysRevE.47. 2083. URL https://link.aps.org/doi/10.1103/PhysRevE.47.2083.
|
| 213 |
+
|
| 214 |
+
Joe G Greener, Lewis Moffat, and David T Jones. Design of metalloproteins and novel protein folds using variational autoencoders. Scientific reports, 8(1):16189, 2018.
|
| 215 |
+
|
| 216 |
+
Ronald Gstir, Simon Schafferer, Marcel Scheideler, Matthias Misslinger, Matthias Griehl, Nina Daschil, Christian Humpel, Gerald J. Obermair, Claudia Schmuckermair, Joerg Striessnig, Bernhard E. Flucher, and Alexander Hüttenhofer. Generation of a neuro-specific microarray reveals novel differentially expressed noncoding RNAs in mouse models for neurodegenerative diseases. RNA, 20(12):1929–1943, 2014.
|
| 217 |
+
|
| 218 |
+
Peixuan Guo, Oana Coban, Nicholas M. Snead, Joe Trebley, Steve Hoeprich, Songchuan Guo, and Yi Shu. Engineering RNA for Targeted siRNA Delivery and Medical Application. Advanced Drug Delivery Reviews, 62(6):650 – 666, 2010. ISSN 0169-409X. doi: https://doi. org/10.1016/j.addr.2010.03.008. URL http://www.sciencedirect.com/science/ article/pii/S0169409X10000773. From Biology to Materials: Engineering DNA and RNA for Drug Delivery and Nanomedicine.
|
| 219 |
+
|
| 220 |
+
Anvita Gupta and James Zou. Feedback gan (fbgan) for dna: a novel feedback-loop architecture for optimizing protein functions. arXiv preprint arXiv:1804.01694, 2018.
|
| 221 |
+
|
| 222 |
+
R. W. Hamming. Error detecting and error correcting codes. The Bell System Technical Journal, 29 (2):147–160, April 1950. ISSN 0005-8580. doi: 10.1002/j.1538-7305.1950.tb00463.x.
|
| 223 |
+
|
| 224 |
+
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.
|
| 225 |
+
|
| 226 |
+
Peter Henderson, Riashat Islam, Philip Bachman, Joelle Pineau, Doina Precup, and David Meger. Deep reinforcement learning that matters. arXiv preprint arXiv:1709.06560, 2017.
|
| 227 |
+
|
| 228 |
+
Ivo Hofacker, Walter Fontana, Peter Stadler, Sebastian Bonhoeffer, Manfred Tacker, and Peter Schuster. Fast Folding and Comparison of RNA Secondary Structures. Monatshefte fuer Chemie/Chemical Monthly, 125:167–188, 02 1994.
|
| 229 |
+
|
| 230 |
+
Giles Hooker. Generalized functional ANOVA diagnostics for high-dimensional functions of dependent variables. Journal of Computational and Graphical Statistics, 16(3):709–732, 2007.
|
| 231 |
+
|
| 232 |
+
F. Hutter, H. Hoos, and K. Leyton-Brown. An efficient approach for assessing hyperparameter importance. In E. Xing and T. Jebara (eds.), Proceedings of the 31th International Conference on Machine Learning, (ICML’14), pp. 754–762. Omnipress, 2014.
|
| 233 |
+
|
| 234 |
+
Frank Hutter, Lars Kotthoff, and Joaquin Vanschoren (eds.). Automated Machine Learning: Methods, Systems, Challenges. Springer, 2019. In press, available at http://automl.org/book.
|
| 235 |
+
|
| 236 |
+
Ioanna Kalvari, Joanna Argasinska, Natalia Quinones-Olvera, Eric P Nawrocki, Elena Rivas, Sean R Eddy, Alex Bateman, Robert D Finn, and Anton I Petrov. Rfam 13.0: shifting to a genome-centric resource for non-coding RNA families. Nucleic acids research, 46(D1):D335–D342, 2017.
|
| 237 |
+
|
| 238 |
+
Kriti Kaushik, Ambily Sivadas, Shamsudheen Karuthedath Vellarikkal, Ankit Verma, Rijith Jayarajan, Satyaprakash Pandey, Tavprithesh Sethi, Souvik Maiti, Vinod Scaria, and Sridhar Sivasubbu. RNA secondary structure profiling in zebrafish reveals unique regulatory features. BMC Genomics, 20:147, 2018.
|
| 239 |
+
|
| 240 |
+
P Kerpedjiev, C Höner zu Siederdissen, and IL Hofacker. Predicting RNA 3D structure using a coarse-grain helix-centered model. RNA, 21(6):1110–1121, 2015. doi: 10.1261/rna.047522.114.
|
| 241 |
+
|
| 242 |
+
Robert Kleinkauf, Torsten Houwaart, Rolf Backofen, and Martin Mann. antaRNA–Multi-objective inverse folding of pseudoknot RNA using ant-colony optimization. BMC bioinformatics, 16(1): 389, 2015.
|
| 243 |
+
|
| 244 |
+
Christiane Lemke, Marcin Budka, and Bogdan Gabrys. Metalearning: a survey of trends and technologies. 44(1):117–130, Jun 2015.
|
| 245 |
+
|
| 246 |
+
Ronny Lorenz, Stephan H. Bernhart, Christian Höner zu Siederdissen, Hakim Tafer, Christoph Flamm, Peter F. Stadler, and Ivo L. Hofacker. Viennarna package 2.0. Algorithms for Molecular Biology, 6(1):26, Nov 2011a. ISSN 1748-7188. doi: 10.1186/1748-7188-6-26. URL https: //doi.org/10.1186/1748-7188-6-26.
|
| 247 |
+
|
| 248 |
+
Ronny Lorenz, Stephan H Bernhart, Christian Hoener Zu Siederdissen, Hakim Tafer, Christoph Flamm, Peter F Stadler, and Ivo L Hofacker. Viennarna package 2.0. Algorithms for Molecular Biology, 6(1):26, 2011b.
|
| 249 |
+
|
| 250 |
+
H. Mendoza, A. Klein, M. Feurer, J. Springenberg, and F. Hutter. Towards automatically-tuned neural networks. In ICML 2016 AutoML Workshop, 2016.
|
| 251 |
+
|
| 252 |
+
Sarai Meyer, James Chappell, Sitara Sankar, Rebecca Chew, and Julius B. Lucks. Improving fold activation of small transcription activating RNAs (STARs) with rational RNA engineering strategies. Biotechnology and Bioengineering, 113(1):216–225, 2015. doi: 10.1002/bit.25693. URL https://onlinelibrary.wiley.com/doi/abs/10.1002/bit.25693.
|
| 253 |
+
|
| 254 |
+
Aliasghar Mortazi and Ulas Bagci. Automatically designing cnn architectures for medical image segmentation. In Yinghuan Shi, Heung-Il Suk, and Mingxia Liu (eds.), Machine Learning in Medical Imaging, pp. 98–106, Cham, 2018. Springer International Publishing. ISBN 978-3-030- 00919-9.
|
| 255 |
+
|
| 256 |
+
Marcus Olivecrona, Thomas Blaschke, Ola Engkvist, and Hongming Chen. Molecular de-novo design through deep reinforcement learning. Journal of cheminformatics, 9(1):48, 2017.
|
| 257 |
+
|
| 258 |
+
Vladimir Reinharz, François Major, and Jérôme Waldispühl. Towards 3d structure prediction of large rna molecules: an integer programming framework to insert local 3d motifs in rna secondary structure. Bioinformatics, 28(12):i207–i214, 2012. doi: 10.1093/bioinformatics/bts226. URL http://dx.doi.org/10.1093/bioinformatics/bts226.
|
| 259 |
+
|
| 260 |
+
Benjamin Sanchez-Lengeling and Alán Aspuru-Guzik. Inverse molecular design using machine learning: Generative models for matter engineering. Science, 361(6400):360–365, 2018. ISSN 0036-8075. doi: 10.1126/science.aat2663. URL http://science.sciencemag.org/ content/361/6400/360.
|
| 261 |
+
|
| 262 |
+
Michael Schaarschmidt, Alexander Kuhnle, and Kai Fricke. Tensorforce: A tensorflow library for applied reinforcement learning. Web page, 2017. URL https://github.com/ reinforceio/tensorforce.
|
| 263 |
+
|
| 264 |
+
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.
|
| 265 |
+
|
| 266 |
+
Bruce A Shapiro. An algorithm for comparing multiple rna secondary structures. Bioinformatics, 4 (3):387–393, 1988.
|
| 267 |
+
|
| 268 |
+
Jade Shi, Rhiju Das, and Vijay S Pande. Sentrna: Improving computational rna design by incorporating a prior of human design strategies. arXiv preprint arXiv:1803.03146, 2018.
|
| 269 |
+
|
| 270 |
+
Akito Taneda. MODENA: a multi-objective RNA inverse folding. Advances and applications in bioinformatics and chemistry: AABC, 4:1, 2011.
|
| 271 |
+
|
| 272 |
+
Lee E. Vandivier, Stephen J. Anderson, Shawn W. Foley, and Brian D. Gregory. The conservation and function of RNA secondary structure in plants. Annual review of plant biology, 67:463–488, 2016.
|
| 273 |
+
|
| 274 |
+
Manja Wachsmuth, Sven Findeiß, Nadine Weissheimer, Peter F. Stadler, and Mario Mörl. De novo design of a synthetic riboswitch that regulates transcription termination. Nucleic Acids Research, 41(4):2541–2551, 2013. doi: 10.1093/nar/gks1330. URL http://dx.doi.org/10.1093/ nar/gks1330.
|
| 275 |
+
|
| 276 |
+
Catherine Wong, Neil Houlsby, Yifeng Lu, and Andrea Gesmundo. Transfer learning with neural automl. In Advances in Neural Information Processing Systems, pp. 8366–8375, 2018.
|
| 277 |
+
|
| 278 |
+
Xiufeng Yang, Kazuki Yoshizoe, Akito Taneda, and Koji Tsuda. RNA inverse folding using Monte Carlo tree search. BMC bioinformatics, 18(1):468, 2017.
|
| 279 |
+
|
| 280 |
+
Joseph N. Zadeh, Conrad D. Steenberg, Justin S. Bois, Brian R. Wolfe, Marshall B. Pierce, Asif R. Khan, Robert M. Dirks, and Niles A. Pierce. Nupack: Analysis and design of nucleic acid systems. Journal of Computational Chemistry, 32(1):170–173, 2010. doi: 10.1002/jcc.21596. URL https://onlinelibrary.wiley.com/doi/abs/10.1002/jcc.21596.
|
| 281 |
+
|
| 282 |
+
Arber Zela, Aaron Klein, Stefan Falkner, and Frank Hutter. Towards automated deep learning: Efficient joint neural architecture and hyperparameter search. In ICML 2018 AutoML Workshop, July 2018.
|
| 283 |
+
|
| 284 |
+
Y Zhao, Y Huang, Z Gong, Y Wang, J Man, and Y Xiao. Automated and fast building of threedimensional RNA structures. Scientific Reports, 2(734), 2012. doi: 10.1038/srep00734.
|
| 285 |
+
|
| 286 |
+
B. Zoph and Q. V. Le. Neural architecture search with reinforcement learning. In Proceedings of the International Conference on Learning Representations (ICLR’17), 2017. Published online: iclr.cc.
|
| 287 |
+
|
| 288 |
+
B. Zoph, V. Vasudevan, J. Shlens, and Q. V. Le. Learning transferable architectures for scalable image recognition. In Proceedings of the International Conference on Computer Vision and Pattern Recognition (CVPR’18), 2018.
|
| 289 |
+
|
| 290 |
+
M Zuker and P. Stiegler. Optimal computer folding of large RNA sequences using thermodynamics and auxiliary information. Nucleic Acids Research, 9(1):133–148, 1981.
|
| 291 |
+
|
| 292 |
+
Michael Zuker and David Sankoff. RNA secondary structures and their prediction. Bulletin of Mathematical Biology, 46(4):591 – 621, 1984. ISSN 0092-8240. doi: https://doi.org/ 10.1016/S0092-8240(84)80062-2. URL http://www.sciencedirect.com/science/ article/pii/S0092824084800622.
|
| 293 |
+
|
| 294 |
+
# A P S E U D O C O D E F O R C O M P U T I N G T H E R E WA R D
|
| 295 |
+
|
| 296 |
+
<table><tr><td colspan="2">Algorithm 1: Local improvement step (LIS) using Hamming distance dH(·,·) and folding algorithm F(·).</td></tr><tr><td>output : locally improved distance</td><td>input : designed solution Φ, target structure ω, initial Hamming distance δ</td></tr><tr><td>1△←の 2 nucleotide_combinations ← {A, G, U, C}δ</td><td></td></tr><tr><td></td><td>3 candidate_solutions ← replaceMismatchedSites(Φ,ω,nucleotide_combinations)</td></tr><tr><td></td><td>4 foreach γ ∈candidate_solutions do</td></tr><tr><td>5</td><td>δ↑dH(F(φ),ω)</td></tr><tr><td>6</td><td>if δ=O then</td></tr><tr><td>7</td><td>return δ</td></tr><tr><td>8</td><td>end</td></tr><tr><td>9</td><td>△↑△U{δ}</td></tr><tr><td>10 end</td><td></td></tr><tr><td colspan="2">11 return min △</td></tr><tr><td colspan="2"></td></tr></table>
|
| 297 |
+
|
| 298 |
+
<table><tr><td>Algorithm 2: Computing reward RT() using LIS (Algorithm 1), Hamming distance dH(· ) and folding algorithm F().</td></tr><tr><td>input : designed solution $, target structure ω, LIS cut-off parameter § output : reward RT(Φ)</td></tr><tr><td>1 δ←dH(F(Φ),ω)</td></tr><tr><td>2 if δ=O then</td></tr><tr><td>return δ</td></tr><tr><td>4 else ifδ<then</td></tr><tr><td>5|δ←LIS(Φ,ω,δ) 6 end</td></tr><tr><td>7 L←δ/ω</td></tr><tr><td>8 return (1 - Lω)α</td></tr><tr><td></td></tr></table>
|
| 299 |
+
|
| 300 |
+
# B C R E AT I N G T H E R F A M - L E A R N D ATA S E T S
|
| 301 |
+
|
| 302 |
+
To ensure a large enough and interesting dataset, we downloaded all families of the Rfam database version 13.0 (Kalvari et al., 2017) and folded them using the ViennaRNA package (Lorenz et al., 2011a). We removed all secondary structures with multiple known solutions, and only kept structures with lengths between 50 and 450 to match the existing datasets. To focus on the harder sequences, we only kept the ones that a single run of MCTS-RNA could not solve within 30 seconds. We chose MCTS-RNA for filtering as it was the fastest algorithm from the literature. The remaining secondary structures were split into a training set of 65000, a validation set of 100, and a test set of 100 secondary structures.
|
| 303 |
+
|
| 304 |
+
# C S O F T WA R E A N D H A R D WA R E D E TA I L S
|
| 305 |
+
|
| 306 |
+
We used the implementation of the Zuker algorithm provided by ViennaRNA (Lorenz et al., 2011b) versions 2.4.8 (MCTS-RNA, RL-LS and LEARNA), 2.1.9 (antaRNA) and 2.4.9 (RNAInverse). Our implementation uses the reinforcement learning library tensorforce, version 0.3.3 (Schaarschmidt et al., 2017) working with TensorFlow version 1.4.0 (Abadi et al., 2015). All computations were done on Broadwell E5-2630v4 2.2 GHz CPUs with a limitation of 5 GByte RAM per each of the 10 cores. For the training phase of Meta-LEARNA, we used two of these CPUs, but at evaluation time, all methods were only allowed a single core (using core binding).
|
| 307 |
+
|
| 308 |
+
# D B E N C H M A R K S
|
| 309 |
+
|
| 310 |
+
Table 2: Overview on the three benchmarks Eterna100 (Anderson-Lee et al., 2016), Rfam-Taneda (Taneda, 2011) and Rfam-Learn we used for our experiments. The table displays the timeout, the number of evaluations for each target structure, the number of sequences and the range of sequence lengths for the corresponding benchmark.
|
| 311 |
+
|
| 312 |
+
<table><tr><td>DATASET</td><td>TIMEOUT</td><td>EVALUATIONS</td><td>SEQUENCES</td><td>LENGTH</td></tr><tr><td>ETERNA100</td><td>24H</td><td>5</td><td>100</td><td>12-400</td></tr><tr><td>RFAM-TANEDA</td><td>10MIN</td><td>50</td><td>29</td><td>54-451</td></tr><tr><td>RFAM-LEARN-TRAIN</td><td>1</td><td>1</td><td>65000</td><td>50-450</td></tr><tr><td>RFAM-LEARN-VAL</td><td>1</td><td>1</td><td>100</td><td>50-444</td></tr><tr><td>RFAM-LEARN-TEST</td><td>1H</td><td>5</td><td>100</td><td>50-446</td></tr></table>
|
| 313 |
+
|
| 314 |
+
# E J O I N T A R C H I T E C T U R E A N D H Y P E R P A R A M E T E R S E A R C H
|
| 315 |
+
|
| 316 |
+
Here, we provide a detailed description of the search space, the different computational budgets used for optimization, and the final configurations found by the optimizer. The search spaces for LEARNA and Meta-LEARNA can be found in Tables 3 and 4.
|
| 317 |
+
|
| 318 |
+
Table 3: Search space for the agent’s architecture and the hyperparameters used for LEARNA.
|
| 319 |
+
|
| 320 |
+
<table><tr><td>Parameter Name</td><td>Type</td><td>Range</td><td>Prior</td></tr><tr><td>filter size in 1st conv layer</td><td>integer</td><td>{0} U{3,5,...,17}</td><td>uniform</td></tr><tr><td>filter size in 2nd conv layer</td><td>integer</td><td>{0, 3, 5, 7, 9}</td><td>uniform</td></tr><tr><td># filter in 1st conv layer</td><td>integer</td><td>[1,32]</td><td>log-uniform</td></tr><tr><td># filter in 2nd conv layer</td><td>integer</td><td>[1,32]</td><td>log-uniform</td></tr><tr><td>#LSTMlayers</td><td>integer</td><td>[0,2]</td><td>uniform</td></tr><tr><td># units in every LSTM layer</td><td>integer</td><td>[1,64]</td><td>log-uniform</td></tr><tr><td># fully connected layers</td><td>integer</td><td>[1,2]</td><td>uniform</td></tr><tr><td># units in fully connected layer(s)</td><td>integer</td><td>[8,64]</td><td>log-uniform</td></tr><tr><td>state space radius K</td><td>integer</td><td>[0,32]</td><td>uniform</td></tr><tr><td>embedding dimensionality</td><td>integer</td><td>[0,4]</td><td>uniform</td></tr><tr><td>batch size</td><td>integer</td><td>[32,128]</td><td>log-uniform</td></tr><tr><td>entropy regularization</td><td>foat</td><td>[1·10-5,1·10-2]</td><td>log-uniform</td></tr><tr><td>learning rate for PPO</td><td>float</td><td>[1·10-5,1· 10-3]</td><td>log-uniform</td></tr><tr><td>reward exponent α</td><td>float</td><td>[1,10]</td><td>uniform</td></tr></table>
|
| 321 |
+
|
| 322 |
+
Table 4: Modified hyperparameters in the search space used for optimizing Meta-LEARNA compared to Table 3. We adapted these ranges slightly based on preliminary experiments. We hypothesize that the longer training time and the parallel training require smaller learning rates and larger regularization.
|
| 323 |
+
|
| 324 |
+
<table><tr><td>Parameter Name</td><td>Type</td><td>Range</td><td>Prior</td></tr><tr><td>entropy regularization</td><td>float</td><td>[5·10-5,5:10-3]</td><td>log-uniform</td></tr><tr><td>learning rate for PPO</td><td>float</td><td>[1·10-6,1· 10-4]</td><td>log-uniform</td></tr></table>
|
| 325 |
+
|
| 326 |
+
Using varying budgets, we can eliminate bad configurations quickly and focus most of the resources on the promising ones. In BOHB, these budgets are geometrically distributed with a factor of three between them. For LEARNA, we directly optimize the performance on the validation set and use varying evaluation timeouts as budgets, with a maximum of 30 minutes to keep the optimization manageable. For Meta-LEARNA, we vary the training time and keep the evaluation timeout on the validation set fixed at 60 seconds. The maximum timeout of 1 hour on 20 CPU cores was chosen to almost match the timeout of the Eterna100 benchmark for a single sequence and the minimum timeout was set to 400 seconds, chosen by preliminary runs and inspecting the achieved performance. The validation timeout of one minute was chosen such that the training time on the smallest budget of 400 seconds is still larger than the evaluation time for the 100 validation sequences. Additionally, this encourages the agent to find a solution quickly. These considerations lead to the budgets shown in the legends of Figure 4 and Figure 5.
|
| 327 |
+
|
| 328 |
+

|
| 329 |
+
Figure 4: Left: Observed validation loss during the BOHB run for LEARNA. The different budgets $b$ correspond to the timeout for each of the 100 validation sequences. Right: Relationship between the observed validation loss (sum of minimal, normalized Hamming distances) and the fraction of solved sequences.
|
| 330 |
+
|
| 331 |
+

|
| 332 |
+
Figure 5: Left: Observed validation loss during the BOHB run for Meta-LEARNA. The different budgets $b$ corresponds to the training time on $2 0 \mathrm { C P U }$ cores before evaluating on the 100 validation sequences for 60 seconds each. The results seem to suggest that one can achieve a very similar performance with only 20 minutes of training, which could imply that much longer training of the agent might be required for substantially better performance. Right: Relationship between the observed validation loss (sum of minimal, normalized Hamming distances) and the fraction of solved sequences during validation. The plot suggests that our loss metric correlates strongly with the number of successfully found primary sequences.
|
| 333 |
+
|
| 334 |
+
Finally, Table 5 summarizes the evaluated configurations. The biggest differences between LEARNA and Meta-LEARNA can be found among the architectural choices. The LEARNA configuration has a relatively big CNN component and additionally uses a single LSTM layer with 28 units; in contrast, the best found Meta-LEARNA configuration has no LSTM layers and a relatively small CNN component with only 3 filters in the second layer. For both LEARNA and Meta-LEARNA, a modest feed forward component with only one layer suffices, the number of embedding dimensions and the batch sizes are almost identical. The entropy regularization and the learning rate also vary, validating our decision to adapt the search spaces based on preliminary experiments. We expect most of these differences to be the result of the different CPU time budgets, but we do not want to speculate about whether CNNs are inherently better suited to generalizing across sequences than LSTMs based on our results; longer training and more optimization might also produce a configuration for Meta-LEARNA with LSTM cells.
|
| 335 |
+
|
| 336 |
+
To summarize the results from the optimization: The best found configurations vary in key parameters, highlighting the necessity to jointly optimize as many aspects of the RL problem as possible for the given scenario.
|
| 337 |
+
|
| 338 |
+
Table 5: The selected configurations for each scenario.
|
| 339 |
+
|
| 340 |
+
<table><tr><td>Parameter Name</td><td>LEARNA</td><td>Meta-LEARNA</td></tr><tr><td>filter size in 1st conv layer</td><td>17</td><td>11</td></tr><tr><td>filter size in 2nd conv layer</td><td>5</td><td>3</td></tr><tr><td># filters in 1st conv layer</td><td>7</td><td>10</td></tr><tr><td># filters in 2nd conv layer</td><td>18</td><td>3</td></tr><tr><td># fully connected layers</td><td>1</td><td>1</td></tr><tr><td># units in fully connected layer(s)</td><td>57</td><td>52</td></tr><tr><td>#LSTM layers</td><td>1</td><td>0</td></tr><tr><td># units in everyLSTMlayer</td><td>28</td><td>3</td></tr><tr><td>state space radius K</td><td>32</td><td>29</td></tr><tr><td>embedding dimensionality</td><td>3</td><td>2</td></tr><tr><td>batch size</td><td>126</td><td>123</td></tr><tr><td>entropy regularization</td><td>6.76·10-5</td><td>1.51 · 10-4</td></tr><tr><td>learning rate for PPO</td><td>5.99 · 10-4</td><td>6.44 · 10-5</td></tr><tr><td>reward exponent α</td><td>9.34</td><td>8.93</td></tr></table>
|
| 341 |
+
|
| 342 |
+

|
| 343 |
+
F F U N C T I O N A L A N A L Y S I S O F VA R I A N C E F O R M E T A - L E A R N A
|
| 344 |
+
Figure 6: Marginal prediction plots for the most important individual parameters, with all other parameters marginalized out based on a random forest regression model. We plot means of the marginal prediction across the random forest’s individual trees $\pm$ the empirical standard deviation across the trees. The importance numbers given in the figure subtitles measure the fraction of the total variance explained by the respective single parameter.
|
| 345 |
+
|
| 346 |
+
Here, we performed an analysis of variance (ANOVA) that quantifies the global importance of a parameter of Meta-LEARNA by the fraction of the total variance it explains. Because our parameter space is rather high dimensional, and we collected a limited (relative to the dimensionality) and highly biased (because we optimized performance) set of evaluations, we use the functional ANOVA (fANOVA) framework (Hooker, 2007). In particular, we use fANOVA based on random forests as introduced by Hutter et al. (2014). The results are shown in Figures 6 and 7.
|
| 347 |
+
|
| 348 |
+
Among the four most important individual parameters, we found training and regularization hyperparameters (learning rate and entropy regularization in PPO), the reward representation (the reward exponent), and an architectural hyperparameter (number of units in the fully connected layer(s)). This highlights the need to include all components in the optimization.
|
| 349 |
+
|
| 350 |
+
The global analysis performed by fANOVA highlights hyperparameters that impact performance most across the entire search space. As a result, the shown fraction of solved validation sequences is rather low in the plots $( \lesssim 3 5 \%$ , where the best found configurations achieved almost $9 0 \%$ , see Figure 5). It is important to note that the quantitative behavior predicted by the fANOVA does not have to be representative for the best configurations, especially if the good part of the space is rather small. This also means that other hyperparameters, e.g., the architecture and type of the network, can be more important than indicated by the fANOVA in order to reach peak performance.
|
| 351 |
+
|
| 352 |
+
From the plots, we can conclude that a relatively large learning rate performs best on average. Interestingly, it seems to be advantageous to have a limited entropy regularization, which we see as an indicator that the training set is fairly diverse and the problem challenging enough for the agent to keep exploring. The reward exponent should also be set quite high in conjunction with the learning rate (see top right panel of Figure 7).
|
| 353 |
+
|
| 354 |
+

|
| 355 |
+
Figure 7: Marginal prediction plots for the most important pairs of parameters when marginalizing across all other parameters. The importance values shown in the subtitles are the ones by the interaction effect itself (first) and the sum of it and the two individual effects (second).
|
| 356 |
+
|
| 357 |
+
# G A B L A T I O N S T U D Y
|
| 358 |
+
|
| 359 |
+
In addition to the hyperparameter importance study, we assess the contribution of the different components of our approaches with an ablation (Figure 8 and Figure 9). Clearly, a model based agent compared to random actions has the biggest impact on the performance. The second most important component is the local improvement step, which is active once a sequence with less than 5 mismatches has been found. Restarts only seem to affect the performance on the Eterna100 benchmark, where due to the long budget, we only evaluated LEARNA. The seemingly negligible impact of the continued training in Meta-LEARNA-Adapt could increase on datasets more dissimilar to the training data or with an additional optimization of the relevant parameters used for the continuous updates. Potentially, all parameters except the architecture and the state space representation could be optimized to improve performance. This could be investigated in future work.
|
| 360 |
+
|
| 361 |
+

|
| 362 |
+
Figure 8: Ablation study of Meta-LEARNA-Adapt (first row), Meta-LEARNA (second row) and LEARNA (third row) on Rfam-Learn-Test. The left side shows the accumulated number of solved target structures over 5 independent runs, while the right side shows the mean and the standard deviation around the mean.
|
| 363 |
+
|
| 364 |
+

|
| 365 |
+
Figure 9: Ablation study of LEARNA on Eterna100 with an evaluation timeout of 12 hours. The left side shows the accumulated number of solved target structures over 5 independent runs, while the right side shows the mean and the standard deviation around the mean.
|
| 366 |
+
|
| 367 |
+

|
| 368 |
+
Figure 10: Minimum solution times across sequence lengths on the Rfam-Learn-Test benchmark. The solid line represents the evaluation timeout of 1 hour for the Rfam-Learn-Test benchmark and points drawn above this line were not solved.
|
| 369 |
+
|
| 370 |
+
# I C O M P A R I S O N : N U M B E R O F S O L U T I O N S P E R K R U N S
|
| 371 |
+
|
| 372 |
+
Table 6: Comparison of all methods on Eterna100. Results list the number of solved target structures in at least 1, 2, 3, 4, or all of the evaluation runs in percent.
|
| 373 |
+
|
| 374 |
+
<table><tr><td rowspan="2">METHOD</td><td colspan="4">SOLVED SEQUENCES [%]</td></tr><tr><td>TOTAL</td><td>2 RUNS</td><td>3RUNS 4RUNS</td><td>ALL RUNS</td></tr><tr><td>MCTS-RNA</td><td>57</td><td>57</td><td>56</td><td>51</td></tr><tr><td>ANTARNA</td><td>58</td><td>58</td><td></td><td>55</td></tr><tr><td>RL-LS</td><td>59</td><td>59</td><td></td><td>55</td></tr><tr><td>RNAINVERSE</td><td>60</td><td>60</td><td></td><td>58</td></tr><tr><td>LEARNA</td><td>67</td><td>66</td><td>63</td><td>63</td></tr><tr><td>META-LEARNA</td><td>68</td><td>67</td><td></td><td>67</td></tr><tr><td>META-LEARNA-ADAPT</td><td>68</td><td>67</td><td>67 67</td><td>66</td></tr></table>
|
| 375 |
+
|
| 376 |
+
Table 7: Comparison of all methods on Rfam-Taneda. Results list the number of solved target structures in at least 1, 5, 10, 25, or all of the evaluation runs in percent.
|
| 377 |
+
|
| 378 |
+
<table><tr><td rowspan="2">METHOD</td><td colspan="5">SOLVED SEQUENCES [%]</td></tr><tr><td>TOTAL</td><td>5 RUNS</td><td>10 RUNS</td><td>25 RUNS</td><td>ALL RUNS</td></tr><tr><td>MCTS-RNA</td><td>79</td><td>76</td><td>72</td><td>72</td><td>59</td></tr><tr><td>ANTARNA</td><td>66</td><td>66</td><td>66</td><td>66</td><td>62</td></tr><tr><td>RL-LS</td><td>62</td><td>62</td><td>55</td><td>52</td><td>48</td></tr><tr><td>RNAINVERSE</td><td>59</td><td>55</td><td>55</td><td>52</td><td>48</td></tr><tr><td>LEARNA</td><td>79</td><td>79</td><td>76</td><td>66</td><td>48</td></tr><tr><td>META-LEARNA</td><td>83</td><td>79</td><td>79</td><td>79</td><td>72</td></tr><tr><td>META-LEARNA-ADAPT</td><td>83</td><td>83</td><td>79</td><td>79</td><td>76</td></tr></table>
|
| 379 |
+
|
| 380 |
+
Table 8: Comparison of all methods on Rfam-Learn-Test. Results list the number of solved target structures in at least 1, 2, 3, 4, or all of the evaluation runs in percent.
|
| 381 |
+
|
| 382 |
+
<table><tr><td rowspan="2">METHOD</td><td colspan="4">SOLVED SEQUENCES [%]</td></tr><tr><td>TOTAL</td><td>2 RUNS</td><td>3 RUNS 4 RUNS</td><td>ALL RUNS</td></tr><tr><td>MCTS-RNA</td><td>97</td><td>94</td><td>91</td><td>82</td></tr><tr><td>ANTARNA</td><td>100</td><td>99</td><td>89 99</td><td>99</td></tr><tr><td>RL-LS</td><td>62</td><td>53</td><td>45</td><td>37</td></tr><tr><td>RNAINVERSE</td><td>95</td><td>90</td><td></td><td>78</td></tr><tr><td>LEARNA</td><td>97</td><td>93</td><td>86</td><td>71</td></tr><tr><td>META-LEARNA</td><td>100</td><td>99</td><td></td><td>96</td></tr><tr><td>META-LEARNA-ADAPT</td><td>99</td><td>99</td><td>98 99</td><td>94</td></tr></table>
|
| 383 |
+
|
| 384 |
+
# J C O M P A R I S O N : N U M B E R O F S O L U T I O N S AT D I F F E R E N T T I M E S
|
| 385 |
+
|
| 386 |
+
Table 9: Comparison of all methods on Eterna100. Results list the number of solved target structures at different time points in percent.
|
| 387 |
+
|
| 388 |
+
<table><tr><td rowspan="2">METHOD</td><td colspan="7">SOLVED SEQUENCES [%]</td></tr><tr><td>10s</td><td>1MIN</td><td>30MIN</td><td>1H</td><td>4H</td><td>12H</td><td>24H</td></tr><tr><td>MCTS-RNA</td><td>41</td><td>48</td><td>55</td><td>56</td><td>57</td><td>57</td><td>57</td></tr><tr><td>ANTARNA</td><td>36</td><td>46</td><td>54</td><td>55</td><td>55</td><td>58</td><td>58</td></tr><tr><td>RL-LS</td><td>0</td><td>40</td><td>53</td><td>55</td><td>58</td><td>59</td><td>59</td></tr><tr><td>RNAINVERSE</td><td>32</td><td>44</td><td>55</td><td>57</td><td>59</td><td>60</td><td>60</td></tr><tr><td>LEARNA</td><td>21</td><td>47</td><td>61</td><td>63</td><td>65</td><td>67</td><td>67</td></tr><tr><td>META-LEARNA</td><td>56</td><td>62</td><td>65</td><td>67</td><td>67</td><td>68</td><td>68</td></tr><tr><td>META-LEARNA-ADAPT</td><td>56</td><td>61</td><td>64</td><td>66</td><td>67</td><td>67</td><td>68</td></tr></table>
|
| 389 |
+
|
| 390 |
+
Table 10: Comparison of all methods on Rfam-Taneda. Results list the number of solved target structures at different time points in percent.
|
| 391 |
+
|
| 392 |
+
<table><tr><td rowspan="2">METHOD</td><td colspan="5">SOLVED SEQUENCES[%]</td></tr><tr><td>10s</td><td>30s</td><td>1MIN</td><td>5MIN</td><td>10MIN</td></tr><tr><td>MCTS-RNA</td><td>72</td><td>76</td><td>76</td><td>79</td><td>79</td></tr><tr><td>ANTARNA</td><td>52</td><td>62</td><td>66</td><td>66</td><td>66</td></tr><tr><td>RL-LS</td><td>0</td><td>48</td><td>59</td><td>62</td><td>62</td></tr><tr><td>RNAINVERSE</td><td>55</td><td>55</td><td>55</td><td>55</td><td>59</td></tr><tr><td>LEARNA</td><td>24</td><td>52</td><td>69</td><td>79</td><td>79</td></tr><tr><td>META-LEARNA</td><td>79</td><td>79</td><td>79</td><td>79</td><td>83</td></tr><tr><td>META-LEARNA-ADAPT</td><td>79</td><td>79</td><td>79</td><td>83</td><td>83</td></tr></table>
|
| 393 |
+
|
| 394 |
+
Table 11: Comparison of all methods on Rfam-Learn-Test. Results list the number of solved target structures at different time points in percent.
|
| 395 |
+
|
| 396 |
+
<table><tr><td rowspan="2">METHOD</td><td colspan="7">SoLvED SEQUENCES [%]</td></tr><tr><td>10s</td><td>30s</td><td>1MIN</td><td>5MIN</td><td>10MIN</td><td>30MIN</td><td>1H</td></tr><tr><td>MCTS-RNA</td><td>40</td><td>55</td><td>68</td><td>86</td><td>92</td><td>94</td><td>97</td></tr><tr><td>ANTARNA</td><td>36</td><td>58</td><td>73</td><td>97</td><td>99</td><td>100</td><td>100</td></tr><tr><td>RL-LS</td><td>0</td><td>14</td><td>21</td><td>38</td><td>45</td><td>56</td><td>62</td></tr><tr><td>RNAINVERSE</td><td>39</td><td>53</td><td>66</td><td>83</td><td>89</td><td>93</td><td>95</td></tr><tr><td>LEARNA</td><td>11</td><td>23</td><td>31</td><td>72</td><td>83</td><td>93</td><td>97</td></tr><tr><td>META-LEARNA</td><td>74</td><td>82</td><td>87</td><td>96</td><td>97</td><td>100</td><td>100</td></tr><tr><td>META-LEARNA-ADAPT</td><td>73</td><td>84</td><td>91</td><td>95</td><td>98</td><td>99</td><td>99</td></tr></table>
|
| 397 |
+
|
| 398 |
+
# K C O M P A R I S O N : S P E C I F I C T A R G E T S T R U C T U R E S
|
| 399 |
+
|
| 400 |
+
Table 12: Results for 5 independent attempts on the first half of the 100 target structures of the RfamLearn-Test benchmark. We abbreviate Meta-LEARNA with M-LEARNA and Meta-LEARNA-Adapt with M-LEARNA-A.
|
| 401 |
+
|
| 402 |
+
<table><tr><td>ID</td><td>LEARNA</td><td>M-LEARNA</td><td>M-LEARNA-A</td><td>MCTS-RNA</td><td>RL-LS</td><td>RNAINVERSE</td><td>ANTARNA</td></tr><tr><td>1</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td></tr><tr><td>2</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td></tr><tr><td>3</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td></tr><tr><td>4</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td></tr><tr><td>5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td></tr><tr><td>6</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td></tr><tr><td>7</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td></tr><tr><td>8</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td></tr><tr><td>9</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td></tr><tr><td>10</td><td>2/5</td><td>2/5</td><td>=</td><td>4/5</td><td>-</td><td>5/5</td><td>5/5</td></tr><tr><td>11</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td></tr><tr><td>12</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td></tr><tr><td>13</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td></tr><tr><td>14</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td></tr><tr><td>15</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td></tr><tr><td>16</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td></tr><tr><td>17</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td></tr><tr><td>18</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td></tr><tr><td>19</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td></tr><tr><td>20</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td></tr><tr><td>21</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td></tr><tr><td>22</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td></td><td>5/5</td><td>5/5</td></tr><tr><td>23</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td></tr><tr><td>24</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td></tr><tr><td>25</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>4/5</td><td>5/5</td><td>5/5</td></tr><tr><td>26</td><td>4/5</td><td>5/5</td><td>5/5</td><td>4/5</td><td>2/5</td><td>5/5</td><td>5/5</td></tr><tr><td>27</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td></tr><tr><td>28</td><td>2/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>1/5</td><td>5/5</td><td>5/5</td></tr><tr><td>29</td><td>5/5</td><td>5/5</td><td>5/5</td><td>3/5</td><td>3/5</td><td>5/5</td><td>5/5</td></tr><tr><td>30</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td></tr><tr><td>31</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td></tr><tr><td>32</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td></tr><tr><td>33</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td></tr><tr><td>34</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td></tr><tr><td>35</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>4/5</td><td>5/5</td><td>5/5</td></tr><tr><td>36</td><td>5/5</td><td>5/5</td><td>5/5</td><td>4/5</td><td>3/5</td><td>5/5</td><td>5/5</td></tr><tr><td>37</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td></tr><tr><td>38</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>1/5</td><td>5/5</td><td>5/5</td></tr><tr><td>39</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td></tr><tr><td>40</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td></tr><tr><td>41</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td></tr><tr><td>42</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td></tr><tr><td>43</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td></tr><tr><td>44</td><td>2/5</td><td>5/5</td><td>5/5</td><td>1/5</td><td>-</td><td>4/5</td><td>5/5</td></tr><tr><td>45</td><td>-</td><td>1/5</td><td>3/5</td><td>=</td><td>=</td><td>=</td><td>1/5</td></tr><tr><td>46</td><td>5/5</td><td>5/5</td><td>5/5</td><td>1/5</td><td>=</td><td>5/5</td><td>5/5</td></tr><tr><td>47</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>3/5</td><td>5/5</td><td>5/5</td></tr><tr><td>48</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td></tr><tr><td>49 50</td><td>5/5 5/5</td><td>5/5 5/5</td><td>5/5 5/5</td><td>5/5 5/5</td><td>5/5 4/5</td><td>5/5 5/5</td><td>5/5 5/5</td></tr><tr></table>
|
| 403 |
+
|
| 404 |
+
Table 13: Results for 5 independent attempts on the second half of the 100 target structures of the Rfam-Learn-Test benchmark. We abreviate Meta-LEARNA with M-LEARNA and Meta-LEARNAAdapt with M-LEARNA-A.
|
| 405 |
+
|
| 406 |
+
<table><tr><td>ID</td><td>LEARNA</td><td>M-LEARNA</td><td>M-LEARNA-A</td><td>MCTS-RNA</td><td>RL-LS</td><td>RNAINVERSE</td><td>ANTARNA</td></tr><tr><td>51</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>1/5</td><td>5/5</td><td>5/5</td></tr><tr><td>52</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td></tr><tr><td>53</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>1/5</td><td>5/5</td><td>5/5</td></tr><tr><td>54</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>2/5</td><td>5/5</td><td>5/5</td></tr><tr><td>55</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>3/5</td><td>5/5</td><td>5/5</td></tr><tr><td>56</td><td>4/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>1/5</td><td>5/5</td><td>5/5</td></tr><tr><td>57</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>-</td><td>4/5</td><td>5/5</td></tr><tr><td>58</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>=</td><td>3/5</td><td>5/5</td></tr><tr><td>59</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>2/5</td><td>5/5</td><td>5/5</td></tr><tr><td>60</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>2/5</td><td>3/5</td><td>5/5</td></tr><tr><td>61</td><td>5/5</td><td>5/5</td><td>5/5</td><td>4/5</td><td>2/5</td><td>1/5</td><td>5/5</td></tr><tr><td>62</td><td>3/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>1/5</td><td>5/5</td><td>5/5</td></tr><tr><td>63</td><td>4/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>1/5</td><td>5/5</td><td>5/5</td></tr><tr><td>64</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>-</td><td>5/5</td><td>5/5</td></tr><tr><td>65</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>-</td><td>5/5</td><td>5/5</td></tr><tr><td>66</td><td>4/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>-</td><td>5/5</td><td>5/5</td></tr><tr><td>67</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td></td><td>5/5</td><td>5/5</td></tr><tr><td>68</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>2/5</td><td>5/5</td><td>5/5</td></tr><tr><td>69</td><td>2/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>=</td><td>3/5</td><td>5/5</td></tr><tr><td>70</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>1/5</td><td>5/5</td><td>5/5</td></tr><tr><td>71</td><td>1/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>-</td><td>5/5</td><td>5/5</td></tr><tr><td>72</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>=</td><td>5/5</td><td>5/5</td></tr><tr><td>73</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>=</td><td>5/5</td><td>5/5</td></tr><tr><td>74</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td></td><td>2/5</td><td>5/5</td></tr><tr><td>75</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td></td><td>5/5</td><td>5/5</td></tr><tr><td>76</td><td>4/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>1/5</td><td>2/5</td><td>5/5</td></tr><tr><td>77</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>4/5</td><td>5/5</td><td>5/5</td></tr><tr><td>78</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>=</td><td>4/5</td><td>5/5</td></tr><tr><td>79</td><td>4/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td></td><td>5/5</td><td>5/5</td></tr><tr><td>80</td><td></td><td>4/5</td><td>5/5</td><td></td><td></td><td>1/5</td><td>5/5</td></tr><tr><td>81</td><td>3/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td></td><td>2/5</td><td>5/5</td></tr><tr><td>82</td><td>4/5</td><td>5/5</td><td>5/5</td><td>4/5</td><td></td><td></td><td>5/5</td></tr><tr><td>83</td><td>4/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td></td><td>4/5</td><td>5/5</td></tr><tr><td>84</td><td>5/5</td><td>5/5</td><td>5/5</td><td>4/5</td><td></td><td>3/5</td><td>5/5</td></tr><tr><td>85</td><td>2/5</td><td>4/5</td><td>3/5</td><td>1/5</td><td></td><td>5/5</td><td>5/5</td></tr><tr><td>86</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>2/5</td><td>5/5</td><td>5/5</td></tr><tr><td>87</td><td>3/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td></td><td>5/5</td><td>5/5</td></tr><tr><td>88</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td></td><td>1/5</td><td>5/5</td></tr><tr><td>89</td><td>=</td><td>5/5</td><td>5/5</td><td>2/5</td><td></td><td>=</td><td>5/5</td></tr><tr><td>90</td><td>2/5</td><td>5/5</td><td>5/5</td><td>2/5</td><td></td><td>5/5</td><td>5/5</td></tr><tr><td>91</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td></td><td>5/5</td><td>5/5</td></tr><tr><td>92</td><td>3/5</td><td>5/5</td><td>4/5</td><td></td><td></td><td>5/5</td><td>5/5</td></tr><tr><td>93</td><td>1/5</td><td>5/5</td><td>5/5</td><td>4/5</td><td></td><td>4/5</td><td>5/5</td></tr><tr><td>94</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td></td><td>5/5</td><td>5/5</td></tr><tr><td>95</td><td>2/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td></td><td>1/5</td><td>5/5</td></tr><tr><td>96</td><td>4/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>2/5</td><td>5/5</td><td>5/5</td></tr><tr><td>97</td><td>1/5</td><td>5/5</td><td>4/5</td><td>2/5</td><td></td><td>1/5</td><td>5/5</td></tr><tr><td>98</td><td>4/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td></td><td></td><td>5/5</td></tr><tr><td>99 100</td><td>4/5 1/5</td><td>5/5 5/5</td><td>5/5 4/5</td><td>5/5 3/5</td><td>= -</td><td>5/5 =</td><td>5/5 5/5</td></tr><tr></table>
|
| 407 |
+
|
| 408 |
+
Table 14: Results for 5 independent attempts on the first half of the 100 target structures of the Eterna100 benchmark. We abbreviate Meta-LEARNA with M-LEARNA and Meta-LEARNA-Adapt with M-LEARNA-A.
|
| 409 |
+
|
| 410 |
+
<table><tr><td>ID</td><td>LEARNA</td><td>M-LEARNA</td><td>M-LEARNA-A</td><td>MCTS-RNA</td><td>RL-LS</td><td>RNAINVERSE</td><td>ANTARNA</td></tr><tr><td>1</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td></tr><tr><td>2</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td></tr><tr><td>3</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td></tr><tr><td>4</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td></tr><tr><td>5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td></tr><tr><td>6</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>-</td><td>5/5</td><td>5/5</td></tr><tr><td>7</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td></tr><tr><td>8</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td></tr><tr><td>9</td><td>5/5</td><td>5/5</td><td>5/5</td><td>-</td><td>4/5</td><td>-</td><td>3/5</td></tr><tr><td>10</td><td>5/5</td><td>5/5</td><td>5/5</td><td>=</td><td>5/5</td><td>5/5</td><td>5/5</td></tr><tr><td>11</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td></tr><tr><td>12</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td></tr><tr><td>13</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td></tr><tr><td>14</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td></tr><tr><td>15</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td></tr><tr><td>16</td><td>5/5</td><td>5/5</td><td>5/5</td><td>=</td><td>3/5</td><td>=</td><td></td></tr><tr><td>17</td><td>5/5</td><td>5/5</td><td>5/5</td><td>4/5</td><td>5/5</td><td>2/5</td><td></td></tr><tr><td>18</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td></tr><tr><td>19</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td></tr><tr><td>20</td><td>5/5</td><td>5/5</td><td>5/5</td><td>4/5</td><td>5/5</td><td>5/5</td><td>5/5</td></tr><tr><td>21</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td></tr><tr><td>22</td><td>2/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td></td><td>5/5</td></tr><tr><td>23</td><td>5/5</td><td>5/5</td><td>5/5</td><td>=</td><td>5/5</td><td>5/5</td><td>5/5</td></tr><tr><td>24</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td></tr><tr><td>25</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td></tr><tr><td>26</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td></tr><tr><td>27</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td></tr><tr><td>28</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td></tr><tr><td>29</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td></tr><tr><td>30</td><td>5/5</td><td>5/5</td><td>5/5</td><td></td><td>5/5</td><td>5/5</td><td>5/5</td></tr><tr><td>31</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td></tr><tr><td>32</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td></tr><tr><td>33</td><td>5/5</td><td>5/5</td><td>5/5</td><td></td><td></td><td>5/5</td><td>5/5</td></tr><tr><td>34</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td></tr><tr><td>35</td><td>2/5</td><td>5/5</td><td>5/5</td><td>=</td><td></td><td></td><td></td></tr><tr><td>36</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td></tr><tr><td>37</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>2/5</td><td>4/5</td><td>-</td></tr><tr><td>38</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td></td><td>=</td><td></td></tr><tr><td>39</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td></tr><tr><td>40</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td></tr><tr><td>41</td><td>5/5</td><td>5/5</td><td>5/5</td><td></td><td>5/5</td><td>5/5</td><td>5/5</td></tr><tr><td>42</td><td>5/5</td><td>5/5</td><td>5/5</td><td>4/5</td><td>5/5</td><td>5/5</td><td>5/5</td></tr><tr><td>43</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td></tr><tr><td>44</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td></tr><tr><td>45</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td></tr><tr><td>46</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td></tr><tr><td>47</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td></tr><tr><td>48</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td></tr><tr><td>49 50</td><td>5/5 -</td><td>5/5 -</td><td>5/5 -</td><td>5/5 -</td><td>5/5 -</td><td>5/5 -</td><td>5/5 -</td></tr><tr></table>
|
| 411 |
+
|
| 412 |
+
Table 15: Results for 5 independent attempts on the second half of the 100 target structures of the Eterna100 benchmark. We abbreviate Meta-LEARNA with M-LEARNA and Meta-LEARNA-Adapt with M-LEARNA-A.
|
| 413 |
+
|
| 414 |
+
<table><tr><td>ID</td><td>LEARNA</td><td>M-LEARNA</td><td>M-LEARNA-A</td><td>MCTS-RNA</td><td>RL-LS</td><td>RNAINVERSE</td><td>ANTARNA</td></tr><tr><td>51</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td></tr><tr><td>52</td><td></td><td>=</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td></tr><tr><td>53</td><td>-</td><td>5/5</td><td>5/5</td><td></td><td></td><td></td><td></td></tr><tr><td>54</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td></tr><tr><td></td><td></td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td></td></tr><tr><td>55 56</td><td>5/5 5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td></tr><tr><td>57</td><td></td><td></td><td></td><td></td><td></td><td></td><td>5/5</td></tr><tr><td>58</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td></tr><tr><td>59</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td></td></tr><tr><td>60</td><td></td><td></td><td></td><td>-</td><td>-</td><td></td><td>-</td></tr><tr><td>61</td><td>-</td><td></td><td>--</td><td>-</td><td>-</td><td>-</td><td></td></tr><tr><td>62</td><td>5/5</td><td>5/5</td><td>5/5</td><td></td><td></td><td>5/5</td><td>3/5</td></tr><tr><td>63</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td></td></tr><tr><td>64</td><td>-</td><td>-</td><td>=</td><td></td><td>-</td><td></td><td>5/5</td></tr><tr><td>65</td><td></td><td></td><td></td><td>2/5</td><td></td><td>=</td><td></td></tr><tr><td>66</td><td></td><td>5/5</td><td></td><td></td><td></td><td>5/5</td><td></td></tr><tr><td>67</td><td></td><td></td><td></td><td>-</td><td></td><td></td><td>5/5</td></tr><tr><td>68</td><td></td><td>:</td><td></td><td>-</td><td></td><td>-</td><td>-</td></tr><tr><td>69</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td></td><td></td><td>=</td></tr><tr><td>70</td><td>5/5</td><td>5/5</td><td>5/5</td><td>3/5</td><td></td><td></td><td></td></tr><tr><td>71</td><td>-</td><td>-</td><td>-</td><td></td><td></td><td></td><td>4/5</td></tr><tr><td>72</td><td>=</td><td></td><td>=</td><td>-</td><td>5/5</td><td>5/5</td><td>-</td></tr><tr><td>73</td><td>=</td><td></td><td>=</td><td>=</td><td>=</td><td></td><td>=</td></tr><tr><td>74</td><td>1/5</td><td></td><td>3/5</td><td></td><td></td><td></td><td></td></tr><tr><td>75</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td></td></tr><tr><td>76</td><td>=</td><td></td><td></td><td></td><td>=</td><td></td><td>5/5</td></tr><tr><td>77</td><td>2/5</td><td>5/5</td><td>5/5</td><td>3/5</td><td>4/5</td><td>5/5</td><td>=</td></tr><tr><td>78</td><td>-</td><td>-</td><td>-</td><td></td><td>-</td><td></td><td></td></tr><tr><td>79</td><td>=</td><td></td><td>-</td><td>-</td><td>-</td><td>-</td><td></td></tr><tr><td>80</td><td>=</td><td>=</td><td>=</td><td>=</td><td></td><td>-</td><td></td></tr><tr><td>81</td><td></td><td></td><td></td><td>=</td><td></td><td>=</td><td></td></tr><tr><td>82</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td></td></tr><tr><td>83</td><td></td><td></td><td></td><td></td><td></td><td></td><td>5/5</td></tr><tr><td>84</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td></td></tr><tr><td>85</td><td>-</td><td>=</td><td>=</td><td>=</td><td>-</td><td></td><td>5/5</td></tr><tr><td>86</td><td></td><td></td><td></td><td></td><td></td><td></td><td>-</td></tr><tr><td>87</td><td></td><td></td><td></td><td></td><td></td><td></td><td>/</td></tr><tr><td>88</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>89</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>90</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>91</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>92</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>93</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td></tr><tr><td>94</td><td>=</td><td></td><td>=</td><td>=</td><td>=</td><td></td><td></td></tr><tr><td>95</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td><td>5/5</td></tr><tr><td>96</td><td>-</td><td></td><td></td><td>-</td><td>-</td><td>-</td><td>-</td></tr><tr><td>97</td><td></td><td>:</td><td>:</td><td>=</td><td>=</td><td></td><td>=</td></tr><tr><td>98</td><td>5/5</td><td>1/5</td><td>1/5</td><td></td><td></td><td>=</td><td>=</td></tr><tr><td>99 100</td><td></td><td>-</td><td>-</td><td></td><td></td><td></td><td></td></tr><tr></table>
|
| 415 |
+
|
| 416 |
+
Table 16: Results for 50 independent attempts on each of the 29 target structures of the RfamTaneda benchmark. We abbreviate Meta-LEARNA with M-LEARNA and Meta-LEARNA-Adapt with M-LEARNA-A.
|
| 417 |
+
|
| 418 |
+
<table><tr><td>ID</td><td>LEARNA</td><td>M-LEARNA</td><td>M-LEARNA-A</td><td>MCTS-RNA</td><td>RL-LS</td><td>RNAINVERSE</td><td>ANTARNA</td></tr><tr><td>1</td><td>50/50</td><td>50/50</td><td>50/50</td><td>32/50</td><td>7/50</td><td>20/50</td><td>50/50</td></tr><tr><td>2</td><td>35/50</td><td>50/50</td><td>50/50</td><td>28/50</td><td>5/50</td><td>=</td><td></td></tr><tr><td>3</td><td>18/50</td><td>49/50</td><td>50/50</td><td>4/50</td><td></td><td></td><td></td></tr><tr><td>4</td><td>50/50</td><td>50/50</td><td>50/50</td><td>50/50</td><td>50/50</td><td>50/50</td><td>50/50</td></tr><tr><td>5</td><td>50/50</td><td>50/50</td><td>50/50</td><td>50/50</td><td>50/50</td><td>50/50</td><td>50/50</td></tr><tr><td>6</td><td>50/50</td><td>50/50</td><td>50/50</td><td>50/50</td><td>50/50</td><td>50/50</td><td>50/50</td></tr><tr><td>7</td><td>50/50</td><td>50/50</td><td>50/50</td><td>50/50</td><td>48/50</td><td>50/50</td><td>50/50</td></tr><tr><td>8</td><td>50/50</td><td>50/50</td><td>50/50</td><td>50/50</td><td>50/50</td><td>50/50</td><td>50/50</td></tr><tr><td>9</td><td>18/50</td><td>50/50</td><td>50/50</td><td>44/50</td><td>-</td><td>-</td><td>-</td></tr><tr><td>10</td><td>-</td><td>-</td><td>-</td><td>-</td><td></td><td>-</td><td>-</td></tr><tr><td>11</td><td></td><td>=</td><td></td><td>-</td><td></td><td>=</td><td></td></tr><tr><td>12</td><td>48/50</td><td>50/50</td><td>50/50</td><td>50/50</td><td>50/50</td><td>3/50</td><td>50/50</td></tr><tr><td>13</td><td>50/50</td><td>50/50</td><td>50/50</td><td>50/50</td><td>50/50</td><td>50/50</td><td>50/50</td></tr><tr><td>14</td><td>50/50</td><td>50/50</td><td>50/50</td><td>50/50</td><td>50/50</td><td>50/50</td><td>50/50</td></tr><tr><td>15</td><td>50/50</td><td>50/50</td><td>50/50</td><td>50/50</td><td>50/50</td><td>50/50</td><td>50/50</td></tr><tr><td>16</td><td>=</td><td></td><td></td><td>=</td><td>-</td><td>=</td><td>=</td></tr><tr><td>17</td><td>22/50</td><td>50/50</td><td>50/50</td><td>47/50</td><td>=</td><td>50/50</td><td>50/50</td></tr><tr><td>18</td><td></td><td>2/50</td><td>5/50</td><td>=</td><td></td><td></td><td></td></tr><tr><td>19</td><td>50/50</td><td>50/50</td><td>50/50</td><td>50/50</td><td>50/50</td><td>50/50</td><td>50/50</td></tr><tr><td>20</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>21</td><td>50/50</td><td>50/50</td><td>50/50</td><td>50/50</td><td>50/50</td><td>50/50</td><td>50/50</td></tr><tr><td>22</td><td>50/50</td><td>50/50</td><td>50/50</td><td>50/50</td><td>50/50</td><td>50/50</td><td>50/50</td></tr><tr><td>23</td><td>=</td><td></td><td></td><td>=</td><td>=</td><td>=</td><td></td></tr><tr><td>24</td><td>48/50</td><td>50/50</td><td>50/50</td><td>50/50</td><td>19/50</td><td>=</td><td>50/50</td></tr><tr><td>25 26</td><td>50/50</td><td>50/50</td><td>50/50</td><td>50/50</td><td>50/50</td><td>46/50</td><td>50/50</td></tr><tr><td>27</td><td>50/50</td><td>50/50</td><td>50/50</td><td>50/50</td><td>50/50</td><td>50/50</td><td>50/50</td></tr><tr><td></td><td>8/50</td><td>42/50</td><td>43/50</td><td>6/50</td><td></td><td></td><td></td></tr><tr><td>28 29</td><td>49/50 28/50</td><td>50/50 50/50</td><td>50/50</td><td>50/50</td><td>50/50</td><td>50/50</td><td>50/50</td></tr><tr><td>TOTAL</td><td>974/1450</td><td>1143/1450</td><td>50/50</td><td>50/50</td><td>-</td><td>-</td><td>36/50</td></tr><tr><td>SOLVED</td><td>23/29</td><td>24/29</td><td>1148/1450 24/29</td><td>1011/1450 23/29</td><td>779/1450 18/29</td><td>769/1450 17/29</td><td>936/1450 19/29</td></tr></table>
|
md/train/Byl8BnRcYm/Byl8BnRcYm.md
ADDED
|
@@ -0,0 +1,337 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# CAPSULE GRAPH NEURAL NETWORK
|
| 2 |
+
|
| 3 |
+
Zhang Xinyi, Lihui Chen School of Electrical and Electronic Engineering Nanyang Technological University, Singapore xinyi001@e.ntu.edu.sg, elhchen@ntu.edu.sg
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
The high-quality node embeddings learned from the Graph Neural Networks (GNNs) have been applied to a wide range of node-based applications and some of them have achieved state-of-the-art (SOTA) performance. However, when applying node embeddings learned from GNNs to generate graph embeddings, the scalar node representations may not suffice to preserve the node/graph properties efficiently, resulting in sub-optimal graph embeddings.
|
| 8 |
+
|
| 9 |
+
Inspired by the Capsule Neural Network (CapsNet) (Sabour et al., 2017), we propose the Capsule Graph Neural Network (CapsGNN), which adopts the concept of capsules to address the weakness in existing GNN-based graph embeddings algorithms. By extracting node features in the form of capsules, routing mechanism can be utilized to capture important information at the graph level. As a result, our model generates multiple embeddings for each graph to capture graph properties from different aspects. The attention module incorporated in CapsGNN is used to tackle graphs with various sizes which also enables the model to focus on critical parts of the graphs.
|
| 10 |
+
|
| 11 |
+
Our extensive evaluations with 10 graph-structured datasets demonstrate that CapsGNN has a powerful mechanism that operates to capture macroscopic properties of the whole graph by data-driven. It outperforms other SOTA techniques on several graph classification tasks, by virtue of the new instrument.
|
| 12 |
+
|
| 13 |
+
# 1 INTRODUCTION
|
| 14 |
+
|
| 15 |
+
GNN is a general type of deep-learning architectures that can be directly applied to structured data. These architectures are mainly generalized from other well-established deep-learning models like CNN (Krizhevsky et al., 2012) and RNN (Mikolov et al., 2010). In this paper, we mainly focus on Convolution-based Graph Neural Networks which attract increasing interest recently. Convolution operation can be embedded into Graph Neural Networks from spectral or spatial perspective. Bruna et al. (2013) defines the convolution operation in the Fourier domain which needs to calculate the eigendecomposition of the graph Laplacian. This method is computationally expensive and the filters they defined are non-spatially localized. Later, Henaff et al. (2015) introduces Chebyshev expansion of the graph Laplacian to avoid computing eigenvectors and Kipf & Welling (2017) proposes to do convolution within 1-step neighbor nodes to reduce the complexity. From the spatial perspective, Hamilton et al. (2017) and Zhang et al. (2018) propose to define a node receptive-field and do convolution within this field during which the information of each node as well as their neighbor nodes is gathered and new representation of each node is generated through an activation function. Both of these two perspectives perform well in node representation learning and a number of variants (Velikovi et al., 2018) are developed based on the convolution idea and some of them have proven to achieve SOTA in various tasks.
|
| 16 |
+
|
| 17 |
+
The success of GNN in node representation learning has inspired many deep-learning-based approaches to leverage on node embeddings extracted from GNN to generate graph embeddings for graph-based applications. However, during this procedure, the learned representation of each node will be considered as multiple individual scalar features instead of one vector. For example, Zhang et al. (2018) applies element-wise max-pooling to nodes embeddings when generating graph embeddings, Verma & Zhang (2018) generates graph embeddings by computing the element-wise covariance of all nodes. These operations indicate that the authors capture node features in the form of scalar when they generate graph embeddings which may not suffice to preserve the node/graph properties efficiently.
|
| 18 |
+
|
| 19 |
+
To build high-quality graph embeddings, it is important to not only detect the presence of different structures around each node but also preserve their detailed properties such as position, direction, connection, etc. However, encoding these properties information in the form of scalar means activating elements in a vector one-by-one which is exponentially less efficient than encoding them with distributed representations. This has been identified discussed in Sabour et al. (2017). Inspired by CapsNet, we propose to extend scalar to vector during the procedure of applying GNN to graph representation learning. Compared with scalar-based neural network, vector-based neural network preserves the information of node/graph properties more efficiently. The technique for extracting features in the form of vectors is proposed in Hinton et al. (2011) and improved in Sabour et al. (2017) and Hinton et al. (2018). This technique is mainly devised for image processing. In their work, the extracted vector is referred to as capsule (a group of neurons in neural network), so we follow the same notation in our work. Introducing capsules allows us to use routing mechanism to generate high-level features which we believe is a more efficient way for features encoding. Compared with max-pooling in CNN in which all information will be dropped except for the most active one, routing preserves all the information from low-level capsules and routes them to the closest high-level capsules. Besides, this allows to model each graph with multiple embeddings and each embedding reflects different properties of the graph. This is more representative than only one embedding used in other scalar-based approaches.
|
| 20 |
+
|
| 21 |
+
In this paper, we propose Capsule Graph Neural Network (CapsGNN), a novel deep learning architecture, which is inspired by CapsNet and uses node features extracted from GNN to generate high-quality graph embeddings. In this architecture, each graph is represented as multiple embeddings and each embedding reflects the graph properties from different aspects. More specifically, basic node features are extracted in the form of capsules through GNN and routing mechanism is applied to generate high-level graph capsules as well as class capsules. In the procedure of generating graph capsules, an Attention Module can be applied to tackle graphs in various sizes. It also assigns different weights to each capsule of each node so that this model focuses on critical parts of the graph. We validate the performance of generated graph embeddings on classification task over 5 biological datasets and 5 social datasets. CapsGNN achieves SOTA performance on 6 out of 10 benchmark datasets and comparable results on the rest. T-SNE (Maaten & Hinton, 2008) is used to visualize the learned graph embeddings and the results show that different graph capsules indeed capture different information of the graphs.
|
| 22 |
+
|
| 23 |
+
# 2 BACKGROUND
|
| 24 |
+
|
| 25 |
+
Here, we provide a brief introduction to Graph Convolutional Networks (GCNs) (Kipf & Welling, 2017), routing mechanism in CapsNet and Attention mechanism which is used in CapsGNN.
|
| 26 |
+
|
| 27 |
+
# 2.1 GRAPH
|
| 28 |
+
|
| 29 |
+
By definition, a weighted directed graph can be represented by ${ \mathcal { G } } \ = \ ( \mathbb { V } , \pmb { X } , \pmb { A } )$ where $\mathbb { V } =$ $\{ v _ { 1 } , v _ { 2 } , . . . v _ { N } \}$ is the set of nodes and $\mathbf { \bar { A } } \in \lbrace 0 , 1 \rbrace ^ { \grave { N } \times N }$ is the adjacency matrix. If there is an edge from $v _ { i }$ to $v _ { j }$ , then $A _ { i j } = 1$ otherwise $A _ { i j } = 0$ . $\pmb { X } \in \mathbb { R } ^ { N \times d }$ represents the features of each node. $d$ is the number of feature channels and $N$ is the number of nodes.
|
| 30 |
+
|
| 31 |
+
# 2.2 GRAPH CONVOLULTIONAL NETWORK
|
| 32 |
+
|
| 33 |
+
GCN, a widely used GNN architecture, is chosen as one of the key building blocks in our work. At each layer of the GCN, the convolution operation is applied to each node as well as its neighbors and the new representation of each node is computed through an activation function. This procedure can be written as:
|
| 34 |
+
|
| 35 |
+
$$
|
| 36 |
+
\pmb { Z } ^ { l + 1 } = f ( \pmb { T } \pmb { Z } ^ { l } \pmb { W } ^ { l } )
|
| 37 |
+
$$
|
| 38 |
+
|
| 39 |
+
where $Z ^ { l } ~ \in ~ \mathbb { R } ^ { N \times d }$ represents nodes features at the layer $l , d$ represents the number of feature channels and $Z ^ { 0 } = X$ , $W ^ { l } \in \mathbb { R } ^ { d \times d ^ { \prime } }$ is a trainable weights matrix which serves as a channel filter, $f$ is a nonlinear activation function, $\pmb { T } \in \mathbb { R } ^ { N \times N }$ is the information transform matrix and it is usually calculated from the adjacency matrix $\pmb { A }$ for guiding the information flowing between nodes.
|
| 40 |
+
|
| 41 |
+
A complete GNN usually stacks $L$ layers to generate final nodes embeddings $Z ^ { L }$ . In the architecture proposed by Kipf & Welling (2017), at the lth layer of GCN, the extracted features of each node actually take all its adjacent nodes within $l$ steps into consideration. So $l$ can be considered as the size of the node receptive-field at this layer. This special property inspired us to use nodes features extracted from different layers to generate the graph capsules.
|
| 42 |
+
|
| 43 |
+
# 2.3 CAPSULE NEURAL NETWORK
|
| 44 |
+
|
| 45 |
+
The concept of capsules is invented by Hinton’s team (Hinton et al., 2011) and used recently in Sabour et al. (2017) and Hinton et al. (2018). CapsNet is designed for image features extraction and it is developed based on CNN. However, unlike traditional CNN in which the presence of feature is represented with scalar value in feature maps, the features in CapsNet are represented with capsules (vectors). In Sabour et al. (2017), the direction of capsules reflects the detailed properties of the features and the length of capsules reflects the probability of the presence of different features. The transmission of information between layers follows Dynamic Routing mechanism. The specific procedure of Dynamic Routing can be found in Appendix A for the completeness.
|
| 46 |
+
|
| 47 |
+
Inspired by CapsNet, the capsule mechanism is adopted and fused with GNN in our proposed CapsGNN to generate graph capsules and class capsules on the basis of node capsules which are extracted from GNN. Dynamic Routing is applied to update weights between capsules from one layer to the next layer so that the properties captured by node capsules can be propagated to suitable graph capsules. Thus, each graph is modeled as multiple graph capsules, and then modeled as multiple class capsules. Different graph capsules reflect the properties of the graph from different aspects.
|
| 48 |
+
|
| 49 |
+
# 2.4 ATTENTION MECHANISM
|
| 50 |
+
|
| 51 |
+
Attention mechanism is widely applied in image (Zheng et al., 2017) and natural language processing domain (Gehring et al., 2016) where it is used to find the relevant parts of the input data to the task target. The main procedure of Attention mechanism is: 1) defining an attention measure which is used to measure the relevance of each part of the input data to the task target. 2) normalizing the generated attention value. 3) scaling each part with the normalized attention value.
|
| 52 |
+
|
| 53 |
+
In CapsGNN, we apply Attention mechanism for two purposes: 1) scaling each node capsule so that the graph capsules that are generated from different graphs are still comparable even though these graphs are vastly different in sizes. 2) guiding the model to focus on more relevant parts of graphs.
|
| 54 |
+
|
| 55 |
+
# 3 CAPSULE GRAPH NEURAL NETWORK
|
| 56 |
+
|
| 57 |
+
In this section, we outline CapsGNN and show how it is used to generate high-quality graph capsules which then can be applied to graph classification task. Figure 1 shows a simplified version of CapsGNN. It consists of three key blocks:
|
| 58 |
+
|
| 59 |
+
1) Basic node capsules extraction block: GNN is applied to extract local vertices features with different receptive-field and then primary node capsules are built in this block. 2) High level graph capsules extraction block: Attention Module and Dynamic Routing are fused to generate multiple capsules for graphs. 3) Graph classification block: Dynamic Routing is applied again to generate class capsules for graph classification. The details of each block is explained in the following.
|
| 60 |
+
|
| 61 |
+
# 3.1 BASIC NODE CAPSULES
|
| 62 |
+
|
| 63 |
+
Firstly, the basic node features are extracted with GNN. Node degrees can be used as node attributes if nodes do not have attributes. We use the architecture improved by Kipf & Welling (2017) (GCN) as the node features extractor. The difference is that we extract multi-scale node features from different layers and the extracted features are represented in the form of capsules. The procedure can be written as:
|
| 64 |
+
|
| 65 |
+
$$
|
| 66 |
+
Z _ { j } ^ { l + 1 } = f ( \sum _ { i } \tilde { D } ^ { - \frac { 1 } { 2 } } \tilde { A } \tilde { D } ^ { - \frac { 1 } { 2 } } Z _ { i } ^ { l } W _ { i j } ^ { l } )
|
| 67 |
+
$$
|
| 68 |
+
|
| 69 |
+

|
| 70 |
+
Figure 1: Framework of CapsGNN. At first, GNN is used to extract node embeddings and form primary capsules. Attention module is used to scale node embeddings which is followed by Dynamic Routing to generate graph capsules. At the last stage, Dynamic Routing is applied again to perform graph classification.
|
| 71 |
+
|
| 72 |
+
where $W _ { i j } ^ { l } \in \mathbb { R } ^ { d \times d ^ { \prime } }$ is the trainable weights matrix. It serves as the channel filters from the $i$ th channel at the lth layer to the $j$ th channel at the $( l + 1 ) \mathrm { t h }$ layer. Here, we choose $f ( \cdot ) = t a n h ( \cdot )$ as the activation function. $Z ^ { l + 1 } ~ \in ~ \mathbb { R } ^ { N \times d ^ { \prime } }$ , $Z ^ { 0 } = X$ , ${ \tilde { \cal A } } = { \cal A } + { \cal I } ^ { \ 1 }$ and $\begin{array} { r } { \tilde { D } = \sum _ { j } \tilde { A } _ { i j } } \end{array}$ . To preserve features of sub-components with different sizes, we use nodes features extracted from all GNN layers to generate high-level capsules.
|
| 73 |
+
|
| 74 |
+
# 3.2 HIGH-LEVEL GRAPH CAPSULES
|
| 75 |
+
|
| 76 |
+
After getting local node capsules, global routing mechanism is applied to generate graph capsules. The input of this block contains $N$ sets of node capsules, each set is $\mathbb { S } ^ { n } = \bar { \{ } s _ { 1 1 } , . . , s _ { 1 C _ { 1 } } , . . . , \bar { s } _ { L C _ { L } } \}$ , $s _ { l c } \in \bar { \mathbb { R } } ^ { d }$ , where $C _ { l }$ is the number of channels at the lth layer of GNN, $d$ is the dimension of each capsule. The output of this block is a set of graph capsules $\pmb { H } \in \mathbb { R } ^ { P \times d ^ { \prime } }$ . Each of the capsules reflects the properties of the graph from different aspects. The length of these capsules reflects the probability of the presence of these properties and the angle reflects the details of the graph properties. Before generating graph capsules with node capsules, an Attention Module is introduced to scale node capsules.
|
| 77 |
+
|
| 78 |
+
Attention Module. In CapsGNN, primary capsules are extracted based on each node which means the number of primary capsules depends on the size of input graphs. In this case, if the routing mechanism is directly applied, the value of the generated high-level capsules will highly depend on the number of primary capsules (graph size) which is not the ideal case. Hence, an Attention Module is introduced to combat this issue.
|
| 79 |
+
|
| 80 |
+
The attention measure we choose is a two-layer fully connected neural network $F _ { a t t n } ( \cdot )$ . The number of input units of $F _ { a t t n } ( \cdot )$ is $d \times C _ { a l l }$ where $\begin{array} { r } { C _ { a l l } = \sum _ { l } C _ { l } } \end{array}$ and the number of output units equals to $C _ { a l l }$ . We apply node-based normalization to generate attention value in each channel and then scale the original node capsules. The details of Attention Module is shown in Figure 2 and the procedure can be written as:
|
| 81 |
+
|
| 82 |
+
$$
|
| 83 |
+
s c a l e d ( \boldsymbol { s } _ { ( n , i ) } ) = \frac { F _ { a t t n } ( \tilde { \boldsymbol { s _ { n } } } ) _ { i } } { \sum _ { n } F _ { a t t n } ( \tilde { \boldsymbol { s _ { n } } } ) _ { i } } \boldsymbol { s } _ { ( n , i ) }
|
| 84 |
+
$$
|
| 85 |
+
|
| 86 |
+
where $\tilde { s _ { n } } ~ \in ~ \mathbb { R } ^ { 1 \times C _ { a l l } d }$ is obtained by concatenating all capsules of the node $n$ . $\pmb { S } _ { ( n , i ) } ~ \in ~ \mathbb { R } ^ { 1 \times d }$ represents the $i$ th capsule of the node $n$ and $F _ { a t t n } \big ( \tilde { s _ { n } } \big ) \in \mathbb { R } ^ { 1 \times C _ { a l l } }$ is the generated attention value. In this way, the generated graph capsules can be independent to the size of graphs and the architecture will focus on more important parts of the input graph.
|
| 87 |
+
|
| 88 |
+

|
| 89 |
+
Figure 2: The structure of Attention Module. We first flatten primary capsules and apply two layer fully-connected neural network to generate attention value for each capsule. Node-based normalization (normalize each row here) is applied to generate final attention value. Scaled capsules are calculated by multiplying the normalized value with primary capsules.
|
| 90 |
+
|
| 91 |
+
After Attention Module, coordinate addition module can be used to preserve the position information of each node during the procedure of generating node capsule votes. Here, we introduce coordinate addition as an additional module and more details can be found in Appendix C.
|
| 92 |
+
|
| 93 |
+
The procedure of generating multiple graph capsules is summarized as follows:
|
| 94 |
+
|
| 95 |
+
1) Scale primary capsules: Apply Attention Module to scale primary capsules. The results of this module should be S ∈ RN×Call×d.
|
| 96 |
+
|
| 97 |
+
2) Calculate votes: When calculating votes, capsules of different nodes from the same channel share the transform matrix. The result of this step is a set of votes $V \in \mathbb { R } ^ { N \times C _ { a l l } \times P \times d }$ where $C _ { a l l }$ denotes the number of channels. $P$ denotes the defined number of graph capsules.
|
| 98 |
+
|
| 99 |
+
3) Dynamic Routing Mechanism: High-level graph capsules are computed with the procedure introduced in Section 2.3 based on votes produced in previous steps.
|
| 100 |
+
|
| 101 |
+
# 3.3 CLASSIFICATION
|
| 102 |
+
|
| 103 |
+
This block is designed for graph classification using the graph capsules.
|
| 104 |
+
|
| 105 |
+
Classification Loss. Dynamic Routing is applied again over graph capsules to generate final class capsules $C \in \mathbb { R } ^ { K \times d }$ , where $K$ is the number of graph classes. Here, we use margin loss function proposed in Sabour et al. (2017) to calculate the classification loss and it is computed as:
|
| 106 |
+
|
| 107 |
+
$$
|
| 108 |
+
L o s s _ { c } = \sum _ { k } \{ T _ { k } \operatorname* { m a x } ( 0 , m ^ { + } - \| \pmb { c } _ { k } \| ) ^ { 2 } + \lambda ( 1 - T _ { k } ) \operatorname* { m a x } ( 0 , \| \pmb { c } _ { k } \| - m ^ { - } ) ^ { 2 } \}
|
| 109 |
+
$$
|
| 110 |
+
|
| 111 |
+
where $m ^ { + } = 0 . 9$ , $m ^ { - } = 0 . 1$ and $T _ { k } = 1$ iff the input graph belongs to class $k , ~ \lambda$ is used to stop initial learning from reducing the length of all class capsules especially when $K$ is large.
|
| 112 |
+
|
| 113 |
+
Reconstruction Loss. Following Sabour et al. (2017), we use reconstruction loss as regularization method. Here, all class capsules are masked except the correct one and it is decoded with two fullyconnected layer to reconstruct the input information. The information we reconstruct here is the histogram of input nodes. The procedure can be written as:
|
| 114 |
+
|
| 115 |
+
$$
|
| 116 |
+
L o s s _ { r } = \frac { \sum _ { i } M P _ { i } ( { \bf d } _ { i } - { m _ { i } } ) ^ { 2 } } { \sum _ { i } M P _ { i } } + \frac { \sum _ { i } ( 1 - M P _ { i } ) ( { d _ { i } } - { m _ { i } } ) ^ { 2 } } { \sum _ { i } ( 1 - M P _ { i } ) }
|
| 117 |
+
$$
|
| 118 |
+
|
| 119 |
+
where $\mathbf { m } _ { i }$ represents the number of nodes with the attribute $i$ appear in the input graph, $\mathbf { \ b { d } } _ { i }$ is the corresponding decoded value. $M P _ { i } = 1$ iff input graph contains nodes with attribute $i$ . Equation 5 is used to prevent reducing reconstruction loss from setting all decoded value as 0 especially when most of the elements of the ground truth are 0.
|
| 120 |
+
|
| 121 |
+
The architecture details presented in section 3 describe the key design idea of CapsGNN which is based on the fusing of GNN and CapsNet. We also present a general comparison between CapsGNN with existing approaches in Appendix D.
|
| 122 |
+
|
| 123 |
+
# 4 EXPERIMENTS
|
| 124 |
+
|
| 125 |
+
We verify the performance of the graph embeddings extracted from CapsGNN against a number of SOTA approaches and some classical approaches on classification task with 10 benchmark datasets. Besides, we conduct experimental study to assess the impact of capsules in efficiency of encoding features of graphs. We also conduct brief analysis on the generated graph/class capsules. The experimental results and analysis is shown in the following. In addition to the analysis of the whole framework, we also provide a comparison experiment to evaluate the contribution of each module of CapsGNN with classification task. More details can be found in Appendix F.
|
| 126 |
+
|
| 127 |
+
# 4.1 GRAPH CLASSIFICATION
|
| 128 |
+
|
| 129 |
+
The goal of graph classification is to predict the classes these graphs belong to by analyzing the structure and nodes labels information of graphs. More specifically, given a set of labeled graphs ${ \mathbb D } = \{ ( \mathcal { G } _ { 1 } , y _ { 1 } ) , ( \mathcal { G } _ { 2 } , y _ { 2 } ) , . . . \}$ where $y _ { i } \in \mathbb { Y }$ is the label of each graph $\mathcal { G } _ { i }$ . The objective of graph classification is to find a mapping $f$ such that $f : \mathcal { G } \mathbb { Y }$ .
|
| 130 |
+
|
| 131 |
+
# 4.1.1 BASELINES METHODS
|
| 132 |
+
|
| 133 |
+
We compare CapsGNN with both kernel-based and deep-learning-based algorithms. The details are given as follows:
|
| 134 |
+
|
| 135 |
+
Kernel-based Methods: Three kernel-based algorithms, namely the Weisfeiler-Lehman subtree kernel (WL) (Shervashidze et al., 2011), the graphlet count kernel(GK) (Shervashidze et al., 2009), and the Random Walk (RW) (Vishwanathan et al., 2010). Typically, kernel-based algorithms first decompose graphs into sub-components based on the kernel definition, then build graph embeddings in a feature-based manner. Lastly, some machine learning algorithms (i.e., SVM) are applied to perform graph classification.
|
| 136 |
+
|
| 137 |
+
Deep-Learning-based Methods: Three types of deep-learning-based algorithms are selected:
|
| 138 |
+
|
| 139 |
+
1) Graph2vec (Narayanan et al., 2017), Deep Graph Kernel (DGK)(Yanardag & Vishwanathan, 2015) and AWE (Ivanov & Burnaev, 2018). Graph2vec, DGK and AWE require extracting substructures in advance while Graph2vec and AWE learn the representations of graphs in the manner of Doc2vec (Le & Mikolov, 2014), DGK applies Word2vec (Mikolov et al., 2013) to learn the similarity between each pair of sub-structures which will be used to build the graph kernel. Then kernel-based machine learning methods (i.e., SVM) are applied to perform graph classification. These three algorithms as well as kernel-based methods are all sub-components based and they all require two stages to do graph classification. So although Graph2vec, DGK and AWE apply learning approaches to learn the embeddings, we still consider them and other kernel-based algorithms as the same type in our experiments and we mainly compare our proposed architecture with the other remained methods which are all end-to-end and totally data-driven architectures.
|
| 140 |
+
|
| 141 |
+
2) PATCHY-SAN (PSCN)(Niepert et al., 2016). This method first sorts all nodes, then defines a receptive-field size for each node. These receptive-field are then filled with sorted neighbor nodes. Lastly, 1-D CNN is applied to perform graph classification.
|
| 142 |
+
|
| 143 |
+
3) GCAPS-CNN (Verma & Zhang, 2018), Dynamic Edge CNN (ECC) (Simonovsky & Komodakis, 2017) and Deep Graph CNN (DGCNN) (Zhang et al., 2018). These methods are all GNN-based algorithms. GCAPS-CNN first extract FGSD (Verma & Zhang, 2017) features for nodes that do not have attributes and then generate capsules for each node with higher-order statistical moment value of its neighbor nodes. At the last layer, they calculate covariance between all nodes to generate graph embeddings. ECC extracts node features on the condition of edge labels in GNN and then apply multi-scale pyramid structure to coarsen the graph. It uses average pooling at the last layer to generate graph embeddings. DGCNN generates nodes embeddings through a multi-layer GNN and combine features extracted from all layers. Then they order the nodes based on the embeddings extracted from the last layer which is followed by 1-D CNN.
|
| 144 |
+
|
| 145 |
+
# 4.1.2 EXPERIMENTAL SET-UP
|
| 146 |
+
|
| 147 |
+
Five biological graph datasets: MUTAG, ENZYMES, NCI1, PROTEINS, D&D and five social network datasets: COLLAB, IMDB-B, IMDB-M, RE-M5K, RE-M12K (Yanardag & Vishwanathan, 2015) are used for our experimental study. Details of these datasets can be found in Appendix B.
|
| 148 |
+
|
| 149 |
+
We applied 10-fold cross validation to evaluate the performance objectively. Each time we use 1 training fold as validation fold to adjust hyper-parameters, 8 training fold to train the architecture and the remained 1 testing fold to test the performance. We stop training when the performance on the validation fold reaches to the highest. Then we use the accuracy on the test fold as our test result. The final result is the average of these 10 test accuracy. By default, we use the results reported in the original work for baseline comparison. However, in cases where the results are not available, we use the best testing results reported in Verma & Zhang (2018), Zhang et al. (2018) and Ivanov & Burnaev (2018). More details about experimental setting can be found in Appendix E.
|
| 150 |
+
|
| 151 |
+
# 4.1.3 CLASSIFICATION RESULT
|
| 152 |
+
|
| 153 |
+
Table 1 lists the results of the experiments on biological datasets, Table 2 lists the results of the experiments on social datasets. For each dataset, we highlight the top 2 accuracy in bold. Compared with all the other algorithms, CapsGNN achieves top 2 on 6 out of 10 datasets and achieves comparable results on the other datasets. Compared with all the other end-to-end architectures, CapsGNN achieves top 1 on all the social datasets.
|
| 154 |
+
|
| 155 |
+
Table 1: Experiment Result of Biological Dataset
|
| 156 |
+
|
| 157 |
+
<table><tr><td>Algorithm</td><td>MUTAG</td><td>NCI1</td><td>PROTEINS</td><td>D&D</td><td>ENZYMES</td></tr><tr><td>WL</td><td>82.05±0.36</td><td>82.19±0.18</td><td>74.68±0.49</td><td>79.78±0.36</td><td>52.22±1.26</td></tr><tr><td>GK</td><td>81.58±2.11</td><td>62.49±0.27</td><td>71.67±0.55</td><td>78.45±0.26</td><td>32.70±1.20</td></tr><tr><td>RW</td><td>79.17±2.07</td><td>>3days</td><td>74.22±0.42</td><td>>3days</td><td>24.16±1.64</td></tr><tr><td>Graph2vec</td><td>83.15±9.25</td><td>73.22±1.81</td><td>73.30±2.05</td><td></td><td></td></tr><tr><td>AWE</td><td>87.87±9.76</td><td>=</td><td>1</td><td>71.51±4.02</td><td>35.77±5.93</td></tr><tr><td>DGK</td><td>87.44±2.72</td><td>80.31±0.46</td><td>75.68±0.54</td><td>73.50±1.01</td><td>53.43±0.91</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>PSCN</td><td>88.95±4.37</td><td>76.34±1.68</td><td>75.00±2.51</td><td>76.27±2.64</td><td></td></tr><tr><td>DGCNN</td><td>85.83±1.66</td><td>74.44±0.47</td><td>75.54±0.94</td><td>79.37±0.94</td><td>51.00±7.29</td></tr><tr><td>ECC</td><td>76.11</td><td>76.82</td><td>1</td><td>72.54</td><td>45.67</td></tr><tr><td>GCAPS-CNN</td><td></td><td>82.72±2.38</td><td>76.40±4.17</td><td>77.62±4.99</td><td>61.83±5.39</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>CapsGNN</td><td>86.67±6.88</td><td>78.35±1.55</td><td>76.28±3.63</td><td>75.38±4.17</td><td>54.67±5.67</td></tr></table>
|
| 158 |
+
|
| 159 |
+
CapsGNN achieves the SOTA performance on social datasets. More specifically, we are able to improve the classification accuracy by a margin of $2 . 7 8 \%$ and $5 . 3 0 \%$ on RE-M5K and RE-M12K respectively. This demonstrates that learning features in the form of capsules and modeling a graph to multiple embeddings is beneficial to capture macroscopic properties of graphs which are more important in classifying social networks. These results also consistent with the property of CapsNet, as it focuses more on extracting important information from children capsules by voting. However, applying routing to the whole graph leads to preserve all the information at a graph level and this property is not suitable to give prominence to individual fine structures which might be more important to biological datasets analysis. This results in less robust of CapsGNN on biological datasets. Despite this, the performance of CapsGNN in graph classification task still demonstrates its capability of graph representation especially its high potential of large graph dataset analysis.
|
| 160 |
+
|
| 161 |
+
Table 2: Experiment Result of Social Dataset
|
| 162 |
+
|
| 163 |
+
<table><tr><td>Algorithm</td><td>COLLAB</td><td>IMDB-B</td><td>IMDB-M</td><td>RE-M5K</td><td>RE-M12K</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>WL</td><td>79.02±1.77</td><td>73.40±4.63</td><td>49.33±4.75</td><td>49.44±2.36</td><td>38.18±1.30</td></tr><tr><td>GK</td><td>72.84±0.28</td><td>65.87±0.98</td><td>43.89±0.38</td><td>41.01±0.17</td><td>31.82±0.08</td></tr><tr><td>DGK</td><td>73.09±0.25</td><td>66.96±0.56</td><td>44.55±0.52</td><td>41.27±0.18</td><td>32.22±0.10</td></tr><tr><td>AWE</td><td>73.93±1.94</td><td>74.45±5.83</td><td>51.54±3.61</td><td>50.46±1.91</td><td>39.20±2.09</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>PSCN</td><td>72.60±2.15</td><td>71.00±2.29</td><td>45.23±2.84</td><td>49.10±0.70</td><td>41.32±0.42</td></tr><tr><td>DGCNN</td><td>73.76±0.49</td><td>70.03±0.86</td><td>47.83±0.85</td><td>48.70±4.54</td><td></td></tr><tr><td>GCAPS-CNN</td><td>77.71±2.51</td><td>71.69±3.40</td><td>48.50±4.10</td><td>50.10±1.72</td><td>1</td></tr><tr><td>CapsGNN</td><td>79.62±0.91</td><td>73.10±4.83</td><td>50.27±2.65</td><td>52.88±1.48</td><td>46.62±1.90</td></tr></table>
|
| 164 |
+
|
| 165 |
+
# 4.2 EFFICIENCY OF CAPSULES
|
| 166 |
+
|
| 167 |
+
The main objective of this experiment is to examine the efficiency of capsules in encoding graph features. More efficient in feature encoding here means representing more information with the similar number of neurons. We construct a scalar-based neural network for each CapsGNN and then compare the CapsGNN with its related scalar-based architecture by comparing their training and testing accuracy on graph classification task to demonstrate the efficiency in feature representation. More specifically,these scalar-based architectures are designed by replacing the graph capsules block and the class capsules block in CapsGNN with fully-connected layers (FC). In this case, the only difference between each pair of CapsGNN and its corresponding scalar-based architecture is that CapsGNN represents features with vectors and uses routing to propagate information between layers while the scalar-based architecture encodes features with scalar values.
|
| 168 |
+
|
| 169 |
+
In this experiment, the number of layers of GNN is set as $L = 3$ , the number of channels at each layer is all set as $C _ { l } = 2$ . We construct different CapsGNNs by adjusting the dimension of nodes $( d _ { n } )$ and graphs $( d _ { g } )$ capsules and the number of graph capsules $( P )$ . The size of FC in scalar-based architectures is adjusted based on the size of CapsGNNs so that they have comparable number of trainable weights. Other hyper-parameters are the same as Appendix E. The details of the tested architectures are shown in Table 3. Besides, NCI1 dataset, which has more than 4000 graphs, is used for the test. The accuracy of NCI1 on various architectures can be found in Figure 3.
|
| 170 |
+
|
| 171 |
+
Table 3: Details of Tested Architectures in Efficiency Evaluation Experiment
|
| 172 |
+
|
| 173 |
+
<table><tr><td></td><td>2-4-2</td><td>2-4-4</td><td>2-4-8</td><td>2-4-16</td><td>4-4-2</td><td>4-4-4</td><td>4-4-8</td><td>4-4-16</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>No. trainable Para.(Caps)</td><td>208</td><td>367</td><td>688</td><td>1328</td><td>448</td><td>704</td><td>1216</td><td>2240</td></tr><tr><td>No. trainable Para.(Scalar)</td><td>216</td><td>370</td><td>692</td><td>1336</td><td>452</td><td>712</td><td>1232</td><td>2246</td></tr><tr><td>Dim Node Feat.(Both)</td><td>2 2×4</td><td>2 4×4</td><td>2 8×4</td><td>2 16×4</td><td>4</td><td>4</td><td>4</td><td>4</td></tr><tr><td>Dim Graph emb.(Caps) Dim FC.(Scalar)</td><td>12</td><td>23</td><td>48</td><td>92</td><td>2×4 10</td><td>4×4 20</td><td>8×4 40</td><td>16×4 79</td></tr></table>
|
| 174 |
+
|
| 175 |
+
In Table 3 and Figure 3, the setting of different architectures is represented as $d _ { n } { - } d _ { g } { - } P$ . Here, we choose the simplest setting (2-4-2) as an example: 2-4-2 means that the dimension of nodes capsules is $d _ { n } = 2$ , the dimension of graph and class capsules is $d _ { g } = 4$ and the number of graph capsules $P$ equals to 2. Besides, we set the dimension of FC of its corresponding scalar-based architecture as 12 so that they have comparable number of trainable weights. In this case, each graph is modeled as 2 4-dimensional graph embeddings in the CapsGNN or 1 12-dimensional graph embedding in its corresponding scalar-based architecture. Both architectures are sub-optimal to represent the whole dataset while CapsGNN can still reach higher accuracy compared with the scalar-based architecture.
|
| 176 |
+
|
| 177 |
+
As we can see from Figure 3, the test accuracy of Caps-based architectures (CapsGNN) is higher than the corresponding scalar-based architectures in all settings. For the training accuracy, when the dimension of FC is slightly higher than the dimension of graph embeddings in CapsGNN, CapsGNN can still reach higher accuracy which indicates that CapsGNN is more powerful in representing the whole dataset. When we keep increasing the number of graph capsules in CapsGNN and enlarging the dimension of FC in scalar-based architectures, the difference between the dimension of graph embeddings and the size of FC becomes larger, their training accuracy will be closer. It is noted that the training accuracy of scalar-based architectures is slightly higher than the CapsGNNs when the dimension of FC is about $20 \%$ larger than the dimension of graph capsules. In this experiment, we use extremely simple architectures on purpose to simulate the situation where we need to model complex datasets with relatively simple architectures. Since each pair of CapsGNN and its corresponding scalar-based architecture have similar structure and comparable number of trainable weights, the higher training accuracy and testing accuracy of CapsGNN demonstrate its efficiency in feature encoding and its strong capability of generalization.
|
| 178 |
+
|
| 179 |
+

|
| 180 |
+
Figure 3: Comparison of efficiency in feature representation. The horizontal axis represents the setting of tested architectures. The vertical axis represents classification accuracy on NCI1.
|
| 181 |
+
|
| 182 |
+
# 4.3 GRAPH CAPSULES ANALYSIS
|
| 183 |
+
|
| 184 |
+
CapsGNN leverages on capsules idea to get multiple embeddings for each graph so that complex information underlying graphs can be captured more effectively. To explore the properties of the extracted graph/class capsules, we plot the graph distribution based on capsules extracted from different channels with t-SNE. Due to space constrain, we only take REDDIT-M12K as an example.
|
| 185 |
+
|
| 186 |
+
Table 4: Visualization of Graph Capsules
|
| 187 |
+
|
| 188 |
+
<table><tr><td>Subreddit</td><td>Channel 1</td><td>Channel2</td><td>Channel 11</td><td>Channel 14</td></tr><tr><td>atheism & IAmA</td><td></td><td></td><td></td><td></td></tr><tr><td>atheism & mildlyinteresting</td><td></td><td></td><td></td><td></td></tr></table>
|
| 189 |
+
|
| 190 |
+
We choose to depict the distribution of graphs which are generated from 3 categories, namely atheism , IAmA and mildlyinteresting with capsules extracted from the 1st, 2nd, 11th, 14th channel of graph capsules. As we can see from Table 4, different channels of capsules represent different aspects of graph properties. atheism and IAmA can be discriminated obviously with capsules extracted from the 11th and the 14th channels while they are hard to be separated with capsules extracted from the 1st and the 2nd channels. However, atheism and mildlyinteresting can be discriminated with the capsules extracted from the 1st and the 2nd channels while they are mixed in the 11th and the 14th channels which is opposite to the case of atheism and IAmA. This phenomenon can also be observed in other multi-class datasets. It is still hard to figure out the specific aspects these capsules focus on. However, compared with scalar-based neural networks, modeling an object with multiple embeddings makes it possible to explore the meaning of each channel which may lead the model to learn more interpretable embeddings in the future.
|
| 191 |
+
|
| 192 |
+
Table 5: Visualization of Class Capsules
|
| 193 |
+
|
| 194 |
+
<table><tr><td>Subreddit</td><td>atheism</td><td>IAmA</td><td>mildlyinteresting</td><td>Concatenate</td></tr><tr><td>atheism(g)</td><td></td><td></td><td></td><td></td></tr><tr><td>&</td><td></td><td></td><td></td><td></td></tr><tr><td>IAmA(r)</td><td></td><td></td><td></td><td></td></tr><tr><td>&</td><td></td><td></td><td></td><td></td></tr><tr><td></td><td>囍</td><td></td><td></td><td></td></tr><tr><td>mildlyinteresting(b)</td><td></td><td></td><td></td><td></td></tr></table>
|
| 195 |
+
|
| 196 |
+
As we can see from Table 5, different class capsules focus on different classification-related graph properties. For example, the capsules that represent athesism (first column) can well discriminate athesism (red) from the other two types of graphs while IAmA (green) and mildlyinteresting (blue) are mixed in this channel. The similar phenomenon can also be found in other class capsules. Besides, when we concatenate the capsules of these three classes together, three types of graphs can be well discriminated with the concatenated capsules which also directly reflect the classification performance. This property is quite different from standard scalar-based architectures where each graph is modeled with only one graph embedding2. By introducing the concept of capsules, the graph and class capsules can not only preserve classification-related properties of each graph (reflected with the length of class capsules) but also other properties information (reflected with the angle of class capsules). The generated class capsules can also be useful in other follow-up work and we leave this to be explored in the future.
|
| 197 |
+
|
| 198 |
+
# 5 CONCLUSION
|
| 199 |
+
|
| 200 |
+
We have proposed CapsGNN, a novel framework that fuses capsules theory into GNN for more efficient graph representation learning. Inspired by CapsNet, the concepts of capsules are introduced in this architecture to extract features in the form of vectors on the basis of nodes features extracted from GNN. As a result, one graph is represented as multiple embeddings and each embedding captures different aspects of the graph properties. The generated graph and class capsules can preserve not only the classification-related information but also other information with respect to graph properties which might be useful in the follow-up work and we leave this to be explored in the future. We believe this is a novel, efficient and powerful data-driven method to represent high-dimensional data such as graphs. Our model has successfully achieved better or comparable performance when compared with other SOTA algorithms on 6 out of 10 graph classification tasks especially on social datasets. Compared with similar scalar-based architectures, CapsGNN is more efficient in encoding features and this would be very beneficial for processing large datasets.
|
| 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 |
+
Joan Bruna, Wojciech Zaremba, Arthur Szlam, and Yann LeCun. Spectral networks and locally connected networks on graphs. arXiv preprint arXiv:1312.6203, 2013.
|
| 207 |
+
|
| 208 |
+
Jonas Gehring, Michael Auli, David Grangier, and Yann N Dauphin. A convolutional encoder model for neural machine translation. arXiv preprint arXiv:1611.02344, 2016.
|
| 209 |
+
|
| 210 |
+
Will Hamilton, Zhitao Ying, and Jure Leskovec. Inductive representation learning on large graphs. In Advances in Neural Information Processing Systems, pp. 1024–1034, 2017.
|
| 211 |
+
|
| 212 |
+
Mikael Henaff, Joan Bruna, and Yann LeCun. Deep convolutional networks on graph-structured data. arXiv preprint arXiv:1506.05163, 2015.
|
| 213 |
+
|
| 214 |
+
Geoffrey E Hinton, Alex Krizhevsky, and Sida D Wang. Transforming auto-encoders. In International Conference on Artificial Neural Networks, pp. 44–51. Springer, 2011.
|
| 215 |
+
|
| 216 |
+
Geoffrey E Hinton, Sara Sabour, and Nicholas Frosst. Matrix capsules with EM routing. In International Conference on Learning Representations, 2018. URL https://openreview.net/ forum?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ HJWLfGWRb.
|
| 217 |
+
|
| 218 |
+
Sergey Ivanov and Evgeny Burnaev. Anonymous walk embeddings. In Jennifer Dy and Andreas Krause (eds.), Proceedings of the 35th International Conference on Machine Learning, volume 80 of Proceedings of Machine Learning Research, pp. 2186–2195, Stockholmsmssan, Stockholm Sweden, 10–15 Jul 2018. PMLR. URL http://proceedings.mlr.press/ v80/ivanov18a.html.
|
| 219 |
+
|
| 220 |
+
Thomas N Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. In International Conference on Learning Representations, 2017.
|
| 221 |
+
|
| 222 |
+
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.
|
| 223 |
+
|
| 224 |
+
Quoc Le and Tomas Mikolov. Distributed representations of sentences and documents. In International Conference on Machine Learning, pp. 1188–1196, 2014.
|
| 225 |
+
|
| 226 |
+
Laurens van der Maaten and Geoffrey Hinton. Visualizing data using t-sne. Journal of machine learning research, 9(Nov):2579–2605, 2008.
|
| 227 |
+
|
| 228 |
+
Toma´s Mikolov, Martin Karafi ˇ at, Luk ´ a´s Burget, Jan ˇ Cernock ˇ y, and Sanjeev Khudanpur. Recurrent \` neural network based language model. In Eleventh Annual Conference of the International Speech Communication Association, 2010.
|
| 229 |
+
|
| 230 |
+
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.
|
| 231 |
+
|
| 232 |
+
Annamalai Narayanan, Mahinthan Chandramohan, Rajasekar Venkatesan, Lihui Chen, Yang Liu, and Shantanu Jaiswal. graph2vec: Learning distributed representations of graphs. CoRR, abs/1707.05005, 2017. URL http://arxiv.org/abs/1707.05005.
|
| 233 |
+
|
| 234 |
+
Mathias Niepert, Mohamed Ahmed, and Konstantin Kutzkov. Learning convolutional neural networks for graphs. In International conference on machine learning, pp. 2014–2023, 2016.
|
| 235 |
+
|
| 236 |
+
Sara Sabour, Nicholas Frosst, and Geoffrey E Hinton. Dynamic routing between capsules. In Advances in Neural Information Processing Systems, pp. 3856–3866, 2017.
|
| 237 |
+
|
| 238 |
+
Nino Shervashidze, SVN Vishwanathan, Tobias Petri, Kurt Mehlhorn, and Karsten Borgwardt. Efficient graphlet kernels for large graph comparison. In Artificial Intelligence and Statistics, pp. 488–495, 2009.
|
| 239 |
+
|
| 240 |
+
Nino Shervashidze, Pascal Schweitzer, Erik Jan van Leeuwen, Kurt Mehlhorn, and Karsten M Borgwardt. Weisfeiler-lehman graph kernels. Journal of Machine Learning Research, 12(Sep):2539– 2561, 2011.
|
| 241 |
+
|
| 242 |
+
Martin Simonovsky and Nikos Komodakis. Dynamic edgeconditioned filters in convolutional neural networks on graphs. In Proc. CVPR, 2017.
|
| 243 |
+
|
| 244 |
+
Petar Velikovi, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Li, and Yoshua Bengio. Graph attention networks. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum?id $=$ rJXMpikCZ.
|
| 245 |
+
|
| 246 |
+
Saurabh Verma and Zhi-Li Zhang. Hunt for the unique, stable, sparse and fast feature learning on graphs. In Advances in Neural Information Processing Systems, pp. 88–98, 2017.
|
| 247 |
+
|
| 248 |
+
Saurabh Verma and Zhi-Li Zhang. Graph capsule convolutional neural networks. arXiv preprint arXiv:1805.08090, 2018.
|
| 249 |
+
|
| 250 |
+
S Vichy N Vishwanathan, Nicol N Schraudolph, Risi Kondor, and Karsten M Borgwardt. Graph kernels. Journal of Machine Learning Research, 11(Apr):1201–1242, 2010.
|
| 251 |
+
|
| 252 |
+
Pinar Yanardag and SVN Vishwanathan. Deep graph kernels. In Proceedings of the 21th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pp. 1365–1374. ACM, 2015.
|
| 253 |
+
|
| 254 |
+
Muhan Zhang, Zhicheng Cui, Marion Neumann, and Yixin Chen. An end-to-end deep learning architecture for graph classification. In Proceedings of AAAI Conference on Artificial Inteligence, 2018.
|
| 255 |
+
|
| 256 |
+
Heliang Zheng, Jianlong Fu, Tao Mei, and Jiebo Luo. Learning multi-attention convolutional neural network for fine-grained image recognition. In Int. Conf. on Computer Vision, volume 6, 2017.
|
| 257 |
+
|
| 258 |
+
# A SPECIFIC PROCEDURE OF ROUTING
|
| 259 |
+
|
| 260 |
+
The specific procedure of routing is shown in Algorithm 1.
|
| 261 |
+
|
| 262 |
+
Algorithm 1 Dynamic routing mechanism returns parent capsules $\pmb { H }$ given children capsules $_ { s }$ , a set of trainable transform matrices W and the number of iterations $t$ .
|
| 263 |
+
|
| 264 |
+
1: procedure DYNAMIC R $\operatorname { O U T I N G } ( t , S , \mathbb { W } )$
|
| 265 |
+
2: for all children capsule $i : { \boldsymbol { v } } _ { j \mid i } = s _ { i } ^ { T } W _ { i j }$
|
| 266 |
+
3: for all children capsule $i$ to all parent capsule $j$ : $r _ { i j } \gets 0$
|
| 267 |
+
4: for t iterations do
|
| 268 |
+
5: for all children capsule $i$ : $\tilde { { \boldsymbol { r } } } _ { i } \gets s o f t m a x ( { \boldsymbol { r } } _ { i } )$
|
| 269 |
+
6: for all parent capsule $j$ : $\begin{array} { r } { \begin{array} { r } { h _ { j } \sum _ { i } \tilde { r } _ { i j } v _ { i j } } \end{array} } \end{array}$
|
| 270 |
+
7: for all parent capsule $j$ : $\tilde { \mathbf { \pmb { h } } } _ { j } \gets s q u a s h ( \pmb { h } _ { j } )$
|
| 271 |
+
8: for all children capsule $i$ to all parent capsule $j$ : $r _ { i j } \gets r _ { i j } + \tilde { h } _ { j } ^ { T } { \pmb v } _ { i j }$
|
| 272 |
+
9: end for
|
| 273 |
+
10: return $\tilde { h } _ { j }$
|
| 274 |
+
11: end procedure
|
| 275 |
+
|
| 276 |
+
# B DETAILS OF EXPERIMENTAL DATASETS
|
| 277 |
+
|
| 278 |
+
The details of benchmark datasets we use in our experiment is shown in Table 6.
|
| 279 |
+
|
| 280 |
+
Table 6: Dataset Description
|
| 281 |
+
|
| 282 |
+
<table><tr><td>Dataset</td><td>Source</td><td>Graphs</td><td>Classes</td><td>Nodes Avg.</td><td>Edges Avg.</td><td>Nodes Labels</td></tr><tr><td>MUTAG</td><td>Bio</td><td>188</td><td>2</td><td>17.93</td><td>19.79</td><td>7</td></tr><tr><td>ENZYMES</td><td>Bio</td><td>600</td><td>6</td><td>32.46</td><td>63.14</td><td>6</td></tr><tr><td>NCI1</td><td>Bio</td><td>4110</td><td>2</td><td>29.87</td><td>32.30</td><td>23</td></tr><tr><td>PROTEINS</td><td>Bio</td><td>1113</td><td>2</td><td>39.06</td><td>72.81</td><td>4</td></tr><tr><td>D&D</td><td>Bio</td><td>1178</td><td>2</td><td>284.31</td><td>715.65</td><td>82</td></tr><tr><td>COLLAB</td><td>Social</td><td>5000</td><td>3</td><td>74.49</td><td>4914.99</td><td></td></tr><tr><td>IMDB-B</td><td>Social</td><td>1000</td><td>2</td><td>19.77</td><td>193.06</td><td>-</td></tr><tr><td>IMDB-M</td><td>Social</td><td>1500</td><td>3</td><td>13</td><td>131.87</td><td></td></tr><tr><td>REDDIT-M5K</td><td>Social</td><td>4999</td><td>5</td><td>508.5</td><td>1189.74</td><td></td></tr><tr><td>REDDIT-M12K</td><td>Social</td><td>11929</td><td>11</td><td>391.4</td><td>456.89</td><td></td></tr></table>
|
| 283 |
+
|
| 284 |
+
# C COORDINATE ADDITION
|
| 285 |
+
|
| 286 |
+
After Attention Module, coordinate addition can be used to preserve the position information of each node during the procedure of generating node capsule votes. The details of Coordinate Addition module can be found in Figure 4. This module is not necessary in some datasets. Here, we propose this module as a selective optimization. When the GNN goes deeper, the extracted nodes features contain more specific position information of each node. Inspired by Zhang et al. (2018) where the node embeddings learned from the last layer of GNN are taken to order all nodes, we also take the capsules extracted from the last layer of GNN as the position indicators of corresponding nodes by concatenating it with each capsule of the node. The procedure of calculating votes with node position indicators can be written as:
|
| 287 |
+
|
| 288 |
+
$$
|
| 289 |
+
\pmb { v } _ { ( n , i ) j } = [ \pmb { s } _ { ( n , i ) } ^ { T } \pmb { W } _ { i j } ^ { n } \| \pmb { s } _ { ( n , C _ { a l l } ) } ^ { T } \pmb { W } _ { j } ^ { p } ]
|
| 290 |
+
$$
|
| 291 |
+
|
| 292 |
+
where ${ \pmb v } _ { ( n , i ) j } \in R ^ { 1 \times ( d _ { n } + d _ { p } ) }$ represents the node capsule vote from the $i$ th channel of the $n$ th node to the $j$ th channel of graph capsules. $W _ { i j } ^ { n } \in R ^ { d \times d _ { n } }$ and $W _ { j } ^ { p } \in R ^ { d \times d _ { p } }$ are the transform matrices. $\boldsymbol { s } _ { ( n , i ) }$ is the same as introduced in Section 3.2 and $\parallel$ represents concatenate operation.
|
| 293 |
+
|
| 294 |
+

|
| 295 |
+
Figure 4: The structure of Coordinate Addition Module. We take the capsules extracted from the final layer of GNN as the position indicators of corresponding nodes by concatenating it with each capsule of the node. The node capsules votes generated in this way contain more position information.
|
| 296 |
+
|
| 297 |
+
# D DIFFERENCES FROM EXISTING APPROACHES
|
| 298 |
+
|
| 299 |
+
Here, we present a general comparison between CapsGNN with existing approaches.
|
| 300 |
+
|
| 301 |
+
1) Compared with Atwood & Towsley (2016), Simonovsky & Komodakis (2017) and Zhang et al. (2018) (GNN-based graph representation learning architectures), CapsGNN represents node features in the form of capsules. This is helpful to preserve the properties information contained in nodes more efficiently when generating graph embeddings. Besides, each graph is modeled as multiple embeddings in CapsGNN instead of only one embedding used in other approaches. This allows us to capture information of graphs from different aspects. The second difference is that, in these approaches, each part of the graph is given equal importance. However, the attention mechanism used in CapsGNN allows it to assign various weights to different nodes. This leads the model to focus on critical parts of input graphs. Lastly, different from Atwood & Towsley (2016) and Simonovsky & Komodakis (2017), CapsGNN and Zhang et al. (2018) uses node features extracted from multiple layers of GNN so that different size of receptive-fields are applied to preserve more information.
|
| 302 |
+
|
| 303 |
+
2) GCAPS-CNN proposed by Verma & Zhang (2018) also introduced capsule-related concept into graph representation learning. However, they generate capsules in a feature-based manner instead of learning capsules as distributed embeddings. More specifically, when they extend a scalar feature to a capsule for the node $n$ , $P$ higher-order statistical moment value is calculated based on its neighbor nodes and these $P$ value is concatenated to a $P$ -dimensional capsule. Between layers, GCAPSCNN performs dimension reduction to compress capsules back to scalar features, which defeats the purpose of having capsules in the first place. CapsGNN learns each dimension of capsules in a data-driven manner and apply routing mechanism between layers to preserve the learned meaning of each capsule. This also allows us to preserve multiple properties information contained in nodes more efficiently especially when generating graph embeddings.
|
| 304 |
+
|
| 305 |
+
3) Compared with CapsNet proposed by Sabour et al. (2017) which works well in image processing domain, CapsGNN needs to handle more complex situations when handling graphs. In image processing domain, the size of the input images can be standardized by resizing the images. However, it is not possible to simply resize the graphs. So, we introduced an additional Attention Module to tackle graphs that are vastly different in sizes and preserve important parts of graphs. We also propose to use features extracted from all layers of GNN since it is hard to define a suitable receptive-field size for graphs. Furthermore, compared with the architecture of CapsNet, CapsGNN has one additional graph capsules layer which is used to learn multiple graph embeddings and these embeddings reflect different aspects of graph properties which is valuable in future research. To the best of our knowledge, we are the first one to model a graph as multiple embeddings in the form of distributed capsules and we believe this approach of learning representations has a high potential for other complex data analysis which is not limited to graphs. Besides, CapsGNN has different explanation of linear transformation. In CapsNet, by applying a linear trainable transformation to pose vectors, the spatial relationship between object parts and the whole object can be well modeled. However, by applying linear trainable transformation, CapsGNN is simply computing the prediction vectors from nodes-level representations to graph-level representations. This transform matrix is not trying to model the change of viewpoint or capture viewpoint invariant knowledge but to model the relationship between the properties of nodes and the properties of the whole graph.
|
| 306 |
+
|
| 307 |
+
# E EXPERIMENTAL SETTING
|
| 308 |
+
|
| 309 |
+
The same architecture settings are used in CapsGNN for all datasets to show its robust performance. For the node capsules extraction, the GCN has 5 layers $L = 5$ ), the number of channels at each layer is set as the same which is 2 $C _ { l } = 2$ ). The number of graph capsules is fixed as 16 $P = 1 6$ ). The dimension of all capsules are set as 8 $( d = 8$ ). The number of units in the hidden layer of Attention Module is set as 1 of the number of input units. The number of iterations in routing is set as 3. During training stage, we simultaneously reduce $L o s s _ { c }$ and $L o s s _ { r }$ and we scale $L o s s _ { r }$ with 0.1 so that the model focuses on classification task. $\lambda$ is set as 0.5 and 1.0 for multi-class classification and binary classification respectively. As for the node attributes in different datasets, considering that REDDIT-M5K and REDDIT-M12K are large-scale datasets with widely distributed nodes degree, we set the attributes of all nodes in these two datasets as the same which means we consider the initial node embeddings for all the nodes as the same to avoid over-fitting. For the remained relatively small datasets, both of the node degree and other node attributes are sent to CapsGNN as node features to speed up the training and we apply dropout(dropput rate is 0.3) to the input node features to improve the learning performance. The settings are summarized in the Table 7:
|
| 310 |
+
|
| 311 |
+
Table 7: Experimental Setting for Graph Classification
|
| 312 |
+
|
| 313 |
+
<table><tr><td rowspan=1 colspan=1>Hyper-parameter description</td><td rowspan=1 colspan=1>Notation</td><td rowspan=1 colspan=1>Value</td></tr><tr><td rowspan=1 colspan=1>Number of GCNlayers</td><td rowspan=1 colspan=1>L</td><td rowspan=1 colspan=1>5</td></tr><tr><td rowspan=1 colspan=1>Number of channels at each layer</td><td rowspan=1 colspan=1>C</td><td rowspan=1 colspan=1>2</td></tr><tr><td rowspan=1 colspan=1>Number of graph capsules</td><td rowspan=1 colspan=1>P</td><td rowspan=1 colspan=1>16</td></tr><tr><td rowspan=1 colspan=1>Dimension of all capsules</td><td rowspan=1 colspan=1>d</td><td rowspan=1 colspan=1>8</td></tr><tr><td rowspan=1 colspan=1>Number of iterations in routing</td><td rowspan=1 colspan=1>t</td><td rowspan=1 colspan=1>3</td></tr><tr><td rowspan=1 colspan=1>Value used to scale LosSr</td><td rowspan=1 colspan=1>r</td><td rowspan=1 colspan=1>0.1</td></tr><tr><td rowspan=1 colspan=1>Valueused to balance the lossfrom the positive and negative output</td><td rowspan=1 colspan=1>入</td><td rowspan=1 colspan=1>0.5 for multi-class classification1.0 for binary classification</td></tr></table>
|
| 314 |
+
|
| 315 |
+
# F CONTRIBUTION OF EACH MODULE
|
| 316 |
+
|
| 317 |
+
In addition to evaluate the performance of the whole architecture on the classification task, we also provide detailed study to quantify the contributions made by each module in CapsGNN on the classification task. The six comparison architectures set-up is shown as below and the settings of the hyper-parameters are the same as Section 4.1.2.
|
| 318 |
+
|
| 319 |
+
1) CapsGNN ( $\mathrm { G C N } +$ Attention $^ +$ Routing $^ +$ Reconstruction): Basic CapsGNN.
|
| 320 |
+
|
| 321 |
+
2) CapsGNN-Coord ( $\mathrm { G C N } +$ Attention $^ +$ Coordinate $^ +$ Routing $^ +$ Reconstruction): Basic CapsGNN with Coordinate Addition module.
|
| 322 |
+
|
| 323 |
+
3) CapsGNN-Avg (GCN $^ +$ $\mathrm { \ A v e r a g e + F }$ outing $^ +$ Reconstruction): The Attention module in basic CapsGNN is replaced with the Average module.
|
| 324 |
+
|
| 325 |
+
4) CapsGNN-noRout ( $\mathrm { G C N } +$ Attention $^ +$ Reconstruction): In this architecture, we will fix the similarity coefficients between all the capsules from one layer to the next layer as the same so that each children capsule will be equally routed to all the parent capsules.
|
| 326 |
+
|
| 327 |
+
5) CapsGNN-noRecon (GCN $^ +$ Attention $^ +$ Routing): In this architecture, we directly remove the Reconstruction loss module.
|
| 328 |
+
|
| 329 |
+
6) CapsGNN-Avg-noRout $\mathrm { \ G C N + \mathrm { R o u t i n g } ) }$ : In this architecture, we replace the Attention module in basic CapsGNN with the Average module and fix the similarity coefficients between all the capsules from one layer to the next layer as the same.
|
| 330 |
+
|
| 331 |
+
Table 8: Validation Accuracy Comparison of Each Module
|
| 332 |
+
|
| 333 |
+
<table><tr><td>Architecture</td><td>COLLAB</td><td>IMDB-B</td><td>PROTEINS</td><td>NCI1</td><td>D&D</td></tr><tr><td>CapsGNN</td><td>79.77±1.15</td><td>74.42±2.20</td><td>77.27±2.58</td><td>79.23±1.88</td><td>76.16±4.19</td></tr><tr><td>CapsGNN -Coord</td><td>80.00±1.22</td><td>74.81±2.96</td><td>76.58±2.42</td><td>79.04±1.93</td><td>77.41±3.33</td></tr><tr><td>CapsGNN -Avg</td><td>79.61±0.81</td><td>73.29±2.66</td><td>76.54±2.98</td><td>78.36±1.95</td><td>74.44±3.46</td></tr><tr><td>CapsGNN -noRout</td><td>80.48±0.86</td><td>74.11±2.94</td><td>77.18±2.94</td><td>77.62±1.15</td><td>75.28±4.17</td></tr><tr><td>CapsGNN -noRecon</td><td>80.44±0.88</td><td>74.03±2.11</td><td>76.69±1.78</td><td>78.23±2.41</td><td>74.70±3.12</td></tr><tr><td>CapsGNN -Avg-noRout</td><td>80.15±1.02</td><td>74.23±3.47</td><td>75.94±2.61</td><td>76.25±2.40</td><td>73.93±3.56</td></tr></table>
|
| 334 |
+
|
| 335 |
+
The validation accuracy of each architecture is shown in Table 8 where we highlight the highest and lowest accuracy respectively. As we can see from the Table, IMDB-B and D&D reach better performance with CapsGNN-Coord which indicates the effectiveness of Coordinate Addition Module. However, the performance of social datasets is still comparable across all types of architectures. On the other hand, the performance of biological datasets(NCI1, PROTEINS, D&D) is more sensitive to the introduced modules in each architecture. The highest accuracy of NCI1, PROTEINS is achieved on CapsGNN which indicates the little effectiveness of Coordinate Addition Module in these two datasets. More specifically, the comparison between CapsGNN-Avg-noRout and CapsGNN-Avg on NCI1, PROTEINS and D&D indicates the effectiveness of Routing mechanism which improves the accuracy by $2 . 1 \%$ , $0 . 6 \%$ and $0 . 5 1 \%$ respectively. Besides, the comparison between CapsGNNAvg-noRout and CapsGNN-noRout on NCI1, PROTEINS and D&D indicates the effectiveness of Attention Module which improves the accuracy by $1 . 3 7 \%$ , $1 . 2 4 \%$ and $1 . 3 5 \%$ respectively. The accuracy of NCI1, PROTEINS and D&D can be improved by as much as $2 . 9 8 \%$ , $1 . 3 3 \%$ and $2 . 2 3 \%$ when Attention Module and Routing mechanism are combined in the architecture.
|
| 336 |
+
|
| 337 |
+
Overall, CapsGNN is a general framework that fuses capsule theory to GNN for more efficient graph representation learning. In this framework, we also provide multiple possible modules to improve the quality of learned graph embeddings while we do not target to find the best combination of modules for each dataset. Since each possible module plays a different role in different datasets, it would be better to adjust the architecture and hyper-parameters based on practical situation.
|
md/train/Byt3oJ-0W/Byt3oJ-0W.md
ADDED
|
@@ -0,0 +1,580 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# LEARNING LATENT PERMUTATIONS WITH GUMBELSINKHORN NETWORKS
|
| 2 |
+
|
| 3 |
+
Gonzalo E. Mena ∗ Department of Statistics, Columbia University gem2131@columbia.edu
|
| 4 |
+
|
| 5 |
+
David Belanger Google Brain
|
| 6 |
+
|
| 7 |
+
Scott Linderman Department of Statistics, Columbia University
|
| 8 |
+
|
| 9 |
+
Jasper Snoek Google Brain
|
| 10 |
+
|
| 11 |
+
# ABSTRACT
|
| 12 |
+
|
| 13 |
+
Permutations and matchings are core building blocks in a variety of latent variable models, as they allow us to align, canonicalize, and sort data. Learning in such models is difficult, however, because exact marginalization over these combinatorial objects is intractable. In response, this paper introduces a collection of new methods for end-to-end learning in such models that approximate discrete maximum-weight matching using the continuous Sinkhorn operator. Sinkhorn operator is attractive because it functions as a simple, easy-to-implement analog of the softmax operator. With this, we can define the Gumbel-Sinkhorn method, an extension of the Gumbel-Softmax method (Jang et al., 2016; Maddison et al., 2016) to distributions over latent matchings. We demonstrate the effectiveness of our method by outperforming competitive baselines on a range of qualitatively different tasks: sorting numbers, solving jigsaw puzzles, and identifying neural signals in worms.
|
| 14 |
+
|
| 15 |
+
# 1 INTRODUCTION
|
| 16 |
+
|
| 17 |
+
In principle, deep networks can learn arbitrarily sophisticated mappings from inputs to outputs. However, in practice we must encode specific inductive biases in order to learn accurate models from limit data. In a variety of recent research efforts, practitioners have provided models with the ability to explicitly manipulate latent combinatorial objects such as stacks (Dyer et al., 2015; Joulin & Mikolov, 2015), memory slots (Graves et al., 2014; Sukhbaatar et al., 2015), mathematical expressions (Neelakantan et al., 2015), program traces (Gaunt et al., 2016; Bosnjak et al., 2017), ˇ and first order logic (Rocktaschel & Riedel, 2017). Operations on these discrete objects can be ¨ approximated using differentiable operations on continuous relaxations of the objects. As such, these operations can be included as modules in neural network models that can be trained end-toend by gradient descent.
|
| 18 |
+
|
| 19 |
+
Matchings and permutations are a fundamental building block in a variety of applications, as they can be used to align, canonicalize, and sort data. Prior work has developed learning algorithms for supervised learning where the training data includes annotated matchings (Caetano et al., 2009; Petterson et al., 2009; Tang et al., 2016). However, we would like to learn models with latent matchings, where the matching is not provided to us as supervision. This is a common and relevant setting. For example, Linderman et al. (2017) showed a problem from neuroscience involving the identification of neurons from the worm C. elegans can be cast as the inference of latent permutation on a larger hierarchical structure.
|
| 20 |
+
|
| 21 |
+
Unfortunately, maximizing the marginal likelihood for problems with latent matchings is very challenging. Unlike for problems with categorical latent variables, we cannot obtain unbiased stochastic gradients of the marginal likelihood using the score function estimator (Williams, 1992), as computing the probability of a given matching requires computing an intractable partition function for a structured distribution. Instead, we draw on recent work that obtains biased stochastic gradients by relaxing the discrete latent variables into continuous random variables that support the reparametrization trick (Jang et al., 2016; Maddison et al., 2016).
|
| 22 |
+
|
| 23 |
+
Our contributions are the following: first, in Section 2 we present a theoretical result showing that the non-differentiable parameterization of a permutation can be approximated in terms of a differentiable relaxation, the so-called Sinkhorn operator. Based on this result, in Section 3 we introduce Sinkhorn networks, which generalize the work of method of Adams & Zemel (2011) for predicting rankings, and complements the concurrent work by Cruz et al. (2017), by focusing on more fundamental aspects. Further, in Section 4 we introduce the Gumbel-Sinkhorn, an analog of the Gumbel Softmax distribution (Jang et al., 2016; Maddison et al., 2016) for permutations. This enables optimization of the marginal likelihood by the reparametrization trick. Finally, in Section 5 we demonstrate that our methods outperform strong neural network baselines on the tasks of sorting numbers, solving jigsaw puzzles, and identifying neural signals from C. elegans worms.
|
| 24 |
+
|
| 25 |
+
# 2 THE SINKHORN OPERATOR: AN ANALOG OF THE SOFTMAX FORPERMUTATIONS
|
| 26 |
+
|
| 27 |
+
One sensible way to approximate a discrete category by continuous values is by using a temperature-dependent softmax function, component-wise defined as $\begin{array} { r l } { \operatorname { s o f t m a x } _ { \tau } ( x ) _ { i } } & { = } \end{array}$ $\begin{array} { r } { \exp ( x _ { i } / \tau ) \dot { / } \sum _ { j = 1 } \exp ( x _ { j } / \tau ) } \end{array}$ . For positive values of $\tau$ , $\operatorname { s o f t m a x } _ { \tau } ( x ) _ { i }$ is a point in the probability simplex. Also, in the limit $\tau 0$ , $\operatorname { s o f t m a x } _ { \tau } ( x ) _ { i }$ converges to a vertex of the simplex, a one-hot vector corresponding to the largest $x _ { i }$ 1. This approximation is a key ingredient in the successful implementations by Jang et al. (2016); Maddison et al. (2016), and here we extend it to permutations.
|
| 28 |
+
|
| 29 |
+
To do so, we first state an analog of the normalization implemented by the softmax. This is achieved through the Sinkhorn operator (or Sinkhorn normalization, or Sinkhorn balancing), which iteratively normalizes rows and columns of a matrix. Specifically, following Adams & Zemel (2011), we define the Sinkhorn operator $S ( X )$ over an $N$ dimensional square matrix $X$ as:
|
| 30 |
+
|
| 31 |
+
$$
|
| 32 |
+
\begin{array} { r c l } { { S ^ { 0 } ( X ) } } & { { = } } & { { \exp ( X ) , } } \\ { { S ^ { l } ( X ) } } & { { = } } & { { { \mathcal T } _ { c } ( { \mathcal T } _ { r } ( S ^ { l - 1 } ( X ) ) ) , } } \\ { { S ( X ) } } & { { = } } & { { \displaystyle \operatorname* { l i m } _ { l \infty } S ^ { l } ( X ) . } } \end{array}
|
| 33 |
+
$$
|
| 34 |
+
|
| 35 |
+
where $\mathcal { T } _ { r } ( X ) = X \oslash ( X \mathbf { 1 } _ { N } \mathbf { 1 } _ { N } ^ { \top } )$ , and $\mathcal { T } _ { c } ( X ) \ : = \ : X \ : \emptyset \ : ( \mathbf { 1 } _ { N } \mathbf { 1 } _ { N } ^ { \top } X )$ as the row and column-wise normalization operators of a matrix, with $\oslash$ denoting the element-wise division and $\mathbf { 1 } _ { N }$ a column vector of ones. Sinkhorn (1964) proved that $S ( X )$ must belong to the Birkhoff polytope, the set of doubly stochastic matrices, that we denote $\boldsymbol { B } _ { N }$ 2 .
|
| 36 |
+
|
| 37 |
+
Building on our analogy with categories, notice that choosing a category can always be cast as a maximization problem: the choice $\operatorname { a r g m a x } _ { i } x _ { i }$ is the one that maximizes the function $\langle x , v \rangle$ (with $v$ being a one-hot vector), i.e. the maximizing $v ^ { * }$ indexes the largest $x _ { i }$ . Similarly, one may parameterize the choice of a permutation $P$ through a square matrix $X$ , as the solution to the linear assignment problem (Kuhn, 1955), with $\mathcal { P } _ { N }$ denoting the set of permutation matrices and $\langle A , B \rangle _ { F } = \mathrm { t r a c e } ( A ^ { \top } \mathbf { \hat { B } } )$ the (Frobenius) inner product of matrices:
|
| 38 |
+
|
| 39 |
+
$$
|
| 40 |
+
M ( X ) = \mathop { \underset { P \in \mathcal { P } _ { N } } { \operatorname { a r g m a x } } } \left. P , X \right. _ { F } .
|
| 41 |
+
$$
|
| 42 |
+
|
| 43 |
+
We call $M ( \cdot )$ the matching operator, through which we parameterize the hard choice of a permutation (see Figure 3a for an example). Our theoretical contribution is to show that $M ( X )$ can be obtained as the limit of $S ( X / \tau )$ , meaning that one can approximate $M ( X ) \approx S ( X / \tau )$ with a small $\tau$ . Theorem 1 summarizes our finding. We provide a rigorous proof in appendix A; briefly, it is based on showing that $S ( X / \tau )$ solves a certain entropy-regularized problem in $B _ { n }$ , which in the limit converges to the matching problem in equation 2.
|
| 44 |
+
|
| 45 |
+
Theorem 1. For a doubly-stochastic matrix $P$ , define its entropy as $\begin{array} { r } { h ( P ) = - \sum _ { i , j } P _ { i , j } \log { ( P _ { i , j } ) } } \end{array}$ Then, one has,
|
| 46 |
+
|
| 47 |
+
$$
|
| 48 |
+
S ( X / \tau ) = \underset { P \in \mathcal { B } _ { N } } { \arg \operatorname* { m a x } } \langle P , X \rangle _ { F } + \tau h ( P ) .
|
| 49 |
+
$$
|
| 50 |
+
|
| 51 |
+
Now, assume also the entries of $X$ are drawn independently from a distribution that is absolutely continuous with respect to the Lebesgue measure in $\mathbb { R }$ . Then, almost surely, the following convergence holds:
|
| 52 |
+
|
| 53 |
+
$$
|
| 54 |
+
M ( X ) = \operatorname* { l i m } _ { \tau 0 ^ { + } } S ( X / \tau ) .
|
| 55 |
+
$$
|
| 56 |
+
|
| 57 |
+
Finally, we note that Theorem 1 cannot be realized in practice, as it involves a limit on the Sinkhorn iterations $l$ . Instead, we’ll always consider the incomplete version of the Sinkhorn operator (Adams & Zemel, 2011), where we truncate $l$ in (1) to $L$ . Figure 3b in appendix A.3 illustrates the dependence of the approximation in $\tau$ and $L$ .
|
| 58 |
+
|
| 59 |
+
# 3 SINKHORN NETWORKS
|
| 60 |
+
|
| 61 |
+
Now we show how to apply the approximation in Theorem 1 in the context of artificial neural networks. We construct a layer that encodes the representation of a permutation, and show how to train networks containing such layers as intermediate representations.
|
| 62 |
+
|
| 63 |
+
We define the components of this network through a minimal example: consider the supervised task of learning a mapping from scrambled objects $\tilde { X }$ to actual, non-scrambled $X$ . Data, then, are $M$ pairs $( X _ { i } , \tilde { X } _ { i } )$ where ${ \tilde { X } } _ { i }$ can be constructed by randomly permuting pieces of $X _ { i }$ . We state this problem as a permutation-valued regression $X _ { i } = P _ { \theta , \tilde { X } _ { i } } ^ { - 1 } \tilde { X } _ { i } + \varepsilon _ { i }$ , where $\varepsilon _ { i }$ is a noise term, and $P _ { \theta , \tilde { X } _ { i } }$ is the permutation matrix mapping $X _ { i }$ to ${ \tilde { X } } _ { i }$ , which depends on ${ \tilde { X } } _ { i }$ and parameters $\theta$ . We are concerned with minimization of the reconstruction error 3:
|
| 64 |
+
|
| 65 |
+
$$
|
| 66 |
+
f ( \theta , X , \tilde { X } ) = \sum _ { i = 1 } ^ { M } | | X _ { i } - P _ { \theta , \tilde { X } _ { i } } ^ { - 1 } \tilde { X } _ { i } | | ^ { 2 } .
|
| 67 |
+
$$
|
| 68 |
+
|
| 69 |
+
One way to express a complex parameterization of this kind is through a neural network: this network receives $\bar { X } _ { i }$ as input, which is then passed through some intermediate, feed-forward computations of the type $g _ { h } ( W _ { h } x _ { h } + b _ { h } )$ , where $g _ { h }$ are nonlinear activation functions, $x _ { h }$ is the output of a previous layer, and $\theta = \{ ( W _ { h } , b _ { h } ) \} _ { h }$ are the network parameters. To make the final network output be a permutation, we appeal to constructions developed in Section 2: by assuming that the final network output $P _ { \theta , \tilde { X } }$ can be parameterized as the solution of the assignments problem; i.e., $P _ { \theta , \tilde { X } } = M ( g ( \tilde { X } , \theta ) )$ , where $g ( \cdot , \theta )$ represents the outcome of all operations involving $g _ { h }$ .
|
| 70 |
+
|
| 71 |
+
Unfortunately, the above construction involves a non-differentiable $f$ (in $\theta$ ). We use Theorem 1 as a justification for replacing $M ( g ( \tilde { X } , \theta ) )$ by the differentiable $S ( g ( \tilde { X } , \theta ) / \tau )$ in the computational graph. The value of $\tau$ must be chosen with caution: if $\tau$ is too small, gradients vanishes almost everywhere, as $S ( g ( \tilde { X } , \theta ) / \tau )$ approaches the non-differentiable $M ( g ( \tilde { X } , \bar { \theta } ) )$ . Conversely, if $\tau$ is too large, $S ( X / \tau )$ may be far from the vertices of the Birkhoff polytope, and reconstructions $P _ { \theta , \tilde { X } } ^ { - 1 } \tilde { X }$ may be nonsensical (see Figure 2a). Importantly, we will always add noise to the output layer $g ( { \tilde { X } } , \theta )$ as a regularization device: by doing so we ensure uniqueness of $M ( g ( \tilde { X } , \theta ) )$ , which is required for convergence in Theorem 1.
|
| 72 |
+
|
| 73 |
+
# 3.1 PERMUTATION EQUIVARIANCE
|
| 74 |
+
|
| 75 |
+
Among all possible architectures that respect the aforementioned parameterization, we will only consider networks that are permutation equivariant, the natural kind of symmetry arising in this context. Specifically, we require networks to satisfy:
|
| 76 |
+
|
| 77 |
+
$$
|
| 78 |
+
P _ { \theta , P ^ { \prime } \tilde { X } } \left( P ^ { \prime } \tilde { X } \right) = P ^ { \prime } \left( P _ { \theta , \tilde { X } } \tilde { X } \right)
|
| 79 |
+
$$
|
| 80 |
+
|
| 81 |
+
where $P ^ { \prime }$ is an arbitrary permutation. The underlying intuition is simple: reconstructions of objects should not depend on how pieces were scrambled, but only on the pieces themselves. We achieve permutation equivariance by using the same network to process each piece of $\tilde { X }$ , throwing an $N$ dimensional output. Then, these $N$ outputs (each with $N$ components) are used to create the rows of the matrix $g ( \tilde { X } , \theta )$ , to which we finally apply the (differentiable) Sinkhorn operator (i.e. $g$ stacks the composition of the $g _ { h }$ acting locally on each piece). One can interpret each row as representing a vector of local likelihoods of assignment, but they might be inconsistent. The Sinkhorn operator, then, mixes those separate representations, and ensures that consistent (approximate) assignment are produced. With permutation equivariance, the only consideration left to the practitioner is the choice of the particular architecture, which will depend on the particular kind of data. In Section 5 we illustrate the uses of Sinkhorn networks with three examples, each of them using a different architecture. Also, in figure 1 we illustrate a network architecture used in one of our examples.
|
| 82 |
+
|
| 83 |
+
# 3.2 SUMMARY
|
| 84 |
+
|
| 85 |
+
Sinkhorn network is a supervised method for learning to reconstruct a scrambled object $\tilde { X }$ (input) given several training examples $( X _ { i } , \tilde { X _ { i } } )$ . By applying some non-linear transformations, a Sinkhorn network richly parameterizes the mapping between $\tilde { X }$ and the permutation $P$ that once applied to $\tilde { X }$ , will allow to reconstruct the original object as $X _ { r e c } = P ^ { \top } \tilde { X }$ (the output). We note that Sinkhorn networks may be similarly used not only to learn permutations, but also to learn matchings between objects of two sets of the same size.
|
| 86 |
+
|
| 87 |
+

|
| 88 |
+
Figure 1: Schematic of Sinkhorn Network for Jigsaw puzzles. Each piece of the scrambled digit $\tilde { X }$ is processed with the same (convolutional) network $g _ { 1 }$ (arrows with solid circles). The outputs lying on a latent space (rectangles surrounding $\tilde { X }$ ) are then connected through $g _ { 2 }$ (arrows with empty circles) to conform the rows of the matrix $g ( { \tilde { X } } , \theta )$ ; $g ( \tilde { X } , \theta ) _ { i } = g _ { 1 } \circ g _ { 2 } ( \tilde { \tilde { X } } _ { i } )$ . Rows may be interpreted as unnormalized assignment probabilities, indicating individual unnormalized likelihoods of pieces of $\tilde { X }$ to be at every position in the actual image. Applying $S ( \cdot )$ leads to a ‘soft-permutation’ $P _ { \theta , \tilde { X } }$ that resolves inconsistencies in $g ( { \tilde { X } } , \theta )$ . $P _ { \theta , \tilde { X } }$ is then used to recover the actual $X$ at training, although at test time one may use the actual $M ( g ( \tilde { X } , \theta ) )$ .
|
| 89 |
+
|
| 90 |
+
# 4 PROBABILISTIC ASPECTS: THE GUMBEL-SINKHORN AND GUMBEL-MATCHING DISTRIBUTIONS
|
| 91 |
+
|
| 92 |
+
Recently, in Jang et al. (2016) and Maddison et al. (2016), the Gumbel-Softmax or Concrete distributions were defined for computational graphs with stochastic nodes; i.e, latent probabilistic representations. Their choice is guided by the following i) they seek re-parameterizable distributions to enable the re-parameterization trick (Kingma & Welling, 2013), and note that via the Gumbel trick (see below) any categorical distribution is re-parameterizable, ii) since the re-parameterization in i)
|
| 93 |
+
|
| 94 |
+
is not differentiable, they consider instead sampling under the softmax approximation. This gives rise to the Gumbel-Softmax distribution.
|
| 95 |
+
|
| 96 |
+
Here we parallel these choices to enable learning of a probabilistic latent representation of permutations. To this aim, we start by considering a generic distribution on the discrete set $\mathcal { V }$ , with potential function $X : \mathcal { V } \mathbb { R }$ :
|
| 97 |
+
|
| 98 |
+
$$
|
| 99 |
+
p ( y | X ) \propto \exp \left( X ( y ) \right) \mathbf { 1 } _ { y \in \mathcal { Y } } .
|
| 100 |
+
$$
|
| 101 |
+
|
| 102 |
+
Regarding i), the Gumbel trick arises in the context of Perturb and MAP methods (Papandreou & Yuille, 2011) for sampling in discrete graphical models. This has recently received renewed interest (Balog et al., 2017), as it recasts the a difficult sampling problem as an easier optimization problem. In detail, sampling from (6), can be achieved by the maximization of random perturbations of each potential $X ( y )$ , with Gumbel i.i.d. noise $\gamma ( y )$ ; i.e., arg $\begin{array} { r } { \operatorname* { m a x } _ { y \in \mathcal { V } } \{ X ( y ) + \gamma ( y ) \} \sim p ( \cdot | X ) } \end{array}$ . Therefore, one can re-parameterize any categorical distribution (corresponding to (6) with $X ( y ) =$ $\langle X , y \rangle )$ by the choice of a category, after injecting noise.
|
| 103 |
+
|
| 104 |
+
However, the above scheme is unfeasible in our context, as $| y | = N !$ . Nonetheless, we appeal to an interesting result: in cases where $\begin{array} { r } { \gamma ( y ) = \sum _ { i = 1 } ^ { N } \gamma _ { i } ( y _ { i } ) } \end{array}$ i=1 is proposed as a more tractable alternative. Although ultimately heuristic, they $\mathcal { V }$ factorizes, $\begin{array} { r } { \mathcal { Y } = \prod _ { i = 1 } ^ { N } \mathcal { Y } _ { i } ^ { \ 4 } } \end{array}$ , the use of rank-one perturbations be understood as providing approximate or unbiased samples from the true density (Hazan et al., 2013; Tomczak, 2016).
|
| 105 |
+
|
| 106 |
+
Guided by this, we say the random permutation $P$ follows the Gumbel-Matching distribution with parameter $X$ , denoted $P \sim \mathcal { G . M . } ( X )$ , if it has the distribution arising by the rank-one perturbation of (6) on permutations, with the linear potential $X ( P ) = \langle X , P \rangle _ { F }$ (replacing $y$ with $P$ ). One can verify, in a similar line as in Li et al. (2013), that $M ( X + \varepsilon ) \sim { \mathcal { G } } . { \bar { M } } . ( X )$ , if $\varepsilon$ is a matrix of standard i.i.d. Gumbel noise.
|
| 107 |
+
|
| 108 |
+
Unfortunately, as ii) with the categorical case, Gumbel-Matching distribution samples are not differentiable in $X$ , but by appealing to Theorem 1, we define its relaxation for doubly stochastic matrices as follows: we say $P$ follows the Gumbel-Sinkhorn distribution with parameter $X$ and temperature $\tau$ , denoted $P \sim \mathcal { G } . S . ( X , \tau )$ , if it has the distribution of $S ( ( X + \varepsilon ) / \tau )$ . Samples of $\mathcal { G . S . } ( X , \tau )$ converge almost surely to samples of the Gumbel-Matching distribution (see Fig 3c in appendix A.3).
|
| 109 |
+
|
| 110 |
+
Unlike for the categorical case, neither the Gumbel-Matching nor Gumbel-Sinkhorn distributions have tractable densities. However, this does not preclude inference: likelihood-free methods have recently been developed to enable learning in such implicitly defined distributions (Ranganath et al., 2016; Tran et al., 2017). These methods avoid evaluating the likelihood based on the observation that in many cases inference can be cast as the estimation of a likelihood ratio, which can be obtained from samples (Huszar, 2017). Regardless of these useful advances, in the following we develop a ´ solution based on using the likelihoods of random variables whose densities are available.
|
| 111 |
+
|
| 112 |
+
# 4.1 APPROXIMATE POSTERIOR INFERENCE
|
| 113 |
+
|
| 114 |
+
Consider a latent variable model probabilistic model with observed data $Y$ , and latent $Z = \{ P , W \}$ where $P$ is a permutation and $W$ are other variables. Here we illustrate how to approximate the posterior probability $p ( \{ P , W \} | Y )$ using variational inference Blei et al. (2017). Specifically, we aim to maximize the ELBO, the r.h.s. of (7):
|
| 115 |
+
|
| 116 |
+
$$
|
| 117 |
+
\log p ( y ) \geq E _ { q ( Z | Y ) } \left( \log p ( Y | Z ) \right) - K L ( q ( Z | Y ) \parallel p ( Z ) ) .
|
| 118 |
+
$$
|
| 119 |
+
|
| 120 |
+
We assume that both the prior and variational posteriors decompose as products (mean-field). That is, $q ( \{ P , W \} | Y ) = q ( P ) q ( W ) , p ( P , W ) = p ( P ) p ( W )$ . With this assumption, we may focus only on the discrete part of the problem, i.e. without loss of generality we can assume $Z = P$ .
|
| 121 |
+
|
| 122 |
+
We parameterize our variational prior and posteriors on $P$ using the Gumbel-Matching distributions with some parameter $X$ ; ${ \mathcal { G } } . { \mathcal { M } } . ( X )$ . To enable differentiability, we replace them by $\mathcal { G . S . } ( X , \tau )$ distributions, leading to a surrogate ELBO that uses relaxed (continuous) variables. In more detail,
|
| 123 |
+
|
| 124 |
+
<table><tr><td>Test distribution</td><td colspan="5">N=5 N=10 N=15 N=80 N =100 N= 120</td></tr><tr><td>U(0,1)</td><td>.0 .0</td><td>.0</td><td>.0</td><td>.0</td><td>.01</td></tr><tr><td>U(0,1) (Vinyals et al.,2015)</td><td>.06</td><td>0.43 0.9</td><td>1</td><td>1</td><td>1</td></tr><tr><td>U(0,10)</td><td>.0</td><td>.0</td><td>.0</td><td>.0 .02</td><td>.03</td></tr><tr><td>U(0,1000)</td><td>.0</td><td>.0</td><td>.0 .01</td><td>.02</td><td>.04</td></tr><tr><td>U(1,2)</td><td>.0</td><td>.0</td><td>.0 .01</td><td>.04</td><td>.08</td></tr><tr><td>U(10,11)</td><td>.0</td><td>.0</td><td>.0</td><td>.08 .08</td><td>.6</td></tr><tr><td>U(100,101)</td><td>.0</td><td>.0</td><td>.01</td><td>.02 .99</td><td>1.</td></tr><tr><td>U(1000,1001)</td><td>.0</td><td>.0</td><td>.07</td><td>1. 1.</td><td>1.</td></tr></table>
|
| 125 |
+
|
| 126 |
+
Table 1: Results on the number sorting task measured using Prop. any wrong. In the top two rows we compare to Vinyals et al. (2015), showing that our approach can sort far more inputs at significantly higher accuracy. In the bottom rows we evaluate generalization to different intervals on the real line.
|
| 127 |
+
|
| 128 |
+
for our uniform prior over permutations we use the isotropic $\mathcal { G S } . ( X = 0 , \tau _ { p r i o r } )$ distribution, while for the variational posterior we consider the more generic $\mathcal { G . S . } ( X , \tau )$ .
|
| 129 |
+
|
| 130 |
+
Unfortunately, the term $K L ( q ( P | Y ) \parallel p ( P ) ) = K L ( { \mathcal G } . S . ( X , \tau ) \parallel { \mathcal G } . S . ( X = 0 , \tau _ { p r i o r } ) )$ in equation (7) is intractable as there is not closed form expression for the density of ${ \mathcal { G . S } }$ . random variables. As a solution, we use that our prior and posterior are re-parameterizable in terms of matrices $\varepsilon$ of Gumbel i.i.d variables: we have $S ( ( X + \varepsilon ) / \tau ) \sim \mathcal { G } . S . ( X , \tau )$ and $S ( \varepsilon / \tau _ { p r i o r } ) \sim \mathcal { G } . S . ( X =$ $0 , \tau _ { p r i o r } )$ , for the posterior and prior, respectively. To obtain a tractable expression, we propose to use as ‘code’ or stochastic node $Z$ , the variable $( X + \varepsilon ) / \tau$ instead. Then, the KL term substantially simplifies to $K L ( ( X + \varepsilon ) / \tau \parallel \varepsilon / \tau _ { p r i o r } )$ . This term can be computed explicitly, as shown in appendix B.3.
|
| 131 |
+
|
| 132 |
+
This ‘trick’, however, comes at a cost: the divergence $K L ( Z _ { 1 } \parallel Z _ { 2 } )$ would certainly remain unchanged by applying the same invertible transformation $g$ to both variables $Z _ { 1 }$ and $Z _ { 2 }$ , but in the general case, for non-invertible transformations, such as $S ( \cdot )$ , one has $K L ( Z _ { 1 } \parallel Z _ { 2 } ) \geq$ $K L ( g ( \mathsf { \bar { Z } } _ { 1 } ) \parallel g ( Z _ { 2 } ) )$ . This implies that working in the ‘Gumbel space’ might entail the optimization of a less tight lower bound. Nonetheless, through categorical experiments on MNIST (see appendix C.3) we observe this loss of tightness is minimal, suggesting the suitability of our approach on permutations. Finally, we note that key to to our treatment of the problem is the fact that both the prior and posterior were the same function $( S ( \cdot ) )$ of a simpler distribution. This may not be the case in more general models.
|
| 133 |
+
|
| 134 |
+
To conclude this section, we refer the reader to table 8 in appendix D.2 for a summary of all the constructions on permutations developed in this work.
|
| 135 |
+
|
| 136 |
+
# 5 EXPERIMENTS
|
| 137 |
+
|
| 138 |
+
In this section we perform several experiments comparing to existing methods. In the first three experiments we explore different Sinkhorn network architectures of increasing complexity, and therefore, they mostly implements section 3. The fourth experiment relates to the probabilistic constructions described in section 4, and addresses a problem involving marginal inferences over a latent, unobserved permutation. All experimental details not stated here are in appendix B.
|
| 139 |
+
|
| 140 |
+
# 5.1 SORTING NUMBERS
|
| 141 |
+
|
| 142 |
+
To illustrate the capabilities of Sinkhorn Networks in a simple scenario, we consider the task of sorting numbers using artificial neural networks as in Vinyals et al. (2015). Specifically, we sample uniform random numbers $\tilde { X }$ in the [0, 1] interval and we train our network with pairs $( { \tilde { X } } , X )$ where $X$ are the same $\tilde { X }$ but in sorted order. The network has a first fully connected layer that links a number with an intermediate representation (with 32 units), and a second (also fully connected) layer that turns that representation into a row of the matrix $g ( { \tilde { X } } , \theta )$ .
|
| 143 |
+
|
| 144 |
+
Table 1 shows our network learns to sort up to $N = 1 2 0$ numbers. As an evaluation measure, we report the proportion of sequences where there was at least one error (Prop. any wrong). Surprisingly, the network learns to sort numbers even when test examples are not sampled from $U ( 0 , 1 )$ , but on a considerably different interval. This indicates the network is not overfitting. These results can be compared with those from Vinyals et al. (2015), where a much more complex (recurrent) network was used, but performance guarantees were obtained only with at most $N = 1 5$ numbers. In that case, the reported error rate is 0.9, whereas ours starts to degrade only after $N \approx 1 0 0$ for most test intervals.
|
| 145 |
+
|
| 146 |
+
Table 2: Jigsaw puzzle results. We compare to the available result on the Kendall Tau metric from Cruz et al. (2017) and provide additional results from our experiments. Randomly guessed permutations of $n$ items have an expected proportion of errors of $( \bar { n } - 1 ) / n$ . Note that our model has at least $2 0 \mathrm { x }$ fewer parameters..
|
| 147 |
+
|
| 148 |
+
<table><tr><td rowspan="2"></td><td colspan="5">MNIST</td><td colspan="4">Celeba</td><td colspan="2">Imagenet</td></tr><tr><td>2x2</td><td>3x3</td><td>4x4</td><td>5x5</td><td>6x6</td><td>2x2</td><td>3x3</td><td>4x4</td><td>5x5</td><td>2x2</td><td>3x3</td></tr><tr><td>Kendall tau Kendall tau</td><td>1.</td><td>.83</td><td>.43</td><td>.39</td><td>.27</td><td>1.0</td><td>.96</td><td>.88</td><td>.78</td><td>.85</td><td>.73</td></tr><tr><td>(Cruz et al., 2017)</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>-</td><td>.72</td></tr><tr><td>Prop. wrong</td><td>.0</td><td>.09</td><td>.45</td><td>.45</td><td>.59</td><td>.0</td><td>.03</td><td>.1</td><td>.21</td><td>.12</td><td>.26</td></tr><tr><td> Prop. any wrong</td><td>.0</td><td>.28</td><td>.97</td><td>1.</td><td>1.</td><td>.0</td><td>.09</td><td>.36</td><td>.73</td><td>.19</td><td>.53</td></tr><tr><td>11</td><td>.0</td><td>.0</td><td>.04</td><td>.02</td><td>.03</td><td>.0</td><td>.01</td><td>.04</td><td>.08</td><td>.05</td><td>.12</td></tr><tr><td>12</td><td>.0</td><td>.0</td><td>.26</td><td>.18</td><td>.19</td><td>.0</td><td>.11</td><td>.18</td><td>.24</td><td>.22</td><td>.31</td></tr></table>
|
| 149 |
+
|
| 150 |
+
# 5.2 JIGSAW PUZZLES
|
| 151 |
+
|
| 152 |
+
A more complex scenario for learning permutations arises in the reconstruction of an image $X$ from a collection of scrambled “jigsaw” pieces $\tilde { X }$ (Noroozi & Favaro, 2016; Cruz et al., 2017). In this example, our network differs from the one in 5.1 in the first layer is a simple CNN (convolution $^ +$ max pooling), which maps the puzzle pieces to an intermediate representation (see figure 1 for details).
|
| 153 |
+
|
| 154 |
+
For evaluation on test data, we report several measures: first, in addition to Prop. any wrong we also consider Prop. wrong, the overall proportion of scrambled pieces that were wrongly assigned to their actual position. Also, we use $l 1$ and l2 (train) losses and the Kendall tau, a “correlation coefficient” for ranked data. In Table 2, we benchmark results for the MNIST, Celeba and Imagenet datasets, with puzzles between $2 \mathbf { x } 2$ and 6x6 pieces. In MNIST we achieve very low $l 1$ and $l 2$ on up to 6x6 puzzles but a high proportion of errors. This is a consequence of our loss being agnostic to particular permutations, but only caring about reconstruction errors: as the number of black pieces increases with the number of puzzle pieces, many become unidentifiable under this loss.
|
| 155 |
+
|
| 156 |
+
In Celeba, we are able to solve puzzles of up to 5x5 pieces with only $21 \%$ of pieces of faces being incorrectly ordered (see Figure 2a for examples of reconstructions). For this dataset, we provide additional baselines in Table 4 of appendix C.1: there, we show that performance substantially decreases if the temperature is too small or large, but only slightly decreases if only one Sinkhorn iterations is made. We observe that temperature does play a relevant role, consistent with the findings of Maddison et al. (2016); Jang et al. (2016). This might not be obvious a-priori, as one could reason that temperature over-parameterizes the network. However, results confirm this is not the case. We hypothesize that different temperatures result in parameter convergence in different phases or regions. Also, the minor difference for a single iteration suggest that only a few might be necessary, implying potential savings in the memory needed to unroll computations in the graph, during training.
|
| 157 |
+
|
| 158 |
+
Learning in the Imagenet dataset is much more challenging, as there isn’t a sequential structure that generalizes among images, unlike Celeba and MNIST. In this dataset, our network ties with the .72 Kendall tau score reported in (Cruz et al., 2017). Their network, named DeepPermNet, is based on the stacking of up to the sixth fully connected layer fc6 of AlexNet (Krizhevsky et al., 2012), which finally (fully) connects to a Sinkhorn layer through intermediate fc7 and fc8. We note, however, our network is much simpler, with only two layers and far fewer parameters. Specifically, the network that produced our best results had around 1,050,000 parameters (see appendix $\mathbf { B }$ for a derivation), while in DeepPermNet, the layer connecting $f c 6$ with $f c 7$ has $5 1 2 \times 4 0 9 6 \times 9 \approx 1 9 , 0 0 0 , 0 0 0$ parameters, let alone the AlexNet parameters (also to be learned). Indeed, we believe there is no reason to consider a complex stacking of convolutions: as the number of pieces increases, each piece is smaller and the convolutional layer eventually becomes fully connected. In the following experiment we explore this phenomenon in more detail.
|
| 159 |
+
|
| 160 |
+

|
| 161 |
+
Figure 2: (a) Sinkhorn networks can be trained to solve Jigsaw Puzzles. Given a trained model, ‘soft’ reconstructions are shown at different $\tau$ using $S ( X / \tau )$ . We also show hard reconstructions, made by computing $M ( X )$ with the Hungarian algorithm (Munkres, 1957). (b) Sinkhorn networks can also be used to learn to transform any MNIST digit into another. We show hard and soft reconstructions, with $\tau = 1$ .
|
| 162 |
+
|
| 163 |
+
# 5.3 ASSEMBLY OF ARBITRARY MNIST DIGITS FROM PIECES
|
| 164 |
+
|
| 165 |
+
We also consider an original application, motivated by the observation that the Jigsaw Puzzle task becomes ill-posed if a puzzle contains too many pieces. Indeed, consider the binarized MNIST dataset: there, reconstructions are not unique if pieces are sufficiently atomic, and in the limit case of pieces of size 1x1 squared pixels, for a given scrambled MNIST digit there are as many valid reconstructions as there are MNIST digits with the same number of white pixels. In other words, reconstructions stop being probabilistic and become a multimodal distribution over permutations.
|
| 166 |
+
|
| 167 |
+
We exploit this intuition to ask whether a neural network can be trained to achieve arbitrary digit reconstructions, given their loose atomic pieces. To address this question, we slightly changed the network in 5.2, this time stacking several second layers linking an intermediate representation to the output. We trained the network to reconstruct a particular digit with each layer, by using digit identity to indicate which layer should activate with a particular training example.
|
| 168 |
+
|
| 169 |
+
Our results demonstrate a positive answer: Figure 2b shows reconstructions of arbitrary digits given $1 0 \mathrm { x } 1 0$ scrambled pieces. In general, they can be unambiguously identified by the naked eye. Moreover, this judgement is supported by the assessment of a neural network. Specifically, we trained a two-layer CNN 5 on MNIST (achieving a $9 9 . 2 \%$ accuracy on test set) and evaluated its performance on the test set generated by arbitrary transformations of each digit of the original test set into any other digit. We found the CNN made an appropriate judgement in $8 5 . 1 \%$ of the time. More specific results, regarding specific transformations are presented in Table 5 of appendix C.2.
|
| 170 |
+
|
| 171 |
+
Finally, we note that meaningful assemblies are possible regardless of the original digit: in Figure 4 of appendix C.2 we show arbitrary reconstructions, by this same network, of “digits” from a ‘strongly mixed’ MNIST dataset. In detail, these “digits” were crafted by sampling, without replacement, from a bag containing all the small pieces from all original digits. These reconstructions suggest the possibility of an alternative to generative modeling, based on the (random) assembly of small pieces of noise, instead of the processing of noise through a neural network. However, this would require training the network without supervision, which is beyond the scope of this work.
|
| 172 |
+
|
| 173 |
+
<table><tr><td rowspan="2">Prop. known neurons Difficulty</td><td colspan="2">40.%</td><td colspan="2">30.%</td><td colspan="2">20.%</td><td colspan="2">10.%</td></tr><tr><td>Easy</td><td>Hard</td><td>Easy</td><td>Hard</td><td>Easy</td><td>Hard</td><td>Easy</td><td>Hard</td></tr><tr><td>MCMC</td><td>.85</td><td>.82</td><td>.51</td><td>.44</td><td>.29</td><td>.27</td><td>.16</td><td>.12</td></tr><tr><td>(Linderman et al., 2017)</td><td>.97</td><td>.95</td><td>.90</td><td>.85</td><td>.77</td><td>.59</td><td>.39</td><td>.21</td></tr><tr><td>Gumbel-Sinkhorn</td><td>.97</td><td>.96</td><td>.92</td><td>.84</td><td>.76</td><td>.59</td><td>.44</td><td>.26</td></tr><tr><td>Gumbel-Sinkhorn, no regularization</td><td>.96</td><td>.93</td><td>.89</td><td>.78</td><td>.71</td><td>.52</td><td>.4</td><td>.23</td></tr></table>
|
| 174 |
+
|
| 175 |
+
Table 3: Results for the C. elegans neural inference problem.
|
| 176 |
+
|
| 177 |
+
# 5.4 POSTERIOR INFERENCE OVER PERMUTATIONS WITH THE GUMBEL-SINKHORN ESTIMATOR
|
| 178 |
+
|
| 179 |
+
We illustrate how the ${ \mathcal { G . S } }$ . distribution can be used as a continuous relaxation for stochastic nodes in a computational graph. To this end, we revisit the “C. elegans neural identification problem”, originally introduced in Linderman et al. (2017). We refer the reader to (Linderman et al., 2017) for an in-depth introduction, but briefly, C. elegans is a nematode (worm) whose biological neural configuration – the connectome – is stereotypical; i.e. specimens always posses the same number of somatic neurons (282) (Varshney et al., 2011), and the ways those neurons connect and interact changes little from worm to worm. Therefore, its brain can be thought of as a canonical object, and its neurons can unequivocally be identified with names.
|
| 180 |
+
|
| 181 |
+
The task, then, consists of matching traces from the observed neural dynamics $Y$ to identities (neuron names) in the canonical brain. This problem is stated in terms of a Bayesian hierarchical model, in order to profit from prior information that may constrain the possibilities. Specifically, one states a linear dynamical system $\begin{array} { r } { Y _ { t } = P W P ^ { \top } Y _ { t - 1 } \dot { + } \nu _ { t } } \end{array}$ , where $\nu _ { t }$ is a noise term and $W$ and $P$ are latent variables with respective prior distributions. $W$ encodes the dynamics, with a prior $p ( W )$ to represent the sparseness of the connectome, etc., and $P$ is a permutation matrix representing the matching between indexes of observed neurons and their canonical counterparts, where we place a flat prior $p ( P )$ over permutations. Notably, within the framework it is possible to model the simultaneous problem with many worms sharing the same dynamical system, but here we avoid explicit references to individuals for notational ease.
|
| 182 |
+
|
| 183 |
+
Given this model, we seek the posterior distribution $p ( \{ P , W \} | Y )$ , a problem that we address with variational inference (Blei et al., 2017) using the constructions developed in 4.1. In Table 3 (and also in Table 7 of appendix C.4) we show results for this task, using accuracy in matching as the performance measure. These are broken down by relevant experimental covariates (Linderman et al., 2017): different proportion of neurons known beforehand, and by task difficulty. As baselines, we include i) a simple MCMC sampler that proposes local swipes on permutations ii) the rounding method presented in Linderman et al. (2017), iii) our method, where we also consider the absence of regularization. Results show our method outperforms the alternatives in most cases. MCMC fails because mixing is poor, but differences are much subtler with the other baselines. With them, we see that clear differences with the no-regularization case confirm the stochastic nature of this problem, i.e., that it is truly necessary to represent a latent probabilistic permutation. We believe our method outperforms the one in Linderman et al. (2017) because theirs, although it provides a explicit density, is a less tight relaxation, in the sense that points can be anywhere in the space, and not only on the Birkhoff polytope. Therefore, their prior also needs to be defined on the entire space and may not property act as an efficient regularizer.
|
| 184 |
+
|
| 185 |
+
# 6 RELATED WORK
|
| 186 |
+
|
| 187 |
+
Learning with matchings has been extensively been studied in the machine learning community; but current applications mostly relate to structured prediction (Petterson et al., 2009; Tang et al., 2016). However, our probabilistic treatment focuses on marginal inference in a model with a latent matching. This is a more challenging scenario, as standard learning techniques, i.e. the score function estimator or REINFORCE (Williams, 1992), are not applicable due to the partition function for non-trivial distributions over matchings.
|
| 188 |
+
|
| 189 |
+
In the case of latent categories, a recent technique that combines a relaxation and the reparameterization trick (Kingma & Welling, 2013) was proposed as a competitive alternative to REINFORCE for the marginal inference scenario. Specifically, Maddison et al. (2016); Jang et al. (2016) use the Gumbel-trick to re-parameterize a discrete density, and then replace it with a relaxed surrogate, the Gumbel Softmax distribution, to enable gradient-descent. Our work, like the simultaneous work of Linderman et al. (2017), aims to extends the scope of this technique to latent permutations. We deem our Gumbel Sinkhorn distributions as the most natural tractable extension of the Gumbel Softmax to permutations, as we clearly parallel each of the steps leading to its construction. A parallel is also presented in Linderman et al. (2017); and notably, unlike ours, their framework produces tractable densities. However, it is less clear how their constructions extend each of the features of the Gumbel Softmax: for example, their rounding-based relaxation also utilizes the Sinkhorn operator, but the limit they consider does not make use of the non-trivial statement of Theorem 1, which naturally extends the categorical case (see appendix A.2 for details). In practice, we see our results favor the Gumbel Sinkhorn distribution, since it is a tighter relaxation.
|
| 190 |
+
|
| 191 |
+
Connections between permutations and the Sinkhorn operator have been known for at least twenty years. Indeed, the limit in Theorem 1 was first presented in Kosowsky & Yuille (1994), but their interpretation and motivation were more linked to statistical physics and economics. However, our approach is different and links to recent developments in optimal transport (OT) (Villani, 2003): Theorem 1 draws on the entropy-regularization for OT technique developed inCuturi (2013), where the entropy-regularized transportation problem is referred to as a ‘Sinkhorn distance’. The extension is sensible as in the case of transportation between two discrete measures (here) the Birkhoff polytope appears naturally as the optimization set (Villani, 2003). Entropy regularization as means to achieve a differentiable version of a loss was first proposed in Genevay et al. (2017) in the context of generative modeling. Although this field may appear separate, recent work (Salimans et al., 2018) makes explicit the connection to permutations: to compute a (Wasserstein) distance between a batch of dataset samples and one of generative samples of the same size, one needs to solve the matching problem so that the distance between matched samples is minimized. Finally, we note our work shares with Salimans et al. (2018); Genevay et al. (2017) in that the OT cost function (here, the matrix $X$ ) is learned using an artificial neural network.
|
| 192 |
+
|
| 193 |
+
We understand our work as extending Adams & Zemel (2011), which developed neural networks to learn a permutation-like structure; a ranking. However, there, as in Helmbold & Warmuth (2009), the objective function was linear and the Sinkhorn operator was instead used as an approximation of a matrix of the marginals, i.e., $S ( P ) \approx E ( P )$ . In consequence, there was no need to introduce a temperature parameter and consider a limit argument, which is critical to our case. Interestingly, equation (10) can be understood in terms of approximate marginal inference, justifying the approximation $S ( P ) \approx E ( P )$ . We comment on this in appendix D.1. Note that Sinkhorn iteration can be interpreted as mean-field inference in an associated Gibbs distribution over matchings. With this in mind, backpropagation through Sinkhorn is an end-to-end learning in an unrolled inference algorithm Stoyanov et al. (2011); Domke (2013). In future work, it may be fruitful to unroll alternative algorithms for marginal inference over matchings, such as belief propagation (Huang & Jebara, 2009).
|
| 194 |
+
|
| 195 |
+
Sinkhorn networks were also very recently introduced in Cruz et al. (2017), although their work substantially differs from ours. While their interest lies in the representational aspects of CNN’s, we are more concerned with the more fundamental properties. In their work, they don’t consider a temperature parameter $\tau$ , but their network still successfully learns, as $\tau = 1$ happens to fall within the range of reasonable values. On the Jigsaw puzzle task, we showed that we achieve equivalent performance with a much simpler network having several times fewer parameters and layers. Nonetheless, we recognize the need for more complex architectures for the tasks considered in Cruz et al. (2017), and we hope our more general theory; particularly, Theorem 1 and the notion of equivariance, may aid further developments in that direction.
|
| 196 |
+
|
| 197 |
+
# 7 DISCUSSION
|
| 198 |
+
|
| 199 |
+
We have demonstrated Sinkhorn networks are able to learn to find the right permutation in the most elementary cases; where all training samples obey the same sequential structure; e.g., in sorted number and in pieces of faces, as we expect parts of faces occupy similar positions from sample to sample. This is already non-trivial, as indicates one can train a neural network to solve the linear assignment problem.
|
| 200 |
+
|
| 201 |
+
However, the fact that Imagenet represented a much more challenging scenario indicates there are clear limits to our formulation. As the most obvious extension we propose to introduce a sequential stage, in which current solutions are kept on a memory buffer, and improved. One way to achieve this would be by exploring more complex parameterizations for permutations; i.e. replacing $M ( X )$ by a quadratic operator that may parameterize a notion of local distance between pieces. Alternatively, one may resort to reinforcement learning techniques, as suggested in Bello et al. (2016). Either sequential improvement would help solve the “Order Matters” problem (Vinyals et al., 2015), and we deem our elementary work as a significant step in that direction.
|
| 202 |
+
|
| 203 |
+
We have made available Tensorflow code for Gumbel-Sinkhorn networks featuring an implementation of the number sorting experiment at http://github.com/google/gumbel sinkhorn .
|
| 204 |
+
|
| 205 |
+
# REFERENCES
|
| 206 |
+
|
| 207 |
+
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.
|
| 208 |
+
Ryan Prescott Adams and Richard S Zemel. Ranking via sinkhorn propagation. arXiv preprint arXiv:1106.1925, 2011.
|
| 209 |
+
Matej Balog, Nilesh Tripuraneni, Zoubin Ghahramani, and Adrian Weller. Lost relatives of the gumbel trick. arXiv preprint arXiv:1706.04161, 2017.
|
| 210 |
+
Irwan Bello, Hieu Pham, Quoc V Le, Mohammad Norouzi, and Samy Bengio. Neural combinatorial optimization with reinforcement learning. arXiv preprint arXiv:1611.09940, 2016.
|
| 211 |
+
Garrett Birkhoff. Tres observaciones sobre el algebra lineal. Univ. Nac. Tucuman. Revista A ´ , 5: 147–151, 1946.
|
| 212 |
+
David M Blei, Alp Kucukelbir, and Jon D McAuliffe. Variational inference: A review for statisticians. Journal of the American Statistical Association, (just-accepted), 2017.
|
| 213 |
+
Matko Bosnjak, Tim Rockt ˇ aschel, Jason Naradowsky, and Sebastian Riedel. Programming with a ¨ differentiable forth interpreter. In Doina Precup and Yee Whye Teh (eds.), Proceedings of the 34th International Conference on Machine Learning, volume 70 of Proceedings of Machine Learning Research, pp. 547–556, International Convention Centre, Sydney, Australia, 06–11 Aug 2017. PMLR. URL http://proceedings.mlr.press/v70/bosnjak17a.html.
|
| 214 |
+
Tiberio S Caetano, Julian J McAuley, Li Cheng, Quoc V Le, and Alex J Smola. Learning graph ´ matching. IEEE transactions on pattern analysis and machine intelligence, 31(6):1048–1058, 2009.
|
| 215 |
+
Roberto Cominetti and Jaime San Mart´ın. Asymptotic analysis of the exponential penalty trajectory in linear programming. Mathematical Programming, 67(1-3):169–187, 1994.
|
| 216 |
+
Rodrigo Santa Cruz, Basura Fernando, Anoop Cherian, and Stephen Gould. Deeppermnet: Visual permutation learning. arXiv preprint arXiv:1704.02729, 2017.
|
| 217 |
+
Marco Cuturi. Sinkhorn distances: Lightspeed computation of optimal transport. In Advances in neural information processing systems, pp. 2292–2300, 2013.
|
| 218 |
+
Justin Domke. Learning graphical model parameters with approximate marginal inference. IEEE transactions on pattern analysis and machine intelligence, 35(10):2454–2467, 2013.
|
| 219 |
+
Chris Dyer, Miguel Ballesteros, Wang Ling, Austin Matthews, and Noah A Smith. Transition-based dependency parsing with stack long short-term memory. arXiv preprint arXiv:1505.08075, 2015.
|
| 220 |
+
Alexander L Gaunt, Marc Brockschmidt, Rishabh Singh, Nate Kushman, Pushmeet Kohli, Jonathan Taylor, and Daniel Tarlow. Terpret: A probabilistic programming language for program induction. arXiv preprint arXiv:1608.04428, 2016.
|
| 221 |
+
|
| 222 |
+
Aude Genevay, Gabriel Peyre, and Marco Cuturi. Learning generative models with sinkhorn diver- ´ gences. arXiv preprint arXiv:1706.00292, 2017.
|
| 223 |
+
|
| 224 |
+
Amir Globerson and Tommi Jaakkola. Approximate inference using conditional entropy decompositions. In International Conference on Artificial Intelligence and Statistics, pp. 130–138, 2007.
|
| 225 |
+
|
| 226 |
+
Alex Graves, Greg Wayne, and Ivo Danihelka. Neural turing machines. arXiv preprint arXiv:1410.5401, 2014.
|
| 227 |
+
|
| 228 |
+
Tamir Hazan and Tommi Jaakkola. On the partition function and random maximum a-posteriori perturbations. arXiv preprint arXiv:1206.6410, 2012.
|
| 229 |
+
|
| 230 |
+
Tamir Hazan, Subhransu Maji, and Tommi Jaakkola. On sampling from the gibbs distribution with random maximum a-posteriori perturbations. In Advances in Neural Information Processing Systems, pp. 1268–1276, 2013.
|
| 231 |
+
|
| 232 |
+
David P Helmbold and Manfred K Warmuth. Learning permutations with exponential weights. Journal of Machine Learning Research, 10(Jul):1705–1736, 2009.
|
| 233 |
+
|
| 234 |
+
Bert Huang and Tony Jebara. Approximating the permanent with belief propagation. arXiv preprint arXiv:0908.1769, 2009.
|
| 235 |
+
|
| 236 |
+
Ferenc Huszar. Variational inference using implicit distributions. ´ arXiv preprint arXiv:1702.08235, 2017.
|
| 237 |
+
|
| 238 |
+
Eric Jang, Shixiang Gu, and Ben Poole. Categorical reparameterization with gumbel-softmax. arXiv preprint arXiv:1611.01144, 2016.
|
| 239 |
+
|
| 240 |
+
Armand Joulin and Tomas Mikolov. Inferring algorithmic patterns with stack-augmented recurrent nets. In C. Cortes, N. D. Lawrence, D. D. Lee, M. Sugiyama, and R. Garnett (eds.), Advances in Neural Information Processing Systems 28, pp. 190– 198. Curran Associates, Inc., 2015. URL http://papers.nips.cc/paper/ 5857-inferring-algorithmic-patterns-with-stack-augmented-recurrent-nets. pdf.
|
| 241 |
+
|
| 242 |
+
Diederik P Kingma and Max Welling. Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114, 2013.
|
| 243 |
+
|
| 244 |
+
Philip A Knight. The sinkhorn–knopp algorithm: convergence and applications. SIAM Journal on Matrix Analysis and Applications, 30(1):261–275, 2008.
|
| 245 |
+
|
| 246 |
+
JJ Kosowsky and Alan L Yuille. The invisible hand algorithm: Solving the assignment problem with statistical physics. Neural networks, 7(3):477–490, 1994.
|
| 247 |
+
|
| 248 |
+
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.
|
| 249 |
+
|
| 250 |
+
Harold W Kuhn. The hungarian method for the assignment problem. Naval Research Logistics (NRL), 2(1-2):83–97, 1955.
|
| 251 |
+
|
| 252 |
+
Ke Li, Kevin Swersly, Ryan, and Richard S Zemel. Efficient feature learning using perturb-and-map. NIPS Workshop on Perturbations, Optimization, and Statistics, 2013.
|
| 253 |
+
|
| 254 |
+
Scott W Linderman, Gonzalo E Mena, Hal Cooper, Liam Paninski, and John P Cunningham. Reparameterizing the birkhoff polytope for variational permutation inference. arXiv preprint arXiv:1710.09508, 2017.
|
| 255 |
+
|
| 256 |
+
Chris J Maddison, Andriy Mnih, and Yee Whye Teh. The concrete distribution: A continuous relaxation of discrete random variables. arXiv preprint arXiv:1611.00712, 2016.
|
| 257 |
+
|
| 258 |
+
James Munkres. Algorithms for the assignment and transportation problems. Journal of the society for industrial and applied mathematics, 5(1):32–38, 1957.
|
| 259 |
+
|
| 260 |
+
Arvind Neelakantan, Quoc V Le, and Ilya Sutskever. Neural programmer: Inducing latent programs with gradient descent. arXiv preprint arXiv:1511.04834, 2015.
|
| 261 |
+
|
| 262 |
+
Mehdi Noroozi and Paolo Favaro. Unsupervised learning of visual representations by solving jigsaw puzzles. In European Conference on Computer Vision, pp. 69–84. Springer, 2016.
|
| 263 |
+
|
| 264 |
+
George Papandreou and Alan L Yuille. Perturb-and-map random fields: Using discrete optimization to learn and sample from energy models. In Computer Vision (ICCV), 2011 IEEE International Conference on, pp. 193–200. IEEE, 2011.
|
| 265 |
+
|
| 266 |
+
James Petterson, Jin Yu, Julian J McAuley, and Tiberio S Caetano. Exponential family graph match- ´ ing and ranking. In Advances in Neural Information Processing Systems, pp. 1455–1463, 2009.
|
| 267 |
+
|
| 268 |
+
Rajesh Ranganath, Dustin Tran, Jaan Altosaar, and David Blei. Operator variational inference. In Advances in Neural Information Processing Systems, pp. 496–504, 2016.
|
| 269 |
+
|
| 270 |
+
C Radhakrishna Rao. Convexity properties of entropy functions and analysis of diversity. Lecture Notes-Monograph Series, pp. 68–77, 1984.
|
| 271 |
+
|
| 272 |
+
Ralph Tyrell Rockafellar. Convex analysis. Princeton university press, 1970.
|
| 273 |
+
|
| 274 |
+
Tim Rocktaschel and Sebastian Riedel. End-to-end differentiable proving. ¨ arXiv preprint arXiv:1705.11040, 2017.
|
| 275 |
+
|
| 276 |
+
Tim Salimans, Han Zhang, Alec Radford, and Dimitris Metaxas. Improving GANs using optimal transport. In International Conference on Learning Representations, 2018. URL https:// openreview.net/forum?id $=$ rkQkBnJAb.
|
| 277 |
+
|
| 278 |
+
Richard Sinkhorn. A relationship between arbitrary positive matrices and doubly stochastic matrices. The annals of mathematical statistics, 35(2):876–879, 1964.
|
| 279 |
+
|
| 280 |
+
Richard Sinkhorn and Paul Knopp. Concerning nonnegative matrices and doubly stochastic matrices. Pacific Journal of Mathematics, 21(2):343–348, 1967.
|
| 281 |
+
|
| 282 |
+
Veselin Stoyanov, Alexander Ropson, and Jason Eisner. Empirical risk minimization of graphical model parameters given approximate inference, decoding, and model structure. In Proceedings of the Fourteenth International Conference on Artificial Intelligence and Statistics, pp. 725–733, 2011.
|
| 283 |
+
|
| 284 |
+
Sainbayar Sukhbaatar, Jason Weston, Rob Fergus, et al. End-to-end memory networks. In Advances in neural information processing systems, pp. 2440–2448, 2015.
|
| 285 |
+
|
| 286 |
+
Kui Tang, Nicholas Ruozzi, David Belanger, and Tony Jebara. Bethe learning of conditional random fields via map decoding. AISTATS, 2016.
|
| 287 |
+
|
| 288 |
+
Jakub M Tomczak. On some properties of the low-dimensional gumbel perturbations in the perturband-map model. Statistics & Probability Letters, 115:8–15, 2016.
|
| 289 |
+
|
| 290 |
+
Dustin Tran, Rajesh Ranganath, and David M Blei. Deep and hierarchical implicit models. arXiv preprint arXiv:1702.08896, 2017.
|
| 291 |
+
|
| 292 |
+
Lav R Varshney, Beth L Chen, Eric Paniagua, David H Hall, and Dmitri B Chklovskii. Structural properties of the caenorhabditis elegans neuronal network. PLoS computational biology, 7(2): e1001066, 2011.
|
| 293 |
+
|
| 294 |
+
Cedric Villani. ´ Topics in optimal transportation. Number 58. American Mathematical Soc., 2003.
|
| 295 |
+
|
| 296 |
+
Luke Vilnis, David Belanger, Daniel Sheldon, and Andrew McCallum. Bethe projections for nonlocal inference. arXiv preprint arXiv:1503.01397, 2015.
|
| 297 |
+
|
| 298 |
+
Oriol Vinyals, Samy Bengio, and Manjunath Kudlur. Order matters: Sequence to sequence for sets. arXiv preprint arXiv:1511.06391, 2015.
|
| 299 |
+
|
| 300 |
+
Martin J Wainwright, Michael I Jordan, et al. Graphical models, exponential families, and variational inference. Foundations and Trends
|
| 301 |
+
|
| 302 |
+
Ronald J Williams. Simple statistical gradient-following algorithms for connectionist reinforcement learning. Machine learning, 8(3-4):229–256, 1992.
|
| 303 |
+
|
| 304 |
+
Jonathan S Yedidia, William T Freeman, and Yair Weiss. Bethe free energy, kikuchi approximations, and belief propagation algorithms. Advances in neural information processing systems, 13, 2001.
|
| 305 |
+
|
| 306 |
+
# A PROOF OF THEOREM 1
|
| 307 |
+
|
| 308 |
+
In this section we give a rigorous proof of Theorem 1. Also, in A.2 we briefly comment on how Theorem 1 extend a perhaps more intuitive results, in the probability simplex.
|
| 309 |
+
|
| 310 |
+
Before stating Theorem 1 we need some preliminary definitions. We start by recalling a well-known result in matrix theory, the Sinkhorn theorem.
|
| 311 |
+
|
| 312 |
+
Theorem (Sinkhorn). Let $A$ be an $N$ dimensional square matrix with positive entries. Then, there exists two diagonal matrices $D _ { 1 } , D _ { 2 }$ , with positive diagonals, so that $P = D _ { 1 } A D _ { 2 }$ is a doubly stochastic matrix. These $D _ { 1 } , D _ { 2 }$ are unique up to a scalar factor. Also, $P$ can be obtained through the iterative process of alternatively normalizing the rows and columns of $A$ .
|
| 313 |
+
|
| 314 |
+
Proof. See Sinkhorn (1964); Sinkhorn & Knopp (1967); Knight (2008).
|
| 315 |
+
|
| 316 |
+
For our purposes, it is useful to define the Sinkhorn operator $S ( \cdot )$ as follows:
|
| 317 |
+
|
| 318 |
+
Definition 1. Let $X$ be an arbitrary matrix with dimension $N$ . Denote ${ \mathcal { T } } _ { r } ( X ) ~ = ~ X ~ \oslash$ $( X 1 _ { N } 1 _ { N } ^ { \top } )$ , $\mathcal { T } _ { c } ( X ) = X \oslash ( 1 _ { N } 1 _ { N } ^ { \top } X )$ (with $\oslash$ representing the element-wise division and $1 _ { n }$ the $n$ dimensional vector of ones) the row and column-wise normalization operators, respectively. Then, we define the Sinkhorn operator applied to $X$ ; $S ( X )$ , as follows:
|
| 319 |
+
|
| 320 |
+
$$
|
| 321 |
+
\begin{array} { r c l } { { S ^ { 0 } ( X ) } } & { { = } } & { { \exp ( X ) , } } \\ { { S ^ { l } ( X ) } } & { { = } } & { { { \mathcal T } _ { c } ( { \mathcal T } _ { r } ( S ^ { l - 1 } ( X ) ) ) , } } \\ { { S ( X ) } } & { { = } } & { { \displaystyle \operatorname* { l i m } _ { n \infty } S ^ { l } ( X ) . } } \end{array}
|
| 322 |
+
$$
|
| 323 |
+
|
| 324 |
+
Here, the $\exp ( \cdot )$ operator is interpreted as the component-wise exponential. By Sinkhorn’s theorem, $S ( X )$ is a doubly stochastic matrix.
|
| 325 |
+
|
| 326 |
+
Finally, we review some key properties related to the space of doubly stochastic matrices. First, we need to define a relevant geometric object.
|
| 327 |
+
|
| 328 |
+
Definition 2. We denote by $B _ { N }$ the $N$ -Birkhoff polytope, i.e., the set of doubly stochastic matrices of dimension $N$ . Likewise, we denote $\mathcal { P } _ { n }$ be the set of permutation matrices of size $N$ . Alternatively,
|
| 329 |
+
|
| 330 |
+
$$
|
| 331 |
+
\mathcal { B } _ { N } = \{ P \in [ 0 , 1 ] \in \mathbb { R } ^ { N , N } ~ P 1 _ { N } = 1 _ { N } , P ^ { \top } 1 _ { N } = 1 _ { N } \} ,
|
| 332 |
+
$$
|
| 333 |
+
|
| 334 |
+
$$
|
| 335 |
+
\mathcal { P } _ { N } = \{ P \in \{ 0 , 1 \} \in \mathbb { R } ^ { N , N } ~ P 1 _ { N } = 1 _ { N } , P ^ { \top } 1 _ { N } = 1 _ { N } \} .
|
| 336 |
+
$$
|
| 337 |
+
|
| 338 |
+
Theorem (Birkhoff). $\mathcal { P } _ { N }$ is the set of extremal points of $B _ { N }$ . In other words, the convex hull of $B _ { N }$ equals $\mathcal { P } _ { N }$ .
|
| 339 |
+
|
| 340 |
+
Proof. See Birkhoff (1946).
|
| 341 |
+
|
| 342 |
+
# A.1 AN APPROXIMATION THEOREM FOR THE MATCHING PROBLEM
|
| 343 |
+
|
| 344 |
+
Let’s now focus on the standard combinatorial assignment (or matching) problem, for an arbitrary $N$ dimensional matrix $X$ . We aim to maximize a linear functional (in the sense of the Frobenius norm) in the space of permutation matrices. In this context, let’s define the matching operator $M ( \cdot )$ as the one that returns the solution of the assignment problem:
|
| 345 |
+
|
| 346 |
+
$$
|
| 347 |
+
M ( X ) \equiv \underset { P \in \mathcal { P } _ { N } } { \arg \operatorname* { m a x } } { \langle P , X \rangle } _ { F } .
|
| 348 |
+
$$
|
| 349 |
+
|
| 350 |
+
Likewise, we define $\tilde { M } ( \cdot )$ as a related operator, but changing the feasible space by the Birkhoff polytope:
|
| 351 |
+
|
| 352 |
+
$$
|
| 353 |
+
\tilde { M } ( X ) \equiv \underset { P \in \mathcal { B } _ { N } } { \arg \operatorname* { m a x } } { \langle P , X \rangle } _ { F } .
|
| 354 |
+
$$
|
| 355 |
+
|
| 356 |
+
Notice that in general ${ \tilde { M } } ( X ) , M ( X )$ might not be unique matrices, but a face of the Birkhoff polytope, or a set of permutations, respectively (see Lemma 2 for details). In any case, the relation
|
| 357 |
+
|
| 358 |
+
$M ( X ) \subseteq { \tilde { M } } ( X )$ holds by virtue of Birkhoff’s theorem, and the fundamental theorem of linear programming.
|
| 359 |
+
|
| 360 |
+
Now we state the main theorem of this work:
|
| 361 |
+
|
| 362 |
+
Theorem 1. For a doubly stochastic matrix $P$ define its entropy as $\begin{array} { r } { h ( P ) = - \sum _ { i , j } P _ { i , j } \log { ( P _ { i , j } ) } } \end{array}$ Then, one has,
|
| 363 |
+
|
| 364 |
+
$$
|
| 365 |
+
S ( X / \tau ) = \underset { P \in \mathcal { B } _ { N } } { \arg \operatorname* { m a x } } \langle P , X \rangle _ { F } + \tau h ( P ) .
|
| 366 |
+
$$
|
| 367 |
+
|
| 368 |
+
Now, assume also the entries of $X$ are drawn independently from a distribution that is absolutely continuous with respect to the Lebesgue measure in $\mathcal { R }$ . Then, almost surely the following convergence holds:
|
| 369 |
+
|
| 370 |
+
$$
|
| 371 |
+
M ( X ) = \operatorname* { l i m } _ { \tau 0 ^ { + } } S ( X / \tau ) .
|
| 372 |
+
$$
|
| 373 |
+
|
| 374 |
+
We divide the proof of Theorem 1 in three steps. First, in Lemma 1 we state a relation between $S ( X / \tau )$ and the entropy regularized problem in equation (10). Then, in Lemma 2 we show that under our stochastic regime, uniqueness of solutions holds. Finally, in Lemma 3 we show that in this well-behaved regime, convergence of solutions holds. states that and Lemma 2b endows us with the tools to make a limit argument.
|
| 375 |
+
|
| 376 |
+
A.1.1 INTERMEDIATE RESULTS FOR THEOREM 1
|
| 377 |
+
|
| 378 |
+
Lemma 1.
|
| 379 |
+
|
| 380 |
+
$$
|
| 381 |
+
S ( X / \tau ) = \underset { P \in \mathcal { B } _ { N } } { \arg \operatorname* { m a x } } \langle P , X \rangle _ { F } + \tau h ( P ) .
|
| 382 |
+
$$
|
| 383 |
+
|
| 384 |
+
Proof. We first notice that the solution $P _ { \tau }$ of the above problem exists, and it is unique. This is a simple consequence of the strict concavity of the objective (recall the entropy is strictly concave Rao (1984)).
|
| 385 |
+
|
| 386 |
+
Now, let’s state the Lagrangian of this constrained problem
|
| 387 |
+
|
| 388 |
+
$$
|
| 389 |
+
\mathcal { L } ( \alpha , \beta , P ) = \left. P , X \right. _ { F } + \tau h ( P ) + \alpha ^ { \top } ( P 1 _ { N } - 1 _ { N } ) + \beta ^ { \top } ( P ^ { \top } 1 _ { N } - 1 _ { N } ) ,
|
| 390 |
+
$$
|
| 391 |
+
|
| 392 |
+
It is easy to see, by stating the equality $\partial \mathcal { L } / \partial P = 0$ that one must have for each $i , j$ ,
|
| 393 |
+
|
| 394 |
+
$$
|
| 395 |
+
p _ { \tau } ^ { i , j } = \mathrm { e x p } ( \alpha _ { i } / \tau - 1 / 2 ) \mathrm { e x p } ( X _ { i , j } / \tau ) \mathrm { e x p } ( \beta _ { j } / \tau - 1 / 2 ) ,
|
| 396 |
+
$$
|
| 397 |
+
|
| 398 |
+
in other words, $P _ { \tau } = D _ { 1 } \exp ( X _ { i , j } / \tau ) D _ { 2 }$ for certain diagonal matrices $D _ { 1 } , D _ { 2 }$ , with positive diagonals. By Sinkhorn’s theorem, and our definition of the Sinkhorn operator, we must have that $\bar { S ( \cal X / \tau ) } = \dot { \cal P } _ { \tau }$ . □
|
| 399 |
+
|
| 400 |
+
Lemma 2. Suppose the entries of $X$ are drawn independently from a distribution that is absolutely continuous with respect to the Lebesgue measure in $\mathbb { R }$ . Then, almost surely, ${ \tilde { M } } ( X ) = M ( X )$ is $a$ unique permutation matrix.
|
| 401 |
+
|
| 402 |
+
Proof. This is a known result from sensibility analysis on linear programming which we prove for completeness. Notice first that the problem in (2) is a linear program on a polytope. As such, by the fundamental theorem of linear program, the optimal solution set must correspond to a face of the polytope. Let $\mathcal { F }$ be a face of $\boldsymbol { B } _ { N }$ of dimension $\geq 1$ , and take $P _ { 1 } , P _ { 2 } \in { \mathcal { F } }$ , $P _ { 1 } \neq P _ { 2 }$ . If $\mathcal { F }$ is an optimal face for a certain $X _ { \mathcal { F } }$ , then $X _ { \mathcal { F } } \in \{ X \ : \ \langle P _ { 1 } , X \rangle _ { F } = \langle P _ { 2 } , X \rangle _ { F } \}$ . Nonetheless, the latter set does not have full dimension, and consequently has measure zero, given our distributional assumption on $X$ . Repeating the argument for every face of dimension $\geq 1$ and taking a union bound we conclude that, almost surely, the optimal solution lies on a face of dimension 0, i.e, a vertex. From here uniqueness follows. □
|
| 403 |
+
|
| 404 |
+
Lemma 3. Call $P _ { \tau }$ the solution to the problem in equation $I O$ , i.e. $P _ { \tau } = P _ { \tau } ( X ) = S ( X / \tau )$ . Under the assumptions of Lemma 2, $P _ { \tau } \to P _ { 0 }$ when if $\tau \to 0 ^ { + }$ .
|
| 405 |
+
|
| 406 |
+
Proof. Proof Notice that by Lemmas 1 and 2, $P _ { \tau }$ is well defined and unique for each $\tau \geq 0$ . Moreover, at $\tau = 0$ , $P _ { 0 } = M ( X )$ is the unique solution of a linear program. Now, let’s define $f _ { \tau } ( \cdot ) = \langle \cdot , X \rangle _ { F } + \tau h ( \cdot )$ . We observe that $f _ { 0 } ( \bar { P _ { \tau } } ) \to f _ { 0 } ( P _ { 0 } )$ . Indeed, one has:
|
| 407 |
+
|
| 408 |
+
$$
|
| 409 |
+
\begin{array} { l l l } { f _ { 0 } ( P _ { 0 } ) - f _ { 0 } ( P _ { \tau } ) } & { = } & { \langle P _ { 0 } , X \rangle _ { F } - \langle P _ { \tau } , X \rangle _ { F } } \\ & { = } & { \langle P _ { 0 } , X \rangle _ { F } - f _ { \tau } ( P _ { \tau } ) + \tau h ( P _ { \tau } ) } \\ & { < } & { \langle P _ { 0 } , X \rangle _ { F } - f _ { \tau } ( P _ { 0 } ) + \tau h ( P _ { \tau } ) } \\ & { < } & { \tau \left( h ( P _ { \tau } ) - h ( P _ { 0 } ) \right) } \\ & { < } & { \tau \displaystyle \operatorname* { m a x } _ { P \in \mathcal { B } _ { N } } h ( P ) . } \end{array}
|
| 410 |
+
$$
|
| 411 |
+
|
| 412 |
+
From which convergence follows trivially. Moreover, in this case convergence of the values implies the converge of $P _ { \tau }$ : suppose $P _ { \tau }$ does not converge to $P _ { 0 }$ . Then, there would exist a certain $\delta$ and sequence $\tau _ { n } 0$ such that $\| P _ { \tau _ { n } } - P _ { 0 } \| > \delta$ . On the other hand, since $P _ { 0 }$ is the unique maximizer of an LP, there exists $\varepsilon > 0$ such that $f _ { 0 } ( P _ { 0 } ) - f _ { 0 } ( P ) > \varepsilon$ whenever $\| P - P _ { 0 } \| > \delta$ , $P \in B _ { N }$ . This contradicts the convergence of $f _ { 0 } ( P _ { \tau _ { n } } )$ . □
|
| 413 |
+
|
| 414 |
+
# A.1.2 PROOF OF THEOREM 1
|
| 415 |
+
|
| 416 |
+
The first statement is Lemma 1. Convergence (equation 11) is a direct consequence of Lemma 3, after noticing $P _ { \tau } = S ( X / \tau )$ and $P _ { 0 } = M ( X )$ . We note that an alternative approach for the limiting argument is presented in Cominetti & San Mart´ın (1994).
|
| 417 |
+
|
| 418 |
+
# A.2 RELATION TO SOFTMAX
|
| 419 |
+
|
| 420 |
+
Finally, we notice that all of the above results can be understood as a generalization of the wellknown approximation result arg $\begin{array} { r } { \operatorname* { m a x } _ { i } x _ { i } = \operatorname* { l i m } _ { \tau \to 0 ^ { + } } s o f t m a x ( x / \tau ) } \end{array}$ . To see this, treat a category as a one-hot vector. Then, one has
|
| 421 |
+
|
| 422 |
+
$$
|
| 423 |
+
\arg \operatorname* { m a x } _ { i } x _ { i } = \underset { e \in S _ { N } } { \arg \operatorname* { m a x } } \langle e , x \rangle ,
|
| 424 |
+
$$
|
| 425 |
+
|
| 426 |
+
where $S _ { n }$ is the probability simplex, the convex hull of the one-hot vectors (denoted ${ \mathcal { H } } _ { n }$ ). Again, by the fundamental theorem of linear algebra, the following holds:
|
| 427 |
+
|
| 428 |
+
$$
|
| 429 |
+
\arg \operatorname* { m a x } _ { i } x _ { i } = \underset { e \in \mathcal { H } _ { N } } { \arg \operatorname* { m a x } } \langle e , x \rangle .
|
| 430 |
+
$$
|
| 431 |
+
|
| 432 |
+
On the other hand, by a similar (but simpler) argument than of the proof of theorem 4 one can easily show that
|
| 433 |
+
|
| 434 |
+
$$
|
| 435 |
+
s o f t m a x ( x / \tau ) \equiv \frac { \exp ( x / \tau ) } { \sum _ { i = 1 } \exp ( x _ { i } / \tau ) } = \arg \operatorname* { m a x } _ { e \in S _ { n } } \langle e , x \rangle + \tau h ( e ) ,
|
| 436 |
+
$$
|
| 437 |
+
|
| 438 |
+
where the entropy $h ( \cdot )$ is not defined as $\begin{array} { r } { h ( e ) = - \sum _ { i = 1 } ^ { n } e _ { i } \log ( e _ { i } ) } \end{array}$
|
| 439 |
+
|
| 440 |
+
# A.3 ILLUSTRATING THEOREM 1
|
| 441 |
+
|
| 442 |
+

|
| 443 |
+
Figure 3: Illustrating the Matching and Sinkhorn operators, and the Gumbel-Matching and GumbelSinkhorn distributions. Each 5x5 grid represents a matrix, with the shading indicating cell values (a) Matching operator $M ( X )$ applied to a parameter matrix $X$ . (b) Sinkhorn Operator $S ( X / \tau )$ approximating $M ( X )$ for different temperature $\tau$ and number of Sinkhorn iterations, $L$ . (c). First row: samples from the Matching Sinkhorn distribution. Second and third rows: samples from the Gumbel-Sinkhorn distribution at two temperatures. At low temperature, both distributions are indistinguishable.
|
| 444 |
+
|
| 445 |
+
# B SUPPLEMENTAL METHODS
|
| 446 |
+
|
| 447 |
+
# B.1 EXPERIMENTAL PROTOCOLS
|
| 448 |
+
|
| 449 |
+
All experiments were run on a cluster using Tensorflow Abadi et al. (2016), using several GPU (Tesla K20, K40, K80 and P100) in parallel to enable an efficient exploration of the hyperparameter space: temperature, learning rate, and neural network parameters (dimensions).
|
| 450 |
+
|
| 451 |
+
In all cases, we used $L = 2 0$ Sinkhorn Operator Iterations, and a $1 0 \mathrm { x } 1 0$ batch size: for each sample in the batch we used Gumbel perturbations to generate 10 different reconstructions.
|
| 452 |
+
|
| 453 |
+
For evaluation, we used the Hungarian Algorithm Munkres (1957) to compute $M ( X )$ required to infer the predicted matching.
|
| 454 |
+
|
| 455 |
+
Finally, experiments of section 5.4 were done consistent with model specifications stated in Linderman et al. (2017)
|
| 456 |
+
|
| 457 |
+
# B.2 NUMBER OF PARAMETERS ON SINKHORN NETWORKS
|
| 458 |
+
|
| 459 |
+
In the simplest network, the one that sorts number, the number of parameters is given by $n _ { u } + N \times n _ { u }$ : Indeed, each number is connected with the hidden layer with $n _ { u }$ (here, 32) units. This layer connects with another layer with $N$ units, representing a row of $g ( { \tilde { X } } , \theta )$ .
|
| 460 |
+
|
| 461 |
+
For images, the first layer is a convolution, composed by $n _ { f }$ convolutional filters of receptive field size $K _ { s }$ with $n _ { c }$ channels (one or three) followed by a ReLU $^ +$ max-pooling (with stride $s$ ) operations. Then, the number of parameters in the first layer is given by $\bar { K _ { s } ^ { 2 } } \times n _ { c } \bar { \times } n _ { f } + n _ { f }$ . The second layers connects the output of a convolution, i.e., the stacked convolved $l \times l$ images by each of the filters (after max-pooling) and $p ^ { 2 }$ units, where $p$ is the number of pieces each side was divided by. Therefore, the number of parameters is given by $l ^ { 2 } / ( p ^ { 2 } s ^ { 2 } ) \times n _ { f } \times \dot { p } ^ { 2 } = l ^ { 2 } / s ^ { 2 } \times n _ { f }$ , up to rounding and padding subtleties. Then, the total number of parameters is $l ^ { 2 } / s ^ { 2 } \times n _ { f } + K _ { s } ^ { 2 } \times n _ { c } \times n _ { f } + n _ { f }$ . For the $3 \mathrm { x } 3$ puzzle on Imagenet, $l = 2 5 6 , p = 3 , n _ { c } = 3$ and the optimal network was such that $n _ { f } = 6 4 , s = 2 , K _ { s } = 5$ . Then, it had 1,053,440 parameters.
|
| 462 |
+
|
| 463 |
+
Finally, for arbitrary assembly experiments, as one includes additional fully connected second layers, the total number of parameters is $n _ { l } \times l ^ { 2 } / s ^ { 2 } \times n _ { f } + K _ { s } ^ { 2 } \times n _ { c } \times n _ { f } + \bar { n _ { f } }$ , where $n _ { l }$ is the number of labels (here, $n _ { l } = 1 0 $ ).
|
| 464 |
+
|
| 465 |
+
# B.3 INFERENCE WITH THE IMPLICIT GUMBEL-SINKHORN DISTRIBUTION
|
| 466 |
+
|
| 467 |
+
Here we show how to compute $K L ( ( X + \varepsilon ) / \tau \parallel \varepsilon / \tau _ { p r i o r } )$ , as defined in 4.1. We first notice that the density of the variable $h = ( a + g ) / b$ , where $g$ has a Gumbel distribution and $a , b$ are constants is given by:
|
| 468 |
+
|
| 469 |
+
$$
|
| 470 |
+
\log p _ { h } ( z ) = \log b - \left( b z - a + \exp \left( a - b z \right) \right) .
|
| 471 |
+
$$
|
| 472 |
+
|
| 473 |
+
Therefore, the log density ratio $L R ( z )$ between each component of $h _ { 1 } = ( x _ { i , j } + \varepsilon _ { i , j } ) / \tau$ and $h _ { 2 } =$ $\varepsilon _ { i , j } / \tau _ { p r i o r }$ is (suppressing indexing for simplicity)
|
| 474 |
+
|
| 475 |
+
$$
|
| 476 |
+
\begin{array} { r l } & { L R ( z ) = \log p _ { h _ { 1 } } ( z ) / \log p _ { h _ { 2 } } ( z ) } \\ & { \qquad = \log \tau - ( \tau z - x + \exp { ( x - z \tau ) } ) - \log \tau _ { p r i o r } + ( \tau _ { p r i o r } z + \exp { ( - z \tau _ { p r i o r } ) } ) . } \end{array}
|
| 477 |
+
$$
|
| 478 |
+
|
| 479 |
+
We need to take expectations with respect to the distribution of $h _ { 1 }$ . To compute this expectation, we first express the above ratio in terms of $\varepsilon$
|
| 480 |
+
|
| 481 |
+
$$
|
| 482 |
+
L R ( \varepsilon ) = \log ( \tau / \tau _ { p r i o r } ) - ( \varepsilon + \exp \left( - \varepsilon \right) - ( \varepsilon + x ) \tau _ { p r i o r } / \tau - \exp \left( - ( \varepsilon + x ) \tau _ { p r i o r } / \tau \right) ) )
|
| 483 |
+
$$
|
| 484 |
+
|
| 485 |
+
Now we appeal to the law of the unconscious statistician, and take the expectation with respect to $\varepsilon$ . Using the identities
|
| 486 |
+
|
| 487 |
+
• $E ( \varepsilon ) = \gamma \approx 0 . 5 7 7 2$ (the Euler-Mascheroni constant)
|
| 488 |
+
• Moment generating function $E ( \exp ( t \varepsilon ) ) = \Gamma ( 1 - t )$ ; implying $E ( \exp ( - \varepsilon ) ) = 1$ and $E ( \exp \left( - \tau _ { p r i o r } / \tau \varepsilon \right) ) = \Gamma ( 1 + \tau _ { p r i o r } / \tau ) )$
|
| 489 |
+
|
| 490 |
+
we have:
|
| 491 |
+
|
| 492 |
+
$$
|
| 493 |
+
\begin{array} { r l } & { \Xi _ { h _ { 1 } } \left( L R ( z ) \right) = E _ { \varepsilon } \left( L R ( \varepsilon ) \right) } \\ & { \qquad = \log ( \tau / \tau _ { p r i o r } ) - \left( \gamma ( 1 - \tau _ { p r i o r } / \tau ) + 1 - x \tau _ { p r i o r } / \tau - \exp \left( - x \tau _ { p r i o r } / \tau \right) \Gamma ( 1 + \tau _ { p r i o r } / \tau ) \right) } \end{array}
|
| 494 |
+
$$
|
| 495 |
+
|
| 496 |
+
From this, it easily follows (adding all the $N ^ { 2 }$ components) that
|
| 497 |
+
|
| 498 |
+
$$
|
| 499 |
+
\begin{array} { l } { { \displaystyle { \ddot { \times } L ( ( X + \varepsilon ) / \tau \parallel \varepsilon / \tau _ { p r i o r } ) = \sum _ { i , j } E _ { g _ { 1 } } \left( L R ( z _ { i , j } ) \right) } } \ ~ } \\ { { \displaystyle ~ = N ^ { 2 } \left( \log ( \tau / \tau _ { p r i o r } ) - 1 + \gamma ( \tau _ { p r i o r } / \tau - 1 ) \right) + S _ { 1 } + \Gamma ( 1 + \tau _ { p r i o r } / \tau ) S _ { 2 } } . } \end{array}
|
| 500 |
+
$$
|
| 501 |
+
|
| 502 |
+
where $S _ { 1 } = \tau _ { p r i o r } / \tau \sum _ { i , j } x _ { i , j }$ and $\begin{array} { r } { S _ { 2 } = \sum _ { i , j } \exp \left( - x _ { i , j } { \tau _ { p r i o r } } / \tau \right) } \end{array}$ .
|
| 503 |
+
|
| 504 |
+
# C SUPPLEMENTAL RESULTS
|
| 505 |
+
|
| 506 |
+
# C.1 PUZZLES
|
| 507 |
+
|
| 508 |
+
In table 4 we provide further performance measures for the Jigsaw puzzle task on Celeba, for extreme hyper-parameter values: small temperature, large temperature, and a single Sinkhorn iteration These are worse than the ones in table 2, although surprisingly, one Sinkhorn iteration already provides reasonable performance, as long temperature is chosen in an appropriate range.
|
| 509 |
+
|
| 510 |
+
# C.2 TRANSFORMATIONS INTO ARBITRARY DIGITS
|
| 511 |
+
|
| 512 |
+
In table 5 we show performance of a 2-layer CNN in detecting transformed digits as the ones they are intended to be. From this we see the most troublesome transformation was to one, as this network most of the times categorized it as a different number. Also, in figure 4 we show transformations, showing that to reconstruct to arbitrary digits it is not required that the original ones have an actual digit-like structure, but they can be only pieces of ‘strokes’ or ‘dust’.
|
| 513 |
+
|
| 514 |
+
Table 4: Jigsaw puzzle results for different extreme hyper-parameter values
|
| 515 |
+
|
| 516 |
+
<table><tr><td></td><td colspan="4">T = 0.01</td><td colspan="4">T=100</td><td colspan="4">L=1</td></tr><tr><td></td><td>2x2</td><td>3x3</td><td>4x4</td><td>5x5</td><td>2x2</td><td>3x3</td><td>4x4</td><td>5x5</td><td>.2x2</td><td>3x3</td><td>4x4</td><td>5x5</td></tr><tr><td>Prop. wrong</td><td>.06</td><td>.08</td><td>.23</td><td>.36</td><td>.03</td><td>.1</td><td>.28</td><td>.5</td><td>.0</td><td>.03</td><td>.13</td><td>.28</td></tr><tr><td>Prop. any wrong</td><td>.1</td><td>.22</td><td>.36</td><td>.9</td><td>.04</td><td>.23</td><td>.67</td><td>.97</td><td>.0</td><td>.08</td><td>.42</td><td>.82</td></tr><tr><td>Kendall tau</td><td>.9</td><td>.89</td><td>.74</td><td>.62</td><td>.97</td><td>.88</td><td>.7</td><td>.47</td><td>1.0</td><td>.96</td><td>.86</td><td>.72</td></tr><tr><td>11</td><td>.03</td><td>.04</td><td>.1</td><td>.14</td><td>.01</td><td>.04</td><td>.11</td><td>.19</td><td>.0</td><td>.01</td><td>.05</td><td>.11</td></tr><tr><td>12</td><td>.16</td><td>.18</td><td>.28</td><td>.34</td><td>.11</td><td>.19</td><td>.3</td><td>.38</td><td>.0</td><td>.11</td><td>.21</td><td>.3</td></tr></table>
|
| 517 |
+
|
| 518 |
+
Becomes
|
| 519 |
+
Table 5: Accuracies of two-layer convolutional neural network in identifying transformed digits
|
| 520 |
+
|
| 521 |
+
<table><tr><td></td><td>0</td><td></td><td>1</td><td>2</td><td>3</td><td>4</td><td>5</td><td>6</td><td>7</td><td>8</td><td>9</td></tr><tr><td></td><td>0</td><td></td><td>.0</td><td>1.</td><td>1.</td><td>1.</td><td>1.</td><td>1.</td><td>1.</td><td>1.</td><td>1.</td></tr><tr><td></td><td>1</td><td></td><td></td><td>.97</td><td>.99</td><td>.99</td><td>1.</td><td>1.</td><td>.56</td><td>.75</td><td>.2</td></tr><tr><td></td><td>23456</td><td></td><td></td><td></td><td></td><td></td><td></td><td>1</td><td>.70</td><td></td><td>1.</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>11111</td><td></td><td>.96</td></tr><tr><td></td><td></td><td></td><td>10.0.46</td><td></td><td></td><td></td><td></td><td></td><td></td><td>1168</td><td>.36</td></tr><tr><td>Hrp1eaat</td><td></td><td>914.113</td><td>品</td><td></td><td></td><td>111611L</td><td>II1LL</td><td>6116</td><td></td><td>.16.11L</td><td>1.</td></tr><tr><td></td><td></td><td></td><td></td><td>911111211</td><td>1111146</td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>7</td><td></td><td></td><td>.73</td><td></td><td></td><td></td><td>1.</td><td>11</td><td></td><td></td><td></td></tr><tr><td>8</td><td>.0 1.</td><td></td><td>.07</td><td></td><td>1.</td><td></td><td>1.</td><td></td><td>.07</td><td></td><td>11216</td></tr><tr><td>9</td><td>1.</td><td></td><td>.33</td><td></td><td>1.</td><td>1.</td><td>1.</td><td>1.</td><td>1.</td><td></td><td></td></tr></table>
|
| 522 |
+
|
| 523 |
+
# C.3 RESULTS ON CATEGORIAL VAE IN MNIST
|
| 524 |
+
|
| 525 |
+
In general, for arbitrary random variables $Z _ { 1 } , Z _ { 2 }$ and a function $g$ , one has
|
| 526 |
+
|
| 527 |
+
$$
|
| 528 |
+
K L ( Z _ { 1 } \parallel Z _ { 2 } ) \geq K L ( g ( Z _ { 1 } ) \parallel g ( Z _ { 2 } ) ) .
|
| 529 |
+
$$
|
| 530 |
+
|
| 531 |
+
We prove this in the discrete case, for simplicity: call $q ( z )$ and $p ( z )$ the densities of $Z _ { 1 } , Z _ { 2 }$ , and call $y = g ( z )$ . This induces two joint distributions, $p ( z , y )$ and $q ( z , y )$ . Now, define
|
| 532 |
+
|
| 533 |
+
$$
|
| 534 |
+
K L ( q ( z | y ) \parallel p ( z | y ) ) = \sum _ { y , z } ( q ( z , y ) \log q ( z | y ) - \log p ( z | y ) ) .
|
| 535 |
+
$$
|
| 536 |
+
|
| 537 |
+
Under this definition, one can verify that
|
| 538 |
+
|
| 539 |
+
$$
|
| 540 |
+
\begin{array} { r } { K L ( q ( \boldsymbol { z } , \boldsymbol { y } ) \parallel p ( \boldsymbol { z } , \boldsymbol { y } ) ) = K L ( q ( \boldsymbol { z } ) \parallel p ( \boldsymbol { z } ) ) + K L ( q ( \boldsymbol { y } | \boldsymbol { z } ) \parallel p ( \boldsymbol { y } | \boldsymbol { z } ) ) } \\ { = K L ( q ( \boldsymbol { y } ) \parallel p ( \boldsymbol { y } ) ) + K L ( q ( \boldsymbol { z } | \boldsymbol { y } ) \parallel p ( \boldsymbol { z } | \boldsymbol { y } ) ) . } \end{array}
|
| 541 |
+
$$
|
| 542 |
+
|
| 543 |
+
But $K L ( ( q ( y | z ) \quad \parallel \quad p ( y | z ) ) = 0 .$ , as $y$ is a deterministic function of $z$ . Therefore, $K L ( ( q ( z ) \parallel p ( z ) ) = K L ( q ( y ) \parallel p ( y ) ) + K L ( q ( z | y ) \parallel p ( z | y ) )$ , and since the second term is positive (a KL divergence) we conclude $K L ( q ( z ) \parallel p ( z ) ) \geq K L ( q ( y ) \parallel p ( y ) )$ .
|
| 544 |
+
|
| 545 |
+
This implies a lower (or less tight) ELBO if using $Z _ { 1 } , Z _ { 2 }$ instead of $g ( Z _ { 1 } ) , g ( Z _ { 2 } )$ . However, we note that in the categorical case this has a minimal impact in performance. Indeed, we replicated the density estimation on MNIST task described in Jang et al. (2016); Maddison et al. (2016), and as alternative method we considered the concrete distribution, but using as stochastic node $( \varepsilon + x ) / \tau$ (with prior $\varepsilon / \tau _ { p r i o r }$ instead of two concrete distributions. In other words, for us $g ( x ) = \mathrm { s o f t m a x } _ { \tau } ( x )$ and $Z _ { 1 } \stackrel { . } { = } ( \varepsilon + x ) / \tau , Z _ { 2 } = ( \varepsilon ) / \tau _ { p r i o r }$ (in law). Results are shown in Table 6. We first see that Concrete distribution does worse than Gumbel-Softmax, which we attribute to a sub-optimal parameter search. However, we see that working in the Gumbel space has little impact on $\log p ( x )$ : the difference was smaller than .5 nats.
|
| 546 |
+
|
| 547 |
+

|
| 548 |
+
Figure 4: First column: samples from dataset created by mixing all pieces of digits, and then reassembling them into ‘digits’. Second column: random permutations of first column. Third column: hard reconstructions using $M ( X )$ . Fourth column: soft reconstructions using $S ( X / \tau )$ and $\tau = 1$ . Metaphorically, one is able to reconstruct pieces out of ‘dust’.
|
| 549 |
+
|
| 550 |
+
Table 6: Summary of results in VAE
|
| 551 |
+
|
| 552 |
+
<table><tr><td>Method</td><td>-log p(x)</td></tr><tr><td>Gumbel-Softmax</td><td>106.7</td></tr><tr><td>Concrete</td><td>111.5</td></tr><tr><td>Concrete (Gumbel space)</td><td>111.9</td></tr></table>
|
| 553 |
+
|
| 554 |
+
Table 7: Accuracy in the C.elegans neural identification problem, for varying mean number of candidate neurons (10, 30, 45, 60) and number of worms (1 and 4).
|
| 555 |
+
|
| 556 |
+
<table><tr><td rowspan="2">Mean number of candidates Difficulty</td><td colspan="2">10</td><td colspan="2">30</td><td colspan="2">45</td><td colspan="2">60</td></tr><tr><td>1 worm</td><td>4 worms</td><td>1 Worm</td><td>4 worms</td><td>1 worm</td><td> 4 worms</td><td>1 worms</td><td>4 worms</td></tr><tr><td>MCMC</td><td>.34</td><td>.65</td><td>.18</td><td>.28</td><td>.14</td><td>.17</td><td>.13</td><td>.16</td></tr><tr><td>(Linderman et al., 2017)</td><td>.77</td><td>.93</td><td>.33</td><td>.7</td><td>.18</td><td>.48</td><td>.17</td><td>.37</td></tr><tr><td>Gumbel-Sinkhorn</td><td>.79</td><td>.94</td><td>.4</td><td>.69</td><td>.25</td><td>.51</td><td>.21</td><td>.44</td></tr><tr><td>Gumbel-Sinkhorn (no regularization)</td><td>0.77</td><td>.92</td><td>.4</td><td>.64</td><td>.25</td><td>.44</td><td>.21</td><td>.39</td></tr></table>
|
| 557 |
+
|
| 558 |
+
# C.4 SUPPLEMENTARY RESULTS ON C.ELEGANS
|
| 559 |
+
|
| 560 |
+
Finally, in Table 7 we show additional results for the C.elegans experiment. The setting is the same as in Figure 4(a) in Linderman et al. (2017). Likewise, Table 3 correspond to the setting of Figure 4(b) in Linderman et al. (2017).
|
| 561 |
+
|
| 562 |
+
# D SUPPLEMENTARY DISCUSSION
|
| 563 |
+
|
| 564 |
+
# D.1 SINKHORN OPERATOR FOR APPROXIMATE MARGINAL INFERENCE
|
| 565 |
+
|
| 566 |
+
A second connection between the distribution in (6) (and therefore, the Matching Gumbel distribution) and the Sinkhorn operator arises as a consequence of Theorem 1. This relates to the estimation of the marginals $E _ { \theta } ( P _ { i , j } )$ , known to be a $\# \mathrm { P }$ hard problem. A well known result (Globerson & Jaakkola, 2007; Wainwright et al., 2008), consequence of Fenchel (conjugate) duality (Rockafellar, 1970) applied to exponential families, links this problem to optimization in the following way: lets denote by $\mathcal { M }$ the marginal polytope, the convex hull of the set of realizable sufficient statistics, that here coincides with $B _ { n }$ . Also, lets call $\mathcal { H } ( \mu )$ the entropy of (6) for the parameter $\theta ( \mu )$ such that
|
| 567 |
+
|
| 568 |
+
$\mu = E _ { \theta ( \mu ) } ( P )$ . Then,
|
| 569 |
+
|
| 570 |
+
$$
|
| 571 |
+
E _ { \theta } ( P ) = \arg \operatorname* { m a x } _ { \mu \in \mathcal { M } } \langle \theta , \mu \rangle _ { F } + \mathcal { H } ( \mu ) .
|
| 572 |
+
$$
|
| 573 |
+
|
| 574 |
+
Notice the only difference between the optimization problems in (17) and (10) is the entropy term, after identifying $X$ with $\theta$ . Therefore, one may understand the Sinkhorn operator as providing approximations for the partition function and the marginals, which will be accurate insofar as $h ( \mu )$ is a good approximation for $\mathcal { H } ( \mu )$ . In this way, one can understand $S ( X )$ as an approximation for $E _ { \theta } ( P )$ , that may complement more classical ones, as the Bethe and Kituchani’s approximations for $\mathcal { H } ( \mu )$ , and the corresponding approximate inference algorithms that they give rise to (Yedidia et al., 2001; Vilnis et al., 2015).
|
| 575 |
+
|
| 576 |
+
# D.2 SUMMARY OF EXTENSIONS
|
| 577 |
+
|
| 578 |
+
Table 8: Analogies between permutation and categories
|
| 579 |
+
|
| 580 |
+
<table><tr><td colspan="2">Categories</td><td>Permutations</td></tr><tr><td colspan="3"></td></tr><tr><td>Polytope</td><td>Probability simplex S</td><td>Birkhoff polytope BN</td></tr><tr><td>Linear program</td><td>arg max xi = arg maxsεs(x,s)</td><td>M(X)= arg maxpeB (P,X) F</td></tr><tr><td>Approximation</td><td>arg maxi xi = limr→0+ softmax(x/τ)</td><td>M(X)= limr→0+ S(X/τ)</td></tr><tr><td>Entropy</td><td>h(s)=∑-silog Si</td><td>h(P)=∑i,j-Pi,j log(Pi,j)</td></tr><tr><td>Entropy regularized linear program</td><td></td><td>softmax(x/T)= arg maxs∈s(x,s)+ Th(s) S(X/τ) = arg maxp∈B(P,X)F + Th(P)</td></tr><tr><td>Reparameterization</td><td>Gumbel-max trick argmaxi(xi+∈i)</td><td>Gumbel-Matching 9M(X) M(X+ ε)</td></tr><tr><td>Continuous approximation</td><td>Concrete softmax((x +∈)/τ)</td><td>Gumbel-Sinkhorn GS(X, T) S((X+∈)/τ)</td></tr></table>
|
md/train/DKabt9MFnT/DKabt9MFnT.md
ADDED
|
@@ -0,0 +1,477 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# How Gradient Descent Separates Data with Neural Collapse: A Layer-Peeled Perspective
|
| 2 |
+
|
| 3 |
+
Anonymous Author(s)
|
| 4 |
+
Affiliation
|
| 5 |
+
Address
|
| 6 |
+
email
|
| 7 |
+
|
| 8 |
+
# Abstract
|
| 9 |
+
|
| 10 |
+
1 In this paper, we study the inductive bias of the neural features and parameters
|
| 11 |
+
2 from neural networks with cross-entropy loss. We study a surrogate model named
|
| 12 |
+
3 unconstrained layer peeled model (ULPM), which helps us to illustrate that the
|
| 13 |
+
4 features and classifiers in the last layer of the neural network will converge to
|
| 14 |
+
5 a certain neural collapse structure [28], where the cross-example within-class
|
| 15 |
+
6 variability of the last-layer features collapse to zero and the class-means converge
|
| 16 |
+
7 to a Simplex Equiangular Tight Frame (ETF). We illustrate that the ULPM with
|
| 17 |
+
8 cross-entropy loss enjoys a benign global landscape on this model where all the
|
| 18 |
+
9 critical points are strict saddle points except the only global minimizers which
|
| 19 |
+
10 exhibit neural collapse phenomenon. Empirically we show that our results also
|
| 20 |
+
11 hold during the training of neural networks in real world tasks when explicit
|
| 21 |
+
12 regularization or weight decay is not included.
|
| 22 |
+
|
| 23 |
+
# 13 1 Introduction
|
| 24 |
+
|
| 25 |
+
14 Deep learning has achieved state-of-the-art per
|
| 26 |
+
15 formances in various applications [20], from
|
| 27 |
+
16 computer vision [16], to natural language
|
| 28 |
+
17 processing[6] and even scientific discovery [23,
|
| 29 |
+
18 41]. Despite the empirical successes achieved,
|
| 30 |
+
19 how gradient descent or its variants leads deep
|
| 31 |
+
20 neural networks to be biased towards solutions
|
| 32 |
+
21 with good generalization performance on the
|
| 33 |
+
22 test set is still a major open question. To de
|
| 34 |
+
23 velop a theoretical foundation for deep learn
|
| 35 |
+
24 ing, many works have studied the implicit
|
| 36 |
+
25 bias of gradient descent in different settings
|
| 37 |
+
26 [21, 1, 37, 33, 25, 3].
|
| 38 |
+
27 It is well-acknowledged that well-trained end
|
| 39 |
+
28 to-end deep architectures have the ability to ef
|
| 40 |
+
29 fectively extract features relevant to the given label. Although theoretical analysis of deep learning
|
| 41 |
+
30 has several achievements in recent years [2, 13], most of the works that aim to analyze properties
|
| 42 |
+
31 of the final output function fail to understand the feature learned. Recently in [28], authors observe
|
| 43 |
+
32 that the within-class cross-sample features will collapse to the mean and the mean will converge
|
| 44 |
+
33 to an Equiangular Tight Frame (ETF) during the terminal phase of training, i.e. after achieving
|
| 45 |
+
34 zero training error and interpolating the in-sample training data. Such phenomenon, namely Neural
|
| 46 |
+
35 Collapse (NC) [28], provides a clear view of how the last layer features in the neural network involve
|
| 47 |
+
36 after interpolation and enables us to understand the benefit of training after achieving zero training
|
| 48 |
+
37 error to achieve better properties in generalization and robustness. To theoretically analyze the neuron
|
| 49 |
+
38 collapse phenomenon, [9, 24, 39] propose the Layer-Peeled Model (LPM) as a simplification for
|
| 50 |
+
39 neural networks, where the last-layer features are modeled as free optimization variables. In particular,
|
| 51 |
+
40 in a $K$ -class classification problem using a neural network with $d$ neurons in the last hidden layer, a
|
| 52 |
+
41 corresponding class of LPMs can be defined through the form
|
| 53 |
+
|
| 54 |
+

|
| 55 |
+
Figure 1: Illustration of Neural Collapse [28].
|
| 56 |
+
|
| 57 |
+
$$
|
| 58 |
+
\begin{array} { r l } & { \displaystyle \operatorname* { m i n } _ { W , H } \frac { 1 } { N } \sum _ { i = 1 } ^ { N } \mathcal { L } \left( W h _ { i } , y _ { i } \right) } \\ & { \displaystyle \quad \mathrm { s . t . } \ \frac { 1 } { 2 } | | W | | _ { F } ^ { 2 } \leq C _ { 1 } , \frac { 1 } { 2 } | | H | | _ { F } ^ { 2 } \leq C _ { 2 } } \end{array}
|
| 59 |
+
$$
|
| 60 |
+
|
| 61 |
+
42 for some positive constant $C _ { 1 } , C _ { 2 }$ . Here $\ b { W } = [ \ b { w } _ { 1 } , \ b { w } _ { 2 } , \ b { \cdot } \ b { \cdot } \ b { \cdot } \ , \ b { w } _ { K } ] ^ { \top } \in \mathbb { R } ^ { K \times d }$ is the weight of the
|
| 62 |
+
43 final linear classifier, $\pmb { H } = [ h _ { 1 } , h _ { 2 } , \cdot \cdot \cdot , h _ { N } ] \in \mathbb { R } ^ { d \times N }$ is the feature of the last layer and $y _ { i }$ is the
|
| 63 |
+
44 corresponding label. The intuition behind LPM is that the modern deep networks are often highly
|
| 64 |
+
45 over-parameterized, with the capacity to learn any representations of the input data. It has been shown
|
| 65 |
+
46 that equiangular tight frame (ETF), i.e. feature with neural collapse, is the only global optimum
|
| 66 |
+
47 of the LPM objective (1) [9, 24, 39]. However, even for this simplified model, the non-convexity
|
| 67 |
+
48 nature of it makes the analysis highly non-trivial. In this paper we aim to understand how gradient
|
| 68 |
+
49 descent separates data with neural collapse. To do this, we build a connection between the neural
|
| 69 |
+
50 collapse with the recently proposed normalized margin [25, 38]. In [25], the authors shows that, using
|
| 70 |
+
51 gradient descent, the direction of the weight converges to the direction that maximizes the $\ell _ { 2 }$ -margin
|
| 71 |
+
52 of the data while the norm of the weight diverges to $+ \infty$ in homogeneous neural networks. Based on
|
| 72 |
+
53 these results, we introduce neural collapse margin and use it provide a convergence result to the first
|
| 73 |
+
54 order stationary point of the minimum-norm separation problem. Furthermore, we illustrate that the
|
| 74 |
+
55 cross-entropy loss enjoys a benign global landscape where all the critical points are strict saddles
|
| 75 |
+
56 in the tangent space except the only global minimizers which exhibit neural collapse phenomenon.
|
| 76 |
+
57 The analysis provides insights on how gradient descent separates data during the training of neural
|
| 77 |
+
58 networks with neural collapse and the benefit of training after interpolation on generalization and
|
| 78 |
+
robustness. We verify our insights via empirical experiments.
|
| 79 |
+
5960 Besides, [26] and a concurrent paper [43] also provide landscape and optimization analysis to study
|
| 80 |
+
61 neural collapse phenomenon, we summarize the connection and difference with our paper in Table 1.
|
| 81 |
+
62 Our result doesn’t introduce any extra feature norm constraint or feature norm regularization, which
|
| 82 |
+
63 are not commonly used in the realistic deep learning. We put the detailed discussion in Section 5.2.
|
| 83 |
+
|
| 84 |
+
<table><tr><td rowspan=1 colspan=1>Reference</td><td rowspan=1 colspan=1>Contribution</td><td rowspan=1 colspan=1>Feature NormConstraint</td><td rowspan=1 colspan=1>Feature NormRegularization</td><td rowspan=1 colspan=1>Loss Function</td></tr><tr><td rowspan=1 colspan=1>[28]</td><td rowspan=1 colspan=1>Empirical Results</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>Cross-Entropy Loss</td></tr><tr><td rowspan=1 colspan=1>[9]</td><td rowspan=1 colspan=1>Global Optimum</td><td rowspan=1 colspan=1>?</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>Cross-Entropy Loss</td></tr><tr><td rowspan=1 colspan=1>[39]</td><td rowspan=1 colspan=1>Global Optimum</td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>Cross-Entropy Loss</td></tr><tr><td rowspan=1 colspan=1>[24]</td><td rowspan=1 colspan=1>Global Optimum</td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>Cross-Entropy Loss</td></tr><tr><td rowspan=1 colspan=1>[26]</td><td rowspan=1 colspan=1>Training Dynamics</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>l2Loss</td></tr><tr><td rowspan=1 colspan=1>[43]</td><td rowspan=1 colspan=1>Landscape Analysis</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=1>Cross-Entropy Loss</td></tr><tr><td rowspan=1 colspan=1>This paper</td><td rowspan=1 colspan=1>Training Dynamics+Landscape Analysis</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>×</td><td rowspan=1 colspan=1>Cross-Entropy Loss</td></tr></table>
|
| 85 |
+
|
| 86 |
+
Table 1: Comparison of Recent Analysis for Neural Collapse. We provide strongest theoretical results with minimum modification on the training objective function.
|
| 87 |
+
|
| 88 |
+
# 64 1.1 Contribution
|
| 89 |
+
|
| 90 |
+
65 We summarize our contribution as follows.
|
| 91 |
+
|
| 92 |
+
• We build a relationship between the max-margin analysis [33, 27, 25] with the neural collapse and provide the inductive bias analysis to the feature rather than the output function. • Previous works only prove that Gradient Descent on homogeneous neural networks will converge to the KKT point of the corresponding minimum-norm separation problem. However, the minimum-norm separation problem is still a highly non-convex problem. In this paper, we prove that the ULPM cases enjoys a benign landscape and characterize the neural collapse property of the global minimizer.
|
| 93 |
+
|
| 94 |
+
• We show that although the gradient descent on cross entropy loss will push the parameters to infinity, the landscape in the tangent space has no spurious minimum thus many optimization algorithms will converge only along the neural collapse directions .
|
| 95 |
+
|
| 96 |
+
# 76 1.2 Related Work
|
| 97 |
+
|
| 98 |
+
Inductive Bias of Gradient Descent: To understand how gradient or its variants descent helps deep learning to find solutions with good generalization performance on the test set. A recent line of research have studied the implicit bias of gradient descent in different settings. As example, gradient descent is biased towards model have smaller weight [21, 1, 37] and will converge to large margin solution [33, 27, 25, 7, 14] while using logistic loss. For linear networks, [3, 31, 12] have shown that gradient descent will find out a low rank approximation.
|
| 99 |
+
|
| 100 |
+
Loss Landscape Analysis: Although the practical optimization problems encountered in machine learning are often nonconvex, recent works have shown that critical points other than the good ones always lies in the balanced superpositions of symmetric copies of the ground truth according to the hidden symmetries in the objective function [34, 42] which leads to a benign global landscape. In particular, these landscapes do not exhibit spurious local minimizers or flat saddles and can be optimized easily via gradient based methods [10]. The examples including phase retrieval [36], low-rank matrix recovery [11, 10], dictionary learning [35, 30, 19], blind deconvolution [18].
|
| 101 |
+
|
| 102 |
+
# 2 Preliminaries and Problem Setup
|
| 103 |
+
|
| 104 |
+
# 2.1 Preliminaries
|
| 105 |
+
|
| 106 |
+
We considerbalanced, i.e. $K$ sses: . A st $\textstyle \bigcup _ { k = 1 } ^ { K } \{ \pmb { x } _ { k , i } \} _ { i = 1 } ^ { n _ { k } }$ . For simplicity, we assume the dataset isnected neural network can be represented as: $n _ { 1 } = \cdot \cdot \cdot = n _ { K } = n$
|
| 107 |
+
|
| 108 |
+
$$
|
| 109 |
+
f \left( x ; W _ { f u l l } \right) = b _ { L } + W _ { L } \sigma \left( b _ { L - 1 } + W _ { L - 1 } \sigma \left( \cdot \cdot \cdot \sigma \left( b _ { 1 } + W _ { 1 } x \right) \right) \right) .
|
| 110 |
+
$$
|
| 111 |
+
|
| 112 |
+
5 Here $W _ { f u l l } = \left( W _ { 1 } , W _ { 2 } , \cdot \cdot \cdot , W _ { L } \right)$ denote the weight matrices in each layer and $( b _ { 1 } , b _ { 2 } , \cdots , b _ { L } )$ are the bias terms, $\sigma ( \cdot )$ stands for the nonlinear activation function, for example, ReLU or sigmoid. Let ${ \bf { x } } _ { k , i }$ $\begin{array} { r } { \pmb { h } _ { k , i } = \sigma \left( \pmb { b } _ { L - 1 } + \pmb { W } _ { L - 1 } \sigma \left( \cdots \sigma \left( \pmb { b } _ { 1 } + \pmb { W } _ { 1 } \pmb { x } _ { k , i } \right) \right) \right) \in \mathbb { R } ^ { d } } \end{array}$ and $\begin{array} { r } { \bar { \pmb { h } } _ { k } = \frac { 1 } { n } \sum _ { i = 1 } ^ { n } { \pmb { h } } _ { k , i } } \end{array}$ the feature mean within in the k-th class. Without loss of generality, we denote the last layer feature for data can absorb the bias term into the weight matrix by adding a scalar into each feature vectors, so we will ignore the bias term in the following analysis. Let $\begin{array} { r } { \tilde { \pmb { W } } \in \mathbb { R } ^ { K \times d } = \pmb { W } _ { L } = [ \pmb { w } _ { 1 } , \pmb { w } _ { 2 } , \cdots , \pmb { w } _ { K } ] ^ { \top } } \end{array}$ be the weight of the final linear classifier. Neural collapse is the phenomenon that the final layer feature will convergence to a simplex equiangular tight frame (ETF):
|
| 113 |
+
|
| 114 |
+
Definition 2.1. A symmetric matrix 03 $M \in \mathbb { R } ^ { K \times K }$ is said to be simplex equiangular tight frame 04 (ETF) if
|
| 115 |
+
|
| 116 |
+
$$
|
| 117 |
+
M = \sqrt { \frac { K } { K - 1 } } { \cal Q } ( { \cal I } _ { K } - \frac { 1 } { K } { \bf 1 } _ { K } { \bf 1 } _ { K } ^ { \top } ) .
|
| 118 |
+
$$
|
| 119 |
+
|
| 120 |
+
Where 105 $Q \in \mathbb { R } ^ { K \times K }$ is an orthogonal matrix.
|
| 121 |
+
|
| 122 |
+
106 The four criteria of neural collapse can be formulated precisely as
|
| 123 |
+
|
| 124 |
+
• (NC1) Variability collapse: As training progresses, the within-class variation of the activation becomes negligible as these activation collapse to their class-means $\begin{array} { r } { \bar { \pmb { h } } _ { k } = \frac { 1 } { n } \sum _ { i = 1 } ^ { n } { \pmb { h } } _ { k , i } } \end{array}$
|
| 125 |
+
|
| 126 |
+
$$
|
| 127 |
+
| | h _ { k , i } - \bar { h } _ { k } | | = 0 , \quad \forall 1 \leq k \leq K
|
| 128 |
+
$$
|
| 129 |
+
|
| 130 |
+
• (NC2) Convergence to Simplex ETF: The vectors of the class-means (after centering by their global-mean converge to having equal length, forming equal-sized angles between any given pair, and being the maximally pairwise-distanced configuration constrained to the previous two properties.
|
| 131 |
+
|
| 132 |
+
$$
|
| 133 |
+
c o s ( \bar { h } _ { k } , \bar { h } _ { j } ) = - \frac { 1 } { K - 1 } , \quad | | \bar { h } _ { k } | | = | | \bar { h } _ { j } | | , \quad \forall k \neq j
|
| 134 |
+
$$
|
| 135 |
+
|
| 136 |
+
• (NC3) Convergence to self-duality: The linear classifiers and class-means will converge to each other, up to rescaling.
|
| 137 |
+
|
| 138 |
+
$$
|
| 139 |
+
\exists C \ \mathrm { s . t . } \ w _ { k } = C \bar { h } _ { k } , \quad \forall 1 \leq k \leq K
|
| 140 |
+
$$
|
| 141 |
+
|
| 142 |
+
• (NC4) Simplification to Nearest Class-Center For a given deepnet activation $\boldsymbol { h } \quad =$ $\sigma \left( b _ { L - 1 } + \bar { W } _ { L - 1 } \sigma \left( \cdot \cdot \cdot \sigma \left( b _ { 1 } + W _ { 1 } x \right) \right) \right) \in \mathbb { R } ^ { d }$ , the network classifier converges to choose whichever class has the nearest train class-mean
|
| 143 |
+
|
| 144 |
+
$$
|
| 145 |
+
\underset { k } { \arg \operatorname* { m i n } } \pmb { w } _ { k } , \pmb { h } \underset { k } { \arg \operatorname* { m i n } } \| \pmb { h } - \bar { \pmb { h } } _ { k } \| ,
|
| 146 |
+
$$
|
| 147 |
+
|
| 148 |
+
In this paper, we say a point 07 $\pmb { W } \in \mathbb { R } ^ { K \times d } , \pmb { H } \in \mathbb { R } ^ { d \times n K }$ satisfies neural collapse conditions or is 08 neural collapse solution if these four criteria are all satisfied for $( W , H )$ .
|
| 149 |
+
|
| 150 |
+
# 2.2 Problem Setup
|
| 151 |
+
|
| 152 |
+
110 In this paper, we mainly focus on the neural collapse phenomenon, which is only related to the
|
| 153 |
+
111 classifiers and features in the last layer. Since general analysis on the highly non-smooth and non
|
| 154 |
+
112 convex neural network is difficult, here we peel down the last layer of neural network and propose
|
| 155 |
+
113 the following Unconstrained Layer-Peeled Model (ULPM) as a simplification to capture the main
|
| 156 |
+
114 characteristic related to neural collapse during the training dynamics. Similar simplification is
|
| 157 |
+
115 common used in previous theoretical works [24, 9, 39, 43], but ours don’t have any constraint or
|
| 158 |
+
116 regularization on features and stands closer to realistic neural network models. We need to mention
|
| 159 |
+
117 that although [26] also study the unconstrained model, their analysis is highly dependent on the $\ell _ { 2 }$
|
| 160 |
+
118 loss function which is rarely used in classification task while ours can address the most popular cross
|
| 161 |
+
119 entropy loss.
|
| 162 |
+
120 Let $\ b { W } = [ \ b { w } _ { 1 } , \ b { w } _ { 2 } , \ b { \cdot } \ b { \cdot } \ b { \cdot } , \ b { w } _ { K } ] ^ { \top } \in \mathbb { R } ^ { K \times d }$ and $H = [ h _ { 1 , 1 } , \cdot \cdot \cdot , h _ { 1 , N } , h _ { 2 , 1 } , \cdot \cdot \cdot , h _ { K , N } ] \in \mathbb { R } ^ { d \times K N }$
|
| 163 |
+
121 be the matrices of classifiers and features in the last layer, where $K$ is the number of classes and $N$
|
| 164 |
+
122 is the number of data points in each classes. The Unconstrained Layer-Peeled Model is defined as
|
| 165 |
+
123 following:
|
| 166 |
+
|
| 167 |
+
$$
|
| 168 |
+
\operatorname* { m i n } _ { W , H } \mathcal { L } ( W , H ) = - \sum _ { k = 1 } ^ { K } \sum _ { i = 1 } ^ { n } \log \left( \frac { \exp ( w _ { k } ^ { \top } h _ { k , i } ) } { \sum _ { j = 1 } ^ { K } \exp ( w _ { j } ^ { \top } h _ { k , i } ) } \right)
|
| 169 |
+
$$
|
| 170 |
+
|
| 171 |
+
124 Here we do not have any constrain or regularization on features, which corresponds to the absence
|
| 172 |
+
125 of weight decay in deep learning training. The objective function (4) is generally non-convex on
|
| 173 |
+
126 $( W , H )$ and we aim to study the landscape of the objective function (4). Furthermore, we consider
|
| 174 |
+
127 the gradient flow of the the objective function
|
| 175 |
+
|
| 176 |
+
$$
|
| 177 |
+
\frac { d \pmb { W } ( t ) } { d t } = \frac { \partial \pmb { \mathcal { L } } ( \pmb { W } ( t ) , \pmb { H } ( t ) ) } { \partial \pmb { W } } , \frac { d \pmb { H } } { d t } = \frac { \partial \pmb { \mathcal { L } } ( \pmb { W } ( t ) , \pmb { H } ( t ) ) } { \partial \pmb { H } } .
|
| 178 |
+
$$
|
| 179 |
+
|
| 180 |
+
128 We also trace the the dynamic of the loss function $\mathcal { L } ( t ) : = \mathcal { L } ( W ( t ) , H ( t ) )$ and study the convergence
|
| 181 |
+
129 of $( W ( t ) , H ( t ) )$ .
|
| 182 |
+
130 Notations. We denote $| | \cdot | | _ { F }$ the Frobenius norm, $\| \cdot \| _ { 2 }$ the matrix spectral norm, $\| \cdot \| _ { * }$ the nuclear
|
| 183 |
+
131 norm, $\| \cdot \|$ the vector $l _ { 2 }$ norm and $t r ( \cdot )$ the trace of matrices. We use $[ K ] : = \{ 1 , 2 , \cdots , K \}$ to denote
|
| 184 |
+
132 the set of indices up to $K$ .
|
| 185 |
+
|
| 186 |
+
# 33 3 Main Results
|
| 187 |
+
|
| 188 |
+
134 In this section, we present our main results about the training dynamics and landscape analysis about
|
| 189 |
+
135 (4). We organize the section as follows: First in Section 3.1.1, we show the relationship between
|
| 190 |
+
136 margin and neural collapse in our surrogate model. Inspired by this relationship, we propose a
|
| 191 |
+
137 minimum-norm separation problem (5) and show the connection between the convergence direction
|
| 192 |
+
138 of gradient flow and the KKT point of (5). In addition, we explicitly solve the global optimum of
|
| 193 |
+
139 (5) and show it must satisfy neural collapse conditions. However, due to the non-convexity, we find
|
| 194 |
+
140 an Example 3.1 in Section 3.2 which shows that there exist some bad KKT points such that simple
|
| 195 |
+
141 gradient flow will get stuck in them and not converge to neural collapse solution which is proved
|
| 196 |
+
142 to be optimal in Theorem 3.3. Then we present our second–order analysis result in Theorem 3.4 to
|
| 197 |
+
143 show that those bad points will exhibit decreasing directions in the tangent space thus if we add some
|
| 198 |
+
144 noise in the training algorithm (e.g. use stochastic gradient descent), our algorithm can escape from
|
| 199 |
+
145 those directions and can only converge to the neural collapse solutions.
|
| 200 |
+
|
| 201 |
+
# 3.1.1 Neural Collapse Margin
|
| 202 |
+
|
| 203 |
+
Before we state our convergence result, let’s first discuss the relationship between margin and neural collapse. By building the relationship between them we can have a better intuition about why gradient flow can converge to neural collapse solution since the convergence to max-margin solutions has been studied in many literature [21, 25, 1, 37]. Recall the margin of a single data point ${ \bf { x } } _ { k , i }$ and associated feature $h _ { k , i }$ as $\begin{array} { r } { q _ { k , i } ( W , H ) : = w _ { k } ^ { \top } h _ { k , i } - \operatorname* { m a x } _ { j \neq k } w _ { j } ^ { \top } h _ { k , i } . } \end{array}$ . [5, 4]. To bridge the margin theory with neural collapse phenomenon, we define the following neural collapse margin:
|
| 204 |
+
|
| 205 |
+
Definition 3.1. We define the the Neural Collapse Margin for the entire dataset as $q _ { \operatorname* { m i n } } ( W , H ) =$ $\begin{array} { r } { \operatorname* { m i n } _ { k \in [ 1 , K ] , i \in [ 1 , n ] } q _ { k , i } ( W , H ) } \end{array}$ .
|
| 206 |
+
|
| 207 |
+
56 The following lemma shows that the neural collapse margin is an indicator of the neural collapse
|
| 208 |
+
57 phenomenon in the sense that collapsed margin minimize the neural collapse margin. Thus we can
|
| 209 |
+
58 trace the neural collapse margin to study the convergence to the neural collapse solution.
|
| 210 |
+
|
| 211 |
+
Lemma 3.1 (Neural Collapse Margin as an Indicator of Neural Collapse). The neural collapse margin always smaller than
|
| 212 |
+
|
| 213 |
+
$$
|
| 214 |
+
q _ { \operatorname* { m i n } } ( W , H ) \leq \frac { \| W \| _ { F } ^ { 2 } + \| H \| _ { F } ^ { 2 } } { 2 ( K - 1 ) \sqrt { n } }
|
| 215 |
+
$$
|
| 216 |
+
|
| 217 |
+
159 and $( W , H )$ must satisfies the neural collapse conditions when the inequality above is reduced to an
|
| 218 |
+
160 equality.
|
| 219 |
+
|
| 220 |
+
# 3.1.2 Convergence Results
|
| 221 |
+
|
| 222 |
+
Now we present our result about the convergence of gradient flow on the ULPM (4). Following [25], we link gradient flow on cross-entropy loss with a minimum-norm separation problem.
|
| 223 |
+
|
| 224 |
+
Theorem 3.1. For problem (4), let $( W ( t ) , H ( t ) )$ be the path of gradient flow at time t, if there exist a time $t _ { 0 }$ such that $\mathcal { L } _ { C E } ( \boldsymbol { W } ( t _ { 0 } ) , H ( t _ { 0 } ) ) < \log 2 ,$ , then any limit point of $\{ ( \hat { H } ( t ) , \hat { W } ( t ) ) : =$ $( \frac { H ( t ) } { \sqrt { \| \boldsymbol { W } ( t ) \| _ { 2 } ^ { 2 } + \| \boldsymbol { H } ( t ) \| _ { 2 } ^ { 2 } } } , \frac { W ( t ) } { \sqrt { \| \boldsymbol { W } ( t ) \| _ { 2 } ^ { 2 } + \| \boldsymbol { H } ( t ) \| _ { 2 } ^ { 2 } } } ) \big \}$ is along the direction of an Karush-Kuhn-Tucker (KKT) point of the following minimum-norm separation problem:
|
| 225 |
+
|
| 226 |
+
$$
|
| 227 |
+
\begin{array} { r l r } & { \underset { W , H } { \operatorname* { m i n } } \frac { 1 } { 2 } | | W | | _ { F } ^ { 2 } + \frac { 1 } { 2 } | | H | | _ { F } ^ { 2 } } & \\ & { s . t . } & { \forall k \neq j \in [ K ] , i \in [ n ] , \quad w _ { k } ^ { \top } h _ { k , i } - w _ { j } ^ { \top } h _ { k , i } \geq 1 . } & \end{array}
|
| 228 |
+
$$
|
| 229 |
+
|
| 230 |
+
168 Remark 3.1. Indeed, the problem (5) can be reorganized to maximize neural collapse margin such
|
| 231 |
+
169 that the norm is constrained to be lower than a certain value. The proof is as follows, for all feasible
|
| 232 |
+
170 solutions $( W , H )$ , we can find that $\forall \alpha \ge q _ { m i n } ( W , H ) ^ { - 1 / 2 } , \alpha ( W , H )$ are still feasible thus the
|
| 233 |
+
171 minimum objective value is $\frac { \frac { 1 } { 2 } | | \boldsymbol { W } | | _ { F } ^ { 2 } + \frac { 1 } { 2 } | | \boldsymbol { H } | | _ { F } ^ { 2 } } { q _ { m i n } ( \boldsymbol { W } , \boldsymbol { H } ) ^ { 1 / 2 } }$ along the direction of $( W , H )$ . Then take minimum
|
| 234 |
+
172 among all the directions we can find the minimum is attained if and only if $( W , H )$ attains the
|
| 235 |
+
173 maximum neural collapse margin on the sphere $\{ ( W , H ) : | | W | | _ { F } ^ { 2 } + | | H | | _ { F } ^ { 2 } \le C \}$
|
| 236 |
+
174 The Theorem 3.1 indicates that the convergent direction of gradient flow is restricted to those
|
| 237 |
+
175 max-margin directions, which usually enjoy some good properties on robustness or generalization
|
| 238 |
+
176 performance. Generally speaking, the KKT conditions are not sufficient to obtain global optimality
|
| 239 |
+
177 since the minimum-norm separation problem (5) is non-convex. Moreover, in some certain occasions,
|
| 240 |
+
178 KKT conditions may be even not necessary for global optimum. However, we can have a precise
|
| 241 |
+
179 characterization about the optimum from another perspective, the following result shows that the
|
| 242 |
+
180 global optimum of this problem satisfies neural collapse conditions.
|
| 243 |
+
81 Theorem 3.2. Every global optimum of the minimum-norm separation problem (5) is also a KKT
|
| 244 |
+
82 point and it satisfies the neural collapse conditions.
|
| 245 |
+
183 To illustrate how does (5) related to (4) and gain insight about Theorem 3.1, we provided the following
|
| 246 |
+
184 lemmas to show that when t is sufficient large, the $( \mathbf { \bar { W } } ( t ) , \mathbf { \cal { H } } ( t ) )$ is an $( \epsilon , \delta )$ approximate KKT point
|
| 247 |
+
185 after appropriate scaling, where the $( \epsilon , \delta )$ converges to zero when $t \to \infty$ . Then as shown in [8] we
|
| 248 |
+
186 know that the limit of these $( \epsilon , \delta )$ approximate KKT point is exact KKT point. Detailed definition of
|
| 249 |
+
187 KKT points and approximate KKT points can be found in appendix.
|
| 250 |
+
|
| 251 |
+
Lemma 3.2. If there exist a time $t _ { 0 }$ such that $\mathcal { L } ( W ( t _ { 0 } ) , H ( t _ { 0 } ) ) < \log 2$ , then for any $t > t _ { 0 }$ $( \tilde { W ( t ) } , \tilde { H ( t ) } ) : = ( W ( t ) , H ( t ) ) / q _ { \mathrm { m i n } } ( W ( t ) , H ( t ) ) ^ { 1 / 2 }$ is a $( \epsilon , \delta )$ - approximate KKT point of the following minimum-norm separation problem. More precisely, we have
|
| 252 |
+
|
| 253 |
+
$$
|
| 254 |
+
\epsilon = \sqrt { \frac { 2 ( 1 - \beta ( t ) ) } { C } } , \delta = \frac { K } { 2 C q _ { m i n } ( t ) }
|
| 255 |
+
$$
|
| 256 |
+
|
| 257 |
+
where:
|
| 258 |
+
|
| 259 |
+
$$
|
| 260 |
+
\beta = \frac { t r ( W ^ { \top } \nabla _ { W } \mathcal { L } ( W , H ) ) + t r ( H ^ { \top } \nabla _ { H } \mathcal { L } ( W , H ) ) } { \sqrt { | | W | | _ { F } ^ { 2 } | | + | | H | | _ { F } ^ { 2 } } \sqrt { | | \nabla _ { W } \mathcal { L } ( W , H ) | | _ { F } ^ { 2 } | | + | | \nabla _ { H } \mathcal { L } ( W , H ) | | _ { F } ^ { 2 } } }
|
| 261 |
+
$$
|
| 262 |
+
|
| 263 |
+
is the angle between $( W , H )$ and its corresponding gradient and $C$ is a positive constant.
|
| 264 |
+
|
| 265 |
+
9 Lemma 3.3. If there exist a time $t _ { 0 }$ such that $\mathcal { L } _ { C E } ( \boldsymbol { W } ( t _ { 0 } ) , H ( t _ { 0 } ) ) < \log 2 ,$ , then we have:
|
| 266 |
+
|
| 267 |
+
$$
|
| 268 |
+
\beta ( t ) \to 1 , \quad q _ { m i n } ( t ) \to \infty a s t \to \infty
|
| 269 |
+
$$
|
| 270 |
+
|
| 271 |
+
which implies that $\epsilon 0$ and $\delta 0$ when time $t$ goes to infinity.
|
| 272 |
+
|
| 273 |
+
# 3.2 Second–Order Landscape Analysis
|
| 274 |
+
|
| 275 |
+
Due to the non-convex nature of the objective (4), we can’t achieve such global solution efficiently. The global optimality condition shown in Theorem 3.2 still can’t guarantee convergence to neural collapse. In this section, we aim to show that this non-convex optimization problem is actually not scary.
|
| 276 |
+
|
| 277 |
+
Different from previous landscape analysis of non-convex problem, where people aim to show that the objective has a negative directional curvature around any stationary point [34, 42], once features can be perfectly separated, the ULPM objective (4) will always decrease along the direction of the current point and the optimum is attained only in infinity. Although growing along all of those perfectly separation directions can let the loss function decreasing to 0, the speed of decreasing are quite different and there exists an optimal direction with fastest decreasing speed. However, simple first–order analysis may fail to interpret how does gradient flow move among these directions and we need second–order analysis to help us fully characterize the realistic training dynamics. Here is an example illustrating our motivation.
|
| 278 |
+
|
| 279 |
+
Example 3.1 (A Motivating Example). Consider the case when $K = 4 , n = 1$ , let $( W , H )$ be the following point:
|
| 280 |
+
|
| 281 |
+
$$
|
| 282 |
+
W = H = C \left[ \begin{array} { c c c c } { { 1 } } & { { - 1 } } & { { 0 } } & { { 0 } } \\ { { - 1 } } & { { 1 } } & { { 0 } } & { { 0 } } \\ { { 0 } } & { { 0 } } & { { 1 } } & { { - 1 } } \\ { { 0 } } & { { 0 } } & { { - 1 } } & { { 1 } } \end{array} \right]
|
| 283 |
+
$$
|
| 284 |
+
|
| 285 |
+
207 One can easily verify that this $( W , H )$ enables our model to classify all of the features perfectly.
|
| 286 |
+
208 209 Further more, we can show it is along the direction problem (5) by construct the Lagrangian multiplier $\Lambda = ( \lambda _ { i j } ) _ { i , j = 1 } ^ { K }$ of the minimum-norm separationas following:
|
| 287 |
+
|
| 288 |
+
$$
|
| 289 |
+
\Lambda = { \left[ \begin{array} { l l l l } { 0 } & { 0 } & { { \frac { 1 } { 2 } } } & { { \frac { 1 } { 2 } } } \\ { 0 } & { 0 } & { { \frac { 1 } { 2 } } } & { { \frac { 1 } { 2 } } } \\ { { \frac { 1 } { 2 } } } & { { \frac { 1 } { 2 } } } & { 0 } & { 0 } \\ { { \frac { 1 } { 2 } } } & { { \frac { 1 } { 2 } } } & { 0 } & { 0 } \end{array} \right] }
|
| 290 |
+
$$
|
| 291 |
+
|
| 292 |
+
210 And the gradient of $( W , H )$ is
|
| 293 |
+
|
| 294 |
+
$$
|
| 295 |
+
\nabla _ { W } \mathcal { L } ( W , H ) = \nabla _ { H } \mathcal { L } ( W , H ) = - C \frac { 2 + 2 e ^ { - 2 C ^ { 2 } } } { 2 + 2 e ^ { - 2 C ^ { 2 } } + 2 e ^ { 2 C ^ { 2 } } } \left[ \begin{array} { c c c c } { 1 } & { - 1 } & { 0 } & { 0 } \\ { - 1 } & { 1 } & { 0 } & { 0 } \\ { 0 } & { 0 } & { 1 } & { - 1 } \\ { 0 } & { 0 } & { - 1 } & { 1 } \end{array} \right]
|
| 296 |
+
$$
|
| 297 |
+
|
| 298 |
+
211 We can find that the directions of gradient and the parameter align with each other (i.e.
|
| 299 |
+
212 $W / / \nabla _ { W } \mathcal { L } ( W , H ) , H / / \nabla _ { H } \mathcal { L } ( W , \bar { H } ) )$ , which implies simple gradient descent get stuck in this
|
| 300 |
+
213 direction and only grow the parameter norm. However, if we construct:
|
| 301 |
+
|
| 302 |
+
$$
|
| 303 |
+
W ^ { \prime } = \pmb { H } ^ { \prime } = C \left[ \begin{array} { l l l l } { 1 } & { \alpha } & { \beta } & { \beta } \\ { \alpha } & { 1 } & { \beta } & { \beta } \\ { \beta } & { \beta } & { 1 } & { \alpha } \\ { \beta } & { \beta } & { \alpha } & { 1 } \end{array} \right] , \quad \alpha ^ { 2 } + 2 \beta ^ { 2 } = 1 , \alpha < 0 , \beta < 0
|
| 304 |
+
$$
|
| 305 |
+
|
| 306 |
+
214 Then $\forall \epsilon > 0$ , we can choose appropriate $\alpha , \beta$ such that (see detailed computation in Appendix):
|
| 307 |
+
|
| 308 |
+
$$
|
| 309 |
+
\begin{array} { r l } & { | | W ^ { \prime } | | _ { F } ^ { 2 } = | | W | | _ { F } ^ { 2 } , | | H ^ { \prime } | | _ { F } ^ { 2 } = | | H | | _ { F } ^ { 2 } , } \\ & { | | W ^ { \prime } - W | | _ { F } ^ { 2 } + | | H ^ { \prime } - H | | _ { F } ^ { 2 } < \epsilon , \mathcal { L } ( W ^ { \prime } , H ^ { \prime } ) \leq \mathcal { L } ( W , H ) } \end{array}
|
| 310 |
+
$$
|
| 311 |
+
|
| 312 |
+
215 The results in (11) indicate that $( W ^ { \prime } , H ^ { \prime } )$ is a saddle point on the sphere and there exists many better
|
| 313 |
+
216 direction $( W ^ { \prime } , H ^ { \prime } )$ staying very close to the original direction $( W , H )$ . Although simple gradient
|
| 314 |
+
217 descent will always move along the original direction, once we add some noise in the training (e.g.
|
| 315 |
+
218 stochastic gradient descent), the optimization algorithm can find this better direction and escape the
|
| 316 |
+
219 original bad direction.
|
| 317 |
+
220 In Example 3.1, we show that there does exist some suboptimal KKT point of the minimum-norm
|
| 318 |
+
221 separation problem (5), but there also exist some better points close to it thus stochastic gradient
|
| 319 |
+
222 method can easily escape form them. In the following theorem, we will show that the best directions
|
| 320 |
+
223 are neural collapse solutions in the sense that the loss function is lowest among all the growing
|
| 321 |
+
224 directions.
|
| 322 |
+
|
| 323 |
+
Theorem 3.3. The optimal value of loss function (4) on a sphere is attained (i.e. $\begin{array} { r } { \mathcal { L } ( W , H ) \le } \end{array}$ $\mathcal { L } ( W ^ { \prime } , H ^ { \prime } ) , \forall | | W ^ { \prime } | | _ { F } ^ { 2 } + | | H ^ { \prime } | | _ { F } ^ { 2 } = | | W | | _ { F } ^ { 2 } + | | H | | _ { F } ^ { 2 } )$ if only if the $( W , H )$ satisfies neural collapse conditions and $| | \boldsymbol { W } | | _ { F } = | | \boldsymbol { H } | | _ { F }$ .
|
| 324 |
+
|
| 325 |
+
Remark 3.2. Note that the second conditions is necessary since neural collapse conditions don’t specify the norm ratio of $W$ and $\pmb { H }$ . That is, if $( W , H )$ satisfies neural collapse conditions, $( \alpha W , \beta H ) , \forall \alpha , \beta \in \mathbb { R }$ will also satisfies them but only some certain $\alpha , \beta$ are optimal.
|
| 326 |
+
|
| 327 |
+
31 Now we turns to those points that don’t satisfy neural collapse conditions. To formalize our discussion
|
| 328 |
+
32 in the motivating Example 3.1, we first introduce the tangent space:
|
| 329 |
+
233 Definition 3.2 (tangent space). The tangent space of $( W , H )$ is defined to be a set of directions that
|
| 330 |
+
234 are orthogonal to $( W , H )$ :
|
| 331 |
+
|
| 332 |
+
$$
|
| 333 |
+
\mathcal { T } ( W , H ) = \left\{ \Delta W \in \mathbb { R } ^ { K \times d } , \Delta H \in \mathbb { R } ^ { d \times n K } \right\} : t r ( W ^ { \top } \Delta W ) + t r ( H ^ { \top } \Delta H ) = 0 \}
|
| 334 |
+
$$
|
| 335 |
+
|
| 336 |
+
235 Our next result justify our observation in the Example 3.1 that for every suboptimal points, there exist
|
| 337 |
+
236 a direction in the tangent space such that move along this direction will leads to a lower objective
|
| 338 |
+
237 value.
|
| 339 |
+
38 Theorem 3.4. If $( W , H )$ is not the optimal solutions in Theorem 3.3, then $\exists ( \Delta W , \Delta H ) \ \in$
|
| 340 |
+
39 $\mathcal { T } ( W , H ) , M > 0$ such that
|
| 341 |
+
|
| 342 |
+
$$
|
| 343 |
+
\forall 0 < \delta < M , \mathcal { L } ( W + \delta \Delta W , H + \delta \Delta H ) \le \mathcal { L } ( W , H )
|
| 344 |
+
$$
|
| 345 |
+
|
| 346 |
+
. Further more, it implies that 240 $\forall \epsilon > 0 , \exists ( W ^ { \prime } , H ^ { \prime } )$ such that:
|
| 347 |
+
|
| 348 |
+
$$
|
| 349 |
+
\begin{array} { r l } & { | | W ^ { \prime } | | _ { F } ^ { 2 } + | | H ^ { \prime } | | _ { F } ^ { 2 } = | | W | | _ { F } ^ { 2 } + | | H | | _ { F } ^ { 2 } , } \\ & { | | W ^ { \prime } - W | | _ { F } ^ { 2 } + | | H ^ { \prime } - H | | _ { F } ^ { 2 } < \epsilon , \mathcal { L } ( W ^ { \prime } , H ^ { \prime } ) \leq \mathcal { L } ( W , H ) } \end{array}
|
| 350 |
+
$$
|
| 351 |
+
|
| 352 |
+
241 Remark 3.3. The result in (13) give us a decreasing direction orthogonal to the direction of $( W , H )$ ,
|
| 353 |
+
242 as shown in Example 3.1, the gradient might be parallel to $( W , H )$ , the decreasing direction must be
|
| 354 |
+
243 obtained by analyze the Hessian matrices and it further indicates that these points are exactly saddle
|
| 355 |
+
244 points in the tangent space, a formal statement and definition can be found in appendix. For a large
|
| 356 |
+
245 family of stochastic optimization algorithm , the projection of noise onto this decreasing direction
|
| 357 |
+
246 is not zero with probability 1, so its those algorithms will escape the bad point and no longer move
|
| 358 |
+
247 along this direction within a small number of iterations.
|
| 359 |
+
|
| 360 |
+
# 4 Empirical Results
|
| 361 |
+
|
| 362 |
+
Gradient Descent on the ULPM Objective. We first conduct experiments on the ULPM objective (4) to support the results of convergence towards Neural Collapse in our theories. We set $N = 1 0$ , $K = 5$ , $d = 2 0$ and use gradient descent with learning rate 5 to run $1 0 ^ { 5 }$ epochs. We characterize the dynamics of the training procedure in Figure 2, through four aspects: (1) variation of the centered class-mean features’ norms (i.e., $\mathrm { S t d } ( \| \bar { \boldsymbol { h } } _ { k } - \bar { \boldsymbol { h } } \| ) / \mathrm { A v g } ( \| \bar { \boldsymbol { h } } _ { k } - \bar { \boldsymbol { h } } \| ) )$ and the variation of the classifier’s norms (i.e., $\mathrm { S t d } ( \| \bar { \boldsymbol { w } } _ { k } \| ) / \mathrm { A v g } ( \| \bar { \boldsymbol { w } } _ { k } \| ) )$ . (2) Within-class variation of last layer features (i.e., $\mathrm { A v g } ( \| h _ { k , i } - h _ { k } \| ) / \mathrm { A v g } ( \| h _ { k , i } - \bar { h } \| ) )$ . (3) The cosines between pairs of last layer features (i.e.,
|
| 363 |
+
|
| 364 |
+
256 $\mathrm { A v g } ( | \cos ( \bar { h } _ { k } , \bar { h } _ { k ^ { \prime } } ) + 1 / ( K - 1 ) | ) )$ and that of the classifiers (i.e., $\mathrm { A v g } ( | \cos ( \bar { w } _ { k } , \bar { w } _ { k ^ { \prime } } ) + 1 / ( K - 1 ) | ) \}$ .
|
| 365 |
+
257 (4) The distance between normalized centered classifier and normalized last layer feature (i.e.,
|
| 366 |
+
258 $\mathrm { A v g } ( | ( \bar { h } _ { k } - \bar { h } ) / \| \bar { h } _ { k } - \bar { h } \| - \bar { w } _ { k } / \| \bar { w } _ { k } \| | ) )$ . Empirically we observe that logarithm of the two
|
| 367 |
+
259 variations of norms (in the first aspect) decrease approximately at rate $O ( 1 / ( \log ( t ) ) )$ , and the
|
| 368 |
+
260 remaining quantities decrease approximately at rate ${ \bar { O } } { \bar { ( } } 1 / ( \log ( t ) ) { \bar { ) } }$ .
|
| 369 |
+
261 Realistic Training. We also extend our theory to realistic neural network training on benchmark
|
| 370 |
+
262 dataset. To evaluate our theory, we train the VGG-13 [32] on FashionMNIST [40] without weight
|
| 371 |
+
263 decay and track the convergence speed of the last layer feature to the neural collapse solution every few
|
| 372 |
+
264 epochs to see how it changes during the terminal phase training. Observe that all the aforementioned
|
| 373 |
+
265 quantities either decrease or stay in small values during the training process, providing implications
|
| 374 |
+
266 that neural collapse can occur with sufficient training epochs.
|
| 375 |
+
|
| 376 |
+

|
| 377 |
+
Figure 2: Training dynamics in ULPM. The $_ x$ -axis in the figures are set to have $\log ( \log ( t ) )$ scales and the $_ y$ -axis in the figures are set to have log scales. (a) The dynamics of the variation of the centered class-mean features’ norms (shown in blue) and the variation of the classifier’s norms (shown in red). We observe that the logarithm of both terms decrease at rate $O ( 1 / ( \log ( t ) ) )$ . (b) The dynamics of the within-class variation of last layer features. Logarithm of the variation converge approximately at rate $O ( 1 / \log ( t ) ) )$ . (c) The dynamics of the cosines between pairs of last layer features (shown in blue) and that of the classifiers (shown in red). Logarithm of both terms converge approximately at rate $O ( 1 / \log ( t ) ) )$ . (d) The dynamics of the distance between normalized centered classifier and normalized last layer feature. Logarithm of the quantity converge approximately at rate $O ( 1 / \log ( t ) ) ,$ to the point of self-duality.
|
| 378 |
+
|
| 379 |
+

|
| 380 |
+
Figure 3: Training VGG-13 without weight decay on FashionMNIST. The $x$ -axis in the figures are set to have $\log ( \log ( t ) )$ scales and the $_ y$ -axis in the figures are set to have log scales. (a) Variation of the centered class-mean features’ norms and that of the classifier’s norms are below 0.1 after 500 epochs. (b) Logarithm of the within-class variation of last layer features decreases approximately linearly with respect to $\log ( \log ( t ) )$ after 100 epochs. (c) The cosines between pairs of last layer features and that of the classifiers decrease and are below 0.1 after 500 epochs. (d) The distance between normalized centered classifier and normalized last layer feature decreases during training towards self-duality.
|
| 381 |
+
|
| 382 |
+
# 5 Conclusion and Discussion
|
| 383 |
+
|
| 384 |
+
# 5.1 Conclusion
|
| 385 |
+
|
| 386 |
+
270 To understand the inductive bias of neural feature from gradient descent training, we build a connection
|
| 387 |
+
271 between large margin inductive bias with neural collapse phenomenon and study a unconstrained
|
| 388 |
+
272 layer-peeled model in this paper. We proved that the gradient flow of the ULPM convergences
|
| 389 |
+
273 to KKT point of a minimum-norm separation problem where the global optimum satisfies neural
|
| 390 |
+
274 collapse conditions. Although the ULPM is nonconvex, we show that ULPM have a nice landscape
|
| 391 |
+
275 where all the stationary point is a strict saddle point in the tangent space except the global neural
|
| 392 |
+
276 collapse solution. Our study helps to demystify the neural collapse phenomenon, which shed light on
|
| 393 |
+
277 the generalization and robustness properties during the terminal phase of training deep networks in
|
| 394 |
+
278 classification problems.
|
| 395 |
+
|
| 396 |
+
# 5.2 Relationship with Other Results
|
| 397 |
+
|
| 398 |
+
Theoretical analysis of neural collapse are first provided by [24, 39, 9], they show that the neural collapse solution is the only global minimum of the simplified non-convex objective function. In particular, [39, 24] study a continuous integral form of the loss function and show that the feature learnt should be a uniform distribution on sphere. A more realistic discrete setting are studied in [9], where the constraint is on the whole feature matrix rather than individual features. All these results only relies on Jensen inequality on output logits thus can be generalized to other convex in logit losses. Our result utilize the implicit bias of the exponential like loss function to remove the feature norm constraint which is not practicable in real applications.
|
| 399 |
+
|
| 400 |
+
288 Though the global optimum shares good property [9], the ULPM objective is still highly non-convex.
|
| 401 |
+
289 Regards optimization, [26, 29] analyze the unconstrained feature model with $\ell _ { 2 }$ loss and establish
|
| 402 |
+
290 convergence results to collapsed feature for gradient descent. However they fail to generalize on
|
| 403 |
+
291 other more practical loss functions used in classification tasks. The analysis highly relies on the $\ell _ { 2 }$
|
| 404 |
+
292 loss which turns the training dynamic to an ODE in eigenvalues.
|
| 405 |
+
293 The most relevant paper is a concurrent breakthrough work [43], which provide a landscape analysis
|
| 406 |
+
294 about the regularized unconstrained feature model. [43] turns the feature norm constraint in [9] into
|
| 407 |
+
295 feature norm regularization and still preserves the neural collapse global optimum. At the same
|
| 408 |
+
296 time, [43] also show that the modified regularized objective shares a benign landscape, where all
|
| 409 |
+
297 the critical points are strict saddles except the global one. Although our paper and [43] discover
|
| 410 |
+
298 similar landscape results, we believe our characterization stays closer to the real algorithms used in
|
| 411 |
+
299 the following two ways
|
| 412 |
+
|
| 413 |
+
• The same as [24, 39, 9], [43] only utilize the convexity in logits of the loss function. However, our analysis also explores the exponential-like property of the cross-entropy loss which will enlarge the norm of the feature. The large feature will provide better approximation to the true neural collapse problem of the normalized feature via approximating the max function via gradually scaled exponential function.
|
| 414 |
+
We doesn’t introduce any constraints or regularization on the feature norm, which is not applied in the realist training. Regularization on feature introduce in [43] is still different from the weight decay regularization [17]. However weight decay on homogeneous neural network is equivalent to gradient descent with scaling step size on unregularized objective [22, 41].
|
| 415 |
+
|
| 416 |
+
We summarize analysis of neural collapse in Table 1.
|
| 417 |
+
|
| 418 |
+
# 5.3 Limitation and Future Work
|
| 419 |
+
|
| 420 |
+
The convergence to neural collapse is super slow. [15] provide a loss dependent learning rate schedule and leads to $O ( 1 / t )$ convergence rate for linear regression. It’s interesting to investigate can this methodology being generalized to our setting. On the other hand, although we have shown that the ULPM have a nice landscape, we still leave the global convergence of (stochastic) gradient descent as future work for we want to provide global convergence of gradient descent combined with a plug in feature extractor.
|
| 421 |
+
|
| 422 |
+
# References
|
| 423 |
+
|
| 424 |
+
[1] Shun-ichi Amari, Jimmy Ba, Roger Grosse, Xuechen Li, Atsushi Nitanda, Taiji Suzuki, Denny Wu, and Ji Xu. When does preconditioning help or hurt generalization? arXiv preprint arXiv:2006.10732, 2020.
|
| 425 |
+
[2] Raman Arora, Sanjeev Arora, Joan Bruna, Nadav Cohen, Rong Ge, Suriya Gunasekar, Chi Jin, Jason Lee, Tengyu Ma, Behnam Neyshabua, and Zhao Song. Theory of deep learning. https://www.cs.princeton.edu/courses/archive/fall19/cos597B/ lecnotes/bookdraft.pdf/.
|
| 426 |
+
[3] Sanjeev Arora, Nadav Cohen, Wei Hu, and Yuping Luo. Implicit regularization in deep matrix factorization. arXiv preprint arXiv:1905.13655, 2019.
|
| 427 |
+
[4] Peter Bartlett, Dylan J Foster, and Matus Telgarsky. Spectrally-normalized margin bounds for neural networks. arXiv preprint arXiv:1706.08498, 2017.
|
| 428 |
+
[5] Peter Bartlett, Yoav Freund, Wee Sun Lee, and Robert E Schapire. Boosting the margin: A new explanation for the effectiveness of voting methods. The annals of statistics, 26(5):1651–1686, 1998.
|
| 429 |
+
[6] 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.
|
| 430 |
+
[7] Lenaic Chizat and Francis Bach. Implicit bias of gradient descent for wide two-layer neural networks trained with the logistic loss. In Conference on Learning Theory, pages 1305–1338. PMLR, 2020.
|
| 431 |
+
[8] J. Dutta, K. Deb, Rupesh Tulshyan, and Ramnik Arora. Approximate kkt points and a proximity measure for termination. Journal of Global Optimization, 56:1463–1499, 2013.
|
| 432 |
+
[9] Cong Fang, Hangfeng He, Qi Long, and Weijie J Su. Layer-peeled model: Toward understanding well-trained deep neural networks. arXiv preprint arXiv:2101.12699, 2021.
|
| 433 |
+
[10] Rong Ge, Furong Huang, Chi Jin, and Yang Yuan. Escaping from saddle points—online stochastic gradient for tensor decomposition. In Conference on learning theory, pages 797–842. PMLR, 2015.
|
| 434 |
+
[11] Rong Ge, Jason D Lee, and Tengyu Ma. Matrix completion has no spurious local minimum. arXiv preprint arXiv:1605.07272, 2016.
|
| 435 |
+
[12] Gauthier Gidel, Francis Bach, and Simon Lacoste-Julien. Implicit regularization of discrete gradient dynamics in linear neural networks. arXiv preprint arXiv:1904.13262, 2019.
|
| 436 |
+
[13] Micah Goldblum, Jonas Geiping, Avi Schwarzschild, Michael Moeller, and Tom Goldstein. Truth or backpropaganda? an empirical investigation of deep learning theory. arXiv preprint arXiv:1910.00359, 2019.
|
| 437 |
+
[14] Ziwei Ji, Miroslav Dudík, Robert E Schapire, and Matus Telgarsky. Gradient descent follows the regularization path for general losses. In Conference on Learning Theory, pages 2109–2136. PMLR, 2020.
|
| 438 |
+
[15] Ziwei Ji and Matus Telgarsky. Characterizing the implicit bias via a primal-dual analysis. In Algorithmic Learning Theory, pages 772–804. PMLR, 2021.
|
| 439 |
+
[16] Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. Advances in neural information processing systems, 25:1097– 1105, 2012.
|
| 440 |
+
[17] Anders Krogh and John A Hertz. A simple weight decay can improve generalization. In Advances in neural information processing systems, pages 950–957, 1992.
|
| 441 |
+
[18] Yenson Lau, Qing Qu, Han-Wen Kuo, Pengcheng Zhou, Yuqian Zhang, and John Wright. Short-and-sparse deconvolution–a geometric approach. arXiv preprint arXiv:1908.10959, 2019.
|
| 442 |
+
|
| 443 |
+
[19] Thomas Laurent and James Brecht. Deep linear networks with arbitrary loss: All local minima are global. In International conference on machine learning, pages 2902–2907. PMLR, 2018. [20] Yann LeCun, Yoshua Bengio, and Geoffrey Hinton. Deep learning. nature, 521(7553):436–444, 2015. [21] Yuanzhi Li, Tengyu Ma, and Hongyang Zhang. Algorithmic regularization in over-parameterized matrix sensing and neural networks with quadratic activations. In Conference On Learning Theory, pages 2–47. PMLR, 2018. [22] Zhiyuan Li and Sanjeev Arora. An exponential learning rate schedule for deep learning. arXiv preprint arXiv:1910.07454, 2019. [23] Zichao Long, Yiping Lu, Xianzhong Ma, and Bin Dong. Pde-net: Learning pdes from data. In International Conference on Machine Learning, pages 3208–3216. PMLR, 2018. [24] Jianfeng Lu and Stefan Steinerberger. Neural collapse with cross-entropy loss. arXiv preprint arXiv:2012.08465, 2020. [25] Kaifeng Lyu and Jian Li. Gradient descent maximizes the margin of homogeneous neural networks. arXiv preprint arXiv:1906.05890, 2019. [26] Dustin G Mixon, Hans Parshall, and Jianzong Pi. Neural collapse with unconstrained features. arXiv preprint arXiv:2011.11619, 2020. [27] Mor Shpigel Nacson, Jason Lee, Suriya Gunasekar, Pedro Henrique Pamplona Savarese, Nathan Srebro, and Daniel Soudry. Convergence of gradient descent on separable data. In The 22nd International Conference on Artificial Intelligence and Statistics, pages 3420–3428. PMLR, 2019. [28] Vardan Papyan, XY Han, and David L Donoho. Prevalence of neural collapse during the terminal phase of deep learning training. Proceedings of the National Academy of Sciences, 117(40):24652–24663, 2020. [29] Tomaso Poggio and Qianli Liao. Explicit regularization and implicit bias in deep network classifiers trained with the square loss. arXiv preprint arXiv:2101.00072, 2020. [30] Qing Qu, Yuexiang Zhai, Xiao Li, Yuqian Zhang, and Zhihui Zhu. Analysis of the optimization landscapes for overcomplete representation learning. arXiv preprint arXiv:1912.02427, 2019. [31] Noam Razin and Nadav Cohen. Implicit regularization in deep learning may not be explainable by norms. arXiv preprint arXiv:2005.06398, 2020. [32] Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014. [33] Daniel Soudry, Elad Hoffer, Mor Shpigel Nacson, Suriya Gunasekar, and Nathan Srebro. The implicit bias of gradient descent on separable data. The Journal of Machine Learning Research, 19(1):2822–2878, 2018. [34] Ju Sun, Qing Qu, and John Wright. When are nonconvex problems not scary? arXiv preprint arXiv:1510.06096, 2015. [35] Ju Sun, Qing Qu, and John Wright. Complete dictionary recovery over the sphere i: Overview and the geometric picture. IEEE Transactions on Information Theory, 63(2):853–884, 2016. [36] Ju Sun, Qing Qu, and John Wright. A geometric analysis of phase retrieval. Foundations of Computational Mathematics, 18(5):1131–1198, 2018. [37] Sharan Vaswani, Reza Babanezhad, Jose Gallego, Aaron Mishkin, Simon Lacoste-Julien, and Nicolas Le Roux. To each optimizer a norm, to each norm its generalization. arXiv preprint arXiv:2006.06821, 2020. 09 [38] Colin Wei, Jason Lee, Qiang Liu, and Tengyu Ma. On the margin theory of feedforward neural networks. 2018.
|
| 444 |
+
|
| 445 |
+
11 [39] Stephan Wojtowytsch and Weinan E. On the emergence of tetrahedral symmetry in the final and penultimate layers of neural network classifiers. arXiv preprint arXiv:2012.05420, 2020. [40] Han Xiao, Kashif Rasul, and Roland Vollgraf. Fashion-mnist: a novel image dataset for benchmarking machine learning algorithms. arXiv preprint arXiv:1708.07747, 2017. [41] Linfeng Zhang, Jiequn Han, Han Wang, Roberto Car, and Weinan E. Deep potential molecular dynamics: a scalable model with the accuracy of quantum mechanics. Physical Review Letters, 120(14):143001, 2018. [42] Yuqian Zhang, Qing Qu, and John Wright. From symmetry to geometry: Tractable nonconvex problems. arXiv preprint arXiv:2007.06753, 2020. [43] Zhihui Zhu, Tianyu Ding, Jinxin Zhou, Xiao Li, Chong You, Jeremias Sulam, and Qing Qu. A geometric analysis of neural collapse with unconstrained features. arXiv preprint arXiv:2105.02375, 2021.
|
| 446 |
+
|
| 447 |
+
1. For all authors...
|
| 448 |
+
|
| 449 |
+
(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes]
|
| 450 |
+
(b) Did you describe the limitations of your work? [Yes]
|
| 451 |
+
(c) Did you discuss any potential negative societal impacts of your work? [N/A]
|
| 452 |
+
(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
|
| 453 |
+
|
| 454 |
+
2. If you are including theoretical results...
|
| 455 |
+
|
| 456 |
+
(a) Did you state the full set of assumptions of all theoretical results? [Yes] (b) Did you include complete proofs of all theoretical results? [Yes]
|
| 457 |
+
|
| 458 |
+
3. If you ran experiments...
|
| 459 |
+
|
| 460 |
+
(a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [Yes]
|
| 461 |
+
(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they are chosen)? [Yes]
|
| 462 |
+
(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [No]
|
| 463 |
+
(d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [No]
|
| 464 |
+
|
| 465 |
+
4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
|
| 466 |
+
|
| 467 |
+
(a) If your work uses existing assets, did you cite the creators? [N/A]
|
| 468 |
+
(b) Did you mention the license of the assets? [N/A]
|
| 469 |
+
(c) Did you include any new assets either in the supplemental material or as a URL? [N/A]
|
| 470 |
+
(d) Did you discuss whether and how consent is obtained from people whose data you’re using/curating? [N/A]
|
| 471 |
+
(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A]
|
| 472 |
+
|
| 473 |
+
5. If you used crowdsourcing or conducted research with human subjects...
|
| 474 |
+
|
| 475 |
+
(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
|
| 476 |
+
(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A]
|
| 477 |
+
(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]
|
md/train/G1jmxFOtY_/G1jmxFOtY_.md
ADDED
|
@@ -0,0 +1,374 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Learning with User-Level Privacy
|
| 2 |
+
|
| 3 |
+
Daniel Levy∗,1 Ziteng Sun∗,2 Kareem Amin3 Satyen Kale3
|
| 4 |
+
Alex Kulesza3 Mehryar Mohri3,4 Ananda Theertha Suresh3
|
| 5 |
+
|
| 6 |
+
1Stanford University 2Cornell University 3Google Research 4Courant Institute danilevy@stanford.edu, zs335@cornell.edu, {kamin, satyenkale, kulesza, mohri, theertha}@google.com
|
| 7 |
+
|
| 8 |
+
# Abstract
|
| 9 |
+
|
| 10 |
+
We propose and analyze algorithms to solve a range of learning tasks under userlevel differential privacy constraints. Rather than guaranteeing only the privacy of individual samples, user-level DP protects a user’s entire contribution $m \geq 1$ samples), providing more stringent but more realistic protection against information leaks. We show that for high-dimensional mean estimation, empirical risk minimization with smooth losses, stochastic convex optimization, and learning hypothesis classes with finite metric entropy, the privacy cost decreases as $O ( 1 / \bar { \sqrt { m } } )$ as users provide more samples. In contrast, when increasing the number of users $n$ , the privacy cost decreases at a faster $O ( 1 / n )$ rate. We complement these results with lower bounds showing the minimax optimality of our algorithms for mean estimation and stochastic convex optimization. Our algorithms rely on novel techniques for private mean estimation in arbitrary dimension with error scaling as the concentration radius $\tau$ of the distribution rather than the entire range.
|
| 11 |
+
|
| 12 |
+
# 1 Introduction
|
| 13 |
+
|
| 14 |
+
Releasing seemingly innocuous functions of a data set can easily compromise the privacy of individuals, whether the functions are simple counts [35] or complex machine learning models like deep neural networks [52, 30]. To protect against such leaks, Dwork et al. proposed the notion of differential privacy (DP). Given some data from $n$ participants in a study, we say that a statistic of the data is differentially private if an attacker who already knows the data of $n - 1$ participants cannot reliably determine from the statistic whether the $n$ -th remaining participant is Alice or Bob. With the recent explosion of publicly available data, progress in machine learning, and widespread public release of machine learning models and other statistical inferences, differential privacy has become an important standard and is widely adopted by both industry and government [32, 5, 21, 55].
|
| 15 |
+
|
| 16 |
+
The standard setting of DP described in [22] assumes that each participant contributes a single data point to the dataset, and preserves privacy by “noising” the output in a way that is commensurate with the maximum contribution of a single example. This is not the situation faced in many applications of machine learning models, where users often contribute multiple samples to the model—for example, when language and image recognition models are trained on the users’ own data, or in federated learning settings [37]. As a result, current techniques either provide privacy guarantees that degrade with a user’s increased participation or naively add a substantial amount of noise, relying on the group property of differential privacy, which significantly harms the performance of the deployed model.
|
| 17 |
+
|
| 18 |
+
To remedy this issue, we consider user-level DP, which instead of guaranteeing privacy for individual samples, protects a user’s entire contribution $\textcircled { m } \geq 1$ samples). This is a more stringent but more realistic privacy desideratum. To hold, it requires that the output of our algorithm does not significantly change when changing user’s entire contribution—i.e. possibly swapping up to $m$ samples in total. We make this formal in Definition 1. Very recently, for the reasons outlined above, there has been increasing interest in user-level DP for applications such as estimating discrete distributions under user-level privacy constraints [46], PAC learning with user-level privacy [31], and bounding user contributions in ML models [4, 26]. Differentially private SQL with bounded user contributions was proposed in [59]. User-level privacy has been also studied in the context of learning models via federated learning [49, 48, 58, 6].
|
| 19 |
+
|
| 20 |
+
In this paper, we tackle the problem of learning with user-level privacy in the central model of DP. In particular, we provide algorithms and analyses for the tasks of mean estimation, empirical risk minimization (ERM), stochastic convex optimization (SCO), and learning hypothesis classes with finite metric entropy. Our utility analyses assume that all users draw their samples i.i.d. from related distributions, a setting we refer to as limited heterogeneity. On these tasks, naively applying standard mechanisms, such as Laplace or Gaussian, or using the group property with item-level DP estimators, both yield a privacy error independent of $m$ . We first develop novel private mean estimators in high dimension with statistical and privacy error scaling with the (arbitrary) concentration radius rather than the range, and apply these to the statistical query setting [SQ; 41]. Our algorithms then rely on (privately) answering a sequence of adaptively chosen queries using users’ samples, e.g., gradient queries in stochastic gradient descent algorithms. We show that for these tasks, the additional error√ due to privacy constraints decreases as $\bar { O } ( 1 / \sqrt { m } )$ , contrasting with the naive rate—independent of $m$ . Interestingly, increasing $n$ , the number of users, decreases the privacy cost at a faster $O ( 1 / n )$ rate.
|
| 21 |
+
|
| 22 |
+
Importantly, our results imply concrete practical recommendations on sample collection, regardless of the level of heterogeneity. Indeed, increasing $m$ will yield the most value in the i.i.d. setting and will yield no improvement when the users’ distributions are arbitrary. As the real-world will lie somewhere in between, our results exhibit a regime where, for any heterogeneity, it is strictly better to collect more users (increasing $n$ ) than more samples per user (increasing $m$ ).
|
| 23 |
+
|
| 24 |
+
# 1.1 Our Contributions and Related Work
|
| 25 |
+
|
| 26 |
+
We provide a theoretical tool to construct estimators for tasks with user-level privacy constraints and apply it to a range of learning problems.
|
| 27 |
+
|
| 28 |
+
Optimal private mean estimation and uniformly concentrated queries (Section 3) We show that for a random variable in $[ - B , B ]$ concentrated in an unknown interval of radius $\tau$ (made precise in Definition 2), we can privately estimate its mean with error proportional to $\tau$ rather than $B$ , as we would obtain using standard private mean estimation techniques such as Laplace mechanism [24]. When data is concentrated in $\ell _ { \infty }$ -norm, several papers show that one can achieve an error scaling with $\tau$ rather than $B$ , either asymptotically [53], for Gaussian mean-estimation [40, 38], for sub-Gaussian symmetric distributions [18, 17] or for distributions with bounded $p$ -th moment [39]. We propose a private mean estimator (Algorithm 2) with error scaling with $\tau$ that works in arbitrary dimension when data is concentrated in $\ell _ { 2 }$ -norm (Theorem 2). In Corollary 1, we show it (optimally) solves mean estimation under user-level privacy constraints for random vectors bounded in $\ell _ { 2 }$ -norm. In Appendix D.6, we show that for uniformly concentrated queries (see Definition 3), sequentially applying Algorithm 2 privately answers $K$ adaptively chosen queries with privacy cost $\tilde { O } ( \tau \sqrt { K } / n \varepsilon )$ .
|
| 29 |
+
|
| 30 |
+
Our conclusions relate to the growing literature in adaptive data analysis. While a sequence of work [25, 9, 27, 28] use techniques from differential privacy and their answers are $( \varepsilon , \delta )$ -DP with $\varepsilon = \Theta ( 1 )$ , our work guarantees privacy for arbitrary $\varepsilon$ with the additional assumption of uniform concentration.
|
| 31 |
+
|
| 32 |
+
Empirical risk minimization (Section 4) An influential line of papers studies ERM under itemlevel privacy constraints [19, 42, 8]. Importantly, these papers assume arbitrary data, i.e., not necessarily samples from users’ distributions. The exact analog of ERM in the user-level setting is consequently less interesting as, for $n$ data points $\{ z _ { 1 } , \ldots , z _ { n } \}$ , in the worst case, each user $u \in [ n ]$ contributes $m$ copies of $z _ { u }$ and the problem reduces to the item-level setting. Instead, we consider the (related) problem of ERM when users contribute points sampled i.i.d. Assuming some regularity (A3 and A4), we develop and analyze algorithms for ERM under user-level DP constraints for convex, strongly-convex, and non-convex losses (Theorem 3).
|
| 33 |
+
|
| 34 |
+
Optimal stochastic convex optimization (Section 5) Under item-level DP (or equivalently, userlevel DP with $m = 1$ ), a sequence of work [19, 8, 10, 11, 29] establishes the constrained minimax risk as $\tilde { \Theta } ( 1 / \sqrt { n } + \sqrt { d } / ( n \varepsilon ) )$ . In this paper, with the additional assumptions that the losses are individually smooth2 and the gradients are sub-Gaussian random vectors, we prove matching upper√ (Theorem 4) and lower bounds (Theorem 5) of order $\tilde { \Theta } ( 1 / \sqrt { n m } + \sqrt { d } / ( n \sqrt { m } \varepsilon ) )$ in a regime we make precise. We leave closing the gap outside of this regime to future work.
|
| 35 |
+
|
| 36 |
+
Limit of learning with a fixed number of users (Appendix B) Finally, we resolve a conjecture of [4] and prove that with a fixed number of users, even in the limit $m \infty$ (i.e., each user has an infinite number of samples), we cannot reach zero error. In particular, we prove that for all the learning tasks we consider, the risk under user-level privacy constraints is at least $\Omega ( e ^ { - \varepsilon n } )$ regardless of $m$ . Note that this does not contradict the results above since they require $n = \Omega ( ( \log m ) / \varepsilon )$ .
|
| 37 |
+
|
| 38 |
+
Finally, we provide results in Appendix A for learning under pure user-level DP for function classes with finite metric entropy. We apply these to SCO with $\ell _ { \infty }$ constraints (Remark 1) and achieve (near)-optimal rates.
|
| 39 |
+
|
| 40 |
+
# 2 Preliminaries
|
| 41 |
+
|
| 42 |
+
Notation. Throughout this work, $d$ denotes the dimension, $n$ the number of users, and $m$ the number of samples per user. Generically, $\sigma$ will denote the sub-Gaussian parameter, $\tau$ the concentration radius, $\nu$ the variance of a random vector and $P$ a data distribution. We denote the optimization variable with $\theta \in \Theta \subset \mathbb { R } ^ { d }$ , use $z$ (or $Z$ when random) to denote the data sample supported on a space $\mathcal { Z }$ , and $\ell \colon \Theta \times \mathcal { Z } \mathbb { R }$ for the loss function. Gradients (denoted $\nabla$ ) are always taken with respect to the optimization variable $\theta$ . For a convex set $\mathcal { C }$ , $\Pi _ { \mathcal { C } }$ denotes the euclidean projection on $\mathcal { C }$ , i.e. $\begin{array} { r } { \Pi _ { \mathcal { C } } ( y ) : = \operatorname * { a r g m i n } _ { z \in \mathcal { C } } \| y - z \| _ { 2 } } \end{array}$ . We use $\mathsf { A }$ to refer to (possibly random) private mechanisms and $X ^ { n }$ as a shorthand for the dataset $( X _ { 1 } , \ldots , X _ { n } )$ . For two distributions $P$ and $Q$ , we denote by $\| \boldsymbol { P } - \boldsymbol { Q } \| _ { \mathsf { T V } }$ their total variation distance and $D _ { \mathrm { k l } } \left( P \| Q \right)$ their Kullback-Leibler divergence. For a random vector $X \sim P$ supported on $\mathbb { R } ^ { d }$ , we use $\mathrm { V a r } ( P )$ or $\operatorname { V a r } ( X )$ to denote $\mathbb { E } \left[ \lVert X - \mathbb { E } [ X ] \rVert _ { 2 } ^ { 2 } \right]$ , which is equal to the trace of the covariance matrix of $X$ .
|
| 43 |
+
|
| 44 |
+
Next, we consider differential privacy in the most general way, which only requires specifying a dataset space $\mathbb { S }$ and a distance $\mathrm { d }$ on $\mathbb { S }$ .
|
| 45 |
+
|
| 46 |
+
Definition 1 (Differential Privacy). Let $\varepsilon , \delta \geq 0$ . Let $\ u : \mathbb { S } \to \Theta$ be a (potentially randomized) mechanism. We say that A is $( \varepsilon , \delta )$ - $D P$ with respect to d if for any measurable subset $O \subset \Theta$ and all $S , S ^ { \prime } \in \mathbb { S }$ satisfying $\mathrm { d } ( S , S ^ { \prime } ) \stackrel { \cdot } { = } 1$ ,
|
| 47 |
+
|
| 48 |
+
$$
|
| 49 |
+
\mathbb { P } ( \mathsf { A } ( S ) \in O ) \le e ^ { \varepsilon } \mathbb { P } ( \mathsf { A } ( S ^ { \prime } ) \in O ) + \delta .
|
| 50 |
+
$$
|
| 51 |
+
|
| 52 |
+
$I f \delta = 0$ , we refer to this guarantee as pure differential privacy.
|
| 53 |
+
|
| 54 |
+
For a data space $\mathcal { Z }$ , choosing $\mathbb { S } = \mathcal { Z } ^ { n }$ and $\begin{array} { r } { \mathrm { d } ( S , S ^ { \prime } ) = \mathrm { d } _ { \mathsf { H a m } } ( S , S ^ { \prime } ) = \sum _ { i = 1 } ^ { n } 1 \{ z _ { i } \neq z _ { i } ^ { \prime } \} } \end{array}$ recovers the canonical setting considered in most of the literature—we refer to this as item-level differential privacy. When we wish to guarantee privacy for users rather than individual samples, we instead assume a structured dataset into which each of $n$ users contributes $m > 1$ samples. This corresponds to $\mathbb { S } = ( \mathcal { Z } ^ { m } ) ^ { n }$ such that for ${ \boldsymbol { s } } \in \mathbb { S }$ , we have
|
| 55 |
+
|
| 56 |
+
$$
|
| 57 |
+
{ \mathcal { S } } = ( S _ { 1 } , \ldots , S _ { n } ) , { \mathrm { ~ w h e r e ~ } } S _ { u } = \left\{ z _ { 1 } ^ { ( u ) } , \ldots , z _ { m } ^ { ( u ) } \right\} { \mathrm { ~ a n d ~ } } \mathrm { d } _ { { \mathfrak { u s e r } } } ( S , S ^ { \prime } ) : = \sum _ { u = 1 } ^ { n } 1 \{ S _ { u } \neq S _ { u } ^ { \prime } \} ,
|
| 58 |
+
$$
|
| 59 |
+
|
| 60 |
+
which means that, in this setting, two datasets are neighboring if at most one of the user’s contributions differ. We henceforth refer to this setting as user-level differential privacy.
|
| 61 |
+
|
| 62 |
+
Distributional assumptions. In the case of user-level privacy with $n$ users each providing $m$ samples, we assume existence of a collection of distributions $\{ \bar { P _ { u } } \} _ { u \in [ n ] }$ over $\mathcal { Z }$ . One then observes the following user-level dataset3
|
| 63 |
+
|
| 64 |
+
$$
|
| 65 |
+
{ \mathcal { S } } = ( S _ { 1 } , \ldots , S _ { n } ) { \mathrm { ~ w h e r e ~ } } S _ { u } \stackrel { \mathrm { i i d } } { \sim } P _ { u } .
|
| 66 |
+
$$
|
| 67 |
+
|
| 68 |
+
In this paper, we consider the limited heterogeneity setting, i.e. when the users have related distributions. This setting is more reflective of practice, especially in light of growing interest towards federated learning applications [37, 60].
|
| 69 |
+
|
| 70 |
+
Assumption A1 (Limited heterogeneity setting). There exists a distribution $P _ { 0 }$ over $\mathcal { Z }$ such that all the user distributions are close to $P _ { 0 }$ in total variation distance, i.e.
|
| 71 |
+
|
| 72 |
+
$$
|
| 73 |
+
\operatorname* { m a x } _ { u \in [ n ] } \lVert P _ { u } - P _ { 0 } \rVert \mathrm { { r v } } \leq \Delta ,
|
| 74 |
+
$$
|
| 75 |
+
|
| 76 |
+
where $\Delta \geq 0$ quantifies the level of heterogeneity. Note that $\Delta = 0$ corresponds to assumption $A 2$ .
|
| 77 |
+
|
| 78 |
+
Note that our TV-based definition is natural in this setting as it is closely related to the notion of discrepancy (or $d _ { A }$ distance) which plays a key role in domain adaption scenarios [47, 12]. Lower bound results have been given in terms of the discrepancy measure (see [13]), which further justify the adoption of this definition in the presence of multiple distributions.
|
| 79 |
+
|
| 80 |
+
In the case that $\Delta = 0$ , A1 reduces to the standard homogeneous setting. Many fundamental papers choose this setting when explicating minimax rates under constraints (e.g. in distributed optimization and federated learning [61] or under communication constraints [63, 15]).
|
| 81 |
+
|
| 82 |
+
Assumption A2 (Homogeneous setting). The distributions of individual users are equal, meaning there exists $P _ { 0 }$ such that for all $u \in [ n ]$ , $P _ { u } = P _ { 0 }$ .
|
| 83 |
+
|
| 84 |
+
In this paper, we develop techniques and provide matching upper and lower bounds for solving learning tasks in the homogeneous setting. In Appendix C, we prove that our techniques naturally apply to the heterogeneous setting in a black-box fashion, and for all considered problems provide meaningful guarantees under Assumption A1. Moreover, the algorithm achieves almost optimal rate whenever $\Delta$ is (polynomially) small. See the detailed statement in Theorem 9.
|
| 85 |
+
|
| 86 |
+
# 2.1 ERM and stochastic convex optimization
|
| 87 |
+
|
| 88 |
+
Assumptions on the loss. Throughout this work, we assume that the parameter space $\Theta$ is closed, convex, and satisfies $\lVert { \boldsymbol { \theta } } - { \boldsymbol { \vartheta } } \rVert _ { 2 } \leq R$ for all $\theta , \vartheta \in \Theta$ . We also assume that the loss $\ell \colon \Theta \times \mathcal { Z } \mathbb { R }$ is $G$ -Lipschitz w.r.t. the $\ell _ { 2 } { \mathrm { - n o r m } } ^ { 4 }$ , meaning that for all $z \in { \mathcal { Z } }$ , for all $\theta \in \Theta$ , $\| \nabla \ell ( \theta ; z ) \| _ { 2 } \leq G$ . We further consider the following assumptions.
|
| 89 |
+
|
| 90 |
+
Assumption A3. The function $\ell ( \cdot ; z )$ is $H$ -smooth. In other words, the gradient $\nabla \ell ( \theta ; z )$ is $H$ Lipschitz in the variable $\theta$ for all $z \in { \mathcal { Z } }$ .
|
| 91 |
+
|
| 92 |
+
Assumption A4. The random vector $\nabla \ell ( \theta ; Z )$ is $\sigma ^ { 2 }$ -sub-Gaussian for all $\theta \in \Theta$ and $Z \sim P _ { 0 }$ Equivalently, for all $v \in \mathbb { R } ^ { d }$ , $\langle v , \nabla \ell ( \theta ; Z ) \rangle$ is a $\sigma ^ { 2 }$ -sub-Gaussian random variable, i.e.,
|
| 93 |
+
|
| 94 |
+
$$
|
| 95 |
+
\begin{array} { r } { \mathbb { E } \left[ \exp ( \langle v , \nabla \ell ( \theta ; Z ) - \mathbb { E } [ \nabla \ell ( \theta ; Z ) ] \rangle ) \right] \leq \exp \bigl ( \| v \| _ { 2 } ^ { 2 } \sigma ^ { 2 } / 2 \bigr ) . } \end{array}
|
| 96 |
+
$$
|
| 97 |
+
|
| 98 |
+
In this work, our rates often depend on the sub-Gaussianity and Lipschitz parameters $\sigma$ and $G$ , and thus we define the shorthands ${ \widetilde { G } } : = \sigma { \sqrt { d } }$ and $\underline { { G } } : = \operatorname* { m i n } \{ G , \widetilde { G } \}$ . Intuitively, the $G$ -Lipschitzness assumption bounds the gradient in a ball around 0 (independently of $\theta$ ), while sub-Gaussianity implies that, for each $\theta$ , $\nabla \ell ( \theta ; Z )$ likely lies in $\mathbb { B } _ { 2 } ^ { d } ( \nabla \mathcal { L } ( \theta ; \bar { P } _ { 0 } ) , \widetilde { G } )$ . Generically, there is no ordering between $G$ and $\widetilde { G }$ : for linear loss $\ell ( \theta ; z ) = \langle \theta , z \rangle$ , depending on $P _ { 0 }$ , it can hold that $G \ll \widetilde G$ (e.g., $P _ { 0 } = \mathsf { U n i f } \{ - v , v \}$ for $v \in \mathbb { R } ^ { d }$ ), $\widetilde G \ll G$ (e.g., $P _ { 0 }$ is $\mathsf { N } ( \mu , \sigma ^ { 2 } I _ { d } )$ truncated in a ball around $\mu$ , with $\| \mu \| _ { 2 } \gg \sigma { \sqrt { d } } )$ or $\boldsymbol { G } \approx \boldsymbol { \widetilde { G } }$ (e.g., $P _ { 0 } = \mathsf { U n i f } \{ - 1 , + 1 \} ^ { d } )$ .
|
| 99 |
+
|
| 100 |
+
We introduce the tasks we consider in this work, namely empirical risk minimization (ERM) and stochastic convex optimization (SCO). For a collection of samples from $n$ users $\boldsymbol { S } = ( S _ { 1 } , \ldots , S _ { n } )$ , where each $S _ { u } = \{ z _ { 1 } ^ { ( u ) } , \dots , z _ { m } ^ { ( u ) } \} \in \mathcal { Z } ^ { m }$ , we define the empirical risk objectives
|
| 101 |
+
|
| 102 |
+
$$
|
| 103 |
+
\mathcal { L } ( \boldsymbol { \theta } ; S _ { u } ) : = \frac { 1 } { m } \sum _ { i = 1 } ^ { m } \ell ( \boldsymbol { \theta } ; z _ { i } ^ { ( u ) } ) \ \mathrm { ~ a n d ~ } \ \mathcal { L } ( \boldsymbol { \theta } ; S ) : = \frac { 1 } { n } \sum _ { u = 1 } ^ { n } \mathcal { L } ( \boldsymbol { \theta } ; S _ { u } ) = \frac { 1 } { m n } \sum _ { u = 1 } ^ { n } \sum _ { i = 1 } ^ { m } \ell ( \boldsymbol { \theta } ; z _ { i } ^ { ( u ) } ) .
|
| 104 |
+
$$
|
| 105 |
+
|
| 106 |
+
In the user-level setting we wish to minimize $\textstyle { \mathcal { L } } ( \theta ; S )$ under user-level privacy constraints. Going beyond the empirical risk, we also solve SCO [51], i.e. minimizing a convex population objective
|
| 107 |
+
|
| 108 |
+
when provided with samples from each users’ distributions. In the user-level setting, for a convex loss $\ell$ and a convex constraint set $\Theta$ , we observe $\begin{array} { r } { \pmb { \mathcal { S } } = ( S _ { 1 } , \dots , S _ { n } ) \sim \otimes _ { \pmb { u } \in [ n ] } ( P _ { u } ) ^ { m } } \end{array}$ and wish to
|
| 109 |
+
|
| 110 |
+
$$
|
| 111 |
+
\operatorname* { m i n i m i z e } _ { \theta \in \Theta } \frac { 1 } { n } \sum _ { u \in [ n ] } \mathcal { L } ( \theta ; P _ { u } ) : = \frac { 1 } { n } \sum _ { u \in [ n ] } \mathbb { E } _ { P _ { u } } [ \ell ( \theta ; Z ) ] .
|
| 112 |
+
$$
|
| 113 |
+
|
| 114 |
+
In the homogeneous case (Assumption A2), this reduces to the classic SCO setting:
|
| 115 |
+
|
| 116 |
+
$$
|
| 117 |
+
\operatorname* { m i n i m i z e } _ { \theta \in \Theta } \mathcal { L } ( \theta ; P _ { 0 } ) : = \mathbb { E } _ { P _ { 0 } } [ \ell ( \theta ; Z ) ] .
|
| 118 |
+
$$
|
| 119 |
+
|
| 120 |
+
# 2.2 Uniform concentration of queries
|
| 121 |
+
|
| 122 |
+
Let $\phi : \mathcal { Z } \to \mathbb { R } ^ { d }$ be a $d$ -dimensional query function. We define concentration of random variables and uniform concentration of multiple queries as follows.
|
| 123 |
+
|
| 124 |
+
Definition 2. A (random) sample $X ^ { n }$ supported on $[ - B , B ] ^ { d }$ is $( \tau , \gamma )$ -concentrated (and we call $\tau$ the “concentration radius”) if there exists $x _ { 0 } \in [ - B , B ] ^ { d }$ such that with probability at least $1 - \gamma ,$
|
| 125 |
+
|
| 126 |
+
$$
|
| 127 |
+
\operatorname* { m a x } _ { i \in [ n ] } \lVert X _ { i } - x _ { 0 } \rVert _ { 2 } \leq \tau .
|
| 128 |
+
$$
|
| 129 |
+
|
| 130 |
+
Definition 3 (Uniform concentration of vector queries). Let $\mathcal { Q } _ { B } ^ { d } = \{ \phi \colon \mathcal { Z } [ - B , B ] ^ { d } \}$ be $a$ family of queries with bounded range. For $Z ^ { n } = ( Z _ { 1 } , \ldots , Z _ { n } ) \stackrel { \mathrm { i i d } } { \sim } P$ , we say that $( Z ^ { n } , \mathcal { Q } _ { B } ^ { d } )$ is $( \tau , \gamma )$ -uniformly-concentrated if with probability at least $1 - \gamma$ , we have
|
| 131 |
+
|
| 132 |
+
$$
|
| 133 |
+
\operatorname* { m a x } _ { i \in [ n ] } \operatorname* { s u p } _ { \phi \in \mathcal { Q } _ { B } ^ { d } } \Big \| \phi ( Z _ { i } ) - \mathbb { E } _ { Z \sim P } [ \phi ( Z ) ] \Big \| _ { 2 } \leq \tau .
|
| 134 |
+
$$
|
| 135 |
+
|
| 136 |
+
In this work, we will often consider $\sigma ^ { 2 }$ -sub-Gaussian random variables (or vectors), which are concentrated according to Definition 2. For example, if $X ^ { n }$ is drawn i.i.d. from a $\sigma ^ { 2 }$ -sub-Gaussian random vector supported on $[ - B , B ] ^ { d }$ , then it is $( \sigma \sqrt { d \log ( 2 n / \gamma ) } , \gamma )$ -concentrated around its mean (see, e.g., [56]). Finally, we define a distance between random variables (and estimators).
|
| 137 |
+
|
| 138 |
+
Definition 4 ( $\beta$ -close Random Variables). For any two random variables $X _ { 1 } \sim P _ { 1 }$ and $X _ { 2 } \sim P _ { 2 }$ , we say $X _ { 1 }$ and $X _ { 2 }$ are $\beta$ -close, if $\| P _ { 1 } - P _ { 2 } \| _ { \mathsf { T V } } \leq \bar { \beta }$ . We use the notation $X _ { 1 } \sim _ { \beta } X _ { 2 }$ if $X _ { 1 }$ and $X _ { 2 }$ are $\beta$ -close.
|
| 139 |
+
|
| 140 |
+
$\beta$ -closeness is useful as, in many of our results, the private estimator we propose returns a simple unbiased estimate with high probability and is bounded otherwise. Thus, it suffices to do the analysis in the “nice” case and crudely bound the error otherwise.
|
| 141 |
+
|
| 142 |
+
# 3 High Dimensional Mean Estimation and Uniformly Concentrated Queries
|
| 143 |
+
|
| 144 |
+
In this section, we present a private mean estimator with privacy cost proportional to the concentration radius. Using these techniques, we show that, under uniform concentration, we answer adaptivelychosen queries with privacy cost proportional to the concentration radius instead of the whole range. Our theorems guarantee that the estimator is $\beta$ -close (with $\beta$ exponentially small in $n$ ) to a simple unbiased estimator with small noise. We further show how to directly translate these results into bounds on the estimator error, which we demonstrate by providing tight bounds on estimating the mean of $\ell _ { 2 }$ -bounded random vectors under user-level DP constraints (Corollary 1).
|
| 145 |
+
|
| 146 |
+
Given i.i.d samples $X ^ { n }$ from a distribution $P$ supported on $\mathbb { R } ^ { d }$ with mean $\mu$ , the goal of mean estimation is to design a private estimator that minimizes the $\mathbb { E } \left[ \lVert \mathsf { A } ( X ^ { n } ) - \dot { \mu } \rVert _ { 2 } ^ { 2 } \right]$ . We focus on distributions with bounded supprot $[ - B , B ] ^ { d }$ . However, our algorithm also generalize to the case when the mean is guaranteed to be in $[ - B , B ] ^ { d }$ . In the user-level setting (in the homogeneous case), one observes a dataset $s$ sampled as in (2) and wishes to minimize $\mathbb { E } \bar { [ \| \mathsf { A } ( S ) - \mathbb { E } P _ { 0 } \| \bar { 2 } ] }$ under user-level privacy constraints. We first focus on the scalar case.
|
| 147 |
+
|
| 148 |
+
Mean estimation in one dimension. The algorithm uses a two-stage procedure, similar in spirit to those of [53], [40], and [39]. In the first stage of this procedure, we use the approximate median estimation in [27], detailed in Algorithm 6 in Appendix D.1, to privately estimate a crude interval
|
| 149 |
+
|
| 150 |
+
Require: $X ^ { n } : = ( X _ { 1 } , X _ { 2 } , . . . , X _ { n } ) \in [ - B , B ] ^ { n }$ , τ : concentration radius, privacy parameter $\varepsilon > 0$ . 1: $[ a , b ] = \mathbf { P r i v a t e R a n g e } ( X ^ { n } , \varepsilon / 2 , \tau , B )$ with $| b - a | = 4 \tau$ . {Algorithm 6 in Appendix D.1. $\}$ 2: Sample $\textstyle \xi \sim \mathrm { L a p } { \bigl ( } 0 , { \frac { 8 \tau } { \varepsilon n } } { \bigr ) }$ and return
|
| 151 |
+
|
| 152 |
+
$$
|
| 153 |
+
\bar { \mu } = \frac { 1 } { n } \sum _ { i = 1 } ^ { n } \Pi _ { [ a , b ] } ( X _ { i } ) + \xi ,
|
| 154 |
+
$$
|
| 155 |
+
|
| 156 |
+
where $\Pi _ { [ a , b ] } ( x ) = \operatorname* { m a x } \{ a , \operatorname* { m i n } \{ x , b \} \}$ .
|
| 157 |
+
|
| 158 |
+
in which the means lie, with accuracy $\Theta ( \tau )$ . The second stage clips the mean around this interval, reducing the sensitivity from $O ( B )$ to $O ( \tau )$ , and adds the appropriate Laplace noise. With high probability, we can recover the guarantee of the Laplace mechanism with smaller sensitivity since the samples are concentrated in a radius $\tau$ . We present the formal guarantees of Algorithm 1 in Theorem 1 and defer its proof to Appendix D.2.
|
| 159 |
+
|
| 160 |
+
Theorem 1. Let $X ^ { n }$ be a dataset supported on $[ - B , B ]$ . The output of Algorithm 1, denoted by ${ \mathsf { A } } ( X ^ { n } )$ , is ${ \varepsilon } { - } D P .$ Furthermore, if $X ^ { n }$ is $( \tau , \gamma )$ -concentrated, it holds that
|
| 161 |
+
|
| 162 |
+
$$
|
| 163 |
+
\mathsf { A } ( X ^ { n } ) \sim _ { \beta } \frac { 1 } { n } \sum _ { i = 1 } ^ { n } X _ { i } + L a p \bigg ( \frac { 8 \tau } { n \varepsilon } \bigg ) ,
|
| 164 |
+
$$
|
| 165 |
+
|
| 166 |
+
where $\begin{array} { r } { \beta = \operatorname* { m i n } \left\{ 1 , \gamma + \frac { B } { \tau } \exp \left( - \frac { n \varepsilon } { 8 } \right) \right\} } \end{array}$ . Moreover, Algorithm $I$ runs in time ${ \tilde { O } } ( n + \log ( B / \tau ) )$
|
| 167 |
+
|
| 168 |
+
Compared to [40, 38, 39], our algorithm runs in time ${ \tilde { O } } ( n + \log ( B / \tau ) )$ instead of ${ \tilde { O } } ( n + B / \tau )$ owing to the approximate median estimation algorithm in [27], which is faster when $\tau \ll B$ .
|
| 169 |
+
|
| 170 |
+
Mean estimation in arbitrary dimension. In the general $d$ -dimensional case, if $X ^ { n }$ is concentrated in $\ell _ { \infty }$ -norm, one simply applies Algorithm 1 to each dimension. However, when $X ^ { n }$ is concentrated in $\ell _ { 2 }$ -norm, naively upper bounding $\ell _ { \infty }$ -norm by the $\ell _ { 2 }$ -norm will incur a superfluous $\sqrt { d }$ factor: if $\| v \| _ { 2 } \leq \rho$ , each $| v _ { j } |$ is possibly as large as $\rho$ . To remedy this issue, we use the random rotation trick in [3, 54]. This guarantees that all coordinates have roughly the same range: for √ $v \in \mathbb { R } ^ { d }$ , with high probability, $\| R \dot { v } \| _ { \infty } \leq \tilde { O } ( \| v \| _ { 2 } / \sqrt { d } )$ , where $R$ is the random rotation. We present this procedure in Algorithm 2 and its performance in Theorem 2.
|
| 171 |
+
|
| 172 |
+
Require: $X ^ { n } : = ( X _ { 1 } , X _ { 2 } , . . . , X _ { n } ) , X _ { i } \ \in \ [ - B , B ] ^ { d } , \tau , \gamma$ : concentration radius and probability, privacy parameter $\varepsilon , \delta > 0$ .
|
| 173 |
+
1: Let $D = { \mathsf { D i a g } } ( \omega )$ where $\omega$ is sampled uniformly from $\{ \pm 1 \} ^ { d }$ .
|
| 174 |
+
2: Set $U = d ^ { - 1 / 2 } \mathbf { H } D$ , where $\mathbf { H }$ is a $d$ -dimensional Hadamard matrix. For all $i \in [ n ]$ , compute $Y _ { i } = U X _ { i }$ .
|
| 175 |
+
3: Let $\begin{array} { r } { \varepsilon ^ { \prime } = \frac { \varepsilon } { \sqrt { 8 d \log ( 1 / \delta ) } } , \tau ^ { \prime } = 1 0 \tau \sqrt { \frac { \log ( d n / \gamma ) } { d } } } \end{array}$ log(dn/γ)d . For j ∈ [d], compute $\overset { \sim } { \underset { } { \bar { Y } } } ( j ) = \mathbf { W i n s o r i z e d M e a n 1 D } \Big ( \{ Y _ { i } ( j ) \} _ { i \in [ n ] } , \varepsilon ^ { \prime } , \tau ^ { \prime } , \sqrt { d } B \Big ) .$
|
| 176 |
+
4: return ${ \bar { X } } = U ^ { - 1 } { \bar { Y } }$ .
|
| 177 |
+
|
| 178 |
+
Theorem 2. Let $\mathsf { A } ( X ^ { n } ) = { \mathsf { W i n s o r i z e d M e a n H i g h D } } ( X ^ { n } , \varepsilon , \delta , \tau , B , \gamma )$ be the output of Algorithm 2. $\mathsf { A } ( X ^ { n } )$ is $( \varepsilon , \delta )$ -DP. Furthermore, if $X ^ { n }$ is $( \tau , \gamma )$ -concentrated in $\ell _ { 2 }$ -norm, there exists an estimator $\mathsf { A } ^ { \prime } ( X ^ { n } )$ such that ${ \mathsf { A } } ( X ^ { n } ) \sim _ { \beta } { \mathsf { A } } ^ { \prime } ( { \bar { X } } ^ { n } )$ and
|
| 179 |
+
|
| 180 |
+
$$
|
| 181 |
+
\mathbb { E } [ \mathsf { A } ^ { \prime } ( X ^ { n } ) | X ^ { n } ] = \frac { 1 } { n } \sum _ { i = 1 } ^ { n } X _ { i } a n d \mathrm { ~ } \mathrm { V a r } ( \mathsf { A } ^ { \prime } ( X ^ { n } ) | X ^ { n } ) \leq c _ { 0 } \frac { d \tau ^ { 2 } \log ( d n / \alpha ) \log ( 1 / \delta ) } { n ^ { 2 } \varepsilon ^ { 2 } } ,
|
| 182 |
+
$$
|
| 183 |
+
|
| 184 |
+
We present the proof of Theorem 2 in Appendix D.3. We are able to transfer both Theorem 1 and Theorem 2 into finite-sample estimation error bounds for various types of concentrated distributions and obtain near optimal guarantees (see Appendix D.5 for an example in mean estimation of subGaussian distributions). The next corollary characterizes the risk of mean estimation for distributions supported on an $\ell _ { 2 }$ -bounded domain with user-level DP guarantees (see Appendix D.4 for the proof).
|
| 185 |
+
|
| 186 |
+
Corollary 1. Assume $A 2$ holds with $P _ { 0 }$ supported on $\mathbb { B } _ { 2 } ^ { d } ( 0 , B )$ with mean $\mu$ . Given ${ \boldsymbol { s } } \ =$ $( S _ { 1 } , S _ { 2 } , . . . , S _ { n } )$ , $| S _ { u } | = m$ , consisting of m i.i.d. samples from $P _ { u }$ . There exists an $( \varepsilon , \delta )$ -userlevel $D P$ algorithm $\mathsf { A } ( \boldsymbol { S } )$ such that, if $\dot { n } \geq ( c _ { 1 } \sqrt { d \log ( 1 / \delta ) } / \varepsilon ) \log ( m ( d n + n ^ { 2 } \varepsilon ^ { 2 } ) )$ for a numerical constant c1, we have5
|
| 187 |
+
|
| 188 |
+
$$
|
| 189 |
+
\mathbb { E } \left[ \| \mathsf { A } ( \pmb { \mathscr { S } } ) - \mu \| _ { 2 } ^ { 2 } \right] = \frac { \mathrm { V a r } ( P _ { 0 } ) } { m n } + \tilde { O } \bigg ( \frac { d B ^ { 2 } } { m n ^ { 2 } \varepsilon ^ { 2 } } \bigg ) .
|
| 190 |
+
$$
|
| 191 |
+
|
| 192 |
+
Note that $\mathrm { V a r } ( P _ { 0 } ) \le B ^ { 2 }$ for any $P _ { 0 }$ supported on $\mathbb { B } _ { 2 } ^ { d } ( 0 , B )$ . Replacing ${ \mathrm { V a r } } ( P _ { 0 } )$ by $B ^ { 2 }$ , the bound 2is minimax optimal up to logarithmic factors. When onsame error bounds holds (up to constant) for estimating $A l$ with for a $\Delta \leq \mathsf { p o l y } ( d , \frac { 1 } { n } , \frac { 1 } { m } , \frac { 1 } { \varepsilon } )$ , the $\mathbb { E } _ { Z \sim P _ { u } } [ Z ]$ $u \in [ n ]$
|
| 193 |
+
|
| 194 |
+
Note that algorithms in [38, 39], which focus on estimating the mean of $d$ -dimensional subGaussian distributions, can also be used to estimate the mean of $\ell _ { 2 }$ -bounded distributions since bounded random variables are also subGaussian. However, applying these algorithms directly will incur a superfluous $d$ factor in the mean square error. We void this using the random rotation trick in Algorithm 2.
|
| 195 |
+
|
| 196 |
+
Answering multiple queries. We end this section by noting that, when a family of queries $\mathcal { Q }$ is uniformly concentrated (as made precise in Definition 3), we answer sequences of √ $K d$ -dimensional, adaptively chosen queries with error scaling as ${ \tilde { O } } ( { \sqrt { d K } } \tau / ( n \varepsilon ) )$ by applying Algorithm 2 to $\{ \phi _ { k } ( Z _ { i } ) \} _ { i \in [ n ] }$ with the right $( \varepsilon _ { 0 } , \delta _ { 0 } )$ . We make this formal in Theorem 10 in Appendix D.6.
|
| 197 |
+
|
| 198 |
+
# 4 Empirical Risk Minimization with User-Level Differential Privacy
|
| 199 |
+
|
| 200 |
+
In this section, we present an algorithm to solve the ERM objective of (3) under user-level DP constraints. We apply the results of Section 3 by noting that the SQ framework encompasses stochastic gradient methods. Informally, one can sequentially choose queries $\phi _ { k } ( z ) = \nabla \ell ( \theta _ { k } ; z )$ and, for a stepsize $\eta$ , update $\theta _ { k + 1 } = \Pi _ { \Theta } \big ( \dot { \theta } _ { k } - \eta v _ { k } \big )$ , where $v _ { k }$ is the answer to the $k$ -th query. For the results to hold, we require a uniform concentration result over the appropriate class of queries.
|
| 201 |
+
|
| 202 |
+
Uniform concentration of stochastic gradients The class of queries for stochastic gradient methods is $\mathcal { Q } _ { \sf e r m } ~ : = ~ \{ \nabla \ell ( \theta ; \cdot ) ~ : ~ \theta ~ \in ~ \bar { \Theta } \}$ . We prove that when assumptions A3 and A4 hold, $( \{ \nabla \ell ( \cdot ; S _ { u } ) \} _ { u \in [ n ] } , \mathcal { Q } _ { \mathrm { e r m } } )$ is $( \tilde { O } ( \sigma \sqrt { d / m } ) , \alpha )$ -uniformly concentrated. The next proposition is a simplification of the result of [50] under the (stronger) assumption A3 that $\ell$ is uniformly $H$ -smooth. The proof, which we defer to Appendix E.1, hinges on a covering number argument.
|
| 203 |
+
|
| 204 |
+
Proposition 1 (Concentration of random gradients). Let $S _ { u } \overset { \mathrm { i i d } } { \sim } P _ { u }$ $| S _ { u } | = m$ for $u \in [ n ]$ and $\alpha \geq 0$ $1 - \alpha$
|
| 205 |
+
|
| 206 |
+
$$
|
| 207 |
+
\operatorname* { m a x } _ { u \in [ n ] } \operatorname* { s u p } _ { \theta \in \Theta } \| \nabla \mathcal { L } ( \theta ; S _ { u } ) - \nabla \mathcal { L } ( \theta ; P _ { u } ) \| _ { 2 } = O \left( \sigma \sqrt { \frac { d \log \left( \frac { R H m } { d \sigma } \right) } { m } + \frac { \log \left( \frac { n } { \alpha } \right) } { m } } \right) .
|
| 208 |
+
$$
|
| 209 |
+
|
| 210 |
+
Stochastic gradient methods We state classical convergence results for stochastic gradient methods for both convex and non-convex losses under smoothness. For a function $F : \Theta \to \mathbb { R }$ , we assume access to a first-order stochastic oracle $\mathsf { O } _ { F , \nu ^ { 2 } }$ , i.e., a random mapping such that for all $\theta \in \Theta$ ,
|
| 211 |
+
|
| 212 |
+
$$
|
| 213 |
+
\mathsf { O } _ { F , \nu ^ { 2 } } ( \theta ) = \nabla \widehat { F } ( \theta ) \mathrm { ~ w i t h ~ } \mathbb { E } \Big [ \nabla \widehat { F } ( \theta ) \Big ] = \nabla F ( \theta )
|
| 214 |
+
$$
|
| 215 |
+
|
| 216 |
+
$$
|
| 217 |
+
\operatorname { V a r } \left( \nabla { \widehat { F } } ( \theta ) \right) \leq \nu ^ { 2 } .
|
| 218 |
+
$$
|
| 219 |
+
|
| 220 |
+
We abstract optimization algorithms in the following way: an algorithm consists of an output set $\mathcal { O }$ , a sub-routine $\mathsf { Q u e r y : } \mathcal { O } \to \Theta$ that takes the last output and indicates the next point to query and a sub-routine Update : ${ \mathcal { O } } \times \mathbb { R } ^ { d } \to { \mathcal { O } }$ that takes the previous output and a stochastic gradient and returns the next output. After $T$ steps, we call Aggregate : $O ^ { * } \to \Theta$ , which takes all the previous outputs and returns the final point. (See Algorithm 7 in Appendix E.2 for how to instantiate generic first-order optimization in this framework.) We detail in Proposition 4 in Appendix E.2 standard convergence results for variations of (projected) stochastic gradient descent (SGD). We introduce this abstraction to forego the details of each specific algorithm and instead focus on the privacy and utility guarantees.
|
| 221 |
+
|
| 222 |
+
Algorithm We recall the ERM setting with user-level DP. We observe $\boldsymbol { S } = ( S _ { 1 } , \ldots , S _ { n } )$ with $S _ { u } \in \mathcal { Z } ^ { m }$ for $u \in [ n ]$ and wish to solve the constrained optimization problem with objective in (3). We present our method in Algorithm 3 and provide utility and privacy guarantees in Theorem 3.
|
| 223 |
+
|
| 224 |
+
# Algorithm 3 Winsorized First-Order Optimization
|
| 225 |
+
|
| 226 |
+
1: Input: Number of iterations $T$ , optimization algorithm $\{ \mathcal { O } , \mathsf { Q u e r y }$ , Update, Aggregate}, privacy
|
| 227 |
+
parameters $( \varepsilon , \delta )$ , data $\boldsymbol { S } = ( S _ { 1 } , \ldots , S _ { n } )$ , initial output $o _ { 0 }$ , parameter set $\Theta$ , concentration radius
|
| 228 |
+
2: Set $\tau$ , probability $\begin{array} { r } { \varepsilon ^ { \prime } = \frac { \varepsilon } { 2 \sqrt { 2 T \log ( 2 / \delta ) } } } \end{array}$ $\gamma$ . and $\begin{array} { r } { \delta ^ { \prime } = \frac { \delta } { 2 T } } \end{array}$
|
| 229 |
+
3: for $t = 0 , \ldots , T - 1$ do
|
| 230 |
+
4: $\theta _ { t } \gets \mathsf { Q u e r y } ( o _ { t } )$ .
|
| 231 |
+
5: For each user $u \in [ n ]$ , compute
|
| 232 |
+
6: Compute $\bar { g } _ { t } =$ Winso $\begin{array} { r l r } & { } & { g _ { t } ^ { ( u ) } = \nabla \mathcal { L } ( \theta _ { t } ; S _ { u } ) = \displaystyle \frac { 1 } { m } \sum _ { j \in [ m ] } \nabla \ell ( \theta _ { t } ; z _ { j } ^ { ( u ) } ) . } \\ & { } & { \mathrm { ~ } \mathrm { ~ r i z e d M e a n H i g h } \mathbf { D } ( \{ g _ { t } ^ { ( u ) } \} _ { u \in [ n ] } , \varepsilon ^ { \prime } , \delta ^ { \prime } , \tau , G , \gamma ) . } \end{array}$
|
| 233 |
+
7: $o _ { t + 1 } \gets \mathsf { U p d a t e } ( o _ { t } , \bar { g } _ { t } )$ .
|
| 234 |
+
8: end for
|
| 235 |
+
9: return $\bar { \theta } \gets \mathsf { A g g r e g a t e } ( o _ { 0 } , \ldots , o _ { T } )$ .
|
| 236 |
+
|
| 237 |
+
Theorem 3 (Privacy and utility guarantees for ERM). Assume $A 2$ holds and recall that ${ \widetilde { G } } = \sigma { \sqrt { d } } ,$ , assume6 $n = \tilde { \Omega } ( \sqrt { d T } / \varepsilon )$ and let $\widehat { \theta }$ be the output of Algorithm 3. There exists variants of projected $S G D$ (e.g. the ones we present in Proposition 4) such that, with probability greater than $1 - \gamma$ :
|
| 238 |
+
|
| 239 |
+
(i) If for all $z \in \mathcal { Z } , \ell ( \cdot ; z )$ is convex, then
|
| 240 |
+
|
| 241 |
+
$$
|
| 242 |
+
\mathbb { E } \bigg [ \mathcal { L } ( \widehat { \theta } ; \mathcal { S } ) - \operatorname* { i n f } _ { \theta ^ { \prime } \in \Theta } \mathcal { L } ( \theta ^ { \prime } ; \mathcal { S } ) \bigg | \mathcal { S } \bigg ] = \tilde { O } \Bigg ( \frac { R ^ { 2 } H } { T } + R \widetilde { G } \frac { \sqrt { d } } { n \sqrt { m } \varepsilon } \Bigg ) .
|
| 243 |
+
$$
|
| 244 |
+
|
| 245 |
+
(ii) If for all $z \in \mathcal { Z } , \ell ( \cdot ; z )$ is $\mu$ -strongly-convex, then
|
| 246 |
+
|
| 247 |
+
$$
|
| 248 |
+
\mathbb { E } \bigg [ \mathcal { L } ( \widehat { \theta } ; \mathcal { S } ) - \operatorname* { i n f } _ { \theta ^ { \prime } \in \Theta } \mathcal { L } ( \theta ^ { \prime } ; \mathcal { S } ) \bigg | \mathcal { S } \bigg ] = \widetilde { \mathcal { O } } \bigg ( G R \exp \big ( - \frac { \mu } { H } T \big ) + \widetilde { G } ^ { 2 } \frac { d } { \mu n ^ { 2 } m \varepsilon ^ { 2 } } \bigg ) .
|
| 249 |
+
$$
|
| 250 |
+
|
| 251 |
+
(iii) Otherwise, defining the gradient mapping7 $\begin{array} { r } { { \sf G } _ { F , \gamma } ( \theta ) : = \frac { 1 } { \gamma } [ \theta - \Pi _ { \Theta } ( \theta - \gamma \nabla F ( \theta ) ) ] . } \end{array}$ , we have
|
| 252 |
+
|
| 253 |
+
$$
|
| 254 |
+
\mathbb { E } \bigg [ \| \mathsf { G } _ { \mathcal { L } ( \cdot ; S ) , 1 / H } ( \widehat { \theta } ) \| _ { 2 } ^ { 2 } | S \bigg ] = \tilde { O } \bigg ( \frac { H ^ { 2 } R } { T } + H R \widetilde G \frac { \sqrt { d } } { n \sqrt { m } \varepsilon } \bigg ) .
|
| 255 |
+
$$
|
| 256 |
+
|
| 257 |
+
For $\varepsilon \le 1 , \delta > 0$ , Algorithm $^ 3$ instantiated with any first-order gradient algorithm is $( \varepsilon , \delta )$ -user-level $D P .$ In the case that only $A l$ holds, the same guarantees hold whenever $\Delta \leq \mathsf { p o l y } ( d , \frac { 1 } { n } , \frac { 1 } { m } , \frac { 1 } { \varepsilon } )$ .
|
| 258 |
+
|
| 259 |
+
We present the proof in Appendix E.3. For the utility guarantees, the crux of the proof resides in Theorem 10: as well as ensuring small excess loss in expectation, the SQ algorithm produces with high probability a sample from the stochastic gradient oracle $\operatorname { O } _ { \mathcal { L } ( \cdot ; S ) , \nu ^ { 2 } }$ where $\begin{array} { r } { \nu ^ { 2 } = { \tilde { O } } ( T { \widetilde G } ^ { 2 } \frac { d } { n ^ { 2 } m \varepsilon ^ { 2 } } ) } \end{array}$ When this happens for all $T$ steps, the analysis of stochastic gradient methods provide the desired regret. The privacy guarantees follow from the strong composition theorem of [23].
|
| 260 |
+
|
| 261 |
+
Importantly, when the function exhibits (some) strong-convexity (which will be the case for any regularized objective), we are able to localize the optimal parameter—up to the privacy cost—in ${ \cal \tilde { O } } ( H / \mu )$ steps. This will be particularly important in Section 5.
|
| 262 |
+
|
| 263 |
+
Corollary 2 (Localization). Let $\widehat { \theta }$ be the output of Algorithm $^ 3$ on the ERM problem of (3). Assume that $\ell ( \cdot ; z )$ is $\mu$ -strongly-convex for all $z \in { \mathcal { Z } }$ , that $n = \tilde { \Omega } ( \sqrt { d H / \mu } )$ and set $T =$ $\begin{array} { r } { \frac { H } { \mu } \log \left( n ^ { 2 } m ( \underline { { G } } / \widetilde G ^ { 2 } ) \frac { \mu R \varepsilon ^ { 2 } } { d } \right) } \end{array}$ and $\begin{array} { r } { \gamma = { \frac { \sigma ^ { 2 } d ^ { 2 } } { \mu ^ { 2 } n ^ { 2 } m \varepsilon ^ { 2 } R ^ { 2 } } } } \end{array}$ . For $\theta _ { S } ^ { * } \in \mathrm { a r g m i n } _ { \theta ^ { \prime } \in \Theta } \mathcal { L } ( \theta ^ { \prime } ; S )$ , it holds8
|
| 264 |
+
|
| 265 |
+
$$
|
| 266 |
+
\mathbb { E } [ \| \widehat { \theta } - \theta _ { S } ^ { * } \| _ { 2 } ^ { 2 } ] = \tilde { O } \bigg ( \frac { \sigma ^ { 2 } d ^ { 2 } } { \mu ^ { 2 } n ^ { 2 } m \varepsilon ^ { 2 } } \bigg ) .
|
| 267 |
+
$$
|
| 268 |
+
|
| 269 |
+
# 5 Stochastic Convex Optimization with User-level Privacy
|
| 270 |
+
|
| 271 |
+
In this section we address the SCO task of (5) under user-level DP constraints. Our approach (which we show in Algorithm 4) solves a sequence of carefully regularized ERM problems, drawing on√ the guarantees of the previous section. Recall that $\widetilde { G } = \sigma \sqrt { d }$ and $\underline { { G } } = \operatorname* { m i n } \{ G , \widetilde { G } \}$ , and that $\ell$ is $H$ -smooth under assumption A3. In this section, we assume that $\ell$ is convex. We first present our results and state an upper and lower bound for SCO with user-level privacy constraints.
|
| 272 |
+
|
| 273 |
+
Theorem 4 (Phased ERM for SCO). Algorithm $^ { 4 }$ is user-level $( \varepsilon , \delta )$ -DP. When $A 2$ holds and $n =$ $\tilde { \Omega } ( \operatorname* { m i n } \{ \sqrt [ 3 ] { d ^ { 2 } m H ^ { 2 } R ^ { 2 } / ( G { \underline { { G } } } \varepsilon ^ { 4 } ) } , H R \sqrt { m } / ( \sigma \varepsilon ) \} )$ , or, equivalently, $\begin{array} { r } { H = \tilde { O } ( \sqrt { \frac { n ^ { 2 } \varepsilon ^ { 2 } \sigma ^ { 2 } } { R ^ { 2 } m } + \frac { G \bar { a } ^ { 3 } \varepsilon ^ { 4 } } { d ^ { 2 } R ^ { 2 } m } } ) f o r } \end{array}$ r all $P$ and $\ell$ satisfying Assumptions $A 3$ and A4, we have
|
| 274 |
+
|
| 275 |
+
$$
|
| 276 |
+
\mathbb { E } \left[ \mathcal { L } \big ( \mathsf { A } _ { \mathsf { P h a s e d E R M } } ( S ) ; P _ { 0 } \big ) \right] - \operatorname* { m i n } _ { \theta ^ { \prime } \in \Theta } \mathcal { L } ( \theta ^ { \prime } ; P _ { 0 } ) = \tilde { O } \left( \frac { R \sqrt { G G } } { \sqrt { m n } } + R \widetilde G \frac { \sqrt { d } } { n \sqrt { m } \varepsilon } \right) .
|
| 277 |
+
$$
|
| 278 |
+
|
| 279 |
+
Furthermore, our results still hold in the heterogeneous setting (Assumption $A I$ ) whenever $\Delta \le$ $\mathtt { p o l y } ( d , \frac { 1 } { n } , \frac { 1 } { m } , \frac { 1 } { \varepsilon } )$ ; the risk guarantee being with respect to any user distribution $P _ { u }$ .
|
| 280 |
+
|
| 281 |
+
Theorem 5 (Lower bound for SCO). There exists a distribution $P$ and a loss $\ell$ satisfying Assumptions $A 3$ and A4 such that for any algorithm A satisfying $( \varepsilon , \delta )$ -DP at user-level, we have
|
| 282 |
+
|
| 283 |
+
$$
|
| 284 |
+
\mathbb { E } \left[ \mathcal { L } ( \mathsf { A } ( \mathcal { S } ) ; P ) \right] - \operatorname* { m i n } _ { \theta ^ { \prime } \in \Theta } \mathcal { L } ( \theta ^ { \prime } ; P ) = \Omega \Bigg ( \frac { R G } { \sqrt { m n } } + R \underline { { G } } \frac { \sqrt { d } } { n \sqrt { m } \varepsilon } \Bigg ) .
|
| 285 |
+
$$
|
| 286 |
+
|
| 287 |
+
When $G = \Theta ( \sigma { \sqrt { d } } )$ , the upper bound matches the lower bound up to logarithmic factors. We present the algorithm and proof for Theorem 4 in Section 5.1. Theorem 5 is proved in Section 5.2.
|
| 288 |
+
|
| 289 |
+
# 5.1 Upper bound: minimizing a sequence of regularized ERM problems
|
| 290 |
+
|
| 291 |
+
We now present Algorithm 4, which achieves the upper bound of Theorem 4. It is similar in spirit to Phased ERM [29] and EpochGD [34], in that at each round we minimize a regularized ERM problem with fresh samples and increased regularization, initializing each round from the final iterate of the previous round. This allows us to localize the optimum with exponentially increasing accuracy without blowing up our privacy budget. We solve each round using Algorithm 3 to guarantee privacy and obtain an approximate minimizer. We show the guarantee in Corollary 2 is enough to achieve optimal rates. We provide the proof of Theorem 4 in Appendix $\mathrm { F }$ and present a sketch here.
|
| 292 |
+
|
| 293 |
+
Algorithm 4 APhasedERM: Phased ERM
|
| 294 |
+
|
| 295 |
+
<table><tr><td>parameterσ.</td><td>Require: Private dataset: S = (S1,...,Sn) ∈ (Zm)n : n × m i.i.d samples from P,H-smooth, convex loss function l,convex set Θ C Rd, privacy parameters ε ≤ 1,δ ≤1/n²,sub-Gaussian</td><td></td><td></td><td></td></tr><tr><td>1: SetT=[log2(</td><td>(Gn√mε)1,入=√ GG gd nm</td><td>/R</td><td></td><td></td></tr><tr><td>2:</td><td>fort=1toTdo</td><td>n²mε²</td><td></td><td></td></tr><tr><td>3: 4:</td><td>Setnt =,,xt =4t入</td><td></td><td></td><td></td></tr><tr><td></td><td> Sample St, nt users that have not participated in previous rounds. Using Algorithm 3,compute</td><td></td><td></td><td></td></tr><tr><td></td><td>an approximate minimizer 0t, to the accuracy of Corollary 2, for the objective</td><td>m</td><td></td><td></td></tr><tr><td></td><td>Lλt,t_(0;St)=</td><td>1 MM e(0,z</td><td>t 11-0t-12.</td><td></td></tr><tr><td></td><td></td><td>mnt</td><td>(u) 十 2</td><td></td></tr><tr><td>5: end for</td><td></td><td>uESt j=1</td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr><tr><td>6:return</td><td>T</td><td></td><td></td><td></td></tr></table>
|
| 296 |
+
|
| 297 |
+
Proof sketch of Theorem 4. The privacy guarantee comes directly from the privacy guarantee of Algorithm 3 and the fact that $S _ { t }$ are non-overlapping. The proof for utility is similar to the proof of Theorem 4.8 in [29]. In round $t$ of Algorithm 4, we consider the true minimizer $\theta _ { t } ^ { * }$ and the approximate minimizer $\widehat { \theta } _ { t }$ . By stability [14], we can bound the generalization error of $\theta _ { t } ^ { * }$ (see Proposition 5 in Appendix F) and, by Corollary 2, we can bound $\widehat { \mathbb { E } } \| \widehat { \theta } _ { t } - \theta _ { t } ^ { * } \| _ { 2 } ^ { 2 }$ . We finally choose $\{ ( \lambda _ { t } , n _ { t } ) \} _ { t \le T }$ such that the assumptions of Corollary 2 hold and to minimize the final error. □
|
| 298 |
+
|
| 299 |
+
# 5.2 Lower bound: SCO is harder than Gaussian mean estimation
|
| 300 |
+
|
| 301 |
+
First of all, note that it suffices to prove the lower bounds in the homogeneous setting as any level of heterogeneity only makes the problem harder. Theorem 5 holds for $( \varepsilon , \delta )$ -user-level DP—importantly, this is a setting for which lower bounds are generally more challenging (we provide a related lower bound for $\varepsilon$ -user-level DP in Appendix A.2). We present the proof in Appendix F.2 and a sketch here.
|
| 302 |
+
|
| 303 |
+
Proof sketch of Theorem 5. The (constrained) minimax lower bound decomposes into a statistical rate and a privacy rate. The statistical rate is optimal (see, e.g., [44, 2]), thus we focus on the privacy rate. We consider linear losses of the form $\ell ( \theta ; z ) = - \langle \theta , z \rangle$ . We show that optimizing $\mathsf { \bar { L } } ( \theta ; \dot { P } ) = \mathbb { E } _ { P } [ \ell ( \theta ; Z ) ]$ over $\theta \in \Theta$ is harder than the mean estimation task for $P$ . Intuitively, $C ( \theta ; P ) = - \langle \theta , \mathbb { E } Z \rangle$ attains its minimum at $\theta ^ { * } = R \mathbb { E } [ Z ] / \| \mathbb { E } [ Z ] \| _ { 2 }$ and finding $\theta ^ { * }$ provides a good estimate of (the direction of) $\mathbb { E } [ Z ]$ . We make this formal in Proposition 6. Next, for Gaussian mean estimation, we reduce, in Proposition 3, user-level DP to item-level DP with lower variance by having each user contribute their sample average (which is a sufficient statistic). We conclude with the results of [38] (see Proposition 7) by proving in Corollary 6 that estimating the direction of the mean with item-level privacy is hard. □
|
| 304 |
+
|
| 305 |
+
# Acknowledgments
|
| 306 |
+
|
| 307 |
+
The authors would like to thank Hilal Asi and Karan Chadha for comments on an earlier draft as well as Yair Carmon, Peter Kairouz, Gautam Kamath, Sai Praneeth Karimireddy, Thomas Steinke and Sebastian Stich, for useful discussions and pointers to very relevant references.
|
| 308 |
+
|
| 309 |
+
# References
|
| 310 |
+
|
| 311 |
+
[1] J. Acharya, Z. Sun, and H. Zhang. Differentially private Assouad, Fano, and Le Cam. In V. Feldman, K. Ligett, and S. Sabato, editors, Proceedings of the 32nd International Conference on Algorithmic Learning Theory, pages 48–78. PMLR, 16–19 Mar 2021. URL https:// proceedings.mlr.press/v132/acharya21a.html.
|
| 312 |
+
[2] A. Agarwal, P. L. Bartlett, P. Ravikumar, and M. J. Wainwright. Information-theoretic lower bounds on the oracle complexity of convex optimization. IEEE Transactions on Information Theory, 58(5):3235–3249, 2012.
|
| 313 |
+
[3] N. Ailon and B. Chazelle. Approximate nearest neighbors and the fast johnson-lindenstrauss transform. In Proceedings of the thirty-eighth annual ACM symposium on Theory of computing, pages 557–563, 2006.
|
| 314 |
+
[4] K. Amin, A. Kulesza, A. Munoz, and S. Vassilvtiskii. Bounding user contributions: A biasvariance trade-off in differential privacy. In International Conference on Machine Learning, pages 263–271, 2019.
|
| 315 |
+
[5] Apple Privacy Team. Learning with privacy at scale, 2017. Available at https: //machinelearning.apple.com/2017/12/06/learning-with-privacy-at-scale. html.
|
| 316 |
+
[6] S. Augenstein, H. B. McMahan, D. Ramage, S. Ramaswamy, P. Kairouz, M. Chen, R. Mathews, and B. A. y Arcas. Generative models for effective ml on private, decentralized datasets. In International Conference on Learning Representations, 2019.
|
| 317 |
+
[7] R. F. Barber and J. C. Duchi. Privacy and statistical risk: Formalisms and minimax bounds. arXiv:1412.4451 [math.ST], 2014.
|
| 318 |
+
[8] R. Bassily, A. Smith, and A. Thakurta. Private empirical risk minimization: Efficient algorithms and tight error bounds. In 2014 IEEE 55th Annual Symposium on Foundations of Computer Science, pages 464–473. IEEE, 2014.
|
| 319 |
+
[9] R. Bassily, K. Nissim, A. Smith, T. Steinke, U. Stemmer, and J. Ullman. Algorithmic stability for adaptive data analysis. In Proceedings of the forty-eighth annual ACM symposium on Theory of Computing, pages 1046–1059, 2016.
|
| 320 |
+
[10] R. Bassily, V. Feldman, K. Talwar, and A. G. Thakurta. Private stochastic convex optimization with optimal rates. In Advances in Neural Information Processing Systems, pages 11279–11288, 2019.
|
| 321 |
+
[11] R. Bassily, V. Feldman, C. Guzman, and K. Talwar. Stability of stochastic gradient descent on ´ nonsmooth convex losses. In H. Larochelle, M. Ranzato, R. Hadsell, M. F. Balcan, and H. Lin, editors, Advances in Neural Information Processing Systems, volume 33, pages 4381–4391. Curran Associates, Inc., 2020. URL https://proceedings.neurips.cc/paper/2020/ file/2e2c4bf7ceaa4712a72dd5ee136dc9a8-Paper.pdf.
|
| 322 |
+
[12] S. Ben-David, J. Blitzer, K. Crammer, and F. Pereira. Analysis of representations for domain adaptation. Advances in Neural Information Processing Systems 20, 2007.
|
| 323 |
+
[13] S. Ben-David, T. Lu, T. Luu, and D. Pal. Impossibility theorems for domain adaptation. In ´ Proceedings of the 13th International Conference on Artificial Intelligence and Statistics, pages 129–136, 2010.
|
| 324 |
+
[14] O. Bousquet and A. Elisseeff. Stability and generalization. Journal of machine learning research, 2(Mar):499–526, 2002.
|
| 325 |
+
[15] M. Braverman, A. Garg, T. Ma, H. L. Nguyen, and D. P. Woodruff. Communication lower bounds for statistical estimation problems via a distributed data processing inequality. In Proceedings of the Forty-Eigth Annual ACM Symposium on the Theory of Computing, 2016. URL https://arxiv.org/abs/1506.07216.
|
| 326 |
+
[16] S. Bubeck. Convex optimization: Algorithms and complexity. arXiv preprint arXiv:1405.4980, 2014.
|
| 327 |
+
[17] M. Bun and T. Steinke. Average-case averages: Private algorithms for smooth sensitivity and mean estimation. In Advances in Neural Information Processing Systems, pages 181–191, 2019.
|
| 328 |
+
[18] T. T. Cai, Y. Wang, and L. Zhang. The cost of privacy: Optimal rates of convergence for parameter estimation with differential privacy. arXiv preprint arXiv:1902.04495, 2019.
|
| 329 |
+
[19] K. Chaudhuri, C. Monteleoni, and A. D. Sarwate. Differentially private empirical risk minimization. Journal of Machine Learning Research, 12(Mar):1069–1109, 2011.
|
| 330 |
+
[20] D. Davis and D. Drusvyatskiy. Stochastic model-based minimization of weakly convex functions. SIAM Journal on Optimization, 29(1):207–239, 2019.
|
| 331 |
+
[21] B. Ding, J. Kulkarni, and S. Yekhanin. Collecting telemetry data privately. 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, pages 3571–3580, 2017.
|
| 332 |
+
[22] C. Dwork, F. McSherry, K. Nissim, and A. Smith. Calibrating noise to sensitivity in private data analysis. In Proceedings of the Third Theory of Cryptography Conference, pages 265–284, 2006.
|
| 333 |
+
[23] C. Dwork, G. N. Rothblum, and S. Vadhan. Boosting and differential privacy. In 2010 IEEE 51st Annual Symposium on Foundations of Computer Science, pages 51–60. IEEE, 2010.
|
| 334 |
+
[24] C. Dwork, A. Roth, et al. The algorithmic foundations of differential privacy. 2014.
|
| 335 |
+
[25] C. Dwork, V. Feldman, M. Hardt, T. Pitassi, O. Reingold, and A. L. Roth. Preserving statistical validity in adaptive data analysis. In Proceedings of the forty-seventh annual ACM symposium on Theory of computing, pages 117–126, 2015.
|
| 336 |
+
[26] A. Epasto, M. Mahdian, J. Mao, V. Mirrokni, and L. Ren. Smoothly bounding user contributions in differential privacy. In H. Larochelle, M. Ranzato, R. Hadsell, M. F. Balcan, and H. Lin, editors, Advances in Neural Information Processing Systems, volume 33, pages 13999–14010. Curran Associates, Inc., 2020. URL https://proceedings.neurips.cc/paper/2020/ file/a0dc078ca0d99b5ebb465a9f1cad54ba-Paper.pdf.
|
| 337 |
+
[27] V. Feldman and T. Steinke. Generalization for adaptively-chosen estimators via stable median. In S. Kale and O. Shamir, editors, ICML, volume 65 of Proceedings of Machine Learning Research, pages 728–757, Amsterdam, Netherlands, 07–10 Jul 2017. PMLR.
|
| 338 |
+
[28] V. Feldman and T. Steinke. Calibrating noise to variance in adaptive data analysis. In Conference On Learning Theory, pages 535–544. PMLR, 2018.
|
| 339 |
+
[29] V. Feldman, T. Koren, and K. Talwar. Private stochastic convex optimization: optimal rates in linear time. In Proceedings of the 52nd Annual ACM SIGACT Symposium on Theory of Computing, pages 439–449, 2020.
|
| 340 |
+
[30] M. Fredrikson, S. Jha, and T. Ristenpart. Model inversion attacks that exploit confidence information and basic countermeasures. In Proceedings of the 22nd ACM SIGSAC Conference on Computer and Communications Security, pages 1322–1333, New York, NY, USA, 2015. ACM. doi: 10.1145/2810103.2813677. URL http://doi.acm.org/10.1145/2810103.2813677.
|
| 341 |
+
[31] B. Ghazi, R. Kumar, and P. Manurangsi. User-level private learning via correlated sampling. arXiv preprint arXiv:2110.11208, 2021.
|
| 342 |
+
[32] Google. Enabling developers and organizations to use differential privacy, 2019. Available at https://developers.googleblog.com/2019/09/ enabling-developers-and-organizations.html.
|
| 343 |
+
[33] C. Guzman and A. Nemirovski. On lower complexity bounds for large-scale smooth convex ´ optimization. Journal of Complexity, 31(1):1–14, 2015.
|
| 344 |
+
[34] E. Hazan and S. Kale. Beyond the regret minimization barrier: an optimal algorithm for stochastic strongly-convex optimization. In Proceedings of the 24th Annual Conference on Learning Theory, pages 421–436, 2011.
|
| 345 |
+
[35] N. Homer, S. Szelinger, M. Redman, D. Duggan, W. Tembe, J. Muehling, J. V. Pearson, D. A. Stephan, S. F. Nelson, and D. W. Craig. Resolving individuals contributing trace amounts of DNA to highly complex mixtures using high-density SNP genotyping microarrays. PLoS Genetics, 4(8):e1000167, 2008.
|
| 346 |
+
[36] C. Jin, P. Netrapalli, R. Ge, S. M. Kakade, and M. I. Jordan. A short note on concentration inequalities for random vectors with subgaussian norm. arXiv:1902.03736 [math.PR], 2019.
|
| 347 |
+
[37] P. Kairouz, H. B. McMahan, B. Avent, A. Bellet, M. Bennis, A. N. Bhagoji, K. Bonawitz, Z. Charles, G. Cormode, R. Cummings, et al. Advances and open problems in federated learning. Foundations and Trends® in Machine Learning, 14(1–2):1–210, 2021. ISSN 1935-8237. doi: 10.1561/2200000083. URL http://dx.doi.org/10.1561/2200000083.
|
| 348 |
+
[38] G. Kamath, J. Li, V. Singhal, and J. Ullman. Privately learning high-dimensional distributions. In Conference on Learning Theory, pages 1853–1902. PMLR, 2019.
|
| 349 |
+
[39] G. Kamath, V. Singhal, and J. Ullman. Private mean estimation of heavy-tailed distributions. In J. Abernethy and S. Agarwal, editors, Proceedings of Thirty Third Conference on Learning Theory, volume 125 of Proceedings of Machine Learning Research, pages 2204–2235. PMLR, 09–12 Jul 2020.
|
| 350 |
+
[40] V. Karwa and S. Vadhan. Finite sample differentially private confidence intervals. 9th Innovations in Theoretical Computer Science Conference (ITCS 2018), 2018.
|
| 351 |
+
[41] M. Kearns. Efficient noise-tolerant learning from statistical queries. Journal of the Association for Computing Machinery, 45(6):983–1006, 1998.
|
| 352 |
+
[42] D. Kifer, A. Smith, and A. Thakurta. Private convex empirical risk minimization and highdimensional regression. In Conference on Learning Theory, pages 25–1. JMLR Workshop and Conference Proceedings, 2012.
|
| 353 |
+
[43] A. Kulunchakov and J. Mairal. Estimate sequences for stochastic composite optimization: Variance reduction, acceleration, and robustness to noise. Journal of Machine Learning Research, 21(155):1–52, 2020.
|
| 354 |
+
[44] D. Levy and J. C. Duchi. Necessary and sufficient geometries for gradient methods. In Advances in Neural Information Processing Systems 32, 2019. URL https://arxiv.org/abs/1909. 10455.
|
| 355 |
+
[45] J. Liu and K. Talwar. Private selection from private candidates. In Proceedings of the 51st Annual ACM SIGACT Symposium on Theory of Computing, pages 298–309, 2019.
|
| 356 |
+
[46] Y. Liu, A. Theertha Suresh, F. Yu, S. Kumar, and M. Riley. Learning discrete distributions: user vs item-level privacy. In Advances in Neural Information Processing Systems, 2020.
|
| 357 |
+
[47] Y. Mansour, M. Mohri, and A. Rostamizadeh. Domain adaptation: Learning bounds and algorithms. In Proceedings of the Twenty Second Annual Conference on Computational Learning Theory, 2009.
|
| 358 |
+
[48] H. B. McMahan, G. Andrew, U. Erlingsson, S. Chien, I. Mironov, N. Papernot, and P. Kairouz. A general approach to adding differential privacy to iterative training procedures. arXiv preprint arXiv:1812.06210, 2018.
|
| 359 |
+
[49] H. B. McMahan, D. Ramage, K. Talwar, and L. Zhang. Learning differentially private recurrent language models. In International Conference on Learning Representations, 2018.
|
| 360 |
+
[50] S. Mei, Y. Bai, A. Montanari, et al. The landscape of empirical risk for nonconvex losses. The Annals of Statistics, 46(6A):2747–2774, 2018.
|
| 361 |
+
[51] S. Shalev-Shwartz, O. Shamir, N. Srebro, and K. Sridharan. Stochastic convex optimization. In Conference on Learning Theory, 2009.
|
| 362 |
+
[52] R. Shokri and V. Shmatikov. Privacy-preserving deep learning. In Proceedings of the 22nd ACM SIGSAC Conference on Computer and Communications Security, pages 1310–1321, 2015.
|
| 363 |
+
[53] A. Smith. Privacy-preserving statistical estimation with optimal convergence rates. In Proceedings of the forty-third annual ACM symposium on Theory of computing, pages 813–822, 2011.
|
| 364 |
+
[54] A. T. Suresh, F. X. Yu, S. Kumar, and H. B. McMahan. Distributed mean estimation with limited communication. In D. Precup and Y. W. Teh, editors, Proceedings of the 34th International Conference on Machine Learning, volume 70 of Proceedings of Machine Learning Research, pages 3329–3337, International Convention Centre, Sydney, Australia, 06–11 Aug 2017. PMLR.
|
| 365 |
+
[55] United States Census Bureau. Statistical safeguards, 2018. Available at https://www.census. gov/about/policies/privacy/statistical_safeguards.html.
|
| 366 |
+
[56] R. Vershynin. High Dimensional Probability: An Introduction with Applications in Data Science. Cambridge University Press, 2019.
|
| 367 |
+
[57] M. J. Wainwright. High-Dimensional Statistics: A Non-Asymptotic Viewpoint. Cambridge University Press, 2019.
|
| 368 |
+
[58] Z. Wang, M. Song, Z. Zhang, Y. Song, Q. Wang, and H. Qi. Beyond inferring class representatives: User-level privacy leakage from federated learning. In IEEE INFOCOM 2019-IEEE Conference on Computer Communications, pages 2512–2520. IEEE, 2019.
|
| 369 |
+
[59] R. J. Wilson, C. Y. Zhang, W. Lam, D. Desfontaines, D. Simmons-Marengo, and B. Gipson. Differentially private SQL with bounded user contribution. Proceedings on Privacy Enhancing Technologies, 2:230–250, 2020.
|
| 370 |
+
[60] B. Woodworth, K. K. Patel, and N. Srebro. Minibatch vs local SGD for heterogeneous distributed learning. In Proceedings of the 37th International Conference on Machine Learning, 2020.
|
| 371 |
+
[61] B. E. Woodworth, J. Wang, A. Smith, B. McMahan, and N. Srebro. Graph oracle models, lower bounds, and gaps for parallel stochastic optimization. In Advances in Neural Information Processing Systems 31, 2018.
|
| 372 |
+
[62] B. Yu. Assouad, Fano, and Le Cam. In Festschrift for Lucien Le Cam, pages 423–435. Springer-Verlag, 1997.
|
| 373 |
+
|
| 374 |
+
[63] Y. Zhang, J. Duchi, M. I. Jordan, and M. J. Wainwright. Information-theoretic lower bounds for distributed statistical estimation with communication constraints. In C. J. C. Burges, L. Bottou, M. Welling, Z. Ghahramani, and K. Q. Weinberger, editors, Advances in Neural Information Processing Systems, volume 26. Curran Associates, Inc., 2013. URL https://proceedings. neurips.cc/paper/2013/file/d6ef5f7fa914c19931a55bb262ec879c-Paper.pdf.
|
md/train/Gl8FHfMVTZu/Gl8FHfMVTZu.md
ADDED
|
@@ -0,0 +1,235 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Do Vision Transformers See Like Convolutional Neural Networks?
|
| 2 |
+
|
| 3 |
+
Maithra Raghu Google Research, Brain Team maithrar@gmail.com
|
| 4 |
+
|
| 5 |
+
Thomas Unterthiner Google Research, Brain Team unterthiner@google.com
|
| 6 |
+
|
| 7 |
+
Simon Kornblith Google Research, Brain Team kornblith@google.com
|
| 8 |
+
|
| 9 |
+
Chiyuan Zhang Google Research, Brain Team chiyuan@google.com
|
| 10 |
+
|
| 11 |
+
Alexey Dosovitskiy Google Research, Brain Team adosovitskiy@google.com
|
| 12 |
+
|
| 13 |
+
# Abstract
|
| 14 |
+
|
| 15 |
+
Convolutional neural networks (CNNs) have so far been the de-facto model for visual data. Recent work has shown that (Vision) Transformer models (ViT) can achieve comparable or even superior performance on image classification tasks. This raises a central question: how are Vision Transformers solving these tasks? Are they acting like convolutional networks, or learning entirely different visual representations? Analyzing the internal representation structure of ViTs and CNNs on image classification benchmarks, we find striking differences between the two architectures, such as ViT having more uniform representations across all layers. We explore how these differences arise, finding crucial roles played by self-attention, which enables early aggregation of global information, and ViT residual connections, which strongly propagate features from lower to higher layers. We study the ramifications for spatial localization, demonstrating ViTs successfully preserve input spatial information, with noticeable effects from different classification methods. Finally, we study the effect of (pretraining) dataset scale on intermediate features and transfer learning, and conclude with a discussion on connections to new architectures such as the MLP-Mixer.
|
| 16 |
+
|
| 17 |
+
# 1 Introduction
|
| 18 |
+
|
| 19 |
+
Over the past several years, the successes of deep learning on visual tasks has critically relied on convolutional neural networks [20, 16]. This is largely due to the powerful inductive bias of spatial equivariance encoded by convolutional layers, which have been key to learning general purpose visual representations for easy transfer and strong performance. Remarkably however, recent work has demonstrated that Transformer neural networks are capable of equal or superior performance on image classification tasks at large scale [14]. These Vision Transformers (ViT) operate almost identically to Transformers used in language [13], using self-attention, rather than convolution, to aggregate information across locations. This is in contrast with a large body of prior work, which has focused on more explicitly incorporating image-specific inductive biases [30, 9, 4]
|
| 20 |
+
|
| 21 |
+
This breakthrough highlights a fundamental question: how are Vision Transformers solving these image based tasks? Do they act like convolutions, learning the same inductive biases from scratch? Or are they developing novel task representations? What is the role of scale in learning these representations? And are there ramifications for downstream tasks? In this paper, we study these questions, uncovering key representational differences between ViTs and CNNs, the ways in which these difference arise, and effects on classification and transfer learning. Specifically, our contributions are:
|
| 22 |
+
|
| 23 |
+
35th Conference on Neural Information Processing Systems (NeurIPS 2021).
|
| 24 |
+
|
| 25 |
+
• We investigate the internal representation structure of ViTs and CNNs, finding striking differences between the two models, such as ViT having more uniform representations, with greater similarity between lower and higher layers.
|
| 26 |
+
• Analyzing how local/global spatial information is utilised, we find ViT incorporates more global information than ResNet at lower layers, leading to quantitatively different features.
|
| 27 |
+
• Nevertheless, we find that incorporating local information at lower layers remains vital, with large-scale pre-training data helping early attention layers learn to do this
|
| 28 |
+
• We study the uniform internal structure of ViT, finding that skip connections in ViT are even more influential than in ResNets, having strong effects on performance and representation similarity.
|
| 29 |
+
• Motivated by potential future uses in object detection, we examine how well input spatial information is preserved, finding connections between spatial localization and methods of classification.
|
| 30 |
+
• We study the effects of dataset scale on transfer learning, with a linear probes study revealing its importance for high quality intermediate representations.
|
| 31 |
+
|
| 32 |
+
# 2 Related Work
|
| 33 |
+
|
| 34 |
+
Developing non-convolutional neural networks to tackle computer vision tasks, particularly Transformer neural networks [44] has been an active area of research. Prior works have looked at local multiheaded self-attention, drawing from the structure of convolutional receptive fields [30, 36], directly combining CNNs with self-attention [4, 2, 46] or applying Transformers to smaller-size images [6, 9]. In comparison to these, the Vision Transformer [14] performs even less modification to the Transformer architecture, making it especially interesting to compare to CNNs. Since its development, there has also been very recent work analyzing aspects of ViT, particularly robustness [3, 31, 28] and effects of self-supervision [5, 7]. Other recent related work has looked at designing hybrid ViT-CNN models [49, 11], drawing on structural differences between the models. Comparison between Transformers and CNNs are also recently studied in the text domain [41].
|
| 35 |
+
|
| 36 |
+
Our work focuses on the representational structure of ViTs. To study ViT representations, we draw on techniques from neural network representation similarity, which allow the quantitative comparisons of representations within and across neural networks [17, 34, 26, 19]. These techniques have been very successful in providing insights on properties of different vision architectures [29, 22, 18], representation structure in language models [48, 25, 47, 21], dynamics of training methods [33, 24] and domain specific model behavior [27, 35, 38]. We also apply linear probes in our study, which has been shown to be useful to analyze the learned representations in both vision [1] and text [8, 32, 45] models.
|
| 37 |
+
|
| 38 |
+
# 3 Background and Experimental Setup
|
| 39 |
+
|
| 40 |
+
Our goal is to understand whether there are differences in the way ViTs represent and solve image tasks compared to CNNs. Based on the results of Dosovitskiy et al. [14], we take a representative set of CNN and ViT models — ResNet50x1, ResNet152x2, ViT-B/32, ViT-B/16, ViT-L/16 and ViT-H/14. Unless otherwise specified, models are trained on the JFT-300M dataset [40], although we also investigate models trained on the ImageNet ILSVRC 2012 dataset [12, 37] and standard transfer learning benchmarks [50, 14]. We use a variety of analysis methods to study the layer representations of these models, gaining many insights into how these models function. We provide further details of the experimental setting in Appendix A.
|
| 41 |
+
|
| 42 |
+
Representation Similarity and CKA (Centered Kernel Alignment): Analyzing (hidden) layer representations of neural networks is challenging because their features are distributed across a large number of neurons. This distributed aspect also makes it difficult to meaningfully compare representations across neural networks. Centered kernel alignment (CKA) [17, 10] addresses these challenges, enabling quantitative comparisons of representations within and across networks. Specifically, CKA takes as input $\mathbf { X } \in \mathbb { R } ^ { m \times p _ { 1 } }$ and $\mathbf { Y } \in \mathbb { R } ^ { \bar { m } \times p _ { 2 } }$ which are representations (activation matrices), of two layers, with $p _ { 1 }$ and $p _ { 2 }$ neurons respectively, evaluated on the same $m$ examples. Letting $K = X X ^ { \top }$ and $\pmb { L } = \pmb { Y } \pmb { Y } ^ { \top }$ denote the Gram matrices for the two layers (which measures the similarity of a pair of datapoints according to layer representations) CKA computes:
|
| 43 |
+
|
| 44 |
+
$$
|
| 45 |
+
\operatorname { C K A } ( K , L ) = { \frac { \operatorname { H S I C } ( K , L ) } { \sqrt { \operatorname { H S I C } ( K , K ) \operatorname { H S I C } ( L , L ) } } } ,
|
| 46 |
+
$$
|
| 47 |
+
|
| 48 |
+

|
| 49 |
+
Figure 1: Representation structure of ViTs and convolutional networks show significant differences, with ViTs having highly similar representations throughout the model, while the ResNet models show much lower similarity between lower and higher layers. We plot CKA similarities between all pairs of layers across different model architectures. The results are shown as a heatmap, with the x and y axes indexing the layers from input to output. We observe that ViTs have relatively uniform layer similarity structure, with a clear grid-like pattern and large similarity between lower and higher layers. By contrast, the ResNet models show clear stages in similarity structure, with smaller similarity scores between lower and higher layers.
|
| 50 |
+
|
| 51 |
+

|
| 52 |
+
Figure 2: Cross model CKA heatmap between ViT and ResNet illustrate that a larger number of lower layers in the ResNet are similar to a smaller set of the lowest ViT layers. We compute a CKA heatmap comparing all layers of ViT to all layers of ResNet, for two different ViT models. We observe that the lower half of ResNet layers are similar to around the lowest quarter of ViT layers. The remaining half of the ResNet is similar to approximately the next third of ViT layers, with the highest ViT layers dissimilar to lower and higher ResNet layers.
|
| 53 |
+
|
| 54 |
+
where HSIC is the Hilbert-Schmidt independence criterion [15]. Given the centering matrix $\begin{array} { r } { \pmb { H } = \pmb { I } _ { n } - \frac { 1 } { n } \pmb { 1 } \pmb { 1 } ^ { \top } } \end{array}$ and the centered Gram matrices $K ^ { \prime } = H K H$ and $L ^ { \prime } = H L H$ , $\mathrm { H S I C } ( \bar { K } , L ) =$ $\mathrm { v e c } ( K ^ { \prime } ) \cdot \mathrm { v e c } ( L ^ { \prime } ) / ( m - 1 ) ^ { 2 }$ , the similarity between these centered Gram matrices. CKA is invariant to orthogonal transformation of representations (including permutation of neurons), and the normalization term ensures invariance to isotropic scaling. These properties enable meaningful comparison and analysis of neural network hidden representations. To work at scale with our models and tasks, we approximate the unbiased estimator of HSIC [39] using minibatches, as suggested in [29].
|
| 55 |
+
|
| 56 |
+
# 4 Representation Structure of ViTs and Convolutional Networks
|
| 57 |
+
|
| 58 |
+
We begin our investigation by using CKA to study the internal representation structure of each model. How are representations propagated within the two architectures, and are there signs of functional differences? To answer these questions, we take every pair of layers $X , Y$ within a model and compute their CKA similarity. Note that we take representations not only from outputs of ViT/ResNet blocks, but also from intermediate layers, such as normalization layers and the hidden activations inside a ViT MLP. Figure 1 shows the results as a heatmap, for multiple ViTs and ResNets. We observe clear differences between the internal representation structure between the two model architectures: (1) ViTs show a much more uniform similarity structure, with a clear grid like structure (2) lower and higher layers in ViT show much greater similarity than in the ResNet, where similarity is divided into different (lower/higher) stages.
|
| 59 |
+
|
| 60 |
+
We also perform cross-model comparisons, where we take all layers $\boldsymbol { X }$ from ViT and compare to all layers $\mathbf { Y }$ from ResNet. We observe (Figure 2) that the lower half of 60 ResNet layers are similar to approximately the lowest quarter of ViT layers. In particular, many more lower layers in the ResNet are needed to compute similar representations to the lower layers of ViT. The top half of the ResNet is approximately similar to the next third of the ViT layers. The final third of ViT layers is less similar to all ResNet layers, likely because this set of layers mainly manipulates the CLS token representation, further studied in Section 6.
|
| 61 |
+
|
| 62 |
+

|
| 63 |
+
Figure 3: Plotting attention head mean distances shows lower ViT layers attend both locally and globally, while higher layers primarily incorporate global information. For each attention head, we compute the pixel distance it attends to, weighted by the attention weights, and then average over 5000 datapoints to get an average attention head distance. We plot the heads sorted by their average attention distance for the two lowest and two highest layers in the ViT, observing that the lower layers attend both locally and globally, while the higher layers attend entirely globally.
|
| 64 |
+
|
| 65 |
+
Taken together, these results suggest that (i) ViT lower layers compute representations in a different way to lower layers in the ResNet, (ii) ViT also more strongly propagates representations between lower and higher layers (iii) the highest layers of ViT have quite different representations to ResNet.
|
| 66 |
+
|
| 67 |
+
# 5 Local and Global Information in Layer Representations
|
| 68 |
+
|
| 69 |
+
In the previous section, we observed much greater similarity between lower and higher layers in ViT, and we also saw that ResNet required more lower layers to compute similar representations to a smaller set of ViT lower layers. In this section, we explore one possible reason for this difference: the difference in the ability to incorporate global information between the two models. How much global information is aggregated by early self-attention layers in ViT? Are there noticeable resulting differences to the features of CNNs, which have fixed, local receptive fields in early layers? In studying these questions, we demonstrate the influence of global representations and a surprising connection between scale and self-attention distances.
|
| 70 |
+
|
| 71 |
+
Analyzing Attention Distances: We start by analyzing ViT self-attention layers, which are the mechanism for ViT to aggregate information from other spatial locations, and structurally very different to the fixed receptive field sizes of CNNs. Each self-attention layer comprises multiple self-attention heads, and for each head we can compute the average distance between the query patch position and the locations it attends to. This reveals how much local vs global information each self-attention layer is aggregating for the representation. Specifically, we weight the pixel distances by the attention weights for each attention head and average over 5000 datapoints, with results shown in Figure 3. In agreement with Dosovitskiy et al. [14], we observe that even in the lowest layers of ViT, self-attention layers have a mix of local heads (small distances) and global heads (large distances). This is in contrast to CNNs, which are hardcoded to attend only locally in the lower layers. At higher layers, all self-attention heads are global.
|
| 72 |
+
|
| 73 |
+
Interestingly, we see a clear effect of scale on attention. In Figure 4, we look at attention distances when training only on ImageNet (no large-scale pre-training), which leads to much lower performance in ViT-L/16 and ViT-H/14 [14]. Comparing to Figure 3, we see that with not enough data, ViT does not learn to attend locally in earlier layers. Together, this suggests that using local information early on for image tasks (which is hardcoded into CNN architectures) is important for strong performance.
|
| 74 |
+
|
| 75 |
+
Does access to global information result in different features? The results of Figure 3 demonstrate that ViTs have access to more global information than CNNs in their lower layers. But does this result in different learned features? As an interventional test, we take subsets of the ViT attention heads from the first encoder block, ranging from the subset corresponding to the most local attention heads to a subset of the representation corresponding to the most global attention heads. We then compute CKA similarity between these subsets and the lower layer representations of ResNet.
|
| 76 |
+
|
| 77 |
+

|
| 78 |
+
Figure 4: With less training data, lower attention layers do not learn to attend locally. Comparing the results to Figure 3, we see that training only on ImageNet leads to the lower layers not learning to attend more locally. These models also perform much worse when only trained on ImageNet, suggesting that incorporating local features (which is hardcoded into CNNs) may be important for strong performance. (See also Figure C.5.)
|
| 79 |
+
|
| 80 |
+

|
| 81 |
+
Figure 5: Lower layer representations of ResNet are most similar to representations corresponding to local attention heads of ViT. We take subsets of ViT attention heads in the first encoder block, ranging from the most locally attending heads (smallest mean distance) to the most global heads (largest mean distance). We then compute CKA similarity between these subsets and lower layer representations in the ResNet. We observe that lower ResNet layers are most similar to the features learned by local attention heads of ViT, and decrease monotonically in similarity as more global information is incorporated, demonstrating that the global heads learn quantitatively different features.
|
| 82 |
+
|
| 83 |
+
The results, shown in Figure 5, which plot the mean distance for each subset against CKA similarity, clearly show a monotonic decrease in similarity as mean attention distance grows, demonstrating that access to more global information also leads to quantitatively different features than computed by the local receptive fields in the lower layers of the ResNet.
|
| 84 |
+
|
| 85 |
+
Effective Receptive Fields: We conclude by computing effective receptive fields [23] for both ResNets and ViTs, with results in Figure 6 and Appendix C. We observe that lower layer effective receptive fields for ViT are indeed larger than in ResNets, and while ResNet effective receptive fields grow gradually, ViT receptive fields become much more global midway through the network. ViT receptive fields also show strong dependence on their center patch due to their strong residual connections, studied in the next section. As we show in Appendix C, in attention sublayers, receptive fields taken before the residual connection show far less dependence on this central patch.
|
| 86 |
+
|
| 87 |
+
# 6 Representation Propagation through Skip Connections
|
| 88 |
+
|
| 89 |
+
The results of the previous section demonstrate that ViTs learn different representations to ResNets in lower layers due to access to global information, which explains some of the differences in represen tation structure observed in Section 4. However, the highly uniform nature of ViT representations (Figure 1) also suggests lower representations are faithfully propagated to higher layers. But how does this happen? In this section, we explore the role of skip connections in representation propagation across ViTs and ResNets, discovering ViT skip connections are highly influential, with a clear phase transition from preserving the CLS (class) token representation (in lower layers) to spatial token representations (in higher layers).
|
| 90 |
+
|
| 91 |
+

|
| 92 |
+
|
| 93 |
+
Figure 7: Most information in ViT passes through skip connections. Comparison of representation norms between the skip-connection (identity) and the long branch for ViT-B/16 trained on ImageNet and a ResNet. For ViT, we show the CLS token separately from the rest of the representation. (left) shows the ratios separated for the first few tokens (token 0 is CLS), (right) shows averages over all tokens.
|
| 94 |
+
|
| 95 |
+
Like Transformers, ViTs contain skip (aka identity or shortcut) connections throughout, which are added on after the (i) self-attention layer, and (ii) MLP layer. To study their effect, we plot the norm ratio $\vert \vert z _ { i } \vert \vert / \vert \vert f ( z _ { i } ) \vert \vert$ where $z _ { i }$ is the hidden representation of the ith layer coming from the skip connection, and $f ( z _ { i } )$ is the transformation of $z _ { i }$ from the long branch (i.e. MLP or self-attention.)
|
| 96 |
+
|
| 97 |
+
The results are in Figure 7 (with additional cosine similarity analysis in Figure E.2.) The heatmap on the left shows $\| z _ { i } \| / \| f ( z _ { i } ) \|$ for different token representations. We observe a striking phase transition: in the first half of the network, the CLS token (token 0) representation is primarily propagated by the skip connection branch (high norm ratio), while the spatial token representations have a large contribution coming from the long branch (lower norm ratio). Strikingly, in the second half of the network, this is reversed.
|
| 98 |
+
|
| 99 |
+
The right pane, which has line plots of these norm ratios across ResNet50, the ViT CLS token and the ViT spatial tokens additionally demonstrates that skip connection is much more influential in ViT compared to ResNet: we observe much higher norm ratios for ViT throughout, along with the phase transition from CLS to spatial token propagation (shown for the MLP and self-attention layers.)
|
| 100 |
+
|
| 101 |
+
ViT Representation Structure without Skip Connections: The norm ratio results strongly suggest that skip connections play a key role in the representational structure of ViT. To test this interventionally, we train ViT models with skip connections removed in block $i$ for varying $i$ , and plot the CKA representation heatmap. The results, in Figure 8, illustrate that removing the skip connections in a block partitions the layer representations on either side. (We note a performance drop of $4 \%$ when removing skip connections from middle blocks.) This demonstrates the importance of representations being propagated by skip connections for the uniform similarity structure of ViT in Figure 1.
|
| 102 |
+
|
| 103 |
+

|
| 104 |
+
Figure 8: ViT models trained without any skip connections in block $_ { i }$ show very little representation similarity between layers before/after block $_ { i }$ . We train several ViT models without any skip connections at block $_ { i }$ for varying $_ { i }$ to interventionally test the effect on representation structure. For middle blocks without skip connections, we observe a performance drop of $4 \%$ . We also observe that removing a skip connection at block $i$ partitions similar representations to before/after block $_ { i }$ — this demonstrates the importance of skip connections in ViT’s standard uniform representation structure.
|
| 105 |
+
|
| 106 |
+

|
| 107 |
+
ViT-B/32 final block Token at Location(0, 0) Token at Location(2, 1) Token at Location(4, 2) Token at Location(4, 4)
|
| 108 |
+
Figure 9: Higher layers of ViT maintain spatial location information more faithfully than ResNets. Each heatmap plot shows the CKA similarity between a single token representation in final block of the model and the input images, which are divided into non-overlapping patches. We observe that ViT tokens have strongest similarity to their corresponding spatial location in the image, but tokens corresponding to spatial locations at the edge of the image (e.g. token 0) additionally show similarity to other edge positions. This demonstrates that spatial information from the input is preserved even at the final layer of ViT. By contrast, ResNet “tokens” (features at a specific spatial location) are much less spatially discriminative, showing comparable similarity across a broad set of input spatial locations. See Appendix for additional layers and results.
|
| 109 |
+
|
| 110 |
+
# 7 Spatial Information and Localization
|
| 111 |
+
|
| 112 |
+
The results so far, on the role of self-attention in aggregating spatial information in ViTs, and skipconnections faithfully propagating representations to higher layers, suggest an important followup question: how well can ViTs perform spatial localization? Specifically, is spatial information from the input preserved in the higher layers of ViT? And how does it compare in this aspect to ResNet? An affirmative answer to this is crucial for uses of ViT beyond classification, such as object detection.
|
| 113 |
+
|
| 114 |
+

|
| 115 |
+
Figure 10: When trained with global average pooling (GAP) instead of a CLS token, ViTs show less clear localization (compare Figure 9). We plot the same CKA heatmap between a token and different input images patches as in Figure 9, but for a ViT model trained with global average pooling (like ResNet) instead of a CLS token. We observe significantly less localization.
|
| 116 |
+
|
| 117 |
+

|
| 118 |
+
Figure 11: Spatial localization experiments with linear probes. We train linear classifiers on 10-shot ImageNet classification from the representations extracted from different layers of ViT-B/32 models. We then plot the accuracy of the probe versus the (normalized) layer number. Left: We train a classifier on each token separately and report the average accuracy over all tokens (excluding the CLS token for the ViT CLS model.) Right: Comparison of ViT models pre-trained with a classification token or with global average pooling (GAP) and then evaluated with different ways of aggregating the token representations.
|
| 119 |
+
|
| 120 |
+
We begin by comparing token representations in the higher layers of ViT and ResNet to those of input patches. Recall that ViT tokens have a corresponding input patch, and thus a corresponding input spatial location. For ResNet, we define a token representation to be all the convolutional channels at a particular spatial location. This also gives it a corresponding input spatial location. We can then take a token representation and compute its CKA score with input image patches at different locations. The results are illustrated for different tokens (with their spatial locations labelled) in Figure 9.
|
| 121 |
+
|
| 122 |
+
For ViT, we observe that tokens corresponding to locations at the edge of the image are similar to edge image patches, but tokens corresponding to interior locations are well localized, with their representations being most similar to the corresponding image patch. By contrast, for ResNet, we see significantly weaker localization (though Figure D.3 shows improvements for earlier layers.)
|
| 123 |
+
|
| 124 |
+
One factor influencing this clear difference between architectures is that ResNet is trained to classify with a global average pooling step, while ViT has a separate classification (CLS) token. To examine this further, we test a ViT architecture trained with global average pooling (GAP) for localization (see Appendix A for training details). The results, shown in Figure 10, demonstrate that global average pooling does indeed reduce localization in the higher layers. More results in Appendix Section D.
|
| 125 |
+
|
| 126 |
+
Localization and Linear Probe Classification: The previous results have looked at localization through direct comparison of each token with input patches. To complete the picture, we look at using each token separately to perform classification with linear probes. We do this across different layers of the model, training linear probes to classify image label with closed-form few-shot linear regression similar to Dosovitskiy et al. [14] (details in Appendix A). Results are in Figure 11, with further results in Appendix F. The left pane shows average accuracy of classifiers trained on individual tokens, where we see that ResNet50 and ViT with GAP model tokens perform well at higher layers, while in the standard ViT trained with a CLS token the spatial tokens do poorly – likely because their representations remain spatially localized at higher layers, which makes global classification challenging. Supporting this are results on the right pane, which shows that a single token from the
|
| 127 |
+
|
| 128 |
+

|
| 129 |
+
Figure 12: Measuring similarity of representations learned with varying amounts of data shows the importance of large datasets for higher layers and larger model representations. We compute the similarity of representations at each block for ViT models that have been trained on smaller subsets of the data to a model that has been trained on the full data on ViT-L/16 (left) and ViT-B/32 (right). We observe that while lower layer representations have high similarity even with $1 0 \%$ of the data, higher layers and larger models require significantly more data to learn similar representations.
|
| 130 |
+
|
| 131 |
+

|
| 132 |
+
Figure 13: Experiments with linear probes. We train linear classifiers on 10-shot ImageNet classification from the aggregated representations of different layers of different models. We then plot the accuracy of the probe versus the (normalized) layer number. Left: Comparison of ViTs pre-trained on JFT-300M or ImageNet and evaluated with linear probes on Imagenet. Right: Comparison of ViT and ResNet models trained JFT- $3 0 0 \mathrm { m }$ evaluated with linear probes on ImageNet.
|
| 133 |
+
|
| 134 |
+
ViT-GAP model achieves comparable accuracy in the highest layer to all tokens pooled together. With the results of Figure 9, this suggests all higher layer tokens in GAP models learn similar (global) representations.
|
| 135 |
+
|
| 136 |
+
# 8 Effects of Scale on Transfer Learning
|
| 137 |
+
|
| 138 |
+
Motivated by the results of Dosovitskiy et al. [14] that demonstrate the importance of dataset scale for high performing ViTs, and our earlier result (Figure 4) on needing scale for local attention, we perform a study of the effect of dataset scale on representations in transfer learning.
|
| 139 |
+
|
| 140 |
+
We begin by studying the effect on representations as the JFT-300M pretraining dataset size is varied. Figure 12 illustrates the results on ViT-B/32 and ViT-L/16. Even with $3 \%$ of the entire dataset, lower layer representations are very similar to the model trained on the whole dataset, but higher layers require larger amounts of pretraining data to learn the same representations as at large data scale, especially with the large model size. In Section G, we study how much representations change in finetuning, finding heterogeneity over datasets.
|
| 141 |
+
|
| 142 |
+
We next look at dataset size effect on the larger ViT-L/16 and ViT-H/14 models. Specifically, in the left pane of Figure 13, we train linear classifer probes on ImageNet classes for models pretrained on JFT-300M vs models only pretrained on ImageNet. We observe the JFT-300M pretained models achieve much higher accuracies even with middle layer representations, with a $3 0 \%$ gap in absolute accuracy to the models pretrained only on ImageNet. This suggests that for larger models, the larger dataset is especially helpful in learning high quality intermediate representations. This conclusion is further supported by the results of the right pane of Figure 13, which shows linear probes on different ResNet and ViT models, all pretrained on JFT-300M. We again see the larger ViT models learn much stronger intermediate representations than the ResNets. Additional linear probes experiments in Section F demonstrate this same conclusion for transfer to CIFAR-10 and CIFAR-100.
|
| 143 |
+
|
| 144 |
+
# 9 Discussion
|
| 145 |
+
|
| 146 |
+
Limitations: Our study uses CKA [17], which summarizes measurements into a single scalar, to provide quantitative insights on representation similarity. While we have complemented this with interventional tests and other analyses (e.g. linear probes), more fine-grained methods may reveal additional insights and variations in the representations.
|
| 147 |
+
|
| 148 |
+
Conclusion: Given the central role of convolutional neural networks in computer vision breakthroughs, it is remarkable that Transformer architectures (almost identical to those used in language) are capable of similar performance. This raises fundamental questions on whether these architectures work in the same way as CNNs. Drawing on representational similarity techniques, we find surprisingly clear differences in the features and internal structures of ViTs and CNNs. An analysis of self-attention and the strength of skip connections demonstrates the role of earlier global features and strong representation propagation in ViTs for these differences, while also revealing that some CNN properties, e.g. local information aggregation at lower layers, are important to ViTs, being learned from scratch at scale. We examine the potential for ViTs to be used beyond classification through a study of spatial localization, discovering ViTs with CLS tokens show strong preservation of spatial information — promising for future uses in object detection. Finally, we investigate the effect of scale for transfer learning, finding larger ViT models develop significantly stronger intermediate representations through larger pretraining datasets. These results are also very pertinent to understanding MLP-based architectures for vision proposed by concurrent work [42, 43], further discussed in Section H, and together answer central questions on differences between ViTs and CNNs, and suggest new directions for future study. From the perspective of societal impact, these findings and future work may help identify potential failures as well as greater model interpretability.
|
| 149 |
+
|
| 150 |
+
# References
|
| 151 |
+
|
| 152 |
+
[1] G. Alain and Y. Bengio. Understanding intermediate layers using linear classifier probes. arXiv preprint arXiv:1610.01644, 2016.
|
| 153 |
+
[2] I. Bello, B. Zoph, A. Vaswani, J. Shlens, and Q. V. Le. Attention augmented convolutional networks. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 3286–3295, 2019.
|
| 154 |
+
[3] S. Bhojanapalli, A. Chakrabarti, D. Glasner, D. Li, T. Unterthiner, and A. Veit. Understanding robustness of transformers for image classification. arXiv preprint arXiv:2103.14586, 2021.
|
| 155 |
+
[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.
|
| 156 |
+
[5] M. Caron, H. Touvron, I. Misra, H. Jégou, J. Mairal, P. Bojanowski, and A. Joulin. Emerging properties in self-supervised vision transformers. arXiv preprint arXiv:2104.14294, 2021.
|
| 157 |
+
[6] M. Chen, A. Radford, R. Child, J. Wu, H. Jun, D. Luan, and I. Sutskever. Generative pretraining from pixels. In International Conference on Machine Learning, pages 1691–1703. PMLR, 2020.
|
| 158 |
+
[7] X. Chen, S. Xie, and K. He. An empirical study of training self-supervised vision transformers. arXiv preprint arXiv:2104.02057, 2021.
|
| 159 |
+
[8] A. Conneau, G. Kruszewski, G. Lample, L. Barrault, and M. Baroni. What you can cram into a single vector: Probing sentence embeddings for linguistic properties. In ACL, 2018.
|
| 160 |
+
[9] J.-B. Cordonnier, A. Loukas, and M. Jaggi. On the relationship between self-attention and convolutional layers. arXiv preprint arXiv:1911.03584, 2019.
|
| 161 |
+
[10] C. Cortes, M. Mohri, and A. Rostamizadeh. Algorithms for learning kernels based on centered alignment. The Journal of Machine Learning Research, 13(1):795–828, 2012.
|
| 162 |
+
[11] S. d’Ascoli, H. Touvron, M. Leavitt, A. Morcos, G. Biroli, and L. Sagun. Convit: Improving vision transformers with soft convolutional inductive biases. arXiv preprint arXiv:2103.10697, 2021.
|
| 163 |
+
[12] J. Deng, W. Dong, R. Socher, L.-J. Li, K. Li, and L. Fei-Fei. Imagenet: A large-scale hierarchical image database. In 2009 IEEE conference on computer vision and pattern recognition, pages 248–255. Ieee, 2009.
|
| 164 |
+
[13] 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.
|
| 165 |
+
[14] 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.
|
| 166 |
+
[15] A. Gretton, K. Fukumizu, C. H. Teo, L. Song, B. Schölkopf, A. J. Smola, et al. A kernel statistical test of independence. In Nips, volume 20, pages 585–592. Citeseer, 2007.
|
| 167 |
+
[16] A. Kolesnikov, L. Beyer, X. Zhai, J. Puigcerver, J. Yung, S. Gelly, and N. Houlsby. Big transfer (bit): General visual representation learning. arXiv preprint arXiv:1912.11370, 6(2):8, 2019.
|
| 168 |
+
[17] S. Kornblith, M. Norouzi, H. Lee, and G. Hinton. Similarity of neural network representations revisited. In ICML, 2019.
|
| 169 |
+
[18] S. Kornblith, H. Lee, T. Chen, and M. Norouzi. What’s in a loss function for image classification? arXiv preprint arXiv:2010.16402, 2020.
|
| 170 |
+
[19] N. Kriegeskorte, M. Mur, and P. A. Bandettini. Representational similarity analysis-connecting the branches of systems neuroscience. Frontiers in systems neuroscience, 2:4, 2008.
|
| 171 |
+
[20] 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.
|
| 172 |
+
[21] S. R. Kudugunta, A. Bapna, I. Caswell, N. Arivazhagan, and O. Firat. Investigating multilingual nmt representations at scale. arXiv preprint arXiv:1909.02197, 2019.
|
| 173 |
+
[22] G. W. Lindsay. Convolutional neural networks as a model of the visual system: past, present, and future. Journal of cognitive neuroscience, pages 1–15, 2020.
|
| 174 |
+
[23] W. Luo, Y. Li, R. Urtasun, and R. Zemel. Understanding the effective receptive field in deep convolutional neural networks. arXiv preprint arXiv:1701.04128, 2017.
|
| 175 |
+
[24] N. Maheswaranathan, A. H. Williams, M. D. Golub, S. Ganguli, and D. Sussillo. Universality and individuality in neural dynamics across large populations of recurrent networks. Advances in neural information processing systems, 2019:15629, 2019.
|
| 176 |
+
[25] A. Merchant, E. Rahimtoroghi, E. Pavlick, and I. Tenney. What happens to bert embeddings during fine-tuning? arXiv preprint arXiv:2004.14448, 2020.
|
| 177 |
+
[26] A. S. Morcos, M. Raghu, and S. Bengio. Insights on representational similarity in neural networks with canonical correlation. arXiv preprint arXiv:1806.05759, 2018.
|
| 178 |
+
[27] B. Mustafa, A. Loh, J. Freyberg, P. MacWilliams, M. Wilson, S. M. McKinney, M. Sieniek, J. Winkens, Y. Liu, P. Bui, et al. Supervised transfer learning at scale for medical imaging. arXiv preprint arXiv:2101.05913, 2021.
|
| 179 |
+
[28] M. Naseer, K. Ranasinghe, S. Khan, M. Hayat, F. S. Khan, and M.-H. Yang. Intriguing properties of vision transformers, 2021.
|
| 180 |
+
[29] T. Nguyen, M. Raghu, and S. Kornblith. Do wide and deep networks learn the same things? uncovering how neural network representations vary with width and depth. arXiv preprint arXiv:2010.15327, 2020.
|
| 181 |
+
[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.
|
| 182 |
+
[31] S. Paul and P.-Y. Chen. Vision transformers are robust learners. arXiv preprint arXiv:2105.07581, 2021.
|
| 183 |
+
[32] M. E. Peters, M. Neumann, L. Zettlemoyer, and W.-t. Yih. Dissecting contextual word embeddings: Architecture and representation. In EMNLP, 2018.
|
| 184 |
+
[33] 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.
|
| 185 |
+
[34] M. Raghu, J. Gilmer, J. Yosinski, and J. Sohl-Dickstein. Svcca: Singular vector canonical correlation analysis for deep learning dynamics and interpretability. arXiv preprint arXiv:1706.05806, 2017.
|
| 186 |
+
[35] M. Raghu, C. Zhang, J. Kleinberg, and S. Bengio. Transfusion: Understanding transfer learning for medical imaging. arXiv preprint arXiv:1902.07208, 2019.
|
| 187 |
+
[36] P. Ramachandran, N. Parmar, A. Vaswani, I. Bello, A. Levskaya, and J. Shlens. Stand-alone self-attention in vision models. arXiv preprint arXiv:1906.05909, 2019.
|
| 188 |
+
[37] 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.
|
| 189 |
+
[38] J. Shi, E. Shea-Brown, and M. Buice. Comparison against task driven artificial neural networks reveals functional properties in mouse visual cortex. Advances in Neural Information Processing Systems, 32:5764–5774, 2019.
|
| 190 |
+
[39] L. Song, A. Smola, A. Gretton, J. Bedo, and K. Borgwardt. Feature selection via dependence maximization. Journal of Machine Learning Research, 13(5), 2012.
|
| 191 |
+
[40] C. Sun, A. Shrivastava, S. Singh, and A. Gupta. Revisiting unreasonable effectiveness of data in deep learning era. In Proceedings of the IEEE international conference on computer vision, pages 843–852, 2017.
|
| 192 |
+
[41] Y. Tay, M. Dehghani, J. Gupta, D. Bahri, V. Aribandi, Z. Qin, and D. Metzler. Are pre-trained convolutions better than pre-trained transformers? arXiv preprint arXiv:2105.03322, 2021.
|
| 193 |
+
[42] I. Tolstikhin, N. Houlsby, A. Kolesnikov, L. Beyer, X. Zhai, T. Unterthiner, J. Yung, D. Keysers, J. Uszkoreit, M. Lucic, et al. Mlp-mixer: An all-mlp architecture for vision. arXiv preprint arXiv:2105.01601, 2021.
|
| 194 |
+
[43] H. Touvron, P. Bojanowski, M. Caron, M. Cord, A. El-Nouby, E. Grave, A. Joulin, G. Synnaeve, J. Verbeek, and H. Jégou. Resmlp: Feedforward networks for image classification with dataefficient training. arXiv preprint arXiv:2105.03404, 2021.
|
| 195 |
+
[44] 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.
|
| 196 |
+
[45] E. Voita, R. Sennrich, and I. Titov. The bottom-up evolution of representations in the transformer: A study with machine translation and language modeling objectives. In EMNLP, 2019.
|
| 197 |
+
[46] B. Wu, C. Xu, X. Dai, A. Wan, P. Zhang, Z. Yan, M. Tomizuka, J. Gonzalez, K. Keutzer, and P. Vajda. Visual transformers: Token-based image representation and processing for computer vision. arXiv preprint arXiv:2006.03677, 2020.
|
| 198 |
+
[47] J. M. Wu, Y. Belinkov, H. Sajjad, N. Durrani, F. Dalvi, and J. Glass. Similarity analysis of contextual word representation models. arXiv preprint arXiv:2005.01172, 2020.
|
| 199 |
+
[48] S. Wu, A. Conneau, H. Li, L. Zettlemoyer, and V. Stoyanov. Emerging cross-lingual structure in pretrained language models. arXiv preprint arXiv:1911.01464, 2019.
|
| 200 |
+
[49] L. Yuan, Y. Chen, T. Wang, W. Yu, Y. Shi, Z. Jiang, F. E. Tay, J. Feng, and S. Yan. Tokens-to-token vit: Training vision transformers from scratch on imagenet. arXiv preprint arXiv:2101.11986, 2021.
|
| 201 |
+
[50] X. Zhai, J. Puigcerver, A. Kolesnikov, P. Ruyssen, C. Riquelme, M. Lucic, J. Djolonga, A. S. Pinto, M. Neumann, A. Dosovitskiy, et al. The visual task adaptation benchmark. 2019.
|
| 202 |
+
|
| 203 |
+
# Checklist
|
| 204 |
+
|
| 205 |
+
1. For all authors...
|
| 206 |
+
|
| 207 |
+
(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes]
|
| 208 |
+
(b) Did you describe the limitations of your work? [Yes] See Section 9
|
| 209 |
+
(c) Did you discuss any potential negative societal impacts of your work? [N/A]
|
| 210 |
+
(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
|
| 211 |
+
|
| 212 |
+
2. If you are including theoretical results...
|
| 213 |
+
|
| 214 |
+
(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]
|
| 215 |
+
|
| 216 |
+
3. If you ran experiments...
|
| 217 |
+
|
| 218 |
+
(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)? [No]
|
| 219 |
+
(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes]
|
| 220 |
+
(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [No] Where possible, we show variation arising from different sampling aspects, be that dataset samples or model runs. Note that for some of the pretrained models, we only have access to one pretrained checkpoint, and so we show results across multiple model architectures to demonstrate the results hold more broadly.
|
| 221 |
+
(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)? [No]
|
| 222 |
+
|
| 223 |
+
4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
|
| 224 |
+
|
| 225 |
+
(a) If your work uses existing assets, did you cite the creators? [Yes]
|
| 226 |
+
(b) Did you mention the license of the assets? [No]
|
| 227 |
+
(c) Did you include any new assets either in the supplemental material or as a URL? [N/A]
|
| 228 |
+
(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [N/A]
|
| 229 |
+
(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A]
|
| 230 |
+
|
| 231 |
+
5. If you used crowdsourcing or conducted research with human subjects...
|
| 232 |
+
|
| 233 |
+
(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
|
| 234 |
+
(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A]
|
| 235 |
+
(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]
|
md/train/H1ebTsActm/H1ebTsActm.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/train/H1mCp-ZRZ/H1mCp-ZRZ.md
ADDED
|
@@ -0,0 +1,530 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ACTION-DEPENDENT CONTROL VARIATES FOR POL-ICY OPTIMIZATION VIA STEIN’S IDENTITY
|
| 2 |
+
|
| 3 |
+
Hao Liu∗
|
| 4 |
+
Computer Science
|
| 5 |
+
UESTC
|
| 6 |
+
Chengdu, China
|
| 7 |
+
uestcliuhao@gmail.com
|
| 8 |
+
Yi Mao
|
| 9 |
+
Microsoft
|
| 10 |
+
Redmond, WA, 98052
|
| 11 |
+
maoyi@microsoft.com
|
| 12 |
+
Yihao Feng∗
|
| 13 |
+
Computer science
|
| 14 |
+
University of Texas at Austin
|
| 15 |
+
Austin, TX, 78712
|
| 16 |
+
yihao@cs.utexas.edu
|
| 17 |
+
|
| 18 |
+
# Qiang Liu
|
| 19 |
+
|
| 20 |
+
Dengyong Zhou Google Kirkland, WA, 98033 dennyzhou@google.com
|
| 21 |
+
|
| 22 |
+
Jian Peng
|
| 23 |
+
Computer Science
|
| 24 |
+
UIUC
|
| 25 |
+
Urbana, IL 61801
|
| 26 |
+
jianpeng@illinois.edu
|
| 27 |
+
|
| 28 |
+
Computer Science University of Texas at Austin Austin, TX, 78712 lqiang@cs.utexas.edu
|
| 29 |
+
|
| 30 |
+
# ABSTRACT
|
| 31 |
+
|
| 32 |
+
Policy gradient methods have achieved remarkable successes in solving challenging reinforcement learning problems. However, it still often suffers from the large variance issue on policy gradient estimation, which leads to poor sample efficiency during training. In this work, we propose a control variate method to effectively reduce variance for policy gradient methods. Motivated by the Stein’s identity, our method extends the previous control variate methods used in REINFORCE and advantage actor-critic by introducing more general action-dependent baseline functions. Empirical studies show that our method significantly improves the sample efficiency of the state-of-the-art policy gradient approaches.
|
| 33 |
+
|
| 34 |
+
# 1 INTRODUCTION
|
| 35 |
+
|
| 36 |
+
Deep reinforcement learning (RL) provides a general framework for solving challenging goaloriented sequential decision-making problems, It has recently achieved remarkable successes in advancing the frontier of AI technologies (Silver et al., 2017; Mnih et al., 2013; Silver et al., 2016; Schulman et al., 2017). Policy gradient (PG) is one of the most successful model-free RL approaches that has been widely applied to high dimensional continuous control, vision-based navigation and video games (Schulman et al., 2016; Kakade, 2002; Schulman et al., 2015; Mnih et al., 2016).
|
| 37 |
+
|
| 38 |
+
Despite these successes, a key problem of policy gradient methods is that the gradient estimates often have high variance. A naive solution to fix this issue would be generating a large amount of rollout samples to obtain a reliable gradient estimation in each step. Regardless of the cost of generating large samples, in many practical applications like developing driverless cars, it may not even be possible to generate as many samples as we want. A variety of variance reduction techniques have been proposed for policy gradient methods (See e.g. Weaver & Tao 2001, Greensmith et al. 2004, Schulman et al. 2016 and Asadi et al. 2017).
|
| 39 |
+
|
| 40 |
+
In this work, we focus on the control variate method, one of the most widely used variance reduction techniques in policy gradient and variational inference. The idea of the control variate method is to subtract a Monte Carlo gradient estimator by a baseline function that analytically has zero expectation. The resulted estimator does not introduction biases theoretically, but may achieve much lower variance if the baseline function is properly chosen such that it cancels out the variance of the original gradient estimator. Different control variates yield different variance reduction methods. For example, in REINFORCE (Williams, 1992), a constant baseline function is chosen as a control variate; advantage actor-critic (A2C) (Sutton & Barto, 1998; Mnih et al., 2016) considers a state-dependent baseline function as the control variate, which is often set to be an estimated value function $V ( s )$ . More recently, in Q-prop (Gu et al., 2016b), a more general baseline function that linearly depends on the actions is proposed and shows promising results on several challenging tasks. It is natural to expect even more flexible baseline functions which depend on both states and actions to yield powerful variance reduction. However, constructing such baseline functions turns out to be fairly challenging, because it requires new and more flexible mathematical identities that can yield a larger class of baseline functions with zero analytic expectation under the policy distribution of interest.
|
| 41 |
+
|
| 42 |
+
To tackle this problem, we sort to the so-called Stein’s identity (Stein, 1986) which defines a broad class of identities that are sufficient to fully characterize the distribution under consideration (see e.g., Liu et al., 2016; Chwialkowski et al., 2016). By applying the Stein’s identity and also drawing connection with the reparameterization trick (Kingma & Welling, 2013; Rezende et al., 2014), we construct a class of Stein control variate that allows us to use arbitrary baseline functions that depend on both actions and states. Our approach tremendously extends the existing control variates used in REINFORCE, A2C and Q-prop.
|
| 43 |
+
|
| 44 |
+
We evaluate our method on a variety of reinforcement learning tasks. Our experiments show that our Stein control variate can significantly reduce the variance of gradient estimation with more flexible and nonlinear baseline functions. When combined with different policy optimization methods, including both proximal policy optimization (PPO) (Schulman et al., 2017; Heess et al., 2017) and trust region policy optimization (TRPO) (Schulman et al., 2015; 2016), it greatly improves the sample efficiency of the entire policy optimization.
|
| 45 |
+
|
| 46 |
+
# 2 BACKGROUND
|
| 47 |
+
|
| 48 |
+
We first introduce basic backgrounds of reinforcement learning and policy gradient and set up the notation that we use in the rest of the paper in Section 2.1, and then discuss the control variate method as well as its application in policy gradient in Section 2.2.
|
| 49 |
+
|
| 50 |
+
# 2.1 REINFORCEMENT LEARNING AND POLICY GRADIENT
|
| 51 |
+
|
| 52 |
+
Reinforcement learning considers the problem of finding an optimal policy for an agent which interacts with an uncertain environment and collects reward per action. The goal of the agent is to maximize the long-term cumulative reward. Formally, this problem can be formulated as a Markov decision process over the environment states $s \in S$ and agent actions $a \in A$ , under an unknown environmental dynamic defined by a transition probability $T ( s ^ { \prime } | s , a )$ and a reward signal $r ( s , a )$ immediately following the action $a$ performed at state $s$ . The agent’s action $a$ is selected by a conditional probability distribution $\pi ( a | s )$ called policy. In policy gradient methods, we consider a set of candidate policies $\pi _ { \boldsymbol { \theta } } ( a | \boldsymbol { s } )$ parameterized by $\theta$ and obtain the optimal policy by maximizing the expected cumulative reward or return
|
| 53 |
+
|
| 54 |
+
$$
|
| 55 |
+
J ( \theta ) = \mathbb { E } _ { s \sim \rho _ { \pi } , a \sim \pi ( a | s ) } \left[ r ( s , a ) \right] ,
|
| 56 |
+
$$
|
| 57 |
+
|
| 58 |
+
where $\begin{array} { r } { \rho _ { \pi } ( s ) = \sum _ { t = 1 } ^ { \infty } \gamma ^ { t - 1 } \mathrm { P r } ( s _ { t } = s ) } \end{array}$ is the normalized discounted state visitation distribution with discount factor $\gamma \in [ 0 , 1 )$ . To simplify the notation, we denote $\mathbb { E } _ { s \sim \rho _ { \pi } , a \sim \pi ( a | s ) } [ \cdot ]$ by simply $\mathbb { E } _ { \pi } [ \cdot ]$ in the rest of paper. According to the policy gradient theorem (Sutton $\&$ Barto, 1998), the gradient of $J ( \theta )$ can be written as
|
| 59 |
+
|
| 60 |
+
$$
|
| 61 |
+
\nabla _ { \boldsymbol { \theta } } J ( \boldsymbol { \theta } ) = \mathbb { E } _ { \boldsymbol { \pi } } \left[ \nabla _ { \boldsymbol { \theta } } \log \pi ( \boldsymbol { a } | \boldsymbol { s } ) Q ^ { \pi } ( \boldsymbol { s } , \boldsymbol { a } ) \right] ,
|
| 62 |
+
$$
|
| 63 |
+
|
| 64 |
+
where $\begin{array} { r } { Q ^ { \pi } ( s , a ) = \mathbb { E } _ { \pi } \left[ \sum _ { t = 1 } ^ { \infty } \gamma ^ { t - 1 } r ( s _ { t } , a _ { t } ) | s _ { 1 } = s , a _ { 1 } = a \right] } \end{array}$ denotes the expected return under policy starting from state $s$ and action $a$ . Different policy gradient methods are based on different stochastic estimation of the expected gradient in $\operatorname { E q }$ (1). Perhaps the most straightforward way is to simulate the environment with the current policy $\pi$ to obtain a trajectory $\{ ( \bar { s } _ { t } , a _ { t } , r _ { t } ) \} _ { t = 1 } ^ { n }$ and estimate $\nabla _ { \boldsymbol { \theta } } J ( \boldsymbol { \theta } )$ using the Monte Carlo estimation:
|
| 65 |
+
|
| 66 |
+
$$
|
| 67 |
+
\hat { \nabla } _ { \boldsymbol { \theta } } J ( \boldsymbol { \theta } ) = \frac { 1 } { n } \sum _ { t = 1 } ^ { n } \gamma ^ { t - 1 } \nabla _ { \boldsymbol { \theta } } \log \pi ( a _ { t } | \boldsymbol { s } _ { t } ) \hat { Q } ^ { \pi } ( \boldsymbol { s } _ { t } , a _ { t } ) ,
|
| 68 |
+
$$
|
| 69 |
+
|
| 70 |
+
where $\hat { Q } ^ { \pi } ( s _ { t } , a _ { t } )$ is an empirical estimate of $Q ^ { \pi } ( s _ { t } , a _ { t } )$ , e.g., $\begin{array} { r } { \hat { Q } ^ { \pi } ( s _ { t } , a _ { t } ) = \sum _ { j \geq t } \gamma ^ { j - t } r _ { j } } \end{array}$ . Unfortunately, this naive method often introduces large variance in gradient estimation. It is almost always the case that we need to use control variates method for variance reduction, which we will introduce in the following. It has been found that biased estimators help improve the performance, e.g., by using biased estimators of $Q ^ { \pi }$ or dropping the $\gamma ^ { t - 1 }$ term in Eq (2). In this work, we are interested in improving the performance without introducing additional biases, at least theoretically.
|
| 71 |
+
|
| 72 |
+
# 2.2 CONTROL VARIATE
|
| 73 |
+
|
| 74 |
+
The control variates method is one of the most widely used variance reduction techniques in policy gradient. Suppose that we want to estimate the expectation $\mu = \mathbb { E } _ { \tau } [ g ( s , a ) ]$ with Monte Carlo samples $( s _ { t } , \bar { a _ { t } } ) _ { t = 1 } ^ { n }$ drawn from some distribution $\tau$ , which is assumed to have a large variance $\operatorname { v a r } _ { \tau } ( g )$ . The control variate is a function $f ( s , a )$ with known analytic expectation under $\tau$ , which, without losing of generality, can be assumed to be zero: $\mathbb { E } _ { \tau } [ f ( s , \dot { a } ) ] = 0$ . With $f$ , we can have an alternative unbiased estimator
|
| 75 |
+
|
| 76 |
+
$$
|
| 77 |
+
{ \hat { \mu } } = { \frac { 1 } { n } } \sum _ { t = 1 } ^ { n } \left( g ( s _ { t } , a _ { t } ) - f ( s _ { t } , a _ { t } ) \right) ,
|
| 78 |
+
$$
|
| 79 |
+
|
| 80 |
+
where the variance of this estimator is $\operatorname { v a r } _ { \tau } ( g - f ) / n$ , instead of $\operatorname { v a r } _ { \tau } ( g ) / n$ for the Monte Carlo estimator. By taking $f$ to be similar to $g$ , e.g. $f = g - \mu$ in the ideal case, the variance of $g - f$ can be significantly reduced, thus resulting in a more reliable estimator.
|
| 81 |
+
|
| 82 |
+
The key step here is to find an identity that yields a large class of functional $f$ with zero expectation. In most existing policy gradient methods, the following identity is used
|
| 83 |
+
|
| 84 |
+
$$
|
| 85 |
+
\mathbb { E } _ { \pi ( a | s ) } \left[ \nabla _ { \theta } \log \pi ( a | s ) \phi ( s ) \right] = 0 , \quad \mathrm { ~ f o r ~ a n y ~ f u n c t i o n } \phi .
|
| 86 |
+
$$
|
| 87 |
+
|
| 88 |
+
Combining it with the policy gradient theorem, we obtain
|
| 89 |
+
|
| 90 |
+
$$
|
| 91 |
+
\hat { \nabla } _ { \boldsymbol { \theta } } J ( \boldsymbol { \theta } ) = \frac { 1 } { n } \sum _ { t = 1 } ^ { n } \nabla _ { \boldsymbol { \theta } } \log \pi ( a _ { t } | \boldsymbol { s } _ { t } ) \left( \hat { Q } ^ { \pi } ( \boldsymbol { s } _ { t } , a _ { t } ) - \phi ( \boldsymbol { s } _ { t } ) \right) ,
|
| 92 |
+
$$
|
| 93 |
+
|
| 94 |
+
Note that we drop the $\gamma ^ { t - 1 }$ term in Eq (2) as we do in practice. The introduction of the function $\phi$ does not change the expectation but can decrease the variance significantly when it is chosen properly to cancel out the variance of $Q ^ { \pi } ( s , a )$ . In REINFORCE, $\phi$ is set to be a constant $\phi ( s ) = b$ baseline, and $b$ is usually set to approximate the average reward, or determined by minimizing $\operatorname { v a r } ( { \hat { \nabla } } _ { \boldsymbol { \theta } } J ( { \boldsymbol { \theta } } ) )$ empirically. In advantage actor-critic (A2C), $\phi ( s )$ is set to be an estimator of the value function $V ^ { \pi } ( s ) = \mathbb { E } _ { \pi ( a \mid s ) } [ Q ^ { \pi } ( s , a ) ]$ , so that $\hat { Q } ^ { \pi } ( s , a ) - \phi ( s )$ is an estimator of the advantage function. For notational consistency, we call $\phi$ the baseline function and $f ( s , a ) = \nabla _ { \boldsymbol { \theta } } \log \pi ( a | s ) \phi ( s )$ the corresponding control variate.
|
| 95 |
+
|
| 96 |
+
Although REINFORCE and A2C have been widely used, their applicability is limited by the possible choice of $\phi$ . Ideally, we want to set $\phi$ to equal $Q ^ { \pi } ( s , a )$ up to a constant to reduce the variance of $\hat { \nabla } _ { \boldsymbol { \theta } } J ( \boldsymbol { \theta } )$ to close to zero. However, this is impossible for REINFORCE or A2C because $\phi ( s )$ only depends on state $s$ but not action $a$ by its construction. Our goal is to develop a more general control variate that yields much smaller variance of gradient estimation than the one in Eq (4).
|
| 97 |
+
|
| 98 |
+
# 3 POLICY GRADIENT WITH STEIN CONTROL VARIATE
|
| 99 |
+
|
| 100 |
+
In this section, we present our Stein control variate for policy gradient methods. We start by introducing Stein’s identity in Section 3.1, then develop in Section 3.2 a variant that yields a new control variate for policy gradient and discuss its connection to the reparameterization trick and the Q-prop method. We provide approaches to estimate the optimal baseline functions in Section 3.3, and discuss the special case of the Stein control variate for Gaussian policies in Section 3.4. We apply our control variate to proximal policy optimization (PPO) in Section 3.5.
|
| 101 |
+
|
| 102 |
+
# 3.1 STEIN’S IDENTITY
|
| 103 |
+
|
| 104 |
+
Given a policy $\pi ( a | s )$ , Stein’s identity w.r.t $\pi$ is
|
| 105 |
+
|
| 106 |
+
$$
|
| 107 |
+
\mathbb { E } _ { \pi ( a | s ) } \left[ \nabla _ { a } \log \pi ( a | s ) \phi ( s , a ) + \nabla _ { a } \phi ( s , a ) \right] = 0 , \quad \forall s ,
|
| 108 |
+
$$
|
| 109 |
+
|
| 110 |
+
which holds for any real-valued function $\phi ( s , a )$ with some proper conditions. To see this, note the left hand side of Eq (5) is equivalent to $\begin{array} { r } { \int \nabla _ { a } \left( \pi ( a | s ) \phi ( s , a ) \right) d a } \end{array}$ , which equals zero if $\pi ( a | s ) \phi ( s , a )$ equals zero on the boundary of the integral domain, or decay sufficiently fast (e.g., exponentially) when the integral domain is unbounded.
|
| 111 |
+
|
| 112 |
+
The power of Stein’s identity lies in the fact that it defines an infinite set of identities, indexed by arbitrary function $\phi ( s , a )$ , which is sufficient to uniquely identify a distribution as shown in the work of Stein’s method for proving central limit theorems (Stein, 1986; Barbour & Chen, 2005), goodness-of-fit test (Chwialkowski et al., 2016; Liu et al., 2016), and approximate inference (Liu & Wang, 2016). Oates et al. (2017) has applied Stein’s identity as a control variate for general Monte Carlo estimation, which is shown to yield a zero-variance estimator because the control variate is flexible enough to approximate the function of interest arbitrarily well.
|
| 113 |
+
|
| 114 |
+
# 3.2 STEIN CONTROL VARIATE FOR POLICY GRADIENT
|
| 115 |
+
|
| 116 |
+
Unfortunately, for the particular case of policy gradient, it is not straightforward to directly apply Stein’s identity (5) as a control variate, since the dimension of the left-hand side of (5) does not match the dimension of a policy gradient: the gradient in (5) is taken w.r.t. the action $a$ , while the policy gradient in (1) is taken w.r.t. the parameter $\theta$ . Therefore, we need a general approach to connect $\nabla _ { a } \log \pi ( a | s )$ to $\nabla _ { \theta } \log \pi ( a | s )$ in order to apply Stein’s identity as a control variate for policy gradient. We show in the following theorem that this is possible when the policy is reparameterizable in that $a \sim \pi _ { \theta } ( a | s )$ can be viewed as generated by $a = f _ { \theta } ( s , \xi )$ where $\xi$ is a random noise drawn from some distribution independently of $\theta$ . With an abuse of notation, we denote by $\pi ( \boldsymbol { a } , \boldsymbol { \xi } | \boldsymbol { s } )$ the joint distribution of $( a , \xi )$ conditioned on $s$ , so that $\begin{array} { r } { \pi ( a | s ) = \int \pi ( a | s , \xi ) \pi ( \xi ) d \xi } \end{array}$ , where $\pi ( \xi )$ denotes the distribution generating $\xi$ and $\pi ( a | s , \xi ) = \delta ( a - f ( s , \xi ) )$ where $\delta$ is the Delta function.
|
| 117 |
+
|
| 118 |
+
Theorem 3.1. With the reparameterizable policy defined above, using Stein’s identity, we can derive
|
| 119 |
+
|
| 120 |
+
$$
|
| 121 |
+
{ { \mathbb E } } _ { \pi ( a | s ) } \left[ \nabla _ { \theta } \log \pi ( a | s ) \phi ( s , a ) \right] = { { \mathbb E } } _ { \pi ( a , \xi | s ) } \left[ \nabla _ { \theta } f _ { \theta } ( s , \xi ) \nabla _ { a } \phi ( s , a ) \right] .
|
| 122 |
+
$$
|
| 123 |
+
|
| 124 |
+
Proof. See Appendix for the detail proof. To help understand the intuition, we can consider the Delta function as a Gaussian with a small variance $\bar { h } ^ { 2 }$ , i.e. $\pi ( a | s , \xi ) \propto \exp ( - \| a - f ( s , \xi ) \| _ { 2 } ^ { 2 } / 2 h ^ { 2 } )$ , for which it is easy to show that
|
| 125 |
+
|
| 126 |
+
$$
|
| 127 |
+
\nabla _ { \theta } \log \pi ( a , \xi \mid s ) = - \nabla _ { \theta } f _ { \theta } ( s , \xi ) \nabla _ { a } \log \pi ( a , \xi \mid s ) .
|
| 128 |
+
$$
|
| 129 |
+
|
| 130 |
+
This allows us to convert between the derivative w.r.t. $a$ and w.r.t. $\theta$ , and apply Stein’s identity.
|
| 131 |
+
|
| 132 |
+
Stein Control Variate Using Eq (6) as a control variate, we obtain the following general formula of policy gradient:
|
| 133 |
+
|
| 134 |
+
$$
|
| 135 |
+
\nabla _ { \theta } J ( \theta ) = \mathbb { E } _ { \pi } \left[ \nabla _ { \theta } \log \pi ( a | s ) ( Q ^ { \pi } ( s , a ) - \phi ( s , a ) ) \ + \ \nabla _ { \theta } f _ { \theta } ( s , \xi ) \nabla _ { a } \phi ( s , a ) \right] ,
|
| 136 |
+
$$
|
| 137 |
+
|
| 138 |
+
where any fixed choice of $\phi$ does not introduce bias to the expectation. Given a sample set $( s _ { t } , a _ { t } , \xi _ { t } ) _ { t = 1 } ^ { n }$ where $a _ { t } = f _ { \theta } ( s _ { t } , \xi _ { t } )$ , an estimator of the gradient is
|
| 139 |
+
|
| 140 |
+
$$
|
| 141 |
+
\hat { \nabla } _ { \theta } J ( \theta ) = \frac { 1 } { n } \sum _ { t = 1 } ^ { n } \left[ \nabla _ { \theta } \log \pi ( a _ { t } \mid s _ { t } ) ( \hat { Q } ^ { \pi } ( s _ { t } , a _ { t } ) - \phi ( s _ { t } , a _ { t } ) ) + \nabla _ { \theta } f _ { \theta } ( s _ { t } , \xi _ { t } ) \nabla _ { a } \phi ( s _ { t } , a _ { t } ) \right] .
|
| 142 |
+
$$
|
| 143 |
+
|
| 144 |
+
This estimator clearly generalizes the control variates used in A2C and REINFORCE. To see this, let $\phi$ be action independent, i.e. $\phi ( s , a ) = \phi ( s )$ or even $\phi ( s , a ) = b$ , in both cases the last term in (9) equals to zero because $\nabla _ { a } \phi = 0$ . When $\phi$ is action-dependent, the last term (9) does not vanish in general, and in fact will play an important role for variance reduction as we will illustrate later.
|
| 145 |
+
|
| 146 |
+
Relation to Q-prop Q-prop is a recently introduced sample-efficient policy gradient method that constructs a general control variate using Taylor expansion. Here we show that $\mathbf { Q }$ -prop can be derived from (8) with a special $\phi$ that depends on the action linearly, so that its gradient w.r.t. $a$ is action-independent, i.e. $\nabla _ { a } \phi ( a , s ) = \varphi ( s )$ . In this case, Eq (8) becomes
|
| 147 |
+
|
| 148 |
+
$$
|
| 149 |
+
\nabla _ { \theta } J ( \theta ) = \mathbb { E } _ { \boldsymbol \pi } \left[ \nabla _ { \theta } \log \pi ( a | s ) ( Q ^ { \pi } ( s , a ) - \phi ( s , a ) ) \ + \ \nabla _ { \theta } f _ { \theta } ( s , \xi ) \varphi ( s ) \right] .
|
| 150 |
+
$$
|
| 151 |
+
|
| 152 |
+
Furthermore, note that $\mathbb { E } _ { \pi ( \xi ) } [ \nabla _ { \theta } f ( s , \xi ) ] = \nabla _ { \theta } \mathbb { E } _ { \pi ( \xi ) } [ f ( s , \xi ) ] : = \nabla _ { \theta } \mu _ { \pi } ( s ) ,$ , where $\mu _ { \pi } ( s )$ is the expectation of the action conditioned on $s$ . Therefore,
|
| 153 |
+
|
| 154 |
+
$$
|
| 155 |
+
\nabla _ { \theta } J ( \theta ) = \mathbb { E } _ { \boldsymbol { \pi } } \left[ \nabla _ { \theta } \log { \pi ( a | s ) } \left( Q ^ { \pi } ( s , a ) - \phi ( s , a ) \right) \ + \ \nabla _ { \theta } \mu _ { \pi } ( s ) \varphi ( s ) \right] ,
|
| 156 |
+
$$
|
| 157 |
+
|
| 158 |
+
which is the identity used in $\mathrm { Q }$ -prop to construct their control variate (see $\operatorname { E q } 6$ in Gu et al. 2016b). In Q-prop, the baseline function is constructed empirically by the first-order Taylor expansion as
|
| 159 |
+
|
| 160 |
+
$$
|
| 161 |
+
\phi ( s , a ) = \hat { V } ^ { \pi } ( s ) + \langle \nabla _ { a } \hat { Q } ^ { \pi } ( s , \mu _ { \pi } ( s ) ) , a - \mu _ { \pi } ( s ) \rangle ,
|
| 162 |
+
$$
|
| 163 |
+
|
| 164 |
+
where $\hat { V } ^ { \pi } ( s )$ and $\hat { Q } ^ { \pi } ( s , a )$ are parametric functions that approximate the value function and Q function under policy $\pi$ , respectively. In contrast, our method allows us to use more general and flexible, nonlinear baseline functions $\phi$ to construct the Stein control variate which is able to decrease the variance more significantly.
|
| 165 |
+
|
| 166 |
+
Relation to the reparameterization trick The identity (6) is closely connected to the reparameterization trick for gradient estimation which has been widely used in variational inference recently (Kingma & Welling, 2013; Rezende et al., 2014). Specifically, let us consider an auxiliary objective function based on function $\phi$ :
|
| 167 |
+
|
| 168 |
+
$$
|
| 169 |
+
L _ { s } ( \theta ) : = \mathbb { E } _ { \pi ( a \mid s ) } [ \phi ( s , a ) ] = \int \pi ( a \mid s ) \phi ( s , a ) d a .
|
| 170 |
+
$$
|
| 171 |
+
|
| 172 |
+
Then by the log-derivative trick, we can obtain the gradient of this objective function as
|
| 173 |
+
|
| 174 |
+
$$
|
| 175 |
+
\nabla _ { \theta } L _ { s } ( \theta ) = \int \nabla _ { \theta } \pi ( a | s ) \phi ( s , a ) d a = \mathbb { E } _ { \pi ( a | s ) } \left[ \nabla _ { \theta } \log \pi ( a | s ) \phi ( s , a ) \right] ,
|
| 176 |
+
$$
|
| 177 |
+
|
| 178 |
+
which is the left-hand side of (6). On the other hand, if $a \sim \pi ( a | s )$ can be parameterized by $a = f _ { \theta } ( s , \xi )$ , then $L _ { s } ( \theta ) = \mathbb { E } _ { \pi ( \xi ) } [ \phi ( s , f _ { \theta } ( s , \xi ) ) ]$ , leading to the reparameterized gradient in Kingma & Welling (2013):
|
| 179 |
+
|
| 180 |
+
$$
|
| 181 |
+
\nabla _ { \theta } L _ { s } ( \theta ) = \mathbb { E } _ { \pi ( a , \xi \mid s ) } \left[ \nabla _ { \theta } f _ { \theta } ( s , \xi ) \nabla _ { a } \phi ( s , a ) \right] .
|
| 182 |
+
$$
|
| 183 |
+
|
| 184 |
+
Equation (11) and (12) are equal to each other since both are $\nabla _ { \theta } L _ { s } ( \theta )$ . This provides another way to prove the identity in (6). The connection between Stein’s identity and the reparameterization trick that we reveal here is itself interesting, especially given that both of these two methods have been widely used in different areas.
|
| 185 |
+
|
| 186 |
+
# 3.3 CONSTRUCTING THE BASELINE FUNCTIONS FOR STEIN CONTROL VARIATE
|
| 187 |
+
|
| 188 |
+
We need to develop practical approaches to choose the baseline functions $\phi$ in order to fully leverage the power of the flexible Stein control variate. In practice, we assume a flexible parametric form $\phi _ { w } ( s , a )$ with parameter $w$ , e.g. linear functions or neural networks, and hope to optimize $w$ efficiently for variance reduction. Here we introduce two approaches for optimizing $w$ and discuss some practical considerations.
|
| 189 |
+
|
| 190 |
+
We should remark that if $\phi$ is constructed based on data $( s _ { t } , a _ { t } ) _ { t = 1 } ^ { n }$ , it introduces additional dependency and (4) is no longer an unbiased estimator theoretically. However, the bias introduced this way is often negligible in practice (see e.g., Section 2.3.4 of Oates & Girolami (2016)). For policy gradient, this bias can be avoided by estimating $\phi$ based on the data from the previous iteration.
|
| 191 |
+
|
| 192 |
+
Estimating $\phi$ by Fitting Q Function Eq (8) provides an interpolation between the log-likelihood ratio policy gradient (1) (by taking $\phi = 0$ ) and a reparameterized policy gradient as follows (by taking $\phi ( \dot { s , } \bar { a ) } = Q ^ { \pi } ( s , a ) )$ :
|
| 193 |
+
|
| 194 |
+
$$
|
| 195 |
+
\nabla _ { \theta } J ( \theta ) = \mathbb { E } _ { \pi } [ \nabla _ { \theta } f ( s , \xi ) \nabla _ { a } Q ^ { \pi } ( s , a ) ] .
|
| 196 |
+
$$
|
| 197 |
+
|
| 198 |
+
It is well known that the reparameterized gradient tends to yield much smaller variance than the log-likelihood ratio gradient from the variational inference literature (see e.g., Kingma & Welling, 2013; Rezende et al., 2014; Roeder et al., 2017; Tucker et al., 2017). An intuitive way to see this is to consider the extreme case when the policy is deterministic. In this case the variance of (11) is infinite because $\log \pi ( a | s )$ is either infinite or does not exist, while the variance of (12) is zero because $\xi$ is deterministic. Because optimal policies often tend to be close to deterministic, the reparameterized gradient should be favored for smaller variance.
|
| 199 |
+
|
| 200 |
+
Therefore, one natural approach is to set $\phi$ to be close to $\mathrm { Q }$ function, that is, $\phi ( s , a ) = \hat { Q } ^ { \pi } ( s , a )$ so that the log-likelihood ratio term is small. Any methods for $\mathrm { Q }$ function estimation can be used. In our experiments, we optimize the parameter $w$ in $\phi _ { w } ( s , a )$ by
|
| 201 |
+
|
| 202 |
+
$$
|
| 203 |
+
\operatorname* { m i n } _ { w } \sum _ { t = 1 } ^ { n } ( \phi _ { w } ( s _ { t } , a _ { t } ) - R _ { t } ) ^ { 2 } ,
|
| 204 |
+
$$
|
| 205 |
+
|
| 206 |
+
where $R _ { t }$ an estimate of the reward starting from $\left( { { s _ { t } } , { a _ { t } } } \right)$ . It is worth noticing that with deterministic policies, (13) is simplified to the update of deep deterministic policy gradient (DDPG) (Lillicrap et al., 2015; Silver et al., 2014). However, DDPG directly plugs an estimator $\hat { Q } ^ { \pi } ( s , a )$ into (13) to estimate the gradient, which may introduce a large bias; our formula (8) can be viewed as correcting this bias in the reparameterized gradient using the log-likelihood ratio term.
|
| 207 |
+
|
| 208 |
+
Estimating $\phi$ by Minimizing the Variance Another approach for obtaining $\phi$ is to directly minimize the variance of the gradient estimator. Note that $\mathrm { v a r } ( \hat { \nabla } _ { \boldsymbol { \theta } } J ( \boldsymbol { \theta } ) ) = \mathbb { E } [ ( \hat { \nabla } _ { \boldsymbol { \theta } } J ( \boldsymbol { \theta } ) ) ^ { 2 } ] - \mathbb { E } [ \hat { \nabla } _ { \boldsymbol { \theta } } J ( \boldsymbol { \theta } ) ] ^ { 2 }$ . Since $\mathbb { E } [ \hat { \nabla } _ { \boldsymbol { \theta } } J ( \boldsymbol { \theta } ) ] = \nabla _ { \boldsymbol { \theta } } J ( \boldsymbol { \theta } )$ which does not depend on $\phi$ , it is sufficient to minimize the first term. Specifically, for $\phi _ { w } ( s , a )$ we optimize $w$ by
|
| 209 |
+
|
| 210 |
+
$$
|
| 211 |
+
\operatorname* { m i n } _ { w } \sum _ { t = 1 } ^ { n } \Big \| \nabla _ { \theta } \log \pi ( a _ { t } \mid s _ { t } ) \left( \hat { Q } ^ { \pi } ( s _ { t } , a _ { t } ) - \phi _ { w } ( s _ { t } , a _ { t } ) \right) + \nabla _ { \theta } f ( s _ { t } , \xi _ { t } ) \nabla _ { a } \phi _ { w } ( s _ { t } , a _ { t } ) \Big \| _ { 2 } ^ { 2 } .
|
| 212 |
+
$$
|
| 213 |
+
|
| 214 |
+
In practice, we find that it is difficult to implement this efficiently using the auto-differentiation in the current deep learning platforms because it involves derivatives w.r.t. both $\theta$ and $a$ . We develop a computational efficient approximation for the special case of Gaussian policy in Section 3.4.
|
| 215 |
+
|
| 216 |
+
Architectures of $\phi$ Given the similarity between $\phi$ and the Q function as we mentioned above, we may decompose $\phi$ into
|
| 217 |
+
|
| 218 |
+
$$
|
| 219 |
+
\phi _ { w } ( s , a ) = \hat { V } ^ { \pi } ( s ) + \psi _ { w } ( s , a ) .
|
| 220 |
+
$$
|
| 221 |
+
|
| 222 |
+
The term $\hat { V } ^ { \pi } ( s )$ is parametric function approximation of the value function which we separately estimate in the same way as in A2C, and $w$ is optimized using the method above with fixed $\hat { V } ^ { \pi } ( s )$ . Here the function $\psi _ { w } ( s , a )$ can be viewed as an estimate of the advantage function, whose parameter $w$ is optimized using the two optimization methods introduced above. To see, we rewrite our gradient estimator to be
|
| 223 |
+
|
| 224 |
+
$$
|
| 225 |
+
\hat { \nabla } _ { \theta } J ( \theta ) = \frac { 1 } { n } \sum _ { t = 1 } ^ { n } \left[ \nabla _ { \theta } \log \pi ( a _ { t } \mid s _ { t } ) ( \hat { A } ^ { \pi } ( s _ { t } , a _ { t } ) - \psi _ { w } ( s _ { t } , a _ { t } ) ) + \nabla _ { \theta } f _ { \theta } ( s _ { t } , \xi _ { t } ) \nabla _ { a } \psi _ { w } ( s _ { t } , a _ { t } ) \right] ,
|
| 226 |
+
$$
|
| 227 |
+
|
| 228 |
+
where ${ \hat { A } } ^ { \pi } ( s _ { t } , a _ { t } ) = { \hat { Q } } ^ { \pi } ( s _ { t } , a _ { t } ) - { \hat { V } } ^ { \pi } ( s _ { t } )$ is an estimator of the advantage function. If we set $\psi _ { w } ( s , a ) = 0$ , then Eq (16) clearly reduces to A2C. We find that separating $\hat { V } ^ { \pi } ( s )$ from $\psi _ { w } ( s , a )$ works well in practice, because it effectively provides a useful initial estimation of $\phi$ , and allows us to directly improve the $\phi$ on top of the value function baseline.
|
| 229 |
+
|
| 230 |
+
# 3.4 STEIN CONTROL VARIATE FOR GAUSSIAN POLICIES
|
| 231 |
+
|
| 232 |
+
Gaussian policies have been widely used and are shown to perform efficiently in many practical continuous reinforcement learning settings. Because of their wide applicability, we derive the gradient estimator with the Stein control variate for Gaussian policies here and use it in our experiments.
|
| 233 |
+
|
| 234 |
+
Specifically, Gaussian policies take the form $\pi ( a \mid s ) = \mathcal { N } ( a ; \mu _ { \theta _ { 1 } } ( s ) , \Sigma _ { \theta _ { 2 } } ( s ) )$ , where mean $\mu$ and covariance matrix $\Sigma$ are often assumed to be parametric functions with parameters $\theta = \left[ \theta _ { 1 } , \theta _ { 2 } \right]$ . This is equivalent to generating $a$ by $a = f _ { \theta } ( s , \xi ) = \mu _ { \theta _ { 1 } } ( s ) + \Sigma _ { \theta _ { 2 } } ( s ) ^ { 1 / 2 } \xi$ , where $\xi \sim \mathcal { N } ( 0 , 1 )$ . Following Eq (8), the policy gradient w.r.t. the mean parameter $\theta _ { 1 }$ is
|
| 235 |
+
|
| 236 |
+
$$
|
| 237 |
+
\nabla _ { \theta _ { 1 } } J ( \theta ) = \mathbb { E } _ { \boldsymbol { \pi } } [ \nabla _ { \theta _ { 1 } } \log \pi ( a | s ) ( Q ^ { \pi } ( s , a ) - \phi ( s , a ) ) + \phantom { \sum _ { a } J ( \theta _ { 1 } ) \sum _ { a } J ( \theta _ { 2 } ) } \cdot \boldsymbol { \pi } _ { a } ) \cdot \sum _ { \theta = 1 } ^ { J } \phi ( s , a ) ] .
|
| 238 |
+
$$
|
| 239 |
+
|
| 240 |
+
For each coordinate $\theta _ { \ell }$ in the variance parameter $\theta _ { 2 }$ , its gradient is computed as
|
| 241 |
+
|
| 242 |
+
$$
|
| 243 |
+
\nabla _ { \theta _ { \xi } } J ( \theta ) = \mathbb { E } _ { \pi } \left[ \nabla _ { \theta _ { \xi } } \log \pi ( a | s ) \left( Q ^ { \pi } ( s , a ) - \phi ( s , a ) \right) - \frac { 1 } { 2 } \left. \nabla _ { a } \log \pi ( a | s ) \nabla _ { a } \phi ( s , a ) ^ { \top } , \nabla _ { \theta _ { \xi } } \Sigma \right. \right] ,
|
| 244 |
+
$$
|
| 245 |
+
|
| 246 |
+
where $\langle A , B \rangle : = \operatorname { t r a c e } ( A B )$ for two $d _ { a } \times d _ { a }$ matrices.
|
| 247 |
+
|
| 248 |
+
Note that the second term in (18) contains $\nabla _ { a } \log \pi ( a | s )$ ; we can further apply Stein’s identity on it to obtain a simplified formula
|
| 249 |
+
|
| 250 |
+
$$
|
| 251 |
+
\nabla _ { \theta _ { \varepsilon } } J ( \theta ) = \mathbb { E } _ { \pi } \left[ \nabla _ { \theta _ { \varepsilon } } \log \pi ( a | s ) \left( Q ^ { \pi } ( s , a ) - \phi ( s , a ) \right) \ + \ { \frac { 1 } { 2 } } \left. \nabla _ { a , a } \phi ( s , a ) , \ \nabla _ { \theta _ { \varepsilon } } \Sigma \right. \right] .
|
| 252 |
+
$$
|
| 253 |
+
|
| 254 |
+
The estimator in (19) requires to evaluate the second order derivative $\nabla _ { a , a } \phi$ , but may have lower variance compared to that in (18). To see this, note that if $\phi ( s , a )$ is a linear function of $a$ (like the case of Q-prop), then the second term in (19) vanishes to zero, while that in (18) does not.
|
| 255 |
+
|
| 256 |
+
We also find it is practically convenient to estimate the parameters $w$ in $\phi$ by minimizing $\mathrm { v a r } ( \hat { \nabla } _ { \mu } J ) +$ $\mathrm { v a r } ( \hat { \nabla } _ { \Sigma } J )$ , instead of the exact variance $\mathrm { v a r } ( \hat { \nabla } _ { \theta } J )$ . Further details can be found in Appendix 7.2.
|
| 257 |
+
|
| 258 |
+
# 3.5 PPO WITH STEIN CONTROL VARIATE
|
| 259 |
+
|
| 260 |
+
Proximal Policy Optimization (PPO) (Schulman et al., 2017; Heess et al., 2017) is recently introduced for policy optimization. It uses a proximal Kullback-Leibler (KL) divergence penalty to regularize and stabilize the policy gradient update. Given an existing policy $\pi _ { \mathrm { o l d } }$ , PPO obtains a new policy by maximizing the following surrogate loss function
|
| 261 |
+
|
| 262 |
+
$$
|
| 263 |
+
J _ { \mathrm { p p o } } ( \theta ) = \mathbb { E } _ { \pi _ { \mathrm { o l d } } } \left[ \frac { \pi _ { \theta } ( a | s ) } { \pi _ { \mathrm { o l d } } ( a | s ) } Q ^ { \pi } ( s , a ) - \lambda \mathrm { K L } \left[ \pi _ { \mathrm { o l d } } ( \cdot | s ) \ | | \ \pi _ { \theta } ( \cdot | s ) \right] \right] ,
|
| 264 |
+
$$
|
| 265 |
+
|
| 266 |
+
where the first term is an approximation of the expected reward, and the second term enforces the the updated policy to be close to the previous policy under KL divergence. The gradient of $J _ { \mathrm { p p o } } ( \theta )$ can be rewritten as
|
| 267 |
+
|
| 268 |
+
$$
|
| 269 |
+
\nabla _ { \boldsymbol { \theta } } J _ { \mathrm { p p o } } ( \boldsymbol { \theta } ) = \mathbb { E } _ { \pi _ { \mathrm { o l d } } } \bigg [ w _ { \pi } ( s , a ) \nabla _ { \boldsymbol { \theta } } \log \pi ( a | s ) Q _ { \lambda } ^ { \pi } ( s , a ) \bigg ]
|
| 270 |
+
$$
|
| 271 |
+
|
| 272 |
+
where $w _ { \pi } ( s , a ) : = \pi _ { \theta } ( a | s ) / \pi _ { \mathrm { o l d } } ( a | s )$ is the density ratio of the two polices, and $Q _ { \lambda } ^ { \pi } ( s , a ) : =$ $Q ^ { \pi } ( s , a ) \ + \ \lambda w _ { \pi } ( s , a ) ^ { - 1 }$ where the second term comes from the $\mathrm { K L }$ penalty. Note that $\mathbb { E } _ { \pi _ { \mathrm { o l d } } } [ w _ { \pi } ( s , a ) f ( s , a ) ] = \mathbb { E } _ { \pi } [ f ( s , a ) ]$ by canceling the density ratio. Applying (6), we obtain
|
| 273 |
+
|
| 274 |
+
$$
|
| 275 |
+
\begin{array} { r l } & { \nabla _ { \theta } J _ { \mathrm { p p o } } ( \theta ) = \mathbb { E } _ { \pi _ { \mathrm { o d d } } } \bigg [ w _ { \pi } ( s , a ) \bigg ( \nabla _ { \theta } \log \pi ( a | s ) \big ( Q _ { \lambda } ^ { \pi } ( s , a ) - \phi ( s , a ) \big ) \ + \ \nabla _ { \theta } f _ { \theta } ( s , a ) \nabla _ { a } \phi ( s , a ) \bigg ) \bigg ] . } \end{array}
|
| 276 |
+
$$
|
| 277 |
+
|
| 278 |
+
Putting everything together, we summarize our PPO algorithm with Stein control variates in Algorithm 1. It is also straightforward to integrate the Stein control variate with TRPO.
|
| 279 |
+
|
| 280 |
+
# 4 RELATED WORK
|
| 281 |
+
|
| 282 |
+
Stein’s identity has been shown to be a powerful tool in many areas of statistical learning and inference. An incomplete list includes Gorham & Mackey (2015), Oates et al. (2017), Oates et al. (2016), Chwialkowski et al. (2016), Liu et al. (2016), Sedghi et al. (2016), Liu & Wang (2016), Feng et al. (2017), Liu & Lee (2017). This work was originally motivated by Oates et al. (2017), which uses Stein’s identity as a control variate for general Monte Carlo estimation. However, as discussed in Section 3.1, the original formulation of Stein’s identity can not be directly applied to policy gradient, and we need the mechanism introduced in (6) that also connects to the reparameterization trick (Kingma & Welling, 2013; Rezende et al., 2014).
|
| 283 |
+
|
| 284 |
+
Control variate method is one of the most widely used variance reduction techniques in policy gradient (see e.g., Greensmith et al., 2004). However, action-dependent baselines have not yet been well
|
| 285 |
+
|
| 286 |
+
Algorithm 1 PPO with Control Variate through Stein’s Identity (the PPO procedure is adapted from Algorithm 1 in Heess et al. 2017)
|
| 287 |
+
|
| 288 |
+
<table><tr><td>repeat</td><td></td></tr><tr><td>Run policy Tθ for n timesteps,collecting {St,at,Et,rt},where &t is the random seed that generates action at,i.e.,at=fe(st,t).SetTold←Tθ.</td><td></td></tr><tr><td>// Updating the baseline functionΦ forK iterations do</td><td></td></tr><tr><td>Update w by one stochastic gradient descent step according to (14),or (15),or (27) for Gaussian</td><td></td></tr><tr><td>policies. end for</td><td></td></tr><tr><td></td><td></td></tr><tr><td>// Updating the policy T for M iterations do</td><td></td></tr><tr><td></td><td>Update θ by one stochastic gradient descent step with (2O)(adapting it with (17)and (19) for Gaussian</td></tr><tr><td>policies). end for</td><td></td></tr><tr><td>// Adjust the KL penalty coefficient X</td><td></td></tr><tr><td>ifKL[πold|πe]> βhighKLtarget then</td><td></td></tr><tr><td>>←α></td><td></td></tr><tr><td>else ifKL[πold|πe]< βlowKLtarget then</td><td></td></tr><tr><td>入←>/α</td><td></td></tr><tr><td>end if</td><td></td></tr><tr><td>until Convergence</td><td></td></tr></table>
|
| 289 |
+
|
| 290 |
+
studied. Besides Q-prop (Gu et al., 2016b) which we draw close connection to, the work of Thomas & Brunskill (2017) also suggests a way to incorporate action-dependent baselines, but is restricted to the case of compatible function approximation. More recently, Tucker et al. (2017) studied a related action-dependent control variate for discrete variables in learning latent variable models.
|
| 291 |
+
|
| 292 |
+
Recently, Gu et al. (2017) proposed an interpolated policy gradient (IPG) framework for integrating on-policy and off-policy estimates that generalizes various algorithms including DDPG and Q-prop. If we set $\nu = 1$ and $p ^ { \bar { \pi } } = p ^ { \beta }$ (corresponding to using off-policy data purely) in IPG, it reduces to a special case of (16) with $\bar { \psi } _ { w } ( s , a ) \bar { = } Q _ { w } ( \bar { s } , a ) - \bar { \mathbb { E } _ { \pi ( a | s ) } } \bar { [ } Q _ { w } ( s , a ) ]$ where $Q _ { w }$ an approximation of the Q-function. However, the emphasis of Gu et al. (2017) is on integrating on-policy and offpolicy estimates, generally yielding theoretical bias, and the results of the case when $\nu = 1$ and $\stackrel { \bullet } { p ^ { \pi } } \stackrel { \bullet } { = } p ^ { \beta }$ were not reported. Our work presents the result that shows significant improvement of sample efficiency in policy gradient by using nonlinear, action-dependent control variates.
|
| 293 |
+
|
| 294 |
+
In parallel to our work, there have been some other works discovered action-dependent baselines for policy-gradient methods in reinforcement learning. Such works include Grathwohl et al. (2018) which train an action-dependent baseline for both discrete and continuous control tasks. Wu et al. (2018) exploit per-dimension independence of the action distribution to produce an action-dependent baseline in continuous control tasks.
|
| 295 |
+
|
| 296 |
+
# 5 EXPERIMENTS
|
| 297 |
+
|
| 298 |
+
We evaluated our control variate method when combining with PPO and TRPO on continuous control environments from the OpenAI Gym benchmark (Brockman et al., 2016) using the MuJoCo physics simulator (Todorov et al., 2012). We show that by using our more flexible baseline functions, we can significantly improve the sample efficiency compared with methods based on the typical value function baseline and Q-prop.
|
| 299 |
+
|
| 300 |
+
All our experiments use Gaussian policies. As suggested in Section 3.3, we assume the baseline to have a form of $\phi _ { w } ( s , a ) = \hat { V } ^ { \pi } ( s ) \bar { + } \psi _ { w } ( s , a )$ , where ${ \hat { V } } ^ { \pi }$ is the valued function estimated separately in the same way as the value function baseline, and $\psi _ { w } ( s , a )$ is a parametric function whose value $w$ is decided by minimizing either Eq (14) (denoted by FitQ), or Eq (27) designed for Gaussian policy (denoted by MinVar). We tested three different architectures of $\psi _ { w } ( s , a )$ , including
|
| 301 |
+
|
| 302 |
+
Linear. $\psi _ { w } ( s , a ) = \langle \nabla _ { a } q _ { w } ( a , \mu _ { \pi } ( s ) )$ , $( a - \mu _ { \pi } ( s ) ) \rangle$ , where $q _ { w }$ is a parametric function designed for estimating the Q function $Q ^ { \pi }$ . This structure is motivated by Q-prop, which estimates $w$ by fitting $q _ { w } ( s , a )$ with $Q ^ { \pi }$ . Our MinVar, and FitQ methods are different in that they optimize $w$ as a part of $\phi _ { w } ( s , a )$ by minimizing the objective in Eq (14) and Eq (27). We show in Section 5.2 that our optimization methods yield better performance than Q-prop even with the same architecture of $\psi _ { w }$ . This is because our methods directly optimize for the baseline function $\phi _ { w } ( s , a )$ , instead of $q _ { w } ( s , a )$ which serves an intermediate step.
|
| 303 |
+
|
| 304 |
+

|
| 305 |
+
Figure 1: The variance of gradient estimators of different control variates under a fixed policy obtained by running vanilla PPO for 200 iterations in the Walker2d-v1 environment.
|
| 306 |
+
|
| 307 |
+
Quadratic. $\psi _ { w } ( s , a ) = - ( a - \mu _ { w } ( s ) ) ^ { \top } \Sigma _ { w } ^ { - 1 } ( a - \mu _ { w } ( s ) )$ . In our experiments, we set $\mu _ { w } ( s )$ to be a neural network, and $\Sigma _ { w }$ a positive diagonal matrix that is independent of the state $s$ . This is motivated by the normalized advantage function in Gu et al. (2016a).
|
| 308 |
+
|
| 309 |
+
MLP. $\psi _ { w } ( s , a )$ is assumed to be a neural network in which we first encode the state $s$ with a hidden layer, and then concatenate it with the action $a$ and pass them into another hidden layer before the output.
|
| 310 |
+
|
| 311 |
+
Further, we denote by Value the typical value function baseline, which corresponds to setting $\psi _ { w } ( s , a ) = 0$ in our case. For the variance parameters $\theta _ { 2 }$ of the Gaussian policy, we use formula (19) for Linear and Quadratic, but (18) for MLP due to the difficulty of calculating the second order derivative $\nabla _ { a , a } \psi _ { w } ( s , a )$ in MLP. All the results we report are averaged over three random seeds. See Appendix for implementation details.
|
| 312 |
+
|
| 313 |
+
# 5.1 COMPARING THE VARIANCE OF DIFFERENT GRADIENT ESTIMATORS
|
| 314 |
+
|
| 315 |
+
We start with comparing the variance of the gradient estimators with different control variates. Figure 1 shows the results on Walker2d-v1, when we take a fixed policy obtained by running the vanilla PPO for 2000 steps and evaluate the variance of the different gradient estimators under different sample size $n$ . In order to obtain unbiased estimates of the variance, we estimate all the baseline functions using a hold-out dataset with a large sample size. We find that our methods, especially those using the MLP and Quadratic baselines, obtain significantly lower variance than the typical value function baseline methods. In our other experiments of policy optimization, we used the data from the current policy to estimate $\phi$ , which introduces a small bias theoretically, but was found to perform well empirically (see Appendix 7.4 for more discussion on this issue).
|
| 316 |
+
|
| 317 |
+
# 5.2 COMPARISON WITH Q-PROP USING TRPO FOR POLICY OPTIMIZATION
|
| 318 |
+
|
| 319 |
+
Next we want to check whether our Stein control variate will improve the sample efficiency of policy gradient methods over existing control variate, e.g. Q-prop (Gu et al., 2016b). One major advantage of Q-prop is that it can leverage the off-policy data to estimate $q _ { w } ( s , a )$ . Here we compare our methods with the original implementation of Q-prop which incorporate this feature for policy optimization. Because the best existing version of Q-prop is implemented with TRPO, we implement a variant of our method with TRPO for fair comparison. The results on Hopper-v1 and Walker2d-v1 are shown in Figure 2, where we find that all Stein control variates, even including Fit $\mathsf { Q } +$ Linear and MinVar+Linear, outperform Q-prop on both tasks. This is somewhat surprising because the Q-prop compared here utilizes both on-policy and off-policy data to update $w$ , while our methods use only on-policy data. We expect that we can further boost the performance by leveraging the offpolicy data properly, which we leave it for future work. In addition, we noticed that the Quadratic baseline generally does not perform as well as it promises in Figure 1; this is probably because that in the setting of policy training we optimize $\phi _ { w }$ for less number of iterations than what we do for evaluating a fixed policy in Figure 1, and it seems that Quadratic requires more iterations than MLP to converge well in practice.
|
| 320 |
+
|
| 321 |
+

|
| 322 |
+
Figure 2: Evaluation of TRPO with Q-prop and Stein control variates on Hopper-v1 and Walker2d-v1.
|
| 323 |
+
|
| 324 |
+
Table 1: Results of different control variates and methods for optimizing $\phi$ , when combined with PPO. The reported results are the average reward at the 10000k-th time step on Humanoid-v1 and the $5 0 0 0 \mathrm { k }$ -th time step on HumanoidStandup-v1.
|
| 325 |
+
|
| 326 |
+
<table><tr><td></td><td>Humanoid-v1</td><td colspan="2">HumanoidStandup-v1</td></tr><tr><td>Function</td><td>MinVar FitQ</td><td>MinVar</td><td>FitQ</td></tr><tr><td rowspan="3">MLP Quadratic Linear</td><td>3847 ± 249.3 3334 ± 695.7</td><td>143314 ± 9471</td><td>139315 ± 10527</td></tr><tr><td>2356 ± 294.7 3563 ± 235.1</td><td>117962 ± 5798</td><td>141692 ± 3489</td></tr><tr><td>2547± 701.8 3404 土</td><td>129393 土 18574</td><td>132112 土 11450</td></tr><tr><td>Value</td><td>2207 士 554</td><td colspan="2">128765 士 13440</td></tr></table>
|
| 327 |
+
|
| 328 |
+
# 5.3 PPO WITH DIFFERENT CONTROL VARIATES
|
| 329 |
+
|
| 330 |
+
Finally, we evaluate the different Stein control variates with the more recent proximal policy optimization (PPO) method which generally outperforms TRPO. We first test all the three types of $\phi$ listed above on Humanoid-v1 and HumanoidStandup-v1, and present the results in Table 1. We can see that all the three types of Stein control variates consistently outperform the value function baseline, and Quadratic and MLP tend to outperform Linear in general.
|
| 331 |
+
|
| 332 |
+
We further evaluate our methods on a more extensive list of tasks shown in Figure 3, where we only show the result of PPO+MinVar+MLP and $\mathtt { P P O + F i t Q + M L P }$ which we find tend to perform the best according to Table 1. We can see that our methods can significantly outperform PPO+Value which is the vanilla PPO with the typical value function baseline (Heess et al., 2017).
|
| 333 |
+
|
| 334 |
+
It seems that MinVar tends to work better with MLP while FitQ works better with Quadratic in our settings. In general, we find that MinVar+MLP tends to perform the best in most cases. Note that the MinVar here is based on minimizing the approximate objective (27) specific to Gaussian policy, and it is possible that we can further improve the performance by directly minimizing the exact objective in (15) if an efficient implementation is made possible. We leave this a future direction.
|
| 335 |
+
|
| 336 |
+

|
| 337 |
+
Figure 3: Evaluation of PPO with the value function baseline and Stein control variates across different Mujoco environments: HumanoidStandup-v1, Humanoid-v1, Walker2d-v1, Ant-v1 and Hopper-v1, HalfCheetah-v1.
|
| 338 |
+
|
| 339 |
+
# 6 CONCLUSION
|
| 340 |
+
|
| 341 |
+
We developed the Stein control variate, a new and general variance reduction method for obtaining sample efficiency in policy gradient methods. Our method generalizes several previous approaches. We demonstrated its practical advantages over existing methods, including Q-prop and value-function control variate, in several challenging RL tasks. In the future, we will investigate how to further boost the performance by utilizing the off-policy data, and search for more efficient ways to optimize $\phi$ . We would also like to point out that our method can be useful in other challenging optimization tasks such as variational inference and Bayesian optimization where gradient estimation from noisy data remains a major challenge.
|
| 342 |
+
|
| 343 |
+
# REFERENCES
|
| 344 |
+
|
| 345 |
+
Kavosh Asadi, Cameron Allen, Melrose Roderick, Abdel-rahman Mohamed, George Konidaris, and Michael Littman. Mean actor critic. arXiv preprint arXiv:1709.00503, 2017.
|
| 346 |
+
Andrew D Barbour and Louis Hsiao Yun Chen. An introduction to Stein’s method, volume 4. World Scientific, 2005.
|
| 347 |
+
Greg Brockman, Vicki Cheung, Ludwig Pettersson, Jonas Schneider, John Schulman, Jie Tang, and Wojciech Zaremba. Openai gym, 2016.
|
| 348 |
+
Kacper Chwialkowski, Heiko Strathmann, and Arthur Gretton. A kernel test of goodness of fit. In International Conference on Machine Learning, pp. 2606–2615, 2016.
|
| 349 |
+
Yihao Feng, Dilin Wang, and Qiang Liu. Learning to draw samples with amortized stein variational gradient descent. Conference on Uncertainty in Artificial Intelligence (UAI), 2017.
|
| 350 |
+
Jackson Gorham and Lester Mackey. Measuring sample quality with stein’s method. In Advances in Neural Information Processing Systems, pp. 226–234, 2015.
|
| 351 |
+
Will Grathwohl, Dami Choi, Yuhuai Wu, Geoff Roeder, and David Duvenaud. Backpropagation through the void: Optimizing control variates for black-box gradient estimation. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum? id ${ . } = { }$ SyzKd1bCW.
|
| 352 |
+
|
| 353 |
+
Evan Greensmith, Peter L Bartlett, and Jonathan Baxter. Variance reduction techniques for gradient estimates in reinforcement learning. Journal of Machine Learning Research, 5(Nov):1471–1530, 2004.
|
| 354 |
+
|
| 355 |
+
Shixiang Gu, Timothy Lillicrap, Ilya Sutskever, and Sergey Levine. Continuous deep q-learning with model-based acceleration. In International Conference on Machine Learning, pp. 2829– 2838, 2016a.
|
| 356 |
+
|
| 357 |
+
Shixiang Gu, Timothy P. Lillicrap, Zoubin Ghahramani, Richard E. Turner, and Sergey Levine. Q-prop: Sample-efficient policy gradient with an off-policy critic. International Conference on Learning Representations (ICLR), 2016b.
|
| 358 |
+
|
| 359 |
+
Shixiang Gu, Timothy Lillicrap, Zoubin Ghahramani, Richard E Turner, Bernhard Scholkopf, and ¨ Sergey Levine. Interpolated policy gradient: Merging on-policy and off-policy gradient estimation for deep reinforcement learning. Advances in Neural Information Processing Systems, 2017.
|
| 360 |
+
|
| 361 |
+
Nicolas Heess, Srinivasan Sriram, Jay Lemmon, Josh Merel, Greg Wayne, Yuval Tassa, Tom Erez, Ziyu Wang, Ali Eslami, Martin Riedmiller, et al. Emergence of locomotion behaviours in rich environments. arXiv preprint arXiv:1707.02286, 2017.
|
| 362 |
+
|
| 363 |
+
Sham M Kakade. A natural policy gradient. In Advances in Neural Information Processing Systems, pp. 1531–1538, 2002.
|
| 364 |
+
|
| 365 |
+
Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. Proceedings of the 3rd International Conference on Learning Representations (ICLR), 2014.
|
| 366 |
+
|
| 367 |
+
Diederik P Kingma and Max Welling. Auto-encoding variational bayes. Proceedings of the 2nd International Conference on Learning Representations (ICLR), 2013.
|
| 368 |
+
|
| 369 |
+
Timothy P. Lillicrap, Jonathan J. Hunt, Alexander Pritzel, Nicolas Heess, Tom Erez, Yuval Tassa, David Silver, and Daan Wierstra. Continuous control with deep reinforcement learning. Proceedings of the 2nd International Conference on Learning Representations (ICLR), 2015.
|
| 370 |
+
|
| 371 |
+
Qiang Liu and Jason D Lee. Black-box importance sampling. International Conference on Artificial Intelligence and Statistics, 2017.
|
| 372 |
+
|
| 373 |
+
Qiang Liu and Dilin Wang. Stein variational gradient descent: A general purpose bayesian inference algorithm. In Advances in Neural Information Processing Systems, 2016.
|
| 374 |
+
|
| 375 |
+
Qiang Liu, Jason Lee, and Michael Jordan. A kernelized stein discrepancy for goodness-of-fit tests. In International Conference on Machine Learning, pp. 276–284, 2016.
|
| 376 |
+
|
| 377 |
+
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.
|
| 378 |
+
|
| 379 |
+
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.
|
| 380 |
+
|
| 381 |
+
Chris J. Oates and Mark A. Girolami. Control functionals for quasi-monte carlo integration. In International Conference on Artificial Intelligence and Statistics, 2016.
|
| 382 |
+
|
| 383 |
+
Chris J Oates, Jon Cockayne, Franc¸ois-Xavier Briol, and Mark Girolami. Convergence rates for a class of estimators based on stein’s identity. arXiv preprint arXiv:1603.03220, 2016.
|
| 384 |
+
|
| 385 |
+
Chris J Oates, Mark Girolami, and Nicolas Chopin. Control functionals for monte carlo integration. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 79(3):695–718, 2017.
|
| 386 |
+
|
| 387 |
+
Danilo Jimenez Rezende, Shakir Mohamed, and Daan Wierstra. Stochastic backpropagation and approximate inference in deep generative models. Proceedings of the 31st International Conference on Machine Learning (ICML), 2014.
|
| 388 |
+
|
| 389 |
+
Geoffrey Roeder, Yuhuai Wu, and David K. Duvenaud. Sticking the landing: An asymptotically zero-variance gradient estimator for variational inference. Advances in Neural Information Processing Systems, 2017.
|
| 390 |
+
|
| 391 |
+
John Schulman, Sergey Levine, Philipp Moritz, Michael I. Jordan, and Pieter Abbeel. Trust region policy optimization. In International Conference on Machine Learning, 2015.
|
| 392 |
+
|
| 393 |
+
John Schulman, Philipp Moritz, Sergey Levine, Michael Jordan, and Pieter Abbeel. Highdimensional continuous control using generalized advantage estimation. International Conference of Learning Representations (ICLR), 2016.
|
| 394 |
+
|
| 395 |
+
John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. Proximal policy optimization algorithms. Advances in Neural Information Processing Systems, 2017.
|
| 396 |
+
|
| 397 |
+
Hanie Sedghi, Majid Janzamin, and Anima Anandkumar. Provable tensor methods for learning mixtures of generalized linear models. In International Conference on Artificial Intelligence and Statistics, 2016.
|
| 398 |
+
|
| 399 |
+
David Silver, Guy Lever, Nicolas Heess, Thomas Degris, Daan Wierstra, and Martin Riedmiller. Deterministic policy gradient algorithms. In Proceedings of the 31st International Conference on Machine Learning (ICML), pp. 387–395, 2014.
|
| 400 |
+
|
| 401 |
+
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.
|
| 402 |
+
|
| 403 |
+
David Silver, Julian Schrittwieser, Karen Simonyan, Ioannis Antonoglou, Aja Huang, Arthur Guez, Thomas Hubert, Lucas Baker, Matthew Lai, Adrian Bolton, Yutian Chen, Timothy Lillicrap, Fan Hui, Laurent Sifre, George van den Driessche, Thore Graepel, and Demis Hassabis. Mastering the game of go without human knowledge. Nature, 550(7676):354–359, Oct 2017. ISSN 0028-0836.
|
| 404 |
+
|
| 405 |
+
Charles Stein. Approximate computation of expectations. Lecture Notes-Monograph Series, 7: i–164, 1986.
|
| 406 |
+
|
| 407 |
+
Richard S. Sutton and Andrew G. Barto. Introduction to Reinforcement Learning. MIT Press, Cambridge, MA, USA, 1st edition, 1998. ISBN 0262193981.
|
| 408 |
+
|
| 409 |
+
Philip S. Thomas and Emma Brunskill. Policy gradient methods for reinforcement learning with function approximation and action-dependent baselines. arxiv, abs/1706.06643, 2017.
|
| 410 |
+
|
| 411 |
+
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.
|
| 412 |
+
|
| 413 |
+
George Tucker, Andriy Mnih, Chris J Maddison, and Jascha Sohl-Dickstein. Rebar: Low-variance, unbiased gradient estimates for discrete latent variable models. Advances in Neural Information Processing Systems, 2017.
|
| 414 |
+
|
| 415 |
+
Lex Weaver and Nigel Tao. The optimal reward baseline for gradient-based reinforcement learning. In Proceedings of the Seventeenth conference on Uncertainty in artificial intelligence, pp. 538– 545. Morgan Kaufmann Publishers Inc., 2001.
|
| 416 |
+
|
| 417 |
+
Ronald J Williams. Simple statistical gradient-following algorithms for connectionist reinforcement learning. Machine learning, 8(3-4):229–256, 1992.
|
| 418 |
+
|
| 419 |
+
Cathy Wu, Aravind Rajeswaran, Yan Duan, Vikash Kumar, Alexandre M Bayen, Sham Kakade, Igor Mordatch, and Pieter Abbeel. Variance reduction for policy gradient with action-dependent factorized baselines. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ H1tSsb-AW.
|
| 420 |
+
|
| 421 |
+
# 7 APPENDIX
|
| 422 |
+
|
| 423 |
+
# 7.1 PROOF OF THEOREM 3.1
|
| 424 |
+
|
| 425 |
+
Proof. Assume $a = f _ { \theta } ( s , \xi ) + \xi _ { 0 }$ where $\xi _ { 0 }$ is Gaussian noise $\mathcal { N } ( 0 , h ^ { 2 } )$ with a small variance $h$ that we will take $h \to 0 ^ { + }$ . Denote by $\pi ( \boldsymbol { a } , \boldsymbol { \xi } | \boldsymbol { s } )$ the joint density function of $( a , \xi )$ conditioned on $s$ . It can be written as
|
| 426 |
+
|
| 427 |
+
$$
|
| 428 |
+
\pi ( a , \xi | s ) = \pi ( a | s , \xi ) \pi ( \xi ) \propto \exp \left( - \frac { 1 } { 2 h ^ { 2 } } | | a - f _ { \theta } ( s , \xi ) | | ^ { 2 } \right) \pi ( \xi ) .
|
| 429 |
+
$$
|
| 430 |
+
|
| 431 |
+
Taking the derivative of $\log \pi ( a , \xi | s )$ w.r.t. $a$ gives
|
| 432 |
+
|
| 433 |
+
$$
|
| 434 |
+
\nabla _ { a } \log \pi ( a , \xi | s ) = - \frac { 1 } { h ^ { 2 } } \left( a - f _ { \theta } ( s , \xi ) \right) .
|
| 435 |
+
$$
|
| 436 |
+
|
| 437 |
+
Similarly, taking the derivative of $\log \pi ( a , \xi | s )$ w.r.t. $\theta$ , we have
|
| 438 |
+
|
| 439 |
+
$$
|
| 440 |
+
\begin{array} { r l r } & { } & { \nabla _ { \theta } \log \pi ( a , \xi | s ) = \displaystyle \frac { 1 } { h ^ { 2 } } \nabla _ { \theta } f _ { \theta } ( s , \xi ) \left( a - f _ { \theta } \left( s , \xi \right) \right) } \\ & { } & { = - \nabla _ { \theta } f _ { \theta } ( s , \xi ) \nabla _ { a } \log \pi ( a , \xi | s ) . } \end{array}
|
| 441 |
+
$$
|
| 442 |
+
|
| 443 |
+
Multiplying both sides with $\phi ( s , a )$ and taking the conditional expectation yield
|
| 444 |
+
|
| 445 |
+
$$
|
| 446 |
+
\begin{array} { r l } { \mathbb { E } _ { \pi ( a , \xi | s ) } \big [ \nabla _ { \theta } \log { \pi ( a , \xi | s ) } \phi ( s , a ) \big ] = - \mathbb { E } _ { \pi ( a , \xi | s ) } \big [ \nabla _ { \theta } f _ { \theta } ( s , \xi ) \nabla _ { a } \log { \pi ( a , \xi | s ) } \phi ( s , a ) \big ] } \\ & { = \mathbb { E } _ { \pi ( \xi ) } \big [ \nabla _ { \theta } f _ { \theta } ( s , \xi ) \mathbb { E } _ { \pi ( a | s , \xi ) } \big [ - \nabla _ { a } \log { \pi ( a , \xi | s ) } \phi ( s , a ) \big ] \big ] } \\ & { = \mathbb { E } _ { \pi ( \xi ) } \big [ \nabla _ { \theta } f _ { \theta } ( s , \xi ) \mathbb { E } _ { \pi ( a | s , \xi ) } \big [ \nabla _ { a } \phi ( s , a ) \big ] \big ] } \\ & { = \mathbb { E } _ { \pi ( a , \xi | s ) } \big [ \nabla _ { \theta } f _ { \theta } ( s , \xi ) \nabla _ { a } \phi ( s , a ) \big ] } \end{array}
|
| 447 |
+
$$
|
| 448 |
+
|
| 449 |
+
where the third equality comes from Stein’s identity (5) of $\pi ( \boldsymbol { a } | \boldsymbol { \xi } , \boldsymbol { s } )$ . One the other hand,
|
| 450 |
+
|
| 451 |
+
$$
|
| 452 |
+
\begin{array} { r l } & { \mathbb { E } _ { \pi ( a , \xi \vert s ) } \left[ \nabla _ { \theta } \log \pi ( a , \xi \vert s ) \phi ( s , a ) \right] } \\ & { \ = \mathbb { E } _ { \pi ( a , \xi \vert s ) } \left[ \nabla _ { \theta } \log \pi ( a \vert s ) \phi ( s , a ) \right] + \mathbb { E } _ { \pi ( a , \xi \vert s ) } \left[ \nabla _ { \theta } \log \pi ( \xi \vert s , a ) \phi ( s , a ) \right] } \\ & { \ = \mathbb { E } _ { \pi ( a , \xi \vert s ) } \left[ \nabla _ { \theta } \log \pi ( a \vert s ) \phi ( s , a ) \right] , } \end{array}
|
| 453 |
+
$$
|
| 454 |
+
|
| 455 |
+
where the second term of (22) equals zero because
|
| 456 |
+
|
| 457 |
+
$$
|
| 458 |
+
\begin{array} { r } { { \mathbb E } _ { \pi ( a , \xi | s ) } \big [ \nabla _ { \theta } \log \pi ( \xi | s , a ) \phi ( s , a ) \big ] = { \mathbb E } _ { \pi ( a | s ) } \big [ { \mathbb E } _ { \pi ( \xi | s , a ) } \big [ \nabla _ { \theta } \log \pi ( \xi | s , a ) \big ] \big ] \phi ( s , a ) \big ] = 0 . } \end{array}
|
| 459 |
+
$$
|
| 460 |
+
|
| 461 |
+
Combining (21) and (23) gives the result:
|
| 462 |
+
|
| 463 |
+
$$
|
| 464 |
+
\begin{array} { r } { { \mathbb { E } } _ { \pi ( a | s ) } \left[ \nabla _ { \theta } \log \pi ( a | s ) \phi ( s , a ) \right] = { \mathbb { E } } _ { \pi ( a , \xi | s ) } \left[ \nabla _ { \theta } f _ { \theta } ( s , \xi ) \nabla _ { a } \phi ( s , a ) \right] } \end{array}
|
| 465 |
+
$$
|
| 466 |
+
|
| 467 |
+
The above result does not depend on $h$ , and hence holds when $h \to 0 ^ { + }$ . This completes the proof.
|
| 468 |
+
|
| 469 |
+
# 7.2 ESTIMATING $\phi$ FOR GAUSSIAN POLICIES
|
| 470 |
+
|
| 471 |
+
The parameters $w$ in $\phi$ should be ideally estimated by minimizing the variance of the gradient estimator $\operatorname { v a r } ( \nabla _ { \theta } J ( \theta ) )$ using (15). Unfortunately, it is computationally slow and memory inefficient to directly solve (15) with the current deep learning platforms, due to the limitation of the auto-differentiation implementations. In general, this problem might be solved with a customized implementation of gradient calculation as a future work. But in the case of Gaussian policies, we find minimizing $\mathrm { v a r } ( { \hat { \nabla } } _ { \mu } J ( \theta ) ) + \mathrm { v a r } ( { \hat { \nabla } } _ { \Sigma } J ( \theta ) )$ provides an approximation that we find works in our experiments.
|
| 472 |
+
|
| 473 |
+
More specifically, recall that Gaussian policy has a form of
|
| 474 |
+
|
| 475 |
+
$$
|
| 476 |
+
\pi ( a \mid s ) \propto { \frac { 1 } { \sqrt { \left| \Sigma ( s ) \right| } } } \exp \left( - { \frac { 1 } { 2 } } \left( a - \mu ( s ) \right) ^ { \top } \Sigma ( s ) ^ { - 1 } \left( a - \mu ( s ) \right) \right) ,
|
| 477 |
+
$$
|
| 478 |
+
|
| 479 |
+
where $\mu ( s )$ and $\Sigma ( s )$ are parametric functions of state s, and $| \Sigma |$ is the determinant of $\Sigma$ . Following Eq (8) we have
|
| 480 |
+
|
| 481 |
+
$$
|
| 482 |
+
\nabla _ { \mu } J ( \theta ) = \mathbb { E } _ { \pi } \left[ - \nabla _ { a } \log \pi ( a | s ) ( Q ^ { \pi } ( s , a ) - \phi ( s , a ) ) + \nabla _ { a } \phi ( s , a ) \right] ,
|
| 483 |
+
$$
|
| 484 |
+
|
| 485 |
+

|
| 486 |
+
Figure 4: Evaluation of PPO with Stein control variate when $\phi$ is estimated based on data from different iterations. The architecture of $\phi$ is choosen to be MLP.
|
| 487 |
+
|
| 488 |
+
where we use the fact that $\nabla _ { \mu } f ( s , \xi ) = 1$ and
|
| 489 |
+
|
| 490 |
+
$$
|
| 491 |
+
\nabla _ { \mu } \log \pi ( a | s ) = - \nabla _ { a } \log \pi ( a | s ) = \Sigma ( s ) ^ { - 1 } ( a - \mu ( s ) ) .
|
| 492 |
+
$$
|
| 493 |
+
|
| 494 |
+
Similarly, following Eq (18), we have
|
| 495 |
+
|
| 496 |
+
$$
|
| 497 |
+
\nabla _ { \Sigma } J ( \theta ) = \mathbb { E } _ { \boldsymbol { \pi } } \left[ \nabla _ { \Sigma } \log \pi ( a | s ) ( Q ^ { \pi } ( s , a ) - \phi ( s , a ) ) - \frac { 1 } { 2 } \nabla _ { a } \log \pi ( a | s ) \nabla _ { a } \phi ( s , a ) ^ { \top } \right]
|
| 498 |
+
$$
|
| 499 |
+
|
| 500 |
+
where
|
| 501 |
+
|
| 502 |
+
$$
|
| 503 |
+
\nabla _ { \Sigma } \log \pi ( a | s ) = \frac { 1 } { 2 } \left( - \Sigma ^ { - 1 } ( s ) + \Sigma ( s ) ^ { - 1 } ( a - \mu ( s ) ) ( a - \mu ( s ) ) ^ { \top } \Sigma ( s ) ^ { - 1 } \right) .
|
| 504 |
+
$$
|
| 505 |
+
|
| 506 |
+
And Eq (19) reduces to
|
| 507 |
+
|
| 508 |
+
$$
|
| 509 |
+
\nabla _ { \Sigma } J ( \theta ) = \mathbb { E } _ { \pi } \left[ \nabla _ { \Sigma } \log \pi ( a | s ) ( Q ^ { \pi } ( s , a ) - \phi ( s , a ) ) + \frac { 1 } { 2 } \nabla _ { a , a } \phi ( s , a ) \right] .
|
| 510 |
+
$$
|
| 511 |
+
|
| 512 |
+
Because the baseline function does not change the expectations in (24) and (25), we can frame $\begin{array} { r } { \operatorname* { m i n } _ { w } \operatorname { v a r } ( \hat { \nabla } _ { \mu } J ( \theta ) ) + \operatorname { v a r } ( \hat { \nabla } _ { \Sigma } J ( \theta ) ) } \end{array}$ into
|
| 513 |
+
|
| 514 |
+
$$
|
| 515 |
+
\operatorname* { m i n } _ { \boldsymbol { w } } \sum _ { t = 1 } ^ { n } \left\| g _ { \boldsymbol { \mu } } ( s _ { t } , a _ { t } ) \right\| _ { 2 } ^ { 2 } + \left\| g _ { \Sigma } ( s _ { t } , a _ { t } ) \right\| _ { F } ^ { 2 } ,
|
| 516 |
+
$$
|
| 517 |
+
|
| 518 |
+
where $g _ { \mu }$ and $g _ { \Sigma }$ are the integrands in (24) and (25) (or (26)) respectively, that is, $g _ { \mu } ( s , a ) =$ $- \nabla _ { a } \log { \pi ( a | s ) } ( Q ^ { \pi } ( s , a ) - \phi ( s , a ) ) _ { \Sigma } + \nabla _ { a } \phi ( s , a )$ and $g _ { \Sigma } ( s , a ) \ = \ \nabla _ { \Sigma } \log \pi ( a | s ) ( \bar { Q } ^ { \pi } ( s , a ) \ -$ $\begin{array} { r } { \phi ( s , a ) ) - \frac { 1 } { 2 } \nabla _ { a } \log \pi ( a | s ) \nabla _ { a } \phi ( s , a ) ^ { \mid } } \end{array}$ . Here $\begin{array} { r } { \| \dot { A } \| _ { F } ^ { 2 } : = \sum _ { i j } \dot { A } _ { i j } ^ { 2 } } \end{array}$ is the matrix Frobenius norm.
|
| 519 |
+
|
| 520 |
+
# 7.3 EXPERIMENT DETAILS
|
| 521 |
+
|
| 522 |
+
The advantage estimation $\hat { A } ^ { \pi } ( s _ { t } , a _ { t } )$ in $\mathrm { E q ~ } 1 6$ is done by GAE with $\lambda = 0 . 9 8$ , and $\gamma ~ = ~ 0 . 9 9 5$ (Schulman et al., 2016), and correspondingly, $\hat { Q } ^ { \pi } ( s _ { t } , a _ { t } ) = \hat { A } ^ { \pi } ( s _ { t } , a _ { t } ) + \hat { V } ^ { \pi } ( s _ { t } )$ in (9). Observations and advantage are normalized as suggested by Heess et al. (2017). The neural networks of the policies $\pi ( a | s )$ and baseline functions $\phi _ { w } ( s , a )$ use Relu activation units, and the neural network of the value function $\hat { V } ^ { \pi } ( s )$ uses Tanh activation units. All our results use Gaussian MLP policy in our experiments with a neural-network mean and a constant diagonal covariance matrix.
|
| 523 |
+
|
| 524 |
+
Denote by $d _ { s }$ and $d _ { a }$ the dimension of the states $s$ and action $a$ , respectively. Network sizes are fol-√ lows: On Humanoid-v1 and HuamnoidStandup-v1, we use $( d _ { s } , \sqrt { d _ { a } \cdot 5 } , 5 )$ for both policy network and value network; On other Mujoco environments, we use $( 1 0 \cdot d _ { s } , \sqrt { 1 0 \cdot d _ { s } \cdot 5 } , 5 )$ for both policy network and value network, with learning rate $\frac { 0 . 0 0 0 9 } { \sqrt { ( d _ { s } \cdot 5 ) } }$ for policy network and $\frac { 0 . 0 0 0 1 } { \sqrt { ( d _ { s } \cdot 5 ) } }$ for value network. The network for $\phi$ is (100, 100) with state as the input and the action concatenated with the second layer.
|
| 525 |
+
|
| 526 |
+
All experiments of PPO with Stein control variate selects the best learning rate from $\{ 0 . 0 0 1 , 0 . 0 0 0 5$ , $0 . 0 0 0 1 \}$ for $\phi$ networks. We use ADAM (Kingma & Ba, 2014) for gradient descent and evaluate the policy every 20 iterations. Stein control variate is trained for the best iteration in range of $\{ 2 5 0 , 3 0 0$ , $4 0 0 , 5 0 0 , 8 0 0 \}$ .
|
| 527 |
+
|
| 528 |
+
# 7.4 ESTIMATING $\phi$ USING DATA FROM PREVIOUS ITERATIONS
|
| 529 |
+
|
| 530 |
+
Our experiments on policy optimization estimate $\phi$ based on the data from the current iteration. Although this theoretically introduces a bias into the gradient estimator, we find it works well empirically in our experiments. In order to exam the effect of such bias, we tested a variant of PPOMinVar-MLP which fits $\phi$ using data from the previous iteration, or previous two iterations, both of which do not introduce additional bias due to the dependency of $\phi$ on the data. Figure 4 shows the results in Hopper-v1 and Walker2d-v1, where we find that using the data from previous iterations does not seem to improve the result. The may be because during the policy optimization, the updates of $\phi$ are early stopped and hence do not introduce overfitting even when it is based on the data from the current iteration.
|
md/train/HJtEm4p6Z/HJtEm4p6Z.md
ADDED
|
@@ -0,0 +1,336 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# DEEP VOICE 3: SCALING TEXT-TO-SPEECH WITH CONVOLUTIONAL SEQUENCE LEARNING
|
| 2 |
+
|
| 3 |
+
Wei $\mathbf { P i n g ^ { * } }$ , Kainan Peng∗, Andrew Gibiansky∗, Sercan O. Arık ¨ ∗ Ajay Kannan, Sharan Narang
|
| 4 |
+
|
| 5 |
+
Baidu Research
|
| 6 |
+
{pingwei01, pengkainan, gibianskyandrew, sercanarik,
|
| 7 |
+
kannanajay, sharan}@baidu.com
|
| 8 |
+
|
| 9 |
+
Jonathan Raiman∗†OpenAIraiman@openai.com
|
| 10 |
+
|
| 11 |
+
John Miller∗† University of California, Berkeley miller john@berkeley.edu
|
| 12 |
+
|
| 13 |
+
# ABSTRACT
|
| 14 |
+
|
| 15 |
+
We present Deep Voice 3, a fully-convolutional attention-based neural textto-speech (TTS) system. Deep Voice 3 matches state-of-the-art neural speech synthesis systems in naturalness while training an order of magnitude faster. We scale Deep Voice 3 to dataset sizes unprecedented for TTS, training on more than eight hundred hours of audio from over two thousand speakers. In addition, we identify common error modes of attention-based speech synthesis networks, demonstrate how to mitigate them, and compare several different waveform synthesis methods. We also describe how to scale inference to ten million queries per day on a single GPU server.
|
| 16 |
+
|
| 17 |
+
# 1 INTRODUCTION
|
| 18 |
+
|
| 19 |
+
Text-to-speech (TTS) systems convert written language into human speech. TTS systems are used in a variety of applications, such as human-technology interfaces, accessibility for the visuallyimpaired, media and entertainment. Traditional TTS systems are based on complex multi-stage hand-engineered pipelines (Taylor, 2009). Typically, these systems first transform text into a compact audio representation, and then convert this representation into audio using an audio waveform synthesis method called a vocoder.
|
| 20 |
+
|
| 21 |
+
Recent work on neural TTS has demonstrated impressive results, yielding pipelines with simpler features, fewer components, and higher quality synthesized speech. There is not yet a consensus on the optimal neural network architecture for TTS. However, sequence-to-sequence models (Wang et al., 2017; Sotelo et al., 2017; Arık et al., 2017) have shown promising results.
|
| 22 |
+
|
| 23 |
+
In this paper, we propose a novel, fully-convolutional architecture for speech synthesis, scale it to very large audio data sets, and address several real-world issues that arise when attempting to deploy an attention-based TTS system. Specifically, we make the following contributions:
|
| 24 |
+
|
| 25 |
+
1. We propose a fully-convolutional character-to-spectrogram architecture, which enables fully parallel computation and trains an order of magnitude faster than analogous architectures using recurrent cells (e.g., Wang et al., 2017).
|
| 26 |
+
2. We show that our architecture trains quickly and scales to the LibriSpeech ASR dataset (Panayotov et al., 2015), which consists of 820 hours of audio data from 2484 speakers.
|
| 27 |
+
3. We demonstrate that we can generate monotonic attention behavior, avoiding error modes commonly affecting sequence-to-sequence models.
|
| 28 |
+
4. We compare the quality of several waveform synthesis methods, including WORLD (Morise et al., 2016), Griffin-Lim (Griffin & Lim, 1984), and WaveNet (Oord et al., 2016).
|
| 29 |
+
|
| 30 |
+
5. We describe the implementation of an inference kernel for Deep Voice 3, which can serve up to ten million queries per day on one single-GPU server.
|
| 31 |
+
|
| 32 |
+
# 2 RELATED WORK
|
| 33 |
+
|
| 34 |
+
Our work builds upon the state-of-the-art in neural speech synthesis and attention-based sequenceto-sequence learning.
|
| 35 |
+
|
| 36 |
+
Several recent works tackle the problem of synthesizing speech with neural networks, including Deep Voice 1 (Arık et al., 2017), Deep Voice 2 (Arık et al., 2017), Tacotron (Wang et al., 2017), Char2Wav (Sotelo et al., 2017), VoiceLoop (Taigman et al., 2017), SampleRNN (Mehri et al., 2017), and WaveNet (Oord et al., 2016). Deep Voice 1 & 2 retain the traditional structure of TTS pipelines, separating grapheme-to-phoneme conversion, duration and frequency prediction, and waveform synthesis. In contrast to Deep Voice 1 & 2, Deep Voice 3 employs an attentionbased sequence-to-sequence model, yielding a more compact architecture. Similar to Deep Voice 3, Tacotron and Char2Wav propose sequence-to-sequence models for neural TTS. Tacotron is a neural text-to-spectrogram conversion model, used with Griffin-Lim for spectrogram-to-waveform synthesis. Char2Wav predicts the parameters of the WORLD vocoder (Morise et al., 2016) and uses a SampleRNN conditioned upon WORLD parameters for waveform generation. In contrast to Char2Wav and Tacotron, Deep Voice 3 avoids Recurrent Neural Networks (RNNs) to speed up training. 1 Deep Voice 3 makes attention-based TTS feasible for a production TTS system with no compromise on accuracy by avoiding common attention errors. Finally, WaveNet and SampleRNN are neural vocoder models for waveform synthesis. There are also numerous alternatives for highquality hand-engineered vocoders in the literature, such as STRAIGHT (Kawahara et al., 1999), Vocaine (Agiomyrgiannakis, 2015), and WORLD (Morise et al., 2016). Deep Voice 3 adds no novel vocoder, but has the potential to be integrated with different waveform synthesis methods with slight modifications of its architecture.
|
| 37 |
+
|
| 38 |
+
Automatic speech recognition (ASR) datasets are often much larger than traditional TTS corpora but tend to be less clean, as they typically involve multiple microphones and background noise. Although prior work has applied TTS methods to ASR datasets (Yamagishi et al., 2010), Deep Voice 3 is, to the best of our knowledge, the first TTS system to scale to thousands of speakers with a single model.
|
| 39 |
+
|
| 40 |
+
Sequence-to-sequence models (Sutskever et al., 2014; Cho et al., 2014) encode a variable-length input into hidden states, which are then processed by a decoder to produce a target sequence. An attention mechanism allows a decoder to adaptively select encoder hidden states to focus on while generating the target sequence (Bahdanau et al., 2015). Attention-based sequence-to-sequence models are widely applied in machine translation (Bahdanau et al., 2015), speech recognition (Chorowski et al., 2015), and text summarization (Rush et al., 2015). Recent improvements in attention mechanisms relevant to Deep Voice 3 include enforced-monotonic attention during training (Raffel et al., 2017), fully-attentional non-recurrent architectures (Vaswani et al., 2017), and convolutional sequenceto-sequence models (Gehring et al., 2017). Deep Voice 3 demonstrates the utility of monotonic attention during training in TTS, a new domain where monotonicity is expected. Alternatively, we show that with a simple heuristic to only enforce monotonicity during inference, a standard attention mechanism can work just as well or even better. Deep Voice 3 also builds upon the convolutional sequence-to-sequence architecture from Gehring et al. (2017) by introducing a positional encoding similar to that used in Vaswani et al. (2017), augmented with a rate adjustment to account for the mismatch between input and output domain lengths.
|
| 41 |
+
|
| 42 |
+
# 3 MODEL ARCHITECTURE
|
| 43 |
+
|
| 44 |
+
In this section, we present our fully-convolutional sequence-to-sequence architecture for TTS (see Fig. 1). Our architecture is capable of converting a variety of textual features (e.g. characters, phonemes, stresses) into a variety of vocoder parameters, e.g. mel-band spectrograms, linear-scale log magnitude spectrograms, fundamental frequency, spectral envelope, and aperiodicity parameters. These vocoder parameters can be used as inputs for audio waveform synthesis models.
|
| 45 |
+
|
| 46 |
+

|
| 47 |
+
Figure 1: Deep Voice 3 uses residual convolutional layers to encode text into per-timestep key and value vectors for an attention-based decoder. The decoder uses these to predict the mel-scale log magnitude spectrograms that correspond to the output audio. (Light blue dotted arrows depict the autoregressive process during inference.) The hidden states of the decoder are then fed to a converter network to predict the vocoder parameters for waveform synthesis. See Appendix A for more details.
|
| 48 |
+
|
| 49 |
+
The Deep Voice 3 architecture consists of three components:
|
| 50 |
+
|
| 51 |
+
• Encoder: A fully-convolutional encoder, which converts textual features to an internal learned representation.
|
| 52 |
+
• Decoder: A fully-convolutional causal decoder, which decodes the learned representation with a multi-hop convolutional attention mechanism into a low-dimensional audio representation (mel-scale spectrograms) in an autoregressive manner. Converter: A fully-convolutional post-processing network, which predicts final vocoder parameters (depending on the vocoder choice) from the decoder hidden states. Unlike the decoder, the converter is non-causal and can thus depend on future context information.
|
| 53 |
+
|
| 54 |
+
The overall objective function to be optimized is a linear combination of the losses from the decoder (Section 3.5) and the converter (Section 3.7). We separate decoder and converter and apply multi-task training, because it makes attention learning easier in practice. To be specific, the loss for mel-spectrogram prediction guides training of the attention mechanism, because the attention is trained with the gradients from mel-spectrogram prediction besides vocoder parameter prediction.
|
| 55 |
+
|
| 56 |
+
In multi-speaker scenario, trainable speaker embeddings as in Arık et al. (2017) are used across encoder, decoder and converter. Next, we describe each of these components and the data preprocessing in detail. Model hyperparameters are available in Table 4 within Appendix C.
|
| 57 |
+
|
| 58 |
+
# 3.1 TEXT PREPROCESSING
|
| 59 |
+
|
| 60 |
+
Text preprocessing is crucial for good performance. Feeding raw text (characters with spacing and punctuation) yields acceptable performance on many utterances. However, some utterances may have mispronunciations of rare words, or may yield skipped words and repeated words. We alleviate these issues by normalizing the input text as follows:
|
| 61 |
+
|
| 62 |
+
1. We uppercase all characters in the input text.
|
| 63 |
+
2. We remove all intermediate punctuation marks.
|
| 64 |
+
3. We end every utterance with a period or question mark.
|
| 65 |
+
4. We replace spaces between words with special separator characters which indicate the duration of pauses inserted by the speaker between words. We use four different word separators, indicating (i) slurred-together words, (ii) standard pronunciation and space characters, (iii) a short pause between words, and (iv) a long pause between words. For example, the sentence “Either way, you should shoot very slowly,” with a long pause after “way” and a short pause after “shoot”, would be written as “Either way%you should shoot/very slowly $\%$ .” with $\%$ representing a long pause and / representing a short pause for encoding convenience. 2
|
| 66 |
+
|
| 67 |
+
# 3.2 JOINT REPRESENTATION OF CHARACTERS AND PHONEMES
|
| 68 |
+
|
| 69 |
+
Deployed TTS systems (e.g., Capes et al., 2017; Gonzalvo et al., 2016) should include a way toConv Blockdecoder modify pronunciations to correct common mistakes (which typically involve proper nouns, foreign words, and domain-specific jargon). A conventional way to do this is to maintain a dictionary to map words to their phonetic representations.Conv Block
|
| 70 |
+
|
| 71 |
+
Our model can directly convert characters (including punctuation and spacing) to acoustic features, and hence learns an implicit grapheme-to-phoneme model. This implicit conversion is difficult Nprenet to correct when the model makes mistakes. Thus, in addition to character models, we also train phoneme-only models and mixed character-and-phoneme models by allowing phoneme input option explicitly. These models are identical to character-only models, except that the input layer of the encoder sometimes receives phoneme and phoneme stress embeddings instead of character embeddings.
|
| 72 |
+
|
| 73 |
+
A phoneme-only model requires a preprocessing step to convert words to their phoneme representations (by using an external phoneme dictionary or a separately trained grapheme-to-phoneme model)3. A mixed character-and-phoneme model requires a similar preprocessing step, except for words not in the phoneme dictionary. These out-of-vocabulary words are input as characters, allowing the model to use its implicitly learned grapheme-to-phoneme model. While training a mixed character-and-phoneme model, every word is replaced with its phoneme representation with some fixed probability at each training iteration. We find that this improves pronunciation accuracy and minimizes attention errors, especially when generalizing to utterances longer than those seen during training. More importantly, models that support phoneme representation allow correcting mispronunciations using a phoneme dictionary, a desirable feature of deployed systems.
|
| 74 |
+
|
| 75 |
+
3.3 CONVOLUTION BLOCKS FOR SEQUENTIAL PROCESSING
|
| 76 |
+
|
| 77 |
+

|
| 78 |
+
Figure 2: The convolution block consists of a 1-D convolution with a gated linear unit and a residual connection. Here $c$ denotes the dimensionality of the input. The convolution output of size $2 \cdot c$ is split into equal-sized portions: the gate vector and the input vector.
|
| 79 |
+
|
| 80 |
+
By providing a sufficiently large receptive field, stacked convolutional layers can utilize long-term context information in sequences without introducing any sequential dependency in computation. We use the convolution block depicted in Fig. 2 as the main sequential processing unit to encode hidden representations of text and audio. The convolution block consists of a 1-D convolution filter, a gated-linear unit as a learnable nonlinearity (Dauphin et al., 2017), a residual connection to the input, and a scaling factor of $\sqrt { 0 . 5 } ^ { 4 }$ . The gated linear unit provides a linear path for the gradient flow, which alleviates the vanishing gradient issue for stacked convolution blocks while retaining non-linearity. To introduce speaker-dependent control, a speaker-dependent embedding is added as a bias to the convolution filter output, after a softsign function. We use the softsign nonlinearity because it limits the range of the output while also avoiding the saturation problem that exponentialbased nonlinearities sometimes exhibit. We initialize the convolution filter weights with zero-mean and unit-variance activations throughout the entire network.
|
| 81 |
+
|
| 82 |
+
The convolutions in the architecture can be either non-causal (e.g. in encoder and converter) or causal (e.g. in decoder). To preserve the sequence length, inputs are padded with $k - 1$ timesteps of zeros on the left for causal convolutions and $( k - 1 ) / 2$ timesteps of zeros on the left and on the right for non-causal convolutions, where $k$ is an odd convolution filter width. 5 Dropout is applied to the inputs prior to the convolution for regularization.
|
| 83 |
+
|
| 84 |
+
# 3.4 ENCODER
|
| 85 |
+
|
| 86 |
+
The encoder network (depicted in Fig. 1) begins with an embedding layer, which converts characters or phonemes into trainable vector representations, $h _ { e }$ . These embeddings $h _ { e }$ are first projected via a fully-connected layer from the embedding dimension to a target dimensionality. Then, they are processed through a series of convolution blocks described in Section 3.3 to extract time-dependent text information. Lastly, they are projected back to the embedding dimension to create the attention key vectors $h _ { k }$ . The attention value vectors are computed from attention key vectors and text embeddings, $h _ { v } = \sqrt { 0 . 5 } ( h _ { k } + h _ { e } )$ , to jointly consider the local information in $h _ { e }$ and the long-term context information in $h _ { k }$ . The key vectors $h _ { k }$ are used by each attention block to compute attention weights, whereas the final context vector is computed as a weighted average over the value vectors $h _ { v }$ (see Section 3.6).
|
| 87 |
+
|
| 88 |
+
# 3.5 DECODER
|
| 89 |
+
|
| 90 |
+
The decoder (depicted in Fig. 1) generates audio in an autoregressive manner by predicting a group of $r$ future audio frames conditioned on the past audio frames. Since the decoder is autoregressive, it must use causal convolution blocks. We choose mel-band log-magnitude spectrogram as the compact low-dimensional audio frame representation. Similar to Wang et al. (2017), we empirically observed that decoding multiple frames together (i.e. having $r > 1 \AA$ ) yields better audio quality.
|
| 91 |
+
|
| 92 |
+
The decoder network starts with multiple fully-connected layers with rectified linear unit (ReLU) nonlinearities to preprocess input mel-spectrograms (denoted as “PreNet” in Fig. 1). Then, it is followed by a series of causal convolution and attention blocks. These convolution blocks generate the queries used to attend over the encoder’s hidden states (see Section 3.6). Lastly, a fully-connected layer output the next group of $r$ audio frames and also a binary “final frame” prediction (indicating whether the last frame of the utterance has been synthesized). Dropout is applied before each fully-connected layer prior to the attention blocks, except for the first one. An L1 loss 6 is computed using the output mel-spectrograms and a binary cross-entropy loss is computed using the final-frame prediction.
|
| 93 |
+
|
| 94 |
+
# 3.6 ATTENTION BLOCK
|
| 95 |
+
|
| 96 |
+
We use a dot-product attention mechanism (depicted in Fig. 3) similar to Vaswani et al. (2017). The attention mechanism uses a query vector (the hidden states of the decoder) and the per-timestep key vectors from the encoder to compute attention weights, and then outputs a context vector computed as the weighted average of the value vectors.
|
| 97 |
+
|
| 98 |
+
We observe empirical benefits from introducing a inductive bias where the attention follows a monotonic progression in time. Thus, we add a positional encoding to both the key and the query vectors. These positional encodings $h _ { p }$ are chosen as $h _ { p } ( i ) \ = \ \bar { \sin { \left( \omega _ { s } i / 1 0 0 0 0 ^ { k / d } \right) } }$ (for even $i$ ) or $\cos { \left( \omega _ { s } i \big / 1 0 0 0 0 ^ { k } / d \right) }$ (for odd $i$ ), where $i$ is the timestep index, $k$ is the channel index in the positional encoding, $d$ is the total number of channels in the positional encoding, and $\omega _ { s }$ is the position rate of the encoding. The position rate dictates the average slope of the line in the attention distribution, roughly corresponding to speed of speech. For a single speaker, $\omega _ { s }$ is set to one for the query, and be fixed for the key to the ratio of output timesteps to input timesteps (computed across the entire dataset). For multi-speaker datasets, $\omega _ { s }$ is computed for both the key and query from the speaker embedding for each speaker (depicted in Fig. 3). As sine and cosine functions form an orthonormal basis, this initialization yields an attention distribution in the form of a diagonal line (see Fig. 4 (a)). We initialize the fully-connected layer weights used to compute hidden attention vectors to the same values for the query projection and the key projection. Positional encodings are used in all attention blocks. We use context normalization as in Gehring et al. (2017). A fully-connected layer is applied to the context vector to generate the output of the attention block. Overall, positional encodings improve the convolutional attention mechanism.
|
| 99 |
+
|
| 100 |
+

|
| 101 |
+
Figure 3: Positional encodings are added to both keys and query vectors, with rates of $\omega _ { \mathrm { k e y } }$ and $\omega _ { \mathrm { q u e r y } }$ respectively. Forced monotonocity can be applied at inference by adding a mask of large negative values to the logits. One of two possible attention schemes is used: softmax or monotonic attention from Raffel et al. (2017). During training, attention weights are dropped out.
|
| 102 |
+
|
| 103 |
+

|
| 104 |
+
Figure 4: Attention distributions (a) before training, (b) after training, but without inference constraints, (c) with inference constraints applied to the first and third layers. (We empirically observe that fixing the attention of one or two dominant layers is sufficient for high-quality output.)
|
| 105 |
+
|
| 106 |
+
Production-quality TTS systems have very low tolerance for attention errors. Hence, besides positional encodings, we consider additional strategies to eliminate the cases of repeating or skipping words. One approach is to substitute the canonical attention mechanism with the monotonic attention mechanism introduced in Raffel et al. (2017), which approximates hard-monotonic stochastic decoding with soft-monotonic attention by training in expectation.7 Despite the improved monotonicity, this strategy may yield a more diffused attention distribution. In some cases, several characters are attended at the same time and high quality speech couldn’t be obtained. We attribute this to the unnormalized attention coefficients of the soft alignment, potentially resulting in weak signal from the encoder. Thus, we propose an alternative strategy of constraining attention weights only at inference to be monotonic, preserving the training procedure without any constraints. Instead of computing the softmax over the entire input, we instead compute the softmax only over a fixed window starting at the last attended-to position and going forward several timesteps 8. The initial position is set to zero and is later computed as the index of the highest attention weight within the current window. This strategy also enforces monotonic attention at inference as shown in Fig. 4, and yields superior speech quality.
|
| 107 |
+
|
| 108 |
+
# 3.7 CONVERTER
|
| 109 |
+
|
| 110 |
+
The converter network takes as inputs the activations from the last hidden layer of the decoder, applies several non-causal convolution blocks, and then predicts parameters for downstream vocoders. Unlike the decoder, the converter is non-causal and non-autoregressive, so it can use future context from the decoder to predict its outputs.
|
| 111 |
+
|
| 112 |
+
The loss function of the converter network depends on the type of the vocoder used:
|
| 113 |
+
|
| 114 |
+
1. Griffin-Lim vocoder: Griffin-Lim algorithm converts spectrograms to time-domain audio waveforms by iteratively estimating the unknown phases. We find raising the spectrogram to a power parametrized by a sharpening factor before waveform synthesis is helpful for improved audio quality, as suggested in Wang et al. (2017). L1 loss is used for prediction of linear-scale log-magnitude spectrograms.
|
| 115 |
+
|
| 116 |
+

|
| 117 |
+
cFigure 5: Generated WORLD vocoder parameters with fully connected (FC) layers.
|
| 118 |
+
|
| 119 |
+
2. WORLD vocoder: The WORLD vocoder is based on (Morise et al., 2016). As vocoder parameters, we predict a boolean value (whether the current frame is voiced or unvoiced), an F0 value (if the frame is voiced), the spectral envelope, and the aperiodicity parameters. We use a cross-entropy loss for the voiced-unvoiced prediction, and L1 losses for all other predictions (see Fig. 5),
|
| 120 |
+
|
| 121 |
+
3. WaveNet vocoder: We separately train a WaveNet to be used as a vocoder treating melscale log-magnitude spectrograms as vocoder parameters. These vocoder parameters are input as external conditioners to the network. The WaveNet is trained using ground-truth mel-spectragrams and audio waveforms. The architecture besides the conditioner is similar to the WaveNet described in Arık et al. (2017). While the WaveNet in Arık et al. (2017) is conditioned with linear-scale log-magnitude spectrograms, we observed better perforAttention Blockmance with mel-scale spectrograms, which corresponds to a more compact representation Outputof audio. In addition to L1 loss on mel-scale spectrograms at decode, L1 loss on linear-scale spectrogram is also applied as Griffin-Lim vocoder.
|
| 122 |
+
|
| 123 |
+
<table><tr><td>Text Input</td><td>Attention</td><td>Inference constraint</td><td></td><td>Repeat Mispronounce</td><td>Skip</td></tr><tr><td>Characters-only</td><td>Dot-Product</td><td>Yes</td><td>3</td><td>35</td><td>19</td></tr><tr><td>Phonemes & Characters</td><td>Dot-Product</td><td>No</td><td>12</td><td>10</td><td>15</td></tr><tr><td>Phonemes& Characters</td><td>Dot-Product</td><td>Yes</td><td>1</td><td>4</td><td>3</td></tr><tr><td>Phonemes & Characters</td><td>Monotonic</td><td>No</td><td>5</td><td>9</td><td>11</td></tr></table>
|
| 124 |
+
|
| 125 |
+
Table 1: Attention error counts for single-speaker Deep Voice 3 models on the 100-sentence test set, given in Appendix E. One or more mispronunciations, skips, and repeats count as a single mistake per utterance. “Phonemes & Characters” refers to the model trained with a joint character and phoneme representation, as discussed in Section 3.2. We did not include phoneme-only models because the test set contains out-of-vocabulary words. All models use Griffin-Lim as their vocoder.
|
| 126 |
+
|
| 127 |
+
# 4 RESULTS
|
| 128 |
+
|
| 129 |
+
In this section, we present several different experiments and metrics to evaluate our speech synthesis system. We quantify the performance of our system and compare it to other recently published neural TTS systems.
|
| 130 |
+
|
| 131 |
+
Data: For single-speaker synthesis, we use an internal English speech dataset containing approximately 20 hours of audio with a sample rate of $4 8 ~ \mathrm { k H z }$ . For multi-speaker synthesis, we use the VCTK (Yamagishi et al., 2009) and LibriSpeech (Panayotov et al., 2015) datasets. The VCTK dataset consists of audios for 108 speakers, with a total duration of ${ \sim } 4 4$ hours. The LibriSpeech dataset consists of audios for 2484 speakers, with a total duration of ${ \sim } 8 2 0 $ hours. The sample rate is $4 8 \mathrm { k H z }$ for VCTK and $1 6 \mathrm { k H z }$ for LibriSpeech.
|
| 132 |
+
|
| 133 |
+
Fast Training: We compare Deep Voice 3 to Tacotron, a recently published attention-based TTS system. For our system on single-speaker data, the average training iteration time (for batch size 4) is 0.06 seconds using one GPU as opposed to 0.59 seconds for Tacotron, indicating a ten-fold increase in training speed. In addition, Deep Voice 3 converges after $\sim 5 0 0 \mathrm { K }$ iterations for all three datasets in our experiment, while Tacotron requires $\sim 2 \mathbf { M }$ iterations as suggested in Wang et al. (2017). This significant speedup is due to the fully-convolutional architecture of Deep Voice 3, which exploits the parallelism of a GPU during training.
|
| 134 |
+
|
| 135 |
+
Attention Error Modes: Attention-based neural TTS systems may run into several error modes that can reduce synthesis quality – including (i) repeated words, (ii) mispronunciations, and (iii) skipped words. 9 One reason for (i) and (iii) is that the attention-based model does not impose a monotonically progressing mechanism. In order to track the occurrence of attention errors, we construct a custom 100-sentence test set (see Appendix E) that includes particularly-challenging cases from deployed TTS systems (e.g. dates, acronyms, URLs, repeated words, proper nouns, foreign words etc.) Attention error counts are listed in Table 1 and indicate that the model with joint representation of characters and phonemes, trained with standard attention mechanism but enforced the monotonic constraint at inference, largely outperforms other approaches.
|
| 136 |
+
|
| 137 |
+
Naturalness: We demonstrate that choice of waveform synthesis matters for naturalness ratings and compare it to other published neural TTS systems. Results in Table 2 indicate that WaveNet, a neural vocoder, achieves the highest MOS of 3.78, followed by WORLD and Griffin-Lim at 3.63 and 3.62, respectively. Thus, we show that the most natural waveform synthesis can be done with a neural vocoder, and that basic spectrogram inversion techniques can match advanced vocoders with high quality single speaker data. The WaveNet vocoder sounds more natural as the WORLD vocoder introduces various noticeable artifacts. Yet, lower inference latency may render the WORLD vocoder preferable: the heavily engineered WaveNet implementation runs at 3X realtime per CPU core (Arık et al., 2017), while WORLD runs up to 40X realtime per CPU core (see the subsection below).
|
| 138 |
+
|
| 139 |
+
Table 2: Mean Opinion Score (MOS) ratings with $9 5 \%$ confidence intervals using different waveform synthesis methods. We use the crowdMOS toolkit (Ribeiro et al., 2011); batches of samples from these models were presented to raters on Mechanical Turk. Since batches contained samples from all models, the experiment naturally induces a comparison between the models.
|
| 140 |
+
|
| 141 |
+
<table><tr><td>Model</td><td>Mean Opinion Score (MOS)</td></tr><tr><td>Deep Voice 3 (Griffin-Lim)</td><td>3.62 ± 0.31</td></tr><tr><td>Deep Voice3(WORLD)</td><td>3.63 ± 0.27</td></tr><tr><td>Deep Voice3(WaveNet)</td><td>3.78 ± 0.30</td></tr><tr><td>Tacotron (WaveNet)</td><td>3.78 ± 0.34</td></tr><tr><td>Deep Voice 2(WaveNet)</td><td>2.74 ± 0.35</td></tr></table>
|
| 142 |
+
|
| 143 |
+
Table 3: MOS ratings with $9 5 \%$ confidence intervals for audio clips from neural TTS systems on multi-speaker datasets. We also use crowdMOS toolkit; batches of samples including ground truth were presented to human raters. Multi-speaker Tacotron implementation and hyperparameters are based on Arık et al. (2017), which is a proof-of-concept implementation. Deep Voice 2 and Tacotron systems were not trained for the LibriSpeech dataset due to prohibitively long time required to optimize hyperparameters.
|
| 144 |
+
|
| 145 |
+
<table><tr><td>Model</td><td>MOS (VCTK)</td><td>MOS (LibriSpeech)</td></tr><tr><td>Deep Voice 3 (Griffin-Lim)</td><td>3.01 ± 0.29</td><td>2.37 ± 0.24</td></tr><tr><td>Deep Voice 3 (WORLD)</td><td>3.44 ± 0.32</td><td>2.89 ± 0.38</td></tr><tr><td>Deep Voice 2 (WaveNet)</td><td>3.69 ± 0.23</td><td>=</td></tr><tr><td>Tacotron (Griffin-Lim)</td><td>2.07 ± 0.31</td><td>1</td></tr><tr><td>Ground truth</td><td>4.69 ± 0.04</td><td>4.51 ± 0.18</td></tr></table>
|
| 146 |
+
|
| 147 |
+
Multi-Speaker Synthesis: To demonstrate that our model is capable of handling multi-speaker speech synthesis effectively, we train our models on the VCTK and LibriSpeech data sets. For LibriSpeech (an ASR dataset), we apply a preprocessing step of standard denoising (using SoX (Bagwell, 2017)) and splitting long utterances into multiple at pause locations (which are determined by Gentle (Ochshorn & Hawkins, 2017)). Results are presented in Table 3. We purposefully include ground-truth samples in the set being evaluated, because the accents in datasets are likely to be unfamiliar to our North American crowdsourced raters. Our model with the WORLD vocoder achieves a comparable MOS of 3.44 on VCTK in contrast to 3.69 from Deep Voice 2, which is the state-of-theart multi-speaker neural TTS system using WaveNet as vocoder and seperately optimized phoneme duration and fundamental frequency prediction models. We expect further improvement by using WaveNet for multi-speaker synthesis, although it may substantially slow down inference. The MOS on LibriSpeech is lower compared to VCTK, which we mainly attribute to the lower quality of the training dataset due to the various recording conditions and noticeable background noise. 10 In the literature, Yamagishi et al. (2010) also observes worse performance, when apply parametric TTS method to different ASR datasets with hundreds of speakers. Lastly, we find that the learned speaker embeddings lie in a meaningful latent space (see Fig. 7 in Appendix D).
|
| 148 |
+
|
| 149 |
+
Optimizing Inference for Deployment: In order to deploy a neural TTS system in a cost-effective manner, the system must be able to handle as much traffic as alternative systems on a comparable amount of hardware. To do so, we target a throughput of ten million queries per day or 116 queries per second (QPS) 11 on a single-GPU server with twenty CPU cores, which we find is comparable in cost to commercially deployed TTS systems. By implementing custom GPU kernels for the Deep Voice 3 architecture and parallelizing WORLD synthesis across CPUs, we demonstrate that our model can handle ten million queries per day. We provide more details on the implementation in Appendix B.
|
| 150 |
+
|
| 151 |
+
# 5 CONCLUSION
|
| 152 |
+
|
| 153 |
+
We introduce Deep Voice 3, a neural text-to-speech system based on a novel fully-convolutional sequence-to-sequence acoustic model with a position-augmented attention mechanism. We describe common error modes in sequence-to-sequence speech synthesis models and show that we successfully avoid these common error modes with Deep Voice 3. We show that our model is agnostic of the waveform synthesis method, and adapt it for Griffin-Lim spectrogram inversion, WaveNet, and WORLD vocoder synthesis. We demonstrate also that our architecture is capable of multispeaker speech synthesis by augmenting it with trainable speaker embeddings, a technique described in Deep Voice 2. Finally, we describe the production-ready Deep Voice 3 system in full including text normalization and performance characteristics, and demonstrate state-of-the-art quality through extensive MOS evaluations. Future work will involve improving the implicitly learned grapheme-tophoneme model, jointly training with a neural vocoder, and training on cleaner and larger datasets to scale to model the full variability of human voices and accents from hundreds of thousands of speakers.
|
| 154 |
+
|
| 155 |
+
# REFERENCES
|
| 156 |
+
|
| 157 |
+
Yannis Agiomyrgiannakis. Vocaine the vocoder and applications in speech synthesis. In ICASSP, 2015.
|
| 158 |
+
|
| 159 |
+
Sercan O. Arık, Mike Chrzanowski, Adam Coates, Gregory Diamos, Andrew Gibiansky, Yongguo ¨ Kang, Xian Li, John Miller, Jonathan Raiman, Shubho Sengupta, and Mohammad Shoeybi. Deep Voice: Real-time neural text-to-speech. In ICML, 2017.
|
| 160 |
+
|
| 161 |
+
Sercan O. Arık, Gregory Diamos, Andrew Gibiansky, John Miller, Kainan Peng, Wei Ping, Jonathan ¨ Raiman, and Yanqi Zhou. Deep Voice 2: Multi-speaker neural text-to-speech. In NIPS, 2017b.
|
| 162 |
+
|
| 163 |
+
Chris Bagwell. Sox - sound exchange. https://sourceforge.net/p/sox/code/ci/ master/tree/, 2017.
|
| 164 |
+
|
| 165 |
+
Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. In ICLR, 2015.
|
| 166 |
+
|
| 167 |
+
Tim Capes, Paul Coles, Alistair Conkie, Ladan Golipour, Abie Hadjitarkhani, Qiong Hu, Nancy Huddleston, Melvyn Hunt, Jiangchuan Li, Matthias Neeracher, et al. Siri on-device deep learningguided unit selection text-to-speech system. In Interspeech, 2017.
|
| 168 |
+
|
| 169 |
+
Kyunghyun Cho, Bart Van Merrienboer, Caglar Gulcehre, Dzmitry Bahdanau, Fethi Bougares, Hol- ¨ ger Schwenk, and Yoshua Bengio. Learning phrase representations using RNN encoder-decoder for statistical machine translation. In EMNLP, 2014.
|
| 170 |
+
|
| 171 |
+
Jan K Chorowski, Dzmitry Bahdanau, Dmitriy Serdyuk, Kyunghyun Cho, and Yoshua Bengio. Attention-based models for speech recognition. In NIPS, 2015.
|
| 172 |
+
|
| 173 |
+
Yann Dauphin, Angela Fan, Michael Auli, and David Grangier. Language modeling with gated convolutional networks. In ICML, 2017.
|
| 174 |
+
|
| 175 |
+
Jonas Gehring, Michael Auli, David Grangier, Denis Yarats, and Yann Dauphin. Convolutional sequence to sequence learning. In ICML, 2017.
|
| 176 |
+
|
| 177 |
+
Xavi Gonzalvo, Siamak Tazari, Chun-an Chan, Markus Becker, Alexander Gutkin, and Hanna Silen. Recent advances in Google real-time HMM-driven unit selection synthesizer. In Interspeech, 2016.
|
| 178 |
+
|
| 179 |
+
Daniel Griffin and Jae Lim. Signal estimation from modified short-time fourier transform. IEEE Transactions on Acoustics, Speech, and Signal Processing, 1984.
|
| 180 |
+
|
| 181 |
+
Hideki Kawahara, Ikuyo Masuda-Katsuse, and Alain De Cheveigne. Restructuring speech representations using a pitch-adaptive time–frequency smoothing and an instantaneous-frequency-based f0 extraction: Possible role of a repetitive structure in sounds. Speech communication, 1999.
|
| 182 |
+
|
| 183 |
+
Soroush Mehri, Kundan Kumar, Ishaan Gulrajani, Rithesh Kumar, Shubham Jain, Jose Sotelo, Aaron Courville, and Yoshua Bengio. SampleRNN: An unconditional end-to-end neural audio generation model. In ICLR, 2017.
|
| 184 |
+
|
| 185 |
+
Masanori Morise, Fumiya Yokomori, and Kenji Ozawa. WORLD: A vocoder-based high-quality speech synthesis system for real-time applications. IEICE Transactions on Information and Systems, 2016.
|
| 186 |
+
|
| 187 |
+
Robert Ochshorn and Max Hawkins. Gentle. https://github.com/lowerquality/ gentle, 2017.
|
| 188 |
+
|
| 189 |
+
Aaron van den Oord, Sander Dieleman, Heiga Zen, Karen Simonyan, Oriol Vinyals, Alex Graves, Nal Kalchbrenner, Andrew Senior, and Koray Kavukcuoglu. WaveNet: A generative model for raw audio. arXiv:1609.03499, 2016.
|
| 190 |
+
|
| 191 |
+
Colin Raffel, Thang Luong, Peter J Liu, Ron J Weiss, and Douglas Eck. Online and linear-time attention by enforcing monotonic alignments. In ICML, 2017.
|
| 192 |
+
|
| 193 |
+
Flavio Ribeiro, Dinei Flor ´ encio, Cha Zhang, and Michael Seltzer. Crowdmos: An approach for ˆ crowdsourcing mean opinion score studies. In IEEE ICASSP, 2011.
|
| 194 |
+
|
| 195 |
+
Alexander M Rush, Sumit Chopra, and Jason Weston. A neural attention model for abstractive sentence summarization. In EMNLP, 2015.
|
| 196 |
+
|
| 197 |
+
Tim Salimans and Diederik P Kingma. Weight normalization: A simple reparameterization to accelerate training of deep neural networks. In NIPS, 2016.
|
| 198 |
+
|
| 199 |
+
Jose Sotelo, Soroush Mehri, Kundan Kumar, Joao Felipe Santos, Kyle Kastner, Aaron Courville, and Yoshua Bengio. Char2wav: End-to-end speech synthesis. In ICLR workshop, 2017.
|
| 200 |
+
|
| 201 |
+
Ilya Sutskever, Oriol Vinyals, and Quoc V Le. Sequence to sequence learning with neural networks. In NIPS, 2014.
|
| 202 |
+
|
| 203 |
+
Yaniv Taigman, Lior Wolf, Adam Polyak, and Eliya Nachmani. Voice synthesis for in-the-wild speakers via a phonological loop. arXiv:1707.06588, 2017.
|
| 204 |
+
|
| 205 |
+
Paul Taylor. Text-to-Speech Synthesis. Cambridge University Press, New York, NY, USA, 1st edition, 2009. ISBN 0521899273, 9780521899277.
|
| 206 |
+
|
| 207 |
+
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. arXiv:1706.03762, 2017.
|
| 208 |
+
|
| 209 |
+
Yuxuan Wang, RJ Skerry-Ryan, Daisy Stanton, Yonghui Wu, Ron Weiss, Navdeep Jaitly, Zongheng Yang, Ying Xiao, Zhifeng Chen, Samy Bengio, Quoc Le, Yannis Agiomyrgiannakis, Rob Clark, and Rif A. Saurous. Tacotron: Towards end-to-end speech synthesis. In Interspeech, 2017.
|
| 210 |
+
|
| 211 |
+
Junichi Yamagishi, Takashi Nose, Heiga Zen, Zhen-Hua Ling, Tomoki Toda, Keiichi Tokuda, Simon King, and Steve Renals. Robust speaker-adaptive hmm-based text-to-speech synthesis. IEEE Transactions on Audio, Speech, and Language Processing, 2009.
|
| 212 |
+
|
| 213 |
+
Junichi Yamagishi, Bela Usabaev, Simon King, Oliver Watts, John Dines, Jilei Tian, Yong Guan, Rile Hu, Keiichiro Oura, Yi-Jian Wu, et al. Thousands of voices for hmm-based speech synthesis– analysis and application of tts systems built on various asr corpora. IEEE Transactions on Audio, Speech, and Language Processing, 2010.
|
| 214 |
+
|
| 215 |
+
# Appendices
|
| 216 |
+
|
| 217 |
+
# A DETAILED MODEL ARCHITECTURE OF DEEP VOICE 3
|
| 218 |
+
|
| 219 |
+
The detailed model architecture in depicted in Fig. 6.
|
| 220 |
+
|
| 221 |
+

|
| 222 |
+
Figure 6: Deep Voice 3 uses a deep residual convolutional network to encode text and/or phonemes into per-timestep key and value vectors for an attentional decoder. The decoder uses these to predict the mel-band log magnitude spectrograms that correspond to the output audio. (Light blue dotted arrows depict the autoregressive synthesis process during inference.) The hidden state of the decoder then gets fed to a converter network to output linear spectrograms for Griffin-Lim or parameters for WORLD, which can be used to synthesize the final waveform. Weight normalization (Salimans & Kingma, 2016) is applied to all convolution filters and fully-connected layer weight matrices in the model.
|
| 223 |
+
|
| 224 |
+
# B OPTIMIZING DEEP VOICE 3 FOR DEPLOYMENT
|
| 225 |
+
|
| 226 |
+
Running inference with a TensorFlow graph turns out to be prohibitively expensive, averaging approximately 1 QPS 12. Instead, we implement custom GPU kernels for Deep Voice 3 inference. Due to the complexity of the model and the large number of output timesteps, launching individual kernels for different operations in the graph (convolutions, matrix multiplications, unary and binary operations etc.) is impractical: the overhead of launch a CUDA kernel is approximately $5 0 ~ \mu \mathrm { s } .$ , which, when aggregated across all operations in the model and all output timesteps, limits throughput to approximately 10 QPS. Thus, we implement a single kernel for the entire model, which avoids the overhead of launching many CUDA kernels. Finally, instead of batching computation in the kernel, our kernel operates on a single utterance and we launch as many concurrent streams as there are Streaming Multiprocessors (SMs) on the GPU. Every kernel is launched with one block, so we expect the GPU to schedule one block per SM, allowing us to scale inference speed linearly with the number of SMs.
|
| 227 |
+
|
| 228 |
+
On a single Nvidia Tesla P100 GPU with 56 SMs, we achieve an inference speed of 115 QPS, which corresponds to our target ten million queries per day. We parallelize WORLD synthesis across all 20 CPUs on the server, permanently pinning threads to CPUs in order to maximize cache performance.
|
| 229 |
+
|
| 230 |
+
In this setup, GPU inference is the bottleneck, as WORLD synthesis on 20 cores is faster than 115 QPS.
|
| 231 |
+
|
| 232 |
+
We believe that inference can be made significantly faster through more optimized kernels, smaller models, and fixed-precision arithmetic; we leave these aspects to future work.
|
| 233 |
+
|
| 234 |
+
# C MODEL HYPERPARAMETERS
|
| 235 |
+
|
| 236 |
+
All hyperparameters of the models used in this paper are shown in Table 4.
|
| 237 |
+
|
| 238 |
+
Table 4: Hyperparameters used for best models for the three datasets used in the paper.
|
| 239 |
+
|
| 240 |
+
<table><tr><td rowspan=1 colspan=1>Parameter</td><td rowspan=1 colspan=1> Single-Speaker</td><td rowspan=1 colspan=1>VCTK</td><td rowspan=1 colspan=1>LibriSpeech</td></tr><tr><td rowspan=1 colspan=1>FFT Size</td><td rowspan=1 colspan=1>4096</td><td rowspan=1 colspan=1>4096</td><td rowspan=1 colspan=1>4096</td></tr><tr><td rowspan=1 colspan=1>FFTWindow Size /Shift</td><td rowspan=1 colspan=1>2400/600</td><td rowspan=1 colspan=1>2400/600</td><td rowspan=1 colspan=1>1600/400</td></tr><tr><td rowspan=1 colspan=1>Audio Sample Rate</td><td rowspan=1 colspan=1>48000</td><td rowspan=1 colspan=1>48000</td><td rowspan=1 colspan=1>16000</td></tr><tr><td rowspan=1 colspan=1>Reduction Factor r</td><td rowspan=1 colspan=1>4</td><td rowspan=1 colspan=1>4</td><td rowspan=1 colspan=1>4</td></tr><tr><td rowspan=1 colspan=1>Mel Bands</td><td rowspan=1 colspan=1>80</td><td rowspan=1 colspan=1>80</td><td rowspan=1 colspan=1>80</td></tr><tr><td rowspan=1 colspan=1>Sharpening Factor</td><td rowspan=1 colspan=1>1.4</td><td rowspan=1 colspan=1>1.4</td><td rowspan=1 colspan=1>1.4</td></tr><tr><td rowspan=1 colspan=1>Character Embedding Dim.</td><td rowspan=1 colspan=1>256</td><td rowspan=1 colspan=1>256</td><td rowspan=1 colspan=1>256</td></tr><tr><td rowspan=1 colspan=1>EncoderLayers /Conv.Width/Channels</td><td rowspan=1 colspan=1>715/64</td><td rowspan=1 colspan=1>7/5/128</td><td rowspan=1 colspan=1>7/5/256</td></tr><tr><td rowspan=1 colspan=1>Decoder Affine Size</td><td rowspan=1 colspan=1>128,256</td><td rowspan=1 colspan=1>128,256</td><td rowspan=1 colspan=1>128,256</td></tr><tr><td rowspan=1 colspan=1>Decoder Layers / Conv. Width</td><td rowspan=1 colspan=1>4/5</td><td rowspan=1 colspan=1>6/5</td><td rowspan=1 colspan=1>8/5</td></tr><tr><td rowspan=1 colspan=1>Attention Hidden Size</td><td rowspan=1 colspan=1>128</td><td rowspan=1 colspan=1>256</td><td rowspan=1 colspan=1>256</td></tr><tr><td rowspan=1 colspan=1>Position Weight / Initial Rate</td><td rowspan=1 colspan=1>1.0/6.3</td><td rowspan=1 colspan=1>0.1/7.6</td><td rowspan=1 colspan=1>0.1/2.6</td></tr><tr><td rowspan=1 colspan=1>Converter Layers /Conv.Width/ Channels</td><td rowspan=1 colspan=1>5/5/256</td><td rowspan=1 colspan=1>6/5/256</td><td rowspan=1 colspan=1>8/5/256</td></tr><tr><td rowspan=1 colspan=1>Dropout Keep Probability</td><td rowspan=1 colspan=1>0.95</td><td rowspan=1 colspan=1>0.95</td><td rowspan=1 colspan=1>0.99</td></tr><tr><td rowspan=1 colspan=1>Number of Speakers</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>108</td><td rowspan=1 colspan=1>2484</td></tr><tr><td rowspan=1 colspan=1>Speaker Embedding Dim.</td><td rowspan=1 colspan=1>-</td><td rowspan=1 colspan=1>16</td><td rowspan=1 colspan=1>512</td></tr><tr><td rowspan=1 colspan=1>ADAMLearning Rate</td><td rowspan=1 colspan=1>0.001</td><td rowspan=1 colspan=1>0.0005</td><td rowspan=1 colspan=1>0.0005</td></tr><tr><td rowspan=1 colspan=1>Anneal Rate /Anneal Interval</td><td rowspan=1 colspan=1>-</td><td rowspan=1 colspan=1>0.98/30000</td><td rowspan=1 colspan=1>0.95/30000</td></tr><tr><td rowspan=1 colspan=1>Batch Size</td><td rowspan=1 colspan=1>16</td><td rowspan=1 colspan=1>16</td><td rowspan=1 colspan=1>16</td></tr><tr><td rowspan=1 colspan=1>Max Gradient Norm</td><td rowspan=1 colspan=1>100</td><td rowspan=1 colspan=1>100</td><td rowspan=1 colspan=1>50.0</td></tr><tr><td rowspan=1 colspan=1>Gradient Clipping Max. Value</td><td rowspan=1 colspan=1>5</td><td rowspan=1 colspan=1>5</td><td rowspan=1 colspan=1>5</td></tr></table>
|
| 241 |
+
|
| 242 |
+
# D LATENT SPACE OF THE LEARNED EMBEDDINGS
|
| 243 |
+
|
| 244 |
+
Similar to Arık et al. (2017), we apply principal component analysis to the learned speaker embeddings and analyze the speakers based on their ground truth genders. Fig. 7 shows the genders of the speakers in the space spanned by the first two principal components. We observe a very clear separation between male and female genders, suggesting the low-dimensional speaker embeddings constitute a meaningful latent space.
|
| 245 |
+
|
| 246 |
+

|
| 247 |
+
Figure 7: The first two principal components of the learned embeddings for (a) VCTK dataset (108 speakers) and (b) LibriSpeech dataset (2484 speakers).
|
| 248 |
+
|
| 249 |
+
# E 100-SENTENCE TEST SET
|
| 250 |
+
|
| 251 |
+
The 100 sentences used to quantify the results in Table 1 are listed below (note that $\%$ symbol corresponds to pause):
|
| 252 |
+
|
| 253 |
+
4. WAREHOUSE%.
|
| 254 |
+
5.REFERENDUM&
|
| 255 |
+
8。ENVIRONMENT&
|
| 256 |
+
9. A DEBT RUNS%.
|
| 257 |
+
10 GRAVITATIONAL8.
|
| 258 |
+
11 CARDBOARD FIMS
|
| 259 |
+
12 PERSON THINK ING8.
|
| 260 |
+
13. PREPARED KILLER&.
|
| 261 |
+
14 AIRCRAPT TORTURE&
|
| 262 |
+
15 ALLERGIC TROUSER8
|
| 263 |
+
16 STRATECIC CONDUCT&
|
| 264 |
+
17. NORRYING LITERATURE%.
|
| 265 |
+
18 CHRISTMAS ISI COMINGS
|
| 266 |
+
TOIA PETIDILD THINESO
|
| 267 |
+
20 HON WAS THE MATH TEST&?
|
| 268 |
+
21 GOOD TO THE LAST DROP&.
|
| 269 |
+
22 AN M B A AGENT LISTENS&.
|
| 270 |
+
23.A COMPROMISE DISAPPEARS%.
|
| 271 |
+
24 AN AXIS OF X YIOR 2 EREE2ES8
|
| 272 |
+
25. SHE DID HER BEST TO HELP HIM&.
|
| 273 |
+
26.A BACKBONE CONTESTS THE CHAOS8
|
| 274 |
+
27 TWO A CREATER THAN THO N NINE&.
|
| 275 |
+
20 DONLT STEP ON THD BROREN CLRSSS
|
| 276 |
+
29.A DAMNED FLIPS INTO THE PATIENTS.
|
| 277 |
+
30 TRADE PURGES ITHIN THE B BICS
|
| 278 |
+
31.I'D RATHER BE A BIRD THAN A FISH%.
|
| 279 |
+
32 1 HDAR THAT NANCY IS UERY PRETTY6N
|
| 280 |
+
33.1 WANT MORE DETAILED INFORMATION8.
|
| 281 |
+
34: PLEASE WAIT OUTSIDE OF THE HOUSES.
|
| 282 |
+
35:NTA S A EXPOSURE TUNES THE HAFFLE&
|
| 283 |
+
BO IST DICTASS ImIR IE MONSHEN
|
| 284 |
+
37.A SKETCH ROPES THE MIDDLE CEREMONY&
|
| 285 |
+
30 EVERY FARERELL EX PLODES THE CAREER
|
| 286 |
+
39 SHE FOLDED HER HANDKERCHIEF NEATLY
|
| 287 |
+
4DRGI NSHDEDISDTCHOOSESITHE STUDIOS
|
| 288 |
+
41. ROCK MUSIC APPROACHES AT HIGH VELOCITY&.
|
| 289 |
+
42 NINE ADAM BAYE STUDY ON THE TNO PIECES
|
| 290 |
+
43. AN UNFRIENDLY DECAY CONVEYS THE OUTCOME% .
|
| 291 |
+
44ABSTRACTION ISTOFTEN ONE FLOOR ABOVE YOUS
|
| 292 |
+
45.A PLAYED LADY RANKS ANY PUBLICIZED PREVIEW%.
|
| 293 |
+
46 HE TOLD USIA UERY EXCITINGT ADUENTURE STOR
|
| 294 |
+
47. ON AUGUST TWENTY EIGTH&MARY PLAYS THE PIANO% .
|
| 295 |
+
48. INTO A CONTROLLER BEAMS A CONCRETE TERRORISTS
|
| 296 |
+
49.I OFTEN SEE THE TIME ELEVEN ELEVEN ON CLOCKS%.
|
| 297 |
+
50.IT OAS GETTING DARK SAND TE PEREN T THERE YETS
|
| 298 |
+
51.AGAINST EVERY RHYME STARVES A CHORAL APPARATUS: .
|
| 299 |
+
52 BRONEIGT BUS EOIL OENT TO nH MOID ALONE
|
| 300 |
+
53I CHECKED TO MAKE SURE THAT HE TAS STILL ALIVE:
|
| 301 |
+
54A DOMINANT VEGETARIAN SHIES ANAY FROM THE CIO P&
|
| 302 |
+
55.JOE MADE THE SUGAR COOKIES&SUSAN DECORATED THEM6 .
|
| 303 |
+
56 YOL NEDROBAONESIOSBUT RNOT ROONGBUTT DES
|
| 304 |
+
57 A FORMER OVERRIDE OF QWE R TY OUTSIDE THE POPES.
|
| 305 |
+
58UBBIIS YSITHAT C IISSILL STAY ARY FROM ITS
|
| 306 |
+
59.ANY CLIMBING DISH LISTENS TO A CUMBERSOME FORMULA8
|
| 307 |
+
GO SHE OROTE HIMIAILONCI LETTERSBUT HEIDIDNTT READ ITE
|
| 308 |
+
61.DEARSBEAUTY IS IN THE HEAT NOT PHYSICALSI LOVE YOU&.
|
| 309 |
+
62 AN APPEAL ON JANUARY FIETH DUPLICATES A SHARP QUEENS
|
| 310 |
+
63.A FAREWELL SOLOS ON MARCH TRENTY THIRD SHAKES NORTHS
|
| 311 |
+
64: HE RAN OUT OF MONEYSSO HE HAD TO STOP PLAYING POKERS
|
| 312 |
+
|
| 313 |
+
GOTICURENTIHAVEIFOURDINDOSIOPENTUPSANDITIDONUTIRNOIOELO
|
| 314 |
+
67 . NEXT TO MY INDIRECT VOCAL DECLINES EVERY UNBEARABLE ACADEMIC%.
|
| 315 |
+
60OPPOSITE HERISOUNDING BAC IGTAMC SICONEIGUREDI THOROUCHEARES
|
| 316 |
+
69. FROM APRIL EIGHTH TO THE PRESENTSI ONLY SMOKE FOUR CIGARETTES%.
|
| 317 |
+
TOI WIL NEVER IBEITHIS YOUNGTAGAING ERSOHI DAMNGI GUST GOT OLDER
|
| 318 |
+
E GENEROUSICONTINUUM OEUADAZOTDOT CONTISTTHE CONFLICTING HORKERS
|
| 319 |
+
22 SHETAD ISED H GO COLE BACK AT ONCESTED IEE LECTURES THRBLASTO
|
| 320 |
+
13.A SONG CAN MAKE OR RUIN A PERSON'S DAY IF THEY LET IT GET TO THEM&.
|
| 321 |
+
TASHDIDID NOT ICHDAT ONTEE TESTSEOR T DASINOT TEEIRIGH THING TOI DOS
|
| 322 |
+
75. HE SAID HE WAS NOT THERE YESTERDAY&HOWEVERSMANY PEOPLE SAN HIM THERE&.
|
| 323 |
+
16 SHOULD PE START CLASS NON BOR SHOULD TEAIT EOR EVERYONE TO CET HERES2
|
| 324 |
+
1IF PURPLE PEOPLE EATERS ARE REALSWHERE DO THEY FIND PURPLE PEOPLE TO EATS?
|
| 325 |
+
LOON NOUBMBERIBIGHTEENTH EIGHTEEN TOENTY ONEO CLITTERINGICDT ISINOT ENOUGH
|
| 326 |
+
79.A ROCKET FROM SPACE X INTERACTS WITH THE INDIVIDUAL BENEATH THE SOFT FLAN%.
|
| 327 |
+
BO MALLS ARE GREAT PLACES TOISHOPSI CAN FIND EVER THING IINEED UNDER IONE ROOFS
|
| 328 |
+
81.I THINK I WILL BUY THE RED CARBOR I WILL LEASE THE BLUE ONESTHE FAITH NESTS8.
|
| 329 |
+
82 ITALY IS ITBVORITE COUNIRIAINIDACTBI PLAN TO SPEND TRO TEEKS THERD NET DARS
|
| 330 |
+
83.1 WOULD HAVE GOTTEN W WN DOT GOOGLE DOT COMSBUT MY ATTENDANCE PASN'T GOOD ENOUGH&.
|
| 331 |
+
84 NINETEEN TRENTY IS WHEN RE ARE UNIQUE TOGETHER UNTIL WE REALISEWE ARE ALL THESAME%.COM%.ORG%.INCORRECT COMPUTER&.
|
| 332 |
+
93.SHEBORRORED THE BOOKIEROM HIMMANY YEARSLAGO AND HASNT YET RETURNED IT&WHY WON'T
|
| 333 |
+
DIFFERENT TO WHAT MY NICKNAME WAS&THE METAL LUSTS&THE RANGING CAPTAIN CHARTERS THELINK%.WERE CRASHING ON THE SHORE&IT WAS A LOVELY SIGHT&THE PARADOX STICKS THIS BOWL ONTOP OF A SPONTANEOUS TEAS
|
| 334 |
+
97A PURPLE PIG AND A GREEN DONKEY FLEN A KITE IN THE MIDDLE OF THE NIGHT AND ENDED UPSUNBURNT&THE CONTAINED ERROR POSES AS A LOGICAL TARGET&THE DIVORCE ATTACKS NEAR AMISSING DOOM&THE OPERA FINES THE DAILY EXAMINER INTO A MURDERER%.
|
| 335 |
+
98.AS THE MOST FAMOUS SINGLER-SONGRRITER&UAY CHOU GAVE A PERFECT PERFORMANCE INBEIJING ON MAY TWENTY FOURTH&TWENTY FIFTH&AND TWENTY SIXTH TWENTY THREE ALL THE
|
| 336 |
+
CLOCK WITHIN THIS BLOG AND THE CLOCK ON MY LAPTOP ARE ONE HOUR DIFFERENT FROM EACHOTHER%.WOULD TASTE LIKE CARAMEL POPCORN%IT DIDN'T AND THEY DON'T RECOMMEND ANYONE ELSE DOIT EITHER&THE GENTLEMAN MARCHES AROUND THE PRINCIPAL%THE DIVORCE ATTACKS NEAR AMISSING DOOM&THE COLOR MISPRINTS A CIRCULAR WORRY ACROSS THE CONTROVERSY% .
|
md/train/HkNEuToge/HkNEuToge.md
ADDED
|
@@ -0,0 +1,404 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ENERGY-BASED SPHERICAL SPARSE CODING
|
| 2 |
+
|
| 3 |
+
Bailey Kong and Charless C. Fowlkes
|
| 4 |
+
|
| 5 |
+
Department of Computer Science University of California, Irvine Irvine, CA 92697 USA {bhkong,fowlkes}@ics.uci.edu
|
| 6 |
+
|
| 7 |
+
# ABSTRACT
|
| 8 |
+
|
| 9 |
+
In this paper, we explore an efficient variant of convolutional sparse coding with unit norm code vectors where reconstruction quality is evaluated using an inner product (cosine distance). To use these codes for discriminative classification, we describe a model we term Energy-Based Spherical Sparse Coding (EB-SSC) in which the hypothesized class label introduces a learned linear bias into the coding step. We evaluate and visualize performance of stacking this encoder to make a deep layered model for image classification.
|
| 10 |
+
|
| 11 |
+
# 1 INTRODUCTION
|
| 12 |
+
|
| 13 |
+
Sparse coding has been widely studied as a representation for images, audio and other vectorial data. This has been a highly successful method that has found its way into many applications, from signal compression and denoising (Donoho, 2006; Elad & Aharon, 2006) to image classification (Wright et al., 2009), to modeling neuronal receptive fields in visual cortex (Olshausen & Field, 1997). Since its introduction, subsequent works have brought sparse coding into the supervised learning setting by introducing classification loss terms to the original formulation to encourage features that are not only able to reconstruct the original signal but are also discriminative (Jiang et al., 2011; Yang et al., 2010; Zeiler et al., 2010; Ji et al., 2011; Zhou et al., 2012; Zhang et al., 2013).
|
| 14 |
+
|
| 15 |
+
While supervised sparse coding methods have been shown to find more discriminative features leading to improved classification performance over their unsupervised counterparts, they have received much less attention in recent years and have been eclipsed by simpler feed-forward architectures.
|
| 16 |
+
|
| 17 |
+
This is in part because sparse coding is computationally expensive. Convex formulations of sparse coding typically consist of a minimization problem over an objective that includes a least-squares (LSQ) reconstruction error term plus a sparsity inducing regularizer.
|
| 18 |
+
|
| 19 |
+
Because there is no closed-form solution to this formulation, various iterative optimization techniques are generally used to find a solution (Zeiler et al., 2010; Bristow et al., 2013; Yang et al., 2013; Heide et al., 2015). In applications where an approximate solution suffices, there is work that learns non-linear predictors to estimate sparse codes rather than solve the objective more directly (Gregor & LeCun, 2010). The computational overhead for iterative schemes becomes quite significant when training discriminative models due to the demand of processing many training examples necessary for good performance, and so sparse coding has fallen out of favor by not being able to keep up with simpler non-iterative coding methods.
|
| 20 |
+
|
| 21 |
+
In this paper we introduce an alternate formulation of sparse coding using unit length codes and a reconstruction loss based on the cosine similarity. Optimal sparse codes in this model can be computed in a non-iterative fashion and the coding objective lends itself naturally to embedding in a discriminative, energy-based classifier which we term energy-based spherical sparse coding (EBSSC). This bi-directional coding method incorporates both top-down and bottom-up information where the features representation depends on both a hypothesized class label and the input signal. Like Cao et al. (2015), our motivation for bi-directional coding comes from the “Biased Competition Theory”, which suggests that visual processing can be biased by other mental processes (e.g., topdown influence) to prioritize certain features that are most relevant to current task. Fig. 1 illustrates the flow of computation used by our SSC and EB-SSC building blocks compared to a standard feed-forward layer.
|
| 22 |
+
|
| 23 |
+
Our energy based approach for combining top-down and bottom-up information is closely tied to the ideas of Larochelle & Bengio (2008); Ji et al. (2011); Zhang et al. (2013); Li & Guo (2014)— although the model details are substantially different (e.g., Ji et al. (2011) and Zhang et al. (2013) use sigmoid non-linearities while Li & Guo (2014) use separate representations for top-down and bottom-up information). The energy function of Larochelle & Bengio (2008) is also similar but includes an extra classification term and is trained as a restricted Boltzmann machine.
|
| 24 |
+
|
| 25 |
+

|
| 26 |
+
Figure 1: Building blocks for coding networks explored in this paper. Our coding model uses non-linearities that are closely related to the standard ReLU activation function. (a) Keeping both positive and negative activations provides a baseline feed-forward model termed concatenated ReLU (CReLU). (b) Our spherical sparse coding layer has a similar structure but with an extra bias and normalization step. Our proposed energy-based model uses (c) energy-based spherical sparse coding (EB-SSC) blocks that produces sparse activations which are not only positive and negative, but are class-specific. These blocks can be stacked to build deeper architectures.
|
| 27 |
+
|
| 28 |
+
# 1.1 NOTATION
|
| 29 |
+
|
| 30 |
+
Matrices are denoted as uppercase bold (e.g., A), vectors are lowercase bold (e.g., a), and scalars are lowercase (e.g., $a$ ). We denote the transpose operator with |, the element-wise multiplication operator with $\odot$ , the convolution operator with $^ *$ , and the cross-correlation operator with $\star$ . For vectors where we dropped the subscript $k$ (e.g., $\mathbf { d }$ and $\mathbf { z }$ ), we refer to a super vector with $K$ components stacked together (e.g., $\mathbf { z } = [ \mathbf { z } _ { 1 } ^ { \mathsf { T } } , \ldots , \mathbf { z } _ { K } ^ { \mathsf { T } } ] ^ { \mathsf { T } }$ ).
|
| 31 |
+
|
| 32 |
+
# 2 ENERGY-BASED SPHERICAL SPARSE CODING
|
| 33 |
+
|
| 34 |
+
Energy-based models capture dependencies between variables using an energy function that measure the compatibility of the configuration of variables (LeCun et al., 2006). To measure the compatibility between the top-down and bottom-up information, we define the energy function of EB-SSC to be the sum of bottom-up coding term and a top-down classification term:
|
| 35 |
+
|
| 36 |
+
$$
|
| 37 |
+
E ( \mathbf { x } , y , \mathbf { z } ) = E _ { c o d e } ( \mathbf { x } , \mathbf { z } ) + E _ { c l a s s } ( y , \mathbf { z } ) .
|
| 38 |
+
$$
|
| 39 |
+
|
| 40 |
+
The bottom-up information (input signal $\mathbf { x }$ ) and the top-down information (class label $y$ ) are tied together by a latent feature map $\mathbf { z }$ .
|
| 41 |
+
|
| 42 |
+
# 2.1 BOTTOM-UP RECONSTRUCTION
|
| 43 |
+
|
| 44 |
+
To measure the compatibility between the input signal $\mathbf { x }$ and the latent feature maps $\mathbf { z }$ , we introduce a novel variant of sparse coding that is amenable to efficient feed-forward optimization. While the idea behind this variant can be applied to either patch-based or convolutional sparse coding, we specifically use the convolutional variant that shares the burden of coding an image among nearby overlapping dictionary elements. Using such a shift-invariant approach avoids the need to learn dictionary elements which are simply translated copies of each other, freeing up resources to discover more diverse and specific filters (see Kavukcuoglu et al. (2010)).
|
| 45 |
+
|
| 46 |
+
Convolutional sparse coding (CSC) attempts to find a set of dictionary elements $\{ \mathbf { d } _ { 1 } , \hdots , \mathbf { d } _ { K } \}$ and corresponding sparse codes $\left\{ { \bf z } _ { 1 } , \ldots , { \bf z } _ { K } \right\}$ so that the resulting reconstruction, $\begin{array} { r } { \mathbf { r } = \sum _ { k = 1 } ^ { K } \mathbf { d } _ { k } * \mathbf { z } _ { k } } \end{array}$ accurately represents the input signal $\mathbf { x }$ . This is traditionally framed as a least-squares minimization with a sparsity inducing prior on $\mathbf { z }$ :
|
| 47 |
+
|
| 48 |
+
$$
|
| 49 |
+
\underset { \mathbf { z } } { \arg \operatorname* { m i n } } \ \| \mathbf { x } - \sum _ { k = 1 } ^ { K } \mathbf { d } _ { k } * \mathbf { z } _ { k } \| _ { 2 } ^ { 2 } + \beta \| \mathbf { z } \| _ { 1 } .
|
| 50 |
+
$$
|
| 51 |
+
|
| 52 |
+
Unlike standard feed-forward CNN models that convolve the input signal $\mathbf { x }$ with the filters, this energy function corresponds to a generative model where the latent feature maps $\left\{ { \bf z } _ { 1 } , \ldots , { \bf z } _ { K } \right\}$ are convolved with the filters and compared to the input signal (Bristow et al., 2013; Heide et al., 2015; Zeiler et al., 2010).
|
| 53 |
+
|
| 54 |
+
To motivate our novel variant of CSC, consider expanding the squared reconstruction error $\| \mathbf { x } - \mathbf { \partial }$ $\mathbf { r } \| _ { 2 } ^ { 2 } = \| \mathbf { x } \| _ { 2 } ^ { 2 } - 2 \mathbf { x } ^ { \mathsf { T } } \mathbf { r } + \| \mathbf { r } \| _ { 2 } ^ { 2 }$ . If we constrain the reconstruction $\mathbf { r }$ to have unit norm, the reconstruction error depends entirely on the inner product between $\mathbf { x }$ and $\mathbf { r }$ and is equivalent to the cosine similarity (up to additive and multiplicative constants). This suggests the closely related unit-length reconstruction problem:
|
| 55 |
+
|
| 56 |
+
$$
|
| 57 |
+
\begin{array} { r l r } { { \arg \operatorname* { m a x } \mathbf { x } ^ { \intercal } \big ( \sum _ { k = 1 } ^ { K } \mathbf { d } _ { k } * \mathbf { z } _ { k } \big ) - \beta \| \mathbf { z } \| _ { 1 } } } \\ & { } & { \mathrm { s . t . ~ } \| \sum _ { k = 1 } ^ { K } \mathbf { d } _ { k } * \mathbf { z } _ { k } \| _ { 2 } \leq 1 } \end{array}
|
| 58 |
+
$$
|
| 59 |
+
|
| 60 |
+
In Appendix A we show that, given an optimal unit length reconstruction $\bar { \mathbf { r } } ^ { * }$ with corresponding codes $\bar { \mathbf { z } } ^ { * }$ , the solution to the least squares reconstruction problem (Eq. 2) can be computed by a simple scaling $\begin{array} { r } { \mathbf { r } ^ { * } = ( \mathbf { x } ^ { \mathsf { T } } \bar { \mathbf { r } ^ { * } } - \frac { \beta } { 2 } \| \bar { \mathbf { z } } ^ { * } \| _ { 1 } ) \bar { \mathbf { r } } ^ { * } } \end{array}$ .
|
| 61 |
+
|
| 62 |
+
The unit-length reconstruction problem is no easier than the original least-squares optimization due to the constraint on the reconstruction which couples the codes for different filters. Instead consider a simplified constraint on $\mathbf { z }$ which we refer to as spherical sparse coding (SSC):
|
| 63 |
+
|
| 64 |
+
$$
|
| 65 |
+
\underset { \| { \bf z } \| _ { 2 } \leq 1 } { \arg \operatorname* { m a x } } \ E _ { c o d e } ( { \bf x } , { \bf z } ) = \underset { \| { \bf z } \| _ { 2 } \leq 1 } { \arg \operatorname* { m a x } } { \bf x } ^ { \top } \big ( \sum _ { k = 1 } ^ { K } { \bf d } _ { k } * { \bf z } _ { k } \big ) - \beta \| { \bf z } \| _ { 1 } .
|
| 66 |
+
$$
|
| 67 |
+
|
| 68 |
+
In 2.3 below, we show that the solution to this problem can be found very efficiently without requiring iterative optimization.
|
| 69 |
+
|
| 70 |
+
This problem is a relaxation of convolutional sparse coding since it ignores non-orthogonal interactions between the dictionary elements1. Alternately, assuming unit norm dictionary elements, the code norm constraint can be used to upper-bound the reconstruction length. We have by the triangle and Young’s inequality that:
|
| 71 |
+
|
| 72 |
+
$$
|
| 73 |
+
\Big \| \sum _ { k } \mathbf { d } _ { k } * \mathbf { z } _ { k } \Big \| _ { 2 } \leq \sum _ { k } \| \mathbf { d } _ { k } * \mathbf { z } _ { k } \| _ { 2 } \leq \sum _ { k } \| \mathbf { d } _ { k } \| _ { 1 } \| \mathbf { z } _ { k } \| _ { 1 } \leq D \sum _ { k } \| \mathbf { z } _ { k } \| _ { 2 }
|
| 74 |
+
$$
|
| 75 |
+
|
| 76 |
+
where the factor $D$ is the dimension of $\mathbf { z } _ { k }$ and arises from switching from the 1-norm to the 2-norm. Since $D \sum _ { k } \| { \mathbf z } _ { k } \| _ { 2 } \leq 1$ is a tighter constraint we have
|
| 77 |
+
|
| 78 |
+
$$
|
| 79 |
+
\operatorname* { m a x } _ { \| \sum _ { k } \mathbf { d } _ { k } * \mathbf { z } _ { k } \| _ { 2 } \leq 1 } E _ { c o d e } ( \mathbf { x } , \mathbf { z } ) \geq \operatorname* { m a x } _ { \sum _ { k } \| \mathbf { z } _ { k } \| _ { 2 } \leq \frac { 1 } { D } } E _ { c o d e } ( \mathbf { x } , \mathbf { z } )
|
| 80 |
+
$$
|
| 81 |
+
|
| 82 |
+
However, this relaxation is very loose, primarily due to the triangle inequality. Except in special cases (e.g., if the dictionary elements have disjoint spectra) the SSC codes will be quite different from the standard least-squares reconstruction.
|
| 83 |
+
|
| 84 |
+
# 2.2 TOP-DOWN CLASSIFICATION
|
| 85 |
+
|
| 86 |
+
To measure the compatibility between the class label $y$ and the latent feature maps $\mathbf { z }$ , we use a set of one-vs-all linear classifiers. To provide more flexibility, we generalize this by splitting the code vector into positive and negative components:
|
| 87 |
+
|
| 88 |
+
$$
|
| 89 |
+
\begin{array} { r } { { \bf z } _ { k } = { \bf z } _ { k } ^ { + } + { \bf z } _ { k } ^ { - } \quad { \bf z } _ { k } ^ { + } \geq 0 \quad { \bf z } _ { k } ^ { - } \leq 0 } \end{array}
|
| 90 |
+
$$
|
| 91 |
+
|
| 92 |
+
and allow the linear classifier to operate on each component separately. We express the classifier score for a hypothesized class label $y$ by:
|
| 93 |
+
|
| 94 |
+
$$
|
| 95 |
+
E _ { c l a s s } ( y , \mathbf { z } ) = \sum _ { k = 1 } ^ { K } \mathbf { w } _ { y } ^ { + \intercal } \mathbf { z } _ { k } ^ { + } + \sum _ { k = 1 } ^ { K } \mathbf { w } _ { y } ^ { - \intercal } \mathbf { z } _ { k } ^ { - } .
|
| 96 |
+
$$
|
| 97 |
+
|
| 98 |
+
The classifier thus is parameterized by a pair of weight vectors $( \mathbf { w } _ { y k } ^ { + }$ and $\mathbf { w } _ { y k } ^ { - }$ ) for each class label $y$ and $k$ -th channel of the latent feature map.
|
| 99 |
+
|
| 100 |
+
This splitting, sometimes referred to as full-wave rectification, is useful since a dictionary element and its negative do not necessarily have opposite visual semantics. This splitting also allows the classifier the flexibility to assign distinct meanings or alternately be completely invariant to contrast reversal depending on the problem domain. For example, Shang et al. (2016) found CNN models with ReLU non-linearities which discard the negative activations tend to learn pairs of filters which are related by negation. Keeping both positive and negative responses allowed them to halve the number of dictionary elements.
|
| 101 |
+
|
| 102 |
+
We note that it is also straightforward to introduce spatial average pooling prior to classification by introducing a fixed linear operator $\mathbf { P }$ used to pool the codes (e.g., $\mathbf { \bar { w } } _ { y } ^ { + \top } \mathbf { P } \mathbf { z } _ { k } ^ { \mp } ,$ ). This is motivated by a variety of hand-engineered feature extractors and sparse coding models, such as Ren & Ramanan (2013), which use spatially pooled histograms of sparse codes for classification. This fixed pooling can be viewed as a form of regularization on the linear classifier which enforces shared weights over spatial blocks of the latent feature map. Splitting is also quite important to prevent information loss when performing additive pooling since positive and negative components of $\mathbf { z } _ { k }$ can cancel each other out.
|
| 103 |
+
|
| 104 |
+
# 2.3 CODING
|
| 105 |
+
|
| 106 |
+
Bottom-up reconstruction and top-down classification each provide half of the story, coupled by the latent feature maps. For a given input $\mathbf { x }$ and hypothesized class $y$ , we would like to find the optimal activations $\mathbf { z }$ that maximize the joint energy function $E ( \mathbf { x } , y , \mathbf { z } )$ . This requires solving the following optimization:
|
| 107 |
+
|
| 108 |
+
$$
|
| 109 |
+
\underset { \| \mathbf { z } \| _ { 2 } \leq 1 } { \arg \operatorname* { m a x } } \mathbf { x } ^ { \mathsf { T } } \big ( \sum _ { k = 1 } ^ { K } \mathbf { d } _ { k } * \mathbf { z } _ { k } \big ) - \beta \| \mathbf { z } \| _ { 1 } + \sum _ { k = 1 } ^ { K } \mathbf { w } _ { y k } ^ { + \intercal } \mathbf { z } _ { k } ^ { + } + \sum _ { k = 1 } ^ { K } \mathbf { w } _ { y k } ^ { - \intercal } \mathbf { z } _ { k } ^ { - } ,
|
| 110 |
+
$$
|
| 111 |
+
|
| 112 |
+
where $\mathbf { x } \in \mathbb { R } ^ { D }$ is an image and $y \in \mathcal { V }$ is a class hypothesis. $\mathbf { z } _ { k } \in \mathbb { R } ^ { F }$ is the $k$ -th component latent variable being inferred; $\mathbf { z } _ { k } ^ { + }$ and ${ \bf z } _ { k } ^ { - }$ are the positive and negative coefficients of $\mathbf { z } _ { k }$ , such that zk = z+k + z−k . The parameters dk ∈ RM , w + $\mathbf { w } _ { y k } ^ { + } \in \mathbb { R } ^ { F }$ , and $\mathbf { w } _ { y k } ^ { - } \in \mathbb { R } ^ { F }$ are the dictionary filter, positive coefficient classifier, and negative coefficient classifier for the $k$ -th component respectively. A key aspect of our formulation is that the optimal codes can be found very efficiently in closedform—in a feed-forward manner (see Appendix B for a detailed argument).
|
| 113 |
+
|
| 114 |
+
# 2.3.1 ASYMMETRIC SHRINKAGE
|
| 115 |
+
|
| 116 |
+
To describe the coding processes, let us first define a generalized version of the shrinkage function commonly used in sparse coding. Our asymmetric shrinkage is parameterized by upper and lower thresholds $- \beta ^ { - } \le \bar { \beta } ^ { + }$
|
| 117 |
+
|
| 118 |
+
$$
|
| 119 |
+
\mathrm { s h r i n k } _ { ( \beta ^ { + } , \beta ^ { - } ) } ( v ) = \left\{ \begin{array} { l l } { { v - \beta ^ { + } \qquad } } & { { \mathrm { i f ~ } v - \beta ^ { + } > 0 } } \\ { { 0 \qquad } } & { { \mathrm { o t h e r w i s e } } } \\ { { v + \beta ^ { - } \qquad } } & { { \mathrm { i f ~ } v + \beta ^ { - } < 0 } } \end{array} \right.
|
| 120 |
+
$$
|
| 121 |
+
|
| 122 |
+

|
| 123 |
+
Figure 2: Comparing the behavior of asymmetric shrinkage for different settings of $\beta ^ { + }$ and $\beta ^ { - }$ (a)-(c) satisfy the condition that $- \beta ^ { - } \le \dot { \beta } ^ { + }$ while (d) does not.
|
| 124 |
+
|
| 125 |
+
Fig. 2 shows a visualization of this function which generalizes the standard shrinkage proximal operator by allowing for the positive and negative thresholds. In particular, it corresponds to the proximal operator for a version of the $\ell _ { 1 }$ -norm that penalizes the positive and negative components with different weights $| \mathbf { v } | _ { a s y m } = \beta ^ { + } \| \mathbf { v } ^ { + } \| _ { 1 } + \beta ^ { - } \| \mathbf { v } ^ { - } \| _ { 1 }$ . The standard shrink operator corresponds to $\mathrm { s h r i n k } _ { ( \beta , - \beta ) } ( \bar { v } )$ while the rectified linear unit common in CNNs is given by a limiting case $\mathrm { s h r i n k } _ { ( 0 , - \infty ) } ( v )$ . We note that $- \beta ^ { - } \leq \beta ^ { + }$ is required for $\operatorname { s h r i n k } _ { ( \beta ^ { + } , \beta ^ { - } ) }$ to be a proper function (see Fig. 2).
|
| 126 |
+
|
| 127 |
+
# 2.3.2 FEED-FORWARD CODING
|
| 128 |
+
|
| 129 |
+
We now describe how codes can be computed in a simple feed-forward pass. Let
|
| 130 |
+
|
| 131 |
+
$$
|
| 132 |
+
\begin{array} { r } { \beta _ { y k } ^ { + } = \beta - { \bf w } _ { y k } ^ { + } , \qquad \beta _ { y k } ^ { - } = \beta - { \bf w } _ { y k } ^ { - } } \end{array}
|
| 133 |
+
$$
|
| 134 |
+
|
| 135 |
+
be vectors of positive and negative biases whose entries are associated with a spatial location in the feature map $k$ for class $y$ . The optimal code $\mathbf { z }$ can be computed in three sequential steps:
|
| 136 |
+
|
| 137 |
+
1. Cross-correlate the data with the filterbank $\mathbf { d } _ { k } \star { \mathbf { x } }$
|
| 138 |
+
|
| 139 |
+
2. Apply an asymmetric version of the standard shrinkage operator
|
| 140 |
+
|
| 141 |
+
$$
|
| 142 |
+
\tilde { \mathbf { z } } _ { k } = \mathrm { s h r i n k } _ { ( \beta _ { y k } ^ { + } , \beta _ { y k } ^ { - } ) } \big ( \mathbf { d } _ { k } \star \mathbf { x } \big )
|
| 143 |
+
$$
|
| 144 |
+
|
| 145 |
+
where, with abuse of notation, we allow the shrinkage function (Eq. 9) to apply entries in the vectors of threshold parameter pairs $\beta _ { y k } ^ { + } , \beta _ { y k } ^ { - }$ to the corresponding elements of the argument.
|
| 146 |
+
|
| 147 |
+
3. Project onto the feasible set of unit length codes
|
| 148 |
+
|
| 149 |
+
$$
|
| 150 |
+
\mathbf { z } ^ { * } = \frac { \tilde { \mathbf { z } } } { \lVert \tilde { \mathbf { z } } \rVert _ { 2 } } .
|
| 151 |
+
$$
|
| 152 |
+
|
| 153 |
+
# 2.3.3 RELATIONSHIP TO CNNS:
|
| 154 |
+
|
| 155 |
+
We note that this formulation of coding has a close connection to single layer convolutional neural network (CNN). A typical CNN layer consists of convolution with a filterbank followed by a nonlinear activation such as a rectified linear unit (ReLU). ReLUs can be viewed as another way of inducing sparsity, but rather than coring the values around zero like the shrink function, ReLU truncates negative values. On the other hand, the asymmetric shrink function can be viewed as the sum of two ReLUs applied to appropriately biased inputs:
|
| 156 |
+
|
| 157 |
+
$$
|
| 158 |
+
\operatorname { s h r i n k } _ { ( \beta ^ { + } , \beta ^ { - } ) } ( x ) = \operatorname { R e L U } ( x - \beta ^ { + } ) - \operatorname { R e L U } ( - ( x + \beta ^ { - } ) ) ,
|
| 159 |
+
$$
|
| 160 |
+
|
| 161 |
+
SSC coding can thus be seen as a CNN in which the ReLU activation has been replaced with shrinkage followed by a global normalization.
|
| 162 |
+
|
| 163 |
+
# 3 LEARNING
|
| 164 |
+
|
| 165 |
+
We formulate supervised learning using the softmax log-loss that maximizes the energy for the true class label $y _ { i }$ while minimizing energy of incorrect labels $\bar { y }$ .
|
| 166 |
+
|
| 167 |
+
$$
|
| 168 |
+
\begin{array} { r l } & { \displaystyle \underset { \mathbf { d } , \mathbf { w } ^ { + } , \mathbf { w } ^ { - } , \beta \geq 0 } { \arg \operatorname* { m i n } } \frac { \alpha } { 2 } ( \| \mathbf { w } ^ { + } \| _ { 2 } ^ { 2 } + \| \mathbf { w } ^ { - } \| _ { 2 } ^ { 2 } + \| \mathbf { d } \| _ { 2 } ^ { 2 } ) } \\ & { \displaystyle \quad \quad + \frac { 1 } { N } \sum _ { i = 1 } ^ { N } [ - \underset { \| \mathbf { z } \| _ { 2 } \leq 1 } { \operatorname* { m a x } } E ( \mathbf { x } _ { i } , y _ { i } , \mathbf { z } ) + \log \sum _ { \bar { y } \in \mathcal { V } } \underset { \| \bar { \mathbf { z } } \| _ { 2 } \leq 1 } { \operatorname* { m a x } } e ^ { E ( \mathbf { x } _ { i } , \bar { y } , \bar { \mathbf { z } } ) } ] , } \\ & { \displaystyle \mathrm { s . t . } \ - ( \beta - \mathbf { w } _ { y k } ^ { - } ) \leq ( \beta - \mathbf { w } _ { y k } ^ { + } ) \quad \forall y , k } \end{array}
|
| 169 |
+
$$
|
| 170 |
+
|
| 171 |
+
where $\alpha$ is the hyperparameter regularizing $\mathbf { w } _ { y } ^ { + } , \mathbf { w } _ { y } ^ { - }$ , and $\mathbf { d }$ . We constrain the relationship between $\beta$ and the entries of $\mathbf { w } _ { y } ^ { + }$ and $\mathbf { w } _ { y } ^ { - }$ in order for the asymmetric shrinkage to be a proper function (see Sec. 2.3.1 and Appendix B for details).
|
| 172 |
+
|
| 173 |
+
In classical sparse coding, it is typical to constrain the $\ell _ { 2 }$ -norm of each dictionary filter to unit length. Our spherical coding objective behaves similarly. For any optimal code $\mathbf { z } ^ { \ast }$ , there is a 1-dimensional subspace of parameters for which $\mathbf { z } ^ { \ast }$ is optimal given by scaling $\mathbf { d }$ inversely to w, $\beta$ . For simplicity of the implementation, we opt to regularize $\mathbf { d }$ to assure a unique solution. However, as Tygert et al. (2015) point out, it may be advantageous from the perspective of optimization to explicitly constrain the norm of the filter bank.
|
| 174 |
+
|
| 175 |
+
Note that unlike classical sparse coding, where $\beta$ is a hyperparameter that is usually set using crossvalidation, we treat it as a parameter of the model that is learned to maximize performance.
|
| 176 |
+
|
| 177 |
+
# 3.1 OPTIMIZATION
|
| 178 |
+
|
| 179 |
+
In order to solve Eq. 13, we explicitly formulate our model as a directed-acyclic-graph (DAG) neural network with shared weights, where the forward-pass computes the sparse code vectors and the backward-pass updates the parameter weights. We optimize the objective using stochastic gradient descent (SGD).
|
| 180 |
+
|
| 181 |
+
As mentioned in Sec. 2.3 shrinkage function is assymetric with parameters $\beta _ { y k } ^ { + }$ or $\beta _ { y k } ^ { - }$ as defined in Eq. 10. However, the inequality constraint on their relationship to keep the shrinkage function a proper function is difficult to enforce when optimizing with SGD. Instead, we introduce a central offset parameter and reduce the ordering constraint to pair of positivity constraints. Let
|
| 182 |
+
|
| 183 |
+
$$
|
| 184 |
+
\begin{array} { r } { \hat { \mathbf { w } } _ { y k } ^ { + } = \beta _ { y k } ^ { + } - b _ { k } \quad \quad \hat { \mathbf { w } } _ { y k } ^ { - } = \beta _ { y k } ^ { - } + b _ { k } } \end{array}
|
| 185 |
+
$$
|
| 186 |
+
|
| 187 |
+
be the modified linear “classifiers” relative to the central offset $b _ { k }$ . It is straightforward to see that if $\beta _ { y k } ^ { + }$ and $\beta _ { y k } ^ { - }$ that satisfy the constrain in Eq. 13, then adding the same value to both sides of the inequality will not change that. However, taking $b _ { k }$ to be a midpoint between them, then both $\beta _ { y k } ^ { + } - \bar { b } _ { k }$ and $\beta _ { y k } ^ { - } + b _ { k }$ will be strictly non-negative.
|
| 188 |
+
|
| 189 |
+
Using this variable substitution, we rewrite the energy function (Eq. 1) as
|
| 190 |
+
|
| 191 |
+
$$
|
| 192 |
+
E ^ { \prime } ( \mathbf { x } , y , \mathbf { z } ) = \mathbf { x } ^ { \intercal } \big ( \sum _ { k = 1 } ^ { K } \mathbf { d } _ { k } * \mathbf { z } _ { k } \big ) + \sum _ { k = 1 } ^ { K } b _ { k } \mathbf { 1 } ^ { \intercal } \mathbf { z } _ { k } - \sum _ { k = 1 } ^ { K } \hat { \mathbf { w } } _ { y k } ^ { + \intercal } \mathbf { z } _ { k } ^ { + } + \sum _ { k = 1 } ^ { K } \hat { \mathbf { w } } _ { y k } ^ { - \intercal } \mathbf { z } _ { k } ^ { - } .
|
| 193 |
+
$$
|
| 194 |
+
|
| 195 |
+
where $\mathbf { b }$ is constant offset for each code channel. The modified linear “classification” terms now take on a dual role of inducing sparsity and measuring the compatibility between $\mathbf { z }$ and $y$ .
|
| 196 |
+
|
| 197 |
+
This yields a modified learning objective that can easily be solved with existing implementations for learning convolutional neural nets:
|
| 198 |
+
|
| 199 |
+
$$
|
| 200 |
+
\begin{array} { l } { \displaystyle \underset { { \bf d } , \hat { \bf w } ^ { + } , \hat { \bf w } ^ { - } , { \bf b } } { \arg \operatorname* { m i n } } \frac { \alpha } { 2 } ( \| \hat { \bf w } ^ { + } \| _ { 2 } ^ { 2 } + \| \hat { \bf w } ^ { - } \| _ { 2 } ^ { 2 } + \| { \bf d } \| _ { 2 } ^ { 2 } ) } \\ { \displaystyle + \frac { 1 } { N } \sum _ { i = 1 } ^ { N } [ - \operatorname* { m a x } _ { \| { \bf z } \| _ { 2 } \leq 1 } E ^ { \prime } ( { \bf x } _ { i } , y _ { i } , { \bf z } ) + \log \sum _ { \bar { y } \in \mathcal { Y } } \operatorname* { m a x } _ { \| \bar { \bf z } \| _ { 2 } \leq 1 } e ^ { E ^ { \prime } ( { \bf x } _ { i } , \bar { y } , \bar { \bf z } ) } ] , } \end{array}
|
| 201 |
+
$$
|
| 202 |
+
|
| 203 |
+
where $\hat { \mathbf { w } } ^ { + }$ and $\hat { \mathbf { w } } ^ { - }$ are the new sparsity inducing classifiers, and b are the arbitrary origin points. In particular, adding the $K$ origin points allows us to enforce the constraint by simply projecting $\hat { \mathbf { w } } ^ { + }$ and $\hat { \mathbf { w } } ^ { - }$ onto the positive orthant during SGD.
|
| 204 |
+
|
| 205 |
+
# 3.1.1 STACKING BLOCKS
|
| 206 |
+
|
| 207 |
+
We also examine stacking multiple blocks of our energy function in order to build a hierarchical representation. As mentioned in Sec. 3.1.1, the optimal codes can be computed in a simple feedforward pass—this applies to shallow versions of our model. When stacking multiple blocks of our energy-based model, solving for the optimal codes cannot be done in a feed-forward pass since the codes for different blocks are coupled (bilinearly) in the joint objective. Instead, we can proceed in an iterative manner, performing block-coordinate descent by repeatedly passing up and down the hierarchy updating the codes. In this section we investigate the trade-off between the number of passes used to find the optimal codes for the stacked model and classification performance.
|
| 208 |
+
|
| 209 |
+
For this purpose, we train multiple instances of a 2-block version of our energy-based model that differ in the number of iterations used when solving for the codes. For recurrent networks such as this, inference is commonly implemented by “unrolling” the network, where the parts of the network structure are repeated with parameters shared across these repeated parts to mimic an iterative algorithm that stops at a fixed number of iterations rather than at some convergence criteria.
|
| 210 |
+
|
| 211 |
+

|
| 212 |
+
Figure 3: Comparing the effects of unrolling a 2-block version of our energy-based model. (Best viewed in color.)
|
| 213 |
+
|
| 214 |
+
In Fig. 3, we compare the performance between models that were unrolled zero to four times. We see that there is a difference in performance based on how many sweeps of the variables are made. In terms of the training objective, more unrolling produces models that have lower objective values with convergence after only a few passes. In terms of testing error, however, we see that full code inference is not necessarily better, as unrolling once or twice has lower errors than unrolling three or four times. The biggest difference was between not unrolling and unrolling once, where both the training objective and testing error goes down. The testing error decreases from 0.0131 to 0.0074. While there is a clear benefit in terms of performance for unrolling at least once, there is also a trade-off between performance and computational resource, especially for deeper models.
|
| 215 |
+
|
| 216 |
+
# 4 EXPERIMENTS
|
| 217 |
+
|
| 218 |
+
We evaluate the benefits of combining top-down and bottom-up information to produce classspecific features on the CIFAR-10 (Krizhevsky & Hinton, 2009) dataset using a deep version of our EB-SSC. All experiments were performed using MatConvNet (Vedaldi & Lenc, 2015) framework with the ADAM optimizer (Kingma & Ba, 2014). The data was preprocessed and augmented following the procedure in Goodfellow et al. (2013). Specifically, the data was made zero mean and whitened, augmented with horizontal flips (with a 0.5 probability) and random cropping. No weight decay was used, but we used a dropout rate of 0.3 before every convolution layer except for the first. For these experiments we consider a single forward pass (no unrolling).
|
| 219 |
+
|
| 220 |
+
Table 1: Underlying block architecture common across all models we evaluated. SSC networks add an extra normalization layer after the non-linearity. And EB-SSC networks insert class-specific bias layers between the convolution layer and the non-linearity. Concatenated ReLU (CReLU) splits positive and negative activations into two separate channels rather than discarding the negative component as in the standard ReLU.
|
| 221 |
+
|
| 222 |
+
<table><tr><td rowspan=1 colspan=3>Base Network</td></tr><tr><td rowspan=1 colspan=1>block</td><td rowspan=1 colspan=1>kernel, stride, padding</td><td rowspan=1 colspan=1>activation</td></tr><tr><td rowspan=1 colspan=1>conv1</td><td rowspan=1 colspan=1>3×3×3× 96,1,1</td><td rowspan=1 colspan=1>ReLU/CReLU</td></tr><tr><td rowspan=1 colspan=1>conv2</td><td rowspan=1 colspan=1>3 × 3× 96/192× 96,1,1</td><td rowspan=1 colspan=1>ReLU/CReLU</td></tr><tr><td rowspan=1 colspan=1>pool1</td><td rowspan=1 colspan=1>3 × 3,2,1</td><td rowspan=1 colspan=1>max</td></tr><tr><td rowspan=1 colspan=1>conv3</td><td rowspan=1 colspan=1>3×3× 96/192 × 192,1,1</td><td rowspan=1 colspan=1>ReLU/CReLU</td></tr><tr><td rowspan=1 colspan=1>conv4</td><td rowspan=1 colspan=1>3 × 3× 192/384 × 192,1,1</td><td rowspan=1 colspan=1>ReLU/CReLU</td></tr><tr><td rowspan=1 colspan=1>conv5</td><td rowspan=1 colspan=1>3× 3× 192/384× 192,1,1</td><td rowspan=1 colspan=1>ReLU/CReLU</td></tr><tr><td rowspan=1 colspan=1>pool2</td><td rowspan=1 colspan=1>3×3,2,1</td><td rowspan=1 colspan=1>max</td></tr><tr><td rowspan=1 colspan=1>conv6</td><td rowspan=1 colspan=1>3×3× 192/384× 192,1,1</td><td rowspan=1 colspan=1>ReLU/CReLU</td></tr><tr><td rowspan=1 colspan=1>conv7</td><td rowspan=1 colspan=1>1×1× 192/384 × 192,1,1</td><td rowspan=1 colspan=1>ReLU/CReLU</td></tr></table>
|
| 223 |
+
|
| 224 |
+
# 4.1 CLASSIFICATION
|
| 225 |
+
|
| 226 |
+
We compare our proposed EB-SSC model to that of Springenberg et al. (2015), which uses rectified linear units (ReLU) as its non-linearity. This model can be viewed as a basic feed-forward version of our proposed model which we take as a baseline. We also consider variants of the baseline model that utilize a subset of architectural features of our proposed model (e.g., concatenated rectified linear units (CReLU) and spherical normalization (SN)) to understand how subtle design changes of the network architecture affects performance.
|
| 227 |
+
|
| 228 |
+
We describe the model architecture in terms of the feature extractor and classifier. Table 1 shows the overall network architecture of feature extractors, which consist of seven convolution blocks and two pooling layers. We test two possible classifiers: a simple linear classifier (LC) and our energy-based classifier (EBC), and use softmax-loss for all models. For linear classifiers, a numerical subscript indicates which of the seven conv blocks of the feature extractor is used for classification (e.g., $\mathrm { L C } _ { 7 }$ indicates the activations out of the last conv block is fed into the linear classifier). For energy-based classifiers, a numerical subscript indicates which conv blocks of the feature extractor are replace with a energy-based classifier (e.g., $\mathrm { E B C } _ { 6 - 7 }$ indicates the activations out of conv5 is fed into the energy-based classifier and the energy-based classifier has a similar architecture to the conv blocks it replaces). The notation differ because for energy-based classifiers, the optimal activations are a function of the hypothesized class label, whereas for linear classifiers, they are not.
|
| 229 |
+
|
| 230 |
+
Table 2: Comparison of the baseline ReLU $+ \mathrm { L C } _ { 7 }$ model, its derivative models, and our proposed model on CIFAR-10.
|
| 231 |
+
|
| 232 |
+
<table><tr><td rowspan=1 colspan=1>Model</td><td rowspan=1 colspan=1>Train Err. (%)</td><td rowspan=1 colspan=1>Test Err. (%)</td><td rowspan=1 colspan=1># params</td></tr><tr><td rowspan=1 colspan=1>ReLU+LC7</td><td rowspan=1 colspan=1>1.20</td><td rowspan=1 colspan=1>11.40</td><td rowspan=1 colspan=1>1.3M</td></tr><tr><td rowspan=1 colspan=1>CReLU+LC7</td><td rowspan=1 colspan=1>2.09</td><td rowspan=1 colspan=1>10.17</td><td rowspan=1 colspan=1>2.6M</td></tr><tr><td rowspan=1 colspan=1>CReLU(SN)+LC7</td><td rowspan=1 colspan=1>0.99</td><td rowspan=1 colspan=1>9.74</td><td rowspan=1 colspan=1>2.6M</td></tr><tr><td rowspan=1 colspan=1>SSC+LC7</td><td rowspan=1 colspan=1>0.99</td><td rowspan=1 colspan=1>9.77</td><td rowspan=1 colspan=1>2.6M</td></tr><tr><td rowspan=1 colspan=1>SSC+EBC6-7</td><td rowspan=1 colspan=1>0.21</td><td rowspan=1 colspan=1>9.23</td><td rowspan=1 colspan=1>3.2M</td></tr></table>
|
| 233 |
+
|
| 234 |
+
The results shown in Table 2 compare our proposed model to the baselines $\mathrm { R e L U + L C _ { 7 } }$ (Springenberg et al., 2015) and CReL $\mathrm { J } { + } \mathrm { L C } _ { 7 }$ (Shang et al., 2016), and to intermediate variants. The baseline models all perform very similarly with some small reductions in error rates over the baseline $\mathrm { C R e L U + L C _ { 7 } }$ . However, $\mathrm { C R e L U } { + } \mathrm { L C } _ { 7 }$ reduces the error rate over ${ \mathrm { R e L U } } + { \mathrm { L C } } _ { 7 }$ by more than one percent (from $1 1 . 4 0 \%$ to $1 0 . 1 7 \%$ ), which confirms the claims by Shang et al. (2016) and demonstrates the benefits of splitting positive and negative activations. Likewise, we see further decrease in the error rate (to $9 . 7 4 \%$ ) from using spherical normalization. Though normalizing the activations doesn’t add any capacity to the model, this improved performance is likely because scale-invariant activations makes training easier. On the other hand, further sparsifying the activations yielded no benefit. We tested values $\beta = \{ 0 . 0 0 1 , 0 . 0 1 \}$ and found 0.001 to perform better. Replacing the linear classifier with our energy-based classifier further decreases the error rate by another half percent (to $9 . 2 3 \%$ ).
|
| 235 |
+
|
| 236 |
+
# 4.2 DECODING CLASS-SPECIFIC CODES
|
| 237 |
+
|
| 238 |
+
A unique aspect of our model is that it is generative in the sense that each layer is explicitly trying to encode the activation pattern in the prior layer. Similar to the work on deconvolutional networks built on least-squares sparse coding (Zeiler et al., 2010), we can synthesize input images from activations in our spherical coding network by performing repeated deconvolutions (transposed convolutions) back through the network. Since our model is energy based, we can further examine how the topdown information of a hypothesized class effects the intermediate activations.
|
| 239 |
+
|
| 240 |
+

|
| 241 |
+
Figure 4: The reconstruction of an airplane image from different levels of the network (rows) across different hypothesized class labels (columns). The first column is pure reconstruction, i.e., unbiased by a hypothesized class label, the remaining columns show reconstructions of the learned class bias at each layer for one of ten possible CIFAR-10 class labels. (Best viewed in color.)
|
| 242 |
+
|
| 243 |
+
The first column in Fig. 4 visualizes reconstructions of a given input image based on activations from different layers of the model by convolution transpose. In this case we put in zeros for class biases (i.e., no top-down) and are able to recover high fidelity reconstructions of the input. In the remaining columns, we use the same deconvolution pass to construct input space representations of the learned classifier biases. At low levels of the feature hierarchy, these biases are spatially smooth since the receptive fields are small and there is little spatial invariance capture in the activations. At higher levels these class-conditional bias fields become more tightly localized.
|
| 244 |
+
|
| 245 |
+
Finally, in Fig. 5 we shows decodings from the conv2 and conv5 layer of the EB-SSC model for a given input under different class hypotheses. Here we subtract out the contribution of the top-down bias term in order to isolate the effect of the class conditioning on the encoding of input features. As visible in the figure, the modulation of the activations focused around particular regions of the image and the differences across class hypotheses becomes more pronounced at higher layers of the network.
|
| 246 |
+
|
| 247 |
+
# 5 CONCLUSION
|
| 248 |
+
|
| 249 |
+
We presented an energy-based sparse coding method that efficiently combines cosine similarity, convolutional sparse coding, and linear classification. Our model shows a clear mathematical connection between the activation functions used in CNNs to introduce sparsity and our cosine similarity convolutional sparse coding formulation. Our proposed model outperforms the baseline model and we show which attributes of our model contributes most to the increase in performance. We also demonstrate that our proposed model provides an interesting framework to probe the effects of class-specific coding.
|
| 250 |
+
|
| 251 |
+
# REFERENCES
|
| 252 |
+
|
| 253 |
+
Hilton Bristow, Anders Eriksson, and Simon Lucey. Fast convolutional sparse coding. In Computer Vision and Pattern Recognition (CVPR), 2013.
|
| 254 |
+
|
| 255 |
+

|
| 256 |
+
Figure 5: Visualizing the reconstruction of different input images (rows) for each of 10 different class hypotheses (cols) from the 2nd and 5th block activations for a model trained on MNIST digit classification.
|
| 257 |
+
|
| 258 |
+
Chunshui Cao, Xianming Liu, Yi Yang, Yinan Yu, Jiang Wang, Zilei Wang, Yongzhen Huang, Liang Wang, Chang Huang, Wei Xu, et al. Look and think twice: Capturing top-down visual attention with feedback convolutional neural networks. In International Conference on Computer Vision (ICCV), 2015.
|
| 259 |
+
|
| 260 |
+
David L Donoho. Compressed sensing. IEEE Transactions on information theory, 2006.
|
| 261 |
+
|
| 262 |
+
Michael Elad and Michal Aharon. Image denoising via sparse and redundant representations over learned dictionaries. IEEE Transactions on Image processing, 2006.
|
| 263 |
+
|
| 264 |
+
Ian J Goodfellow, David Warde-Farley, Mehdi Mirza, Aaron C Courville, and Yoshua Bengio. Maxout networks. In International conference on Machine learning (ICML), 2013.
|
| 265 |
+
|
| 266 |
+
Karol Gregor and Yann LeCun. Learning fast approximations of sparse coding. In International Conference on Machine Learning (ICML), 2010.
|
| 267 |
+
|
| 268 |
+
Felix Heide, Wolfgang Heidrich, and Gordon Wetzstein. Fast and flexible convolutional sparse coding. In Computer Vision and Pattern Recognition (CVPR), 2015.
|
| 269 |
+
|
| 270 |
+
Zhengping Ji, Wentao Huang, G. Kenyon, and L.M.A. Bettencourt. Hierarchical discriminative sparse coding via bidirectional connections. In International Joint Converence on Neural Networks (IJCNN), 2011.
|
| 271 |
+
|
| 272 |
+
Zhuolin Jiang, Zhe Lin, and Larry S Davis. Learning a discriminative dictionary for sparse coding via label consistent K-SVD. In Computer Vision and Pattern Recognition (CVPR), 2011.
|
| 273 |
+
|
| 274 |
+
Koray Kavukcuoglu, Pierre Sermanet, Y-Lan Boureau, Karol Gregor, Michael Mathieu, and Yann L ¨ Cun. Learning convolutional feature hierarchies for visual recognition. In Advances in neural information processing systems (NIPS), 2010.
|
| 275 |
+
|
| 276 |
+
Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 277 |
+
|
| 278 |
+
Alex Krizhevsky and Geoffrey Hinton. Learning multiple layers of features from tiny images. 2009.
|
| 279 |
+
|
| 280 |
+
Hugo Larochelle and Yoshua Bengio. Classification using discriminative restricted boltzmann machines. In International conference on Machine learning (ICML), 2008.
|
| 281 |
+
|
| 282 |
+
Yann LeCun, Sumit Chopra, Raia Hadsell, M Ranzato, and F Huang. A tutorial on energy-based learning. Predicting structured data, 2006.
|
| 283 |
+
|
| 284 |
+
Xin Li and Yuhong Guo. Bi-directional representation learning for multi-label classification. In Joint European Conference on Machine Learning and Knowledge Discovery in Databases (ECML KDD). 2014.
|
| 285 |
+
|
| 286 |
+
Bruno A Olshausen and David J Field. Sparse coding with an overcomplete basis set: A strategy employed by v1? Vision research, 1997.
|
| 287 |
+
|
| 288 |
+
Xiaofeng Ren and Deva Ramanan. Histograms of sparse codes for object detection. In Computer Vision and Pattern Recognition (CVPR), 2013.
|
| 289 |
+
|
| 290 |
+
Christopher J Rozell, Don H Johnson, Richard G Baraniuk, and Bruno A Olshausen. Sparse coding via thresholding and local competition in neural circuits. Neural computation, 2008.
|
| 291 |
+
|
| 292 |
+
Wenling Shang, Kihyuk Sohn, Diogo Almeida, and Honglak Lee. Understanding and improving convolutional neural networks via concatenated rectified linear units. In International conference on Machine learning (ICML), 2016.
|
| 293 |
+
|
| 294 |
+
J Springenberg, Alexey Dosovitskiy, Thomas Brox, and M Riedmiller. Striving for simplicity: The all convolutional net. In International conference on Learning Representations (ICLR) (workshop track), 2015.
|
| 295 |
+
|
| 296 |
+
Mark Tygert, Arthur Szlam, Soumith Chintala, Marc’Aurelio Ranzato, Yuandong Tian, and Wojciech Zaremba. Convolutional networks and learning invariant to homogeneous multiplicative scalings. arXiv preprint arXiv:1506.08230, 2015.
|
| 297 |
+
|
| 298 |
+
A. Vedaldi and K. Lenc. Matconvnet – convolutional neural networks for matlab. In ACM International Conference on Multimedia, 2015.
|
| 299 |
+
|
| 300 |
+
John Wright, Allen Y Yang, Arvind Ganesh, S Shankar Sastry, and Yi Ma. Robust face recognition via sparse representation. IEEE transactions on pattern analysis and machine intelligence (TPAMI), 2009.
|
| 301 |
+
|
| 302 |
+
Allen Y Yang, Zihan Zhou, Arvind Ganesh Balasubramanian, S Shankar Sastry, and Yi Ma. Fastminimization algorithms for robust face recognition. IEEE Transactions on Image Processing, 2013.
|
| 303 |
+
|
| 304 |
+
Jianchao Yang, Kai Yu, and Thomas Huang. Supervised translation-invariant sparse coding. In Computer Vision and Pattern Recognition (CVPR), 2010.
|
| 305 |
+
|
| 306 |
+
Matthew D. Zeiler, Dilip Krishnan, Graham W. Taylor, and Robert Fergus. Deconvolutional networks. In Computer Vision and Pattern Recognition (CVPR), 2010.
|
| 307 |
+
|
| 308 |
+
Yangmuzi Zhang, Zhuolin Jiang, and Larry S Davis. Discriminative tensor sparse coding for image classification. In British Machine Vision Conference (BMVC), 2013.
|
| 309 |
+
|
| 310 |
+
Ning Zhou, Yi Shen, Jinye Peng, and Jianping Fan. Learning inter-related visual dictionary for object recognition. In Computer Vision and Pattern Recognition (CVPR), 2012.
|
| 311 |
+
|
| 312 |
+
# APPENDIX A
|
| 313 |
+
|
| 314 |
+
Here we show that spherical sparse coding (SSC) with a norm constraint on the reconstruction is equivalent to standard convolutional sparse coding (CSC). Expanding the least squares reconstruction error and dropping the constant term $\| { \boldsymbol { x } } \| ^ { 2 }$ gives the CSC problem:
|
| 315 |
+
|
| 316 |
+
$$
|
| 317 |
+
\operatorname* { m a x } _ { \mathbf { z } } 2 \mathbf { x } ^ { \intercal } \big ( \sum _ { k = 1 } ^ { K } \mathbf { d } _ { k } * \mathbf { z } _ { k } \big ) - \| \sum _ { k = 1 } ^ { K } \mathbf { d } _ { k } * \mathbf { z } _ { k } \| _ { 2 } ^ { 2 } - \beta \sum _ { k = 1 } ^ { K } \| \mathbf { z } _ { k } \| _ { 1 } .
|
| 318 |
+
$$
|
| 319 |
+
|
| 320 |
+
Let $\begin{array} { r } { { \boldsymbol { \epsilon } } = \| \sum _ { k = 1 } ^ { K } \mathbf { d } _ { k } * \mathbf { z } _ { k } \| _ { 2 } } \end{array}$ be the norm of the reconstruction for some code $\mathbf { z }$ and let $\mathbf { u }$ be the reconstruction scaled $\epsilon$ to have unit norm so that:
|
| 321 |
+
|
| 322 |
+
$$
|
| 323 |
+
\mathbf { u } = \frac { \sum _ { k = 1 } ^ { K } \mathbf { d } _ { k } * \mathbf { z } _ { k } } { \| \sum _ { k = 1 } ^ { K } \mathbf { d } _ { k } * \mathbf { z } _ { k } \| _ { 2 } } = \sum _ { k = 1 } ^ { K } \mathbf { d } _ { k } * \bar { \mathbf { z } } _ { k } \quad \mathrm { w i t h } \quad \bar { \mathbf { z } } = \frac { 1 } { \epsilon } \mathbf { z }
|
| 324 |
+
$$
|
| 325 |
+
|
| 326 |
+
We rewrite the least-squares objective in terms of these new variables:
|
| 327 |
+
|
| 328 |
+
$$
|
| 329 |
+
\begin{array} { r l } & { \underset { \bar { \mathbf { z } } , \epsilon > 0 } { \operatorname* { m a x } } g ( \bar { \mathbf { z } } , \epsilon ) = \underset { \bar { \mathbf { z } } , \epsilon > 0 } { \operatorname* { m a x } } 2 \mathbf { x } ^ { \intercal } ( \epsilon \mathbf { u } ) - \| \epsilon \mathbf { u } \| _ { 2 } ^ { 2 } - \beta \| \epsilon \bar { \mathbf { z } } \| _ { 1 } } \\ & { \qquad = \underset { \bar { \mathbf { z } } , \epsilon > 0 } { \operatorname* { m a x } } 2 \epsilon \big ( \mathbf { x } ^ { \intercal } \mathbf { u } - \frac { \beta } { 2 } \| \bar { \mathbf { z } } \| _ { 1 } \big ) - \epsilon ^ { 2 } } \end{array}
|
| 330 |
+
$$
|
| 331 |
+
|
| 332 |
+
Taking the derivative of $g$ w.r.t. $\epsilon$ yields the optimal scaling $\epsilon ^ { * }$ as a function of $\bar { \bf z }$ :
|
| 333 |
+
|
| 334 |
+
$$
|
| 335 |
+
\epsilon ( \bar { \mathbf { z } } ) ^ { * } = \mathbf { x } ^ { \mathsf { T } } \mathbf { u } - \frac { \beta } { 2 } \| \bar { \mathbf { z } } \| _ { 1 } .
|
| 336 |
+
$$
|
| 337 |
+
|
| 338 |
+
Plugging $\epsilon ( \bar { \bf z } ) ^ { * }$ back into $g$ yields:
|
| 339 |
+
|
| 340 |
+
$$
|
| 341 |
+
\operatorname* { m a x } _ { \bar { \mathbf { z } } , \epsilon > 0 } g ( \bar { \mathbf { z } } , \epsilon ) = \operatorname* { m a x } _ { \bar { \mathbf { z } } , \| u \| _ { 2 } = 1 } \big ( \mathbf { x } ^ { \mathsf { T } } \mathbf { u } - \frac { \beta } { 2 } \| \bar { \mathbf { z } } \| _ { 1 } \big ) ^ { 2 } .
|
| 342 |
+
$$
|
| 343 |
+
|
| 344 |
+
Discarding solutions with $\epsilon < 0$ can be achieved by simply dropping the square which results in the final constrained problem:
|
| 345 |
+
|
| 346 |
+
$$
|
| 347 |
+
\begin{array} { r l } & { \displaystyle \operatorname * { a r g m a x } _ { \bar { \mathbf { z } } } \mathbf { x } ^ { \intercal } \big ( \displaystyle \sum _ { k = 1 } ^ { K } \mathbf { d } _ { k } * \bar { \mathbf { z } } _ { k } \big ) - \frac { \beta } { 2 } \displaystyle \sum _ { k = 1 } ^ { K } \| \bar { \mathbf { z } } _ { k } \| _ { 1 } } \\ & { \quad \quad \mathrm { s . t . } \quad \| \displaystyle \sum _ { k = 1 } ^ { K } \mathbf { d } _ { k } * \bar { \mathbf { z } } _ { k } \| _ { 2 } \leq 1 . } \end{array}
|
| 348 |
+
$$
|
| 349 |
+
|
| 350 |
+
# APPENDIX B
|
| 351 |
+
|
| 352 |
+
We show in this section that coding in the EB-SSC model can be solved efficiently by a combination of convolution, shrinkage and projection, steps which can be implemented with standard libraries on a GPU. For convenience, we first rewrite the objective in terms of cross-correlation rather than convolution (i.e., , $\mathbf { x } ^ { \mathsf { T } } ( \mathbf { d } _ { k } * \mathbf { z } _ { k } ) = ( \mathbf { d } _ { k } \star \mathbf { x } ) ^ { \mathsf { T } } \mathbf { z } _ { k } )$ . For ease of understanding, we first consider the coding problem when there is no classification term.
|
| 353 |
+
|
| 354 |
+
$$
|
| 355 |
+
\mathbf { z } ^ { * } = \arg \operatorname* { m a x } _ { \| \mathbf { z } \| _ { 2 } ^ { 2 } \leq 1 } \mathbf { v } ^ { \mathsf { T } } \mathbf { z } - \beta \| \mathbf { z } \| _ { 1 } ,
|
| 356 |
+
$$
|
| 357 |
+
|
| 358 |
+
where $\mathbf { v } = [ ( \mathbf { d } _ { 1 } \star \mathbf { x } ) ^ { \mathsf { T } } , \hdots , ( \mathbf { d } _ { K } \star \mathbf { x } ) ^ { \mathsf { T } } ] ^ { \mathsf { T } }$ . Pulling the constraint into the objective, we get its Lagrangian function:
|
| 359 |
+
|
| 360 |
+
$$
|
| 361 |
+
\begin{array} { r } { \mathcal { L } ( \mathbf { z } , \lambda ) = \mathbf { v } ^ { \mathsf { T } } \mathbf { z } - \beta \| \mathbf { z } \| _ { 1 } + \lambda \big ( 1 - \| \mathbf { z } \| _ { 2 } ^ { 2 } \big ) . } \end{array}
|
| 362 |
+
$$
|
| 363 |
+
|
| 364 |
+
From the partial subderivative of the Lagrangian w.r.t. $z _ { i }$ we derive the optimal solution as a function of $\lambda$ ; and from that find the conditions in which the solutions hold, giving us:
|
| 365 |
+
|
| 366 |
+
$$
|
| 367 |
+
z _ { i } ( \lambda ) ^ { * } = \frac { 1 } { 2 \lambda } \cdot \left\{ \begin{array} { c l } { v _ { i } - \beta \qquad } & { v _ { i } > \beta } \\ { 0 \qquad } & { \mathrm { o t h e r w i s e } } \\ { v _ { i } + \beta \qquad } & { v _ { i } < \beta } \end{array} \right. .
|
| 368 |
+
$$
|
| 369 |
+
|
| 370 |
+
This can also be compactly written as:
|
| 371 |
+
|
| 372 |
+
$$
|
| 373 |
+
\begin{array} { r } { \mathbf { z } ( \lambda ) ^ { * } = \displaystyle \frac { 1 } { 2 \lambda } \tilde { \mathbf { z } } , } \\ { \tilde { \mathbf { z } } = \mathbf { s } ^ { 2 } \odot \mathbf { v } - \beta \mathbf { s } } \end{array}
|
| 374 |
+
$$
|
| 375 |
+
|
| 376 |
+
where $\mathbf { s } = \mathrm { s i g n } ( \mathbf { z } ^ { * } ) \in \{ - 1 , 0 , 1 \} ^ { | \mathbf { z } | }$ and $\mathbf { s } ^ { 2 } = \mathbf { s } \odot \mathbf { s } \in \{ 0 , 1 \} ^ { | \mathbf { z } | }$ . The sign vector of $\mathbf { z } ^ { \ast }$ can be determined without knowing $\lambda$ , as $\lambda$ is a Lagrangian multiplier for an inequality it must be nonnegative and therefore does not change the sign of the optimal solution. Lastly, we define the squared $\ell _ { 2 }$ -norm of $\tilde { \mathbf { z } }$ , a result that will be used later:
|
| 377 |
+
|
| 378 |
+
$$
|
| 379 |
+
\begin{array} { r l } & { \| \tilde { \mathbf { z } } \| _ { 2 } ^ { 2 } = \tilde { \mathbf { z } } ^ { \mathsf { T } } ( \mathbf { s } ^ { 2 } \odot \mathbf { v } ) - \beta \tilde { \mathbf { z } } ^ { \mathsf { T } } \mathbf { s } } \\ & { \qquad = \tilde { \mathbf { z } } ^ { \mathsf { T } } \mathbf { v } - \beta \| \tilde { \mathbf { z } } \| _ { 1 } . } \end{array}
|
| 380 |
+
$$
|
| 381 |
+
|
| 382 |
+
Substituting ${ \mathbf z } ( \lambda ) ^ { * }$ back into the Lagrangian we get:
|
| 383 |
+
|
| 384 |
+
$$
|
| 385 |
+
\mathcal { L } ( \mathbf { z } ( \lambda ) ^ { * } , \lambda ) = \frac { 1 } { 2 \lambda } \mathbf { v } ^ { \top } \tilde { \mathbf { z } } - \frac { \beta } { 2 \lambda } \| \tilde { \mathbf { z } } \| _ { 1 } + \lambda \big ( 1 - \frac { 1 } { 4 \lambda ^ { 2 } } \| \tilde { \mathbf { z } } \| _ { 2 } ^ { 2 } \big ) ,
|
| 386 |
+
$$
|
| 387 |
+
|
| 388 |
+
and the derivative w.r.t. $\lambda$ is:
|
| 389 |
+
|
| 390 |
+
$$
|
| 391 |
+
\frac { \partial \mathcal { L } ( \mathbf { z } ( \lambda ) ^ { * } } { \partial \lambda } = - \frac { 1 } { 2 \lambda ^ { 2 } } \mathbf { v } ^ { \top } \tilde { \mathbf { z } } + \frac { \beta } { 2 \lambda ^ { 2 } } \| \tilde { \mathbf { z } } \| _ { 1 } + 1 + \frac { 1 } { 4 \lambda ^ { 2 } } \| \tilde { \mathbf { z } } \| _ { 2 } ^ { 2 } .
|
| 392 |
+
$$
|
| 393 |
+
|
| 394 |
+
Setting the derivative equal to zero and using the result from Eq. 19, we can find the optimal solution to $\lambda$ :
|
| 395 |
+
|
| 396 |
+
$$
|
| 397 |
+
\begin{array} { c } { { \displaystyle \lambda ^ { 2 } = \frac { 1 } { 2 } \tilde { \mathbf { z } } ^ { \intercal } \mathbf { v } - \frac { \beta } { 2 } \| \tilde { \mathbf { z } } \| _ { 1 } - \frac { 1 } { 4 } \| \tilde { \mathbf { z } } \| _ { 2 } ^ { 2 } = \frac { 1 } { 2 } \| \tilde { \mathbf { z } } \| _ { 2 } ^ { 2 } - \frac { 1 } { 4 } \| \tilde { \mathbf { z } } \| _ { 2 } ^ { 2 } } } \\ { { \displaystyle \implies \lambda ^ { * } = \frac { 1 } { 2 } \| \tilde { \mathbf { z } } \| _ { 2 } . } } \end{array}
|
| 398 |
+
$$
|
| 399 |
+
|
| 400 |
+
Finally, plugging $\lambda ^ { * }$ into Eq. 18 we find the optimal solution
|
| 401 |
+
|
| 402 |
+
$$
|
| 403 |
+
\mathbf { z } ^ { * } = \frac { \tilde { \mathbf { z } } } { \lVert \tilde { \mathbf { z } } \rVert _ { 2 } } .
|
| 404 |
+
$$
|
md/train/HklJdaNYPH/HklJdaNYPH.md
ADDED
|
@@ -0,0 +1,289 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# AUGMENTING SELF-ATTENTION WITH PERSISTENT MEMORY
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Transformer networks have lead to important progress in language modeling and machine translation. These models include two consecutive modules, a feedforward layer and a self-attention layer. The latter allows the network to capture long term dependencies and are often regarded as the key ingredient in the success of Transformers. Building upon this intuition, we propose a new model that solely consists of attention layers. More precisely, we augment the self-attention layers with persistent memory vectors that play a similar role as the feed-forward layer. Thanks to these vectors, we can remove the feed-forward layer without degrading the performance of a transformer. Our evaluation shows the benefits brought by our model on standard character and word level language modeling benchmarks.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Transformer networks (Vaswani et al., 2017) are sequence models that rely on the attention mechanism (Bahdanau et al., 2015) to capture long term dependencies. Since their introduction in the context of machine translation, they have been applied to many natural language processing tasks, such as language modeling (Al-Rfou et al., 2019) or sentence representation (Devlin et al., 2019). On most of them, they are now surpassing the former state-of-the-art models based on recurrent (Hochreiter & Schmidhuber, 1997) or convolutional networks (Dauphin et al., 2017). At their core, transformers use a self-attention layer that forms a representation of the current input by gathering the most relevant information from its context. This layer is repeated along the network depth, allowing for information to flow for long distances and to form rich sequence representations. The self-attention mechanism is often considered as the key component of their success and many have worked on improving transformers by increasing the size of the context captured by those layers (Wu et al., 2019; Dai et al., 2019; Sukhbaatar et al., 2019).
|
| 12 |
+
|
| 13 |
+
However, self-attention layers are not the only component of transformer networks and they do not explain the effectiveness of transformers by themselves. Each of these layers is followed by a feedforward layer. These feedforward layers contain most of the parameters of the model. This suggests that their role is probably as important as the self-attention mechanism. In fact, the transformer layer, i.e., the sequence of self-attention and feedforward sublayers, should be regarded as a single mechanism that gathers information from the context and transforms it into a rich representation. Having such two different layer types of at the core makes Transformer models harder to analyse and understand. In particular, there are not many works exploring the properties of feedforward layers.
|
| 14 |
+
|
| 15 |
+
In this work, we simplify the transformer architecture by revisiting its mechanism, while keeping its properties. We introduce a new layer that merges the self-attention and feedforward sublayers into a single unified attention layer, as illustrated in Figure 1. As opposed to the two-step mechanism of the transformer layer, it directly builds its representation from the context and a persistent memory block without going through a feedforward transformation. The additional persistent memory block stores, in the form of key-value vectors, information that does not depend on the context. In terms of parameters, these persistent key-value vectors replace the feedforward sublayer. This modification dramatically simplifies the structure of the network with no loss of performance.
|
| 16 |
+
|
| 17 |
+
We evaluate the resulting architecture on standard word level and character level language modeling benchmarks and report performances that are competitive with transformers.
|
| 18 |
+
|
| 19 |
+

|
| 20 |
+
Figure 1: On the left panel, the standard transformer layer is composed of a self-attention sublayer followed by a feedforward sublayer. On the right panel, our all-attention layer merges the weights of the feedforward sublayer with the self-attention sublayer. We represent both models in the case of a single head, but in the general case, both the self-attention sublayer and our all-attention layers have multiple heads.
|
| 21 |
+
|
| 22 |
+
# 2 RELATED WORK
|
| 23 |
+
|
| 24 |
+
Neural language modeling. Different network architectures have been proposed for language modeling, such as feed-forward networks (Bengio et al., 2003a), recurrent networks (Mikolov et al., 2010), gated convolutional networks (Dauphin et al., 2017) and transformer networks (Vaswani et al., 2017). Of particular interest, Al-Rfou et al. (2019) apply deep transformers to character level language modeling. Dai et al. (2019) introduces a caching mechanism, relying on the relative position embeddings from Shaw et al. (2018), which makes inference in these models much more efficient for unbounded sequences. More recently, Sukhbaatar et al. (2019) add a learnable self-attention span to extend the size of the context.
|
| 25 |
+
|
| 26 |
+
Word level language models deal with large vocabularies and computing the most probable word is computationally demanding. Solutions are to either replace the softmax loss with an approximation (Goodman, 2001; Morin & Bengio, 2005), to sample from the vocabulary during training (Bengio et al., 2003b; Jozefowicz et al., 2016) or to include subword units (Sennrich et al., 2016). A simple yet effective solution is to replace the loss by a hierarchical softmax designed to better take advantage of the GPU specificities (Grave et al., 2017a).
|
| 27 |
+
|
| 28 |
+
Finally, many works focus on the regularization of large language models. In particular, Zaremba et al. (2014) show that dropout (Srivastava et al., 2014) is effective for recurrent networks. More recently, Press & Wolf (2017) show that tying the embedding and classifier weights significantly improves generalization. Baevski & Auli (2019) further show that combining this regularization technique with the adaptive softmax of (Grave et al., 2017a) reduces the memory footprint of a transformer while improving its performance.
|
| 29 |
+
|
| 30 |
+
Attention based models. The attention mechanism was first introduced in the context of mixture of experts by Jordan & Jacobs (1994). It is only recently that Bahdanau et al. (2015) have shown their potential when used in neural networks in the context of machine translation. Since then, this mechanism is commonly incorporated within many models, with applications in natural language processing and computer vision, besides transformers. Sukhbaatar et al. (2015) apply the attention mechanism on the same sequence, i.e., the so-called self-attention, in an auto-regressive model called end-to-end memory network. They show their potential in the context of language modeling. Graves et al. (2014) use the attention mechanism for reading from and writing to internal memory for solving algorithmic tasks. Vinyals et al. (2015) combine this self-attention mechanism with a recurrent network to solve simple algorithmic problems. Later, Merity et al. (2017) show that these networks can be used as language models if combined with a cache mechanism (Grave et al., 2017b). The attention mechanism has been also applied to question answering (Miller et al., 2016) and image captioning ( $\mathrm { X u }$ et al., 2015). Finally, Shazeer et al. (2017) uses the attention mechanism as a mixture of experts in a recurrent network.
|
| 31 |
+
|
| 32 |
+
# 3 TRANSFORMER LAYER
|
| 33 |
+
|
| 34 |
+
A transformer model is made of a stack of identical layers, called transformer layers. Each layer is composed of a multi-head self-attention sublayer followed by a feedforward sublayer. Each sublayer is also followed by an add-norm operation, i.e., a skip-connection (He et al., 2016), and layer normalization (Lei Ba et al., 2016). In this section, we review the structure of the transformer layer and refer the reader to Vaswani et al. (2017) for additional details of the overall model.
|
| 35 |
+
|
| 36 |
+
Multi-head self-attention sublayer. A core mechanism of a transformer network is the multi-head self-attention layer, which consists of multiple attention heads applied in parallel. Each attention head applies the attention mechanism of Bahdanau et al. (2015) on an input sequence of vectors. More formally, given a sequence $\mathbf { x } _ { 1 } , . . . , \mathbf { x } _ { T }$ of $d$ -dimensional input vectors, each head applies two linear transformations to these vectors to form the key and value vectors:
|
| 37 |
+
|
| 38 |
+
$$
|
| 39 |
+
\begin{array} { r c l } { \mathbf { k } _ { t } } & { = } & { \mathbf { W } _ { k } \mathbf { x } _ { t } , } \\ { \mathbf { v } _ { t } } & { = } & { \mathbf { W } _ { v } \mathbf { x } _ { t } , } \end{array}
|
| 40 |
+
$$
|
| 41 |
+
|
| 42 |
+
where $\mathbf { W } _ { k }$ and $\mathbf { W } _ { v }$ are the “key” and “value” matrices of a size $d _ { h } \times d$ , where $d _ { h } = d / H$ is the dimension of a head and $H$ is the number of heads. The key vectors are then used to compute a similarity score between an element $t$ of the input sequence and all the elements of its context $C _ { t }$ The context can be, for instance, the elements of the sequence that precede $t$ in the case of language modeling, or the whole sequence in the encoder for machine translation. The similarity score between $t$ and an element $c$ of its context $C _ { t }$ is defined as
|
| 43 |
+
|
| 44 |
+
$$
|
| 45 |
+
s _ { t c } = \mathbf { x } _ { t } ^ { \top } \mathbf { W } _ { q } ^ { \top } \big ( \mathbf { k } _ { c } + \mathbf { p } ( t , c ) \big ) ,
|
| 46 |
+
$$
|
| 47 |
+
|
| 48 |
+
where $\mathbf { W } _ { q } \in \mathbb { R } ^ { d _ { h } \times d }$ is the “query” matrix, and $\mathbf { p } ( t , c )$ is a position encoding function. There are several ways to encode positions: fixed absolute (Vaswani et al., 2017), learned absolute (Al-Rfou et al., 2019), and learned relative (Sukhbaatar et al., 2015; Shaw et al., 2018). The relative position encoding function improves the efficiency for unbounded sequences, making them useful for language modeling (Dai et al., 2019). In this paper, we thus use the relative position encoding defined as $\mathbf { p } ( t , c ) = \mathbf { u } _ { t - c }$ , where $\mathbf { u } _ { i }$ are position embeddings learned during training. The head then outputs a vector $\mathbf { y } _ { t }$ by taking the average of the context representations weighted by attention weights $a _ { t c }$ obtained by applying a softmax function to the similarity scores:
|
| 49 |
+
|
| 50 |
+
$$
|
| 51 |
+
\mathbf { y } _ { t } = \sum _ { c \in C _ { t } } a _ { t c } \big ( \mathbf { v } _ { c } + \mathbf { p } ( t , c ) \big ) \quad \mathrm { a n d } \quad a _ { t c } = \frac { \exp \big ( { s _ { t c } } / { \sqrt { d _ { h } } } \big ) } { \displaystyle \sum _ { i \in C _ { t } } \exp \big ( { s _ { t i } } / { \sqrt { d _ { h } } } \big ) } .
|
| 52 |
+
$$
|
| 53 |
+
|
| 54 |
+
Note that one can use different position encoding functions for the key and value sides. Finally, the outputs from the different heads are concatenated for each timestep $t$ and multiplied by the $d \times d$ “output” matrix $\mathbf { W } _ { o }$ . The final output of this sublayer is thus a sequence of $T$ vectors of dimension $d$ .
|
| 55 |
+
|
| 56 |
+
Feedforward sublayer. The second element of a transformer layer is a fully connected feedforward layer. This sublayer is applied to each position $t$ in the input sequence independently, and consists of two affine transformations with a pointwise non-linear function in between:
|
| 57 |
+
|
| 58 |
+
$$
|
| 59 |
+
\mathrm { F F } \left( \mathbf { x } _ { t } \right) = \mathbf { U } \sigma \left( \mathbf { V } \mathbf { x } _ { t } + \mathbf { b } \right) + \mathbf { c } ,
|
| 60 |
+
$$
|
| 61 |
+
|
| 62 |
+
where $\sigma ( x ) = \operatorname* { m a x } ( 0 , x )$ is the ReLU activation function; $\mathbf { V }$ and $\mathbf { U }$ are matrices of dimension $d \times d _ { f }$ and $d _ { f } \times d$ respectively; b and c are the bias terms. Typically, $d _ { f }$ is set to be 4 times larger than $d$ .
|
| 63 |
+
|
| 64 |
+
Add-norm. Both the multi-head self-attention and the feed-forward layer are followed by an addnorm operation. This transformation is simply a residual connection (He et al., 2016) followed by layer normalization (Lei Ba et al., 2016). The layer normalization computes the average and standard deviation of the output activations of a given sublayer and normalizes them accordingly. This guarantees that the input $\mathbf { y } _ { t }$ of the following sublayer is well conditioned, i.e., that $\mathbf { y } _ { t } ^ { T } \boldsymbol { 1 } = 0$ and $\mathbf { y } _ { t } ^ { T } \mathbf { y } _ { t } = \sqrt { d }$ . More precisely, the AddNorm operation is defined as:
|
| 65 |
+
|
| 66 |
+
$$
|
| 67 |
+
\mathtt { A d d N o r m } ( \mathbf { x } _ { t } ) = \mathtt { L a y e r N o r m } ( \mathbf { x } _ { t } + \mathtt { S u b l a y e r } ( \mathbf { x } _ { t } ) ) ,
|
| 68 |
+
$$
|
| 69 |
+
|
| 70 |
+
where Sublayer is either a multi-head self-attention or a feedforward sublayer.
|
| 71 |
+
|
| 72 |
+
Transformer layer. The overall transformer layer has the following set of equations:
|
| 73 |
+
|
| 74 |
+
$$
|
| 75 |
+
\begin{array} { r c l } { \mathbf { z } _ { t } } & { = } & { \mathbb { A } \mathrm { d } \mathrm { d } \mathrm { N o } \mathrm { r m } ( \mathrm { M u l t i } \mathrm { H e a d } ( \mathbf { x } _ { t } ) ) , } \\ { \mathbf { y } _ { t } } & { = } & { \mathbb { A } \mathrm { d } \mathrm { d } \mathrm { N o } \mathrm { r m } ( \mathrm { F F } ( \mathbf { z } _ { t } ) ) , } \end{array}
|
| 76 |
+
$$
|
| 77 |
+
|
| 78 |
+
where MultiHead is the multi-head self-attention sublayer. This is shown on the left panel of Fig. 1.
|
| 79 |
+
|
| 80 |
+
# 4 OUR APPROACH
|
| 81 |
+
|
| 82 |
+
In this section, we first show that a feedforward sublayer can be viewed as an attention layer. Then, we take advantage of this interpretation of a feedforward model to concatenate it with the self-attention layer, forming a novel layer that relies solely on a multi-head attention layer without the need for a feedforward sublayer.
|
| 83 |
+
|
| 84 |
+
# 4.1 FEEDFORWARD SUBLAYER AS AN ATTENTION LAYER
|
| 85 |
+
|
| 86 |
+
We transform the feedforward sublayer into an attention layer by replacing the ReLU non-linear function in Eq. 5 by a Softmax function and removing the biases:
|
| 87 |
+
|
| 88 |
+
$$
|
| 89 |
+
\mathbf { y } _ { t } = \mathbf { U S o f t m a x } ( \mathbf { V x } _ { t } ) = \sum _ { i = 1 } ^ { d _ { f } } a _ { t i } \mathbf { U } _ { * , i } .
|
| 90 |
+
$$
|
| 91 |
+
|
| 92 |
+
Here we use notations $\mathbf { U } _ { * , i }$ and $\mathbf { V } _ { i , * }$ to denote column and row vectors respectively. The activation $a _ { t i }$ is thus the attention weight computed with $\mathbf { V } _ { i , * }$ and $\mathbf { x } _ { t }$ . The vectors $\mathbf { x } _ { t }$ , $\mathbf { V } _ { i , * }$ and $\mathbf { U } _ { * , i }$ are equivalent to the query, key and value vectors respectively. The Eq. 9 is also equivalent to the self-attention sublayer of Eq. 3-4 with the context vectors $\mathbf { k } _ { t }$ , $\mathbf { v } _ { t }$ set to zero and the vectors $\mathbf { V } _ { i , * }$ and $\mathbf { U } _ { * , i }$ are used as key and value side position embeddings respectively. This allows for a similar implementation for the feedforward and the self-attention sublayers, and opens the possibility of merging them into a single layer.
|
| 93 |
+
|
| 94 |
+
# 4.2 PERSISTENT MEMORY AUGMENTED SELF-ATTENTION LAYER
|
| 95 |
+
|
| 96 |
+
Here we propose a single attention layer that can replace both self-attention and feedforward layers in Transformers, which we call all-attention layer. Our layer applies the attention mechanism simultaneously on the sequence of input vectors, as in the standard self-attention layer, and on a set of vectors not conditioned on the input. These vectors are added to capture information that does not depend on the immediate context, like general knowledge about the task. They are shared across the data and, in some sense, forms a persistent memory similar to the feedforward layer. Therefore we call them persistent vectors. More precisely, the persistent vectors are a set of $N$ pairs of key-value vectors, respectively stacked in two $d _ { h } \times N$ dimensional matrices ${ { \bf { M } } _ { k } }$ and $\mathbf { M } _ { v }$ . As discussed in Section 4.1, ${ { \bf { M } } _ { k } }$ and $\mathbf { M } _ { v }$ can be interpreted as $\mathbf { V }$ and $\mathbf { U }$ of a feedforward sublayer.
|
| 97 |
+
|
| 98 |
+
These persistent vectors are simply added to the pool of key and value vectors conditioned on the input:
|
| 99 |
+
|
| 100 |
+
$$
|
| 101 |
+
\begin{array} { r l r } { \left[ { \bf k } _ { 1 } , \ldots , { \bf k } _ { T + N } \right] } & { = } & { \mathsf { C o n c a t } \left( [ { \bf W } _ { k } { \bf x } _ { 1 } , \ldots , { \bf W } _ { k } { \bf x } _ { T } ] , { \bf M } _ { k } \right) , } \\ { \left[ { \bf v } _ { 1 } , \ldots , { \bf v } _ { T + N } \right] } & { = } & { \mathsf { C o n c a t } \left( [ { \bf W } _ { v } { \bf x } _ { 1 } , \ldots , { \bf W } _ { v } { \bf x } _ { T } ] , { \bf M } _ { v } \right) . } \end{array}
|
| 102 |
+
$$
|
| 103 |
+
|
| 104 |
+
Let us denote by $C _ { t } ^ { + }$ the concatenation of the context $C _ { t }$ and the indices corresponding to the $N$ persistent vectors. The similarity score between an element $t$ of the input sequence and an element $c$ of its extended context $C _ { t } ^ { + }$ is computed the same way as in Eq. (3), i.e.:
|
| 105 |
+
|
| 106 |
+
$$
|
| 107 |
+
s _ { t c } = \mathbf { x } _ { t } ^ { \top } \mathbf { W } _ { q } ^ { \top } \big ( \mathbf { k } _ { c } + \mathbf { p } ( t , c ) \big ) ,
|
| 108 |
+
$$
|
| 109 |
+
|
| 110 |
+
where the position encoding corresponding to a persistent vector is equal to zero. The all-attention then outputs a vector $\mathbf { y _ { t } }$ with the same attention function as in Eq. (4), i.e.,
|
| 111 |
+
|
| 112 |
+
$$
|
| 113 |
+
\mathbf { y } _ { t } = \sum _ { c \in C _ { t } ^ { + } } a _ { t c } \big ( \mathbf { v } _ { c } + \mathbf { p } ( t , c ) \big ) \quad \mathrm { a n d } \quad a _ { t c } = \frac { \exp \big ( { s _ { t c } } / { \sqrt { d _ { h } } } \big ) } { \displaystyle \sum _ { i \in C _ { t } ^ { + } } \exp \big ( { s _ { t i } } / { \sqrt { d _ { h } } } \big ) } .
|
| 114 |
+
$$
|
| 115 |
+
|
| 116 |
+
As with a self-attention sublayer, an all-attention layer can have multiple heads, where outputs from the different heads are concatenated for each timestep $t$ and multiplied $\mathbf { W } _ { o }$ . Note that persistent vectors are not shared between heads. Our overall layer is then simply this new MultiHeadAllAttn sublayer followed by the AddNorm operation as defined in Eq. (6), i.e.,
|
| 117 |
+
|
| 118 |
+
$$
|
| 119 |
+
\mathbf { y } _ { t } = \mathtt { A d d N o r m } \left( \mathtt { M u l t i H e a d A l 1 A t t t n } ( \mathbf { x } _ { t } ) \right) .
|
| 120 |
+
$$
|
| 121 |
+
|
| 122 |
+
The right panel of Fig. 1 summarize the all-attention layer in the case of a single head: we remove the feedforward sublayer and add unconditioned persistent vectors to the self-attention sublayer. While the persistent vectors are directly comparable to a feedforward sublayer in the case of a single head, a multi-head version is more comparable to multiple small feedforward layers working in parallel. If there are as many persistent vectors as the ReLU units, an all-attention layer has the same number of parameters as the standard transformer layer regardless of the number of heads (ignoring bias terms).
|
| 123 |
+
|
| 124 |
+
Note that using attention mechanism to address unconditioned persistent vectors has been previously proposed in the context of question answering with knowledge bases (Miller et al., 2016).
|
| 125 |
+
|
| 126 |
+
# 4.3 LANGUAGE MODELING
|
| 127 |
+
|
| 128 |
+
Language modeling is the problem of assigning a probability to a sequence of tokens $( w _ { 1 } , \dots , w _ { T } )$ :
|
| 129 |
+
|
| 130 |
+
$$
|
| 131 |
+
P ( w _ { 1 } , \dots , w _ { T } ) = \prod _ { t = 1 } ^ { T } P ( w _ { t } \mid w _ { t - 1 } , \dots , w _ { 1 } ) .
|
| 132 |
+
$$
|
| 133 |
+
|
| 134 |
+
In this paper, we focus on tokens that are either words or characters. Language modeling has been dominated by neural networks with models either based on feedforward networks (Bengio et al., 2003a) or recurrent networks (Mikolov et al., 2010). Recently auto-regressive versions of transformers have been achieving the best performance on standard benchmarks (Al-Rfou et al., 2019; Dai et al., 2019; Baevski & Auli, 2019). In this section, we describe several specificities of these models that we borrow to make our model work on language modeling, especially with a large vocabulary and a long context.
|
| 135 |
+
|
| 136 |
+
Relative position embeddings and caching. The relative position embeddings are learnable vectors $\mathbf { u } _ { i }$ that are encoding the relative positions in the sequence by setting $\mathbf { p } ( t , c ) = \mathbf { u } _ { t - c }$ in Eq. 3. They replace the fixed absolute position embeddings of the original transformer to allow these models to work on unbounded sequences. When the input sequence is processed in small blocks for efficiency, caching mechanism (Dai et al., 2019) is necessary to ensure that every token $t$ has the same context length regardless of its position in the block.
|
| 137 |
+
|
| 138 |
+
Adaptive context size. In adaptive attention span (Sukhbaatar et al., 2019), each attention head separately learns its context size from data. This allows few heads to have a very long attention span, while others to focus only on recent past. As a result, it becomes possible to extend the maximum attention span without increasing memory footprint and computation time significantly. The method works by multiplying the attention weights in Eq. 4 by a soft-masking function $m _ { z } ( t - r )$ that maps values to [0, 1]. The real parameter $z \in [ 0 , T ]$ controls how much of the attention stays the same, and it is learned together with the rest of the model. Since our attention weights in Eq. 13 contain additional values corresponding to the persistent vectors, we simply pad the masking function with 1 on the locations corresponding to those persistent vectors. This ensures that we only adapt the context size, while the persistent vectors are always included in the attention.
|
| 139 |
+
|
| 140 |
+
Adaptive input and output. In word level language modeling, the size of the vocabulary is very large, making the use of a softmax loss function prohibitive both in terms of running time and memory footprint. A standard solution to circumvent this issue is to replace the full softmax function by the adaptive softmax of Grave et al. (2017a). The idea of the adaptive softmax is to split the vocabulary into disjoint clusters and compare words only within the same cluster. The clusters $\mathcal { V } _ { 1 } , \dots , \mathcal { V } _ { K }$ are formed by partitioning the vocabulary $\nu$ by following word frequency. The most frequent words are in the first cluster $\nu _ { 1 }$ while the least frequent ones are in the last cluster. The size of each cluster is picked to minimize the overall running time, leading to small clusters of frequent words and large clusters of infrequent words. Finally, they further reduce the running time and the memory footprint by adapting the capacity of the classifiers according to their cluster assignment: The words in the $k$ -th cluster have a classifier that is $4 ^ { k }$ smaller than the one in the first cluster. The underlying motivation is that infrequent words are hard to predict and there is thus no need to use many parameters for them. The memory footprint of the model is further reduced by tying up the embedding weights with the classifier weights (Inan et al., 2017; Press & Wolf, 2017). In the case of the adaptive softmax, this leads to a special form of embeddings called adaptive input (Baevski & Auli, 2019).
|
| 141 |
+
|
| 142 |
+
# 5 EXPERIMENTS
|
| 143 |
+
|
| 144 |
+
# 5.1 EXPERIMENTAL SETUP
|
| 145 |
+
|
| 146 |
+
In this section, we describe our hyperparameters choices, our optimization scheme as well as the details of the datasets we consider.
|
| 147 |
+
|
| 148 |
+
Implementation details. We initialize token and position embeddings from √ √ $\mathcal { N } ( 0 , 1 )$ , and the matrices $\mathbf { W } _ { q , k , v , o }$ from $\mathcal { U } ( - \sqrt { d } , \sqrt { d } )$ . The position embeddings are shared accross all the heads. Persistent vectors are reparameterized by $\mathbf { k } _ { i } = \sqrt { d _ { h } } \mathbf { k } _ { i } ^ { \prime }$ and $\mathbf { v } _ { i } = \sqrt { N } \mathbf { v } _ { i } ^ { \prime }$ , where the parameters $\mathbf { k } _ { i } ^ { \prime }$ and $\mathbf { v } _ { i } ^ { \prime }$ are initialized from $\mathcal { N } ( 0 , 1 / d _ { h } )$ and $\mathcal { N } ( 0 , 1 / N )$ respectively. This way the persistent vectors have the same unit variance as the context vectors initially, while the underlying parameters $\mathbf { k } _ { i } ^ { \prime }$ and $\mathbf { v } _ { i } ^ { \prime }$ are initialized similar to the weights of a feedforward sublayer.
|
| 149 |
+
|
| 150 |
+
For character level language modeling, we set the model dimension to $d = 5 1 2$ , and the number of heads to 8. Our small (large) models have 18 (36) all-attention layers, $N = 1 0 2 4$ (2048) persistent vectors and a dropout rate of 0.3 (0.4) applied to attention weights. The adaptive span has the same hyperparameters as Sukhbaatar et al. (2019) with a maximum span of 8192, except the loss coefficient is set to $1 0 ^ { - 7 }$ . We use Adagrad (Duchi et al., 2011) with a learning rate of 0.07. We clip individual gradients with a norm larger than 0.03 (Pascanu et al., 2013). We warmup the learning rate linearly for $3 2 \mathrm { k }$ timesteps (Vaswani et al., 2017). A training batch consists of 64 samples, each with 512 consecutive tokens. When the loss on validation stops decreasing, we divide the learning rate by 10 for an additional 20-30k steps. Training large models takes about a day on 64 V100 GPUs.
|
| 151 |
+
|
| 152 |
+
For word level language modeling, we use a model with $d = 5 1 2$ and 36 layers, each with 8 heads and 2048 persistent vectors. We use Adam with a learning rate of 0.00025 and $\mathrm { 8 k }$ warmup steps. The whole gradient norm is clipped at 1. A batch consists of 64 samples, each with 256 tokens. We use an adaptive span of 2048 with a loss of $5 \times 1 0 ^ { - 7 }$ . The dropout rate is set to 0.3 for attention weights, and 0.1 for input embeddings and the final representation.
|
| 153 |
+
|
| 154 |
+
Datasets and metrics. For character level language modeling, we consider the enwik8 and text8 datasets from Mahoney (2011). Both datasets have a training set of 100M tokens and a vocabulary of 28 and 205 unique characters respectively (including the end-of-sentence token). Both datasets are made of Wikipedia articles split at the character level. The text8 dataset is preprocessed by lowering casing and retaining only whitespaces and the letters that are in the ISO basic Latin alphabet. We report bit per character (bpc) on dev and test sets.
|
| 155 |
+
|
| 156 |
+
For word level language modeling, we consider the WikiText-103 dataset introduced by Merity et al. (2017). The training set of WikiText $- 1 0 3$ contains around 100M tokens and a vocabulary of about $2 6 0 \mathrm { k }$ words. Each word in the vocabulary appears at least 3 times in the training data. The dataset is made of Wikipedia articles. We report perplexity (ppl) on the dev and test sets.
|
| 157 |
+
|
| 158 |
+
Dataset specific implementation details. Following Baevski & Auli (2019) on WikiText-103, we use tied adaptive softmax and adaptive input with 3 clusters of size 20k, 40k and $2 0 0 \mathrm { k }$ . The dimensions of the classifiers in each cluster are consecutively divided by 4, leading to the following dimensions $d , d / 4$ and $d / 1 6$ .
|
| 159 |
+
|
| 160 |
+
# 5.2 MAIN RESULTS
|
| 161 |
+
|
| 162 |
+
We compare our approach to the state of the art on several standard benchmarks on both word level and character level language modeling.
|
| 163 |
+
|
| 164 |
+
Character level language modeling. In Table 1, we report the results on enwik8. Our small model outperforms all other models of similar sizes. Our large model matches the state-of-the-art performance with significantly fewer parameters. On text8, our small model also matches the best performing model from Sukhbaatar et al. (2019) as shown in Table 2. Our large model is 0.01 bpc below the state-of-the-art, but it matches the performance of a “Transformer $^ +$ adaptive span” baseline 1 of a similar size.
|
| 165 |
+
|
| 166 |
+
Table 1: Comparison with the state of the art on character level language modeling on enwik8. We report bpc for the test set as well as the number of parameters.
|
| 167 |
+
|
| 168 |
+
<table><tr><td>Model</td><td>#Params</td><td>test bpc</td></tr><tr><td>Small models</td><td></td><td></td></tr><tr><td>Haetal. (2017)-LN HyperNetworks</td><td>27M</td><td>1.34</td></tr><tr><td>Chung et al. (2017) -LN HM-LSTM</td><td>35M</td><td>1.32</td></tr><tr><td>Zilly et al. (2O17) -Recurrent highway networks</td><td>46M</td><td>1.27</td></tr><tr><td>Mujika et al. (2017) -Large FS-LSTM-4</td><td>47M</td><td>1.25</td></tr><tr><td>Krause et al. (2017)-Large mLSTM</td><td>46M</td><td>1.24</td></tr><tr><td>Al-Rfou et al. (2019)- T12 Dai et al. (2019)- Transformer-XL</td><td>44M</td><td>1.11</td></tr><tr><td>Sukhbaatar et al.(2O19) - Transformer+ adaptive span</td><td>41M</td><td>1.06</td></tr><tr><td></td><td>39M</td><td>1.02</td></tr><tr><td>All-attention network + adaptive span</td><td>39M</td><td>1.01</td></tr><tr><td>Large models</td><td></td><td></td></tr><tr><td>Al-Rfou et al. (2019)- T64</td><td>235M</td><td>1.06</td></tr><tr><td>Dai et al. (2019)- Transformer-XL 18l</td><td>88M</td><td>1.03</td></tr><tr><td>Dai et al. (2019)- Transformer-XL 24l</td><td>277M</td><td>0.99</td></tr><tr><td>Child et al. (2019)- Sparse Transformer (fixed)</td><td>95M</td><td>0.99</td></tr><tr><td>Sukhbaatar et al. (2O19) - Transformer + adaptive span</td><td>209M</td><td>0.98</td></tr><tr><td>All-attention network + adaptive span</td><td>114M</td><td>0.98</td></tr></table>
|
| 169 |
+
|
| 170 |
+
Table 2: Comparison with the state of the art on character level language modeling on text8. We report bpc for the dev and test sets as well as the number of parameters.
|
| 171 |
+
|
| 172 |
+
<table><tr><td>Model</td><td>#Params</td><td>dev bpc</td><td>test bpc</td></tr><tr><td>Small models</td><td></td><td></td><td></td></tr><tr><td>Chung et al. (2017) - LN HM-LSTM</td><td>35M</td><td></td><td>1.29</td></tr><tr><td>Zilly et al. (2O17) -Recurrent highway networks</td><td>45M</td><td></td><td>1.27</td></tr><tr><td>Krause et al. (2017)-Large mLSTM</td><td>45M</td><td>=</td><td>1.27</td></tr><tr><td>Al-Rfou et al. (2019)-T12</td><td>44M</td><td>=</td><td>1.18</td></tr><tr><td>Sukhbaatar et al.(2O19) - Transformer+adaptive span</td><td>38M</td><td>1.05</td><td>1.11</td></tr><tr><td>All-attention network + adaptive span</td><td>38M</td><td>1.05</td><td>1.11</td></tr><tr><td>Large models</td><td></td><td></td><td></td></tr><tr><td>Al-Rfou et al. (2019)- T64</td><td>235M</td><td>1.06</td><td>1.13</td></tr><tr><td>Dai et al. (2019)- Transformer-XL</td><td>277M</td><td>1</td><td>1.08</td></tr><tr><td>Sukhbaatar et al. (2O19) - Transformer + adaptive span</td><td>209M</td><td>1.01</td><td>1.07</td></tr><tr><td>Transformer+ adaptive span</td><td>116M</td><td>1.02</td><td>1.08</td></tr><tr><td>All-attention network + adaptive span</td><td>114M</td><td>1.02</td><td>1.08</td></tr></table>
|
| 173 |
+
|
| 174 |
+
Word level language modeling. In Table 3, we compare the all-attention network with the state of the art among small models on the WikiText-103 dataset. Our network is $3 . 4 \mathrm { p p l }$ better than the previous best, which was a Transformer-XL of a comparable size 2. For completeness, we also report the state of the art obtained with larger models, that is about 2 perplexity points better than us. In Appendix A, we show sample attention maps from our model.
|
| 175 |
+
|
| 176 |
+
# 5.3 ABLATION STUDY
|
| 177 |
+
|
| 178 |
+
In this section, we compare different variations of our large model on character level language modeling on Text8. First, we vary the number of persistent vectors $N$ in each layer as shown in
|
| 179 |
+
|
| 180 |
+
Table 3: Comparison with the state of the art on word level language modeling on WikiText-103. We report perplexity (ppl) for the dev and test sets as well as the number of parameters.
|
| 181 |
+
|
| 182 |
+
<table><tr><td>Model</td><td>#Params</td><td>dev ppl</td><td> test ppl</td></tr><tr><td>Small models</td><td></td><td></td><td></td></tr><tr><td>Grave et al. (2017b) -LSTM</td><td></td><td></td><td>48.7</td></tr><tr><td>Bai et al. (2018)- TCN</td><td></td><td></td><td>45.2</td></tr><tr><td>Dauphin et al. (2017) - GCNN-8</td><td></td><td></td><td>44.9</td></tr><tr><td>Grave et al. (2017b) -LSTM+ Neural cache</td><td></td><td>=</td><td>40.8</td></tr><tr><td>Merity et al. (2018) - 4-layer QRNN</td><td>151M</td><td>32.0</td><td>33.0</td></tr><tr><td>Rae et al. (2018)-LSTM +Hebbian + Cache</td><td>1</td><td>29.7</td><td>29.9</td></tr><tr><td>Dai et al. (2019)- Transformer-XL Standard</td><td>151M</td><td>23.1</td><td>24.0</td></tr><tr><td>All-attention network + adaptive span</td><td>133M</td><td>19.7</td><td>20.6</td></tr><tr><td>Best published result with a large model (Dai et al., 2019)</td><td>257M</td><td>17.7</td><td>18.3</td></tr></table>
|
| 183 |
+
|
| 184 |
+

|
| 185 |
+
Figure 2: The performance of our large model on Text8 as we vary (left) the number of persistent vectors, or (right) the way how persistent vectors integrate with self-attention.
|
| 186 |
+
|
| 187 |
+
Figure 2(left). The result shows that persistent vectors are crucial for performance, already reaching a good performance at $N = 1 0 2 4$ . A model without persistent vectors (i.e. $N = 0$ ) is equivalent to a transformer model without feedforward sublayers, and it performs poorly. This also demonstrates the importance of feedforward layers in transformer models. However, it maintains decent performances because it still has a lot of parameters (38M) in the $\mathbf { W } _ { q , k , v , o }$ matrices.
|
| 188 |
+
|
| 189 |
+
We also compare several different ways of integrating persistent vectors into self-attention:
|
| 190 |
+
|
| 191 |
+
• All-attn: this is our default model presented in Section 4 where persistent vectors are simply concatenated to context vectors.
|
| 192 |
+
• Attn-split: this is the same as “all-attn” except the attention over context and persistent vectors are computed separately. In other words, we replace the softmax in Eq. 13 with two separate softmax functions: one for context vectors only and one for persistent vectors only.
|
| 193 |
+
• Head-split: this is the same as “all-attn” except we constrain half of the heads to attend only to context vectors, and the other half to attend only to persistent vectors.
|
| 194 |
+
• Single-head: this is the same as “attn-split”, but now persistent vectors are not split into multiple heads. Instead, each layer has a single set of persistent key-value vectors of a dimension $d$ .
|
| 195 |
+
• FF-attn: a Transformer model where the ReLU of feedforward sublayers is replaced with a Softmax function as discussed in Section 4.1. This is the same as “single-head” above except persistent vectors are kept as a separate sublayer that comes after a self-attention sublayer. Since this will double the depth of a model, we decrease the number of layers to 24 and increase the feedforward size to 3072 to maintain the number of parameters same.
|
| 196 |
+
|
| 197 |
+
Note that all those versions have the same number of parameters except “head-split”, which has fewer parameters because half of its persistent vectors are not used. The result is shown in Figure 2(right). There are few things to notice: (i) “all-attn” outperforms “attn-split”, which indicates that there is a benefit in computing attention jointly over persistent and context vectors; (ii) “single-head” is worse than “attn-split”, which means persistent vectors with more heads are better; and (iii) dividing the heads into context-only and persistent-only groups does not work well; and (iv) “FF-attn” does not work as good as “all-attn” which means the switch from ReLU to Softmax alone is not sufficient.
|
| 198 |
+
|
| 199 |
+
# 6 CONCLUSION
|
| 200 |
+
|
| 201 |
+
In this paper, we propose a novel attention layer that presents a unified mechanism to aggregate general and contextual information. It extends the self-attention layer of a transformer with a set of persistent vectors that are capable of storing information that is complementary to the short term information in contexts. We also show that these persistent vectors can replace the feedforward layers in a transformer network with no loss of performance. We think that this simplified layer can help better understand how information is processed and stored in transformer-like sequence models.
|
| 202 |
+
|
| 203 |
+
# REFERENCES
|
| 204 |
+
|
| 205 |
+
Rami Al-Rfou, Dokook Choe, Noah Constant, Mandy Guo, and Llion Jones. Character-level language modeling with deeper self-attention. In Proceedings of the 33rd AAAI Conference on Artificial Intelligence, 2019.
|
| 206 |
+
Alexei Baevski and Michael Auli. Adaptive input representations for neural language modeling. In ICLR, 2019.
|
| 207 |
+
Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. In ICLR, 2015.
|
| 208 |
+
Yoshua Bengio, Réjean Ducharme, Pascal Vincent, and Christian Jauvin. A neural probabilistic language model. Journal of machine learning research, 3(Feb):1137–1155, 2003a.
|
| 209 |
+
Yoshua Bengio, Jean-Sébastien Senécal, et al. Quick training of probabilistic neural nets by importance sampling. In AISTATS, pp. 1–9, 2003b.
|
| 210 |
+
Rewon Child, Scott Gray, Alec Radford, and Ilya Sutskever. Generating long sequences with sparse transformers. arXiv preprint arXiv:1904.10509, 2019.
|
| 211 |
+
Junyoung Chung, Sungjin Ahn, and Yoshua Bengio. Hierarchical multiscale recurrent neural networks. In ICLR, 2017.
|
| 212 |
+
Zihang Dai, Zhilin Yang, Yiming Yang, William W Cohen, Jaime Carbonell, Quoc V Le, and Ruslan Salakhutdinov. Transformer-xl: Attentive language models beyond a fixed-length context. arXiv preprint arXiv:1901.02860, 2019.
|
| 213 |
+
Yann N Dauphin, Angela Fan, Michael Auli, and David Grangier. Language modeling with gated convolutional networks. In ICML, 2017.
|
| 214 |
+
Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: pre-training of deep bidirectional transformers for language understanding. In NAACL-HLT (1), 2019.
|
| 215 |
+
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.
|
| 216 |
+
Joshua T Goodman. A bit of progress in language modeling. Computer Speech & Language, 15(4): 403–434, 2001.
|
| 217 |
+
Edouard Grave, Armand Joulin, Moustapha Cissé, and Hervé Jégou. Efficient softmax approximation for gpus. In ICML, 2017a.
|
| 218 |
+
Edouard Grave, Armand Joulin, and Nicolas Usunier. Improving neural language models with a continuous cache. In ICLR, 2017b.
|
| 219 |
+
Alex Graves, Greg Wayne, and Ivo Danihelka. Neural turing machines. arXiv preprint arXiv:1410.5401, 2014.
|
| 220 |
+
|
| 221 |
+
David Ha, Andrew M. Dai, and Quoc V. Le. Hypernetworks. In ICLR, 2017.
|
| 222 |
+
|
| 223 |
+
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.
|
| 224 |
+
|
| 225 |
+
Sepp Hochreiter and Jürgen Schmidhuber. Long short-term memory. Neural computation, 9(8): 1735–1780, 1997.
|
| 226 |
+
|
| 227 |
+
Hakan Inan, Khashayar Khosravi, and Richard Socher. Tying word vectors and word classifiers: A loss framework for language modeling. In ICLR, 2017.
|
| 228 |
+
|
| 229 |
+
Michael I Jordan and Robert A Jacobs. Hierarchical mixtures of experts and the em algorithm. Neural computation, 6(2):181–214, 1994.
|
| 230 |
+
|
| 231 |
+
Rafal Jozefowicz, Oriol Vinyals, Mike Schuster, Noam Shazeer, and Yonghui Wu. Exploring the limits of language modeling. arXiv preprint arXiv:1602.02410, 2016.
|
| 232 |
+
|
| 233 |
+
Ben Krause, Iain Murray, Steve Renals, and Liang Lu. Multiplicative LSTM for sequence modelling. In ICLR (Workshop), 2017.
|
| 234 |
+
|
| 235 |
+
Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E Hinton. Layer normalization. arXiv preprint arXiv:1607.06450, 2016.
|
| 236 |
+
|
| 237 |
+
Matt Mahoney. Large text compression benchmark. URL: http://www. mattmahoney. net/text/text. html, 2011.
|
| 238 |
+
|
| 239 |
+
Stephen Merity, Caiming Xiong, James Bradbury, and Richard Socher. Pointer sentinel mixture models. In ICLR, 2017.
|
| 240 |
+
|
| 241 |
+
Stephen Merity, Nitish Shirish Keskar, and Richard Socher. An analysis of neural language modeling at multiple scales. arXiv preprint arXiv:1803.08240, 2018.
|
| 242 |
+
|
| 243 |
+
Tomáš Mikolov, Martin Karafiát, Lukáš Burget, Jan Cernock ˇ y, and Sanjeev Khudanpur. Recurrent \` neural network based language model. In Eleventh annual conference of the international speech communication association, 2010.
|
| 244 |
+
|
| 245 |
+
Alexander H. Miller, Adam Fisch, Jesse Dodge, Amir-Hossein Karimi, Antoine Bordes, and Jason Weston. Key-value memory networks for directly reading documents. In EMNLP, 2016.
|
| 246 |
+
|
| 247 |
+
Frederic Morin and Yoshua Bengio. Hierarchical probabilistic neural network language model. In AISTATS, 2005.
|
| 248 |
+
|
| 249 |
+
Asier Mujika, Florian Meier, and Angelika Steger. Fast-slow recurrent neural networks. In NIPS, pp. 5915–5924, 2017.
|
| 250 |
+
|
| 251 |
+
Razvan Pascanu, Tomas Mikolov, and Yoshua Bengio. On the difficulty of training recurrent neural networks. In ICML, 2013.
|
| 252 |
+
|
| 253 |
+
Ofir Press and Lior Wolf. Using the output embedding to improve language models. In EACL (2), 2017.
|
| 254 |
+
|
| 255 |
+
Jack W. Rae, Chris Dyer, Peter Dayan, and Timothy P. Lillicrap. Fast parametric learning with activation memorization. In ICML, 2018.
|
| 256 |
+
|
| 257 |
+
Rico Sennrich, Barry Haddow, and Alexandra Birch. Neural machine translation of rare words with subword units. In ACL (1), 2016.
|
| 258 |
+
|
| 259 |
+
Peter Shaw, Jakob Uszkoreit, and Ashish Vaswani. Self-attention with relative position representations. In NAACL-HLT (2), 2018.
|
| 260 |
+
|
| 261 |
+
Noam Shazeer, Azalia Mirhoseini, Krzysztof Maziarz, Andy Davis, Quoc V. Le, Geoffrey E. Hinton, and Jeff Dean. Outrageously large neural networks: The sparsely-gated mixture-of-experts layer. In ICLR, 2017.
|
| 262 |
+
|
| 263 |
+
Nitish Srivastava, Geoffrey Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov. Dropout: a simple way to prevent neural networks from overfitting. The Journal of Machine Learning Research, 15(1):1929–1958, 2014.
|
| 264 |
+
|
| 265 |
+
Sainbayar Sukhbaatar, Arthur Szlam, Jason Weston, and Rob Fergus. End-to-end memory networks. In NIPS, 2015.
|
| 266 |
+
|
| 267 |
+
Sainbayar Sukhbaatar, Edouard Grave, Piotr Bojanowski, and Armand Joulin. Adaptive attention span in transformers. In ACL, 2019.
|
| 268 |
+
|
| 269 |
+
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In NIPS, 2017.
|
| 270 |
+
|
| 271 |
+
Oriol Vinyals, Meire Fortunato, and Navdeep Jaitly. Pointer networks. In NIPS, 2015.
|
| 272 |
+
|
| 273 |
+
Felix Wu, Angela Fan, Alexei Baevski, Yann Dauphin, and Michael Auli. Pay less attention with lightweight and dynamic convolutions. In ICLR, 2019.
|
| 274 |
+
|
| 275 |
+
Kelvin Xu, Jimmy Ba, Ryan Kiros, Kyunghyun Cho, Aaron C. Courville, Ruslan Salakhutdinov, Richard S. Zemel, and Yoshua Bengio. Show, attend and tell: Neural image caption generation with visual attention. In ICML, 2015.
|
| 276 |
+
|
| 277 |
+
Wojciech Zaremba, Ilya Sutskever, and Oriol Vinyals. Recurrent neural network regularization. arXiv preprint arXiv:1409.2329, 2014.
|
| 278 |
+
|
| 279 |
+
Julian Georg Zilly, Rupesh Kumar Srivastava, Jan Koutník, and Jürgen Schmidhuber. Recurrent highway networks. In ICML, 2017.
|
| 280 |
+
|
| 281 |
+

|
| 282 |
+
Figure 3: Sample attention maps from our model that trained on the WikiText-103 dataset. The 4 plots correspond to 4 different attention heads in the model. The $Y$ -axis is different samples from a short sequence, and the $X$ -axis shows all the vectors in the attention. The first 2048 vectors come from the context, and the remaining 2048 are persistent vectors. In the top 2 heads, few persistent vectors are dominating the attention, although the 2nd head has some attention weights in the context part as well. The 3rd head has more diverse activations on the persistent vectors, while also attending to very recent context. The last head is mostly attending to about last 500 tokens in the context, but there are some activations in the persistent vectors.
|
| 283 |
+
|
| 284 |
+
# B BASELINE TRAINING
|
| 285 |
+
|
| 286 |
+
We trained baseline Transformer models on the WikiText-103 dataset using the same code and settings as our model to check if some of the training details (e.g. weight initialization, position embeddings, adaptive span, etc.˙) affected our result in Table 3. We considered two baselines with roughtly the same number of parameters as our model: 1) a 22-layer model with a hidden size of 512 and a feedforward layer size of 4096; 2) a 36-layer model with a hidden size of 512 and a feedforward layer size of 2048. The 22-layer model is more comparable to our model because it has a similar number of nonlinear layers as our model, while 36-layer has twice as much non-linear layers as our model. The training of those models are plotted in Figure 4 against our model (excluding the finetuning part). As we can see, the training of the 36-layer model has diverged early in the training, which is not surprising as such deep Transformer models are known to be unstable during training. The same thing happenned to the 22-layer model but near the end of its training. However, it is almost certain that its final performance would have been worse than our model even if its training did not diverge.
|
| 287 |
+
|
| 288 |
+

|
| 289 |
+
Figure 4: Training of baseline Transformer models on WikiText-103 dataset.
|
md/train/Hkxvl0EtDH/Hkxvl0EtDH.md
ADDED
|
@@ -0,0 +1,450 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# A CAUSAL VIEW ON ROBUSTNESS OF NEURAL NETWORKS
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
We present a causal view on the robustness of neural networks against input manipulations, which applies not only to traditional classification tasks but also to general measurement data. Based on this view, we design a deep causal manipulation augmented model (deep CAMA) which explicitly models the manipulations of data as a cause to the observed effect variables. We further develop data augmentation and test-time fine-tuning methods to improve deep CAMA’s robustness. When compared with discriminative deep neural networks, our proposed model shows superior robustness against unseen manipulations. As a by-product, our model achieves disentangled representation which separates the representation of manipulations from those of other latent causes.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Deep neural networks (DNNs) have great success in many real-life applications, however, they are easily fooled even by a tiny amount of perturbation (Szegedy et al., 2013; Goodfellow et al., 2015; Carlini & Wagner, 2017b; Athalye et al., 2018). Lack of robustness hinders the application of DNNs to critical decision making tasks such as uses in health care. To address this, a deep learning practitioner may suggest training DNNs with datasets that are not only big but also diverse. Indeed, data augmentation and adversarial training have shown improvements in both the generalization and robustness of DNNs (Kurakin et al., 2016; Perez & Wang, 2017; Madry et al., 2017). Unfortunately, this does not address the vulnerability of DNNs for unseen manipulations. For example, as shown in Figure 1, a DNN trained on clean MNIST digits fails to classify shifted digits. Although observing (adversarial) perturbations of clean data in training improves robustness against that particular manipulation (the green line), the DNN is still fragile when unseen manipulations are present (orange line). Since it is unrealistic to augment the training data towards all possible manipulations that many occur, a principled method that fundamentally improves the robustness is much needed.
|
| 12 |
+
|
| 13 |
+
On the other hand, humans naturally understand the independent causal mechanisms for visual recognition tasks, where the generative process of the perceived view is composed of modules that do not influence each other (Parascandolo et al., 2017). After learning the concept of an “elephant”, a child can identify the elephant in a photo taken under any lightning condition, location, etc. Importantly, the elephant, the lightning condition, and the location are causes of the presented view in the photo. Therefore we argue that the incapability for causal reasoning (Pearl & Mackenzie, 2018; Gopnik et al., 2004) is the reason of DNN’s vulnerability to (adversarial) data manipulations.
|
| 14 |
+
|
| 15 |
+
This work discusses the robustness of DNNs from a causal perspective. Our contributions are:
|
| 16 |
+
|
| 17 |
+
• A causal view on robustness of neural networks. We argue from a causal perspective that adversarial examples for a model can be generated by manipulations on the effect variables and/or their unseen causes. Therefore DNN’s vulnerability to adversarial attacks is due to the lack of causal understanding. • A causal inspired deep generative model. We design a causal deep generative model which takes into account the unseen manipulations of the effect variables. Accompanied with this model is a test-time inference method to learn unseen manipulations and thus improve classification accuracy on noisy inputs. Data augmentation techniques can also be safely applied to our model during training without deteriorating its generalization ability to unseen manipulations. Compared to DNNs, experiments on both MNIST and a measurementbased dataset show that our model is significantly more robustness to unseen manipulations.
|
| 18 |
+
|
| 19 |
+

|
| 20 |
+
Figure 1: Robustness results for DNNs against different manipulations on MNIST. Panels (a) and (b) show the accuracy on classifying noisy test data generated by shifting the digits vertically (Ver) and horizontally (Hor). It shows that data augmentation during training makes generalization to unseen shifts worse (orange versus blue lines).
|
| 21 |
+
|
| 22 |
+
# 2 A CAUSAL VIEW ON ROBUSTNESS OF NEURAL NETWORKS
|
| 23 |
+
|
| 24 |
+
Discriminative DNNs are not robust to manipulations such as adversarial noise injection (Goodfellow et al., 2015; Carlini & Wagner, 2017a; Athalye et al., 2018), rotation and shift. They do not understand the causal mechanisms of the data generating process, which leads to overfiting to nuisance factors that are less related to the ground truth classification results. By exploiting the overfit to the nuisance factors, an adversary can easily manipulate the inputs to fool discriminative DNNs into predicting the wrong outcomes.
|
| 25 |
+
|
| 26 |
+
On the contrary, we as human can easily recognize an object in a scene and be indifferent to the changes in other aspects such as background, viewing angle, the presence of a sticker to the object, etc. More importantly, our recognition is not affected even when some of the perturbations, e.g. changes in the lighting condition, are significant. We argue that the main difference here is due to our ability to perform causal reasoning, which identifies independent mechanisms that are not causally related to the object recognition results (Freeman, 1994; Peters et al., 2017; Parascandolo et al., 2017). This leads to robust human perception to not only a certain type of perturbations, but also to many types of manipulations. Thus we argue that one should incorporate causal mechanisms into model design, and make the model robust on the level of different types of perturbations.
|
| 27 |
+
|
| 28 |
+
Before presenting our causally informed model, we first define a valid manipulation of inputs in a causal sense. A valid manipulation is a perturbation on data, which only changes the effects, not the cause of the target. We visualize a causal graph in Figure 2, where the arrows indicate the causeeffect relationship between variables. Take hand-written digit classification for example, $X$ is the image of a digit and $Y$ is the class label. The appearance of $X$ is an effect of the digit number $Y$ , latent causes $Z$ such as writing styles, and possible manipulations $M$ , such as rotation or translation. Changes to $Z$ and $M$ cause the appearance of $X$ to change, but $X$ still carries the same information about $Y$ regardless of these perturbations, since $Z$ , $M$ and $Y$ are independent mechanisms. Thus, any manipulation that does not influence the $Y X$ relationship are valid manipulations. Humans are extremely robust to these manipulations while machine learning algorithms are vulnerable.
|
| 29 |
+
|
| 30 |
+
In summary, from the causal perspective, any manipulation $M$ on data $X$ , that is a co-parent of $Y$ , is a valid manipulation. This definition includes many manipulations used in existing work on the robustness of neural networks, such as noise injection, shift and rotation (Engstrom et al., 2019). Ideally, a machine learning model should be able to generalize to any valid manipulation, at the same time training with manipulated data of certain types should never harm the model’s robustness to unseen manipulations. However, discriminative deep learning models ignore the causal structure and consider $X Y$ only, which explains their vulnerability to data manipulations. Inspired by causal reasoning of humans, we propose a deep learning framework concerning the causal relationship.
|
| 31 |
+
|
| 32 |
+
# 3 THE CAUSAL MANIPULATION AUGMENTED MODEL
|
| 33 |
+
|
| 34 |
+
We propose a deep CAusal Manipulation Augmented model (deep CAMA), which takes into account the causal relationship for model design. Our proposed model is more robust to unseen manipulations on effect variables, and more importantly, our model can learn these manipulations without supervision. The robustness can be further improved by training-time data augmentation, without sacrificing the generalization ability to unseen manipulations. Below we first present the deep CAMA for single modality data, which focuses on predicting $Y$ using $X$ , and then present a generic deep CAMA for multimodality measurement data.
|
| 35 |
+
|
| 36 |
+

|
| 37 |
+
Figure 2: A simple example, where X is the effect of Y, Z and M.
|
| 38 |
+
|
| 39 |
+

|
| 40 |
+
Figure 3: Graphical presentation of proposed causally consistent deep generative model for single modal data.
|
| 41 |
+
|
| 42 |
+

|
| 43 |
+
Figure 4: The network architecture. Shaded areas show the selective part for $d o ( m )$ training and the fine-tune method, respectively.
|
| 44 |
+
|
| 45 |
+
# 3.1 DEEP CAMA FOR SINGLE MODALITY DATA
|
| 46 |
+
|
| 47 |
+
The task of predicting $Y$ from $X$ covers a wide range of applications such as image/speech recognition and sentiment analysis. Normally a discriminative DNN takes $X$ as input and directly predicts (the distribution of) the target variable $Y$ . Generative classifiers, on the other hand, build a generative model $Y X$ , and use Bayes’ rule for predicting $Y$ given $X$ $\therefore p ( y | x ) = p ( y ) p ( x | y ) / p ( x )$ .
|
| 48 |
+
|
| 49 |
+
We design deep CAMA (Figure 3) following the causal relationship as shown in Figure 2. Taking MNIST for example: $Y$ is the label and $X$ is the image, $Z$ models the latent style of the digits, and $M$ handles the manipulations that we desire the model to be robust to. The model is defined as:
|
| 50 |
+
|
| 51 |
+
$$
|
| 52 |
+
p _ { \theta } ( x , y , z , m ) = p ( m ) p ( z ) p ( y ) p _ { \theta } ( x | y , z , m )
|
| 53 |
+
$$
|
| 54 |
+
|
| 55 |
+
For efficient inference we follow the amortized inference approach in variational auto-encoders (Kingma $\&$ Welling, 2013; Rezende et al., 2014; Zhang et al., 2018) and define an inference network as the approximate posterior distribution:
|
| 56 |
+
|
| 57 |
+
$$
|
| 58 |
+
q _ { \phi } ( z , m | x , y ) = q _ { \phi _ { 1 } } ( z | x , y , m ) q _ { \phi _ { 2 } } ( m | x ) .
|
| 59 |
+
$$
|
| 60 |
+
|
| 61 |
+
We use $\phi$ to denote all the parameters of the encoder network and $\phi = \{ \phi _ { 1 } , \phi _ { 2 } \}$ , where $\phi _ { 1 }$ is the parameter for the encoder network for the variational distribution $q _ { \phi _ { 1 } } ( z | x , y , m )$ , and $\phi _ { 2 }$ is used for the $q _ { \phi _ { 2 } } ( m | x )$ part. Note that we assume the dependence of $M$ on $X$ only in $q _ { \phi _ { 2 } } ( m | x )$ , which, as we shall show later, allows deep CAMA to learn unseen manipulations with unlabelled noisy data.
|
| 62 |
+
|
| 63 |
+
The network architecture is presented in Figure 4. For the $p$ model, the cause variables $Y$ , $Z$ and $M$ are first transformed into feature vectors $h _ { Y } , h _ { Z }$ and $h _ { M }$ . Later, these features are merged together and then passed through another neural network to produce the distributional parameters of $p _ { \theta } ( x | y , z , m )$ . For the approximate posterior $q$ , two different networks are used to compute the distributional parameters of $q _ { \phi _ { 2 } } ( m | x )$ and $q _ { \phi _ { 1 } } ( z | x , y , m )$ , respectively.
|
| 64 |
+
|
| 65 |
+
Model training Assume that during training, the model observes clean data $\mathcal { D } = \{ ( x _ { n } , y _ { n } ) \}$ only. In this case we set the manipulation variable $M$ to a null value, e.g. $d o ( m = 0 )$ , and train deep CAMA by maximizing the likelihood function $\log p ( x , y | d o ( m = 0 ) )$ under training data. Since this marginal distribution is intractable, we instead maximize the intervention evidence lower-bound (ELBO) with $d o ( m = 0 )$ , i.e. $\begin{array} { r } { \operatorname* { m a x } _ { \theta , \phi } \mathbb { E } _ { \mathcal { D } } [ \mathrm { E L B O } ( x , y , d o ( m = 0 ) ) ] } \end{array}$ , with the ELBO defined as
|
| 66 |
+
|
| 67 |
+
$$
|
| 68 |
+
\begin{array} { r } { \mathrm { E L B O } ( x , y , d o ( m = 0 ) ) : = \mathbb { E } _ { q _ { \phi } ( z | x , y , d o ( m = 0 ) ) } \left[ \log \frac { p _ { \theta } ( x , y , z | d o ( m = 0 ) ) } { q _ { \phi } ( z , | x , y , d o ( m = 0 ) ) } \right] } \\ { = \mathbb { E } _ { q _ { \phi _ { 1 } } ( z | x , y , m = 0 ) } \left[ \log \frac { p _ { \theta } ( x | y , z , m = 0 ) p ( y ) p ( z ) } { q _ { \phi _ { 1 } } ( z | x , y , m = 0 ) } \right] . } \end{array}
|
| 69 |
+
$$
|
| 70 |
+
|
| 71 |
+
See appendix A for a detailed derivation. If noisy data $\mathcal { D } ^ { \prime }$ is available during training, then similar to data augmentation and adversarial training (Goodfellow et al., 2015; Tramer et al., 2018; Madry \` et al., 2017), we can augment the training data with this noisy data. We still use the intervention ELBO (3) for clean data. For the manipulated instances, we can either use the intervention ELBO with $d o ( m = m _ { 0 } )$ when the noisy data $\mathcal { D } ^ { \prime } = \{ ( m _ { 0 } ( x ) , y ) \}$ is generated by a known manipulation $m _ { 0 }$ , or, as done in our experiments, infer the latent variable $M$ for unknown manipulations. This is achieved by maximizing the ELBO on the joint distribution $\log p ( x , y )$ using noisy data:
|
| 72 |
+
|
| 73 |
+
$$
|
| 74 |
+
\operatorname { E L B O } ( x , y ) : = \mathbb { E } _ { q _ { \phi } ( z , m \mid x , y ) } \left[ \log \frac { p _ { \theta } ( x , y , z , m ) } { q _ { \phi } ( z , m \mid x , y ) } \right] ,
|
| 75 |
+
$$
|
| 76 |
+
|
| 77 |
+
and therefore the total loss function to be maximized is defined as
|
| 78 |
+
|
| 79 |
+
$$
|
| 80 |
+
\mathcal { L } _ { \mathrm { a u g } } ( \theta , \phi ) = \lambda \mathbb { E } _ { \mathcal { D } } [ \mathrm { E L B O } ( x , y , d o ( m = 0 ) ) ] + ( 1 - \lambda ) \mathbb { E } _ { \mathcal { D } ^ { \prime } } [ \mathrm { E L B O } ( x , y ) ] .
|
| 81 |
+
$$
|
| 82 |
+
|
| 83 |
+
Our causally consistent model effectively disentangles the latent representation: $Z$ models the unknown causes in the clean data, such as personal writing style; and $M$ models possible manipulations which the model should be robust to, such as shift, rotation, noise etc. Due to independent mechanism assumptions in causality, the influence of $Y$ , $Z$ and $M$ on $X$ can be independently applied. Thus, with our model design, we can also ensure that the dependencies $Y X$ and $Z \to X$ are not affected by noisy data present during training. As a result, deep CAMA’s can still generalize to unseen manipulations even after seeing lots of noisy datapoints from other manipulations, in contrast to the behavior of discriminative DNNs as shown in Figure 1.
|
| 84 |
+
|
| 85 |
+
Prediction In general the test data $\tilde { \mathcal { D } }$ can be noisy, and we would like our model to be robust to the unseen manipulated test data. Thus, at test-time, $M$ is unknown, and deep CAMA classifies an unseen test data $x ^ { * }$ , using a Monte Carlo approximation to Bayes’ rule with samples $m ^ { u } \sim$ $q _ { \phi _ { 2 } } ( m | x ) , z _ { c } ^ { k } \sim q _ { \phi _ { 1 } } ( z | x ^ { * } , y _ { c } , m ^ { u } )$ :
|
| 86 |
+
|
| 87 |
+
$$
|
| 88 |
+
p ( \boldsymbol { y } ^ { * } | \boldsymbol { x } ^ { * } ) = \frac { p ( \boldsymbol { x } ^ { * } | \boldsymbol { y } ^ { * } ) p ( \boldsymbol { y } ^ { * } ) } { p ( \boldsymbol { x } ^ { * } ) } \approx \mathrm { s o f t m a x } _ { c = 1 } ^ { C } \left[ \log \sum _ { k = 1 } ^ { K } \frac { p _ { \theta } ( \boldsymbol { x } | \boldsymbol { y } , \boldsymbol { z } _ { c } ^ { k } , \boldsymbol { m } ^ { u } ) p ( \boldsymbol { y } _ { c } ) p ( \boldsymbol { z } ) } { q _ { \phi _ { 1 } } ( \boldsymbol { z } _ { c } ^ { k } | \boldsymbol { x } ^ { * } , \boldsymbol { y } _ { c } , \boldsymbol { m } ^ { u } ) } \right] .
|
| 89 |
+
$$
|
| 90 |
+
|
| 91 |
+
In addition, deep CAMA can be adapted to the unseen manipulations present at test time without labels on the noisy data. From the causal graph, the conditional distributions $p ( X | Y )$ and $p ( X | Z )$ are invariant to the interventions on $X$ based on the independent mechanism assumption (Peters et al., 2017), however, we would like to learn the manipulation mechanism $M X$ . As shown in Figure 4, for the generative model, we only fine-tune the networks that are dependent only on $M$ , i.e. $\mathrm { N N } _ { M } ^ { p }$ by maximizing the ELBO of the marginal distribution $\log p ( x )$ :
|
| 92 |
+
|
| 93 |
+
$$
|
| 94 |
+
\mathrm { E L B O } ( x ) : = \log \left[ \sum _ { c = 1 } ^ { C } \exp [ \mathrm { E L B O } ( x , y _ { c } ) ] \right] .
|
| 95 |
+
$$
|
| 96 |
+
|
| 97 |
+
To reduce the possibly negative effect of fine-tuning to model generalization, we use a shallow network for $\mathrm { N N } _ { m e r g e } ^ { p }$ and deep networks for $\mathrm { N N } _ { M } ^ { p }$ , $\bar { \mathsf { N N } } _ { Y } ^ { p }$ and $\mathrm { N N } _ { Z } ^ { p }$ . We also fine-tune the network $\mathrm { N N } _ { M } ^ { q }$ for the approximate posterior $q$ since $M$ is involved in the inference of $Z$ . In sum, in finetuning the selective part of the deep CAMA model is trained to maximize the following objective:1
|
| 98 |
+
|
| 99 |
+
$$
|
| 100 |
+
\begin{array} { r } { \mathcal { L } _ { \mathrm { f t } } ( \theta , \phi ) = \alpha \mathbb { E } _ { \mathcal { D } } [ \mathrm { E L B O } ( x , y ) ] + ( 1 - \alpha ) \mathbb { E } _ { \tilde { \mathcal { D } } } [ \mathrm { E L B O } ( x ) ] . } \end{array}
|
| 101 |
+
$$
|
| 102 |
+
|
| 103 |
+
Notice that there may exist infinitely many manipulations and it is impossible to observe all of them at training time. Therefore by fine-tuning at test-time, the model can be adapted to any unseen manipulation which is desirable in many real-life applications. As shown in our experiments, the proposed deep CAMA model and the training methods are capable of improving the robustness of the generative classifier to unseen manipulations.
|
| 104 |
+
|
| 105 |
+
# 3.2 DEEP CAMA FOR GENERIC MEASUREMENT DATA
|
| 106 |
+
|
| 107 |
+
We now discuss an even more general version of deep CAMA to handle multimodality in measurement data. To predict the target variable $Y$ in a directed acyclic graph, only variables in the Markov blanket of $Y$ (shown in Figure 5) are needed. This includes the parents $( A )$ , children $( X )$ , and co-parents $( C )$ of the target $Y$ . Similar to the single modal case above, here a valid manipulation can only be independent mechanisms applied to $X$ or $C$ to ensure that $Y$ does not change and the relationship from $Y$ to $X$ does not change.
|
| 108 |
+
|
| 109 |
+

|
| 110 |
+
Figure 5: The Markov Blanket of target variable $Y$
|
| 111 |
+
|
| 112 |
+

|
| 113 |
+
Figure 6: Graphical presentation of proposed causal deep generative model for generic measurement modal data.
|
| 114 |
+
|
| 115 |
+
We design the generic deep CAMA (shown in Figure 6) following the causal process in Figure 5. Unlike discriminative DNNs where $A$ , $C$ and $X$ are used together to predict $Y$ directly, we consider the full causal process and treat them separately. Building on the deep CAMA for single modality data, we add the extra consideration of the parent and observed co-parent of $Y$ , while modelling the latent unobserved cause in $Z$ and potential manipulations in $M$ . We do not need to model manipulation on $C$ as they are out of the Markov Blanket of $Y$ . Thus, our model and the approximate inference network are defined as:
|
| 116 |
+
|
| 117 |
+
$$
|
| 118 |
+
p _ { \theta } ( x , y , z , m , a , c ) = p ( a ) p ( m ) p ( z ) p ( c ) p _ { \theta _ { 1 } } ( y | a ) p _ { \theta _ { 2 } } ( x | y , c , z , m ) ,
|
| 119 |
+
$$
|
| 120 |
+
|
| 121 |
+
$$
|
| 122 |
+
q _ { \phi } ( z , m | x , y , a , c ) = q _ { \phi _ { 1 } } ( z | x , y , m , a , c ) q _ { \phi _ { 2 } } ( m | x ) .
|
| 123 |
+
$$
|
| 124 |
+
|
| 125 |
+
Training, fine-tuning and prediction proceed in the same way as in the single modality deep CAMA (Section 3.1) with $d o ( m )$ operations and Monte Carlo approximations. As we only fine-tune the networks that are dependent on $M$ , using similar reasoning one can show that the multimodality deep CAMA is robust to manipulations directly on the effect variable $X$ .
|
| 126 |
+
|
| 127 |
+
Our proposed model is also robust to manipulations on the co-parents $C$ by design. By our definition of valid manipulation, perturbing $C$ is valid as only causes the changes in $X$ . If the underlying causal relationship between $C$ and $X$ remains the same, and the trained model learns $p ( x | y , c )$ perfectly, then our model is perfectly robust to such changes. This is because we use Bayes’ rule for prediction:
|
| 128 |
+
|
| 129 |
+
$$
|
| 130 |
+
p ( y | a , x , c ) = { \frac { p ( y | a ) p ( a ) p ( c ) p ( x | y , c ) } { p ( a ) p ( c ) \int _ { y } p ( y | a ) p ( x | y , c ) } } = { \frac { p ( y | a ) p ( x | y , c ) } { \int _ { y } p ( y | a ) p ( x | y , c ) } } ,
|
| 131 |
+
$$
|
| 132 |
+
|
| 133 |
+
and the manipulations on $C$ (thus changing $X$ ) do not affect the conditional distribution $p ( x | y , c )$ in the generative classifier (Eq. 11). In contrast, discriminative DNNs concatenate $X$ , $C$ , $A$ together and map these variables to $Y$ , therefore they are sensitive to manipulations on $C$ and/or $X$ .
|
| 134 |
+
|
| 135 |
+
# 4 EXPERIMENTS
|
| 136 |
+
|
| 137 |
+
In this section, we first show the robustness of our proposed deep CAMA for image classification using both MNIST and a binary classification task derived from CIFAR-10. Then, we demonstrate the behaviour of our generic deep CAMA for measurement data. We evaluated the perfromance of CAMA on both manipulations such as shifting and adverserial examples generated using the CleverHans package (Papernot et al., 2018). More results with different DNN architectures and different manipulations are shown in the appendix.
|
| 138 |
+
|
| 139 |
+
# 4.1 ROBUSTNESS TEST ON IMAGE CLASSIFICATION WITH DEEP CAMA
|
| 140 |
+
|
| 141 |
+
We first demonstrate the robustness of our model against vertical (VT) and horizontal (HT) shifts. Details such as network architectures are presented in the appendix. The experiments are repeated for 5 times, and on MNIST, the results are stable and the variances are not visible in the plot.
|
| 142 |
+
|
| 143 |
+

|
| 144 |
+
Figure 7: The first row shows the results of testing the model robustness against horizontal shifts and the second row shows the results against vertical shifts.
|
| 145 |
+
|
| 146 |
+

|
| 147 |
+
Figure 8: Performance regarding different percentages of test data used for fine-tuning manipulation
|
| 148 |
+
|
| 149 |
+

|
| 150 |
+
Figure 9: Visualization of the disentangled representation.
|
| 151 |
+
|
| 152 |
+
Training with clean MNIST data only. Figure 7 shows the results for deep CAMA trained on clean data only. Deep CAMA without fine-tuning (orange lines) perform similarly to a DNN (blue lines) on horizontally shifted images, but it is more robust to vertical shifts. The advantage of deep CAMA is clear when fine-tuning is used at test time (green lines): fine-tuning on noisy test data with the same shift clearly improves the robustness of the network (panels 7(b) and 7(d)). We further inspect the generalization of deep CAMA to unseen manipulation after fine-tuning in panels 7(a) and 7(e). The robustness results of fine-tuned models are similar or even slightly better than the models without fine-tuning. This clearly shows that our model is capable of learning manipulations in an unsupervised manner, without deteriorating the generalization ability to unseen manipulations. Lastly, panels 7(c) and 7(f) show the robustness of our model to both shifts when both types of manipulation are used for fine-tuning, and we see clear improvements over both manipulations.
|
| 153 |
+
|
| 154 |
+
Training with augmented MNIST data We explore the setting where the training data is augmented with noisy data. As discussed in Section 3.1, here deep CAMA naturally learns disentangled representation due to its independent mechanism design. Indeed this is confirmed by Figure 9, where panel 9(b) shows the reconstructions of noisy data from panel 9(a) with $d o ( m = 0 )$ . In this case the model keeps the identity of the digits but moves them to the center of the image. Recall that $d o ( m = 0 )$ corresponds to clean data which contains centered digits. This shows that deep CAMA can disentangle the intrinsic unknown style $Z$ and the shifting manipulation variable $M$ .
|
| 155 |
+
|
| 156 |
+
We show the robustness results of deep CAMA with augmented training in Figure 10 (cf. Figure 1). Here shift range 0.5 is used to augment the training data. Take the vertical shift test in panel 10(a) for example. When vertically shifted data are augmented to the training set, the test performance without fine-tuning (green line) is significant better. Further, fine-tuning (brown line) brings in even larger improvement for large scale shifts. On the other hand, when using horizontally shifted data in training, deep CAMA’s robustness on vertically shifted data also improves (red line), which is different from discriminative DNNs overfitting behaviour (Figure 1). Therefore deep CAMA shows significant advantage over discriminative DNNs as its robustness to unseen manipulations can be improved by observing other related manipulations. Our model does not overfit to a specific type of manipulations, at the same time further fine-tuning can always improve the robustness against new manipulations in the test set (pink line). The same conclusion holds in panel 10(b).
|
| 157 |
+
|
| 158 |
+

|
| 159 |
+
|
| 160 |
+

|
| 161 |
+
Figure 10: Performance of our model against different manipulation (c.f. Figure 1).
|
| 162 |
+
Figure 12: Test accuracy on adversarial examples crafted on CIFAR-binary data.
|
| 163 |
+
Figure 13: Test accuracy on adversarial examples crafted on measurement data.
|
| 164 |
+
|
| 165 |
+
We also quantify the amount of noisy data required for fine-tuning in order to improve the robustness of deep CAMA models. As shown in Figure 8, even using $1 \%$ of the noisy data is sufficient to learn the vertical shift manipulation presented in the test set.
|
| 166 |
+
|
| 167 |
+
Adversarial Attack Test on MNIST We further test deep CAMA’s robustness against two adversarial attacks: fast gradient sign method (FGSM) (Goodfellow et al., 2014) and projected gradient descent (PGD) (Madry et al., 2017). Note that, these attacks are specially developed for images with the small perturbation constraint. However, theses attack does not have guarantee to be valid by our definition as the manipulation depends on the class label $Y$ , which has the risk of changing the ground-truth label. Such risk has also been discussed in Elsayed et al. (2018).
|
| 168 |
+
|
| 169 |
+
Figure 11 show the results comparing CAMA and the DNN; both are trained on clean images only. CAMA is significantly more robust to both attacks than DNN (orange line), and with finetuning, CAMA shows additional $2 0 \% - 4 0 \%$ accuracy increase. We also show the clean data test accuracy after
|
| 170 |
+
|
| 171 |
+

|
| 172 |
+
Figure 11: Test accuracy on MNIST adversarial examples.
|
| 173 |
+
|
| 174 |
+
fine-tuning maintains to be the same thanks to our causal consistent model design.
|
| 175 |
+
|
| 176 |
+
Adversarial attack test on natural image classification The last experiment in this section evaluates the adversarial robustness of deep CAMA when trained on natural images. In this case we follow Li et al. (2018) and consider CIFAR-binary, a binary classification dataset containing airplane and frog images from CIFAR-10. We choose to work with CIFAR-binary because VAE-based fully generative classifiers are less satisfactory for classifying clean CIFAR-10 images $\mathit { \Theta } _ { \mathrm { ~ < ~ } 5 0 \% }$ clean test accuracy). The deep CAMA model trained with data augmentation (adding Gaussian noise with standard deviation 0.1, see objective (5)) achieves $8 8 . 8 5 \%$ clean test accuracy on CIFAR-binary, which is on par with the results reported in Li et al. (2018). For reference, a discriminative CNN with $2 \times$ more channels achieves $9 \bar { 5 } . 6 0 \%$ clean test accuracy. Similar to previous sections we apply FGSM and PGD attacks with different $\epsilon$ values to both deep CAMA and the discriminative CNN, and evaluate classification accuracies on the adversarial examples before and after finetuning.
|
| 177 |
+
|
| 178 |
+

|
| 179 |
+
Figure 14: Manipulate co-parents
|
| 180 |
+
|
| 181 |
+

|
| 182 |
+
Figure 15: Manipulate children
|
| 183 |
+
|
| 184 |
+
Results are reported in Figure 12. For both FGSM and PGD tests, we see that deep CAMA, before finetuning, is significantly more robust to adversarial attacks when compared with a discriminative CNN model. Regarding finetuning, although PGD with large distortion $\epsilon = 0 . 2 $ ) also fools the finetuning mechanism, in other cases finetuning still provides modest improvements $( 5 \%$ to $8 \%$ when compared with the vanilla deep CAMA model) without deteriorating test accuracy on clean data. Combined with adversarial robustness results on MNIST, we conjecture that with a better generative model on natural images the robustness of deep CAMA can be further improved.
|
| 185 |
+
|
| 186 |
+
# 4.2 ROBUSTNESS TEST ON MEASUREMENT BASED DATA WITH GENERALIZED DEEP CAMA
|
| 187 |
+
|
| 188 |
+
Our causal view on valid manipulations allows us to test the robustness of models to generic measurement data. Unfortunately, there exists no public dataset with multiple variables where ground truth causal relationships are known. Therefore we generate synthetic data (see appendix) following a causal process, and test the performance of the generic deep CAMA on this measurement based data. Here we use Gaussian variables for $A$ , $C$ and $X$ , and categorical variables for $Y$ . All the ground truth causal relationships are nonlinear (quadratic mainly).
|
| 189 |
+
|
| 190 |
+
Manipulation Test First, we test manipulations on co-parents, $C$ , while keeping the ground truth causal influence from $C$ to $X$ static. Thus, both $C$ and $X$ change. We manipulate $C$ by shifting it up or down, which is a reasonable analogy to the noisiness in measurement data. For example, in medical measurement data, different doctors may have different subjective standards while examining the patients, thus the same measurement can be shifted up or down. Figure 14 shows the result: compared to a discriminatively trained DNN, deep CAMA is significantly more robust to a wide range of manipulations. However, when the range of the shifting manipulations increases, the classification accuracy of the discriminative DNN drops drastically. This confirms our theory in Section 3.2 that manipulations in $C$ do not affect the decision making of deep CAMA, therefore our model is more robust to manipulation on co-parents as compared to discriminative DNNs.
|
| 191 |
+
|
| 192 |
+
Figure 15 shows the performance of the generic deep CAMA when the children $X$ are manipulated, and the model only sees clean data at training time. While deep CAMA achieves the same accuracy as a discriminative DNN on clean data, it is again significantly more robust to manipulations even without fine-tuning (the orange line vs the blue line). With fine-tuning (green line), the robustness of deep CAMA is further improved, especially when the amount of distortion is large. The red line shows that deep CAMA’s test accuracy on clean data, which does not drop after fine-tuning on different shifts. This further confirms that during test time, fine-tuning learns the influence of $M$ without affecting the causal relationships between $Y$ and $Z$ .
|
| 193 |
+
|
| 194 |
+
Adversarial Attack Test Lastly we evaluate the adversarial robustness of the generalized CAMA model. We only allow attacks on the children $X$ and coparents $C$ to be consistent with our definition of valid attacks. This applies to both DNN and CAMA. Figure 13 shows the results in terms of test accuracy with adversarial examples generated using FGSM and PGD attack methods. Again deep CAMA demonstrate significantly improved robustness against adversarial attacks, and fine-tuning further provides improvements on robustness while keeping high accuracy on clean test examples.
|
| 195 |
+
|
| 196 |
+
# 5 RELATED WORK
|
| 197 |
+
|
| 198 |
+
Adversarial robustness Adversarial attacks can easily fool a discriminative DNN for vision/speech/language modelling tasks by adding imperceptible perturbations (Carlini & Wagner, 2018; Alzantot et al., 2018; Carlini & Wagner, 2017b; Szegedy et al., 2013; Papernot et al., 2017). Adversarial training (Madry et al., 2017; Tramer et al., 2018) has shown some success in defending \` attacks, however, these techniques assume the knowledge of the adversary and present the perturbation to the model during training. Still, a discriminative model after adversarial training is vulnerable to unseen manipulations. Deep generative modelling has recently been applied as a defence mechanism to adversarial attacks. Specifically, existing work considered de-noising adversarial examples before feeding these inputs to the discriminative classifier (Song et al., 2018; Samangouei et al., 2018). Very recently, research revisited (deep) generative classifiers and provided evidence that they are more robust to adversarial attacks (Li et al., 2018; Schott et al., 2019; Lee et al., 2018).
|
| 199 |
+
|
| 200 |
+
Causal learning Causal inference has a long history in statistical research (Spirtes et al., 2000; Pearl, 2009; Peters et al., 2017; Pearl & Mackenzie, 2018). Although it has fundamental importance, the causal view has not been widely incorporated to the robustness analysis of neural networks on unseen manipulations. The most relevant work is in applying the existing causal views to transfer learning and domain adaption (Zhang et al., 2013; Stojanov et al., 2019; Zhao et al., 2019; Gong et al., 2016), where the difference in various domains are treated as either target shift or conditional shift from a causal perspective. As an extension to the domain adaptation work, Rothenhausler ¨ et al. (2018); Heinze-Deml & Meinshausen (2017); Arjovsky et al. (2019) also discussed learning robust predictors across different domains. However, in these approaches the domain is specified either explicitly or though exemplar paired points, thus an unseen manipulation is not explicitly considered. By contrast, our proposed method does not rely on any given domain information. Another related area is causal feature selection (Aliferis et al., 2010), where causal discovery is applied first and features in the Markov Blanket of the prediction target are selected. We also note that CAMA’s design is aligned with causal and anti-causal learning analyses (Scholkopf et al., 2012; ¨ Kilbertus et al., 2018), in that CAMA models the causal mechanism $Y X$ and use Bayes’ rule for anti-causal prediction. Different from Scholkopf et al. (2012), CAMA is not limited to only two ¨ endogenous variables; rather it provides more generic design handling latent causes that correspond to both intrinsic variations and data manipulations.
|
| 201 |
+
|
| 202 |
+
Disentangled representations Learning disentangled representations has become a hot topic of research in recent deep generative modelling literature. A considerable amount of effort went to developing training objectives for variational auto-encoders, e.g. $\beta$ -VAE (Higgins et al., 2017) and other information theoretic approaches (Kim & Mnih, 2018; Chen et al., 2018). Additionally, different factorization structure in graphical model design has also been explored for disentanglement (Narayanaswamy et al., 2017; Li & Mandt, 2018).
|
| 203 |
+
|
| 204 |
+
# 6 DISCUSSION
|
| 205 |
+
|
| 206 |
+
We have provided a causal view on the robustness of neural networks, showing that the vulnerability of discriminative DNNs is due to the lack of causal reasoning. We defined valid manipulations under this causal view, which are the manipulations on the children and/or the co-parents of the target variables, independent of the target and/or the cause of the target. We further proposed a deep causal manipulation augmented model (deep CAMA), which follows the causal relationship in the model design, and can be adapted to unseen manipulations at test time. Our model has demonstrated improved robustness, even without adversarial training. When manipulated data are available, our model’s robustness increases for both seen and unseen manipulation.
|
| 207 |
+
|
| 208 |
+
Our framework is generic, however, manipulations can change over time, and a robust model should adapt to these perturbations in a continuous manner. Our framework thus should be adapted to online learning or continual learning settings. In future work, we will explore the continual learning setting of deep CAMA where new manipulations come in a sequence. In addition, our method is designed for generic class-independent manipulations, therefore a natual extension would consider class-dependent manipulations where $M$ is an effect of $Y$ . Lastly out design excludes gradient-based adversarial attacks which is dependent on both the target and the victim model. As such attacks are commonly adopted in machine learning, we would also like to extend our model to such scenarios.
|
| 209 |
+
|
| 210 |
+
# REFERENCES
|
| 211 |
+
|
| 212 |
+
Constantin F Aliferis, Alexander Statnikov, Ioannis Tsamardinos, Subramani Mani, and Xenofon D Koutsoukos. Local causal and markov blanket induction for causal discovery and feature selection for classification part i: Algorithms and empirical evaluation. Journal of Machine Learning Research, 11(Jan):171–234, 2010.
|
| 213 |
+
|
| 214 |
+
Moustafa Alzantot, Yash Sharma, Ahmed Elgohary, Bo-Jhang Ho, Mani Srivastava, and Kai-Wei Chang. Generating natural language adversarial examples. arXiv preprint arXiv:1804.07998, 2018.
|
| 215 |
+
|
| 216 |
+
Martin Arjovsky, Leon Bottou, Ishaan Gulrajani, and David Lopez-Paz. Invariant risk minimization. ´ arXiv preprint arXiv:1907.02893, 2019.
|
| 217 |
+
|
| 218 |
+
Anish Athalye, Nicholas Carlini, and David Wagner. Obfuscated gradients give a false sense of security: Circumventing defenses to adversarial examples. In International Conference on Machine Learning, pp. 274–283, 2018.
|
| 219 |
+
|
| 220 |
+
Nicholas Carlini and David Wagner. Towards evaluating the robustness of neural networks. In Security and Privacy (SP), 2017 IEEE Symposium on, pp. 39–57. IEEE, 2017a.
|
| 221 |
+
|
| 222 |
+
Nicholas Carlini and David Wagner. Adversarial examples are not easily detected: Bypassing ten detection methods. In Proceedings of the 10th ACM Workshop on Artificial Intelligence and Security, pp. 3–14. ACM, 2017b.
|
| 223 |
+
|
| 224 |
+
Nicholas Carlini and David Wagner. Audio adversarial examples: Targeted attacks on speech-totext. arXiv preprint arXiv:1801.01944, 2018.
|
| 225 |
+
|
| 226 |
+
Tian Qi Chen, Xuechen Li, Roger B Grosse, and David K Duvenaud. Isolating sources of disentanglement in variational autoencoders. In Advances in Neural Information Processing Systems, pp. 2610–2620, 2018.
|
| 227 |
+
|
| 228 |
+
Gamaleldin F Elsayed, Shreya Shankar, Brian Cheung, Nicolas Papernot, Alex Kurakin, Ian Goodfellow, and Jascha Sohl-Dickstein. Adversarial examples that fool both human and computer vision. arXiv preprint arXiv:1802.08195, 10, 2018.
|
| 229 |
+
|
| 230 |
+
Logan Engstrom, Brandon Tran, Dimitris Tsipras, Ludwig Schmidt, and Aleksander Madry. Exploring the landscape of spatial robustness. In International Conference on Machine Learning, pp. 1802–1811, 2019.
|
| 231 |
+
|
| 232 |
+
William T Freeman. The generic viewpoint assumption in a framework for visual perception. Nature, 368(6471):542, 1994.
|
| 233 |
+
|
| 234 |
+
Mingming Gong, Kun Zhang, Tongliang Liu, Dacheng Tao, Clark Glymour, and Bernhard Scholkopf. Domain adaptation with conditional transferable components. In ¨ International conference on machine learning, pp. 2839–2848, 2016.
|
| 235 |
+
|
| 236 |
+
Ian J Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. arXiv preprint arXiv:1412.6572, 2014.
|
| 237 |
+
|
| 238 |
+
Ian J Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. In International Conference on Learning Representations, 2015.
|
| 239 |
+
|
| 240 |
+
Alison Gopnik, Clark Glymour, David M Sobel, Laura E Schulz, Tamar Kushnir, and David Danks. A theory of causal learning in children: causal maps and bayes nets. Psychological review, 111 (1):3, 2004.
|
| 241 |
+
|
| 242 |
+
Christina Heinze-Deml and Nicolai Meinshausen. Conditional variance penalties and domain shift robustness. arXiv preprint arXiv:1710.11469, 2017.
|
| 243 |
+
|
| 244 |
+
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, volume 3, 2017.
|
| 245 |
+
|
| 246 |
+
Niki Kilbertus, Giambattista Parascandolo, and Bernhard Scholkopf. Generalization in anti-causal ¨ learning. arXiv preprint arXiv:1812.00524, 2018.
|
| 247 |
+
|
| 248 |
+
Hyunjik Kim and Andriy Mnih. Disentangling by factorising. In International Conference on Machine Learning, pp. 2654–2663, 2018.
|
| 249 |
+
|
| 250 |
+
Diederik $\mathrm { \bf P }$ Kingma and Max Welling. Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114, 2013.
|
| 251 |
+
|
| 252 |
+
Alexey Kurakin, Ian Goodfellow, and Samy Bengio. Adversarial examples in the physical world. arXiv preprint arXiv:1607.02533, 2016.
|
| 253 |
+
|
| 254 |
+
Kimin Lee, Kibok Lee, Honglak Lee, and Jinwoo Shin. A simple unified framework for detecting out-of-distribution samples and adversarial attacks. In Advances in Neural Information Processing Systems, pp. 7167–7177, 2018.
|
| 255 |
+
|
| 256 |
+
Yingzhen Li and Stephan Mandt. Disentangled sequential autoencoder. In International Conference on Machine Learning, pp. 5656–5665, 2018.
|
| 257 |
+
|
| 258 |
+
Yingzhen Li, John Bradshaw, and Yash Sharma. Are generative classifiers more robust to adversarial attacks? arXiv preprint arXiv:1802.06552, 2018.
|
| 259 |
+
|
| 260 |
+
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.
|
| 261 |
+
|
| 262 |
+
Siddharth Narayanaswamy, T Brooks Paige, Jan-Willem Van de Meent, Alban Desmaison, Noah Goodman, Pushmeet Kohli, Frank Wood, and Philip Torr. Learning disentangled representations with semi-supervised deep generative models. In Advances in Neural Information Processing Systems, pp. 5925–5935, 2017.
|
| 263 |
+
|
| 264 |
+
Nicolas Papernot, Patrick McDaniel, Ian Goodfellow, Somesh Jha, Z Berkay Celik, and Ananthram Swami. Practical black-box attacks against machine learning. In Proceedings of the 2017 ACM on Asia Conference on Computer and Communications Security, pp. 506–519. ACM, 2017.
|
| 265 |
+
|
| 266 |
+
Nicolas Papernot, Fartash Faghri, Nicholas Carlini, Ian Goodfellow, Reuben Feinman, Alexey Kurakin, Cihang Xie, Yash Sharma, Tom Brown, Aurko Roy, Alexander Matyasko, Vahid Behzadan, Karen Hambardzumyan, Zhishuai Zhang, Yi-Lin Juang, Zhi Li, Ryan Sheatsley, Abhibhav Garg, Jonathan Uesato, Willi Gierke, Yinpeng Dong, David Berthelot, Paul Hendricks, Jonas Rauber, and Rujun Long. Technical report on the cleverhans v2.1.0 adversarial examples library. arXiv preprint arXiv:1610.00768, 2018.
|
| 267 |
+
|
| 268 |
+
Giambattista Parascandolo, Niki Kilbertus, Mateo Rojas-Carulla, and Bernhard Scholkopf. Learning ¨ independent causal mechanisms. arXiv preprint arXiv:1712.00961, 2017.
|
| 269 |
+
|
| 270 |
+
Judea Pearl. Causality. Cambridge university press, 2009.
|
| 271 |
+
|
| 272 |
+
Judea Pearl and Dana Mackenzie. The book of why: the new science of cause and effect. Basic Books, 2018.
|
| 273 |
+
|
| 274 |
+
Luis Perez and Jason Wang. The effectiveness of data augmentation in image classification using deep learning. arXiv preprint arXiv:1712.04621, 2017.
|
| 275 |
+
|
| 276 |
+
Jonas Peters, Dominik Janzing, and Bernhard Scholkopf. ¨ Elements of causal inference: foundations and learning algorithms. MIT press, 2017.
|
| 277 |
+
|
| 278 |
+
Danilo Jimenez Rezende, Shakir Mohamed, and Daan Wierstra. Stochastic backpropagation and approximate inference in deep generative models. arXiv preprint arXiv:1401.4082, 2014.
|
| 279 |
+
|
| 280 |
+
Dominik Rothenhausler, Nicolai Meinshausen, Peter B ¨ uhlmann, and Jonas Peters. Anchor regres- ¨ sion: heterogeneous data meets causality. arXiv preprint arXiv:1801.06229, 2018.
|
| 281 |
+
|
| 282 |
+
Pouya Samangouei, Maya Kabkab, and Rama Chellappa. Defense-GAN: Protecting classifiers against adversarial attacks using generative models. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ BkJ3ibb0-.
|
| 283 |
+
|
| 284 |
+
Bernhard Scholkopf, Dominik Janzing, Jonas Peters, Eleni Sgouritsa, Kun Zhang, and Joris Mooij. ¨ On causal and anticausal learning. arXiv preprint arXiv:1206.6471, 2012.
|
| 285 |
+
|
| 286 |
+
Lukas Schott, Jonas Rauber, Matthias Bethge, and Wieland Brendel. Towards the first adversarially robust neural network model on MNIST. In International Conference on Learning Representations, 2019. URL https://openreview.net/forum?id $=$ S1EHOsC9tX.
|
| 287 |
+
|
| 288 |
+
Yang Song, Taesup Kim, Sebastian Nowozin, Stefano Ermon, and Nate Kushman. Pixeldefend: Leveraging generative models to understand and defend against adversarial examples. International Conference on Learning Representations, 2018. URL https://openreview.net/ forum?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ rJUYGxbCW.
|
| 289 |
+
|
| 290 |
+
Peter Spirtes, Clark N Glymour, Richard Scheines, David Heckerman, Christopher Meek, Gregory Cooper, and Thomas Richardson. Causation, prediction, and search. MIT press, 2000.
|
| 291 |
+
|
| 292 |
+
Petar Stojanov, Mingming Gong, Jaime Carbonell, and Kun Zhang. Data-driven approach to multiple-source domain adaptation. In The 22nd International Conference on Artificial Intelligence and Statistics, pp. 3487–3496, 2019.
|
| 293 |
+
|
| 294 |
+
Christian Szegedy, Wojciech Zaremba, Ilya Sutskever, Joan Bruna, Dumitru Erhan, Ian Goodfellow, and Rob Fergus. Intriguing properties of neural networks. arXiv preprint arXiv:1312.6199, 2013.
|
| 295 |
+
|
| 296 |
+
Florian Tramer, Alexey Kurakin, Nicolas Papernot, Ian Goodfellow, Dan Boneh, and Patrick \` McDaniel. Ensemble adversarial training: Attacks and defenses. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum?id $=$ rkZvSe-RZ.
|
| 297 |
+
|
| 298 |
+
Cheng Zhang, Judith Butepage, Hedvig Kjellstrom, and Stephan Mandt. Advances in variational inference. IEEE transactions on pattern analysis and machine intelligence, 2018.
|
| 299 |
+
|
| 300 |
+
Kun Zhang, Bernhard Scholkopf, Krikamol Muandet, and Zhikun Wang. Domain adaptation under ¨ target and conditional shift. In International Conference on Machine Learning, pp. 819–827, 2013.
|
| 301 |
+
|
| 302 |
+
Han Zhao, Remi Tachet des Combes, Kun Zhang, and Geoffrey J Gordon. On learning invariant representation for domain adaptation. arXiv preprint arXiv:1901.09453, 2019.
|
| 303 |
+
|
| 304 |
+
# A DERIVATION DETAILS
|
| 305 |
+
|
| 306 |
+
# A.1 THE INTERVENTION ELBO
|
| 307 |
+
|
| 308 |
+
When training with clean data $\mathcal { D } = \{ ( x _ { n } , y _ { n } ) \}$ , we set the manipulation variable $M$ to a null value, e.g. $d o ( m = 0 )$ . In this case we would like to maximise the log-likelihood of the intervened model, i.e.
|
| 309 |
+
|
| 310 |
+
$$
|
| 311 |
+
\operatorname* { m a x } _ { \theta } \mathbb { E } _ { \mathcal { D } } [ \log p _ { \theta } ( x , y | d o ( m = 0 ) ) ] .
|
| 312 |
+
$$
|
| 313 |
+
|
| 314 |
+
This log-likelihood of the intervened model is defined by integrating out the unobserved latent variable $Z$ in the intervened joint distribution, and from do-calculus we have
|
| 315 |
+
|
| 316 |
+
$$
|
| 317 |
+
\begin{array} { c } { { \log p _ { \theta } ( x , y | d o ( m = 0 ) ) = \log \displaystyle \int p _ { \theta } ( x , y , z | d o ( m = 0 ) ) d z } } \\ { { = \log \displaystyle \int p _ { \theta } ( x | y , z , m = 0 ) p ( y ) p ( z ) d z . } } \end{array}
|
| 318 |
+
$$
|
| 319 |
+
|
| 320 |
+
A variational lower-bound (or ELBO) of the log-likelihood uses a variational distribution $q ( z | \cdot )$
|
| 321 |
+
|
| 322 |
+
$$
|
| 323 |
+
\begin{array} { r l r } & { } & { \log p _ { \theta } ( x , y | d o ( m = 0 ) ) = \log \int p _ { \theta } ( x | y , z , m = 0 ) p ( y ) p ( z ) \frac { q ( z | \cdot ) } { q ( z | \cdot ) } d z } \\ & { } & { \geq \mathbb { E } _ { q ( z | \cdot ) } \left[ \log \frac { p _ { \theta } ( x | y , z , m = 0 ) p ( y ) p ( z ) } { q ( z | \cdot ) } \right] . } \end{array}
|
| 324 |
+
$$
|
| 325 |
+
|
| 326 |
+
The lower-bound holds for arbitrary $q ( z | \cdot )$ as long as it is absolutely continuous w.r.t. the posterior distribution $p _ { \theta } ( z | x , y , d o ( m = 0 ) )$ of the intervened model. Now recall the design of the inference network/variational distribution in the main text:
|
| 327 |
+
|
| 328 |
+
$$
|
| 329 |
+
q _ { \phi } ( z , m | x , y ) = q _ { \phi _ { 1 } } ( z | x , y , m ) q _ { \phi _ { 2 } } ( m | x ) ,
|
| 330 |
+
$$
|
| 331 |
+
|
| 332 |
+
where $\phi _ { 1 }$ and $\phi _ { 2 }$ are the inference network parameters of the corresponding variational distributions. Performing an intervention $d o ( m = 0 )$ on this $q$ distribution gives
|
| 333 |
+
|
| 334 |
+
$$
|
| 335 |
+
q _ { \phi } ( z | x , y , d o ( m = 0 ) ) = q _ { \phi _ { 1 } } ( z | x , y , m = 0 ) .
|
| 336 |
+
$$
|
| 337 |
+
|
| 338 |
+
Defining $q ( z | \cdot ) = q _ { \phi _ { 1 } } ( z | x , y , d o ( m = 0 ) )$ and plugging-in it to eq. (13) return the intervention ELBO objective (3) presented in the main text.
|
| 339 |
+
|
| 340 |
+
# A.2 THE ELBO FOR UNLABELLED TEST DATA
|
| 341 |
+
|
| 342 |
+
The proposed fine-tuning method in the main text require optimising the marginal log-likelihood $\log p _ { \theta } ( x )$ for $x \sim \tilde { \mathcal { D } }$ , which is clearly intractable. Instead of using a variational distribution for the unobserved class label $Y$ , we consider the variational lower-bound of $\log p _ { \theta } ( x , y )$ for all possible $y = y _ { c }$ :
|
| 343 |
+
|
| 344 |
+
$$
|
| 345 |
+
\begin{array} { l } { \displaystyle \log p _ { \theta } ( x , y ) = \log \int p _ { \theta } ( x , y , z , m ) d z d m } \\ { \displaystyle = \log \int p _ { \theta } ( x , y , z , m ) \frac { q _ { \phi } ( z , m | x , y ) } { q _ { \phi } ( z , m | x , y ) } d z d m } \\ { \displaystyle \geq \mathbb { E } _ { q _ { \phi } ( z , m | x , y ) } \left[ \log \frac { p _ { \theta } ( x , y , z , m ) } { q _ { \phi } ( z , m | x , y ) } \right] : = \mathrm { E L B O } ( x , y ) . } \end{array}
|
| 346 |
+
$$
|
| 347 |
+
|
| 348 |
+
Since both logarithm and exponent functions preserve monotonicity, and for all $y _ { c } , c = 1 , . . . , C$ we have $\log p _ { \theta } ( \bar { x _ { \cdot } } y _ { c } ) \geq \mathrm { E L B O } ( x , y _ { c } )$ , we have
|
| 349 |
+
|
| 350 |
+
$$
|
| 351 |
+
\begin{array} { r } { \log p _ { \theta } ( x , y _ { c } ) \geq \mathrm { E L B O } ( x , y _ { c } ) , \forall c \implies p _ { \theta } ( x , y _ { c } ) \geq \exp [ \mathrm { E L B O } ( x , y _ { c } ) ] , \forall c } \end{array}
|
| 352 |
+
$$
|
| 353 |
+
|
| 354 |
+
$$
|
| 355 |
+
\Rightarrow \log p ( x ) = \log \left[ \sum _ { c = 1 } ^ { C } p _ { \theta } ( x , y _ { c } ) \right] \geq \log \left[ \sum _ { c = 1 } ^ { C } \exp [ \mathrm { E L B O } ( x , y _ { c } ) ] \right] : = \mathrm { E L B O } ( x ) ,
|
| 356 |
+
$$
|
| 357 |
+
|
| 358 |
+
which justifies the ELBO objective (7) defined in the main text.
|
| 359 |
+
|
| 360 |
+
# B ADDITIONAL RESULTS
|
| 361 |
+
|
| 362 |
+
CNN We also performed experiments using different DNN network architectures. The convolution layers in CNN are designed to be robust to shifts. Thus, we test these vertical and horizontal shifts with a standard CNN architecture as used in https://keras.io/examples/ cifar10_cnn/. 4 convolution layers are used in this architecture.
|
| 363 |
+
|
| 364 |
+
Figure 16 shows the performance against different shifts. We see that adding vertical shifts to the training data clearly harmed the robustness performances to unseen horizontal shifts as shown in 17(b). Adding horizontal shifted images in training did not influences the performance on vertical shifts much. Thus, we see that using different architectures of DNN, even the one that are designed to be robust to these manipulations, lack of generalization ability to unseen data is a common problem.
|
| 365 |
+
|
| 366 |
+

|
| 367 |
+
Figure 16: Robustness results for DNNs against different manipulations on MNIST using CNN. Panels (a) and (b) show the accuracy on classifying noisy test data generated by shifting the digits vertically (vt) and horizontally (ht). It shows that data augmentation during training makes generalization to unseen shifts worse (orange versus blue lines).
|
| 368 |
+
|
| 369 |
+

|
| 370 |
+
Figure 17: Robustness results for DNNs against different manipulations on MNIST using a large MLP. Panels (a) and (b) show the accuracy on classifying noisy test data generated by shifting the digits vertically (vt) and horizontally (ht). It shows that data augmentation during training makes generalization to unseen shifts worse (orange versus blue lines).
|
| 371 |
+
|
| 372 |
+
Enlarge Network Size Here we exam whether network capacity has any influence on the robustness performance to unseen manipulation. We use a wider network with [1024, 512, 512, 1024] units in each hidden layer instead of [512, 256, 126, 512] sized network in the paper. Figure 17 shows the robustness performance using this enlarged network. We observe the similar degree of over-fitting to the augmented data. The penalization ability shows no improvement by enlarging the network sizes.
|
| 373 |
+
|
| 374 |
+
ZCA Whitening Manipulation Our result does not limited to shifts, it generalizes to other manipulations. Figure 18 compare the result from training with clean images and training with ZCA whitening images added. We see that adding ZCA whitening images in training harm both robustness against vertical shift and horizontal shift.
|
| 375 |
+
|
| 376 |
+

|
| 377 |
+
Figure 18: ZCA Whitening manipulation result. Figure shows the robustness results for DNNs against different manipulations on MNIST using CNN. The blue curve shows that result from training with clean data. The orange curve shows that result from training with zca whitening data added.
|
| 378 |
+
|
| 379 |
+

|
| 380 |
+
Figure 19: Performance regarding different percentage of test data used for fine-tuning manipulation of horizontal shift without using $\bar { d o } ( m ) = 0$ for the cleaning training data during fine-tuning.
|
| 381 |
+
|
| 382 |
+

|
| 383 |
+
Figure 20: Performance regarding different percentage of test data used for fine-tuning manipulation of vertical shift using $d o ( m ) =$ 0 for the cleaning training data during finetuning.
|
| 384 |
+
|
| 385 |
+
Additional Figures In addition to Figure 8, We also show the result testing with Vertical shift show in Figure 19, where a smaller $N _ { M } ^ { \breve { p } }$ network ([dimM, 500, 500]) is used. The conclusion is the same was using the vertical shift. We need very few data for fine-tune. More than $1 \%$ data is sufficient.
|
| 386 |
+
|
| 387 |
+
Similar as Figure 8, we show the result using different percentage of data for fine-tuning in this experiment setting in 20.
|
| 388 |
+
|
| 389 |
+
# C EXPERIMENTAL SETTINGS
|
| 390 |
+
|
| 391 |
+
# Network architecture
|
| 392 |
+
|
| 393 |
+
• MNIST experiments:
|
| 394 |
+
|
| 395 |
+
– Discriminative DNN: The discriminate model used in the paper contains 4 densely connected hidden layer of [512, 256, 126, 512] width for each layer. ReLU activations and dropout are used with dropout rate $[ 0 . 2 5 , 0 . 2 5 , 0 . 2 5 , 0 . 5 ]$ for each layer.
|
| 396 |
+
|
| 397 |
+
– Deep CAMA’s $p$ networks: we use $\dim ( Y ) = 1 0$ , $\dim ( Z ) = 6 4$ and $\mathrm { d i m } ( M ) = 3 2 $ . $\mathrm { N N } _ { Y } ^ { \tilde { p } }$ : an MLP of layer sizes $[ \mathrm { d i m } ( Y ) , 5 0 0 , 5 0 0 ]$ and ReLU activations. YNN pZ : an MLP of layer sizes $[ \mathrm { d i m } ( Z ) , 5 0 0 , 5 0 0 ]$ and ReLU activations. $\mathrm { N N } _ { M } ^ { \widetilde { p } }$ : an MLP of layer sizes $[ \mathrm { d i m } ( M ) , 5 0 0 , 5 0 0 , 5 0 0 , 5 0 0 ]$ and ReLU activations. $\mathrm { N N } _ { \mathrm { m e r g e } } ^ { p }$ : an projection layer ws to a 3D tensor of shape ects the feature outputs from the previous, followed by 3 deconvolutional layers with $( 4 , 4 , 6 4 )$ stride 2, SAME padding, filter size $( 3 , 3 , 6 4 , 6 4 )$ except for the last layer $( 3 , 3 , 6 4 , 1 )$ .
|
| 398 |
+
|
| 399 |
+
All the layers use ReLU activations except for the last layer, which uses sigmoid activation.
|
| 400 |
+
|
| 401 |
+
– Deep CAMA’s $q$ networks:
|
| 402 |
+
|
| 403 |
+
$\mathrm { N N } _ { M } ^ { \bar { q } }$ : it starts from a convolutional neural network (CNN) with 3 blocks of $\mathrm { \{ c o n v 3 \times } $ $3 , \mathrm { m a x - p o o l } \}$ layers with output channel size 64, stride 1 and SAME padding, then performs a reshape-to-vector operation and transforms this vector with an MLP of layer sizes $[ 4 \times 4 \times 6 4 , 5 0 0 , \mathrm { d i m } ( M ) \times 2 ]$ to generate the mean and log-variance of $q ( m | x )$ . All the layers use ReLU activation except for the last layer, which uses linear activation.
|
| 404 |
+
|
| 405 |
+
$\mathrm { N N } _ { Z } ^ { q }$ : first it uses a CNN with similar architecture as $\mathrm { N N } _ { q } ^ { M }$ ’s CNN (except that the filter size is 5) to process $x$ . Then after the reshape-to-vector operation, the vector first gets transformed by an MLP of size $[ 4 \times 4 \times 6 4$ , 500], then it gets combined with $y$ and $m$ and passed through another MLP of size $[ 5 0 0 + \mathrm { d i m } ( Y ) + \mathrm { d i m } ( M ) , 5 0 0 , \mathrm { d i m } ( Z ) \times 2 ]$ to obtain the mean and log-variance of $q ( z | x , y , m )$ . All the layers use ReLU activation except for the last layer, which uses linear activation.
|
| 406 |
+
|
| 407 |
+
• Measurement data experiments:
|
| 408 |
+
|
| 409 |
+
– Discriminative DNN: The $A , C , X$ variables are concatenated to an input vector of total dimension 20. Then the DNN contains 3 densely connected hidden layer of [64, 16, 32] width for each layer, and output $Y$ . ReLU activations and dropout are used with dropout rate [0.25, 0.25, 0.5] for each layer.
|
| 410 |
+
|
| 411 |
+
– Deep CAMA’s $p$ networks: we use $\mathrm { d i m } ( Y ) ~ = ~ 5 , \mathrm { d i m } ( A ) ~ = ~ 5 , \mathrm { d i m } ( C ) ~ = ~$ 5 $, \dot { \dim } ( Z ) = 6 4$ and $\mathrm { d i m } ( M ) = 3 2 $ .
|
| 412 |
+
|
| 413 |
+
$p ( y | a )$ : an MLP of layer sizes $[ \dim ( A ) , 5 0 0 , 5 0 0 , \dim ( Y ) ]$ , ReLU activations except for the last layer (softmax).
|
| 414 |
+
|
| 415 |
+
$p ( x | y , c , z , m )$ contains 5 networks: 4 networks $\left\{ { \bf N N } _ { Y } ^ { p } , { \bf N N } _ { C } ^ { p } , { \bf N N } _ { Z } ^ { p } , { \bf N N } _ { M } ^ { p } \right\}$ to process each of the parents of $X$ , followed by a merging network.
|
| 416 |
+
|
| 417 |
+
$\mathrm { N N } _ { \mathrm { m e r g e } } ^ { p }$ : it first start from a concatenation of the feature outputs from the aboverks, then transforms the concatenated vector with an MLP of layer sizes $[ 5 0 0 \times 4 , 5 0 0 , \mathrm { d i m } ( X ) ]$ to output the mean of $x$ . All the layers use ReLU activations except for the last layer, which uses linear activation.
|
| 418 |
+
|
| 419 |
+
– Deep CAMA’s $q$ networks:
|
| 420 |
+
|
| 421 |
+
$q ( m | x )$ : it uses an MLP of layer sizes $[ \dim ( X ) , 5 0 0 , 5 0 0 , \dim ( M ) \times 2 ]$ to obtain the mean and log-variance. All the layers use ReLU activations except for the last layer, which uses linear activation.
|
| 422 |
+
|
| 423 |
+
$q ( z | x , y , m , a , c )$ : it first concatenates $x , y , m , a , c$ into a vecto, then uses an MLP of layer sizes $[ \dim ( X ) + \dim ( Y ) + \dim ( M ) + \dim ( A ) + \dim ( C )$ , 500, 500, dim(Z) × 2] to transform this vector into the mean and log-variance of $q ( z | x , y , m , a , c )$ . All the layers use ReLU activations except for the last layer, which uses linear activation.
|
| 424 |
+
|
| 425 |
+
• CIFAR-binary experiments:
|
| 426 |
+
|
| 427 |
+
– Discriminative CNN: The discriminate model used in the paper is a CNN with 3 convolutional layers of filter width 3 and channel sizes [128, 128, 128], followed by a flattening operation and a 2-hidden layer MLP of size $[ 4 \times 4 \times 1 2 8 , 1 0 0 0 , 1 0 0 0 , 1 0 ] .$ It uses ReLU activations and max pooling for the convolutional layers.
|
| 428 |
+
|
| 429 |
+
Deep CAMA’s $p$ networks: we use $\dim ( Y ) = 1 0$ , $\mathrm { d i m } ( Z ) = 1 2 8$ and $\dim ( M ) = 6 4$ .
|
| 430 |
+
$\mathrm { N N } _ { Y } ^ { \tilde { p } }$ : an MLP of layer sizes $[ \mathrm { d i m } ( Y )$ , 1000, 1000] and ReLU activations.
|
| 431 |
+
$\mathrm { N N } _ { \boldsymbol { z } } ^ { \hat { p } }$ : an MLP of layer sizes $[ \dim ( Z ) , 1 0 0 0 , 1 0 0 0 ]$ and ReLU activations.
|
| 432 |
+
$\mathrm { N N } _ { M } ^ { \widetilde { p } }$ : an MLP of layer sizes $[ \dim ( M ) , 1 0 0 0 , 1 0 0 0 , 1 0 0 0 ]$ and ReLU activations.
|
| 433 |
+
|
| 434 |
+
$\mathrm { N N } _ { \mathrm { m e r g e } } ^ { p }$ : an projection layer which projects the feature outputs from the previous networks to a 3D tensor of shape $( 4 , 4 , 6 4 )$ , followed by 4 deconvolutional layers with stride 2, SAME padding, filter size $( 3 , 3 , 6 4 , 6 4 )$ except for the last layer $( 3 , 3 , 6 4 , 3 )$ . All the layers use ReLU activations except for the last layer, which uses sigmoid activation.
|
| 435 |
+
|
| 436 |
+
– Deep CAMA’s $q$ networks:
|
| 437 |
+
|
| 438 |
+
$\mathrm { N N } _ { M } ^ { \bar { q } }$ : it starts from a convolutional neural network (CNN) with 3 blocks of $\mathrm { \{ c o n v 3 \times } $ $3 , \mathrm { m a x - p o o l } \}$ layers with output channel size 64, stride 1 and SAME padding, then performs a reshape-to-vector operation and transforms this vector with an MLP of layer sizes $[ 4 \times 4 \times 6 4$ , 1000, 1000, $\mathrm { d i m } ( M ) \times 2 ]$ to generate the mean and log-variance of $q ( m | \bar { x } )$ . All the layers use ReLU activation except for the last layer, which uses linear activation.
|
| 439 |
+
|
| 440 |
+
$\mathrm { N N } _ { Z } ^ { q }$ : first it re-uses $\mathrm { N N } _ { M } ^ { q }$ CNN network for feature extraction on $x$ . Then after the reshape-to-vector operation, the vector gets combined with $y$ and $m$ and passed through another MLP of size [ $4 \times 4 \times 6 4 + \dim ( Y ) + \dim ( M ) , 1 0 0 0 , 1 0 0 0 , \dim ( \bar { Z }$ $\mathrm { d i m } ( \bar { Z } ) \times 2 ]$ to obtain the mean and log-variance of $q ( z | x , y , m )$ . All the layers use ReLU activation except for the last layer, which uses linear activation.
|
| 441 |
+
|
| 442 |
+
Measurement data generation We set the target $Y$ to be categorical, its children, co-parents and parents are continuous variables. The set 5 classes for $Y$ , and $Y$ has 10 children variables and 5 co-parents variables, also one 5 dimensional parents.
|
| 443 |
+
|
| 444 |
+
Parents $( A )$ and co-parents $( C )$ are generated by sampling from a normal distribution. We generate $Y$ using structured equation $Y = \bar { f } _ { y } ( A ) + \sigma _ { Y }$ . We use $f _ { y } =$ argmax $g ( A )$ and $g ( \ u )$ is a quadratic function $0 . 2 * A ^ { 2 } - 0 . 8 A . \ o$ $\sigma _ { Y }$ is the Gaussain noise.
|
| 445 |
+
|
| 446 |
+
To generate the children $X = f ( Y , C ) + \sigma _ { x }$ , we also used quadratic function $f$ and the parameters were sampled from a Gaussian distribution. As in the experiment, we were using fixed scale shift, we also added a normalize the children before adding the Gaussian random noise $\sigma _ { x }$ . So that all observations are in similar scale.
|
| 447 |
+
|
| 448 |
+
Other For MNIST experiments, we uses $5 \%$ of the training data as the validation set. We used the training results with the highest validation accuracy for testing. If not otherwise specified, $5 0 \%$ of noisy test data are used for fine-tuning in the shift experiments and all data are used for fine-tuning in the attack experiments.
|
| 449 |
+
|
| 450 |
+
For the experiments with measurement data. We generated 1000 data in total. We split, 500 data for testing, 450 for training and 50 for validation. We used the training results with the highest validation accuracy for testing for both deep CAMA and for DNN.
|
md/train/Hye9lnCct7/Hye9lnCct7.md
ADDED
|
@@ -0,0 +1,389 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# LEARNING ACTIONABLE REPRESENTATIONS WITH GOAL-CONDITIONED POLICIES
|
| 2 |
+
|
| 3 |
+
Dibya Ghosh, Abhishek Gupta, & Sergey Levine ∗
|
| 4 |
+
Department of Electrical Engineering and Computer Science
|
| 5 |
+
University of California, Berkeley
|
| 6 |
+
Berkeley, CA 94703, USA
|
| 7 |
+
|
| 8 |
+
# ABSTRACT
|
| 9 |
+
|
| 10 |
+
Representation learning is a central challenge across a range of machine learning areas. In reinforcement learning, effective and functional representations have the potential to tremendously accelerate learning progress and solve more challenging problems. Most prior work on representation learning has focused on generative approaches, learning representations that capture all the underlying factors of variation in the observation space in a more disentangled or well-ordered manner. In this paper, we instead aim to learn functionally salient representations: representations that are not necessarily complete in terms of capturing all factors of variation in the observation space, but rather aim to capture those factors of variation that are important for decision making – that are “actionable.” These representations are aware of the dynamics of the environment, and capture only the elements of the observation that are necessary for decision making rather than all factors of variation, eliminating the need for explicit reconstruction. We show how these learned representations can be useful to improve exploration for sparse reward problems, to enable long horizon hierarchical reinforcement learning, and as a state representation for learning policies for downstream tasks. We evaluate our method on a number of simulated environments, and compare it to prior methods for representation learning, exploration, and hierarchical reinforcement learning.
|
| 11 |
+
|
| 12 |
+
# 1 INTRODUCTION
|
| 13 |
+
|
| 14 |
+
Representation learning refers to a transformation of an observation, such as a camera image or state observation, into a form that is easier to manipulate to deduce a desired output or perform a downstream task, such as prediction or control. In reinforcement learning (RL) in particular, effective representations are ones that enable generalizable controllers to be learned quickly for challenging and temporally extended tasks. While end-to-end representation learning with full supervision has proven effective in many scenarios, from supervised image recognition (Krizhevsky et al., 2012) to vision-based robotic control (Levine et al., 2015), devising representation learning methods that can use unlabeled data or experience effectively remains an open problem.
|
| 15 |
+
|
| 16 |
+
Much of the prior work on representation learning in RL has focused on generative approaches. Learning these models is often challenging because of the need to model the interactions of all elements of the state. We instead aim to learn functionally salient representations: representations that are not necessarily complete in capturing all factors of variation in the observation space, but rather aim to capture factors of variation that are relevant for decision making – that are actionable.
|
| 17 |
+
|
| 18 |
+
How can we learn a representation that is aware of the dynamical structure of the environment? We propose that a basic understanding of the world can be obtained from a goal-conditioned policy, a policy that can knows how to reach arbitrary goal states from a given state. Learning how to execute shortest paths between all pairs of states suggests a deep understanding of the environment dynamics, and we hypothesize that a representation incorporating the knowledge of a goal-conditioned policy can be readily used to accomplish more complex tasks. However, such a policy does not provide a readily usable state representation, and it remains to choose how an effective state representation should be extracted. We want to extract those factors of the state observation that are critical for deciding which action to take. We can do this by comparing which actions a goal-conditioned policy takes for two different goal states. Intuitively, if two goal states require different actions, then they are functionally different and vice-versa. This principle is illustrated in the diagram in Figure 1. Based on this principle, we propose actionable representations for control (ARC), representations in which Euclidean distances between states correspond to expected differences between actions taken to reach them. Such representations emphasize factors in the state that induce significant differences in the corresponding actions, and de-emphasize those features that are irrelevant for control.
|
| 19 |
+
|
| 20 |
+
While learning a goal-conditioned policy to extract such a representation might itself represent a daunting task, it is worth noting that such a policy can be learned without any knowledge of downstream tasks, simply through unsupervised exploration of the environment. It is reasonable to postulate that, without active exploration, no representation learning method can possibly acquire a dynamics-aware representation, since understanding the dynamics requires experiencing transitions and interactions, rather than just observations of valid states. As we demonstrate in our experiments, representations extracted from goal-conditioned policies can be used to better learn more challenging tasks than simple goal reaching, which cannot be easily contextualized by goal states. The process of learning goal-conditioned policies can also be made recursive, so that the actionable representations learned from one goalconditioned policy can be used to quickly learn a better one.
|
| 21 |
+
|
| 22 |
+
Actionable representations for control are useful for a number of downstream tasks: as representations for task-specific policies, as representations for hierarchical RL, and to construct well-shaped reward functions. We show that ARCs enable these applications better than representations that are learned using unsupervised generative models, predictive models, and other prior representation learning methods. We analyze structure of the learned representation, and compare the performance of ARC with a number of prior methods on downstream tasks in simulated robotic domains such as wheeled locomotion, legged locomotion, and robotic manipulation.
|
| 23 |
+
|
| 24 |
+

|
| 25 |
+
Figure 1: Actionable representations: 3 houses A, B, C can only be reached by indicated roads. The actions taken to reach A, B, C are shown by arrows. Although A, B are very close in space, they are functionally different. The car has to take a completely different road to reach A, compared to $\mathbf { B }$ and C. Representations $z _ { A }$ , $z _ { B }$ , $z _ { C }$ learn these functional differences to differentiate A from B and C, while keeping B and C close.
|
| 26 |
+
|
| 27 |
+
# 2 PRELIMINARIES
|
| 28 |
+
|
| 29 |
+
Goal-conditioned reinforcement learning. In RL, the goal is to learn a policy $\pi _ { \boldsymbol { \theta } } \big ( a _ { t } | \boldsymbol { s } _ { t } \big )$ that maximizes the expected return $R _ { t } = \mathbb { E } _ { \pi _ { \theta } } [ \bar { \sum _ { t } r _ { t } } ]$ . Typically, RL learns a single task that optimizes for a particular reward function. If we instead would like to train a policy that can accomplish a variety of tasks, we might instead train a policy that is conditioned on another input – a goal. When the different tasks directly correspond to different states, this amounts to conditioning the policy $\pi$ on both the current and goal state. The policy $\pi _ { \boldsymbol { \theta } } ( a _ { t } | \boldsymbol { s } _ { t } , \boldsymbol { g } )$ is trained to reach goals from the state space $g \sim { \mathcal { S } }$ , by optimizing $\mathbb { E } _ { g \sim S } [ \mathbb { E } _ { \pi _ { \theta } ( a | s , g ) } ( R _ { g } ) ) ]$ , where $R _ { g }$ is a reward for reaching the goal $g$ .
|
| 30 |
+
|
| 31 |
+
Maximum entropy RL. Maximum entropy RL algorithms modify the RL objective, and instead learns a policy to maximize the reward as well as the entropy of the policy (Haarnoja et al., 2017; Todorov, 2006), according to $\begin{array} { r } { \pi ^ { \star } = \arg \operatorname* { m a x } _ { \pi } E _ { \pi } [ r ( s , a ) ] \stackrel { } { + } \mathcal { H } ( \pi ) } \end{array}$ . In contrast to standard RL, where optimal policies in fully observed environments are deterministic, the solution in maximum entropy RL is a stochastic policy, where the entropy reflects the sensitivity of the rewards to the action: when the choice of action has minimal effect on future rewards, actions are more random, and when the choice of action is critical, the actions are more deterministic. In this way, the action distributions for a maximum entropy policy carry more information about the dynamics of the task.
|
| 32 |
+
|
| 33 |
+

|
| 34 |
+
Figure 2: An illustration of actionable representations. For a pair of states $s _ { 1 } , s _ { 2 }$ , the divergence between the goal-conditioned action distributions they induce defines the actionable distance $D _ { \mathrm { { A c t } } }$ which in turn is used to learn representation $\phi$ .
|
| 35 |
+
|
| 36 |
+
# 3 LEARNING ACTIONABLE REPRESENTATIONS
|
| 37 |
+
|
| 38 |
+
In this work, we extract a representation that can distinguish states based on actions required to reach them, which we term an actionable representation for control (ARC). In order to learn state representations $\phi$ that can capture the elements of the state which are important for decision making, we first consider defining actionable distances $D _ { \mathrm { A c t } } ( s _ { 1 } , s _ { 2 } )$ between states. Actionable distances are distances between states that capture the differences between the actions required to reach the different states, thereby implicitly capturing dynamics. If actions required for reaching state $s _ { 1 }$ are very different from the actions needed for reaching state $s _ { 2 }$ , then these states are functionally different, and should have large actionable distances. This subsequently allows us to extract a feature representation $( \phi ( s ) )$ of state, which captures elements that are important for decision making.
|
| 39 |
+
|
| 40 |
+
To formally define actionable distances, we build on the framework of goal-conditioned RL. We assume that we have already trained a maximum entropy goal-conditioned policy $\pi _ { \boldsymbol { \theta } } ( a | \boldsymbol { s } , \boldsymbol { g } )$ that can start at an arbitrary state $s _ { 0 } \in S$ in the environment, and reach a goal state $s _ { g } \in \mathcal S$ . Although this is a significant assumption, we will discuss later how this is in fact reasonable in many settings. We can extract actionable distances by examining how varying the goal state affects action distributions for goal-conditioned policies. Formally, consider two different goal states $s _ { 1 }$ and $s _ { 2 }$ . At an intermediate state $s$ , the goal-conditioned policy induces different action distributions $\pi _ { \boldsymbol { \theta } } ( a | \boldsymbol { s } , \boldsymbol { s } _ { 1 } )$ and $\pi _ { \boldsymbol { \theta } } ( a | \boldsymbol { s } , \boldsymbol { s } _ { 2 } )$ to reach $s _ { 1 }$ and $s _ { 2 }$ respectively. If these distributions are similar over many intermediate states $s$ , this suggests that these states are functionally similar, while if these distributions are different, then the states must be functionally different. This motivates a definition for actionable distances $D _ { \mathrm { { A c t } } }$ as
|
| 41 |
+
|
| 42 |
+
$$
|
| 43 |
+
D _ { \mathrm { A c t } } ( s _ { 1 } , s _ { 2 } ) = \mathbb { E } _ { s } \left[ D _ { K L } ( \pi ( a | s , s _ { 1 } ) | | \pi ( a | s , s _ { 2 } ) ) + D _ { K L } ( \pi ( a | s , s _ { 2 } ) | | \pi ( a | s , s _ { 1 } ) ) \right] .
|
| 44 |
+
$$
|
| 45 |
+
|
| 46 |
+
The distance consists of the expected divergence over all initial states $s$ (refer to Section $\mathbf { B }$ for how we do this practically). If we focus on a subset of states, the distance may not capture action differences induced elsewhere, and can miss functional differences between states. Since maximum entropy policies learn unique optimal stochastic policies, the actionable distance is well-defined and unambiguous. Furthermore, because max-ent policies capture sensitivity of the value function, goals are similar under ARC if they require the same action and they are equally “easy” to reach.
|
| 47 |
+
|
| 48 |
+
We can use $D _ { \mathrm { { A c t } } }$ to extract an actionable representation of state. To learn this representation $\phi ( s )$ , we optimize $\phi$ such that Euclidean distance between states in representation space corresponds to actionable distances $D _ { \mathrm { { A c t } } }$ between them. This optimization yields good representations of state because it emphasizes the functionally relevant elements of state, which significantly affect the actionable distance, while suppressing less functionally relevant elements of state. The problem is:
|
| 49 |
+
|
| 50 |
+
$$
|
| 51 |
+
\displaystyle \operatorname* { m i n } _ { \phi } \mathbb { E } _ { s _ { 1 } , s _ { 2 } } \bigg [ \| \phi ( s _ { 1 } ) - \phi ( s _ { 2 } ) \| _ { 2 } - D _ { \mathrm { A c t } } ( s _ { 1 } , s _ { 2 } ) \bigg ] ^ { 2 }
|
| 52 |
+
$$
|
| 53 |
+
|
| 54 |
+
This objective yields representations where Euclidean distances are meaningful. This is not necessarily true in the state space or in generative representations (Section 6.4). These representations are meaningful for several reasons. First, since we are leveraging a goal-conditioned policy, they are aware of dynamics and are able to capture local connectivity of the environment. Secondly, the representation is optimized so that it captures only the functionally relevant elements of state.
|
| 55 |
+
|
| 56 |
+
Requirement for Goal Conditioned Policy: A natural question to ask is whether needing a goalconditioned policy is too strong of a prerequisite. However, it is worth noting that the GCP can be trained with existing RL methods (TRPO) using a sparse task-agnostic reward (Section 6.2, Appendix A.1) – obtaining such a policy is not especially difficult, and existing methods are quite capable of doing so ( Nair et al. (2018)). Furthermore, it is likely not possible to acquire a functionalityaware state representation without some sort of active environment interaction, since dynamics can only be understood by observing outcomes of actions, rather than individual states. Importantly, we discuss in the following section how ARCs help us solve tasks beyond what a simple goalconditioned policy can achieve.
|
| 57 |
+
|
| 58 |
+
# 4 USING ACTIONABLE REPRESENTATIONS FOR DOWNSTREAM TASKS
|
| 59 |
+
|
| 60 |
+
A natural question that emerges when learning representations from a goal-conditioned policy pertains to what such a representation enables over the goal-conditioned policy itself. Although goalconditioned policies enable reaching between arbitrary states, they suffer from fundamental limitations: they do not generalize very well to new states, and they are limited to solving only goalreaching tasks. We show in our empirical evaluation that the ARC representation expands meaningfully over these limitations of a goal-conditioned policy - to new tasks and to new regions of the environment. In this section, we detail how ARCs can be used to generalize beyond a goalconditioned policy to help solve tasks that cannot be expressed as goal reaching (Section 4.1), tasks involving larger regions of state space (Section 4.2), and temporally extended tasks which involve sequences of goals (Section 4.3).
|
| 61 |
+
|
| 62 |
+
# 4.1 FEATURES FOR LEARNING POLICIES
|
| 63 |
+
|
| 64 |
+
Goal-conditioned policies are trained with only a goal-reaching reward, and so are unaware of reward structures used for other tasks in the environment which do not involve simple goal-reaching. Tasks which cannot be expressed as simply reaching a goal are abundant in real life scenarios such as navigation under non-uniform preferences or manipulation with costs on quality of motion, and for such tasks, using the ARC representation as input for a policy or value function can make the learning problem easier. We can learn a policy for a downstream task, of the form $\pi _ { \theta } ( a | \phi ( s ) )$ , using the representation $\phi ( s )$ instead of state $s$ . The implicit understanding of the environment dynamics in the learned representation prioritizes the parts of the state that are most important for learning, and enables quicker learning for these tasks as we see in Section 6.6.
|
| 65 |
+
|
| 66 |
+
# 4.2 REWARD SHAPING
|
| 67 |
+
|
| 68 |
+
We can use ARC to construct better-shaped reward functions. It is common in continuous control to define rewards in terms of some distance to a desired state, oftentimes using Euclidean distance (Schulman et al., 2015; Lillicrap et al., 2015). However, Euclidean distance in state space is not necessarily a meaningful metric of functional proximity. ARC provides a better metric, since it directly accounts for reachability. We can use the actionable representation to define better-shaped reward functions for downstream tasks. We define a shaping of this form to be the negative Euclidean distance between two states in ARC space: $- | | \phi ( s _ { 1 } ) - \bar { \phi ( s _ { 2 } ) } | | _ { 2 }$ : for example, on a goal-reaching task $r ( s ) = r _ { \mathrm { s p a r s e } } ( s , s _ { g } ) - | | \phi ( s ) - \phi ( s _ { g } ) | | _ { 2 }$ . This allows us to explore and learn policies even in the presence of sparse reward functions.
|
| 69 |
+
|
| 70 |
+
One may wonder whether, instead of using ARCs for reward shaping, we might directly use the goalconditioned policy to reach a particular goal. As we will illustrate in Section 6.5, the representation typically generalizes better than the goal-conditioned policy. Goal-conditioned policies typically can be trained on small regions of the state space, but don’t extrapolate well to new parts of the state space. We observe that ARC exhibits better generalization, and can provide effective reward shaping for goals that are very difficult to reach with the goal-conditioned policy.
|
| 71 |
+
|
| 72 |
+
# 4.3 HIERARCHICAL REINFORCEMENT LEARNING
|
| 73 |
+
|
| 74 |
+
Goal-conditioned policies can serve as low-level controllers for hierarchical tasks which require synthesizing a particular sequence of behaviours, and thus not expressible as a single goal-reaching objective. One approach to solving such tasks learns a high-level controller $\pi _ { \mathrm { m e t a } } ( g | s )$ via RL that produces desired goal states for a goal-conditioned policy to reach sequentially (Nachum et al., 2018). The high-level controller suggests a goal, which the goal conditioned policy attempts to reach for several time-steps, following which the high-level controller picks a new goal. For many tasks, naively training such a high-level controller which outputs goals directly in state space is unlikely to perform well, since such a controller must disentangle the relevant attributes in the goal for long horizon reasoning. We consider two schemes to use ARCs for hierarchical RL - learning a high level policy which commands directly in ARC space or commands in a clustered latent space.
|
| 75 |
+
|
| 76 |
+
HRL directly in ARC space: ARC representations provide a better goal space for high-level controllers, since they de-emphasize components of the goal space irrelevant for determining the optimal action. In this scheme, the high-level controller $\pi _ { \mathrm { m e t a } } ( z | s )$ observes the current state and generates a distribution over points in the latent space. At every meta-step, a sample $z _ { h }$ is taken from $\pi _ { \mathrm { m e t a } } ( z | s )$ which represents the high level command. $z _ { h }$ is then translated into a goal $g _ { h }$ via a decoder which is trained to reconstruct states from their corresponding goals. This goal $g _ { h }$ can then be used to command the goal conditioned policy for several time steps, before resampling again from $\pi _ { \mathrm { m e t a } }$ . A high-level controller producing outputs in ARC space does not need to rediscover saliency in the goal space, which makes the search problem less noisy and more accurate. We show in Section 4.3 that using ARC as a hierarchical goal space enables significant improvement for waypoint navigation tasks.
|
| 77 |
+
|
| 78 |
+

|
| 79 |
+
Figure 3: Hierarchical RL with ARC. Left: Directly commanding in ARC space Right: Commanding a cluster in ARC space
|
| 80 |
+
|
| 81 |
+
Clustering in ARC space: Since ARC captures the topology of the environment, clusters in ARC space often correspond to semantically meaningful state abstractions. We utilize these clusters, with the intuition that a meta-controller searching in “cluster space” should learn faster than directly outputting states. In this scheme, we first build a discrete number of clusters by clustering the points that the goal conditioned policy is trained on using the $\mathbf { k }$ -means algorithm within the ARC representation space. We then train a high-level controller $\pi _ { \mathrm { m e t a } } ( c | s )$ which observes a state $s$ and generates a distribution over discrete clusters $c$ . At every meta-step, a cluster sample $c _ { h }$ is taken from $\pi _ { \mathrm { m e t a } } ( c | s )$ . A goal in state space $g _ { h }$ is then chosen uniformly at random from points within the cluster $c _ { h }$ and used to command the GCP for several time steps before the next cluster is sampled from $\pi _ { \mathrm { m e t a } }$ . We train a meta-policy to output clusters, instead of states: $\pi _ { m e t a } ( { \mathrm { c l u s t e r } } | s )$ . We see that for hierarchical tasks with less granular reward functions such as room navigation, performing RL in “cluster space” induced by ARC outperform cluster spaces induced by other representations, since the distance metric is much more meaningful in ARC space.
|
| 82 |
+
|
| 83 |
+
# 5 RELATED WORK
|
| 84 |
+
|
| 85 |
+
The capability to learn effective representations is a major advantage of deep neural network models. These representations can be acquired implicitly, through end-to-end training (Goodfellow et al., 2016), or explicitly, by formulating and optimizing a representation learning objective. A classic approach to representation learning is generative modeling, where a latent variable model is trained to model the data distribution, and the latent variables are then used as a representation (Rasmus et al., 2015; Dumoulin et al., 2016; Kingma & Welling, 2013; Finn et al., 2015; Ghadirzadeh et al., 2017; Curran et al., 2015; Goroshin et al., 2015; Higgins et al., 2017). In the context of control and sequence models, generative models have also been proposed to model transitions (Watter et al., 2015; Assael et al., 2015; Zhang et al., 2018b; Kurutach et al., 2018). While generative models are general and principled, they must not only explain the entirety of the input observation, but must also generate it. Several methods perform representation learning without generation, often based on contrastive losses (Sermanet et al., 2018; van den Oord et al., 2018; Belghazi et al., 2018; Chopra et al., 2005; Weinberger & Saul, 2009). While these methods avoid generation, they either still require modeling of the entire input, or utilize heuristics that encode user-defined information.
|
| 86 |
+
|
| 87 |
+
In contrast, ARCs are directly trained to focus on decision-relevant features of input, providing a broadly applicable objective that is still selective about which aspects of input to represent.
|
| 88 |
+
|
| 89 |
+
In the context of RL and control, representation learning methods have been used for many downstream applications (Lesort et al., 2018), including representing value functions (Barreto et al., 2016) and building models (Watter et al., 2015; Assael et al., 2015; Zhang et al., 2018b). Our approach is complementary: it can also be applied to these applications. Several works have sought to learn representations that are specifically suited for physical dynamical systems (Jonschkowski & Brock, 2015) and that use interaction to build up dynamics-aware features (Bengio et al., 2017; LaversanneFinot et al., 2018). In contrast to Jonschkowski & Brock (2015), our method does not attempt to encode all physically-relevant features of state, only those relevant for choosing actions. In contrast to Bengio et al. (2017); Laversanne-Finot et al. (2018), our approach does not try to determine which features of the state can be independently controlled, but rather which features are relevant for choosing controls. Srinivas et al. (2018) also consider learning representations through goal-directed behaviour, but receives supervision through demonstrations instead of active observation. Related methods learn features that are predictive of actions based on pairs of sequential states (so-called inverse models) (Agrawal et al., 2016; Pathak et al., 2017; Zhang et al., 2018a). More recent work such as (Burda et al., 2018b) perform a large scale study of these types of methods in the context of exploration. Unlike ARC, which is learned from a policy performing long-horizon control, inverse models are not obliged to represent all relevant features for multi-step control, and suffer from greedy reasoning.
|
| 90 |
+
|
| 91 |
+
# 6 EXPERIMENTS
|
| 92 |
+
|
| 93 |
+
The aim of our experimental evaluation is to study the following research questions:
|
| 94 |
+
|
| 95 |
+
1. Can we learn ARCs for multiple continuous control environments? What are the properties
|
| 96 |
+
of these learned representations?
|
| 97 |
+
2. Can ARCs be used as feature representations for learning policies quickly on new tasks?
|
| 98 |
+
3. Can reward shaping with ARCs enable faster learning?
|
| 99 |
+
4. Do ARCs provide an effective mechanism for hierarchical RL?
|
| 100 |
+
|
| 101 |
+
Full experimental and hyperparemeter tuning details are presented in the appendix.
|
| 102 |
+
|
| 103 |
+
# 6.1 DOMAINS
|
| 104 |
+
|
| 105 |
+
We study six simulated environments as illustrated in Figure 4: 2D navigation tasks in two settings, wheeled locomotion tasks in two settings, legged locomotion, and object pushing with a robotic gripper. The 2D navigation domains consist of either a room with a central divider wall or four rooms. Wheeled locomotion involves a two-wheeled differential drive robot, either in free space or with four rooms. For legged locomotion, we use a quadrupedal ant robot, where the state space consists of all joint angles, along with the Cartesian position of the center of mass (CoM). The manipulation task uses a simulated Sawyer arm to push an object, where the state consists of endeffector and object positions. Further details are presented in Appendix C.
|
| 106 |
+
|
| 107 |
+
These environments present interesting representation learning challenges. In 2D navigation, the walls impose structure similar to those in Figure 1: geometrically proximate locations on either side of a wall are far apart in terms of reachability. The locomotion environments present an additional challenge: an effective representation must account for the fact that the internal joints of each robot (legs or wheel orientation) are less salient for long-horizon tasks than CoM. The original state representation does not reflect this structure: joint angles expressed in radians carry as much weight as CoM positions in meters. In the object manipulation task, a key representational challenge is to distinguish between pushing the block and simply moving the arm in free space.
|
| 108 |
+
|
| 109 |
+
# 6.2 LEARNING THE GOAL-CONDITIONED POLICY AND ARC REPRESENTATION
|
| 110 |
+
|
| 111 |
+
We first learn a stochastic goal-conditioned policy parametrized by a neural network which outputs actions given the current state and the desired goal. This goal-conditioned policy is trained using a sparse reward using entropy-regularized Trust Region Policy Optimization (TRPO) (Schulman et al., 2015). For a discussion of the assumption about the existence of a goal-conditioned policy, please refer to Section 3. Exact details about the training procedure, the reward function, and hyperparameters are presented in Appendix A.1. To train the ARC representation, we collect a dataset of 500 trajectories with horizon 100 from the goal-conditioned policy, where each trajectory has an arbitrary start state and intended goal state. We optimize Eqn 2 as a supervised learning problem using this dataset to train the representation, computing the relevant expectations by uniform sampling from states in the dataset. A detailed outline of the training procedure, along with hyperparameter and architecture choices, is presented in Appendix A.2.
|
| 112 |
+
|
| 113 |
+

|
| 114 |
+
Figure 4: The tasks in our evaluation. The 2D navigation tasks allow for easy visualization and analysis, while the more complex tasks allow us to investigate how well ARC and prior methods can discern the most functionally-relevant features of the state.
|
| 115 |
+
|
| 116 |
+
# 6.3 COMPARISONS WITH PRIOR WORK
|
| 117 |
+
|
| 118 |
+
We compare ARC to other representation learning methods used in previous works for control: variational autoencoders (Kingma & Welling, 2013) (VAE), variational autoencoders trained for feature slowness (Jonschkowski & Brock, 2015) (slowness), features extracted from a predictive model (Oh et al., 2015) (predictive model), features extracted from inverse models (Agrawal et al., 2016; Burda et al., 2018a), and a na¨ıve baseline that uses the full state space as the representation (state). Details of the exact objectives used to train these methods is provided in Appendix B.
|
| 119 |
+
|
| 120 |
+
For each downstream task in Section 4, we also compare with alternative approaches for solving the task not involving representation learning. For reward shaping, we compare with VIME (Houthooft et al., 2016), an exploration method based on novelty bonuses. For hierarchical RL, we compare with option critic (Klissarov et al., 2017) and an on-policy adaptation of HIRO (Nachum et al., 2018). We also compare to model-based reinforcement learning with MPC (Nagabandi et al., 2017), a method which explicitly learns and uses environment dynamics, as compared to the implicit dynamics learnt by ARC. Because sample complexity of model-based and model-free methods differ, all results with model-based reinforcement learning indicate final performance.
|
| 121 |
+
|
| 122 |
+
To ensure a fair comparison between the methods, we provide the same information and trajectory data that ARC receives to all of the representation learning methods. Each representation is trained on the same dataset of trajectories collected from the goal-conditioned policy, ensuring that each comparisons receives data from the full state distribution and meaningful transitions.
|
| 123 |
+
|
| 124 |
+

|
| 125 |
+
6.4 ANALYSIS OF LEARNED ACTIONABLE REPRESENTATIONS
|
| 126 |
+
Figure 5: Visualization of ARC for 2D navigation. The states in the environment are colored to help visualize their position in representation space. For the wall task, points on opposite sides of the wall are clearly separated in ARC space (c). For four rooms, we see that ARCs provide a clear decomposition into room clusters (f), while VAEs do not (e).
|
| 127 |
+
|
| 128 |
+
We analyze the structure of ARC space for the tasks described in Section 6.1, to identify which factors of state ARC chooses to emphasize, and how system dynamics affect the representation.
|
| 129 |
+
|
| 130 |
+
In the 2D navigation tasks, we visualize the original state and learned representations in Figure 5. In both environments, ARC reflects the dynamics: points close by in Euclidean distance in the original state space are distant in representation space when they are functionally distinct. For instance, there is a clear separation in the latent space where the wall should be, and points on opposite sides of the wall are much further apart in ARC space (Figure 5) than in the original environment and in the VAE representation. In the room navigation task, the passages between rooms are clear bottlenecks, and the ARC representation separates the rooms according to these bottlenecks.
|
| 131 |
+
|
| 132 |
+

|
| 133 |
+
Figure 6: Perturbation analysis (Section 6.4): Effective representations vary significantly with perturbations to functionally relevant elements of state (shown in orange), and less for secondary elements (shown in purple). ARC exhibits this property, with a spread orange region - robot CoM or object position, and a suppressed purple region - joint angles and other secondary elements. The VAE and naive state representations do not capture this saliency, containing spread purple regions.
|
| 134 |
+
|
| 135 |
+
The representations learned in more complex domains, such as wheeled or legged locomotion and block manipulation, also show meaningful patterns. We aim to understand which elements of state are being emphasized by the representation, by analyzing how distances in the latent space change as we perturb various elements of state. (Fig 6). For each environment, we determine two factors in the state: one which we consider salient for decision making (in orange), and one which is secondary (in purple). We expect a good representation to have a larger variation in distance as we perturb the important factor than when we perturb the secondary factor. In the legged locomotion environment, the CoM is the important factor and the joint angles are secondary. As we perturb the CoM, the representation should vary significantly, while the effect should be muted as we perturb the joints. For the wheeled environment, position of the car should cause large variations while the orientation should be secondary. For the object pushing, we expect block position to be salient and end-effector position to be secondary. Since distances in the high-dimensional representation space are hard to visualize, we project [ARC, VAE, State] representations of perturbed states into 2 dimensions (Fig 6) using multi-dimensional scaling (MDS) (Borg & Groenen, 2005), which projects points while preserving Euclidean distances. From Fig 6, we see that ARC captures the factors of interest; as the important factor is perturbed the representation changes significantly (spread out orange points), while when the secondary factor is perturbed the representation changes minimally (close together purple points). This implies that for Ant, ARC captures CoM while suppressing joint angles; for wheeled, ARC captures position while suppressing orientation; for block pushing, ARC captures block position, suppressing arm movement. Both VAE representations and original state space are unable to capture this.
|
| 136 |
+
|
| 137 |
+
# 6.5 LEVERAGING ACTIONABLE REPRESENTATIONS FOR REWARD SHAPING
|
| 138 |
+
|
| 139 |
+
As desribed in Section 4.2, distances in ARC space can be used for reward shaping to solve tasks that present a large exploration challenge with sparse reward functions. We investigate this on two challenging exploration tasks for wheeled locomotion and legged locomotion (seen in Fig 7). We acquire an ARC from a goal-conditioned policy in the region $s$ where the $\mathbf { \mathrm { C o M } }$ is within a $2 \mathrm { m }$ square. The learned representation is then used to guide learning via reward shaping for learning a goal-conditioned policy on a larger region $S ^ { \prime }$ , where the CoM is within a square of $8 \mathrm { m }$ . The task is to reach arbitrary goals in $S ^ { \prime }$ , but with only a sparse goal completion reward, so exploration is challenging.We shape the reward with a term corresponding to distance between the representation of the current and desired state: $r ( s , g ) = r _ { \mathrm { s p a r s e } } - \| \phi ( s ) - \phi ( g ) \| _ { 2 }$ . To ensure fairness, all comparisons initialize from the goal-conditioned policy on small region $s$ and train on the same data. Further details on the experimental setup for this domain can be found in Appendix A.3.
|
| 140 |
+
|
| 141 |
+

|
| 142 |
+
Figure 7: Learning new tasks with reward shaping in representation space. ARC representations are more effective than other methods, and match the performance of a hand-specified shaping.
|
| 143 |
+
|
| 144 |
+
As shown in Fig 7, ARC demonstrates faster learning speed and better asymptotic performance over all compared methods, when all are initialized from the goal conditioned policy trained on the small region. This can be attributed to the fact that, unlike the other representation learning algorithms, the ARC representation explicitly optimizes for functional distances in latent space, which generalizes well to a larger domain since the functionality in the new space is preserved. The performance of ARC is similar to a hand-designed reward shaping corresponding to distance in COM space, corroborating Figure 6 that ARC considers CoM to be the most salient feature. We notice that representations which are dynamics-aware (ARC, predictive models, inverse models) outperform VIME, which uses a novelty-based exploration strategy without considering environment dynamics, indicating that effectively incorporating dynamics information into representations can help tackle exploration challenges in large environments.
|
| 145 |
+
|
| 146 |
+
# 6.6 LEVERAGING ACTIONABLE REPRESENTATIONS AS FEATURES FOR LEARNING POLICIES
|
| 147 |
+
|
| 148 |
+
We consider using the ARC representation as a feature space for learning policies for tasks that cannot be expressed with a goal-reaching objective. We consider a quadruped ant robot task which requires the agent to reach a target (shown in green in Fig 8) while avoiding a dangerous region (shown in red in Fig 8). Instead of learning a policy from state $\pi ( a | s )$ , we learn a policy using a representation $\phi$ as features $\pi ( a | \phi ( s ) )$ . It is important to note that this task cannot be solved directly by a goal-conditioned policy (GCP), and a GCP attempting to reach the specified goal will walk through the dangerous region and receive a reward of -760. The reward function for this task and other experimental details are noted in Appendix A.4.
|
| 149 |
+
|
| 150 |
+

|
| 151 |
+
Figure 8: ARCs as policy features. Top: Reach-while-avoiding task Bottom: Task learning curves
|
| 152 |
+
|
| 153 |
+
Although all the methods ultimately learn to solve the task, policies using ARC features learn at a significantly faster rate (Figure 8). Policies using ARC features solve the task by Iteration 100, by which point all other methods can only solve with
|
| 154 |
+
|
| 155 |
+
$5 \%$ success. We attribute the rapid learning progress to the ability of ARC to emphasize elements of the state that are important for multi-timestep control, rather than greedy features discovered by reconstruction or one-step prediction. Features which emphasize elements important for control make learning easier because they reduce redundancy and noise in the input, and allows the RL algorithm to effectively assign credit. We further note that other representation learning methods learn only as fast as the original state representation, and model-based MPC controllers (Nagabandi et al., 2017) also perform suboptimally. It is important to note that the same representation can be used to quickly train many different tasks, amortizing the cost of training a GCP.
|
| 156 |
+
|
| 157 |
+
We consider using ARC representations to control high-level controllers for learning temporally extended navigation tasks in room and waypoint navigation settings, as described in Section 4. In the multi-room environments, the agent must navigate through a sequence of 50 rooms in order, receiving a sparse reward when it enters the correct room. In waypoint navigation, the ant must reach a sequence of waypoints in order with a similar sparse reward. These tasks are illustrated in $\operatorname { F i g } 9$ , and are described in detail in Appendix A.5.
|
| 158 |
+
|
| 159 |
+
We evaluate the two schemes for hierarchical reasoning with ARCs detailed in Section 4.3: commanding directly in representation space or through a $k$ -means clustering of the representation space. We train a high-level controller $\pi _ { h }$ with TRPO which outputs as actions either a direct point in the latent space $z _ { h }$ or a cluster index $c _ { h }$ , from which a goal $g _ { h }$ is decoded and passed to the goal-conditioned policy to follow for 50 timesteps. Exact specifications and details are in Appendix A.5 and A.6.
|
| 160 |
+
|
| 161 |
+

|
| 162 |
+
Figure 9: Waypoint and multi-room HRL tasks
|
| 163 |
+
|
| 164 |
+

|
| 165 |
+
Figure 10: Comparison on hierarchical tasks. ARCs perform significantly better than other representation methods, option-critic, and commanding goals in state space
|
| 166 |
+
|
| 167 |
+
Using a hierarchical meta-policy with ARCs performs significantly better than those using alternative representations which do not properly capture abstraction and environment dynamics (Fig 10). For multi-rooms, ARC clusters very clearly capture different rooms (Fig 5), so commanding in cluster space reduces redundancy in action space, allowing for effective exploration. ARC likely works better than commanding goals in spaces learned by other representation learning algorithms, because the learned ARC space is more structured for high-level control, which makes search and clustering simpler. Semantically similar states like two points in the same room end up in the same ARC cluster, thus simplifying the high-level planning process for the meta-controller. As compared to learning from scratch via TRPO and standard HRL methods such as option critic (Klissarov et al., 2017) and an on-policy adaptation of HIRO (Nachum et al., 2018), commanding in representation space enables more effective search and high-level control. The failure of TRPO and option-critic, algorithms not using a goal-conditioned policy, emphasizes the task difficulty and indicates that a goal-conditioned policy trained on simple reaching tasks can be re-used to solve long-horizon problems. Commanding in ARC space is better than in state space using HIRO because state space has redundancies which makes search challenging.
|
| 168 |
+
|
| 169 |
+
# 7 DISCUSSION
|
| 170 |
+
|
| 171 |
+
In this work, we introduce actionable representations for control (ARC), which capture representations of state important for decision making. We build on the framework of goal-conditioned RL to extract state representations that emphasize features of state that are functionally relevant. The learned state representations are implicitly aware of the dynamics, and capture meaningful distances in representation space. ARCs are useful for tasks such as learning policies, HRL and exploration. While ARC are learned by first training a goal-conditioned policy, learning this policy using offpolicy data is a promising direction for future work. Interleaving the process of representation learning and learning of the goal-conditioned policy promises to scale ARC to more general tasks.
|
| 172 |
+
|
| 173 |
+
Acknowledgements This research was supported by Berkeley DeepDrive, Honda, an ONR Young Investigator Program Award, Google, and computational resources from Amazon. Abhishek Gupta was supported by an NSF Graduate Research Fellowship. We thank Pim de Haan, Aviv Tamar, Vitchyr Pong, and Ignasi Clavera for helpful insights and discussions.
|
| 174 |
+
|
| 175 |
+
# REFERENCES
|
| 176 |
+
|
| 177 |
+
Pulkit Agrawal, Ashvin Nair, Pieter Abbeel, Jitendra Malik, and Sergey Levine. Learning to poke by poking: Experiential learning of intuitive physics. CoRR, abs/1606.07419, 2016.
|
| 178 |
+
|
| 179 |
+
John-Alexander M. Assael, Niklas Wahlstrom, Thomas B. Sch ¨ on, and Marc Peter Deisenroth. Data- ¨ efficient learning of feedback policies from image pixels using deep dynamical models. CoRR, abs/1510.02173, 2015.
|
| 180 |
+
|
| 181 |
+
Andre Barreto, R ´ emi Munos, Tom Schaul, and David Silver. Successor features for transfer in ´ reinforcement learning. CoRR, abs/1606.05312, 2016.
|
| 182 |
+
|
| 183 |
+
Ishmael Belghazi, Sai Rajeswar, Aristide Baratin, R. Devon Hjelm, and Aaron C. Courville. MINE: mutual information neural estimation. CoRR, abs/1801.04062, 2018.
|
| 184 |
+
|
| 185 |
+
Emmanuel Bengio, Valentin Thomas, Joelle Pineau, Doina Precup, and Yoshua Bengio. Independently controllable features. CoRR, abs/1703.07718, 2017.
|
| 186 |
+
|
| 187 |
+
I. Borg and P.J.F. Groenen. Modern Multidimensional Scaling: Theory and Applications. Springer, 2005.
|
| 188 |
+
|
| 189 |
+
Yuri Burda, Harri Edwards, Deepak Pathak, Amos Storkey, Trevor Darrell, and Alexei A. Efros. Large-scale study of curiosity-driven learning. In arXiv:1808.04355, 2018a.
|
| 190 |
+
|
| 191 |
+
Yuri Burda, Harrison Edwards, Deepak Pathak, Amos J. Storkey, Trevor Darrell, and Alexei A. Efros. Large-scale study of curiosity-driven learning. CoRR, abs/1808.04355, 2018b.
|
| 192 |
+
|
| 193 |
+
Sumit Chopra, Raia Hadsell, and Yann LeCun. Learning a similarity metric discriminatively, with application to face verification. In 2005 IEEE Computer Society Conference on Computer Vision and Pattern Recognition (CVPR 2005), 20-26 June 2005, San Diego, CA, USA, pp. 539–546, 2005. doi: 10.1109/CVPR.2005.202.
|
| 194 |
+
|
| 195 |
+
William Curran, Tim Brys, Matthew E. Taylor, and William D. Smart. Using PCA to efficiently represent state spaces. CoRR, abs/1505.00322, 2015.
|
| 196 |
+
|
| 197 |
+
Vincent Dumoulin, Ishmael Belghazi, Ben Poole, Alex Lamb, Mart´ın Arjovsky, Olivier Mastropietro, and Aaron C. Courville. Adversarially learned inference. CoRR, abs/1606.00704, 2016.
|
| 198 |
+
|
| 199 |
+
Chelsea Finn, Xin Yu Tan, Yan Duan, Trevor Darrell, Sergey Levine, and Pieter Abbeel. Learning visual feature spaces for robotic manipulation with deep spatial autoencoders. CoRR, abs/1509.06113, 2015.
|
| 200 |
+
|
| 201 |
+
Ali Ghadirzadeh, Atsuto Maki, Danica Kragic, and Marten Bj ˚ orkman. Deep predictive policy train- ¨ ing using reinforcement learning. In 2017 IEEE/RSJ International Conference on Intelligent Robots and Systems, IROS 2017, Vancouver, BC, Canada, September 24-28, 2017, pp. 2351– 2358, 2017. doi: 10.1109/IROS.2017.8206046.
|
| 202 |
+
|
| 203 |
+
Ian Goodfellow, Yoshua Bengio, Aaron Courville, and Yoshua Bengio. Deep learning, volume 1. MIT Press, 2016.
|
| 204 |
+
|
| 205 |
+
Ross Goroshin, Michael Mathieu, and Yann LeCun. Learning to linearize under uncertainty. In ¨ Advances in Neural Information Processing Systems 28: Annual Conference on Neural Information Processing Systems 2015, December 7-12, 2015, Montreal, Quebec, Canada, pp. 1234–1242, 2015.
|
| 206 |
+
|
| 207 |
+
Tuomas Haarnoja, Haoran Tang, Pieter Abbeel, and Sergey Levine. Reinforcement learning with deep energy-based policies. CoRR, abs/1702.08165, 2017.
|
| 208 |
+
|
| 209 |
+
Irina Higgins, Arka Pal, Andrei A. Rusu, Lo¨ıc Matthey, Christopher Burgess, Alexander Pritzel, Matthew Botvinick, Charles Blundell, and Alexander Lerchner. DARLA: improving zero-shot transfer in reinforcement learning. In Proceedings of the 34th International Conference on Machine Learning, ICML 2017, Sydney, NSW, Australia, 6-11 August 2017, pp. 1480–1490, 2017.
|
| 210 |
+
|
| 211 |
+
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.
|
| 212 |
+
|
| 213 |
+
Rico Jonschkowski and Oliver Brock. Learning state representations with robotic priors. Auton. Robots, 39(3):407–428, 2015. doi: 10.1007/s10514-015-9459-7.
|
| 214 |
+
|
| 215 |
+
Diederik P. Kingma and Max Welling. Auto-encoding variational bayes. CoRR, abs/1312.6114, 2013.
|
| 216 |
+
|
| 217 |
+
Martin Klissarov, Pierre-Luc Bacon, Jean Harb, and Doina Precup. Learnings options end-to-end for continuous action tasks. CoRR, abs/1712.00004, 2017. URL http://arxiv.org/abs/ 1712.00004.
|
| 218 |
+
|
| 219 |
+
Alex Krizhevsky, Ilya Sutskever, and Geoffrey E. Hinton. Imagenet classification with deep convolutional neural networks. In Advances in Neural Information Processing Systems 25: 26th Annual Conference on Neural Information Processing Systems 2012. Proceedings of a meeting held December 3-6, 2012, Lake Tahoe, Nevada, United States., pp. 1106–1114, 2012.
|
| 220 |
+
|
| 221 |
+
Thanard Kurutach, Aviv Tamar, Ge Yang, Stuart J. Russell, and Pieter Abbeel. Learning plannable representations with causal infogan. CoRR, abs/1807.09341, 2018.
|
| 222 |
+
|
| 223 |
+
Adrien Laversanne-Finot, Alexandre Per´ e, and Pierre-Yves Oudeyer. Curiosity driven exploration ´ of learned disentangled goal spaces. In 2nd Annual Conference on Robot Learning, CoRL 2018, Zurich, Switzerland, 29-31 October 2018, Proceedings ¨ , pp. 487–504, 2018.
|
| 224 |
+
|
| 225 |
+
Timothee Lesort, Natalia D ´ ´ıaz Rodr´ıguez, Jean-Franc¸ois Goudou, and David Filliat. State representation learning for control: An overview. CoRR, abs/1802.04181, 2018.
|
| 226 |
+
|
| 227 |
+
Sergey Levine, Chelsea Finn, Trevor Darrell, and Pieter Abbeel. End-to-end training of deep visuomotor policies. CoRR, abs/1504.00702, 2015.
|
| 228 |
+
|
| 229 |
+
Timothy P. Lillicrap, Jonathan J. Hunt, Alexander Pritzel, Nicolas Heess, Tom Erez, Yuval Tassa, David Silver, and Daan Wierstra. Continuous control with deep reinforcement learning. CoRR, abs/1509.02971, 2015.
|
| 230 |
+
|
| 231 |
+
Ofir Nachum, Shixiang Gu, Honglak Lee, and Sergey Levine. Data-efficient hierarchical reinforcement learning. CoRR, abs/1805.08296, 2018.
|
| 232 |
+
|
| 233 |
+
Anusha Nagabandi, Gregory Kahn, Ronald S. Fearing, and Sergey Levine. Neural network dynamics for model-based deep reinforcement learning with model-free fine-tuning. CoRR, abs/1708.02596, 2017.
|
| 234 |
+
|
| 235 |
+
Ashvin Nair, Vitchyr Pong, Murtaza Dalal, Shikhar Bahl, Steven Lin, and Sergey Levine. Visual reinforcement learning with imagined goals. CoRR, abs/1807.04742, 2018.
|
| 236 |
+
|
| 237 |
+
Junhyuk Oh, Xiaoxiao Guo, Honglak Lee, Richard L. Lewis, and Satinder P. Singh. Actionconditional video prediction using deep networks in atari games. CoRR, abs/1507.08750, 2015.
|
| 238 |
+
|
| 239 |
+
Deepak Pathak, Pulkit Agrawal, Alexei A. Efros, and Trevor Darrell. Curiosity-driven exploration by self-supervised prediction. In 2017 IEEE Conference on Computer Vision and Pattern Recognition Workshops, CVPR Workshops, Honolulu, HI, USA, July 21-26, 2017, pp. 488–489, 2017. doi: 10.1109/CVPRW.2017.70.
|
| 240 |
+
|
| 241 |
+
Antti Rasmus, Harri Valpola, Mikko Honkala, Mathias Berglund, and Tapani Raiko. Semisupervised learning with ladder network. CoRR, abs/1507.02672, 2015.
|
| 242 |
+
|
| 243 |
+
John Schulman, Sergey Levine, Pieter Abbeel, Michael I. Jordan, and Philipp Moritz. Trust region policy optimization. In Proceedings of the 32nd International Conference on Machine Learning, ICML 2015, Lille, France, 6-11 July 2015, pp. 1889–1897, 2015.
|
| 244 |
+
|
| 245 |
+
Pierre Sermanet, Corey Lynch, Yevgen Chebotar, Jasmine Hsu, Eric Jang, Stefan Schaal, Sergey Levine, and Google Brain. Time-contrastive networks: Self-supervised learning from video. In 2018 IEEE International Conference on Robotics and Automation, ICRA 2018, Brisbane, Australia, May 21-25, 2018, pp. 1134–1141, 2018. doi: 10.1109/ICRA.2018.8462891.
|
| 246 |
+
|
| 247 |
+
Aravind Srinivas, Allan Jabri, Pieter Abbeel, Sergey Levine, and Chelsea Finn. Universal planning networks. arXiv preprint arXiv:1804.00645, 2018.
|
| 248 |
+
|
| 249 |
+
Emanuel Todorov. Linearly-solvable markov decision problems. In Advances in Neural Information Processing Systems 19, Proceedings of the Twentieth Annual Conference on Neural Information Processing Systems, Vancouver, British Columbia, Canada, December 4-7, 2006, pp. 1369–1376, 2006.
|
| 250 |
+
|
| 251 |
+
Aaron van den Oord, Yazhe Li, and Oriol Vinyals. Representation learning with contrastive predic-¨ tive coding. CoRR, abs/1807.03748, 2018.
|
| 252 |
+
|
| 253 |
+
Manuel Watter, Jost Tobias Springenberg, Joschka Boedecker, and Martin A. Riedmiller. Embed to control: A locally linear latent dynamics model for control from raw images. In Advances in Neural Information Processing Systems 28: Annual Conference on Neural Information Processing Systems 2015, December 7-12, 2015, Montreal, Quebec, Canada, pp. 2746–2754, 2015.
|
| 254 |
+
|
| 255 |
+
Kilian Q. Weinberger and Lawrence K. Saul. Distance metric learning for large margin nearest neighbor classification. Journal of Machine Learning Research, 10:207–244, 2009. doi: 10. 1145/1577069.1577078.
|
| 256 |
+
|
| 257 |
+
Amy Zhang, Harsh Satija, and Joelle Pineau. Decoupling dynamics and reward for transfer learning. CoRR, abs/1804.10689, 2018a.
|
| 258 |
+
|
| 259 |
+
Marvin Zhang, Sharad Vikram, Laura Smith, Pieter Abbeel, Matthew J. Johnson, and Sergey Levine. SOLAR: deep structured latent representations for model-based reinforcement learning. CoRR, abs/1808.09105, 2018b.
|
| 260 |
+
|
| 261 |
+
# A EXPERIMENTAL DETAILS
|
| 262 |
+
|
| 263 |
+
# A.1 TRAINING THE GOAL-CONDITIONED POLICY
|
| 264 |
+
|
| 265 |
+
We train a stochastic goal-conditioned policy $\pi ( \cdot | s , g )$ using TRPO with an entropy regularization term, where the goal space $\mathcal { G }$ coincides with the state space $s$ . In every episode, a starting state and a goal state $s , g \in S$ are sampled from a uniform distribution on states, with a sparse reward given of the form below, where $\epsilon$ is task-specific, and listed in the table below.
|
| 266 |
+
|
| 267 |
+
$$
|
| 268 |
+
r ( s , g ) = { \left\{ \begin{array} { l l } { 0 } & { \| s - g \| _ { \infty } > \epsilon } \\ { \epsilon - \| s - g \| _ { \infty } } & { \| s - g \| _ { \infty } < \epsilon } \end{array} \right. }
|
| 269 |
+
$$
|
| 270 |
+
|
| 271 |
+
For the Sawyer environment, although this sparse reward formulation can learn a goal-conditioned policy, it is highly sample inefficient, so in practice we use a shaped reward as detailed in Appendix C. For all of the other environments, in the free space and rooms environments, the goal-conditioned policy is trained using a sparse reward.
|
| 272 |
+
|
| 273 |
+
The goal-conditioned policy is parameterized as $\pi _ { \boldsymbol { \theta } } ( a | s , g ) \sim \mathcal { N } ( \mu _ { \boldsymbol { \theta } } ( s , g ) , \Sigma _ { \boldsymbol { \theta } } )$ . The mean, $\mu _ { \boldsymbol { \theta } } ( \cdot , \cdot )$ is a fully-connected neural network which takes in the state and the desired goal state as a concatenated vector, and has three hidden layers containing 150, 100, and 50 units respectively. $\Sigma$ is a learned diagonal covariance matrix, and is initially set to $\Sigma = I$ .
|
| 274 |
+
|
| 275 |
+
<table><tr><td></td><td>Navigation</td><td>Wheeled Navigation</td><td>Ant Navigation</td><td>Sawyer Pushing</td></tr><tr><td>State/Goal Space Dimension</td><td>2</td><td>6</td><td>15</td><td>6</td></tr><tr><td>Action Space Dimension</td><td>2</td><td>2</td><td>7</td><td>3</td></tr><tr><td>Sparse Reward Threshold (ε)</td><td>0.1</td><td>0.5</td><td>1</td><td>0.3</td></tr><tr><td># Trajectories per Iteration</td><td>100</td><td>200</td><td>250</td><td>500</td></tr><tr><td># Steps in Trajecotry</td><td>50</td><td>100</td><td>200</td><td>100</td></tr><tr><td># Iterations</td><td>200</td><td>1000</td><td>2000</td><td>2000</td></tr><tr><td>Entropy Penalty</td><td>1</td><td>1</td><td>0.1</td><td>0.1</td></tr><tr><td>Learning Rate</td><td>.01</td><td>.02</td><td>.02</td><td>.01</td></tr></table>
|
| 276 |
+
|
| 277 |
+
# A.2 TRAINING THE REPRESENTATION
|
| 278 |
+
|
| 279 |
+
After training a goal-conditioned policy $\pi$ on the specified region of interest, we collect 500 trajectories each of length 100 timesteps, where each trajectory starts at an arbitrary start state, going towards an arbitrary goal state, selected exactly as the goal-conditioned policy was trained in Appendix A.1. This dataset was chosen to be large enough so that the collected dataset has full coverage of the entire state space. Each of the representation learning methods evaluated is trained on this dataset, which means that each learning algorithm receives data from the full state space, and witnesses meaningful transitions between states $( s _ { t } , s _ { t + 1 } )$ .
|
| 280 |
+
|
| 281 |
+
We evaluate ARCs against representations minimizing reconstruction error (VAE, slowness) and representations performing one-step prediction (predictive model, inverse dynamics). For each representation, each component is parametrized by a neural network with ReLU activations and linear outputs, and the objective function is optimized using Adam with a learning rate of $1 0 ^ { - 3 }$ , holding out $20 \%$ of the trajectories as a validation set. We perform coarse hyperparameter sweeps over various hyperparameters for all of the methods, including the dimensionality of the latent state, the size of the neural networks, and the parameters which weigh the various terms in the objectives. The exact objective functions for each representation are detailed further in Appendix B.
|
| 282 |
+
|
| 283 |
+
# A.3 REWARD SHAPING
|
| 284 |
+
|
| 285 |
+
We test the reward shaping capabilities of the learned representations with a set of navigation tasks on the Wheeled and Ant tasks. A goal-conditioned policy $\pi$ is trained on a $n \times n$ meter square of free space, and representations are learned (as specified above) on trajectories collected in this small region. We then attempt to generalize to an $m \times m$ meter square (where $m > > n$ ), and consider the set of tasks of reaching an arbitrary goal in the larger region: a start state and goal state are chosen uniformly at random every episode. The environment setup is identical to that in Appendix A.1, although with a larger region, and policy training is done the same with two distinctions. Instead of training with the sparse reward $r _ { s p a r s e } ( s , g )$ , we train on a ”shaped” surrogate reward
|
| 286 |
+
|
| 287 |
+
$$
|
| 288 |
+
r _ { s h a p e d , \phi } ( s , g ) = r _ { s p a r s e } ( s , g ) - \alpha \| \phi ( s ) - \phi ( g ) \| _ { 2 }
|
| 289 |
+
$$
|
| 290 |
+
|
| 291 |
+
where $\alpha$ weights between the euclidean distance and the sparse reward terms. Second, the policy is initialized to the parameters of the original goal-conditioned policy $\pi$ which was previously trained on the small region to help exploration. As a heuristic for the best possible shaping term, we compare with a ”hand-specified” In addition to reward shaping with the various representations, we also compare to a dedicated exploration algorithm, VIME (Houthooft et al., 2016), which also uses TRPO as a base algorithm. Understanding that different representation learning methods may learn representations with varying scales, we performed a hyperparameter sweep on $\alpha$ for all the representation methods. For VIME, we performed a hyperparameter sweep on $\eta$ . The parameters used for TRPO are exactly those in Appendix A.1, albeit for 3000 iterations.
|
| 292 |
+
|
| 293 |
+
# A.4 FEATURES FOR POLICIES
|
| 294 |
+
|
| 295 |
+
We test the ability of the representation to be used as features for a policy learning some downstream task within the Ant environment. The downstream task is a ”reach-while-avoid” task, in which the Ant requires the quadruped robot to start at the point $( - 1 . 5 , - 1 . 5 )$ and reach the point (1.5, 1.5) while avoiding a circular region centered at the origin with radius 1 (all units in meters). Letting $d _ { g o a l } ( s )$ be the distance of the agent to (1.5, 1.5) and $d _ { o r i g i n } ( s )$ to be the distance of the agent to the origin, the reward function for the task is
|
| 296 |
+
|
| 297 |
+
$$
|
| 298 |
+
r ( s ) = - d _ { g o a l } ( s ) - 4 * \mathbf { 1 } \{ d _ { o r i g i n } ( s ) < 1 \}
|
| 299 |
+
$$
|
| 300 |
+
|
| 301 |
+
For any given representation $\phi ( s )$ , we train a policy which uses the feature representation as input as follows. We use TRPO to train a stochastic policy $\pi ( a | \phi ( s ) )$ , which is of the form $\mathcal { N } ( \mu _ { \boldsymbol { \theta } } ( \phi ( s ) ) , \Sigma _ { \boldsymbol { \theta } } )$ . The mean is a fully connected neural network which takes in the representation, and has two layers of size 50 each, and $\Sigma$ is a learned diagonal covariance matrix initially set to $\Sigma = I$ . Note that gradients do not flow through the representation, so only the policy is adapted and the representation is fixed for the entirety of the experiment.
|
| 302 |
+
|
| 303 |
+
# A.5 HIERARCHICAL REINFORCEMENT LEARNING IN LATENT SPACE
|
| 304 |
+
|
| 305 |
+
We provide comparisons on using the learned representation to direct a goal-conditioned policy for long-horizon sequential tasks. In particular, we consider a waypoint reaching task for the Ant, in which the agent must navigate to a sequence of 50 target locations in order: $\left\{ ( x _ { 1 } , y _ { 1 } ) , ( x _ { 2 } , y _ { 2 } ) , \dots ( x _ { 5 0 } , y _ { 5 0 } ) \right\}$ . The agent receives as input the state of the ant and the checkpoint number that it is currently trying to reach (encoded as a one-hot vector). When the agent gets within $0 . 5 \mathrm { m }$ of the checkpoint, it receives $+ 1$ reward, and the checkpoint is moved to the next point, making this a highly sparse reward. Target locations are sampled uniformly at random from a $8 \times 8$ meter region, but are fixed for the entirety of the experiment.
|
| 306 |
+
|
| 307 |
+
We consider learning a high-level policy $\pi _ { h } ( z _ { h } | s )$ which outputs goals in latent space, which are then executed by a goal-conditioned policy as described in Appendix A.1. Specifically, when the high-level policy outputs a goal in latent space $z _ { h }$ , we use a reconstruction network $\psi$ , which is described below, to receive a goal state $g _ { h } = \psi ( z _ { h } )$ . The goal-conditioned policy executes for 50 timesteps according to $\pi ( a | s , \bar { g } _ { h } )$ . The high-level policy is trained with TRPO with the reward being equal to the sum of the rewards obtained by running the goal-conditioned policy for every meta-step. We parametrize the high-level policy $\pi _ { h } ( z _ { h } | s )$ as having a Gaussian distribution in the latent space, with the mean being specified as a MLP with two layers of 50 units and Tanh activations, and the covariance as a learned diagonal matrix independent of state.
|
| 308 |
+
|
| 309 |
+
To allow the latent representation $z$ to provide commands for the goal-conditioned policy, we separately train a reconstruction network $\psi$ which minimizes the loss function $\mathbb { E } _ { s } [ \lVert \psi ( \phi ( s ) ) - s \rVert _ { 2 } ]$ . For any latent $z$ , we can now use $\psi ( z )$ as an input into the goal-conditioned policy. Note that an alternative method of providing commands in latent space is to train a new goal-conditioned policy $\pi _ { \phi }$ , which is trained to minimize the loss $\mathbb { E } _ { s , g } [ D _ { K L } ( \pi _ { \phi } ( \cdot | s , \phi ( g ) ) \| \pi ( \cdot | s , g ) ) ]$ , however to maintain abstraction between the representation and the goal-conditioned policy, we choose the former approach.
|
| 310 |
+
|
| 311 |
+
# A.6 HIERARCHICAL REINFORCEMENT LEARNING IN CLUSTER SPACE
|
| 312 |
+
|
| 313 |
+
We provide comparisons on using the learned representation to direct a goal-conditioned policy in cluster space, as described in Section 4. We consider navigation through a sequence of rooms in order in the rooms and wheeled rooms environment, as visualized in Figure 4. A sequence of 50 checkpoints are sampled uniformly from the four rooms with the extra constraint that the same room is never repeated two checkpoints in a row (that is, each checkpoint is chosen to be any of the four rooms), and held fixed for the entirety of the experiment. The agent is tasked with going through these rooms in order, receiving a $+ 1$ reward every time it enters the appropriate room. The policy receives as input the state of the agent, and which number checkpoint the agent is currently trying to reach (encoded as a 50-dimensional one-hot vector).
|
| 314 |
+
|
| 315 |
+
After having learned a representation $\phi$ using some set of trajectory data, as described in Appendix A.2, we run $k$ -means clustering on states in the trajectory data to cluster latent states in the representation into $k$ components. We then consider learning a high-level policy $\pi _ { h } ( c _ { h } \vert s )$ which outputs a cluster between $\{ 1 \ldots k \}$ . Given a cluster number $c _ { h }$ from the high-level policy, the low-level policy samples a latent state $z _ { h }$ uniformly from the cluster, and then proceeds to command a learnt goal-conditioned policy exactly as described in Appendix A.5.
|
| 316 |
+
|
| 317 |
+
Specifically, we learn a high-level policy of the form $\pi _ { h } ( c _ { h } | s ) \sim \mathrm { C a t e g o r i c a l } ( p _ { \theta } ( s ) )$ using TRPO where the probabilities for each cluster are specified by a neural network $\pi _ { \theta }$ which has two layers of 50 units each, with Tanh activations, and a final Softmax activation to normalize outputs into the probability simplex.
|
| 318 |
+
|
| 319 |
+
We performed hyperparameter sweeps over $k$ - the number of clusters - for each representation method.
|
| 320 |
+
|
| 321 |
+
# B BENCHMARK REPRESENTATIONS
|
| 322 |
+
|
| 323 |
+
We provide the loss functions that are used to train each of the representations evaluated in our work. All representations are trained on a dataset of trajectories $\mathcal { D } \stackrel { - } { = } \{ \tau _ { i } \} _ { i = 1 } ^ { n }$ . We use the notation $s \sim \mathcal { D }$ to denote sampling a state uniformly at random from a trajectory uniformly at random from the dataset. We use the notation $s _ { t } , s _ { t + 1 } \sim \mathcal { D }$ to denote sampling a state and the state right after it according to the same uniform sampling scheme.
|
| 324 |
+
|
| 325 |
+
• ARC - After precomputing $D _ { a c t }$ :a matrix of actionable distances, we train a neural network $\phi$ to minimize
|
| 326 |
+
|
| 327 |
+
$$
|
| 328 |
+
\begin{array} { r l r } & { } & { D _ { a c t } \big ( s _ { i } , s _ { j } \big ) = \mathbb { E } _ { s \sim \mathcal { D } } \left[ D _ { K L } \big ( \pi ( a | s , s _ { i } ) \| \pi ( a | s , s _ { j } ) \big ) \right] } \\ & { } & { \mathcal { L } ( \phi ) = \mathbb { E } _ { s \sim \mathcal { D } } \left[ \mathbb { E } _ { s ^ { \prime } \sim \mathcal { D } } \left[ \| \| \phi ( s ) - \phi ( s ^ { \prime } ) \| - D _ { a c t } ( s , s ^ { \prime } ) \| ^ { 2 } \right] \right] } \end{array}
|
| 329 |
+
$$
|
| 330 |
+
|
| 331 |
+
• VAE (Kingma & Welling, 2013) - Given $q _ { \phi } ( z | x ) = \mathcal { N } ( \mu _ { \phi } ( x ) , \sigma _ { \phi } ( x ) ) , p _ { \theta } ( x | z ) = $ $\mathcal { N } ( \psi _ { \theta } ( z ) , \bar { I } )$ , and $p ( z ) = \bar { \mathcal { N } } ( 0 , I )$
|
| 332 |
+
|
| 333 |
+
$$
|
| 334 |
+
\mathcal { L } ( \phi , \theta ) = \mathbb { E } _ { s \sim \mathcal { D } } \left[ \mathbb { E } _ { z \sim q _ { \phi } ( x ) } \left[ \log p _ { \theta } ( x | z ) - \beta D _ { K L } \big ( q _ { \theta } ( z | x ) \| p ( z ) \big ) \right] \right]
|
| 335 |
+
$$
|
| 336 |
+
|
| 337 |
+
Here $\mu _ { \phi } , \sigma _ { \phi } , \psi _ { \theta }$ are all neural networks, and $\beta$ is a tunable hyperparameter. The loglikelihood term is equivalent to minimizing mean squared error.
|
| 338 |
+
|
| 339 |
+
• Slowness (Jonschkowski & Brock, 2015) - Given $q _ { \phi } ( z | x ) = \mathcal { N } ( \mu _ { \phi } ( x ) , \sigma _ { \phi } ( x ) ) , p _ { \theta } ( x | z ) =$ $\mathcal { N } ( \psi _ { \theta } ( z ) , I )$ , and $p ( z ) = \mathcal { N } ( 0 , I )$
|
| 340 |
+
|
| 341 |
+
$$
|
| 342 |
+
\begin{array} { r } { \mathcal { L } ( \phi , \theta ) = \mathbb { E } _ { ( s _ { t } , s _ { t + 1 } ) \sim \mathcal { D } } \left[ \mathbb { E } _ { z \sim q _ { \phi } ( s _ { t } ) } \left[ \log p \theta ( s _ { t } | z ) - \beta D _ { K L } ( q _ { \theta } ( z | x ) \| p ( z ) ) - \alpha \| \mu _ { \theta } ( s _ { t + 1 } - \mu _ { \theta } ( s _ { t } ) \| ] \right] \right] } \end{array}
|
| 343 |
+
$$
|
| 344 |
+
|
| 345 |
+
Here $\mu _ { \phi } , \sigma _ { \phi } , \psi _ { \theta }$ are all neural networks, and $\alpha , \beta$ are tunable hyperparameters. The loglikelihood terms are equivalent to minimizing mean squared error.
|
| 346 |
+
|
| 347 |
+
• Predictive Model (Oh et al., 2015) - Given $z = \phi ( s _ { t } )$ , $\hat { z } _ { t + 1 } = f ( z , a )$ and $\psi ( z ) = \hat { s }$ , we
|
| 348 |
+
|
| 349 |
+
$$
|
| 350 |
+
\mathcal { L } ( \phi , f , \psi ) = \mathbb { E } _ { ( s _ { t } , a _ { t } , s _ { t + 1 } ) \sim \mathcal { D } } \left[ \| s _ { t + 1 } - \psi ( f ( \phi ( s _ { t } ) , a _ { t } ) ) \| _ { 2 } ^ { 2 } \right]
|
| 351 |
+
$$
|
| 352 |
+
|
| 353 |
+
where $\phi$ is the learnt representation, $f$ a model in representation space, and $\psi$ a reconstruction network retrieving are all neural networks.
|
| 354 |
+
|
| 355 |
+
• Inverse Model (Burda et al., 2018a) - Given $z _ { t } ~ = ~ \phi ( s _ { t } ) , \hat { z } _ { t + 1 } ~ = ~ f ( z _ { t } , a ) , \hat { a } _ { t + 1 } ~ = ~$ $g ( z _ { t } , z _ { t + 1 } )$
|
| 356 |
+
|
| 357 |
+
$$
|
| 358 |
+
\mathcal { L } ( \phi , f , g ) = \mathbb { E } _ { ( s _ { t } , a _ { t } , a _ { t + 1 } ) \sim \mathcal { D } } \left[ \| a _ { t } - g ( \phi ( s _ { t } ) , \phi ( s _ { t + 1 } ) ) \| _ { 2 } ^ { 2 } + \beta \| \phi ( s _ { t + 1 } ) - f ( \phi ( s _ { t } ) , a _ { t } ) \| _ { 2 } ^ { 2 } \right]
|
| 359 |
+
$$
|
| 360 |
+
|
| 361 |
+
Here, $\phi$ is the learnt representation, $f$ is a learnt model in the representation space, and $g$ is a learnt inverse dynamics model in the representation space. $\beta$ is a hyperparameter which controls how forward prediction error is balanced with inverse prediction error.
|
| 362 |
+
|
| 363 |
+
# C TASK DESCRIPTIONS
|
| 364 |
+
|
| 365 |
+
• 2D Navigation This environment consists of an agent navigating to points in an environment, either with a wall as in Figure 4a or with four rooms, as in Figure 4b. The state space is 2-dimensional, consisting of the Cartesian coordinates of the agent. The agent has acceleration control, so the action space is 2-dimensional. Downstream tasks for this environment include reaching target locations in the environment and navigating through a sequence of 50 rooms.
|
| 366 |
+
|
| 367 |
+
• Wheeled Navigation This environment consists of a car navigating to locations in an empty region, or with four rooms, as illustrated in Figure 4. The state space is 6-dimensional, consisting of the Cartesian coordinates, heading, forward velocity, and angular velocity of the car. The agent controls the velocity of both of its wheels, resulting in a 2-dimensional action space. Goal-conditioned policies are trained within a $3 \times 3$ meter square.
|
| 368 |
+
|
| 369 |
+
Downstream tasks for wheeled navigation include reaching target locations in the environment, navigating through sequences of rooms, and navigating through sequences of waypoints.
|
| 370 |
+
|
| 371 |
+
• Ant This task requires a quadrupedal ant robot navigating in free space.The state space is 15-dimensional, consisting of the Cartesian coordinates of the ant, body orientation as a quaternion, and all the joint angles of the ant. The agent must use torque control to control it’s joints, resulting in an 8-dimensional action space. Goal conditioned policies are trained within a $2 \times 2$ meter square.
|
| 372 |
+
|
| 373 |
+
Downstream tasks for the ant include reaching target locations in the environment, navigating through sequences of waypoints, and reaching target locations while avoiding other locations.
|
| 374 |
+
|
| 375 |
+
• Sawyer This environment involves a Sawyer manipulator and a freely moving block on a table-top. The state space is 6-dimensional, consisting of the Cartesian coordinates of the end-effector of the Sawyer, and the Cartesian coordinates of the block. The Sawyer is controlled via end-effector position control with a 3-dimensional action space.
|
| 376 |
+
|
| 377 |
+
Because training a goal-conditioned policy takes an inordinate number of samples for the Sawyer environment, we instead use the following shaped reward to train the GCVF where $h ( s ) { \overline { { } } }$ is the position of the hand and $o ( s )$ is the position of the object
|
| 378 |
+
|
| 379 |
+
$$
|
| 380 |
+
r _ { s h a p e d } ( s , g ) = r _ { s p a r s e } ( s , g ) - \| h ( s ) - o ( s ) \| - 2 \| o ( s ) - o ( g ) \|
|
| 381 |
+
$$
|
| 382 |
+
|
| 383 |
+
# D HYPERPARAMETER TUNING
|
| 384 |
+
|
| 385 |
+
We perform hyperparameter tuning on three ends: one to discover appropriate parameters for each representation for each environment which are then held constant for the experimental analysis, then on the downstream applications, to choose a scaling factor for reward shaping (see Appendix A.3), and to choose the number of clusters for the hierarchical RL experiments in cluster space (see Appendix A.6).
|
| 386 |
+
|
| 387 |
+
To discover appropriate parameters for each representation for the legged and wheeled locomotion environments, we evaluate representations on the downstream reward-shaping task, performing a hyperparameter sweep on latent dimension and the parameters which weigh the various terms in the representation learning objectives. We keep the network architecture fixed for each representation and each task. We emphasize carefully here that the ARC representation requires no parameters to tune beyond the size of the latent dimension, and we perform a hyperparameter sweep on the penalty terms to ensure that other methods aren’t improperly penalized. On the size of the latent dimension, we sweep over $\{ 2 , 3 , 4 \}$ for wheeled locomotion and $\{ 3 , 5 , 7 , 9 , 1 1 \}$ for the ant. For the relative weighting for the penalty terms for the comparison representations (defined by $\beta$ in Appendix B), we evaluate possible values $\beta \in \{ 4 ^ { - 2 } , 4 ^ { - 1 } , \dot { 1 } , 4 ^ { 1 } , 4 ^ { 2 } \}$ . These representations are then fixed and used for all the downstream applications.
|
| 388 |
+
|
| 389 |
+
For reward shaping, we tune the relative scales between the sparse reward and the shaping term, (denoted by $\alpha$ in Appendix A.3) over possible values $\alpha \in \{ 1 , 4 ^ { 1 } , 4 ^ { 2 } , 4 ^ { 3 } , 4 ^ { 4 } \}$ for each representation on both the legged and wheeled locomotion environments. Tuning for $\alpha$ is required because the representations may have different latent dimensions and different scales, and chose to perform this hyperparameter sweep instead of adding a term to the representation learning objectives to ensure uniformity in scale. For performing $k$ -means clustering on the HRL cluster experiments, we sweep over possible values $k \in \{ 4 , 5 , 6 , 7 , 8 \}$ for each representation on the room navigation tasks for 2D and wheeled navigation, but however found that most representations were robust to choice of the number of clusters.
|
md/train/HyyP33gAZ/HyyP33gAZ.md
ADDED
|
@@ -0,0 +1,607 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ACTIVATION MAXIMIZATION GENERATIVE ADVERSARIAL NETS
|
| 2 |
+
|
| 3 |
+
Zhiming Zhou, Han Cai Shanghai Jiao Tong University heyohai,hcai $@$ apex.sjtu.edu.cn
|
| 4 |
+
|
| 5 |
+
Shu Rong
|
| 6 |
+
Yitu Tech
|
| 7 |
+
shu.rong@yitu-inc.com
|
| 8 |
+
|
| 9 |
+
Yuxuan Song, Kan Ren Shanghai Jiao Tong University songyuxuan,kren $@$ apex.sjtu.edu.cn
|
| 10 |
+
|
| 11 |
+
Jun Wang University College London j.wang@cs.ucl.ac.uk
|
| 12 |
+
|
| 13 |
+
Weinan Zhang, Yu Yong Shanghai Jiao Tong University wnzhang $@$ sjtu.edu.cn, yyu@apex.sjtu.edu.cn
|
| 14 |
+
|
| 15 |
+
# ABSTRACT
|
| 16 |
+
|
| 17 |
+
Class labels have been empirically shown useful in improving the sample quality of generative adversarial nets (GANs). In this paper, we mathematically study the properties of the current variants of GANs that make use of class label information. With class aware gradient and cross-entropy decomposition, we reveal how class labels and associated losses influence GAN’s training. Based on that, we propose Activation Maximization Generative Adversarial Networks (AM-GAN) as an advanced solution. Comprehensive experiments have been conducted to validate our analysis and evaluate the effectiveness of our solution, where AM-GAN outperforms other strong baselines and achieves state-of-the-art Inception Score (8.91) on CIFAR-10. In addition, we demonstrate that, with the Inception ImageNet classifier, Inception Score mainly tracks the diversity of the generator, and there is, however, no reliable evidence that it can reflect the true sample quality. We thus propose a new metric, called AM Score, to provide more accurate estimation on the sample quality. Our proposed model also outperforms the baseline methods in the new metric.
|
| 18 |
+
|
| 19 |
+
# 1 INTRODUCTION
|
| 20 |
+
|
| 21 |
+
Generative adversarial nets (GANs) (Goodfellow et al., 2014) as a new way for learning generative models, has recently shown promising results in various challenging tasks, such as realistic image generation (Nguyen et al., 2016b; Zhang et al., 2016; Gulrajani et al., 2017), conditional image generation (Huang et al., 2016b; Cao et al., 2017; Isola et al., 2016), image manipulation (Zhu et al., 2016) and text generation (Yu et al., 2016).
|
| 22 |
+
|
| 23 |
+
Despite the great success, it is still challenging for the current GAN models to produce convincing samples when trained on datasets with high variability, even for image generation with low resolution, e.g., CIFAR-10. Meanwhile, people have empirically found taking advantages of class labels can significantly improve the sample quality.
|
| 24 |
+
|
| 25 |
+
There are three typical GAN models that make use of the label information: CatGAN (Springenberg, 2015) builds the discriminator as a multi-class classifier; LabelGAN (Salimans et al., 2016) extends the discriminator with one extra class for the generated samples; AC-GAN (Odena et al., 2016) jointly trains the real-fake discriminator and an auxiliary classifier for the specific real classes. By taking the class labels into account, these GAN models show improved generation quality and stability. However, the mechanisms behind them have not been fully explored (Goodfellow, 2016).
|
| 26 |
+
|
| 27 |
+
In this paper, we mathematically study GAN models with the consideration of class labels. We derive the gradient of the generator’s loss w.r.t. class logits in the discriminator, named as class-aware gradient, for LabelGAN (Salimans et al., 2016) and further show its gradient tends to guide each generated sample towards being one of the specific real classes. Moreover, we show that AC-GAN (Odena et al., 2016) can be viewed as a GAN model with hierarchical class discriminator. Based on the analysis, we reveal some potential issues in the previous methods and accordingly propose a new method to resolve these issues.
|
| 28 |
+
|
| 29 |
+
Specifically, we argue that a model with explicit target class would provide clearer gradient guidance to the generator than an implicit target class model like that in (Salimans et al., 2016). Comparing with (Odena et al., 2016), we show that introducing the specific real class logits by replacing the overall real class logit in the discriminator usually works better than simply training an auxiliary classifier. We argue that, in (Odena et al., 2016), adversarial training is missing in the auxiliary classifier, which would make the model more likely to suffer mode collapse and produce low quality samples. We also experimentally find that predefined label tends to result in intra-class mode collapse and correspondingly propose dynamic labeling as a solution. The proposed model is named as Activation Maximization Generative Adversarial Networks (AM-GAN). We empirically study the effectiveness of AM-GAN with a set of controlled experiments and the results are consistent with our analysis and, note that, AM-GAN achieves the state-of-the-art Inception Score (8.91) on CIFAR-10.
|
| 30 |
+
|
| 31 |
+
In addition, through the experiments, we find the commonly used metric needs further investigation. In our paper, we conduct a further study on the widely-used evaluation metric Inception Score (Salimans et al., 2016) and its extended metrics. We show that, with the Inception Model, Inception Score mainly tracks the diversity of generator, while there is no reliable evidence that it can measure the true sample quality. We thus propose a new metric, called AM Score, to provide more accurate estimation on the sample quality as its compensation. In terms of AM Score, our proposed method also outperforms other strong baseline methods.
|
| 32 |
+
|
| 33 |
+
The rest of this paper is organized as follows. In Section 2, we introduce the notations and formulate the LabelGAN (Salimans et al., 2016) and AC-GAN∗ (Odena et al., 2016) as our baselines. We then derive the class-aware gradient for LabelGAN, in Section 3, to reveal how class labels help its training. In Section 4, we reveal the overlaid-gradient problem of LabelGAN and propose AM-GAN as a new solution, where we also analyze the properties of AM-GAN and build its connections to related work. In Section 5, we introduce several important extensions, including the dynamic labeling as an alternative of predefined labeling (i.e., class condition), the activation maximization view and a technique for enhancing the AC-GAN∗. We study Inception Score in Section 6 and accordingly propose a new metric AM Score. In Section 7, we empirically study AM-GAN and compare it to the baseline models with different metrics. Finally we conclude the paper and discuss the future work in Section 8.
|
| 34 |
+
|
| 35 |
+
# 2 PRELIMINARIES
|
| 36 |
+
|
| 37 |
+
In the original GAN formulation (Goodfellow et al., 2014), the loss functions of the generator $G$ and the discriminator $D$ are given as:
|
| 38 |
+
|
| 39 |
+
$$
|
| 40 |
+
\begin{array} { r l } & { \overset { \vartriangle } { \hat { L } _ { G } ^ { \mathrm { a v } } } = - \mathbb { E } _ { z \sim p _ { z } ( z ) } [ \log D _ { r } ( G ( z ) ) ] \triangleq - \mathbb { E } _ { x \sim G } [ \log D _ { r } ( x ) ] , } \\ & { \overset { \mathrm { o n i } } { L _ { D } ^ { \mathrm { o n } } } = - \mathbb { E } _ { x \sim p _ { \mathrm { d a t a } } } [ \log D _ { r } ( x ) ] - \mathbb { E } _ { x \sim G } [ \log ( 1 - D _ { r } ( x ) ) ] , } \end{array}
|
| 41 |
+
$$
|
| 42 |
+
|
| 43 |
+
where $D$ performs binary classification between the real and the generated samples and $D _ { r } ( x )$ represents the probability of the sample $x$ coming from the real data.
|
| 44 |
+
|
| 45 |
+
# 2.1 LABELGAN
|
| 46 |
+
|
| 47 |
+
The framework (see Eq. (1)) has been generalized to multi-class case where each sample $x$ has its associated class label $y \in \{ 1 , . . . , K , K { + } 1 \}$ , and the $K { + } 1 ^ { \mathrm { t h } }$ label corresponds to the generated samples (Salimans et al., 2016). Its loss functions are defined as:
|
| 48 |
+
|
| 49 |
+
$$
|
| 50 |
+
\begin{array} { r l } & { L _ { G } ^ { \mathrm { l a b } } = - \mathbb { E } _ { x \sim G } [ \log { \sum _ { i = 1 } ^ { K } } D _ { i } ( x ) ] \stackrel { \Delta } { = } - \mathbb { E } _ { x \sim G } [ \log D _ { r } ( x ) ] , } \\ & { L _ { D } ^ { \mathrm { l a b } } = - \mathbb { E } _ { ( x , y ) \sim p _ { \mathrm { d a t a } } } [ \log D _ { y } ( x ) ] - \mathbb { E } _ { x \sim G } [ \log D _ { K + 1 } ( x ) ] , } \end{array}
|
| 51 |
+
$$
|
| 52 |
+
|
| 53 |
+
where $D _ { i } ( x )$ denotes the probability of the sample $x$ being class $i$ . The loss can be written in the form of cross-entropy, which will simplify our later analysis:
|
| 54 |
+
|
| 55 |
+
$$
|
| 56 |
+
L _ { G } ^ { \mathrm { l a b } } = \mathbb { E } _ { x \sim G } [ H ( [ 1 , 0 ] , [ D _ { r } ( x ) , D _ { K + 1 } ( x ) ] ) ] ,
|
| 57 |
+
$$
|
| 58 |
+
|
| 59 |
+
$$
|
| 60 |
+
L _ { D } ^ { \mathrm { l a b } } = \mathbb { E } _ { ( x , y ) \sim p _ { \mathrm { d a t a } } } [ H ( v ( y ) , D ( x ) ) ] + \mathbb { E } _ { x \sim G } [ H ( v ( K + 1 ) , D ( x ) ) ] ,
|
| 61 |
+
$$
|
| 62 |
+
|
| 63 |
+
where $D ( x ) = [ D _ { 1 } ( x ) , D _ { 2 } ( x ) , . . . , D _ { K + 1 } ( x ) ]$ and $v ( y ) = \left[ v _ { 1 } ( y ) , \ldots , v _ { K + 1 } ( y ) \right]$ with $v _ { i } \left( y \right) = 0$ if $i \neq$ $y$ and $v _ { i } \left( y \right) = 1$ if $i = y$ . $H$ is the cross-entropy, defined as $\scriptstyle H ( p , q ) = - \sum _ { i } p _ { i } \log q _ { i }$ . We would refer the above model as LabelGAN (using class labels) throughout this paper.
|
| 64 |
+
|
| 65 |
+
# 2.2 AC-GAN∗
|
| 66 |
+
|
| 67 |
+
Besides extending the original two-class discriminator as discussed in the above section, Odena et al. (2016) proposed an alternative approach, i.e., AC-GAN, to incorporate class label information, which introduces an auxiliary classifier $C$ for real classes in the original GAN framework. With the core idea unchanged, we define a variant of AC-GAN as the following, and refer it as AC-GAN∗:
|
| 68 |
+
|
| 69 |
+
$$
|
| 70 |
+
\begin{array} { r l } & { L _ { G } ^ { \mathrm { a c } } ( x , y ) = \mathbb { E } _ { ( x , y ) \sim G } \big [ H \big ( [ 1 , 0 ] , [ D _ { r } ( x ) , D _ { f } ( x ) ] \big ) \big ] } \\ & { \qquad + \mathbb { E } _ { ( x , y ) \sim G } \big [ H \big ( u ( y ) , C ( x ) \big ) \big ] , } \\ & { L _ { D } ^ { \mathrm { a c } } ( x , y ) = \mathbb { E } _ { ( x , y ) \sim p _ { \mathrm { d a u } } } \big [ H \big ( [ 1 , 0 ] , [ D _ { r } ( x ) , D _ { f } ( x ) ] \big ) \big ] + \mathbb { E } _ { ( x , y ) \sim G } \big [ H \big ( [ 0 , 1 ] , [ D _ { r } ( x ) , D _ { f } ( x ) ] \big ) \big ] } \\ & { \qquad + \mathbb { E } _ { ( x , y ) \sim p _ { \mathrm { d a u } } } \big [ H \big ( u ( y ) , C ( x ) \big ) \big ] , } \end{array}
|
| 71 |
+
$$
|
| 72 |
+
|
| 73 |
+
where $D _ { r } ( x )$ and $D _ { f } ( x ) = 1 - D _ { r } ( x )$ are outputs of the binary discriminator which are the same as vanilla GAN, $u ( \cdot )$ is the vectorizing operator that is similar to $v ( \cdot )$ but defined with $K$ classes, and $C ( x )$ is the probability distribution over $K$ real classes given by the auxiliary classifier.
|
| 74 |
+
|
| 75 |
+
In AC-GAN, each sample has a coupled target class $y$ , and a loss on the auxiliary classifier w.r.t. $y$ is added to the generator to leverage the class label information. We refer the losses on the auxiliary classifier, i.e., Eq. (7) and (9), as the auxiliary classifier losses.
|
| 76 |
+
|
| 77 |
+
The above formulation is a modified version of the original AC-GAN. Specifically, we omit the auxiliary classifier loss $\mathbb { E } _ { ( x , y ) \sim G } [ H ( u ( y ) , C ( x ) ) ]$ which encourages the auxiliary classifier $C$ to classify the fake sample $x$ to its target class $y$ . Further discussions are provided in Section 5.3. Note that we also adopt the $- \log ( D _ { r } ( x ) )$ loss in generator.
|
| 78 |
+
|
| 79 |
+
# 3 CLASS-AWARE GRADIENT
|
| 80 |
+
|
| 81 |
+
In this section, we introduce the class-aware gradient, i.e., the gradient of the generator’s loss w.r.t. class logits in the discriminator. By analyzing the class-aware gradient of LabelGAN, we find that the gradient tends to refine each sample towards being one of the classes, which sheds some light on how the class label information helps the generator to improve the generation quality. Before delving into the details, we first introduce the following lemma on the gradient properties of the cross-entropy loss to make our analysis clearer.
|
| 82 |
+
|
| 83 |
+
Lemma 1. With l being the logits vector and $\sigma$ being the softmax function, let $\sigma ( l )$ be the current softmax probability distribution and $\hat { p }$ denote the target probability distribution, then
|
| 84 |
+
|
| 85 |
+
$$
|
| 86 |
+
- \frac { \partial H \big ( \hat { p } , \sigma ( l ) \big ) } { \partial l } = \hat { p } - \sigma ( l ) .
|
| 87 |
+
$$
|
| 88 |
+
|
| 89 |
+
For a generated sample $x$ , the loss in LabelGAN is ${ \cal L } _ { G } ^ { \mathrm { l a b } } ( x ) = H ( [ 1 , 0 ] , [ D _ { r } ( x ) , D _ { K + 1 } ( x ) ] )$ , as defined in Eq. (4). With Lemma 1, the gradient of $L _ { G } ^ { \mathrm { l a b } } ( x )$ w.r.t. the logits vector $l ( x )$ is given as:
|
| 90 |
+
|
| 91 |
+
$$
|
| 92 |
+
\begin{array} { r l } & { \quad - \displaystyle \frac { \partial I _ { G } ^ { \mathrm { l a b } } ( x ) } { \partial l _ { k } ( x ) } = - \displaystyle \frac { \partial H \bigl ( [ 1 , 0 ] , [ D _ { r } ( x ) , D _ { K + 1 } ( x ) ] \bigr ) } { \partial l _ { r } ( x ) } \displaystyle \frac { \partial l _ { r } ( x ) } { \partial l _ { k } ( x ) } = \bigl ( 1 - D _ { r } ( x ) \bigr ) \displaystyle \frac { D _ { k } ( x ) } { D _ { r } ( x ) } , \quad k \in \{ 1 , \ldots , K \} , } \\ & { - \displaystyle \frac { \partial I _ { G } ^ { \mathrm { l a b } } ( x ) } { \partial l _ { K + 1 } ( x ) } = - \displaystyle \frac { \partial H \bigl ( [ 1 , 0 ] , [ D _ { r } ( x ) , D _ { K + 1 } ( x ) ] \bigr ) } { \partial l _ { K + 1 } ( x ) } = 0 - D _ { K + 1 } ( x ) = - \bigl ( 1 - D _ { r } ( x ) \bigr ) . } \end{array}
|
| 93 |
+
$$
|
| 94 |
+
|
| 95 |
+
With the above equations, the gradient of $L _ { G } ^ { \mathrm { l a b } } ( x )$ w.r.t. $x$ is:
|
| 96 |
+
|
| 97 |
+
$$
|
| 98 |
+
\begin{array} { l } { \displaystyle - \frac { \partial L _ { G } ^ { \mathrm { l a b } } ( x ) } { \partial x } = \sum _ { k = 1 } ^ { K } - \frac { \partial L _ { G } ^ { \mathrm { l a b } } ( x ) } { \partial l _ { k } ( x ) } \frac { \partial l _ { k } ( x ) } { \partial x } - \frac { \partial L _ { G } ^ { \mathrm { l a b } } ( x ) } { \partial l _ { K + 1 } ( x ) } \frac { \partial l _ { K + 1 } ( x ) } { \partial x } } \\ { \displaystyle = \left( 1 - D _ { r } ( x ) \right) \left( \sum _ { k = 1 } ^ { K } \frac { D _ { k } ( x ) } { D _ { r } ( x ) } \frac { \partial l _ { k } ( x ) } { \partial x } - \frac { \partial l _ { K + 1 } ( x ) } { \partial x } \right) = \left( 1 - D _ { r } ( x ) \right) \sum _ { k = 1 } ^ { K + 1 } \alpha _ { k } ^ { \mathrm { l a b } } ( x ) \frac { \partial l _ { k } ( x ) } { \partial x } , } \end{array}
|
| 99 |
+
$$
|
| 100 |
+
|
| 101 |
+
where
|
| 102 |
+
|
| 103 |
+
$$
|
| 104 |
+
\alpha _ { k } ^ { \mathrm { l a b } } ( x ) = \left\{ \begin{array} { l l } { \frac { D _ { k } ( x ) } { D _ { r } ( x ) } } & { k \in \{ 1 , \ldots , K \} } \\ { - 1 } & { k = K + 1 } \end{array} \right. .
|
| 105 |
+
$$
|
| 106 |
+
|
| 107 |
+

|
| 108 |
+
Figure 1: An illustration of the overlaid-gradient problem. When two or more classes are encouraged at the same time, the combined gradient may direct to none of these classes. It could be addressed by assigning each generated sample a specific target class instead of the overall real class.
|
| 109 |
+
|
| 110 |
+
From the formulation, we find that the overall gradient w.r.t. a generated example $x$ is $1 - D _ { r } ( x )$ which is the same as that in vanilla GAN (Goodfellow et al., 2014). And the gradient on real classes is further distributed to each specific real class logit $l _ { k } ( x )$ according to its current probability ratio $\frac { D _ { k } ( x ) } { D _ { r } ( x ) }$ .
|
| 111 |
+
|
| 112 |
+
As such, the gradient naturally takes the label information into consideration: for a generated sample, higher probability of a certain class will lead to a larger step towards the direction of increasing the corresponding confidence for the class. Hence, individually, the gradient from the discriminator for each sample tends to refine it towards being one of the classes in a probabilistic sense.
|
| 113 |
+
|
| 114 |
+
That is, each sample in LabelGAN is optimized to be one of the real classes, rather than simply to be real as in the vanilla GAN. We thus regard LabelGAN as an implicit target class model. Refining each generated sample towards one of the specific classes would help improve the sample quality. Recall that there are similar inspirations in related work. Denton et al. (2015) showed that the result could be significantly better if GAN is trained with separated classes. And AC-GAN (Odena et al., 2016) introduces an extra loss that forces each sample to fit one class and achieves a better result.
|
| 115 |
+
|
| 116 |
+
# 4 THE PROPOSED METHOD
|
| 117 |
+
|
| 118 |
+
In LabelGAN, the generator gets its gradients from the $K$ specific real class logits in discriminator and tends to refine each sample towards being one of the classes. However, LabelGAN actually suffers from the overlaid-gradient problem: all real class logits are encouraged at the same time. Though it tends to make each sample be one of these classes during the training, the gradient of each sample is a weighted averaging over multiple label predictors. As illustrated in Figure 1, the averaged gradient may be towards none of these classes.
|
| 119 |
+
|
| 120 |
+
In multi-exclusive classes setting, each valid sample should only be classified to one of classes by the discriminator with high confidence. One way to resolve the above problem is to explicitly assign each generated sample a single specific class as its target.
|
| 121 |
+
|
| 122 |
+
# 4.1 AM-GAN
|
| 123 |
+
|
| 124 |
+
Assigning each sample a specific target class $y$ , the loss functions of the revised-version LabelGAN can be formulated as:
|
| 125 |
+
|
| 126 |
+
$$
|
| 127 |
+
\begin{array} { r l } & { L _ { G } ^ { \mathrm { a m } } = \mathbb { E } _ { ( x , y ) \sim G } [ H ( v ( y ) , D ( x ) ) ] , } \\ & { L _ { D } ^ { \mathrm { a m } } = \mathbb { E } _ { ( x , y ) \sim p _ { \mathrm { d a t a } } } [ H ( v ( y ) , D ( x ) ) ] + \mathbb { E } _ { x \sim G } [ H ( v ( K { + } 1 ) , D ( x ) ) ] , } \end{array}
|
| 128 |
+
$$
|
| 129 |
+
|
| 130 |
+
where $v ( y )$ is with the same definition as in Section 2.1. The model with aforementioned formulation is named as Activation Maximization Generative Adversarial Networks (AM-GAN) in our paper. And the further interpretation towards naming will be in Section 5.2. The only difference between AM-GAN and LabelGAN lies in the generator’s loss function. Each sample in AM-GAN has a specific target class, which resolves the overlaid-gradient problem.
|
| 131 |
+
|
| 132 |
+
AC-GAN (Odena et al., 2016) also assigns each sample a specific target class, but we will show that the AM-GAN and AC-GAN are substantially different in the following part of this section.
|
| 133 |
+
|
| 134 |
+

|
| 135 |
+
Figure 2: AM-GAN (left) v.s. AC-GAN∗ (right). AM-GAN can be viewed as a combination of LabelGAN and auxiliary classifier, while $\mathbf { A C - G A N ^ { * } }$ is a combination of vanilla GAN and auxiliary classifier. AM-GAN can naturally conduct adversarial training among all the classes, while in $\mathbf { A C - G A N ^ { * } }$ , adversarial training is only conducted at the real-fake level and missing in the auxiliary classifier.
|
| 136 |
+
|
| 137 |
+
# 4.2 LABELGAN $^ +$ AUXILIARY CLASSIFIER
|
| 138 |
+
|
| 139 |
+
Both LabelGAN and AM-GAN are GAN models with $K { + 1 }$ classes. We introduce the following cross-entropy decomposition lemma to build their connections to GAN models with two classes and the $K$ -classes models (i.e., the auxiliary classifiers).
|
| 140 |
+
|
| 141 |
+
Lemma 2. Given $v = [ v _ { 1 } , \ldots , v _ { K + 1 } ] ,$ , $v _ { 1 : K } \triangleq \left[ v _ { 1 } , \dots , v _ { K } \right]$ , $\textstyle v _ { r } \ \triangleq \sum _ { k = 1 } ^ { K } v _ { k }$ , $R ( v ) \ { \triangleq } \ v _ { 1 : K } / v _ { r }$ and $F ( v ) \triangleq [ v _ { r } , v _ { K + 1 } ] ,$ , let $\hat { p } = [ \hat { p } _ { 1 } , \dots , \hat { p } _ { K + 1 } ]$ , $p = [ p _ { 1 } , \ldots , p _ { K + 1 } ] ,$ , then we have
|
| 142 |
+
|
| 143 |
+
$$
|
| 144 |
+
H \big ( \hat { p } , p \big ) = \hat { p } _ { r } H \big ( R ( \hat { p } ) , R ( p ) \big ) + H \big ( F ( \hat { p } ) , F ( p ) \big ) .
|
| 145 |
+
$$
|
| 146 |
+
|
| 147 |
+
With Lemma 2, the loss function of the generator in AM-GAN can be decomposed as follows:
|
| 148 |
+
|
| 149 |
+
$$
|
| 150 |
+
\begin{array} { r } { L _ { G } ^ { \mathrm { a m } } ( x ) = H \big ( v ( x ) , D ( x ) \big ) = v _ { r } ( x ) \ \cdot \underbrace { H \big ( R \big ( v ( x ) \big ) , R \big ( D ( x ) \big ) \big ) } _ { \mathrm { A u s i l i a r y ~ C l a s s i f i e r ~ G ~ L o s s } } + \ \underbrace { H \big ( F \big ( v ( x ) \big ) , F \big ( D ( x ) \big ) \big ) } _ { \mathrm { L a p e l G M N G ~ L o s s } } . } \end{array}
|
| 151 |
+
$$
|
| 152 |
+
|
| 153 |
+
The second term of Eq. (17) actually equals to the loss function of the generator in LabelGAN:
|
| 154 |
+
|
| 155 |
+
$$
|
| 156 |
+
\begin{array} { r } { H \big ( F \big ( v ( x ) \big ) , F \big ( D ( x ) \big ) \big ) = H \big ( \big [ 1 , 0 \big ] , \big [ D _ { r } ( x ) , D _ { K + 1 } ( x ) \big ] \big ) = L _ { G } ^ { \mathrm { l a b } } ( x ) . } \end{array}
|
| 157 |
+
$$
|
| 158 |
+
|
| 159 |
+
Similar analysis can be adapted to the first term and the discriminator. Note that $v _ { r } \left( x \right)$ equals to one. Interestingly, we find by decomposing the AM-GAN losses, AM-GAN can be viewed as a combination of LabelGAN and auxiliary classifier (defined in Section 2.2). From the decomposition perspective, disparate to AM-GAN, AC-GAN is a combination of vanilla GAN and the auxiliary classifier.
|
| 160 |
+
|
| 161 |
+
The auxiliary classifier loss in Eq. (17) can also be viewed as the cross-entropy version of generator loss in CatGAN: the generator of CatGAN directly optimizes entropy $H ( R ( D ( x ) ) )$ to make each sample have a high confidence of being one of the classes, while AM-GAN achieves this by the first term of its decomposed loss $H ( R ( \bar { v } ( x ) ) , R ( D ( x ) ) )$ in terms of cross-entropy with given target distribution. That is, the AM-GAN is the combination of the cross-entropy version of CatGAN and LabelGAN. We extend the discussion between AM-GAN and CatGAN in the Appendix B.
|
| 162 |
+
|
| 163 |
+
# 4.3 NON-HIERARCHICAL MODEL
|
| 164 |
+
|
| 165 |
+
With the Lemma 2, we can also reformulate the AC-GAN∗ as a $K { + 1 }$ classes model. Take the generator’s loss function as an example:
|
| 166 |
+
|
| 167 |
+
$$
|
| 168 |
+
\begin{array} { r l } & { L _ { G } ^ { \mathrm { a c } } ( x , y ) = \mathbb { E } _ { ( x , y ) \sim G } \left[ H \bigl ( [ 1 , 0 ] , [ D _ { r } ( x ) , D _ { f } ( x ) ] \bigr ) + H \bigl ( u ( y ) , C ( x ) \bigr ) \right] } \\ & { \quad \quad \quad = \mathbb { E } _ { ( x , y ) \sim G } \left[ H \bigl ( v ( y ) , [ D _ { r } ( x ) \cdot C ( x ) , D _ { f } ( x ) ] \bigr ) \right] . } \end{array}
|
| 169 |
+
$$
|
| 170 |
+
|
| 171 |
+
In the $K { + 1 }$ classes model, the $K { + 1 }$ classes distribution is formulated as $[ D _ { r } ( x ) \cdot C ( x ) , D _ { f } ( x ) ]$ AC-GAN introduces the auxiliary classifier in the consideration of leveraging the side information of class label, it turns out that the formulation of $\mathbf { A C - G A N ^ { * } }$ can be viewed as a hierarchical $K { + 1 }$ classes model consists of a two-class discriminator and a $K$ -class auxiliary classifier, as illustrated in Figure 2. Conversely, AM-GAN is a non-hierarchical model. All $K { + 1 }$ classes stay in the same level of the discriminator in AM-GAN.
|
| 172 |
+
|
| 173 |
+
In the hierarchical model $\mathbf { A C - G A N ^ { * } }$ , adversarial training is only conducted at the real-fake twoclass level, while misses in the auxiliary classifier. Adversarial training is the key to the theoretical guarantee of global convergence $p _ { \mathrm { G } } = p _ { \mathrm { d a t a } }$ . Taking the original GAN formulation as an instance, if generated samples collapse to a certain point $x$ , i.e., $p _ { \mathrm { G } } ( x ) > p _ { \mathrm { d a t a } } ( x )$ , then there must exit another point $x ^ { \prime }$ with $p _ { \mathrm { G } } ( x ^ { \prime } ) < p _ { \mathrm { d a t a } } ( x ^ { \prime } )$ . Given the optimal $\begin{array} { r } { D ( x ) = \frac { p _ { \mathrm { d a t a } } ( x ) } { p _ { \mathrm { G } } ( x ) + p _ { \mathrm { d a t a } } ( x ) } } \end{array}$ pdata(x)pG(x)+pdata(x) , the collapsed point x will get a relatively lower score. And with the existence of higher score points (e.g. $x ^ { \prime }$ ), maximizing the generator’s expected score, in theory, has the strength to recover from the mode-collapsed state. In practice, the $p _ { \mathrm { G } }$ and $p _ { \mathrm { d a t a } }$ are usually disjoint (Arjovsky & Bottou, 2017), nevertheless, the general behaviors stay the same: when samples collapse to a certain point, they are more likely to get a relatively lower score from the adversarial network.
|
| 174 |
+
|
| 175 |
+
Without adversarial training in the auxiliary classifier, a mode-collapsed generator would not get any penalties from the auxiliary classifier loss. In our experiments, we find AC-GAN is more likely to get mode-collapsed, and it was empirically found reducing the weight (such as 0.1 used in Gulrajani et al. (2017)) of the auxiliary classifier losses would help. In Section 5.3, we introduce an extra adversarial training in the auxiliary classifier with which we improve AC-GAN∗’s training stability and sample-quality in experiments. On the contrary, AM-GAN, as a non-hierarchical model, can naturally conduct adversarial training among all the class logits.
|
| 176 |
+
|
| 177 |
+
# 5 EXTENSIONS
|
| 178 |
+
|
| 179 |
+
# 5.1 DYNAMIC LABELING
|
| 180 |
+
|
| 181 |
+
In the above section, we simply assume each generated sample has a target class. One possible solution is like AC-GAN (Odena et al., 2016), predefining each sample a class label, which substantially results in a conditional GAN. Actually, we could assign each sample a target class according to its current probability estimated by the discriminator. A natural choice could be the class which is of the maximal probability currently: $y ( x ) \triangleq \operatorname { a r g m a x } _ { i \in \{ 1 , . . . , K \} } D _ { i } ( x )$ for each generated sample $x$ . We name this dynamic labeling.
|
| 182 |
+
|
| 183 |
+
According to our experiments, dynamic labeling brings important improvements to AM-GAN, and is applicable to other models that require target class for each generated sample, e.g. AC-GAN, as an alternative to predefined labeling.
|
| 184 |
+
|
| 185 |
+
We experimentally find GAN models with pre-assigned class label tend to encounter intra-class mode collapse. In addition, with dynamic labeling, the GAN model remains generating from pure random noises, which has potential benefits, e.g. making smooth interpolation across classes in the latent space practicable.
|
| 186 |
+
|
| 187 |
+
# 5.2 THE ACTIVATION MAXIMIZATION VIEW
|
| 188 |
+
|
| 189 |
+
Activation maximization is a technique which is traditionally applied to visualize the neuron(s) of pretrained neural networks (Nguyen et al., 2016a;b; Erhan et al., 2009).
|
| 190 |
+
|
| 191 |
+
The GAN training can be viewed as an Adversarial Activation Maximization Process. To be more specific, the generator is trained to perform activation maximization for each generated sample on the neuron that represents the log probability of its target class, while the discriminator is trained to distinguish generated samples and prevents them from getting their desired high activation.
|
| 192 |
+
|
| 193 |
+
It is worth mentioning that the sample that maximizes the activation of one neuron is not necessarily of high quality. Traditionally people introduce various priors to counter the phenomenon (Nguyen et al., 2016a;b). In GAN, the adversarial process of GAN training can detect unrealistic samples and thus ensures the high-activation is achieved by high-quality samples that strongly confuse the discriminator.
|
| 194 |
+
|
| 195 |
+
We thus name our model the Activation Maximization Generative Adversarial Network (AM-GAN).
|
| 196 |
+
|
| 197 |
+
# 5.3 AC-GAN∗+
|
| 198 |
+
|
| 199 |
+
Experimentally we find AC-GAN easily get mode collapsed and a relatively low weight for the auxiliary classifier term in the generator’s loss function would help. In the Section 4.3, we attribute mode collapse to the miss of adversarial training in the auxiliary classifier. From the adversarial activation maximization view: without adversarial training, the auxiliary classifier loss that requires high activation on a certain class, cannot ensure the sample quality.
|
| 200 |
+
|
| 201 |
+
That is, in AC-GAN, the vanilla GAN loss plays the role for ensuring sample quality and avoiding mode collapse. Here we introduce an extra loss to the auxiliary classifier in AC-GAN∗ to enforce adversarial training and experimentally find it consistently improve the performance:
|
| 202 |
+
|
| 203 |
+
$$
|
| 204 |
+
L _ { D } ^ { \mathrm { a c + } } ( x , y ) = \mathbb { E } _ { ( x , y ) \sim G } \bigl [ H \bigl ( u ( \cdot ) , C ( x ) \bigr ) \bigr ] ,
|
| 205 |
+
$$
|
| 206 |
+
|
| 207 |
+
where $u ( \cdot )$ represents the uniform distribution, which in spirit is the same as CatGAN (Springenberg, 2015).
|
| 208 |
+
|
| 209 |
+
Recall that we omit the auxiliary classifier loss $\mathbb { E } _ { ( x , y ) \sim G } \big [ H \big ( u ( y ) \big ]$ in $\mathbf { A C - G A N ^ { * } }$ . According to our experiments, $\mathbb { E } _ { ( x , y ) \sim G } [ H ( u ( y ) ]$ does improve AC-GAN∗’s stability and make it less likely to get mode collapse, but it also leads to a worse Inception Score. We will report the detailed results in Section 7. Our understanding on this phenomenon is that: by encouraging the auxiliary classifier also to classify fake samples to their target classes, it actually reduces the auxiliary classifier’s ability on providing gradient guidance towards the real classes, and thus also alleviates the conflict between the GAN loss and the auxiliary classifier loss.
|
| 210 |
+
|
| 211 |
+
# 6 EVALUATION METRICS
|
| 212 |
+
|
| 213 |
+
One of the difficulties in generative models is the evaluation methodology (Theis et al., 2015). In this section, we conduct both the mathematical and the empirical analysis on the widely-used evaluation metric Inception Score (Salimans et al., 2016) and other relevant metrics. We will show that Inception Score mainly works as a diversity measurement and we propose the AM Score as a compensation to Inception Score for estimating the generated sample quality.
|
| 214 |
+
|
| 215 |
+
# 6.1 INCEPTION SCORE
|
| 216 |
+
|
| 217 |
+
As a recently proposed metric for evaluating the performance of generative models, Inception Score has been found well correlated with human evaluation (Salimans et al., 2016), where a publiclyavailable Inception model $C$ pre-trained on ImageNet is introduced. By applying the Inception model to each generated sample $x$ and getting the corresponding class probability distribution $C ( x )$ , Inception Score is calculated via
|
| 218 |
+
|
| 219 |
+
$$
|
| 220 |
+
\operatorname { I n c e p t i o n } { \operatorname { S c o r e } } = \exp { \big ( } \mathbb { E } _ { x } { \big [ } \mathrm { K L } { \big ( } C ( x ) \parallel { \bar { C } } ^ { G } { \big ) } { \big ] } { \big ) } ,
|
| 221 |
+
$$
|
| 222 |
+
|
| 223 |
+
where $\mathbb { E } _ { x }$ is short of $\mathbb { E } _ { x \sim G }$ and $\bar { C } ^ { G } = \mathbb { E } _ { x } [ C ( x ) ]$ is the overall probability distribution of the generated samples over classes, which is judged by $C$ , and KL denotes the Kullback-Leibler divergence. As proved in Appendix D, $\mathbb { E } _ { x } \big [ \mathrm { K L } \big ( \dot { C } ( \dot { x } ) \| \dot { C } ^ { G } \big ) \big ]$ can be decomposed into two terms in entropy:
|
| 224 |
+
|
| 225 |
+
$$
|
| 226 |
+
\operatorname { \mathbb { E } } _ { x } \left[ \operatorname { K L } ( C ( x ) \parallel \bar { C } ^ { G } ) \right] = H ( \bar { C } ^ { G } ) + ( - \operatorname { \mathbb { E } } _ { x } \left[ H \bigl ( C ( x ) \bigr ) \right] ) .
|
| 227 |
+
$$
|
| 228 |
+
|
| 229 |
+
# 6.2 THE PROPERTIES OF INCEPTION MODEL
|
| 230 |
+
|
| 231 |
+
A common understanding of how Inception Score works lies in that a high score in the first term $H ( \bar { C } ^ { G } )$ indicates the generated samples have high diversity (the overall class probability distribution evenly distributed), and a high score in the second term $- \mathbb { E } _ { x } [ H ( C ( x ) ) ]$ indicates that each individual sample has high quality (each generated sample’s class probability distribution is sharp, i.e., it can be classified into one of the real classes with high confidence) (Salimans et al., 2016).
|
| 232 |
+
|
| 233 |
+
However, taking CIFAR-10 as an illustration, the data are not evenly distributed over the classes under the Inception model trained on ImageNet, which is presented in Figure 4a. It makes Inception Score problematic in the view of the decomposed scores, i.e., $H ( \bar { C } ^ { G } )$ and $- \mathbb { E } _ { x } [ H ( C ( x ) ) ]$ . Such as that one would ask whether a higher $H ( \bar { C } ^ { G } )$ indicates a better mode coverage and whether a smaller $H ( C ( x ) )$ indicates a better sample quality.
|
| 234 |
+
|
| 235 |
+

|
| 236 |
+
Figure 3: Training curves of Inception Score and its decomposed terms. a) Inception Score, i.e. $\mathrm { e x p } ( H ( \bar { C } ^ { G } ) - \mathbb { E } _ { x } \bar { [ } H ( C ( x ) ) ] )$ ; b) $\bar { H } ( \bar { C } ^ { G } )$ ; c) $\mathbb { E } _ { x } [ H ( C ( x ) ) ]$ . A common understanding of Inception Score is that: the value of $\bar { H ( C ^ { G } ) }$ measures the diversity of generated samples and is expected to increase in the training process. However, it usually tends to decrease in practice as illustrated in (c).
|
| 237 |
+
|
| 238 |
+

|
| 239 |
+
Figure 4: Statistics of the CIFAR-10 training images. a) $\bar { C } ^ { G }$ over ImageNet classes; b) $H ( C ( x ) )$ distribution with ImageNet classifier of each class; c) $H ( C ( x ) )$ distribution with CIFAR-10 classifier of each class. With the Inception model, the value of $H ( C ( x ) )$ score of CIFAR-10 training data is variant, which means, even in real data, it would still strongly prefer some samples than some others. $H ( C ( x ) )$ on a classifier that pre-trained on CIFAR-10 has low values for all CIFAR-10 training data and thus can be used as an indicator of sample quality.
|
| 240 |
+
|
| 241 |
+
We experimentally find that, as in Figure 3b, the value of $H ( \bar { C } ^ { G } )$ is usually going down during the training process, however, which is expected to increase. And when we delve into the detail of $H ( C ( x ) )$ for each specific sample in the training data, we find the value of $H ( C ( x ) )$ score is also variant, as illustrated in Figure $^ \mathrm { 4 b }$ , which means, even in real data, it would still strongly prefer some samples than some others. The exp operator in Inception Score and the large variance of the value of $H ( C ( x ) )$ aggravate the phenomenon. We also observe the preference on the class level in Figure 4b, e.g., $\vec { \mathbb { E } } _ { x } [ H ( \bar { C } ( x ) ) ] { = } 2 . 1 \bar { 4 }$ for trucks, while $\mathbb { E } _ { x } [ H ( C ( x ) ) ] { = } \bar { 3 } . 8 0$ for birds.
|
| 242 |
+
|
| 243 |
+
It seems, for an ImageNet Classifier, both the two indicators of Inception Score cannot work correctly.
|
| 244 |
+
Next we will show that Inception Score actually works as a diversity measurement.
|
| 245 |
+
|
| 246 |
+
# 6.3 INCEPTION SCORE AS A DIVERSITY MEASUREMENT
|
| 247 |
+
|
| 248 |
+
Since the two individual indicators are strongly correlated, here we go back to Inception Score’s original formulation $\mathbb { E } _ { x } [ { \mathrm { K L } } ( C ( x ) \parallel { \bar { C } } ^ { G } ) ]$ . In this form, we could interpret Inception Score as that it requires each sample’s distribution $C ( x )$ highly different from the overall distribution of the generator $\bar { C } ^ { \dot { G } }$ , which indicates a good diversity over the generated samples.
|
| 249 |
+
|
| 250 |
+
As is empirically observed, a mode-collapsed generator usually gets a low Inception Score. In an extreme case, assuming all the generated samples collapse to a single point, then ${ \dot { C } } ( x ) { = } C ^ { G }$ and we would get the minimal Inception Score 1.0, which is the exp result of zero. To simulate mode collapse in a more complicated case, we design synthetic experiments as following: given a set of $N$ points $\left\{ x _ { 0 } , x _ { 1 } , x _ { 2 } , . . . , x _ { N - 1 } \right\}$ , with each point $x _ { i }$ adopting the distribution $C ( x _ { i } ) = v ( i )$ and representing class $i$ , where $v ( i )$ is the vectorization operator of length $N$ , as defined in Section 2.1, we randomly drop $m$ points, evaluate $\mathbb { E } _ { x } [ { \mathrm { K L } } ( C ( x ) \parallel { \bar { C } } ^ { G } ) ]$ and draw the curve. As is showed in Figure 5, when $N - m$ increases, the value of $\mathbb { E } _ { x } [ { \mathrm { K L } } ( C ( x ) \parallel { \bar { C } } ^ { G } ) ]$ monotonically increases in general, which means that it can well capture the mode dropping and the diversity of the generated distributions.
|
| 251 |
+
|
| 252 |
+

|
| 253 |
+
Figure 5: Mode dropping analysis of Inception Score. a) Uniform density over classes; b) Gaussian density over classes. The value of $\mathbb { E } _ { x } [ { \mathrm { K L } } ( C ( x ) \parallel \bar { C } ^ { G } ) ]$ monotonically increases in general as the number of kept classes increases, which illustrates Inception Score is able to capture the mode dropping and the diversity of the generated distributions. The error bar indicates the min and max values in 1000 random dropping.
|
| 254 |
+
|
| 255 |
+

|
| 256 |
+
Figure 6: Training curves of AM Score and its decomposed terms. a) AM Score, i.e. ${ \mathrm { K L } } ( \bar { C } ^ { \mathrm { t r a i n } } , \bar { C } ^ { G } ) +$ $\mathbb { E } _ { x } { \ ' } [ H ( C ( x ) ) ]$ ; b) ${ \mathrm { K L } } ( \bar { C } ^ { \mathrm { t r a i n } } , \bar { C } ^ { G } )$ ; c) $\mathbb { E } _ { x } [ H ( C ( x ) ) ]$ . All of them works properly (going down) in the training process.
|
| 257 |
+
|
| 258 |
+
One remaining question is that whether good mode coverage and sample diversity mean high quality of the generated samples. From the above analysis, we do not find any evidence. A possible explanation is that, in practice, sample diversity is usually well correlated with the sample quality.
|
| 259 |
+
|
| 260 |
+
# 6.4 AM SCORE WITH ACCORDINGLY PRETRAINED CLASSIFIER
|
| 261 |
+
|
| 262 |
+
Note that if each point $x _ { i }$ has multiple variants such as $x _ { i } ^ { 1 }$ , $x _ { i } ^ { 2 }$ , $x _ { i } ^ { 3 }$ , one of the situations, where $x _ { i } ^ { 2 }$ and $x _ { i } ^ { 3 }$ are missing and only $x ^ { 1 }$ is generated, cannot be detected by $\mathbb { E } _ { x } [ { \mathrm { K L } } ( C ( x ) \parallel \bar { C } ^ { G } ) ]$ score. It means that with an accordingly pretrained classifier, $\mathbb { E } _ { x } [ { \mathrm { K L } } ( C ( x ) \parallel { \bar { C } } ^ { G } ) ]$ score cannot detect intra-class level mode collapse. This also explains why the Inception Network on ImageNet could be a good candidate $C$ for CIFAR-10. Exploring the optimal $C$ is a challenge problem and we shall leave it as a future work.
|
| 263 |
+
|
| 264 |
+
However, there is no evidence that using an Inception Network trained on ImageNet can accurately measure the sample quality, as shown in Section 6.2. To compensate Inception Score, we propose to introduce an extra assessment using an accordingly pretrained classifier. In the accordingly pretrained classifier, most real samples share similar $H ( C ( x ) )$ and $9 9 . 6 \%$ samples hold scores less than 0.05 as showed in Figure $_ \mathrm { 4 c }$ , which demonstrates that $H ( C ( x ) )$ of the classifier can be used as an indicator of sample quality.
|
| 265 |
+
|
| 266 |
+
The entropy term on $\bar { C } ^ { G }$ is actually problematic when training data is not evenly distributed over classes, for that argmin $H ( \bar { C } ^ { G } )$ is a uniform distribution. To take the $\bar { C } ^ { \mathrm { t r a i n } }$ into account, we replace $H ( \bar { C } ^ { G } )$ with a KL divergence between $\bar { C } ^ { \mathrm { t r a i n } }$ and $\bar { C } ^ { G }$ . So that
|
| 267 |
+
|
| 268 |
+
$$
|
| 269 |
+
\mathrm { A M } \mathrm { S c o r e } \triangleq \mathrm { K L } ( \bar { C } ^ { \mathrm { t r a i n } } , \bar { C } ^ { G } ) + \mathbb { E } _ { x } \big [ H \big ( C ( x ) \big ) \big ] ,
|
| 270 |
+
$$
|
| 271 |
+
|
| 272 |
+
which requires $\bar { C } ^ { G }$ close to $\bar { C } ^ { \mathrm { t r a i n } }$ and each sample $x$ has a low entropy $C ( x )$ . The minimal value of AM Score is zero, and the smaller value, the better. A sample training curve of AM Score is showed in Figure 6, where all indicators in AM Score work as expected.
|
| 273 |
+
|
| 274 |
+
Table 1: Inception Score and AM Score Results. Models in the same column share the same network structures $\&$ hyper-parameters. We applied dynamic / predefined labeling for models that require target classes.
|
| 275 |
+
|
| 276 |
+
<table><tr><td rowspan="2">Model</td><td colspan="4">Inception Score</td><td colspan="4">AMScore</td></tr><tr><td colspan="2">CIFAR-10</td><td colspan="2">Tiny ImageNet</td><td colspan="2">CIFAR-10</td><td colspan="2">Tiny ImageNet</td></tr><tr><td></td><td>dynamic</td><td>predefined</td><td>dynamic</td><td>predefined</td><td>dynamic</td><td>predefined</td><td>dynamic</td><td>predefined</td></tr><tr><td>GAN</td><td>7.04 ±0.06</td><td>7.27± 0.07</td><td>-</td><td></td><td>0.45±0.00</td><td>0.43±0.00</td><td></td><td></td></tr><tr><td>GAN*</td><td>7.25 ±0.07</td><td>7.31 ±0.10</td><td>-</td><td></td><td>0.40±0.00</td><td>0.41 ±0.00</td><td>-</td><td>1</td></tr><tr><td>AC-GAN*</td><td>7.41 ± 0.09</td><td>7.79±0.08</td><td>7.28 ±0.07</td><td>7.89± 0.11</td><td>0.17 ±0.00</td><td>0.16±0.00</td><td>1.64 ± 0.02</td><td>1.01 ± 0.01</td></tr><tr><td>AC-GAN*+</td><td>8.56± 0.11</td><td>8.01±0.09</td><td>10.25±0.14</td><td>8.23±0.10</td><td>0.10 ��0.00</td><td>0.14 ±0.00</td><td>1.04 ± 0.01</td><td>1.20 ± 0.01</td></tr><tr><td>LabelGAN</td><td>8.63±0.08</td><td>7.88 ± 0.07</td><td>10.82 ±0.16</td><td>8.62 ± 0.11</td><td>0.13±0.00</td><td>0.25±0.00</td><td>1.11 ± 0.01</td><td>1.37 ± 0.01</td></tr><tr><td>AM-GAN</td><td>8.83± 0.09</td><td>8.35± 0.12</td><td>11.45 ± 0.15</td><td>9.55 ± 0.11</td><td>0.08 ± 0.00</td><td>0.05±0.00</td><td>0.88±0.01</td><td>0.61± 0.01</td></tr></table>
|
| 277 |
+
|
| 278 |
+
Table 2: The maximum value of mean MS-SSIM of various models over the ten classes on CIFAR-10. High-value indicates obvious intra-class mode collapse. Please refer to the Figure 11 in the Appendix for the visual results.
|
| 279 |
+
|
| 280 |
+
<table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>AC-GAN*</td><td rowspan=1 colspan=1>AC-GAN*+</td><td rowspan=1 colspan=1>LabelGAN</td><td rowspan=1 colspan=1>AM-GAN</td></tr><tr><td rowspan=1 colspan=1>dynamic</td><td rowspan=1 colspan=1>0.61</td><td rowspan=1 colspan=1>0.39</td><td rowspan=1 colspan=1>0.35</td><td rowspan=1 colspan=1>0.36</td></tr><tr><td rowspan=1 colspan=1>predefined</td><td rowspan=1 colspan=1>0.35</td><td rowspan=1 colspan=1>0.36</td><td rowspan=1 colspan=1>0.32</td><td rowspan=1 colspan=1>0.36</td></tr></table>
|
| 281 |
+
|
| 282 |
+
# 7 EXPERIMENTS
|
| 283 |
+
|
| 284 |
+
To empirically validate our analysis and the effectiveness of the proposed method, we conduct experiments on the image benchmark datasets including CIFAR-10 and Tiny-ImageNet2 which comprises 200 classes with 500 training images per class. For evaluation, several metrics are used throughout our experiments, including Inception Score with the ImageNet classifier, AM Score with a corresponding pretrained classifier for each dataset, which is a DenseNet (Huang et al., 2016a) model. We also follow Odena et al. (2016) and use the mean MS-SSIM (Wang et al., 2004) of randomly chosen pairs of images within a given class, as a coarse detector of intra-class mode collapse.
|
| 285 |
+
|
| 286 |
+
A modified DCGAN structure, as listed in the Appendix F, is used in experiments. Visual results of various models are provided in the Appendix considering the page limit, such as Figure 9, etc. The repeatable experiment code is published for further research3.
|
| 287 |
+
|
| 288 |
+
# 7.1 EXPERIMENTS ON CIFAR-10
|
| 289 |
+
|
| 290 |
+
# 7.1.1 GAN WITH AUXILIARY CLASSIFIER
|
| 291 |
+
|
| 292 |
+
The first question is whether training an auxiliary classifier without introducing correlated losses to the generator would help improve the sample quality. In other words, with the generator only with the GAN loss in the AC-GAN∗ setting. (referring as $\mathrm { G A N ^ { * } }$ )
|
| 293 |
+
|
| 294 |
+
As is shown in Table 1, it improves GAN’s sample quality, but the improvement is limited comparing to the other methods. It indicates that introduction of correlated loss plays an essential role in the remarkable improvement of GAN training.
|
| 295 |
+
|
| 296 |
+
# 7.1.2 COMPARISON AMONG DIFFERENT MODELS
|
| 297 |
+
|
| 298 |
+
The usage of the predefined label would make the GAN model transform to its conditional version, which is substantially disparate with generating samples from pure random noises. In this experiment, we use dynamic labeling for $\mathbf { A C - G A N ^ { * } }$ , AC-GAN $^ { * + }$ and AM-GAN to seek for a fair comparison among different discriminator models, including LabelGAN and GAN. We keep the network structure and hyper-parameters the same for different models, only difference lies in the output layer of the discriminator, i.e., the number of class logits, which is necessarily different across models.
|
| 299 |
+
|
| 300 |
+
As is shown in Table 1, AC-GAN∗ achieves improved sample quality over vanilla GAN, but sustains mode collapse indicated by the value 0.61 in MS-SSIM as in Table 2. By introducing adversarial training in the auxiliary classifier, $\mathrm { \bf A C { - } G A N ^ { * + } }$ outperforms AC-GAN∗. As an implicit target class model, LabelGAN suffers from the overlaid-gradient problem and achieves a relatively higher per sample entropy (0.124) in the AM Score, comparing to explicit target class model AM-GAN (0.079) and $\mathrm { A C - G A N ^ { * + } }$ (0.102). In the table, our proposed AM-GAN model reaches the best scores against these baselines.
|
| 301 |
+
|
| 302 |
+
Table 3: Inception Score comparison on CIFAR-10. Splitting GAN uses the class splitting technique to enhance the class label information, which is orthogonal to AM-GAN.
|
| 303 |
+
|
| 304 |
+
<table><tr><td>Model</td><td>Score ± Std.</td></tr><tr><td>DFM(Warde-Farley & Bengio, 2017)</td><td>7.72 ± 0.13</td></tr><tr><td>Improved GAN (Salimans et al., 2016)</td><td>8.09 ± 0.07</td></tr><tr><td>AC-GAN (Odena et al., 2016) WGAN-GP + AC (Gulrajani et al., 2017)</td><td>8.25 ± 0.07</td></tr><tr><td>SGAN (Huang et al., 2016b)</td><td>8.42 ± 0.10</td></tr><tr><td>AM-GAN (our work)</td><td>8.59 ± 0.12</td></tr><tr><td></td><td>8.91 ± 0.11</td></tr><tr><td>Splitting GAN (Guillermo et al., 2017)</td><td>8.87 ± 0.09</td></tr><tr><td>Real data</td><td>11.24 ± 0.12</td></tr></table>
|
| 305 |
+
|
| 306 |
+
We also test AC-GAN∗ with decreased weight on auxiliary classifier losses in the generator ( 110 relative to the GAN loss). It achieves 7.19 in Inception Score, 0.23 in AM Score and 0.35 in MS-SSIM. The 0.35 in MS-SSIM indicates there is no obvious mode collapse, which also conform with our above analysis.
|
| 307 |
+
|
| 308 |
+
# 7.1.3 INCEPTION SCORE COMPARING WITH RELATED WORK
|
| 309 |
+
|
| 310 |
+
AM-GAN achieves Inception Score 8.83 in the previous experiments, which significantly outperforms the baseline models in both our implementation and their reported scores as in Table 3. By further enhancing the discriminator with more filters in each layer, AM-GAN also outperforms the orthogonal work (Guillermo et al., 2017) that enhances the class label information via class splitting. As the result, AM-GAN achieves the state-of-the-art Inception Score 8.91 on CIFAR-10.
|
| 311 |
+
|
| 312 |
+
# 7.1.4 DYNAMIC LABELING AND CLASS CONDITION
|
| 313 |
+
|
| 314 |
+
It’s found in our experiments that GAN models with class condition (predefined labeling) tend to encounter intra-class mode collapse (ignoring the noise), which is obvious at the very beginning of GAN training and gets exasperated during the process.
|
| 315 |
+
|
| 316 |
+
In the training process of GAN, it is important to ensure a balance between the generator and the discriminator. With the same generator’s network structures and switching from dynamic labeling to class condition, we find it hard to hold a good balance between the generator and the discriminator: to avoid the initial intra-class mode collapse, the discriminator need to be very powerful; however, it usually turns out the discriminator is too powerful to provide suitable gradients for the generator and results in poor sample quality.
|
| 317 |
+
|
| 318 |
+
Nevertheless, we find a suitable discriminator and conduct a set of comparisons with it. The results can be found in Table 1. The general conclusion is similar to the above, AC-GAN $^ { * + }$ still outperforms AC-GAN∗ and our AM-GAN reaches the best performance. It’s worth noticing that the AC-GAN∗ does not suffer from mode collapse in this setting.
|
| 319 |
+
|
| 320 |
+
In the class conditional version, although with fine-tuned parameters, Inception Score is still relatively low. The explanation could be that, in the class conditional version, the sample diversity still tends to decrease, even with a relatively powerful discriminator. With slight intra-class mode collapse, the per-sample-quality tends to improve, which results in a lower AM Score. A supplementary evidence, not very strict, of partial mode collapse in the experiments is that: the $\sum | \frac { \partial G ( z ) } { \partial z } |$ is around 45.0 in dynamic labeling setting, while it is 25.0 in the conditional version.
|
| 321 |
+
|
| 322 |
+
The LabelGAN does not need explicit labels and the model is the same in the two experiment settings. But please note that both Inception Score and the AM Score get worse in the conditional version. The only difference is that the discriminator becomes more powerful with an extended layer, which attests that the balance between the generator and discriminator is crucial. We find that, without the concern of intra-class mode collapse, using the dynamic labeling makes the balance between generator and discriminator much easier.
|
| 323 |
+
|
| 324 |
+

|
| 325 |
+
Figure 7: The training curves of different models in the dynamic labeling setting.
|
| 326 |
+
|
| 327 |
+
# 7.1.5 THE $\mathbb { E } _ { ( x , y ) \sim G } [ H ( u ( y ) , C ( x ) ) ] \operatorname { L C }$ SS
|
| 328 |
+
|
| 329 |
+
Note that we report results of the modified version of AC-GAN, i.e., AC-GAN∗ in Table 1. If we take the omitted loss $\mathbb { E } _ { ( x , y ) \sim G } [ H ( u ( y ) , C ( x ) ) ]$ back to $\mathrm { \mathbf { A C } \mathrm { - } G A N ^ { * } }$ , which leads to the original AC-GAN (see Section 2.2), it turns out to achieve worse results on both Inception Score and AM Score on CIFAR-10, though dismisses mode collapse. Specifically, in dynamic labeling setting, Inception Score decreases from 7.41 to 6.48 and the AM Score increases from 0.17 to 0.43, while in predefined class setting, Inception Score decreases from 7.79 to 7.66 and the AM Score increases from 0.16 to 0.20.
|
| 330 |
+
|
| 331 |
+
This performance drop might be because we use different network architectures and hyper-parameters from AC-GAN (Odena et al., 2016). But we still fail to achieve its report Inception Score, i.e., 8.25, on CIFAR-10 when using the reported hyper-parameters in the original paper. Since they do not publicize the code, we suppose there might be some unreported details that result in the performance gap. We would leave further studies in future work.
|
| 332 |
+
|
| 333 |
+
# 7.1.6 THE LEARNING PROPERTY
|
| 334 |
+
|
| 335 |
+
We plot the training curve in terms of Inception Score and AM Score in Figure 7. Inception Score and AM Score are evaluated with the same number of samples $5 0 k$ , which is the same as Salimans et al. (2016). Comparing with Inception Score, AM Score is more stable in general. With more samples, Inception Score would be more stable, however the evaluation of Inception Score is relatively costly. A better alternative of the Inception Model could help solve this problem.
|
| 336 |
+
|
| 337 |
+
The AC-GAN∗’s curves appear stronger jitter relative to the others. It might relate to the counteract between the auxiliary classifier loss and the GAN loss in the generator. Another observation is that the AM-GAN in terms of Inception Score is comparable with LabelGAN and $\mathbf { A C - G A N ^ { * + } }$ at the beginning, while in terms of AM Score, they are quite distinguishable from each other.
|
| 338 |
+
|
| 339 |
+
# 7.2 EXPERIMENTS ON TINY-IMAGENET
|
| 340 |
+
|
| 341 |
+
In the CIFAR-10 experiments, the results are consistent with our analysis and the proposed method outperforms these strong baselines. We demonstrate that the conclusions can be generalized with experiments in another dataset Tiny-ImageNet.
|
| 342 |
+
|
| 343 |
+
The Tiny-ImageNet consists with more classes and fewer samples for each class than CIFAR-10, which should be more challenging. We downsize Tiny-ImageNet samples from $6 4 \times 6 4$ to $3 2 \times 3 2$ and simply leverage the same network structure that used in CIFAR-10, and the experiment result is showed also in Table 1. From the comparison, AM-GAN still outperforms other methods remarkably. And the $\mathrm { \bf A C { - } G A N ^ { * + } }$ gains better performance than AC-GAN∗.
|
| 344 |
+
|
| 345 |
+
# 8 CONCLUSION
|
| 346 |
+
|
| 347 |
+
In this paper, we analyze current GAN models that incorporate class label information. Our analysis shows that: LabelGAN works as an implicit target class model, however it suffers from the overlaidgradient problem at the meantime, and explicit target class would solve this problem. We demonstrate that introducing the class logits in a non-hierarchical way, i.e., replacing the overall real class logit in the discriminator with the specific real class logits, usually works better than simply supplementing an auxiliary classifier, where we provide an activation maximization view for GAN training and highlight the importance of adversarial training. In addition, according to our experiments, predefined labeling tends to lead to intra-class mode collapsed, and we propose dynamic labeling as an alternative. Our extensive experiments on benchmarking datasets validate our analysis and demonstrate our proposed AM-GAN’s superior performance against strong baselines. Moreover, we delve deep into the widelyused evaluation metric Inception Score, reveal that it mainly works as a diversity measurement. And we also propose AM Score as a compensation to more accurately estimate the sample quality.
|
| 348 |
+
|
| 349 |
+
In this paper, we focus on the generator and its sample quality, while some related work focuses on the discriminator and semi-supervised learning. For future work, we would like to conduct empirical studies on discriminator learning and semi-supervised learning. We extend AM-GAN to unlabeled data in the Appendix C, where unsupervised and semi-supervised is accessible in the framework of AM-GAN. The classifier-based evaluation metric might encounter the problem related to adversarial samples, which requires further study. Combining AM-GAN with Integral Probability Metric based GAN models such as Wasserstein GAN (Arjovsky et al., 2017) could also be a promising direction since it is orthogonal to our work.
|
| 350 |
+
|
| 351 |
+
# REFERENCES
|
| 352 |
+
|
| 353 |
+
Arjovsky, Martin and Bottou, Léon. Towards principled methods for training generative adversarial networks. In ICLR, 2017.
|
| 354 |
+
Arjovsky, Martin, Chintala, Soumith, and Bottou, Léon. Wasserstein gan. arXiv preprint arXiv:1701.07875, 2017.
|
| 355 |
+
Cao, Yun, Zhou, Zhiming, Zhang, Weinan, and Yu, Yong. Unsupervised diverse colorization via generative adversarial networks. arXiv preprint, 2017.
|
| 356 |
+
Che, Tong, Li, Yanran, Jacob, Athul Paul, Bengio, Yoshua, and Li, Wenjie. Mode regularized generative adversarial networks. arXiv preprint arXiv:1612.02136, 2016.
|
| 357 |
+
Denton, Emily L, Chintala, Soumith, Fergus, Rob, et al. Deep generative image models using a laplacian pyramid of adversarial networks. In Advances in neural information processing systems, pp. 1486–1494, 2015.
|
| 358 |
+
Erhan, Dumitru, Bengio, Yoshua, Courville, Aaron, and Vincent, Pascal. Visualizing higher-layer features of a deep network. University of Montreal, 1341:3, 2009.
|
| 359 |
+
Goodfellow, Ian. Nips 2016 tutorial: Generative adversarial networks. arXiv preprint arXiv:1701.00160, 2016.
|
| 360 |
+
Goodfellow, Ian, Pouget-Abadie, Jean, Mirza, Mehdi, Xu, Bing, Warde-Farley, David, Ozair, Sherjil, Courville, Aaron, and Bengio, Yoshua. Generative adversarial nets. In Advances in neural information processing systems, pp. 2672–2680, 2014.
|
| 361 |
+
Guillermo, L. Grinblat, Lucas, C. Uzal, and Pablo, M. Granitto. Class-splitting generative adversarial networks. arXiv preprint arXiv:1709.07359, 2017.
|
| 362 |
+
Gulrajani, Ishaan, Ahmed, Faruk, Arjovsky, Martin, Dumoulin, Vincent, and Courville, Aaron. Improved training of wasserstein gans. arXiv preprint arXiv:1704.00028, 2017.
|
| 363 |
+
Heusel, Martin, Ramsauer, Hubert, Unterthiner, Thomas, Nessler, Bernhard, Klambauer, Günter, and Hochreiter, Sepp. Gans trained by a two time-scale update rule converge to a nash equilibrium. arXiv preprint arXiv:1706.08500, 2017.
|
| 364 |
+
Huang, Gao, Liu, Zhuang, Weinberger, Kilian Q, and van der Maaten, Laurens. Densely connected convolutional networks. arXiv preprint arXiv:1608.06993, 2016a.
|
| 365 |
+
Huang, Xun, Li, Yixuan, Poursaeed, Omid, Hopcroft, John, and Belongie, Serge. Stacked generative adversarial networks. arXiv preprint arXiv:1612.04357, 2016b.
|
| 366 |
+
Isola, Phillip, Zhu, Jun-Yan, Zhou, Tinghui, and Efros, Alexei A. Image-to-image translation with conditional adversarial networks. arXiv preprint arXiv:1611.07004, 2016.
|
| 367 |
+
Karras, Tero, Aila, Timo, Laine, Samuli, and Lehtinen, Jaakko. Progressive growing of gans for improved quality, stability, and variation. arXiv preprint arXiv:1710.10196, 2017.
|
| 368 |
+
Mao, Xudong, Li, Qing, Xie, Haoran, Lau, Raymond YK, Wang, Zhen, and Smolley, Stephen Paul. Least squares generative adversarial networks. arXiv preprint ArXiv:1611.04076, 2016.
|
| 369 |
+
Nguyen, Anh, Dosovitskiy, Alexey, Yosinski, Jason, Brox, Thomas, and Clune, Jeff. Synthesizing the preferred inputs for neurons in neural networks via deep generator networks. In Advances in Neural Information Processing Systems, pp. 3387–3395, 2016a.
|
| 370 |
+
Nguyen, Anh, Yosinski, Jason, Bengio, Yoshua, Dosovitskiy, Alexey, and Clune, Jeff. Plug & play generative networks: Conditional iterative generation of images in latent space. arXiv preprint arXiv:1612.00005, 2016b.
|
| 371 |
+
Odena, Augustus, Olah, Christopher, and Shlens, Jonathon. Conditional image synthesis with auxiliary classifier gans. arXiv preprint arXiv:1610.09585, 2016.
|
| 372 |
+
Salimans, Tim, Goodfellow, Ian, Zaremba, Wojciech, Cheung, Vicki, Radford, Alec, and Chen, Xi. Improved techniques for training gans. In Advances in Neural Information Processing Systems, pp. 2226–2234, 2016.
|
| 373 |
+
Springenberg, Jost Tobias. Unsupervised and semi-supervised learning with categorical generative adversarial networks. arXiv preprint arXiv:1511.06390, 2015.
|
| 374 |
+
Szegedy, Christian, Vanhoucke, Vincent, Ioffe, Sergey, Shlens, Jon, and Wojna, Zbigniew. Rethinking the inception architecture for computer vision. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 2818–2826, 2016.
|
| 375 |
+
Theis, Lucas, Oord, Aäron van den, and Bethge, Matthias. A note on the evaluation of generative models. arXiv preprint arXiv:1511.01844, 2015.
|
| 376 |
+
Wang, Zhou, Simoncelli, Eero P, and Bovik, Alan C. Multiscale structural similarity for image quality assessment. In Signals, Systems and Computers, 2004. Conference Record of the Thirty-Seventh Asilomar Conference on, volume 2, pp. 1398–1402. IEEE, 2004.
|
| 377 |
+
Warde-Farley, D. and Bengio, Y. Improving generative adversarial networks with denoising feature matching. In ICLR, 2017.
|
| 378 |
+
Yu, Lantao, Zhang, Weinan, Wang, Jun, and Yu, Yong. Seqgan: sequence generative adversarial nets with policy gradient. arXiv preprint arXiv:1609.05473, 2016.
|
| 379 |
+
Zhang, Han, Xu, Tao, Li, Hongsheng, Zhang, Shaoting, Huang, Xiaolei, Wang, Xiaogang, and Metaxas, Dimitris. Stackgan: Text to photo-realistic image synthesis with stacked generative adversarial networks. arXiv preprint arXiv:1612.03242, 2016.
|
| 380 |
+
Zhu, Jun-Yan, Krähenbühl, Philipp, Shechtman, Eli, and Efros, Alexei A. Generative visual manipulation on the natural image manifold. In European Conference on Computer Vision, pp. 597–613. Springer, 2016.
|
| 381 |
+
|
| 382 |
+
# A GRADIENT VANISHING & − $\cdot \log ( D _ { r } ( x ) )$ & LABEL SMOOTHING
|
| 383 |
+
|
| 384 |
+
# A.1 LABEL SMOOTHING
|
| 385 |
+
|
| 386 |
+
Label smoothing that avoiding extreme logits value was showed to be a good regularization (Szegedy et al., 2016). A general version of label smoothing could be: modifying the target probability of discriminator)
|
| 387 |
+
|
| 388 |
+
$$
|
| 389 |
+
\begin{array} { r } { \big [ \hat { D } _ { r } ( x ) , \hat { D } _ { f } ( x ) \big ] = \left\{ \begin{array} { l l } { \big [ \lambda _ { 1 } , 1 - \lambda _ { 1 } \big ] } & { x \sim G } \\ { \big [ 1 - \lambda _ { 2 } , \lambda _ { 2 } \big ] } & { x \sim p _ { \mathrm { d a t a } } } \end{array} \right. . } \end{array}
|
| 390 |
+
$$
|
| 391 |
+
|
| 392 |
+
Salimans et al. (2016) proposed to use only one-side label smoothing. That is, to only apply label smoothing for real samples: $\lambda _ { 1 } = 0$ and $\lambda _ { 2 } > 0$ . The reasoning of one-side label smoothing is applying label smoothing on fake samples will lead to fake mode on data distribution, which is too obscure.
|
| 393 |
+
|
| 394 |
+
We will next show the exact problems when applying label smoothing to fake samples along with the $\log ( 1 { - } D _ { r } ( x ) )$ generator loss, in the view of gradient w.r.t. class logit, i.e., the class-aware gradient, and we will also show that the problem does not exist when using the $- \log ( D _ { r } ( x ) )$ generator loss.
|
| 395 |
+
|
| 396 |
+
A.2 THE $\log ( 1 { - } D _ { r } ( x ) )$ GENERATOR LOSS
|
| 397 |
+
|
| 398 |
+
The $\log ( 1 { - } D _ { r } ( x ) )$ generator loss with label smoothing in terms of cross-entropy is
|
| 399 |
+
|
| 400 |
+
$$
|
| 401 |
+
L _ { G } ^ { \mathrm { l o g ( 1 - D ) } } = - \mathbb { E } _ { x \sim G } \big [ H \big ( [ \lambda _ { 1 } , 1 - \lambda _ { 1 } ] , [ D _ { r } ( x ) , D _ { K + 1 } ( x ) ] \big ) \big ] ,
|
| 402 |
+
$$
|
| 403 |
+
|
| 404 |
+
with lemma 1, its negative gradient is
|
| 405 |
+
|
| 406 |
+
$$
|
| 407 |
+
- \frac { \partial L _ { G } ^ { \mathrm { l o g ( 1 - D ) } } ( x ) } { \partial l _ { r } ( x ) } = D _ { r } ( x ) - \lambda _ { 1 } ,
|
| 408 |
+
$$
|
| 409 |
+
|
| 410 |
+
$$
|
| 411 |
+
\left\{ \begin{array} { l l } { D _ { r } ( x ) = \lambda _ { 1 } } & { \mathrm { g r a d i e n t v a n i s h i n g } } \\ { D _ { r } ( x ) < \lambda _ { 1 } } & { D _ { r } ( x ) \mathrm { i s o p t i m i z e d t o w a r d s } 0 . } \\ { D _ { r } ( x ) > \lambda _ { 1 } } & { D _ { r } ( x ) \mathrm { i s o p t i m i z e d t o w a r d s } 1 } \end{array} \right.
|
| 412 |
+
$$
|
| 413 |
+
|
| 414 |
+
Gradient vanishing is a well know training problem of GAN. Optimizing $D _ { r } ( x )$ towards 0 or 1 is also not what desired, because the discriminator is mapping real samples to the distribution with $D _ { r } ( x ) = 1 - \lambda _ { 2 }$ .
|
| 415 |
+
|
| 416 |
+
A.3 $\mathrm { T H E } - \log ( D _ { r } ( x ) )$ GENERATOR LOSS
|
| 417 |
+
|
| 418 |
+
The $- \log ( D _ { r } ( x ) )$ generator loss with target $[ 1 - \lambda , \lambda ]$ in terms of cross-entropy is
|
| 419 |
+
|
| 420 |
+
$$
|
| 421 |
+
L _ { G } ^ { \mathrm { - l o g ( D ) } } = \mathbb { E } _ { x \sim G } \bigl [ H \bigl ( [ 1 - \lambda , \lambda ] , [ D _ { r } ( x ) , D _ { K + 1 } ( x ) ] \bigr ) \bigr ] ,
|
| 422 |
+
$$
|
| 423 |
+
|
| 424 |
+
the negative gradient of which is
|
| 425 |
+
|
| 426 |
+
$$
|
| 427 |
+
- \frac { \partial L _ { G } ^ { \mathrm { - l o g ( D ) } } ( x ) } { \partial l _ { r } ( x ) } = ( 1 - \lambda ) - D _ { r } ( x ) ,
|
| 428 |
+
$$
|
| 429 |
+
|
| 430 |
+
$$
|
| 431 |
+
\left\{ \begin{array} { l l } { D _ { r } ( x ) = 1 - \lambda } & { \mathrm { s t a t i o n a r y p o i n t } } \\ { D _ { r } ( x ) < 1 - \lambda } & { D _ { r } ( x ) \mathrm { t o w a r d s } 1 - \lambda . } \\ { D _ { r } ( x ) > 1 - \lambda } & { D _ { r } ( x ) \mathrm { t o w a r d s } 1 - \lambda } \end{array} \right.
|
| 432 |
+
$$
|
| 433 |
+
|
| 434 |
+
Without label smooth $\lambda$ , the $- \log ( D _ { r } ( x ) )$ always∗ preserves the same gradient direction as $\log ( 1 { - } D _ { r } ( x ) )$ though giving a difference gradient scale. We must note that non-zero gradient does not mean that the gradient is efficient or valid.
|
| 435 |
+
|
| 436 |
+
The both-side label smoothed version has a strong connection to Least-Square GAN (Mao et al., 2016): with the fake logit fixed to zero, the discriminator maps real to $\alpha$ on the real logit and maps fake to $\beta$ on the real logit, the generator in contrast tries to map fake sample to $\alpha$ . Their gradient on the logit are also similar.
|
| 437 |
+
|
| 438 |
+
# B CATGAN
|
| 439 |
+
|
| 440 |
+
The auxiliary classifier loss of AM-GAN can also be viewed as the cross-entropy version of CatGAN: generator of CatGAN directly optimizes entropy $H ( R ( D ( x ) ) )$ to make each sample be one class, while AM-GAN achieves this by the first term of its decomposed loss $H ( R ( v ( x ) ) , R ( D ( x ) ) )$ in terms of cross-entropy with given target distribution. That is, the AM-GAN is the cross-entropy version of CatGAN that is combined with LabelGAN by introducing an additional fake class.
|
| 441 |
+
|
| 442 |
+
# B.1 DISCRIMINATOR LOSS ON FAKE SAMPLE
|
| 443 |
+
|
| 444 |
+
The discriminator of CatGAN maximizes the prediction entropy of each fake sample:
|
| 445 |
+
|
| 446 |
+
$$
|
| 447 |
+
L _ { D } ^ { \mathrm { C a t } ^ { \prime } } = \mathbb { E } _ { x \sim G } \big [ - H \big ( D ( x ) \big ) \big ] .
|
| 448 |
+
$$
|
| 449 |
+
|
| 450 |
+
In AM-GAN, as we have an extra class on fake, we can achieve this in a simpler manner by minimizing the probability on real logits.
|
| 451 |
+
|
| 452 |
+
$$
|
| 453 |
+
L _ { D } ^ { \mathrm { A M } ^ { \mathrm { \tiny { M } } } } = \mathbb { E } _ { x \sim G } \bigl [ H \bigl ( F ( v ( K + 1 ) ) , F ( D ( x ) ) \bigr ) \bigr ] .
|
| 454 |
+
$$
|
| 455 |
+
|
| 456 |
+
If $v _ { r } \left( K { + } 1 \right)$ is not zero, that is, when we did negative label smoothing Salimans et al. (2016), we could define $R ( v ( K { + } 1 ) )$ to be a uniform distribution.
|
| 457 |
+
|
| 458 |
+
$$
|
| 459 |
+
L _ { D } ^ { \mathrm { A M " } } = \mathbb { E } _ { x \sim G } \big [ H \big ( R ( v ( K { + } 1 ) ) , R ( D ( x ) ) \big ) \big ] \times v _ { r } ( K { + } 1 ) .
|
| 460 |
+
$$
|
| 461 |
+
|
| 462 |
+
As a result, the label smoothing part probability will be required to be uniformly distributed, similar to CatGAN.
|
| 463 |
+
|
| 464 |
+
# C UNLABELED DATA
|
| 465 |
+
|
| 466 |
+
In this section, we extend AM-GAN to unlabeled data. Our solution is analogous to CatGAN Springenberg (2015).
|
| 467 |
+
|
| 468 |
+
# C.1 SEMI-SUPERVISED SETTING
|
| 469 |
+
|
| 470 |
+
Under semi-supervised setting, we can add the following loss to the original solution to integrate the unlabeled data (with the distribution denoted as $p _ { \mathrm { u n l } } ( x ) \big |$ ):
|
| 471 |
+
|
| 472 |
+
$$
|
| 473 |
+
L _ { D } ^ { \mathrm { u n l } ^ { \prime } } = \mathbb { E } _ { \boldsymbol { x } \sim p _ { \mathrm { u n l } } } \big [ H \big ( \boldsymbol { v } ( \boldsymbol { x } ) , D ( \boldsymbol { x } ) \big ) \big ] .
|
| 474 |
+
$$
|
| 475 |
+
|
| 476 |
+
# C.2 UNSUPERVISED SETTING
|
| 477 |
+
|
| 478 |
+
Under unsupervised setting, we need to introduce one extra loss, analogy to categorical GAN Springenberg (2015):
|
| 479 |
+
|
| 480 |
+
$$
|
| 481 |
+
L _ { D } ^ { \mathrm { u n l ^ { \prime } } } = H \big ( p _ { \mathrm { r e f } } , R ( \mathbb { E } _ { \boldsymbol { x } \sim p _ { \mathrm { u n l } } } [ D ( \boldsymbol { x } ) ] ) \big ) ,
|
| 482 |
+
$$
|
| 483 |
+
|
| 484 |
+
where the $p _ { \mathrm { r e f } }$ is a reference label distribution for the prediction on unsupervised data. For example, $p _ { \mathrm { r e f } }$ could be set as a uniform distribution, which requires the unlabeled data to make use of all the candidate class logits.
|
| 485 |
+
|
| 486 |
+
This loss can be optionally added to semi-supervised setting, where the $p _ { \mathrm { r e f } }$ could be defined as the predicted label distribution on the labeled training data $\mathbb { E } _ { x \sim p _ { \mathrm { d a t a } } } [ D ( x ) ]$ .
|
| 487 |
+
|
| 488 |
+
# D INCEPTION SCORE
|
| 489 |
+
|
| 490 |
+
As a recently proposed metric for evaluating the performance of the generative models, the InceptionScore has been found well correlated with human evaluation (Salimans et al., 2016), where a pre-trained publicly-available Inception model $C$ is introduced. By applying the Inception model to each generated sample $x$ and getting the corresponding class probability distribution $C ( x )$ , Inception Score is calculated via
|
| 491 |
+
|
| 492 |
+
$$
|
| 493 |
+
\operatorname { I n c e p t i o n } { \operatorname { S c o r e } } = \exp { \left( \mathbb { E } _ { x } \bigl [ \operatorname { K L } \bigl ( C ( x ) \parallel \bar { C } ^ { G } \bigr ) \bigr ] \right) } ,
|
| 494 |
+
$$
|
| 495 |
+
|
| 496 |
+
where $\mathbb { E } _ { x }$ is short of $\mathbb { E } _ { x \sim G }$ and $\bar { C } ^ { G } = \mathbb { E } _ { x } [ C ( x ) ]$ is the overall probability distribution of the generated samples over classes, which is judged by $C$ , and KL denotes the Kullback-Leibler divergence which is defined as
|
| 497 |
+
|
| 498 |
+
$$
|
| 499 |
+
\begin{array} { r } { \mathrm { K L } ( p \parallel q ) = \sum _ { i } p _ { i } \log \frac { p _ { i } } { q _ { i } } = \sum _ { i } p _ { i } \log p _ { i } - \sum _ { i } p _ { i } \log q _ { i } = - H ( p ) + H ( p , q ) . } \end{array}
|
| 500 |
+
$$
|
| 501 |
+
|
| 502 |
+
An extended metric, the Mode Score, is proposed in Che et al. (2016) to take the prior distribution of the labels into account, which is calculated via
|
| 503 |
+
|
| 504 |
+
$$
|
| 505 |
+
\begin{array} { r } { \mathbf { M o d e ~ S c o r e } = \exp ( \mathbb { E } _ { x } \left[ \mathbf { K L } \big ( C ( x ) \| \bar { C } ^ { \mathrm { t r a i n } } \big ) \right] - \mathbf { K L } ( \bar { C } ^ { G } \| \bar { C } ^ { \mathrm { t r a i n } } ) ) , } \end{array}
|
| 506 |
+
$$
|
| 507 |
+
|
| 508 |
+
where the overall class distribution from the training data $\bar { C } ^ { \mathrm { t r a i n } }$ has been added as a reference. We show in the following that, in fact, Mode Score and Inception Score are equivalent.
|
| 509 |
+
|
| 510 |
+
Lemma 3. Let $p ( x )$ be the class probability distribution of the sample $x$ , and $\bar { p }$ denote another probability distribution, then
|
| 511 |
+
|
| 512 |
+
$$
|
| 513 |
+
\mathbb { E } _ { x } \big [ H \big ( p ( x ) , \bar { p } \big ) \big ] = H \big ( \mathbb { E } _ { x } \big [ p ( x ) \big ] , \bar { p } \big ) .
|
| 514 |
+
$$
|
| 515 |
+
|
| 516 |
+
With Lemma 3, we have
|
| 517 |
+
|
| 518 |
+
$$
|
| 519 |
+
\begin{array} { r l } & { \log ( \mathrm { I n c e p t i o n ~ S c o r e } ) } \\ & { \qquad = \mathbb { E } _ { x } \bigl [ \mathrm { K L } ( C ( x ) \parallel \bar { C } ^ { G } ) \bigr ] } \\ & { \qquad = \mathbb { E } _ { x } \bigl [ H \bigl ( C ( x ) , \bar { C } ^ { G } \bigr ) \bigr ] - \mathbb { E } _ { x } \bigl [ H \bigl ( C ( x ) \bigr ) \bigr ] } \\ & { \qquad = H \bigl ( \mathbb { E } _ { x } \bigl [ C ( x ) \bigr ] , \bar { C } ^ { G } \bigr ) - \mathbb { E } _ { x } \bigl [ H \bigl ( C ( x ) \bigr ) \bigr ] } \\ & { \qquad = H ( \bar { C } ^ { G } ) + ( - \mathbb { E } _ { x } \bigl [ H \bigl ( C ( x ) \bigr ) \bigr ] ) , } \end{array}
|
| 520 |
+
$$
|
| 521 |
+
|
| 522 |
+
$$
|
| 523 |
+
\begin{array} { r l } & { \log ( \operatorname { M o d e ~ S c o r e } ) } \\ & { \qquad = \mathbb { E } _ { x } \left[ \mathrm { K L } \big ( C ( x ) \mid \mid \bar { C } ^ { \mathrm { t r a i n } } \big ) \right] - \mathrm { K L } ( \bar { C } ^ { G } \mid \| \bar { C } ^ { \mathrm { t r a i n } } ) } \\ & { \qquad = \mathbb { E } _ { x } \left[ H \big ( C ( x ) , \bar { C } ^ { \mathrm { t r a i n } } \big ) \right] - \mathbb { E } _ { x } \big [ H \big ( C ( x ) \big ) \big ] - H ( \bar { C } ^ { G } , \bar { C } ^ { \mathrm { t r a i n } } ) + H ( \bar { C } ^ { G } ) } \\ & { \qquad = H ( \bar { C } ^ { G } ) + ( - \mathbb { E } _ { x } \left[ H \big ( C ( x ) \big ) \right] ) . } \end{array}
|
| 524 |
+
$$
|
| 525 |
+
|
| 526 |
+
# E THE LEMMA AND PROOFS
|
| 527 |
+
|
| 528 |
+
Lemma 1. With l being the logits vector and $\sigma$ being the softmax function, let $\sigma ( l )$ be the current softmax probability distribution and $\hat { p }$ denote any target probability distribution, then:
|
| 529 |
+
|
| 530 |
+
$$
|
| 531 |
+
- \frac { \partial H \big ( \hat { p } , \sigma ( l ) \big ) } { \partial l } = \hat { p } - \sigma ( l ) .
|
| 532 |
+
$$
|
| 533 |
+
|
| 534 |
+
Proof.
|
| 535 |
+
|
| 536 |
+
$$
|
| 537 |
+
\begin{array} { r l } & { - \left( \frac { \partial H \left( \hat { p } , \sigma ( l ) \right) } { \partial l } \right) _ { k } = - \frac { \partial H \left( \hat { p } , \sigma ( l ) \right) } { \partial l _ { k } } = \frac { \partial \sum _ { i } \hat { p } _ { i } \log \sigma ( l ) _ { i } } { \partial l _ { k } } = \frac { \partial \sum _ { i } \hat { p } _ { i } \log \frac { \exp ( l _ { i } ) } { \sum _ { j } \exp ( l _ { j } ) } } { \partial l _ { k } } } \\ & { = \frac { \partial \sum _ { i } \hat { p } _ { i } \left( l _ { i } - \log \sum _ { j } \exp ( l _ { j } ) \right) } { \partial l _ { k } } = \frac { \partial \sum _ { i } \hat { p } _ { i } l _ { i } } { \partial l _ { k } } - \frac { \partial \log \left( \sum _ { j } \exp ( l _ { j } ) \right) } { \partial l _ { k } } = \hat { p } _ { k } - \frac { \exp ( l _ { k } ) } { \sum _ { j } \exp ( l _ { j } ) } } \\ & { \Rightarrow - \frac { \partial H \left( \hat { p } , \sigma ( l ) \right) } { \partial l } = \hat { p } - \sigma ( l ) . } \end{array}
|
| 538 |
+
$$
|
| 539 |
+
|
| 540 |
+
Lemma 2. Given $v = [ v _ { 1 } , \ldots , v _ { K + 1 } ]$ , $v _ { 1 : K } \triangleq \left[ v _ { 1 } , \dots , v _ { K } \right]$ , $\textstyle v _ { r } \ \triangleq \sum _ { k = 1 } ^ { K } v _ { k }$ , $R ( v ) \ { \triangleq } \ v _ { 1 : K } / v _ { r }$ and $F ( v ) \triangleq [ v _ { r } , v _ { K + 1 } ] ,$ , let $\hat { p } = [ \hat { p } _ { 1 } , \dots , \hat { p } _ { K + 1 } ]$ , $p = [ p _ { 1 } , \ldots , p _ { K + 1 } ]$ , then we have:
|
| 541 |
+
|
| 542 |
+
$$
|
| 543 |
+
H \big ( \hat { p } , p \big ) = \hat { p } _ { r } H \big ( R ( \hat { p } ) , R ( p ) \big ) + H \big ( F ( \hat { p } ) , F ( p ) \big ) .
|
| 544 |
+
$$
|
| 545 |
+
|
| 546 |
+
Proof.
|
| 547 |
+
|
| 548 |
+
$$
|
| 549 |
+
\begin{array} { r l } & { H ( \hat { p } , p ) = - \sum _ { k = 1 } ^ { K } \hat { p } _ { k } \log p _ { k } - \hat { p } _ { K + 1 } \log p _ { K + 1 } = - \hat { p } _ { r } \sum _ { k = 1 } ^ { K } \frac { \hat { p } _ { k } } { \hat { p } _ { r } } \log ( \frac { p _ { k } } { p _ { r } } p _ { r } ) - \hat { p } _ { K + 1 } \log p _ { K + 1 } } \\ & { \qquad = - \hat { p } _ { r } \sum _ { k = 1 } ^ { K } \frac { \hat { p } _ { k } } { \hat { p } _ { r } } ( \log \frac { p _ { k } } { p _ { r } } + \log p _ { r } ) - \hat { p } _ { K + 1 } \log p _ { K + 1 } } \\ & { \qquad = - \hat { p } _ { r } \sum _ { k = 1 } ^ { K } \frac { \hat { p } _ { k } } { \hat { p } _ { r } } \log \frac { p _ { k } } { p _ { r } } - \hat { p } _ { r } \log p _ { r } - \hat { p } _ { K + 1 } \log p _ { K + 1 } } \\ & { \qquad = \hat { p } _ { r } H \big ( R ( \hat { p } ) , R ( p ) \big ) + H \big ( F ( \hat { p } ) , F ( p ) \big ) . } \end{array}
|
| 550 |
+
$$
|
| 551 |
+
|
| 552 |
+
Lemma 3. Let $p ( x )$ be the class probability distribution of the sample x that from a certain data distribution, and $\bar { p }$ denote the reference probability distribution, then
|
| 553 |
+
|
| 554 |
+
$$
|
| 555 |
+
\mathbb { E } _ { x } \big [ H \big ( p ( x ) , \bar { p } \big ) \big ] = H \big ( \mathbb { E } _ { x } \big [ p ( x ) \big ] , \bar { p } \big ) .
|
| 556 |
+
$$
|
| 557 |
+
|
| 558 |
+
Proof.
|
| 559 |
+
|
| 560 |
+
$$
|
| 561 |
+
\begin{array} { l } { \displaystyle \mathbb { E } _ { x } \big [ H \big ( p ( x ) , \bar { p } \big ) \big ] = \mathbb { E } _ { x } \big [ - \sum _ { i } p _ { i } ( x ) \log \bar { p } _ { i } \big ] = - \sum _ { i } \mathbb { E } _ { x } \big [ p _ { i } ( x ) \big ] \log \bar { p } _ { i } } \\ { \displaystyle \qquad = - \sum _ { i } \big ( \mathbb { E } _ { x } [ p ( x ) ] \big ) _ { i } \log \bar { p } _ { i } = H \big ( \mathbb { E } _ { x } \big [ p ( x ) \big ] , \bar { p } \big ) . } \end{array}
|
| 562 |
+
$$
|
| 563 |
+
|
| 564 |
+

|
| 565 |
+
Figure 8: $H ( C ( x )$ of Inception Score in Real Images. a) $0 { < } H ( C ( x ) { < } 1$ ; b) $3 { < } H ( C ( x ) < 4 )$ ; c) $6 { < } H ( C ( x ) { < } 7$ .
|
| 566 |
+
|
| 567 |
+
# F NETWORK STRUCTURE & HYPER-PARAMETERS
|
| 568 |
+
|
| 569 |
+
Generator:
|
| 570 |
+
|
| 571 |
+
<table><tr><td>Operation</td><td>Kernel</td><td>Strides</td><td>Output Dims</td><td>Output Drop</td><td>Activation</td><td>BN</td></tr><tr><td>Noise</td><td>N/A</td><td>N/A</td><td>100|110</td><td>0.0</td><td>N(0.0, 1.0)</td><td></td></tr><tr><td>Linear</td><td>N/A</td><td>N/A</td><td>4×4×768</td><td>0.0</td><td>Leaky ReLU</td><td>True</td></tr><tr><td>Deconvolution</td><td>3×3</td><td>2×2</td><td>8×8×384</td><td>0.0</td><td>Leaky ReLU</td><td>True</td></tr><tr><td>Deconvolution</td><td>3×3</td><td>2×2</td><td>16×16×192</td><td>0.0</td><td>Leaky ReLU</td><td>True</td></tr><tr><td>Deconvolution</td><td>3×3</td><td>2×2</td><td>32×32×96</td><td>0.0</td><td>Leaky ReLU</td><td>True</td></tr><tr><td>Deconvolution</td><td>3×3</td><td>1×1</td><td>32×32×3</td><td>0.0</td><td>Tanh</td><td></td></tr></table>
|
| 572 |
+
|
| 573 |
+
Discriminator:
|
| 574 |
+
|
| 575 |
+
<table><tr><td>Operation</td><td>Kernel</td><td>Strides</td><td>Output Dims</td><td>Output Drop</td><td>Activation</td><td></td></tr><tr><td>Add Gaussian Noise</td><td>N/A</td><td>N/A</td><td>32×32×3</td><td>0.0</td><td>N(0.0, 0.1)</td><td></td></tr><tr><td>Convolution</td><td>3×3</td><td>1×1</td><td>32×32×64</td><td>0.3</td><td>Leaky ReLU</td><td>True</td></tr><tr><td>Convolution</td><td>3×3</td><td>2×2</td><td>16×16×128</td><td>0.3</td><td>Leaky ReLU</td><td>True</td></tr><tr><td>Convolution</td><td>3×3</td><td>2×2</td><td>8×8×256</td><td>0.3</td><td>Leaky ReLU</td><td>True</td></tr><tr><td>Convolution</td><td>3×3</td><td>2×2</td><td>4×4×512</td><td>0.3</td><td>Leaky ReLU</td><td>True</td></tr><tr><td>Convolution*</td><td>3×3</td><td>1×1</td><td>4×4×512</td><td>0.3</td><td>Leaky ReLU</td><td>True</td></tr><tr><td>AvgPool</td><td>N/A</td><td>N/A</td><td>1×1×512</td><td>0.3</td><td>N/A</td><td></td></tr><tr><td>Linear</td><td>N/A</td><td>N/A</td><td>10|11|12</td><td>0.0</td><td>Softmax</td><td></td></tr></table>
|
| 576 |
+
|
| 577 |
+
<table><tr><td>The *layer was only used for class condition experiments</td><td></td></tr><tr><td>Optimizer: Adam with beta1=0.5, beta2=0.999; Batch size=100.</td><td></td></tr><tr><td>Learning rate:Exponential decay with stair, initial learning rate O.0004.</td><td></td></tr><tr><td>We use weight normalization for each weight</td><td></td></tr></table>
|
| 578 |
+
|
| 579 |
+

|
| 580 |
+
Figure 9: Random Samples of AM-GAN: Dynamic Labeling
|
| 581 |
+
|
| 582 |
+

|
| 583 |
+
Figure 10: Random Samples of AM-GAN: Class Condition
|
| 584 |
+
|
| 585 |
+

|
| 586 |
+
Figure 11: Random Samples of AC-GAN∗: Dynamic Labeling
|
| 587 |
+
|
| 588 |
+

|
| 589 |
+
Figure 12: Random Samples of AC-GAN∗: Class Condition
|
| 590 |
+
|
| 591 |
+

|
| 592 |
+
Figure 13: Random Samples of AC-GAN∗+: Dynamic Labeling
|
| 593 |
+
|
| 594 |
+

|
| 595 |
+
Figure 14: Random Samples of AC-GAN∗+: Class Condition
|
| 596 |
+
|
| 597 |
+

|
| 598 |
+
Figure 15: Random Samples of LabelGAN: Under Dynamic Labeling Setting
|
| 599 |
+
|
| 600 |
+

|
| 601 |
+
Figure 16: Random Samples of LabelGAN: Under Class Condition Setting
|
| 602 |
+
|
| 603 |
+

|
| 604 |
+
Figure 17: Random Samples of GAN: Under Dynamic Labeling Setting
|
| 605 |
+
|
| 606 |
+

|
| 607 |
+
Figure 18: Random Samples of GAN: Under Class Condition Setting
|
md/train/L4cVGxiHRu3/L4cVGxiHRu3.md
ADDED
|
@@ -0,0 +1,377 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Analytically Tractable Bayesian Deep Q-Learning
|
| 2 |
+
|
| 3 |
+
Anonymous Author(s)
|
| 4 |
+
Affiliation
|
| 5 |
+
Address
|
| 6 |
+
email
|
| 7 |
+
|
| 8 |
+
# Abstract
|
| 9 |
+
|
| 10 |
+
Reinforcement learning (RL) has gained increasing interest since the demonstration it was able to reach human performance on video game benchmarks using deep $Q$ -learning (DQN). The current consensus for training neural networks on such complex environments is to rely on gradient-based optimization. Although alternative Bayesian deep learning methods exist, most of them still rely on gradient-based optimization, and they typically do not scale on benchmarks such as the Atari game environment. Moreover none of these approaches allow performing the analytical inference for the weights and biases defining the neural network. In this paper, we present how we can adapt the temporal difference Q-learning framework to make it compatible with the tractable approximate Gaussian inference (TAGI), which allows learning the parameters of a neural network using a closed-form analytical method. Throughout the experiments with on- and off-policy reinforcement learning approaches, we demonstrate that TAGI can reach a performance comparable to backpropagation-trained networks while using fewer hyperparameters, and without relying on gradient-based optimization.
|
| 11 |
+
|
| 12 |
+
# 16 1 Introduction
|
| 13 |
+
|
| 14 |
+
17 Reinforcement learning (RL) has gained increasing interest since the demonstration it was able to
|
| 15 |
+
18 reach human performance on video game benchmarks using deep $Q$ -learning (DQN) [17, 26]. Deep
|
| 16 |
+
19 RL methods typically require an explicit definition of an exploration-exploitation function in order to
|
| 17 |
+
20 compromise between using the current policy and exploring the potential of new actions. Such an
|
| 18 |
+
21 issue can be mitigated by opting for a Bayesian approach where the selection of the optimal action to
|
| 19 |
+
22 follow is based on Thompson sampling [23]. Bayesian deep learning methods based on variational
|
| 20 |
+
23 inference [12, 10, 5, 14, 20, 29], Monte-Carlo dropout [8], or Hamiltonian Monte-Carlo sampling
|
| 21 |
+
24 [18] have shown to perform well on regression and classification benchmarks, despite being generally
|
| 22 |
+
25 computationally more demanding than their deterministic counterparts. Note that none of these
|
| 23 |
+
26 approaches allow performing the analytical inference for the weights and biases defining the neural
|
| 24 |
+
27 network. Goulet et al. [9] recently proposed the tractable approximate Gaussian inference (TAGI)
|
| 25 |
+
28 method which allows learning the parameters of a neural network using a closed-form analytical
|
| 26 |
+
29 method. For convolutional architectures applied on classification benchmarks, this approach was
|
| 27 |
+
30 shown to exceed the performance of other Bayesian and deterministic approaches based on gradient
|
| 28 |
+
31 backpropagation, and to do so while requiring a smaller number of training epochs [19].
|
| 29 |
+
32 In this paper, we present how can we adapt the temporal difference Q-learning framework [24, 28] to
|
| 30 |
+
33 make it compatible with TAGI. Section 2 first reviews the theory behind TAGI and the expected value
|
| 31 |
+
34 formulation through the Bellman’s Equation. Then, we present how the action-value function can
|
| 32 |
+
35 be learned using TAGI. Section 3 presents the related work associated with Bayesian reinforcement
|
| 33 |
+
36 learning, and Section 4 compares the performance of a simple TAGI-DQN architecture with the one
|
| 34 |
+
37 obtained for its backpropagation-trained counterpart.
|
| 35 |
+
39 This section presents how to adapt the DQN frameworks in order to make them compatible with
|
| 36 |
+
40 analytical inference. First, Section 2.1 reviews the fundamental theory behind TAGI, and Section 2.1
|
| 37 |
+
41 reviews the concept of long-term expected value through the Bellman’s equation [25]. Then, Section
|
| 38 |
+
42 2.3 presents how to make the Q-learning formulation [28] compatible with TAGI.
|
| 39 |
+
|
| 40 |
+
# 43 2.1 Tractable Approximate Gaussian Inference
|
| 41 |
+
|
| 42 |
+
44 TAGI [9] relies on two main steps; forward uncertainty propagation and backward update. The
|
| 43 |
+
45 first forward uncertainty propagation step is intended to build the joint prior between the neural
|
| 44 |
+
46 network parameters and the hidden states. This operation is made by propagating the uncertainty
|
| 45 |
+
47 from the model parameters and the input layer through the neural network. TAGI relies on the
|
| 46 |
+
48 Gaussian assumption for the prior of parameters as well as for the variables in the input layer. In order
|
| 47 |
+
49 to maintain the analytical tractability of the forward step, we rely on the Gaussian multiplicative
|
| 48 |
+
50 approximation (GMA) which consists in approximating the product of two Gaussians by a Gaussian
|
| 49 |
+
51 random variable whose moments match those calculated exactly using moment generating functions.
|
| 50 |
+
52 In order to propagate uncertainty through non-linear activation functions, a second approximation
|
| 51 |
+
53 made by locally linearizing these function at the expected value of the hidden unit being activated.
|
| 52 |
+
54 Although this linearization procedure may seems to be a crude approximation, it has been shown to
|
| 53 |
+
55 match or exceeds the state-of-the-art performance on fully-connected neural networks (FNN) [9],
|
| 54 |
+
56 as well as convolutional neural networks (CNN) and generative adversarial networks [19]. TAGI
|
| 55 |
+
57 succeeds in maintaining a linear computational complexity for the forward steps, (1) by assuming
|
| 56 |
+
58 a diagonal covariance for all parameters in the network and for all the hidden units within a same
|
| 57 |
+
59 layer, and (2) by adopting a layer-wise approach where the joint prior is only computed and stored for
|
| 58 |
+
60 the hidden units on pairs of successive hidden layers, as well as the hidden units within a layer and
|
| 59 |
+
61 the parameters connecting into it. This layer-wise approach is allowed by the inherent conditional
|
| 60 |
+
62 independence that is built-in feed-forward neural network architectures.
|
| 61 |
+
63 The second backward update-step consists in performing layer-wise recursive Bayesian inference
|
| 62 |
+
64 which goes from hidden-layer to hidden-layer and from hidden-layer to the parameters connecting
|
| 63 |
+
65 into it. Given the Gaussian approximation for the joint prior throughout the network, the inference
|
| 64 |
+
66 can be done analytically while still maintaining a linear computational complexity with respect to the
|
| 65 |
+
67 number of weight parameters in the network. TAGI allows inferring the diagonal posterior knowledge
|
| 66 |
+
68 for weights and bias parameters, either using one observation at a time, or using mini-batches of
|
| 67 |
+
69 data. As we will show in the next sections, this online learning capacity is best suited for RL
|
| 68 |
+
70 problems where we experience episodes sequentially and where we need to define a tradeoff between
|
| 69 |
+
71 exploration and exploitation, as a function of our knowledge of the expected value associated with
|
| 70 |
+
72 being in a state and taking an action.
|
| 71 |
+
|
| 72 |
+
# 73 2.2 Expected Value and Bellman’s Equation
|
| 73 |
+
|
| 74 |
+
74 We define $r ( s , a , s ^ { \prime } )$ as the reward for being in a state $s ~ \in ~ \mathbb { R } ^ { \mathtt { S } }$ , taking an action $a \ \in \ A \ =$
|
| 75 |
+
75 $\{ a _ { 1 } , a _ { 2 } , \cdots a _ { \tt A } \}$ , and ending in a state $s ^ { \prime } \in \bar { \mathbb { R } } ^ { \mathsf { s } }$ . For simplicity, we use the short-form notation
|
| 76 |
+
76 for the reward $r ( s , a , s ^ { \prime } ) \equiv { \bar { r } } ( s )$ in order to define the value as the infinite sum of discounted rewards
|
| 77 |
+
77
|
| 78 |
+
|
| 79 |
+
$$
|
| 80 |
+
v ( s ) = \sum _ { k = 0 } ^ { \infty } \gamma ^ { k } r ( s _ { t + k } ) .
|
| 81 |
+
$$
|
| 82 |
+
|
| 83 |
+
78 As we do not know what will be the future states $\boldsymbol { s } _ { t + k }$ for $k > 0$ , we need to consider them as random
|
| 84 |
+
79 variables $( S _ { t + k } )$ , so that the value $V ( s _ { t } )$ becomes a random variable as well,
|
| 85 |
+
|
| 86 |
+
$$
|
| 87 |
+
V ( \pmb { s } _ { t } ) = r ( \pmb { s } _ { t } ) + \sum _ { k = 1 } ^ { \infty } \gamma ^ { k } r ( \pmb { S } _ { t + k } ) .
|
| 88 |
+
$$
|
| 89 |
+
|
| 90 |
+
80 Rational decisions regarding which action to take among the set $\mathcal { A }$ is based the maximization of the
|
| 91 |
+
81 expected value as defined by the action-value function
|
| 92 |
+
|
| 93 |
+
$$
|
| 94 |
+
q ( s _ { t } , a _ { t } ) = \mu _ { V } \equiv \mathbb { E } [ V ( s _ { t } , a _ { t } , \pi ) ] = r ( s _ { t } ) + \mathbb { E } \left[ \sum _ { k = 1 } ^ { \infty } \gamma ^ { k } r ( S _ { t + k } ) \right] ,
|
| 95 |
+
$$
|
| 96 |
+
|
| 97 |
+
82 where it is assumed that at each time $t$ , the agent takes the action defined in the policy $\pi$ . In the case
|
| 98 |
+
83 of episode-based learning where the agent interacts with the environment, we assume we know the
|
| 99 |
+
84 tuple of states $\mathbf { \boldsymbol { s } } _ { t }$ and $s _ { t + 1 }$ , so that we can redefine the value as
|
| 100 |
+
|
| 101 |
+
$$
|
| 102 |
+
\begin{array} { r c l } { V ( s _ { t } , a _ { t } ) } & { = } & { \displaystyle r ( s _ { t } ) + \gamma \left( r ( s _ { t + 1 } ) + \sum _ { k = 1 } ^ { \infty } \gamma ^ { k } r ( S _ { t + 1 + k } ) \right) } \\ & { = } & { \displaystyle r ( s _ { t } ) + \gamma V ( s _ { t + 1 } , a _ { t + 1 } ) . } \end{array}
|
| 103 |
+
$$
|
| 104 |
+
|
| 105 |
+
Assuming that the value 85 $V \sim \mathcal N ( v ; \mu _ { V } , \sigma _ { V } ^ { 2 } )$ in Equations 2 and 4 is described by Gaussian random 86 variables, we can reparameterize these equations as the sum of the expected value $\boldsymbol { q } ( s , a )$ and a 87 zero-mean Gaussian random variable $\mathcal { E } \sim \mathcal { N } ( \epsilon ; 0 , 1 )$ , so that
|
| 106 |
+
|
| 107 |
+
$$
|
| 108 |
+
V ( \pmb { \mathscr { s } } , a ) = q ( \pmb { \mathscr { s } } , a ) + \sigma _ { V } \pmb { \mathscr { E } } ,
|
| 109 |
+
$$
|
| 110 |
+
|
| 111 |
+
88 where the variance $\sigma _ { V } ^ { 2 }$ and $\mathcal { E }$ are assumed here to be independent of $\pmb { s }$ and $a$ . Although in a more
|
| 112 |
+
89 general framework this assumption could be relaxed, such an heteroscedastic variance term is outside
|
| 113 |
+
90 from the scope of this paper. Using this reparameterization, we can write Equation 4 as the discounted
|
| 114 |
+
91 difference between the expected values of two subsequent states
|
| 115 |
+
|
| 116 |
+
$$
|
| 117 |
+
\begin{array} { r c l } { q ( { \pmb s } _ { t } , { \pmb a } _ { t } ) } & { = } & { r ( { \pmb s } _ { t } ) + \gamma q ( { \pmb s } _ { t + 1 } , { \pmb a } _ { t + 1 } ) - \sigma _ { V _ { t } } { \pmb \mathcal E } _ { t } + \gamma \sigma _ { V _ { t + 1 } } { \pmb \mathcal E } _ { t + 1 } } \\ & { = } & { r ( { \pmb s } _ { t } ) + \gamma q ( { \pmb s } _ { t + 1 } , { \pmb a } _ { t + 1 } ) + \sigma _ { V } { \pmb \mathcal E } . } \end{array}
|
| 118 |
+
$$
|
| 119 |
+
|
| 120 |
+
92 Note that in Equation 6, $\sigma _ { V _ { t } }$ and $\gamma \sigma _ { V _ { t + 1 } }$ can be combined in a single standard deviation parameters
|
| 121 |
+
93 $\sigma _ { V }$ with the assumption that $\mathcal { E } _ { i } \perp \perp \mathcal { E } _ { j } , \forall i \neq j$ .
|
| 122 |
+
94 In the case where at a time $t$ , we want to update the Q-values encoded in the neural net only after
|
| 123 |
+
95 observing $n$ -step returns [15], we can reformulate the observation equation so that
|
| 124 |
+
|
| 125 |
+
$$
|
| 126 |
+
q ( s _ { t } , a _ { t } ) = \sum _ { i = 0 } ^ { n - t - 1 } \gamma ^ { i } r ( s _ { t + i } ) + \gamma ^ { n - t } q ( s _ { n } , a _ { n } ) + \sigma _ { V } \mathcal { E } _ { t } , \forall t = \{ 1 , 2 , \cdots , n - 1 \} .
|
| 127 |
+
$$
|
| 128 |
+
|
| 129 |
+
96 Note that in the application of Equation 7, we employ the simplifying assumption that $\mathcal { E } _ { t } \perp \perp \mathcal { E } _ { t + i } , \forall i \ne$
|
| 130 |
+
97 0, as Equation 6 already makes simplifying assumptions for the independence of $\sigma _ { V } ^ { 2 }$ and $\mathcal { E }$ . Note
|
| 131 |
+
98 that in a more general framework, this assumption could be relaxed. An example of $n$ -step returns is
|
| 132 |
+
99 presented in the the algorithm displayed in $\ S 1$ from the supplementary material.
|
| 133 |
+
100 The following subsections will present, for the case of categorical actions, how to model the deter
|
| 134 |
+
101 ministic action-value function $\boldsymbol { q } ( s , a )$ using a neural network.
|
| 135 |
+
|
| 136 |
+
# 2.3 TAGI Deep Q-learning for Categorical Actions
|
| 137 |
+
|
| 138 |
+
103 Suppose we represent the environment’s state at a time $t$ and $t + 1$ by $\{ s , s ^ { \prime } \}$ , and the expected value
|
| 139 |
+
104 for each of the A possible actions $a \in { \mathcal { A } }$ by the vector $q \in \mathbb { R } ^ { \mathtt { A } }$ . In that context, the role of the neural
|
| 140 |
+
105 network is to model the relationships between $\{ s , a \}$ and $\pmb q$ . Figure 1a presents a directed acyclic
|
| 141 |
+
106 graph (DAG) describing the interconnectivity in such a neural network, where red nodes denote state
|
| 142 |
+
107 variables, green nodes are vectors of hidden units $_ z$ , the blue box is a compact representation for
|
| 143 |
+
108 the structure of a convolutional neural network, and where gray arrows represent the weights and
|
| 144 |
+
109 bias $\pmb \theta$ connecting the different hidden layers. Note that unlike other gray arrows, the red ones in
|
| 145 |
+
110 (b) are not directed arcs representing dependencies, but they simply outline the flow of information
|
| 146 |
+
111 that takes place during the inference step. For simplification purposes, the convolutional operations
|
| 147 |
+
112 are omitted and all regrouped under the CNN box [19]. In order to learn the parameters $\pmb \theta$ of such a
|
| 148 |
+
113 network, we need to expand the graph from Figure 1a to include the reward $r$ , the error term $\sigma _ { V } \epsilon$
|
| 149 |
+
114 and $\pmb q ^ { \prime }$ , the $q$ -values of the time step $t + 1$ . This configuration is presented in Figure 1b where the
|
| 150 |
+
115 nodes that have been doubled represent the states $\pmb { s }$ and $s ^ { \prime }$ which are both evaluated in a network
|
| 151 |
+
116 sharing the same parameters. When applying Equation 6, $q$ -values corresponding to a specific action
|
| 152 |
+
117 can be selected using a vector $h _ { i } \in \{ 0 , \dot { 1 } \} ^ { \bar { \mathtt { A } } }$ having a single non-zero value for the $i$ -th component
|
| 153 |
+
118 identifying which action was taken at a time $t$ so that
|
| 154 |
+
|
| 155 |
+
$$
|
| 156 |
+
q _ { i } = [ \pmb q ] _ { i } = h _ { i } ^ { \top } \pmb q .
|
| 157 |
+
$$
|
| 158 |
+
|
| 159 |
+
119 During the network’s training, analogously to Thompson sampling [23], the vector $h _ { i } ^ { \prime } \in \{ 0 , 1 \} ^ { \mathtt { A } }$ is defined such that the 120 $i$ -th non-zero value corresponds to the index of the largest value among $\pmb q ^ { \prime }$ , a (a) Neural network DAG for modelling the action-value function $q$
|
| 160 |
+
|
| 161 |
+

|
| 162 |
+
|
| 163 |
+

|
| 164 |
+
(b) DAG for the temporal-difference Q-learning configuration
|
| 165 |
+
Figure 1: Graphical representation of a neural network structure for temporal-difference Q-learning with categorical actions. The red nodes denote state variables, green nodes are vectors of hidden units $_ z$ , and the blue box is a compact representation for the structure of a convolutional neural network. The gray arrows represent the weights and bias $\pmb \theta$ connecting the different hidden layers and the red arrows outline the flow of information that takes place during the inference step.
|
| 166 |
+
|
| 167 |
+
121 vector of realizations from the neural network’s posterior predictive output $Q \sim \mathcal N ( q ^ { \prime } ; \mu _ { Q | \mathcal D } , \Sigma _ { Q | \mathcal D } )$ .
|
| 168 |
+
122 Because of the Gaussian assumptions in TAGI, this posterior predictive is readily available from the
|
| 169 |
+
123 forward uncertainty propagation step, as outlined in $\ S 2 . 1$ .
|
| 170 |
+
124 The red arrows in Figure 1b outline the flow of information during the inference procedure. The first
|
| 171 |
+
125 step consists in inferring $\pmb q$ using the relationships defined in either Equation 6 or 7. As this is a linear
|
| 172 |
+
126 equation involving Gaussian random variables, the inference is analytically tractable. From there, one
|
| 173 |
+
127 can follow the same layer-wise recursive procedure proposed by Goulet et al. [9] in order to learn
|
| 174 |
+
128 the weights and biases in $\pmb \theta$ . With the exclusion of the standard hyperparameters related to network
|
| 175 |
+
129 architecture, batch size, buffer size or the discount factor, this TAGI-DQN framework only involves a
|
| 176 |
+
130 single hyperparameter, $\sigma _ { V }$ , the standard deviation for the value function. Note that when using CNNs
|
| 177 |
+
131 with TAGI, Nguyen and Goulet [19] recommended using a decay function for the standard deviation
|
| 178 |
+
132 of the observation noise so that at after seing $e$ batches of $n$ -steps,
|
| 179 |
+
|
| 180 |
+
$$
|
| 181 |
+
\sigma _ { V } ^ { e } = \operatorname* { m a x } ( \sigma _ { V } ^ { \operatorname* { m i n } } , \eta \cdot \sigma _ { V } ) ^ { e - 1 } .
|
| 182 |
+
$$
|
| 183 |
+
|
| 184 |
+
133 The model in Equation 9 has three hyperparameters, the minimal noise parameter $\sigma _ { V } ^ { \mathrm { m i n } }$ , the decay
|
| 185 |
+
134 factor $\eta$ and the initial noise parameter $\sigma _ { V }$ . As it was shown by Nguyen and Goulet [19] for CNNs
|
| 186 |
+
135 and how we show in $\ S 4$ for RL problems, TAGI’s performance is robust towards the selection of these
|
| 187 |
+
136 hyperparameters.
|
| 188 |
+
137 A comparison of implementation between TAGI and backpropagation on deep Q-network with
|
| 189 |
+
138 experience replay [17] is shown in Figure 2. A practical implementation of $n$ -step TAGI deep
|
| 190 |
+
139 Q-learning is presented in Algorithm 1 from the supplementary material.
|
| 191 |
+
|
| 192 |
+
# 140 3 Related Works
|
| 193 |
+
|
| 194 |
+
141 Over the last decades, several approximate methods have been proposed in order to allow for Bayesian
|
| 195 |
+
142 neural networks [18, 12, 10, 5, 14, 20, 29, 8] with various degree of approximations. Although some
|
| 196 |
+
143 these methods have shown to be capable of tackling classification tasks on datasets such ImageNet
|
| 197 |
+
144 [20], few of them have been applied on large-scale RL benchmark problems. The key idea behind
|
| 198 |
+
145 using Bayesian methods for reinforcement learning is to consider the uncertainty associated with
|
| 199 |
+
146 Q-functions in order to identify a tradeoff between exploring the performance of possible actions and
|
| 200 |
+
147 exploiting the current optimal policy [25]. This typically takes the form of performing Thompson
|
| 201 |
+
148 sampling [23] rather than relying on heuristics such as $\epsilon$ -greedy.
|
| 202 |
+
149 For instance, MC dropout [8] was introduced has a method intrinsically suited for reinforcement
|
| 203 |
+
150 learning. Nevertheless, five years after its inception, the approach has not yet been reliably scaled
|
| 204 |
+
151 to more advanced benchmarks such as the Atari game environment. The same applies to Bayes
|
| 205 |
+
152 by-backprop [5] which was recently applied to simple RL problems [13], and which has not yet
|
| 206 |
+
153 been applied to more challenging environments requiring convolutional networks. On the other
|
| 207 |
+
154 hand, Bayesian neural networks relying on sampling methods such as Hamiltonian Monte-Carlo
|
| 208 |
+
155 [18] are typically computationally demanding to be scaled to RL problems involving such a complex
|
| 209 |
+
156 environment.
|
| 210 |
+
157 Although mainstream methods related to Bayesian neural networks have seldom been applied to
|
| 211 |
+
158 complex RL problems, several research teams have worked on alternative approaches in order to
|
| 212 |
+
159 allow performing Thompson sampling. For instance, Azizzadenesheli et al. [4] have employed a deep
|
| 213 |
+
160 Q-network where the output layer relies on Bayesian linear regression. This approach was shown
|
| 214 |
+
161 to be outperforming its deterministic counterparts on Atari games. Another approach by Osband et
|
| 215 |
+
162 al. [21] employs bootstrapped deep Q-networks with multiple network heads in order to represent
|
| 216 |
+
163 the uncertainty in the Q-functions. This approach was also shown to scale to Atari games while
|
| 217 |
+
164 presenting an improved performance in comparison with deterministic deep Q-networks. Finally,
|
| 218 |
+
165 Wang and Zhou [27] have tackled the same problem, but this time by modelling the variability in the
|
| 219 |
+
166 Q-functions through a latent space learned using variational inference. Despite its good performance
|
| 220 |
+
167 on the benchmarks tested, it did not allowed to be scaled to the Atari game environment.
|
| 221 |
+
168 The TAGI deep Q-network presented in th is paper is the first demonstration that an analytically
|
| 222 |
+
169 tractable inference approach for Bayesian neural networks can be scaled to a problem as challenging
|
| 223 |
+
170 as the Atari game environment.
|
| 224 |
+
|
| 225 |
+

|
| 226 |
+
Figure 2: Comparison of TAGI with backpropagation on deep Q-network with experience replay. PDF: probability density function; $L$ : loss function; $\mathcal { U }$ : uniform distribution; randi: uniformly distributed pseudorandom integers.
|
| 227 |
+
|
| 228 |
+
# 171 4 Benchmarks
|
| 229 |
+
|
| 230 |
+
172 This section compares the performance of TAGI with backpropagation-based standard implementa
|
| 231 |
+
173 tions on off- and on-policy deep RL. For the off-policy RL, both TAGI-based and backpropagation
|
| 232 |
+
174 based RL approaches are applied to deep Q-learning with experience replay (see Algorithm 1 & 2)
|
| 233 |
+
175 for the lunar lander and cart pole environments. For the on-policy RL, TAGI is applied to the $n$ -step
|
| 234 |
+
176 Q-learning algorithm and is compared with its backpropagation-based counterpart [15]. We perform
|
| 235 |
+
177 the comparison for five Atari games including Beamrider, Breakout, Pong, Qbert, and Space Invaders.
|
| 236 |
+
178 Note that these five games are commonly selected for tuning hyperparameters for the entire Atari
|
| 237 |
+
179 games [15, 16]. All benchmark environments are taken from the OpenAI Gym [6].
|
| 238 |
+
181 In the first experiments with off-policy RL, we use a fully-connected multilayer perceptron (MLP)
|
| 239 |
+
182 with two hidden layers of 256 units for the lunar lander environment, and with one hidden layer of
|
| 240 |
+
183 64 units for the cart pole environment. In these experiments, there is no need for input processing
|
| 241 |
+
184 nor for reward normalization. Note that unlike for the deterministic Q-network, TAGI does not use a
|
| 242 |
+
185 target Q-network for ensuring the stability during training and allows eliminating the hyperparameter
|
| 243 |
+
186 related to the target update frequency. For the deep Q-network trained with backpropagation, we
|
| 244 |
+
187 employ the pre-tuned implementation of OpenAI baselines [7] with all hyperparameters set to the
|
| 245 |
+
188 default values.
|
| 246 |
+
189 For the Atari experiments with on-policy RL, we use the same input processing and model architecture
|
| 247 |
+
190 as Mnih et al. [15]. The Q-network uses two convolutional layers (16-32) and a full-connected MLP
|
| 248 |
+
191 of 256 units. TAGI $n$ -step Q-learning only uses a single network to represent the value function for
|
| 249 |
+
192 each action, and relies on a single learning agent. The reason behind this choice is that TAGI current
|
| 250 |
+
193 main library is only available on Matlab which does not support running a Python multiprocessing
|
| 251 |
+
194 module such as the OpenAI gym. In the context of TAGI, we use an horizon of 128 steps and as
|
| 252 |
+
195 recommended by Andrychowicz et al. [3] and following practical implementation details [1, 2],
|
| 253 |
+
196 each return in $n$ -step Q-learning algorithm is normalized by subtracting the average return from
|
| 254 |
+
197 the current $n$ -steps and then dividing by the empirical standard deviation from the set of $n$ returns.
|
| 255 |
+
198 The standard deviation for the value function, $( \sigma _ { V } )$ , is initialized at 2. $\sigma _ { V }$ is decayed each 128
|
| 256 |
+
199 steps with a factor $\eta = 0 . 9 9 9 9$ . The minimal standard deviation for the value function $\sigma _ { V } ^ { \mathrm { m i n } } = 0 . 3$
|
| 257 |
+
200 These hyperparameters values were not grid-searched but simply adapted to the scale of the problems
|
| 258 |
+
201 and are kept constant for all experiments. The complete details of the network architecture and
|
| 259 |
+
202 hyperparameters are provided in the supplementary material.
|
| 260 |
+
|
| 261 |
+
# 4.2 Results
|
| 262 |
+
|
| 263 |
+
204 For the first set of experiments using off-policy RL, Figure 3 presents the average reward over 205 100 episodes for three runs for the lunar lander and cart pole environment. The TAGI-based deep 206 Q-learning with experience replay shows a faster and more stable learning than the one relying on backpropagation, while not requiring a target network.
|
| 264 |
+
|
| 265 |
+

|
| 266 |
+
Figure 3: Illustration of average rewards over 100 episodes of three runs for one million time steps for the TAGI-based and backpropagation-based deep Q-learning.
|
| 267 |
+
|
| 268 |
+
208 Table 1 shows that the average reward over the last 100 episodes obtained using TAGI are greater than the one obtained using backpropagation.
|
| 269 |
+
|
| 270 |
+
Table 1: Average reward over the last 100 episodes for the lunar lander and cart pole experiments. TAGI: Tractable Approximate Gaussian Inference.
|
| 271 |
+
|
| 272 |
+
<table><tr><td>Method</td><td>Lunar lander</td><td>Cart pole</td></tr><tr><td>TAGI</td><td>277.6 ± 6.3</td><td>199.2 ± 1.3</td></tr><tr><td>Backpropagation 166.7 ± 103.6</td><td></td><td>130.3 ± 16.9</td></tr></table>
|
| 273 |
+
|
| 274 |
+
210 Figure 4 compares the average reward over 100 episodes for three runs obtained for TAGI, with 211 the results from Mnih et al. [15] for the second set of experiments on Atari games. Note that all 212 results presented were obtained for a single agent, and that the results for the backpropagation-trained networks are only reported at the end of each epoch.
|
| 275 |
+
|
| 276 |
+

|
| 277 |
+
Figure 4: Illustration of average reward over 100 episodes of three runs for five Atari games. The number of epochs is used here for the comparison of TAGI and backpropagation-trained counterpart obtained by Mnih et al. [15]. Each epoch corresponds to four million frames. The environment identity are {Atari Game}NoFrameSkip-v4.
|
| 278 |
+
|
| 279 |
+
214 Results show that TAGI outperforms the results from the original $n$ -step Q-learning algorithm trained
|
| 280 |
+
215 with backpropagation [15] on Breakout, Pong, and Qbert, while underperforming on Beam Rider
|
| 281 |
+
216 and Space Invaders. The average training time of TAGI for an Atari game is approximately 13 hours
|
| 282 |
+
217 on GPU calculations benchmarked on a 4-core-intel desktop of $3 2 \mathrm { G B }$ of RAM with a NVIDIA
|
| 283 |
+
218 GTX 1080 Ti GPU. The training speed of TAGI for the experiment of the off-policy deep RL is
|
| 284 |
+
219 approximately three times slower on CPU calculations than the backpropagation-trained counterpart.
|
| 285 |
+
220 The reason behind this slower training time is because of its intrinsically different inference engine, so
|
| 286 |
+
221 that TAGI’s implementation is not compatible with existing libraries such as TensorFlow or Pytorch.
|
| 287 |
+
222 TAGI’s library development is still ongoing and it is not yet fully optimized for computational
|
| 288 |
+
223 efficiency. Overall, these results for on- and off policy RL approaches confirm that TAGI can be
|
| 289 |
+
224 applied to large scale problems such as deep Q-learning.
|
| 290 |
+
|
| 291 |
+
# 225 5 Discussion
|
| 292 |
+
|
| 293 |
+
226 Although the performance of TAGI does not systematically outperform its backpropagation-based
|
| 294 |
+
227 counterpart, it requires fewer hyperparameters (see $\ S 3$ in supplementary material). This advantage
|
| 295 |
+
228 is one of the key aspects for improving the generalization and reducing the computational cost of
|
| 296 |
+
229 the hyperparameter tuning process which are the key challenges in current state of deep RL [11].
|
| 297 |
+
230 For instance, in this paper, the TAGI’s hyperparameters relating to the standard deviation of value
|
| 298 |
+
231 function $( \sigma _ { V } )$ are kept constant across all experiments. Moreover, since these hyperparameters
|
| 299 |
+
232 were not subject to grid-search in order to optimize the performance, the results obtained here
|
| 300 |
+
233 are representative of what a user should obtain by simply adapting the hyperparameters to fit the
|
| 301 |
+
234 specificities and scale of the environment at hand.
|
| 302 |
+
235 More advanced RL approaches such as advanced actor critic (A2C) [15] and proximal policy opti
|
| 303 |
+
236 mization (PPO) [22] employ two-networks architectures in which one network is used to approximate
|
| 304 |
+
237 a value function and other is employed to encode the policy. The current TAGI-RL framework is
|
| 305 |
+
238 not yet able to handle such architectures because training a policy network involves an optimization
|
| 306 |
+
239 problem for the selection of the optimal action. Backpropagation-based approach currently rely on
|
| 307 |
+
240 gradient optimization to perform this task, while TAGI will require developing alternative approaches
|
| 308 |
+
241 in order to maintain the analytical tractability without relying on gradient-based optimization.
|
| 309 |
+
|
| 310 |
+
# 242 6 Conclusion
|
| 311 |
+
|
| 312 |
+
This paper presents how to adapt TAGI to deep Q-learning; Throughout the experiments, we demonstrated that TAGI could reach a performance comparable to backpropagation-trained networks while using fewer hyperparameters. These results challenge the common belief that for large scale problems such as the Atari environment, neural networks can only be trained by relying on gradient backpropagation. We have shown here that this current paradigm is no longer the only alternative as TAGI has a linear computational complexity and can be used to learn the parameters complex networks in an analytically tractable manner, without relying on gradient-based optimization.
|
| 313 |
+
|
| 314 |
+
# References
|
| 315 |
+
|
| 316 |
+
[1] Pytorch examples for reinforce algorithm. https://github.com/pytorch/examples/blob/master/ reinforcement_learning/reinforce.py, 2019.
|
| 317 |
+
[2] Pytorch examples for actor crtic algorithm. https://github.com/pytorch/examples/blob/master/ reinforcement_learning/actor_critic.py, 2020.
|
| 318 |
+
[3] M. Andrychowicz, A. Raichuk, P. Stanczyk, M. Orsini, S. Girgin, R. Marinier, L. Hussenot, M. Geist, ´ O. Pietquin, M. Michalski, S. Gelly, and O. Bachem. What matters for on-policy deep actor-critic methods? a large-scale study. In International Conference on Learning Representations, 2021.
|
| 319 |
+
[4] K. Azizzadenesheli, E. Brunskill, and A. Anandkumar. Efficient exploration through Bayesian deep q-networks. In IEEE Information Theory and Applications Workshop, pages 1–9, 2018. [5] C. Blundell, J. Cornebise, K. Kavukcuoglu, and D. Wierstra. Weight uncertainty in neural networks. arXiv preprint arXiv:1505.05424, 2015.
|
| 320 |
+
[6] G. Brockman, V. Cheung, L. Pettersson, J. Schneider, J. Schulman, J. Tang, and W. Zaremba. Openai gym. arXiv preprint arXiv:1606.01540, 2016.
|
| 321 |
+
[7] P. Dhariwal, C. Hesse, O. Klimov, A. Nichol, M. Plappert, A. Radford, J. Schulman, S. Sidor, Y. Wu, and P. Zhokhov. Openai baselines. https://github.com/openai/baselines, 2017.
|
| 322 |
+
[8] Y. Gal and Z. Ghahramani. Dropout as a bayesian approximation: Representing model uncertainty in deep learning. In ICML proceedings, pages 1050–1059, 2016. [9] J-A. Goulet, L.H. Nguyen, and S. Amiri. Tractable approximate Gaussian inference for Bayesian neural networks. arXiv preprint, 2020.
|
| 323 |
+
[10] J. M. Hernández-Lobato and R. Adams. Probabilistic backpropagation for scalable learning of bayesian neural networks. In International Conference on Machine Learning, pages 1861–1869, 2015.
|
| 324 |
+
[11] A. Irpan. Deep reinforcement learning doesn’t work yet. https://www.alexirpan.com/2018/02/14/ rl-hard.html, 2018.
|
| 325 |
+
[12] D. P. Kingma, T. Salimans, and M. Welling. Variational dropout and the local reparameterization trick. In C. Cortes, N. Lawrence, D. Lee, M. Sugiyama, and R. Garnett, editors, Advances in Neural Information Processing Systems, volume 28, 2015.
|
| 326 |
+
[13] Z. Lipton, X. Li, J. Gao, L. Li, F. Ahmed, and L. Deng. Bbq-networks: Efficient exploration in deep reinforcement learning for task-oriented dialogue systems. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 32, 2018.
|
| 327 |
+
[14] C. Louizos and M. Welling. Structured and efficient variational deep learning with matrix Gaussian posteriors. In ICML proceedings, pages 1708–1716, 2016.
|
| 328 |
+
[15] V. Mnih, Adria P. Badia, M. Mirza, A. Graves, T. Lillicrap, T. Harley, D. Silver, and K. Kavukcuoglu. Asynchronous methods for deep reinforcement learning. In ICML proceedings, pages 1928–1937. PMLR, 2016.
|
| 329 |
+
[16] V. Mnih, K. Kavukcuoglu, D. Silver, A. Graves, I. Antonoglou, D. Wierstra, and M. Riedmiller. Playing atari with deep reinforcement learning. arXiv preprint arXiv:1312.5602, December 2013.
|
| 330 |
+
[17] V. Mnih, K. Kavukcuoglu, D. Silver, A.A. Rusu, J. Veness, M.G. Bellemare, A. Graves, M. Riedmiller, A.K. Fidjeland, and G Ostrovski. Human-level control through deep reinforcement learning. nature, 518(7540):529–533, 2015.
|
| 331 |
+
[18] R. M. Neal. Bayesian learning for neural networks. PhD thesis, University of Toronto, 1995.
|
| 332 |
+
[19] L. H. Nguyen and J-A. Goulet. Analytically tractable inference in deep neural networks. arXiv preprint, 2021.
|
| 333 |
+
[20] K. Osawa, S. Swaroop, A. Jain, R. Eschenhagen, R. E. Turner, R. Yokota, and M. E. Khan. Practical deep learning with Bayesian principles. In Advances in Neural Information Processing Systems proceedings, 2019.
|
| 334 |
+
[21] I. Osband, C. Blundell, A. Pritzel, and Benjamin V. Roy. Deep exploration via bootstrapped dqn. In NEURIPS proceedings, pages 4033–4041, 2016.
|
| 335 |
+
[22] J. Schulman, F. Wolski, P. Dhariwal, A. Radford, and O. Klimov. Proximal policy optimization algorithms. arXiv preprint arXiv:1707.06347, 2017.
|
| 336 |
+
[23] M. Strens. A Bayesian framework for reinforcement learning. In ICML proceedings, pages 943–950, 2000.
|
| 337 |
+
[24] R. S. Sutton. Learning to predict by the methods of temporal differences. Machine learning, 3(1):9–44, 1988.
|
| 338 |
+
[25] R. S. Sutton and A. G. Barto. Reinforcement learning: An introduction. MIT Press, 2nd edition, 2018.
|
| 339 |
+
[26] H. Van Hasselt, A. Guez, and D. Silver. Deep reinforcement learning with double q-learning. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 30, 2016.
|
| 340 |
+
[27] Z. Wang and M. Zhou. Thompson sampling via local uncertainty. In ICML proceedings, volume 119, pages 10115–10125, 13–18 Jul 2020.
|
| 341 |
+
[28] C. J. Watkins and P. Dayan. Q-learning. Machine learning, 8(3-4):279–292, 1992.
|
| 342 |
+
[29] A. Wu, S. Nowozin, E. Meeds, R. E. Turner, J. M. Hernández-Lobato, and A. L. Gaunt. Deterministic variational inference for robust Bayesian neural networks. In ICLR proceedings, 2019.
|
| 343 |
+
|
| 344 |
+
# Checklist
|
| 345 |
+
|
| 346 |
+
1. For all authors...
|
| 347 |
+
|
| 348 |
+
(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes]
|
| 349 |
+
(b) Did you describe the limitations of your work? [Yes]
|
| 350 |
+
(c) Did you discuss any potential negative societal impacts of your work? [N/A]
|
| 351 |
+
(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
|
| 352 |
+
|
| 353 |
+
2. If you are including theoretical results...
|
| 354 |
+
|
| 355 |
+
(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]
|
| 356 |
+
|
| 357 |
+
3. If you ran experiments...
|
| 358 |
+
|
| 359 |
+
(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)? [No] The code will be made available upon the publication of the paper
|
| 360 |
+
(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes]
|
| 361 |
+
(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [Yes]
|
| 362 |
+
|
| 363 |
+
(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]
|
| 364 |
+
|
| 365 |
+
4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
|
| 366 |
+
|
| 367 |
+
(a) If your work uses existing assets, did you cite the creators? [Yes]
|
| 368 |
+
(b) Did you mention the license of the assets? [N/A]
|
| 369 |
+
(c) Did you include any new assets either in the supplemental material or as a URL? [No]
|
| 370 |
+
(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [N/A]
|
| 371 |
+
(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A]
|
| 372 |
+
|
| 373 |
+
5. If you used crowdsourcing or conducted research with human subjects...
|
| 374 |
+
|
| 375 |
+
(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
|
| 376 |
+
(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A]
|
| 377 |
+
(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]
|
md/train/O-XJwyoIF-k/O-XJwyoIF-k.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/train/SJeNz04tDS/SJeNz04tDS.md
ADDED
|
@@ -0,0 +1,317 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# OVERLEARNING REVEALS SENSITIVE ATTRIBUTES
|
| 2 |
+
|
| 3 |
+
Congzheng Song Cornell University cs2296@cornell.edu
|
| 4 |
+
|
| 5 |
+
Vitaly Shmatikov
|
| 6 |
+
Cornell Tech
|
| 7 |
+
shmat@cs.cornell.edu
|
| 8 |
+
|
| 9 |
+
# ABSTRACT
|
| 10 |
+
|
| 11 |
+
“Overlearning” means that a model trained for a seemingly simple objective implicitly learns to recognize attributes and concepts that are (1) not part of the learning objective, and (2) sensitive from a privacy or bias perspective. For example, a binary gender classifier of facial images also learns to recognize races—even races that are not represented in the training data—and identities.
|
| 12 |
+
|
| 13 |
+
We demonstrate overlearning in several vision and NLP models and analyze its harmful consequences. First, inference-time representations of an overlearned model reveal sensitive attributes of the input, breaking privacy protections such as model partitioning. Second, an overlearned model can be “re-purposed” for a different, privacy-violating task even in the absence of the original training data.
|
| 14 |
+
|
| 15 |
+
We show that overlearning is intrinsic for some tasks and cannot be prevented by censoring unwanted attributes. Finally, we investigate where, when, and why overlearning happens during model training.
|
| 16 |
+
|
| 17 |
+
# 1 INTRODUCTION
|
| 18 |
+
|
| 19 |
+
We demonstrate that representations learned by deep models when training for seemingly simple objectives reveal privacy- and bias-sensitive attributes that are not part of the specified objective. These unintentionally learned concepts are neither finer-, nor coarse-grained versions of the model’s labels, nor statistically correlated with them. We call this phenomenon overlearning. For example, a binary classifier trained to determine the gender of a facial image also learns to recognize races (including races not represented in the training data) and even identities of individuals.
|
| 20 |
+
|
| 21 |
+
Overlearning has two distinct consequences. First, the model’s inference-time representation of an input reveals the input’s sensitive attributes. For example, a facial recognition model’s representation of an image reveals if two specific individuals appear together in it. Overlearning thus breaks inference-time privacy protections based on model partitioning (Osia et al., 2018; Chi et al., 2018; Wang et al., 2018). Second, we develop a new, transfer learning-based technique to “re-purpose” a model trained for benign task into a model for a different, privacy-violating task. This shows the inadequacy of privacy regulations that rely on explicit enumeration of learned attributes.
|
| 22 |
+
|
| 23 |
+
Overlearning is intrinsic for some tasks, i.e., it is not possible to prevent a model from learning sensitive attributes. We show that if these attributes are censored (Xie et al., 2017; Moyer et al., 2018), the censored models either fail to learn their specified tasks, or still leak sensitive information. We develop a new de-censoring technique to extract information from censored representations. We also show that overlearned representations enable recognition of sensitive attributes that are not present in the training data. Such attributes cannot be censored using any known technique. This shows the the inadequacy of censoring as a privacy protection technology.
|
| 24 |
+
|
| 25 |
+
To analyze where and why overlearning happens, we empirically show how general features emerge in the lower layers of models trained for simple objectives and conjecture an explanation based on the complexity of the training data.
|
| 26 |
+
|
| 27 |
+
# 2 BACKGROUND
|
| 28 |
+
|
| 29 |
+
We focus on supervised deep learning. Given an input $x$ , a model $M$ is trained to predict the target $y$ using a discriminative approach. We represent the model $M = C \circ E$ as a feature extractor (encoder) $E$ and classifier $C$ . The representation $z = E ( x )$ is passed to $C$ to produce the prediction by modeling $p ( y | z ) = C ( z )$ . Since $E$ can have multiple layers of representation, we use $E _ { l } ( x ) = z _ { l }$ to denote the model’s internal representation at layer $l$ ; $z$ is the representation at the last layer.
|
| 30 |
+
|
| 31 |
+
Model partitioning splits the model into a local, on-device part and a remote, cloud-based part to improve scalability of inference (Lane & Georgiev, 2015; Kang et al., 2017) and protect privacy of inputs into the model (Li et al., 2017; Osia et al., 2018; Chi et al., 2018; Wang et al., 2018). For privacy, the local part of the model computes a representation, censors it as described below, and sends it to the cloud part, which computes the model’s output.
|
| 32 |
+
|
| 33 |
+
Censoring representations. The goal is to encode input $x$ into a representation $z$ that does not reveal unwanted properties of $x$ , yet is expressive enough to predict the task label $y$ . Censoring has been used to achieve transform-invariant representations for computer vision, bias-free representations for fair machine learning, and privacy-preserving representations that hide sensitive attributes.
|
| 34 |
+
|
| 35 |
+
A straightforward censoring approach is based on adversarial training (Goodfellow et al., 2014). It involves a mini-max game between a discriminator $D$ trying to infer $s$ from $z$ during training and an encoder and classifier trying to infer the task label $y$ while minimizing the discriminator’s success (Edwards & Storkey, 2016; Iwasawa et al., 2016; Hamm, 2017; Xie et al., 2017; Li et al., 2018; Coavoux et al., 2018; Elazar & Goldberg, 2018). The game is formulated as:
|
| 36 |
+
|
| 37 |
+
$$
|
| 38 |
+
\displaystyle \operatorname* { m i n } _ { E , C } \operatorname* { m a x } _ { D } \mathbb { E } _ { x , y , s } [ \gamma \log p ( s | z = E ( x ) ) - \log p ( y | z = E ( x ) ) ]
|
| 39 |
+
$$
|
| 40 |
+
|
| 41 |
+
where $\gamma$ balances the two log likelihood terms. The inner optimization maximizes $\log p ( s | z =$ $E ( x ) ,$ ), i.e., the discriminator’s prediction of the sensitive attribute $s$ given a representation $z$ . The outer optimization, on the other hand, trains the encoder and classifier to minimize the log likelihood of the discriminator predicting $s$ and maximize that of predicting the task label $y$ .
|
| 42 |
+
|
| 43 |
+
Another approach casts censoring as a single information-theoretical objective. The requirement that $z$ not reveal $s$ can be formalized as an independence constraint $z \perp s$ , but independence is intractable to measure in practice, thus the requirement is relaxed to a constraint on the mutual information between $z$ and $s$ (Osia et al., 2018; Moyer et al., 2018). The overall training objective of censoring $s$ and predicting $y$ from $z$ is formulated as:
|
| 44 |
+
|
| 45 |
+
$$
|
| 46 |
+
\operatorname* { m a x } I ( z , y ) - \beta I ( z , x ) - \lambda I ( z , s )
|
| 47 |
+
$$
|
| 48 |
+
|
| 49 |
+
where $I$ is mutual information and $\beta , \lambda$ are the balancing coefficients; $\beta = 0$ in (Osia et al., 2018). The first two terms $I ( z , y ) - \beta I ( z , x )$ is the objective of variational information bottleneck (Alemi et al., 2017), the third term is the relaxed independence constraint of $z$ and $s$ .
|
| 50 |
+
|
| 51 |
+
Intuitively, this objective aims to maximize the information of $y$ in $z$ as per $I ( z , y )$ , forget the information of $x$ in $z$ as per $- \beta I ( z , x )$ , and remove the information of $s$ in $z$ as per $- \lambda I ( z , s )$ . This objective has an analytical lower bound (Moyer et al., 2018):
|
| 52 |
+
|
| 53 |
+
$$
|
| 54 |
+
\mathbb { E } _ { x , s } [ \mathbb { E } _ { z , y } [ \log p ( y | z ) ] - ( \beta + \lambda ) K L [ q ( z | x ) | | q ( z ) ] - \lambda \mathbb { E } _ { z } [ \log p ( x | z , s ) ] ]
|
| 55 |
+
$$
|
| 56 |
+
|
| 57 |
+
where $K L$ is Kullback-Leibler divergence and $\log p ( x | z , s )$ is the reconstruction likelihood of $x$ given $z$ and $s$ . The conditional distributions $p ( y | z ) = C ( z )$ , $q ( z | x ) = E ( x )$ are modeled as in adversarial training and $p ( x | z , s )$ is modeled with a decoder $R ( z , s ) = p ( x | z , s )$ .
|
| 58 |
+
|
| 59 |
+
All known censoring techniques require a “blacklist” of attributes to censor, and inputs with these attributes must be represented in the training data. Censoring for fairness is applied to the model’s final layer to make its output independent of the sensitive attributes or satisfy a specific fairness constraint (Zemel et al., 2013; Louizos et al., 2016; Madras et al., 2018; Song et al., 2019). In this paper, we use censoring not for fairness but to demonstrate that models cannot be prevented from learning to recognize sensitive attributes. To show this, we apply censoring to different layers, not just the output.
|
| 60 |
+
|
| 61 |
+
# 3 EXPLOITING OVERLEARNING
|
| 62 |
+
|
| 63 |
+
We demonstrate two different ways to exploit overlearning in a trained model $M$ . The inferencetime attack (Section 3.1) applies $M$ to an input and uses $M$ ’s representation of that input to predict its sensitive attributes. The model-repurposing attack (Section 3.2) uses $M$ to create another model that, when applied to an input, directly predicts its sensitive attributes.
|
| 64 |
+
|
| 65 |
+
# Inferring $s$ from representation:
|
| 66 |
+
|
| 67 |
+
# Adversarial re-purposing:
|
| 68 |
+
|
| 69 |
+
1: Input: Adversary’s auxiliary dataset $\mathcal { D } _ { \mathrm { a u x } }$ ,
|
| 70 |
+
black-box oracle $E$ , observed $z ^ { \star }$
|
| 71 |
+
2: ${ \mathcal { D } } _ { \operatorname { a t t a c k } } \gets \{ ( E ( x ) , s ) | ( x , s ) \in { \mathcal { D } } _ { \operatorname { a u x } } \}$
|
| 72 |
+
3: Train attack model $M _ { \mathrm { a t t a c k } }$ on $\mathcal { D } _ { \mathrm { a t t a c k } }$
|
| 73 |
+
4: return prediction $\hat { s } = M _ { \mathrm { a t t a c k } } \mathopen { } \mathclose \bgroup \left( z ^ { \star } \aftergroup \egroup \right)$
|
| 74 |
+
1: Input: Model $M$ for the original task, transfer
|
| 75 |
+
dataset $\mathcal { D } _ { \mathrm { t r a n s f e r } }$ for the new task
|
| 76 |
+
2: Build $M _ { \mathrm { t r a n s f e r } } = C _ { \mathrm { t r a n s f e r } } \circ E _ { l }$ on layer $l$
|
| 77 |
+
3: Fine-tune $M _ { \mathrm { t r a n s f e r } }$ on Dtransfer
|
| 78 |
+
4: return transfer model Mtransfer
|
| 79 |
+
|
| 80 |
+
# Algorithm 1 De-censoring representations
|
| 81 |
+
|
| 82 |
+
1: Input: Auxiliary dataset $\mathcal { D } _ { \mathrm { a u x } }$ , black-box oracle $E$ , observed representation $z ^ { \star }$
|
| 83 |
+
2: Train auxiliary model $M _ { \mathrm { a u x } } = E _ { \mathrm { a u x } } \circ C _ { \mathrm { a u x } }$ on $\mathcal { D } _ { \mathrm { a u x } }$
|
| 84 |
+
3: Initialize transform model $T$ , inference attack model $M _ { \mathrm { a t t a c k } }$
|
| 85 |
+
4: for each training iteration do
|
| 86 |
+
5: Sample a batch of data $( x , s )$ from $\mathcal { D } _ { \mathrm { a u x } }$ and compute $z = E ( x )$ , $z _ { \mathrm { a u x } } = E _ { \mathrm { a u x } } ( x )$
|
| 87 |
+
6: Update $T$ on the batch of $\left( z , z _ { \mathrm { a u x } } \right)$ with loss $| | T ( \bar { z } ) - z _ { \mathrm { a u x } } | | _ { 2 } ^ { 2 }$
|
| 88 |
+
7: Update $M _ { \mathrm { a t t a c k } }$ on the batch of $( T ( z ) , s )$ with cross-entropy loss
|
| 89 |
+
8: end for
|
| 90 |
+
9: return prediction $\hat { s } = M _ { \mathrm { a t t a c k } } ( T ( z ^ { \star } ) )$
|
| 91 |
+
|
| 92 |
+
# 3.1 INFERRING SENSITIVE ATTRIBUTES FROM REPRESENTATION
|
| 93 |
+
|
| 94 |
+
We measure the leakage of sensitive properties from the representations of overlearned models via the following attack. Suppose an adversary can observe the representation $z ^ { \star }$ of a trained model $M$ on input $x ^ { \star }$ at inference time but cannot observe $x ^ { \star }$ directly. This scenario arises in practice when model evaluation is partitioned in order to protect privacy of inputs—see Section 2. The adversary wants to infer some property $s$ of $x ^ { \star }$ that is not part of the task label $y$ .
|
| 95 |
+
|
| 96 |
+
We assume that the adversary has an auxiliary set $\mathcal { D } _ { \mathrm { a u x } }$ of labeled $( x , s )$ pairs and black-box oracle $E$ to compute the corresponding $E ( x )$ . The purpose of $\mathcal { D } _ { \mathrm { a u x } }$ is to help the adversary recognize the property of interest in the model’s representations; it need not be drawn from the same dataset as $x ^ { \star }$ . The adversary uses supervised learning on the $( E ( x ) , s )$ pairs to train an attack model $M _ { \mathrm { a t t a c k } }$ . At inference time, the adversary predicts $\hat { s }$ from the observed $z ^ { \star }$ as $M _ { \mathrm { a t t a c k } } ( z ^ { \star } )$ .
|
| 97 |
+
|
| 98 |
+
De-censoring. If the representation $z$ is “censored” (see Section 2) to reduce the amount of information it reveals about $s$ , the direct inference attack may not succeed. We develop a new, learning-based de-censoring approach (see Algorithm 1) to convert censored representations into a different form that leaks more information about the property of interest. The adversary trains $M _ { \mathrm { a u x } }$ on $\mathcal { D } _ { \mathrm { a u x } }$ to predict $s$ from $x$ , then transforms $z$ into the input features of $M _ { \mathrm { a u x } }$ .
|
| 99 |
+
|
| 100 |
+
We treat de-censoring as an optimization problem with a feature space $L _ { 2 }$ loss $\lvert \lvert T ( z ) - z _ { \mathrm { a u x } } \rvert \rvert _ { 2 } ^ { 2 }$ , where $T$ is the transformer that the adversary wants to learn and ${ \cal Z } _ { \mathrm { a u x } }$ is the uncensored representation from $M _ { \mathrm { a u x } }$ . Training with a feature-space loss has been proposed for synthesizing more natural images by matching them with real images (Dosovitskiy & Brox, 2016; Nguyen et al., 2016). In our case, we match censored and uncensored representations. The adversary can then use $T ( z )$ as an uncensored approximation of $z$ to train an inference model $M _ { \mathrm { a t t a c k } }$ and infer property $s$ as $\dot { M } _ { \mathrm { a t t a c k } } ( T ( z ^ { \star } ) )$ .
|
| 101 |
+
|
| 102 |
+
# 3.2 RE-PURPOSING MODELS TO PREDICT SENSITIVE ATTRIBUTES
|
| 103 |
+
|
| 104 |
+
To re-purpose a model—for example, to convert a model trained for a benign task into a model that predicts a sensitive attribute—we can use features $z _ { l }$ in any layer of $M$ as the feature extractor and connect a new classifier $C _ { \mathrm { t r a n s f e r } }$ to $E _ { l }$ . The transferred model $M _ { \mathrm { t r a n s f e r } } = C _ { \mathrm { t r a n s f e r } } \circ E _ { l }$ is fine-tuned on another, small dataset $\mathcal { D } _ { \mathrm { t r a n s f e r } }$ , which in itself is not sufficient to train an accurate model for the new task. Utilizing features learned by $M$ on the original $\mathcal { D }$ , $M _ { \mathrm { t r a n s f e r } }$ can achieve better results than models trained from scratch on $\mathcal { D } _ { \mathrm { t r a n s f e r } }$ .
|
| 105 |
+
|
| 106 |
+
Feasibility of model re-purposing complicates the application of policies and regulations such as GDPR (EU, 2018). GDPR requires data processors to disclose every purpose of data collection and obtain consent from the users whose data was collected. We show that, given a trained model, it is not possible to determine—nor, consequently, disclose or obtain user consent for—what the model has learned. Learning per se thus cannot be a regulated “purpose” of data collection. Regulators must be aware that even if the original training data has been erased, a model can be re-purposed for a different objective, possibly not envisioned at the time of original data collection. We discuss this further in Section 6.
|
| 107 |
+
|
| 108 |
+
Table 1: Summary of datasets and tasks. Cramer’s V captures statistical correlation between $_ y$ and $s$ (0 indicates no correlation and 1 indicates perfectly correlated).
|
| 109 |
+
|
| 110 |
+
<table><tr><td>Dataset</td><td>Health</td><td>UTKFace</td><td>FaceScrub</td><td>Places365</td><td>Twitter</td><td>Yelp</td><td>PIPA</td></tr><tr><td>Target y</td><td>CCI</td><td>gender</td><td>gender</td><td>in/outdoor</td><td>age</td><td>review score</td><td>facial IDs</td></tr><tr><td>Attribute s</td><td>age</td><td>race</td><td>facial IDs</td><td> scene type</td><td>author</td><td>author</td><td>IDs together</td></tr><tr><td>Cramer's V</td><td>0.149</td><td>0.035</td><td>0.044</td><td>0.052</td><td>0.134</td><td>0.033</td><td>n/a</td></tr></table>
|
| 111 |
+
|
| 112 |
+
# 4 EXPERIMENTAL RESULTS
|
| 113 |
+
|
| 114 |
+
# 4.1 DATASETS, TASKS, AND MODELS
|
| 115 |
+
|
| 116 |
+
Health is the Heritage Health dataset (Heritage Health Prize) with medical records of over 55,000 patients, binarized into 112 features with age information removed. The task is to predict if Charlson Index (an estimate of patient mortality) is greater than zero; the sensitive attribute is age (binned into 9 ranges).
|
| 117 |
+
|
| 118 |
+
UTKFace is a set of over 23,000 face images labeled with age, gender, and race (UTKFace; Zhang et al., 2017). We rescaled them into $5 0 \times 5 0$ RGB pixels. The task is to predict gender; the sensitive attribute is race.
|
| 119 |
+
|
| 120 |
+
FaceScrub is a set of face images labeled with gender (FaceScrub). Some URLs are expired, but we were able to download 74,000 images for 500 individuals and rescale them into $5 0 \times 5 0$ RGB pixels. The task is to predict gender; the sensitive attribute is identity.
|
| 121 |
+
|
| 122 |
+
Places365 is a set of 1.8 million images labeled with 365 fine-grained scene categories. We use a subset of 73,000 images, 200 per category. The task is to predict whether the scene is indoor or outdoor; the sensitive attribute is the fine-grained scene label.
|
| 123 |
+
|
| 124 |
+
Twitter is a set of tweets from the PAN16 dataset (Rangel et al., 2016) labeled with user information. We removed tweets with fewer than 20 tokens and users with fewer than 50 tweets, yielding a dataset of over 46,000 tweets from 151 users with an over 80,000-word vocabulary. The task is to predict the age of the user given a tweet; the sensitive attribute is the author’s identity.
|
| 125 |
+
|
| 126 |
+
Yelp is a set of Yelp reviews labeled with user identities (Yelp Open Dataset). We removed users with fewer than 1,000 reviews and reviews with more than 200 tokens, yielding a dataset of over 39,000 reviews from 137 users with an over 69,000-word vocabulary. The task is to predict the review score between 1 to 5; the sensitive attribute is the author’s identity.
|
| 127 |
+
|
| 128 |
+
PIPA is a set of over 60,000 photos of 2,000 individuals gathered from public Flickr photo albums (Piper project page; Zhang et al., 2015). Each image can include one or more individuals. We cropped their head regions using the bounding boxes in the image annotations. The task is to predict the identity given the head region; the sensitive attribute is whether two head regions are from the same photo.
|
| 129 |
+
|
| 130 |
+
Models. For Health, we use a two-layer fully connected (FC) neural network with 128 and 32 hidden units, respectively, following (Xie et al., 2017; Moyer et al., 2018). For UTKFace and FaceScrub, we use a LeNet (LeCun et al., 1998) variant: three $3 \times 3$ convolutional and $2 \times 2$ max-pooling layers with 16, 32, and 64 filters, followed by two FC layers with 128 and 64 hidden units. For Twitter and Yelp, we use text CNN (Kim, 2014). For Places365 and PIPA, we use AlexNet (Krizhevsky et al., 2012) with convolutional layers pre-trained on ImageNet (Deng et al., 2009) and further add a $3 \times 3$ convolutional layer with 128 filters and $2 \times 2$ max-pooling followed by two FC layers with 128 and 64 hidden units, respectively.
|
| 131 |
+
|
| 132 |
+
Table 2: Accuracy of inference from representations (last FC layer). RAND is random guessing based on majority class labels; BASE is inference from the uncensored representation; ADV from the representation censored with adversarial training; IT from the information-theoretically censored representation.
|
| 133 |
+
|
| 134 |
+
<table><tr><td></td><td colspan="4">Acc of predicting target y</td><td colspan="4">Acc of inferring sensitive attribute s</td></tr><tr><td>Dataset</td><td>RAND</td><td>BASE</td><td>ADV</td><td>IT</td><td>RAND</td><td>BASE</td><td>ADV</td><td>IT</td></tr><tr><td>Health</td><td>66.31</td><td>84.33</td><td>80.16</td><td>82.63</td><td>16.00</td><td>32.52</td><td>32.00</td><td>26.60</td></tr><tr><td>UTKFace</td><td>52.27</td><td>90.38</td><td>90.15</td><td>88.15</td><td>42.52</td><td>62.18</td><td>53.28</td><td>53.30</td></tr><tr><td>FaceScrub</td><td>53.53</td><td>98.77</td><td>97.90</td><td>97.66</td><td>1.42</td><td>33.65</td><td>30.23</td><td>10.61</td></tr><tr><td>Places365</td><td>56.16</td><td>91.41</td><td>90.84</td><td>89.82</td><td>1.37</td><td>31.03</td><td>12.56</td><td>2.29</td></tr><tr><td>Twitter</td><td>45.17</td><td>76.22</td><td>57.97</td><td>n/a</td><td>6.93</td><td>38.46</td><td>34.27</td><td>n/a</td></tr><tr><td>Yelp</td><td>42.56</td><td>57.81</td><td>56.79</td><td>n/a</td><td>15.88</td><td>33.09</td><td>27.32</td><td>n/a</td></tr><tr><td>PIPA</td><td>7.67</td><td>77.34</td><td>52.02</td><td>29.64</td><td>68.50</td><td>87.95</td><td>69.96</td><td>82.02</td></tr></table>
|
| 135 |
+
|
| 136 |
+
# 4.2 INFERRING SENSITIVE ATTRIBUTES FROM REPRESENTATIONS
|
| 137 |
+
|
| 138 |
+
Setup. We use $80 \%$ of the data for training the target models and $20 \%$ for evaluation. The size of the adversary’s auxiliary dataset is $50 \%$ of the training data. Success of the inference attack is measured on the final FC layer’s representation of test data. The baseline is inference from the uncensored representation. We also measure the success of inference against representations censored with $\gamma = 1 . 0$ for adversarial training and $\beta = 0 . 0 1 , \lambda = 0 . 0 0 0 1$ for information-theoretical censoring, following (Xie et al., 2017; Moyer et al., 2018).
|
| 139 |
+
|
| 140 |
+
For censoring with adversarial training, we simulate the adversary with a two-layer FC neural network with 256 and 128 hidden units. The number of epochs is 50 for censoring with adversarial training, 30 for the other models. We use the Adam optimizer with the learning rate of 0.001 and batch size of 128. For information-theoretical censoring, the model is based on VAE (Kingma & Welling, 2013; Moyer et al., 2018). The encoder $q ( z | x )$ has the same architecture as the CNN models with all convolutional layers. On top of that, the encoder outputs a mean vector and a standard deviation vector to model the random variable $z$ with the re-parameterization trick. The decoder $p ( x | z )$ has three de-convolution layers with up-sampling to map $z$ back to the same shape as the input $x$ .
|
| 141 |
+
|
| 142 |
+
For our inference model, we use the same architecture as the censoring adversary. For the PIPA inference model, which takes two representations of faces and outputs a binary prediction of whether these faces appear in the same photo, we use two FC layers followed by a bilinear model: $p ( s | z _ { 1 } , z _ { 2 } ) = \sigma ( h ( z _ { 1 } ) { \mathrm { \hat { W } } } h ( z _ { 2 } ) ^ { \top } )$ , where $z _ { 1 } , z _ { 2 }$ are the two input representations, $h$ is the two FC layers, and $\sigma$ is the sigmoid function. We train the inference model for 50 epochs with the Adam optimizer, learning rate of 0.001, and batch size of 128.
|
| 143 |
+
|
| 144 |
+
Results. Table 2 reports the results. When representations are not censored, accuracy of inference from the last-layer representations is much higher than random guessing for all tasks, which means models overlearn even in the higher, task-specific layers. When representations are censored with adversarial training, accuracy drops for both the main and inference tasks. Accuracy of inference is much higher than in (Xie et al., 2017). The latter uses logistic regression, which is weaker than the training-time censoring-adversary network, whereas we use the same architecture for both the training-time and post-hoc adversaries. Information-theoretical censoring reduces accuracy of inference, but also damages main-task accuracy more than adversarial training for almost all models.
|
| 145 |
+
|
| 146 |
+
Overlearning can cause a model to recognize even the sensitive attributes that are not represented in the training dataset. Such attributes cannot be censored using any known technique. We trained a UTKFace gender classifier on datasets where all faces are of the same race. We then applied this model to test images with four races (White, Black, Asian, Indian) and attempted to infer the race attribute from the model’s representations. Inference accuracy is $6 1 . 9 5 \%$ , $6 1 . 9 9 \%$ , $6 0 . 8 5 \%$ and $6 0 . 8 1 \%$ for models trained only on, respectively, White, Black, Asian, and Indian images—almost as good as the $6 2 . 1 8 \%$ baseline and much higher than random guessing $( 4 2 . 5 2 \% )$ ).
|
| 147 |
+
|
| 148 |
+
Effect of censoring strength. Fig. 2 shows that stronger censoring does not help. On FaceScrub and Twitter with adversarial training, increasing $\gamma$ damages the model’s accuracy on the main task, while accuracy of inference decreases slightly or remains the same. For UTKFace and Yelp, increasing $\gamma$ improves accuracy of inference. This may indicate that the simulated “adversary” during adversarial training overpowers the optimization process and censoring defeats itself.
|
| 149 |
+
|
| 150 |
+

|
| 151 |
+
Figure 2: Reduction in accuracy due to censoring. Blue lines are the main task, red lines are the inference of sensitive attributes. First row is adversarial training with different $\gamma$ values; second and third row is information-theoretical censoring with different $\beta$ and $\lambda$ values respectively.
|
| 152 |
+
|
| 153 |
+
Table 3: Improving inference accuracy with de-censoring. $\delta$ is the increase from Table 2.
|
| 154 |
+
|
| 155 |
+
<table><tr><td>Dataset</td><td>Health</td><td>UTKFace</td><td>FaceScrub</td><td>Places365</td><td>Twitter</td><td>Yelp</td></tr><tr><td>ADV+δ</td><td>32.55 +0.55</td><td>59.38 +6.10</td><td>40.37 +12.24</td><td>19.71 +7.15</td><td>36.55 +2.22</td><td>31.36 +4.04</td></tr><tr><td>IT+δ</td><td>27.05+0.45</td><td>54.31 +1.01</td><td>16.40 +5.79</td><td>3.10 +0.81</td><td>n/a</td><td>n/a</td></tr></table>
|
| 156 |
+
|
| 157 |
+
For all models with information-theoretical censoring, increasing $\beta$ reduces the accuracy of inference but can lead to the model not converging on its main task. Increasing $\lambda$ results in the model not converging on the main task, without affecting the accuracy of inference, on Health, UTKFace and FaceScrub. This seems to contradict the censoring objective, but the reconstruction loss in Equation 2 dominates the other loss terms, which leads to poor divergence between conditional $q ( \bar { z } | x )$ and $q ( z )$ , i.e., information about $x$ is still retained in $z$ .
|
| 158 |
+
|
| 159 |
+
De-censoring. As described in Section 3.1, we developed a new technique to transform censored representations to make inference easier. We first train an auxiliary model on $\mathcal { D } _ { \mathrm { a u x } }$ to predict the sensitive attribute from representations, using the same architecture as in the baseline models. The resulting uncensored representations from the last convolutional layer are the target for the decensoring transformations. We use a single-layer fully connected neural network as the transformer and set the number of hidden units to the dimension of the uncensored representation. The inference model operates on top of the transformer network, with the same hyper-parameters as before.
|
| 160 |
+
|
| 161 |
+
Table 3 shows that de-censoring significantly boosts the accuracy of inference from representations censored with adversarial training. The boost is smaller against information-theoretical censoring because its objective not only censors $z$ with $I ( z , s )$ , but also forgets $x$ with $I ( x , z )$ . On the Health task, there is not much difference since the baseline attack is already similar to the attack on censored representations, leaving little room for improvement.
|
| 162 |
+
|
| 163 |
+
Table 4: Adversarial re-purposing. The values are differences between the accuracy of predicting sensitive attributes using a re-purposed model vs. a model trained from scratch.
|
| 164 |
+
|
| 165 |
+
<table><tr><td>|Dtransfer/|D|</td><td>Health</td><td>UTKFace</td><td>FaceScrub</td><td>Places365</td><td>Twitter</td><td>Yelp</td><td>PIPA</td></tr><tr><td>0.02</td><td>-0.57</td><td>4.72</td><td>7.01</td><td>4.42</td><td>12.99</td><td>5.57</td><td>1.33</td></tr><tr><td>0.04</td><td>0.22</td><td>2.70</td><td>15.07</td><td>2.14</td><td>10.87</td><td>3.60</td><td>2.41</td></tr><tr><td>0.06</td><td>-1.21</td><td>2.83</td><td>7.02</td><td>2.06</td><td>10.51</td><td>8.45</td><td>6.50</td></tr><tr><td>0.08</td><td>-0.99</td><td>0.25</td><td>11.80</td><td>3.39</td><td>9.57</td><td>0.33</td><td>4.93</td></tr><tr><td>0.10</td><td>0.35</td><td>2.24</td><td>9.43</td><td>2.86</td><td>7.30</td><td>2.1</td><td>5.89</td></tr></table>
|
| 166 |
+
|
| 167 |
+
Table 5: The effect of censoring on adversarial re-purposing for FaceScrub with $\gamma = 0 . 5 , 0 . 7 5 , 1 . 0$ . $\delta _ { A }$ is the difference in the original-task accuracy (second column) between uncensored and censored models; $\delta _ { B }$ is the difference in the accuracy of inferring the sensitive attribute (columns 3 to 7) between the models re-purposed from different layers and the model trained from scratch. Negative values mean reduced accuracy. Heatmaps on the right are linear CKA similarities between censored and uncensored representations. Numbers 0 through 4 represent layers conv1, conv2, conv3, fc4, and fc5. For each model censored at layer $i$ $\mathbf { \bar { X } }$ -axis), we measure similarity between the censored and uncensored models at layer $j$ (y-axis).
|
| 168 |
+
|
| 169 |
+
<table><tr><td>Censored on γ = 0.5</td><td>8A conv1</td><td colspan="5">δB when transferred from</td></tr><tr><td>conv1</td><td>-1.66</td><td>-6.42</td><td>conv2 -4.09</td><td>conv3 -1.65</td><td>fc4 0.46</td><td>fc5 -3.87</td></tr><tr><td>conv2</td><td>-2.87</td><td>0.95</td><td>-1.77</td><td>-2.88</td><td>-1.53</td><td>-2.22</td></tr><tr><td>conv3</td><td>-0.64</td><td>1.49</td><td>1.49</td><td>0.67</td><td>-0.48</td><td>-1.38</td></tr><tr><td>fc4</td><td>-0.16</td><td>2.03</td><td>5.16</td><td>6.73</td><td>6.12</td><td>0.54</td></tr><tr><td>fc5</td><td>0.05</td><td>1.52</td><td>4.53</td><td>7.42</td><td>6.14</td><td>4.53</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>γ = 0.75</td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>conv1 conv2</td><td>-4.48</td><td>-7.33</td><td>-5.01</td><td>-1.51</td><td>-7.99</td><td>-7.82</td></tr><tr><td>conv3</td><td>-6.02 -1.90</td><td>0.44</td><td>-7.04</td><td>-5.46</td><td>-5.94</td><td>-5.82</td></tr><tr><td></td><td></td><td>1.32</td><td>1.37</td><td>1.88</td><td>0.74</td><td>-0.67</td></tr><tr><td>fc4 fc5</td><td>0.01</td><td>3.65</td><td>4.56</td><td>5.11</td><td>4.44</td><td>0.91</td></tr><tr><td></td><td>-0.74</td><td>1.54</td><td>3.61</td><td>6.75</td><td>7.18</td><td>4.99</td></tr><tr><td>γ=1</td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>conv1</td><td>-45.25</td><td>-7.36</td><td>-3.93</td><td>-2.75</td><td>-4.37</td><td>-2.91</td></tr><tr><td>conv2</td><td>-20.30</td><td>-3.28</td><td>-5.27</td><td>-7.03</td><td>-6.38</td><td>-5.54</td></tr><tr><td>conv3</td><td>-45.20</td><td>-2.13</td><td>-3.06</td><td>-4.48</td><td>-4.05</td><td>-5.18</td></tr><tr><td>fc4</td><td>-0.52</td><td>1.73</td><td>5.19</td><td>4.80</td><td>5.83</td><td>1.84</td></tr><tr><td>fc5</td><td>-0.86</td><td>1.56</td><td>3.55</td><td>5.59</td><td>5.14</td><td>1.97</td></tr></table>
|
| 170 |
+
|
| 171 |
+

|
| 172 |
+
|
| 173 |
+
In summary, these results demonstrate that information about sensitive attributes unintentionally captured by the overlearned representations cannot be suppressed by censoring.
|
| 174 |
+
|
| 175 |
+
# 4.3 RE-PURPOSING MODELS TO PREDICT SENSITIVE ATTRIBUTES
|
| 176 |
+
|
| 177 |
+
To demonstrate that overlearned representations can be picked up by a small set of unseen data to create a model for predicting sensitive attributes, we re-purpose uncensored baseline models from Section 4.2 by fine-tuning them on a small $( 2 - 1 0 \%$ of $\mathcal { D }$ ) set $\mathcal { D } _ { \mathrm { t r a n s f e r } }$ and compare with the models trained from scratch on $\mathcal { D } _ { \mathrm { t r a n s f e r } }$ . We fine-tune all models for 50 epochs with batch size of 32; the other hyper-parameters are as in Section 4.2. For all CNN models, we use the trained convolutional layers as the feature extractor and randomly initialize the other layers. Table 4 shows that the re-purposed models always outperform those trained from scratch. FaceScrub and Twitter exhibit the biggest gain.
|
| 178 |
+
|
| 179 |
+
Effect of censoring. Previous work only censored the highest layer of the models. Model repurposing can use any layer of the model for transfer learning. Therefore, to prevent re-purposing, inner layers must be censored, too. We perform the first study of inner-layers censoring and measure its effect on both the original and re-purposed tasks. We use FaceScrub for this experiment and apply adversarial training to every layer with different strengths $( \gamma = 0 . 5 , 0 . 7 5 , 1 . 0 )$ .
|
| 180 |
+
|
| 181 |
+

|
| 182 |
+
Figure 3: Pairwise similarities of layer representations between models for the original task (A) and for predicting a sensitive attribute (B). Numbers 0 through 4 denote layers conv1, conv2, conv3, fc4 and fc5.
|
| 183 |
+
|
| 184 |
+
Table 5 summarizes the results. Censoring lower layers (conv1 to conv3) blocks adversarial repurposing, at the cost of reducing the model’s accuracy on its original task. Hyper-parameters must be tuned carefully, e.g. when $\gamma = 1$ , there is a huge drop in the original-task accuracy.
|
| 185 |
+
|
| 186 |
+
To further investigate how censoring in one layer affects the representations learned across all layers, we measure per-layer similarity between censored and uncensored models using CKA, linear centered kernel alignment (Kornblith et al., 2019)—see Table 5. When censoring is applied to a specific layer, similarity for that layer is the smallest (values on the diagonal). When censoring lower layers with moderate strength $\gamma = 0 . 5$ or 0.75), similarity between higher layers is still strong; when censoring higher layers, similarity between lower layers is strong. Therefore, censoring can block adversarial re-purposing from a specific layer, but the adversary can still re-purpose representations in the other layer(s) to obtain an accurate model for predicting sensitive attributes.
|
| 187 |
+
|
| 188 |
+
# 4.4 WHEN, WHERE, AND WHY OVERLEARNING HAPPENS
|
| 189 |
+
|
| 190 |
+
To investigate when (during training) and where (in which layer) the models overlearn, we use linear CKA similarity (Kornblith et al., 2019) to compare the representations at different epochs of training between models trained for the original task (A) and models trained to predict a sensitive attribute (B). We use UTKFace and FaceScrub for these experiments.
|
| 191 |
+
|
| 192 |
+
Fig. 3 shows that lower layers of models A and B learn very similar features. This was observed in (Kornblith et al., 2019) for CIFAR-10 and CIFAR-100 models, but those tasks are closely related. In our case, the tasks are entirely different and B reveals the sensitive attribute while A does not. The similar low-level features are learned very early during training. There is little similarity between the low-level features of A and high-level features of B (and vice versa), matching intuition. Interestingly, on FaceScrub even the high-level features are similar between A and B.
|
| 193 |
+
|
| 194 |
+
We conjecture that one of the reasons for overlearning is structural complexity of the data. Previous work theoretically showed that over-parameterized neural networks favor simple solutions on structured data when optimized with SGD, where structure is quantified as the number of distributions (e.g., images from different identities) within each class in the target task (Li & Liang, 2018), i.e., the fewer distributions, the more structured the data. For data generated from more complicated distributions, networks learn more complex solutions, leading to the emergence of features that are much more general than the learning objective and, consequently, overlearning.
|
| 195 |
+
|
| 196 |
+
Fig. 4 shows that the representations of a gender classifier trained on the faces from 50 individuals are closer to the random initialization than the representations trained on the faces from 500 individuals (the hyper-parameters and the total number of training examples are the same in both cases). More complex training data thus results in more complex representations for the same objective.
|
| 197 |
+
|
| 198 |
+

|
| 199 |
+
Figure 4: Similarity of layer representations of a partially trained gender classifier to a randomly initialized model before training. Models are trained on FaceScrub using $5 0 \mathrm { I D s }$ (blue line) and 500 IDs (red line).
|
| 200 |
+
|
| 201 |
+
# 5 RELATED WORK
|
| 202 |
+
|
| 203 |
+
Prior work studied transferability of representations only between closely related tasks. Transferability of features between ImageNet models decreases as the distance between the base and target tasks grows (Yosinski et al., 2014), and performance of tasks is correlated to their distance from the source task (Azizpour et al., 2015). CNN models trained to distinguish coarse classes also distinguish their subsets (Huh et al., 2016). By contrast, we show that models trained for simple tasks implicitly learn privacy-sensitive concepts unrelated to the labels of the original task. Other than an anecdotal mention in the acknowledgments paragraph of (Kim et al., 2017) that logit-layer activations leak non-label concepts, this phenomenon has never been described in the research literature.
|
| 204 |
+
|
| 205 |
+
Gradient updates revealed by participants in distributed learning leak information about individual training batches that is uncorrelated with the learning objective (Melis et al., 2019). We show that overlearning is a generic problem in (fully trained) models, helping explain these observations.
|
| 206 |
+
|
| 207 |
+
There is a large body of research on learning disentangled representations (Bengio et al., 2013; Locatello et al., 2019). The goal is to separate the underlying explanatory factors in the representation so that it contains all information about the input in an interpretable structure. State-of-the-art approaches use variational autoencoders (Kingma & Welling, 2013) and their variants to learn disentangled representations in an unsupervised fashion (Higgins et al., 2017; Kumar et al., 2018; Kim & Mnih, 2018; Chen et al., 2018). By contrast, overlearning means that representations learned during supervised training for one task implicitly and automatically enable another task—without disentangling the representation on purpose during training.
|
| 208 |
+
|
| 209 |
+
Work on censoring representations aims to suppress sensitive demographic attributes and identities in the model’s output for fairness and privacy. Techniques include adversarial training (Edwards & Storkey, 2016), which has been applied to census and health records (Xie et al., 2017), text (Li et al., 2018; Coavoux et al., 2018; Elazar & Goldberg, 2018), images (Hamm, 2017) and sensor data of wearables (Iwasawa et al., 2016). An alternative approach is to minimize mutual information between the representation and the sensitive attribute (Moyer et al., 2018; Osia et al., 2018). Neither approach can prevent overlearning, except at the cost of destroying the model’s accuracy. Furthermore, these techniques cannot censor attributes that are not represented in the training data. We show that overlearned models recognize such attributes, too.
|
| 210 |
+
|
| 211 |
+
# 6 CONCLUSIONS
|
| 212 |
+
|
| 213 |
+
We demonstrated that models trained for seemingly simple tasks implicitly learn concepts that are not represented in the objective function. In particular, they learn to recognize sensitive attributes, such as race and identity, that are statistically orthogonal to the objective. The failure of censoring to suppress these attributes and the similarity of learned representations across uncorrelated tasks suggest that overlearning may be intrinsic, i.e., learning for some objectives may not be possible without recognizing generic low-level features that enable other tasks, including inference of sensitive attributes. For example, there may not exist a set of features that enables a model to accurately determine the gender of a face but not its race or identity.
|
| 214 |
+
|
| 215 |
+
This is a challenge for regulations such as GDPR that aim to control the purposes and uses of machine learning technologies. To protect privacy and ensure certain forms of fairness, users and regulators may desire that models not learn some features and attributes. If overlearning is intrinsic, it may not be technically possible to enumerate, let alone control, what models are learning. Therefore, regulators should focus on ensuring that models are applied in a way that respects privacy and fairness, while acknowledging that they may still recognize and use sensitive attributes.
|
| 216 |
+
|
| 217 |
+
Acknowledgments. This research was supported in part by NSF grants 1611770, 1704296, and 1916717, the generosity of Eric and Wendy Schmidt by recommendation of the Schmidt Futures program, and a Google Faculty Research Award.
|
| 218 |
+
|
| 219 |
+
# REFERENCES
|
| 220 |
+
|
| 221 |
+
Alexander A. Alemi, Ian Fischer, Joshua V. Dillon, and Kevin Murphy. Deep variational information bottleneck. In ICLR, 2017.
|
| 222 |
+
|
| 223 |
+
Hossein Azizpour, Ali Sharif Razavian, Josephine Sullivan, Atsuto Maki, and Stefan Carlsson. From generic to specific deep representations for visual recognition. In CVPR Workshops, 2015.
|
| 224 |
+
|
| 225 |
+
Yoshua Bengio, Aaron Courville, and Pascal Vincent. Representation learning: A review and new perspectives. PAMI, 2013.
|
| 226 |
+
|
| 227 |
+
Tian Qi Chen, Xuechen Li, Roger B Grosse, and David K Duvenaud. Isolating sources of disentanglement in variational autoencoders. In NIPS, 2018.
|
| 228 |
+
|
| 229 |
+
Jianfeng Chi, Emmanuel Owusu, Xuwang Yin, Tong Yu, William Chan, Patrick Tague, and Yuan Tian. Privacy partitioning: Protecting user data during the deep learning inference phase. arXiv:1812.02863, 2018.
|
| 230 |
+
|
| 231 |
+
Maximin Coavoux, Shashi Narayan, and Shay B. Cohen. Privacy-preserving neural representations of text. In EMNLP, 2018.
|
| 232 |
+
|
| 233 |
+
Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. ImageNet: A large-scale hierarchical image database. In CVPR, 2009.
|
| 234 |
+
|
| 235 |
+
Alexey Dosovitskiy and Thomas Brox. Generating images with perceptual similarity metrics based on deep networks. In NIPS, 2016.
|
| 236 |
+
|
| 237 |
+
Harrison Edwards and Amos J. Storkey. Censoring representations with an adversary. In ICLR, 2016.
|
| 238 |
+
|
| 239 |
+
Yanai Elazar and Yoav Goldberg. Adversarial removal of demographic attributes from text data. In EMNLP, 2018.
|
| 240 |
+
|
| 241 |
+
EU. General Data Protection Regulation. https://en.wikipedia.org/wiki/General_ Data_Protection_Regulation, 2018.
|
| 242 |
+
|
| 243 |
+
FaceScrub. http://vintage.winklerbros.net/facescrub.html, 2014.
|
| 244 |
+
|
| 245 |
+
Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. In NIPS, 2014.
|
| 246 |
+
|
| 247 |
+
Jihun Hamm. Minimax filter: Learning to preserve privacy from inference attacks. JMLR, 18(129): 1–31, 2017.
|
| 248 |
+
|
| 249 |
+
Heritage Health Prize. https://www.kaggle.com/c/hhp, 2012.
|
| 250 |
+
|
| 251 |
+
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 ICLR, 2017.
|
| 252 |
+
|
| 253 |
+
Minyoung Huh, Pulkit Agrawal, and Alexei A Efros. What makes ImageNet good for transfer learning? arXiv:1608.08614, 2016.
|
| 254 |
+
|
| 255 |
+
Yusuke Iwasawa, Kotaro Nakayama, Ikuko Yairi, and Yutaka Matsuo. Privacy issues regarding the application of DNNs to activity-recognition using wearables and its countermeasures by use of adversarial training. In IJCAI, 2016.
|
| 256 |
+
|
| 257 |
+
Yiping Kang, Johann Hauswald, Cao Gao, Austin Rovinski, Trevor Mudge, Jason Mars, and Lingjia Tang. Neurosurgeon: Collaborative intelligence between the cloud and mobile edge. In ASPLOS, 2017.
|
| 258 |
+
|
| 259 |
+
Been Kim, Martin Wattenberg, Justin Gilmer, Carrie Cai, James Wexler, Fernanda Viegas, and Rory Sayres. Interpretability beyond feature attribution: Quantitative testing with concept activation vectors (TCAV). arXiv:1711.11279, 2017.
|
| 260 |
+
|
| 261 |
+
Hyunjik Kim and Andriy Mnih. Disentangling by factorising. In ICML, 2018.
|
| 262 |
+
|
| 263 |
+
Yoon Kim. Convolutional neural networks for sentence classification. In EMNLP, 2014.
|
| 264 |
+
|
| 265 |
+
Diederik P Kingma and Max Welling. Auto-encoding variational Bayes. arXiv:1312.6114, 2013.
|
| 266 |
+
|
| 267 |
+
Simon Kornblith, Mohammad Norouzi, Honglak Lee, and Geoffrey Hinton. Similarity of neural network representations revisited. In ICML, 2019.
|
| 268 |
+
|
| 269 |
+
Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. ImageNet classification with deep convolutional neural networks. In NIPS, 2012.
|
| 270 |
+
|
| 271 |
+
Abhishek Kumar, Prasanna Sattigeri, and Avinash Balakrishnan. Variational inference of disentangled latent concepts from unlabeled observations. In ICLR, 2018.
|
| 272 |
+
|
| 273 |
+
Nicholas D Lane and Petko Georgiev. Can deep learning revolutionize mobile sensing? In HotMobile, 2015.
|
| 274 |
+
|
| 275 |
+
Yann LeCun, Leon Bottou, Yoshua Bengio, and Patrick Haffner. Gradient-based learning applied to ´ document recognition. Proc. IEEE, 86(11):2278–2324, 1998.
|
| 276 |
+
|
| 277 |
+
Meng Li, Liangzhen Lai, Naveen Suda, Vikas Chandra, and David Z Pan. PrivyNet: A flexible framework for privacy-preserving deep neural network training. arXiv:1709.06161, 2017.
|
| 278 |
+
|
| 279 |
+
Yitong Li, Timothy Baldwin, and Trevor Cohn. Towards robust and privacy-preserving text representations. In ACL, 2018.
|
| 280 |
+
|
| 281 |
+
Yuanzhi Li and Yingyu Liang. Learning overparameterized neural networks via stochastic gradient descent on structured data. In NIPS, 2018.
|
| 282 |
+
|
| 283 |
+
Francesco Locatello, Stefan Bauer, Mario Lucic, Gunnar Raetsch, Sylvain Gelly, Bernhard Scholkopf, and Olivier Bachem. Challenging common assumptions in the unsupervised learn- ¨ ing of disentangled representations. In ICML, 2019.
|
| 284 |
+
|
| 285 |
+
Christos Louizos, Kevin Swersky, Yujia Li, Max Welling, and Richard Zemel. The variational fair autoencoder. In ICLR, 2016.
|
| 286 |
+
|
| 287 |
+
David Madras, Elliot Creager, Toniann Pitassi, and Richard Zemel. Learning adversarially fair and transferable representations. In ICML, 2018.
|
| 288 |
+
|
| 289 |
+
Luca Melis, Congzheng Song, Emiliano De Cristofaro, and Vitaly Shmatikov. Exploiting unintended feature leakage in collaborative learning. In S&P, 2019.
|
| 290 |
+
|
| 291 |
+
Daniel Moyer, Shuyang Gao, Rob Brekelmans, Aram Galstyan, and Greg Ver Steeg. Invariant representations without adversarial training. In NIPS, 2018.
|
| 292 |
+
|
| 293 |
+
Anh Nguyen, Alexey Dosovitskiy, Jason Yosinski, Thomas Brox, and Jeff Clune. Synthesizing the preferred inputs for neurons in neural networks via deep generator networks. In NIPS, 2016.
|
| 294 |
+
|
| 295 |
+
Seyed Ali Osia, Ali Taheri, Ali Shahin Shamsabadi, Minos Katevas, Hamed Haddadi, and Hamid R. R. Rabiee. Deep private-feature extraction. TKDE, 2018.
|
| 296 |
+
|
| 297 |
+
Piper project page. https://people.eecs.berkeley.edu/˜nzhang/piper.html, 2015.
|
| 298 |
+
|
| 299 |
+
Francisco Rangel, Paolo Rosso, Ben Verhoeven, Walter Daelemans, Martin Potthast, and Benno Stein. Overview of the 4th author profiling task at PAN 2016: Cross-genre evaluations. In CEUR Workshop, 2016.
|
| 300 |
+
|
| 301 |
+
Jiaming Song, Pratyusha Kalluri, Aditya Grover, Shengjia Zhao, and Stefano Ermon. Learning controllable fair representations. In AISTATS, 2019.
|
| 302 |
+
|
| 303 |
+
UTKFace. http://aicip.eecs.utk.edu/wiki/UTKFace, 2017.
|
| 304 |
+
|
| 305 |
+
Ji Wang, Jianguo Zhang, Weidong Bao, Xiaomin Zhu, Bokai Cao, and Philip S Yu. Not just privacy: Improving performance of private deep learning in mobile cloud. In KDD, 2018.
|
| 306 |
+
|
| 307 |
+
Qizhe Xie, Zihang Dai, Yulun Du, Eduard H. Hovy, and Graham Neubig. Controllable invariance through adversarial feature learning. In NIPS, 2017.
|
| 308 |
+
|
| 309 |
+
Yelp Open Dataset. https://www.yelp.com/dataset, 2018.
|
| 310 |
+
|
| 311 |
+
Jason Yosinski, Jeff Clune, Yoshua Bengio, and Hod Lipson. How transferable are features in deep neural networks? In NIPS, 2014.
|
| 312 |
+
|
| 313 |
+
Rich Zemel, Yu Wu, Kevin Swersky, Toni Pitassi, and Cynthia Dwork. Learning fair representations. In ICML, 2013.
|
| 314 |
+
|
| 315 |
+
Ning Zhang, Manohar Paluri, Yaniv Taigman, Rob Fergus, and Lubomir Bourdev. Beyond frontal faces: Improving person recognition using multiple cues. In CVPR, 2015.
|
| 316 |
+
|
| 317 |
+
Zhifei Zhang, Yang Song, and Hairong Qi. Age progression/regression by conditional adversarial autoencoder. In CVPR, 2017.
|
md/train/SJx63jRqFm/SJx63jRqFm.md
ADDED
|
@@ -0,0 +1,489 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# DIVERSITY IS ALL YOU NEED: LEARNING SKILLS WITHOUT A REWARD FUNCTION
|
| 2 |
+
|
| 3 |
+
Benjamin Eysenbach ∗ Carnegie Mellon University, Google Brain beysenba@cs.cmu.edu
|
| 4 |
+
|
| 5 |
+
Abhishek Gupta
|
| 6 |
+
UC Berkeley
|
| 7 |
+
abhigupta@berkeley.edu
|
| 8 |
+
Julian Ibarz
|
| 9 |
+
Google Brain
|
| 10 |
+
julianibarz@google.com
|
| 11 |
+
|
| 12 |
+
Sergey Levine UC Berkeley, Google Brain svlevine@eecs.berkeley.edu
|
| 13 |
+
|
| 14 |
+
# ABSTRACT
|
| 15 |
+
|
| 16 |
+
Intelligent creatures can explore their environments and learn useful skills without supervision. In this paper, we propose “Diversity is All You Need”(DIAYN), a method for learning useful skills without a reward function. Our proposed method learns skills by maximizing an information theoretic objective using a maximum entropy policy. On a variety of simulated robotic tasks, we show that this simple objective results in the unsupervised emergence of diverse skills, such as walking and jumping. In a number of reinforcement learning benchmark environments, our method is able to learn a skill that solves the benchmark task despite never receiving the true task reward. We show how pretrained skills can provide a good parameter initialization for downstream tasks, and can be composed hierarchically to solve complex, sparse reward tasks. Our results suggest that unsupervised discovery of skills can serve as an effective pretraining mechanism for overcoming challenges of exploration and data efficiency in reinforcement learning.
|
| 17 |
+
|
| 18 |
+
# 1 INTRODUCTION
|
| 19 |
+
|
| 20 |
+
Deep reinforcement learning (RL) has been demonstrated to effectively learn a wide range of rewarddriven skills, including playing games (Mnih et al., 2013; Silver et al., 2016), controlling robots (Gu et al., 2017; Schulman et al., 2015b), and navigating complex environments (Zhu et al., 2017; Mirowski et al., 2016). However, intelligent creatures can explore their environments and learn useful skills even without supervision, so that when they are later faced with specific goals, they can use those skills to satisfy the new goals quickly and efficiently.
|
| 21 |
+
|
| 22 |
+
Learning skills without reward has several practical applications. Environments with sparse rewards effectively have no reward until the agent randomly reaches a goal state. Learning useful skills without supervision may help address challenges in exploration in these environments. For long horizon tasks, skills discovered without reward can serve as primitives for hierarchical RL, effectively shortening the episode length. In many practical settings, interacting with the environment is essentially free, but evaluating the reward requires human feedback (Christiano et al., 2017). Unsupervised learning of skills may reduce the amount of supervision necessary to learn a task. While we can take the human out of the loop by designing a reward function, it is challenging to design a reward function that elicits the desired behaviors from the agent (Hadfield-Menell et al., 2017). Finally, when given an unfamiliar environment, it is challenging to determine what tasks an agent should be able to learn. Unsupervised skill discovery partially answers this question.1
|
| 23 |
+
|
| 24 |
+
Autonomous acquisition of useful skills without any reward signal is an exceedingly challenging problem. A skill is a latent-conditioned policy that alters the state of the environment in a consistent way. We consider the setting where the reward function is unknown, so we want to learn a set of skills by maximizing the utility of this set. Making progress on this problem requires specifying a learning objective that ensures that each skill individually is distinct and that the skills collectively explore large parts of the state space. In this paper, we show how a simple objective based on mutual information can enable RL agents to autonomously discover such skills. These skills are useful for a number of applications, including hierarchical reinforcement learning and imitation learning.
|
| 25 |
+
|
| 26 |
+
We propose a method for learning diverse skills with deep RL in the absence of any rewards. We hypothesize that in order to acquire skills that are useful, we must train the skills so that they maximize coverage over the set of possible behaviors. While one skill might perform a useless behavior like random dithering, other skills should perform behaviors that are distinguishable from random dithering, and therefore more useful. A key idea in our work is to use discriminability between skills as an objective. Further, skills that are distinguishable are not necessarily maximally diverse – a slight difference in states makes two skills distinguishable, but not necessarily diverse in a semantically meaningful way. To combat this problem, we want to learn skills that not only are distinguishable, but also are as diverse as possible. By learning distinguishable skills that are as random as possible, we can “push” the skills away from each other, making each skill robust to perturbations and effectively exploring the environment. By maximizing this objective, we can learn skills that run forward, do backflips, skip backwards, and perform face flops (see Figure 3).
|
| 27 |
+
|
| 28 |
+
Our paper makes five contributions. First, we propose a method for learning useful skills without any rewards. We formalize our discriminability goal as maximizing an information theoretic objective with a maximum entropy policy. Second, we show that this simple exploration objective results in the unsupervised emergence of diverse skills, such as running and jumping, on several simulated robotic tasks. In a number of RL benchmark environments, our method is able to solve the benchmark task despite never receiving the true task reward. In these environments, some of the learned skills correspond to solving the task, and each skill that solves the task does so in a distinct manner. Third, we propose a simple method for using learned skills for hierarchical RL and find this methods solves challenging tasks. Four, we demonstrate how skills discovered can be quickly adapted to solve a new task. Finally, we show how skills discovered can be used for imitation learning.
|
| 29 |
+
|
| 30 |
+
# 2 RELATED WORK
|
| 31 |
+
|
| 32 |
+
Previous work on hierarchical RL has learned skills to maximize a single, known, reward function by jointly learning a set of skills and a meta-controller (e.g., (Bacon et al., 2017; Heess et al., 2016; Dayan & Hinton, 1993; Frans et al., 2017; Krishnan et al., 2017; Florensa et al., 2017)). One problem with joint training (also noted by Shazeer et al. (2017)) is that the meta-policy does not select “bad” options, so these options do not receive any reward signal to improve. Our work prevents this degeneracy by using a random meta-policy during unsupervised skill-learning, such that neither the skills nor the meta-policy are aiming to solve any single task. A second importance difference is that our approach learns skills with no reward. Eschewing a reward function not only avoids the difficult problem of reward design, but also allows our method to learn task-agnostic.
|
| 33 |
+
|
| 34 |
+
Related work has also examined connections between RL and information theory (Ziebart et al., 2008; Schulman et al., 2017; Nachum et al., 2017; Haarnoja et al., 2017) and developed maximum entropy algorithms with these ideas Haarnoja et al. (2018; 2017). Recent work has also applied tools from information theory to skill discovery. Mohamed & Rezende (2015) and Jung et al. (2011) use the mutual information between states and actions as a notion of empowerment for an intrinsically motivated agent. Our method maximizes the mutual information between states and skills, which can be interpreted as maximizing the empowerment of a hierarchical agent whose action space is the set of skills. Hausman et al. (2018), Florensa et al. (2017), and Gregor et al. (2016) showed that a discriminability objective is equivalent to maximizing the mutual information between the latent skill $z$ and some aspect of the corresponding trajectory. Hausman et al. (2018) considered the setting with many tasks and reward functions and Florensa et al. (2017) considered the setting with a single task reward. Three important distinctions allow us to apply our method to tasks significantly more complex than the gridworlds in Gregor et al. (2016). First, we use maximum entropy policies to force our skills to be diverse. Our theoretical analysis shows that including entropy maximization in the RL objective results in the mixture of skills being maximum entropy in aggregate. Second, we fix the prior distribution over skills, rather than learning it. Doing so prevents our method from collapsing to sampling only a handful of skills. Third, while the discriminator in Gregor et al. (2016) only looks at the final state, our discriminator looks at every state, which provides additional reward signal. These three crucial differences help explain how our method learns useful skills in complex environments.
|
| 35 |
+
|
| 36 |
+

|
| 37 |
+
Figure 1: DIAYN Algorithm: We update the discriminator to better predict the skill, and update the skill to visit diverse states that make it more discriminable.
|
| 38 |
+
|
| 39 |
+
Prior work in neuroevolution and evolutionary algorithms has studied how complex behaviors can be learned by directly maximizing diversity (Lehman & Stanley, 2011a;b; Woolley & Stanley, 2011; Stanley & Miikkulainen, 2002; Such et al., 2017; Pugh et al., 2016; Mouret & Doncieux, 2009). While this prior work uses diversity maximization to obtain better solutions, we aim to acquire complex skills with minimal supervision to improve efficiency (i.e., reduce the number of objective function queries) and as a stepping stone for imitation learning and hierarchical RL. We focus on deriving a general, information-theoretic objective that does not require manual design of distance metrics and can be applied to any RL task without additional engineering.
|
| 40 |
+
|
| 41 |
+
Previous work has studied intrinsic motivation in humans and learned agents. Ryan & Deci (2000); Bellemare et al. (2016); Fu et al. (2017); Schmidhuber (2010); Oudeyer et al. (2007); Pathak et al. (2017); Baranes & Oudeyer (2013). While these previous works use an intrinsic motivation objective to learn a single policy, we propose an objective for learning many, diverse policies. Concurrent work Achiam et al. (2017) draws ties between learning discriminable skills and variational autoencoders. We show that our method scales to more complex tasks, likely because of algorithmic design choices, such as our use of an off-policy RL algorithm and conditioning the discriminator on individual states.
|
| 42 |
+
|
| 43 |
+
# 3 DIVERSITY IS ALL YOU NEED
|
| 44 |
+
|
| 45 |
+
We consider an unsupervised RL paradigm in this work, where the agent is allowed an unsupervised “exploration” stage followed by a supervised stage. In our work, the aim of the unsupervised stage is to learn skills that eventually will make it easier to maximize the task reward in the supervised stage. Conveniently, because skills are learned without a priori knowledge of the task, the learned skills can be used for many different tasks.
|
| 46 |
+
|
| 47 |
+
# 3.1 HOW IT WORKS
|
| 48 |
+
|
| 49 |
+
Our method for unsupervised skill discovery, DIAYN (“Diversity is All You Need”), builds off of three ideas. First, for skills to be useful, we want the skill to dictate the states that the agent visits. Different skills should visit different states, and hence be distinguishable. Second, we want to use states, not actions, to distinguish skills, because actions that do not affect the environment are not visible to an outside observer. For example, an outside observer cannot tell how much force a robotic arm applies when grasping a cup if the cup does not move. Finally, we encourage exploration and incentivize the skills to be as diverse as possible by learning skills that act as randomly as possible. Skills with high entropy that remain discriminable must explore a part of the state space far away from other skills, lest the randomness in its actions lead it to states where it cannot be distinguished.
|
| 50 |
+
|
| 51 |
+
We construct our objective using notation from information theory: $S$ and $A$ are random variables for states and actions, respectively; $Z \sim p ( z )$ is a latent variable, on which we condition our policy; we refer to a the policy conditioned on a fixed $Z$ as a “skill”; $I ( \cdot ; \cdot )$ and $\mathcal { H } [ \cdot ]$ refer to mutual information and Shannon entropy, both computed with base $e$ . In our objective, we maximize the mutual information between skills and states, $I ( S ; Z )$ , to encode the idea that the skill should control which states the agent visits. Conveniently, this mutual information dictates that we can infer the skill from the states visited. To ensure that states, not actions, are used to distinguish skills, we minimize the mutual information between skills and actions given the state, $I ( A ; Z \mid S )$ . Viewing all skills together with $p ( z )$ as a mixture of policies, we maximize the entropy $\mathcal { H } [ A \mid S ]$ of this mixture policy. In summary, we maximize the following objective with respect to our policy parameters, $\theta$ :
|
| 52 |
+
|
| 53 |
+
$$
|
| 54 |
+
\begin{array} { r l } & { { \mathscr F } ( \theta ) \triangleq I ( S ; Z ) + { \mathscr H } [ A \mid S ] - I ( A ; Z \mid S ) } \\ & { \quad = ( { \mathscr H } [ Z ] - { \mathscr H } [ Z \mid S ] ) + { \mathscr H } [ A \mid S ] - ( { \mathscr H } [ A \mid S ] - { \mathscr H } [ A \mid S , Z ] ) } \\ & { \quad = { \mathscr H } [ Z ] - { \mathscr H } [ Z \mid S ] + { \mathscr H } [ A \mid S , Z ] } \end{array}
|
| 55 |
+
$$
|
| 56 |
+
|
| 57 |
+
We rearranged our objective in Equation 2 to give intuition on how we optimize it.2 The first term encourages our prior distribution over $p ( z )$ to have high entropy. We fix $p ( z )$ to be uniform in our approach, guaranteeing that it has maximum entropy. The second term suggests that it should be easy to infer the skill $z$ from the current state. The third term suggests that each skill should act as randomly as possible, which we achieve by using a maximum entropy policy to represent each skill. As we cannot integrate over all states and skills to compute $p ( z \mid s )$ exactly, we approximate this posterior with a learned discriminator $q _ { \phi } ( z \mid s )$ . Jensen’s Inequality tells us that replacing $p ( z \mid s )$ with $q _ { \phi } ( z \mid s )$ gives us a variational lower bound ${ \mathcal { G } } ( \theta , \phi )$ on our objective ${ \mathcal { F } } ( \theta )$ (see (Agakov, 2004) for a detailed derivation):
|
| 58 |
+
|
| 59 |
+
$$
|
| 60 |
+
\begin{array} { r l } & { { \mathscr F } ( \theta ) = { \mathscr H } [ A \mid S , Z ] - { \mathscr H } [ Z \mid S ] + { \mathscr H } [ Z ] } \\ & { \qquad = { \mathscr H } [ A \mid S , Z ] + { \mathbb E } _ { z \sim p ( z ) , s \sim \pi ( z ) } [ \log p ( z \mid s ) ] - { \mathbb E } _ { z \sim p ( z ) } [ \log p ( z ) ] } \\ & { \qquad \geq { \mathscr H } [ A \mid S , Z ] + { \mathbb E } _ { z \sim p ( z ) , s \sim \pi ( z ) } [ \log q _ { \phi } ( z \mid s ) - \log p ( z ) ] \triangleq { \mathscr G } ( \theta , \phi ) } \end{array}
|
| 61 |
+
$$
|
| 62 |
+
|
| 63 |
+
# 3.2 IMPLEMENTATION
|
| 64 |
+
|
| 65 |
+
We implement DIAYN with soft actor critic (SAC) (Haarnoja et al., 2018), learning a policy $\pi _ { \boldsymbol { \theta } } ( a \mid s , z )$ that is conditioned on the latent variable $z$ . Soft actor critic maximizes the policy’s entropy over actions, which takes care of the entropy term in our objective $\mathcal { G }$ . Following Haarnoja et al. (2018), we scale the entropy regularizer $\mathcal { H } [ a \mid s , z ]$ by $\alpha$ . We found empirically that an $\alpha = 0 . 1$ provided a good trade-off between exploration and discriminability. We maximize the expectation in $\mathcal { G }$ by replacing the task reward with the following pseudo-reward:
|
| 66 |
+
|
| 67 |
+
$$
|
| 68 |
+
r _ { z } ( s , a ) \triangleq \log q _ { \phi } ( z \mid s ) - \log p ( z )
|
| 69 |
+
$$
|
| 70 |
+
|
| 71 |
+
We use a categorical distribution for $p ( z )$ . During unsupervised learning, we sample a skill $z \sim p ( z )$ at the start of each episode, and act according to that skill throughout the episode. The agent is rewarded for visiting states that are easy to discriminate, while the discriminator is updated to better infer the skill $z$ from states visited. Entropy regularization occurs as part of the SAC update.
|
| 72 |
+
|
| 73 |
+
# 3.3 STABILITY
|
| 74 |
+
|
| 75 |
+
Unlike prior adversarial unsupervised RL methods (e.g., Sukhbaatar et al. (2017)), DIAYN forms a cooperative game, which avoids many of the instabilities of adversarial saddle-point formulations. On gridworlds, we can compute analytically that the unique optimum to the DIAYN optimization problem is to evenly partition the states between skills, with each skill assuming a uniform stationary distribution over its partition (proof in Appendix B). In the continuous and approximate setting, convergence guarantees would be desirable, but this is a very tall order: even standard RL methods with function approximation (e.g., DQN) lack convergence guarantees, yet such techniques are still useful. Empirically, we find DIAYN to be robust to random seed; varying the random seed does not noticeably affect the skills learned, and has little effect on downstream tasks (see Fig.s 4, 6, and 13).
|
| 76 |
+
|
| 77 |
+
# 4 EXPERIMENTS
|
| 78 |
+
|
| 79 |
+
In this section, we evaluate DIAYN and compare to prior work. First, we analyze the skills themselves, providing intuition for the types of skills learned, the training dynamics, and how we avoid problematic
|
| 80 |
+
|
| 81 |
+
behavior in previous work. In the second half, we show how the skills can be used for downstream tasks, via policy initialization, hierarchy, imitation, outperforming competitive baselines on most tasks. We encourage readers to view videos3 and code4 for our experiments.
|
| 82 |
+
|
| 83 |
+
# 4.1 ANALYSIS OF LEARNED SKILLS
|
| 84 |
+
|
| 85 |
+

|
| 86 |
+
Figure 2: (Left) DIAYN skills in a simple navigation environment; (Center) skills can overlap if they eventually become distinguishable; (Right) diversity of the rewards increases throughout training.
|
| 87 |
+
|
| 88 |
+
Question 1. What skills does DIAYN learn?
|
| 89 |
+
|
| 90 |
+
We study the skills learned by DIAYN on tasks of increasing complexity, ranging from point navigation (2 dimensions) to ant locomotion (111 dimensions). We first applied DIAYN to a simple 2D navigation environment. The agent starts in the center of the box, and can take actions to directly move its $( x , y )$ position. Figure 2a illustrates how the 6 skills learned for this task move away from each other to remain distinguishable. Next, we applied DIAYN to two classic control tasks, inverted pendulum and mountain car. Not only does our approach learn skills that solve the task without rewards, it learns multiple distinct skills for solving the task. (See Appendix D for further analysis.)
|
| 91 |
+
|
| 92 |
+
Finally, we applied DIAYN to three continuous control tasks (Brockman et al., 2016): half cheetah, hopper, and ant. As shown in Figure 3, we learn a diverse set of primitive behaviors for all tasks. For half cheetah, we learn skills for running forwards and backwards at various speeds, as well as skills for doing flips and falling over; ant learns skills for jumping and walking in many types of curved trajectories (though none walk in a straight line); hopper learns skills for balancing, hopping forward and backwards, and diving. See Appendix D.4 for a comparison with VIME.
|
| 93 |
+
|
| 94 |
+
# Question 2. How does the distribution of skills change during training?
|
| 95 |
+
|
| 96 |
+
While DIAYN learns skills without a reward function, as an outside observer, can we evaluate the skills throughout training to understand the training dynamics. Figure 2 shows how the skills for inverted pendulum and mountain car become increasingly diverse throughout training (Fig. 13 repeats this experiment for 5 random seeds, and shows that results are robust to initialization). Recall that our skills are learned with no reward, so it is natural that some skills correspond to small task reward while others correspond to large task reward.
|
| 97 |
+
|
| 98 |
+
Question 3. Does discriminating on single states restrict DIAYN to learn skills that visit disjoint sets of states?
|
| 99 |
+
|
| 100 |
+
Our discriminator operates at the level of states, not trajectories. While DIAYN favors skills that do not overlap, our method is not limited to learning skills that visit entirely disjoint sets of states. Figure 2b shows a simple experiment illustrating this. The agent starts in a hallway (green star), and can move more freely once exiting the end of the hallway into a large room. Because RL agents are incentivized to maximize their cumulative reward, they may take actions that initially give no reward to reach states that eventually give high reward. In this environment, DIAYN learns skills that exit the hallway to make them mutually distinguishable.
|
| 101 |
+
|
| 102 |
+

|
| 103 |
+
|
| 104 |
+
Figure 3: Locomotion skills: Without any reward, DIAYN discovers skills for running, walking, hopping, flipping, and gliding. It is challenging to craft reward functions that elicit these behaviors.
|
| 105 |
+
|
| 106 |
+
Question 4. How does DIAYN differ from Variational Intrinsic Control (VIC) (Gregor et al., 2016)?
|
| 107 |
+
|
| 108 |
+
The key difference from the most similar prior work on unsupervised skill discovery, VIC, is our decision to not learn the prior $p ( z )$ . We found that VIC suffers from the “Matthew Effect” Merton (1968): VIC’s learned prior $p ( z )$ will sample the more diverse skills more frequently, and hence only those skills will receive training signal to improve. To study this, we evaluated DIAYN and VIC on the half-cheetah environment, and plotting the effective number of skills (measured as $\exp ( \mathcal { H } [ Z ] ) )$ throughout
|
| 109 |
+
|
| 110 |
+

|
| 111 |
+
Figure 4: Why use a fixed prior? In contrast to prior work, DIAYN continues to sample all skills throughout training.
|
| 112 |
+
|
| 113 |
+
training (details and more figures in Appendix E.2). The figure to the right shows how VIC quickly converges to a setting where it only samples a handful of skills. In contrast, DIAYN fixes the distribution over skills, which allows us to discover more diverse skills.
|
| 114 |
+
|
| 115 |
+
# 4.2 HARNESSING LEARNED SKILLS
|
| 116 |
+
|
| 117 |
+
The perhaps surprising finding that we can discover diverse skills without a reward function creates a building block for many problems in RL. For example, to find a policy that achieves a high reward on a task, it is often sufficient to simply choose the skill with largest reward. Three less obvious applications are adapting skills to maximize a reward, hierarchical RL, and imitation learning.
|
| 118 |
+
|
| 119 |
+
# 4.2.1 ACCELERATING LEARNING WITH POLICY INITIALIZATION
|
| 120 |
+
|
| 121 |
+
After DIAYN learns task-agnostic skills without supervision, we can quickly adapt the skills to solve a desired task. Akin to the use of pre-trained models in computer vision, we propose that DIAYN can serve as unsupervised pre-training for more sample-efficient finetuning of task-specific policies.
|
| 122 |
+
|
| 123 |
+
# Question 5. Can we use learned skills to directly maximize the task reward?
|
| 124 |
+
|
| 125 |
+
We take the skill with highest reward for each benchmark task and further finetune this skill using the task-specific reward function. We compare to a “random initialization” baseline that is initialized from scratch. Our approach differs from this baseline only in how weights are initialized. We initialize both the policy and value networks with weights learned during unsupervised pretraining. Although the critic networks learned during pretraining corresponds to the pseudo-reward from the discriminator (Eq. 3) and not the true task reward, we found empirically that the pseudo-reward was close to the true task reward for the best skill, and initializing the critic in addition to the actor further sped up learning. Figure 5 shows both methods applied to half cheetah, hopper, and ant. We assume that the unsupervised pretraining is free (e.g., only the reward function is expensive to compute) or can be amortized across many tasks, so we omit pretraining steps from this plot. On all tasks, unsupervised pretraining enables the agent to learn the benchmark task more quickly.
|
| 126 |
+
|
| 127 |
+

|
| 128 |
+
Figure 5: Policy Initialization: Using a DIAYN skill to initialize weights in a policy accelerates learning, suggesting that pretraining with DIAYN may be especially useful in resource constrained settings. Results are averages across 5 random seeds.
|
| 129 |
+
|
| 130 |
+
# 4.2.2 USING SKILLS FOR HIERARCHICAL RL
|
| 131 |
+
|
| 132 |
+
In theory, hierarchical RL should decompose a complex task into motion primitives, which may be reused for multiple tasks. In practice, algorithms for hierarchical RL can encounter many problems: (1) each motion primitive reduces to a single action (Bacon et al., 2017), (2) the hierarchical policy only samples a single motion primitive (Gregor et al., 2016), or (3) all motion primitives attempt to do the entire task. In contrast, DIAYN discovers diverse, task-agnostic skills, which hold the promise of acting as a building block for hierarchical RL.
|
| 133 |
+
|
| 134 |
+
# Question 6. Are skills discovered by DIAYN useful for hierarchical RL?
|
| 135 |
+
|
| 136 |
+
We propose a simple extension to DIAYN for hierarchical RL, and find that simple algorithm outperforms competitive baselines on two challenging tasks. To use the discovered skills for hierarchical RL, we learn a meta-controller whose actions are to choose which skill to execute for the next $k$ steps (100 for ant navigation, 10 for cheetah hurdle). The meta-controller has the same observation space as the skills.
|
| 137 |
+
|
| 138 |
+
As an initial test, we applied the hierarchical RL algorithm to a simple 2D point navigation task (details in Appendix C.2). Figure 6 illustrates how the reward on this task increases with the number of skills; error bars show the standard deviation across 5 random seeds. To ensure that our goals were not cherry picked, we sampled 25 goals evenly from the state space, and evaluated
|
| 139 |
+
|
| 140 |
+

|
| 141 |
+
Figure 6: Hierarchical RL
|
| 142 |
+
|
| 143 |
+
each random seed on all goals. We also compared to Variational Information Maximizing Exploration (VIME) (Houthooft et al., 2016). Note that even the best random seed from VIME significantly under-performs DIAYN. This is not surprising: whereas DIAYN learns a set of skills that effectively partition the state space, VIME attempts to learn a single policy that visits many states.
|
| 144 |
+
|
| 145 |
+
Next, we applied the hierarchical algorithm to two challenging simulated robotics environment. On the cheetah hurdle task, the agent is rewarded for bounding up and over hurdles, while in the ant navigation task, the agent must walk to a set of 5 waypoints in a specific order, receiving only a sparse reward upon reaching each waypoint. The sparse reward and obstacles in these environments make them exceedingly difficult for
|
| 146 |
+
|
| 147 |
+

|
| 148 |
+
Figure 7: Challenging tasks for hierarchical RL: (Left) Cheetah Hurdle; (Right) Ant Navigation
|
| 149 |
+
|
| 150 |
+
non-hierarchical RL algorithms. Indeed, state of the art RL algorithms that do not use hierarchies perform poorly on these tasks. Figure 8 shows how DIAYN outperforms state of the art on-policy RL (TRPO (Schulman et al., 2015a)), off-policy RL (SAC (Haarnoja et al., 2018)), and exploration bonuses (VIME). This experiment suggests that unsupervised skill learning provides an effective mechanism for combating challenges of exploration and sparse rewards in RL.
|
| 151 |
+
|
| 152 |
+

|
| 153 |
+
Figure 8: DIAYN for Hierarchical RL: By learning a meta-controller to compose skills learned by DIAYN, cheetah quickly learns to jump over hurdles and ant solves a sparse-reward navigation task.
|
| 154 |
+
|
| 155 |
+
# Question 7. How can DIAYN leverage prior knowledge about what skills will be useful?
|
| 156 |
+
|
| 157 |
+
If the number of possible skills grows exponentially with the dimension of the task observation, one might imagine that DIAYN would fail to learn skills necessary to solve some tasks. While we found that DIAYN does scale to tasks with more than 100 dimensions (ant has 111), we can also use a simple modification to bias DIAYN towards discovering particular types of skills. We can condition the discriminator on only a subset of the observation space, or any other function of the observations. In this case, the discriminator maximizes $\mathbb { E } [ \log q _ { \phi } ( z \mid f ( s ) ) ]$ . For example, in the ant navigation task, $f ( s )$ could compute the agent’s center of mass, and DIAYN would learn skills that correspond to changing the center of mass. The “DIAYN $^ +$ prior” result in Figure 8 (right) shows how incorporating this prior knowledge can aid DIAYN in discovering useful skills and boost performance on the hierarchical task. (No other experiments or figures in this paper used this prior.) The key takeaway is that while DIAYN is primarily an unsupervised RL algorithm, there is a simple mechanism for incorporating supervision when it is available. Unsurprisingly, we perform better on hierarchical tasks when incorporating more supervision.
|
| 158 |
+
|
| 159 |
+
# 4.2.3 IMITATING AN EXPERT
|
| 160 |
+
|
| 161 |
+

|
| 162 |
+
Figure 9: Imitating an expert: DIAYN imitates an expert standing upright, flipping, and faceplanting, but fails to imitate a handstand.
|
| 163 |
+
|
| 164 |
+
# Question 8. Can we use learned skills to imitate an expert?
|
| 165 |
+
|
| 166 |
+
Aside from maximizing reward with finetuning and hierarchical RL, we can also use learned skills to follow expert demonstrations. One use-case is where a human manually controls the agent to complete a task that we would like to automate. Simply replaying the human’s actions fails in stochastic environments, cases where closed-loop control is necessary. A second use-case involves an existing agent with a hard coded, manually designed policy. Imitation learning replaces the existing policy with a similar yet differentiable policy, which might be easier to update in response to new constraints or objectives. We consider the setting where we are given an expert trajectory consisting of states, without actions, defined as $\tau ^ { * } = \{ ( s _ { i } ) \} _ { 1 \leq i \leq N }$ . Our goal is to obtain a feedback controller that will reach the same states. Given the expert trajectory, we use our learned discriminator to estimate which skill was most likely to have generated the trajectory. This optimization problem, which we solve for categorical $z$ by enumeration, is equivalent to an M-projection (Bishop, 2016):
|
| 167 |
+
|
| 168 |
+
$$
|
| 169 |
+
\hat { z } = \underset { z } { \arg \operatorname* { m a x } } \Pi _ { s _ { t } \in \tau ^ { * } } q _ { \phi } ( z \mid s _ { t } )
|
| 170 |
+
$$
|
| 171 |
+
|
| 172 |
+
We qualitatively evaluate this approach to imitation learning on half cheetah. Figure 9 (left) shows four imitation tasks, three of which our method successfully imitates. We quantitatively evaluate this imitation method on classic control tasks in Appendix G.
|
| 173 |
+
|
| 174 |
+
# 5 CONCLUSION
|
| 175 |
+
|
| 176 |
+
In this paper, we present DIAYN, a method for learning skills without reward functions. We show that DIAYN learns diverse skills for complex tasks, often solving benchmark tasks with one of the learned skills without actually receiving any task reward. We further proposed methods for using the learned skills (1) to quickly adapt to a new task, (2) to solve complex tasks via hierarchical RL, and (3) to imitate an expert. As a rule of thumb, DIAYN may make learning a task easier by replacing the task’s complex action space with a set of useful skills. DIAYN could be combined with methods for augmenting the observation space and reward function. Using the common language of information theory, a joint objective can likely be derived. DIAYN may also more efficiently learn from human preferences by having humans select among learned skills. Finally, the skills produced by DIAYN might be used by game designers to allow players to control complex robots and by artists to animate characters.
|
| 177 |
+
|
| 178 |
+
Acknowledgements: We’d like to thank JD Co-Reyes and Andrew Liu for insightful discussions, and our anonymous reviewers for their thoughtful feedback and suggestions.
|
| 179 |
+
|
| 180 |
+
# REFERENCES
|
| 181 |
+
|
| 182 |
+
Joshua Achiam, Harrison Edwards, Dario Amodei, and Pieter Abbeel. Variational autoencoding learning of options by reinforcement. NIPS Deep Reinforcement Learning Symposium, 2017.
|
| 183 |
+
|
| 184 |
+
David Barber Felix Agakov. The im algorithm: a variational approach to information maximization. Advances in Neural Information Processing Systems, 16:201, 2004.
|
| 185 |
+
|
| 186 |
+
Pierre-Luc Bacon, Jean Harb, and Doina Precup. The option-critic architecture. In AAAI, pp. 1726–1734, 2017.
|
| 187 |
+
|
| 188 |
+
Adrien Baranes and Pierre-Yves Oudeyer. Active learning of inverse models with intrinsically motivated goal exploration in robots. Robotics and Autonomous Systems, 61(1):49–73, 2013.
|
| 189 |
+
|
| 190 |
+
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.
|
| 191 |
+
|
| 192 |
+
Christopher M Bishop. Pattern Recognition and Machine Learning. Springer-Verlag New York, 2016.
|
| 193 |
+
|
| 194 |
+
Greg Brockman, Vicki Cheung, Ludwig Pettersson, Jonas Schneider, John Schulman, Jie Tang, and Wojciech Zaremba. Openai gym. arXiv preprint arXiv:1606.01540, 2016.
|
| 195 |
+
|
| 196 |
+
Paul F Christiano, Jan Leike, Tom Brown, Miljan Martic, Shane Legg, and Dario Amodei. Deep reinforcement learning from human preferences. In Advances in Neural Information Processing Systems, pp. 4302–4310, 2017.
|
| 197 |
+
|
| 198 |
+
Peter Dayan and Geoffrey E Hinton. Feudal reinforcement learning. In Advances in neural information processing systems, pp. 271–278, 1993.
|
| 199 |
+
|
| 200 |
+
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.
|
| 201 |
+
|
| 202 |
+
Carlos Florensa, Yan Duan, and Pieter Abbeel. Stochastic neural networks for hierarchical reinforcement learning. arXiv preprint arXiv:1704.03012, 2017.
|
| 203 |
+
|
| 204 |
+
Kevin Frans, Jonathan Ho, Xi Chen, Pieter Abbeel, and John Schulman. Meta learning shared hierarchies. arXiv preprint arXiv:1710.09767, 2017.
|
| 205 |
+
|
| 206 |
+
Justin Fu, John Co-Reyes, and Sergey Levine. Ex2: Exploration with exemplar models for deep reinforcement learning. In Advances in Neural Information Processing Systems, pp. 2574–2584, 2017.
|
| 207 |
+
|
| 208 |
+
Karol Gregor, Danilo Jimenez Rezende, and Daan Wierstra. Variational intrinsic control. arXiv preprint arXiv:1611.07507, 2016.
|
| 209 |
+
|
| 210 |
+
Shixiang Gu, Ethan Holly, Timothy Lillicrap, and Sergey Levine. Deep reinforcement learning for robotic manipulation with asynchronous off-policy updates. In Robotics and Automation (ICRA), 2017 IEEE International Conference on, pp. 3389–3396. IEEE, 2017.
|
| 211 |
+
|
| 212 |
+
Tuomas Haarnoja, Haoran Tang, Pieter Abbeel, and Sergey Levine. Reinforcement learning with deep energybased policies. arXiv preprint arXiv:1702.08165, 2017.
|
| 213 |
+
|
| 214 |
+
Tuomas Haarnoja, Aurick Zhou, Pieter Abbeel, and Sergey Levine. Soft actor-critic: Off-policy maximum entropy deep reinforcement learning with a stochastic actor. arXiv preprint arXiv:1801.01290, 2018.
|
| 215 |
+
|
| 216 |
+
Dylan Hadfield-Menell, Smitha Milli, Pieter Abbeel, Stuart J Russell, and Anca Dragan. Inverse reward design. In Advances in Neural Information Processing Systems, pp. 6768–6777, 2017.
|
| 217 |
+
|
| 218 |
+
Karol Hausman, Jost Tobias Springenberg, Ziyu Wang, Nicolas Heess, and Martin Riedmiller. Learning an embedding space for transferable robot skills. International Conference on Learning Representations, 2018. URL https://openreview.net/forum?id $=$ rk07ZXZRb.
|
| 219 |
+
|
| 220 |
+
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.
|
| 221 |
+
|
| 222 |
+
Peter Henderson, Riashat Islam, Philip Bachman, Joelle Pineau, Doina Precup, and David Meger. Deep reinforcement learning that matters. arXiv preprint arXiv:1709.06560, 2017.
|
| 223 |
+
|
| 224 |
+
Rein Houthooft, Xi Chen, Yan Duan, John Schulman, Filip De Turck, and Pieter Abbeel. Vime: Variational information maximizing exploration. In Advances in Neural Information Processing Systems, pp. 1109–1117, 2016.
|
| 225 |
+
|
| 226 |
+
Tobias Jung, Daniel Polani, and Peter Stone. Empowerment for continuous agent—environment systems. Adaptive Behavior, 19(1):16–39, 2011.
|
| 227 |
+
|
| 228 |
+
Sanjay Krishnan, Roy Fox, Ion Stoica, and Ken Goldberg. Ddco: Discovery of deep continuous options for robot learning from demonstrations. In Conference on Robot Learning, pp. 418–437, 2017.
|
| 229 |
+
|
| 230 |
+
Joel Lehman and Kenneth O Stanley. Abandoning objectives: Evolution through the search for novelty alone. Evolutionary computation, 19(2):189–223, 2011a.
|
| 231 |
+
|
| 232 |
+
Joel Lehman and Kenneth O Stanley. Evolving a diversity of virtual creatures through novelty search and local competition. In Proceedings of the 13th annual conference on Genetic and evolutionary computation, pp. 211–218. ACM, 2011b.
|
| 233 |
+
|
| 234 |
+
Robert K Merton. The matthew effect in science: The reward and communication systems of science are considered. Science, 159(3810):56–63, 1968.
|
| 235 |
+
|
| 236 |
+
Piotr Mirowski, Razvan Pascanu, Fabio Viola, Hubert Soyer, Andrew J Ballard, Andrea Banino, Misha Denil, Ross Goroshin, Laurent Sifre, Koray Kavukcuoglu, et al. Learning to navigate in complex environments. arXiv preprint arXiv:1611.03673, 2016.
|
| 237 |
+
|
| 238 |
+
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.
|
| 239 |
+
|
| 240 |
+
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.
|
| 241 |
+
|
| 242 |
+
Jean-Baptiste Mouret and Stéphane Doncieux. Overcoming the bootstrap problem in evolutionary robotics using behavioral diversity. In Evolutionary Computation, 2009. CEC’09. IEEE Congress on, pp. 1161–1168. IEEE, 2009.
|
| 243 |
+
|
| 244 |
+
Kevin P Murphy. Machine Learning: A Probabilistic Perspective. MIT Press, 2012.
|
| 245 |
+
|
| 246 |
+
Ofir Nachum, Mohammad Norouzi, Kelvin Xu, and Dale Schuurmans. Bridging the gap between value and policy based reinforcement learning. In Advances in Neural Information Processing Systems, pp. 2772–2782, 2017.
|
| 247 |
+
|
| 248 |
+
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.
|
| 249 |
+
Deepak Pathak, Pulkit Agrawal, Alexei A Efros, and Trevor Darrell. Curiosity-driven exploration by selfsupervised prediction. arXiv preprint arXiv:1705.05363, 2017.
|
| 250 |
+
Vitchyr Pong, Shixiang Gu, Murtaza Dalal, and Sergey Levine. Temporal difference models: Model-free deep rl for model-based control. arXiv preprint arXiv:1802.09081, 2018.
|
| 251 |
+
Justin K Pugh, Lisa B Soros, and Kenneth O Stanley. Quality diversity: A new frontier for evolutionary computation. Frontiers in Robotics and AI, 3:40, 2016.
|
| 252 |
+
Richard M Ryan and Edward L Deci. Intrinsic and extrinsic motivations: Classic definitions and new directions. Contemporary educational psychology, 25(1):54–67, 2000.
|
| 253 |
+
Jürgen Schmidhuber. Formal theory of creativity, fun, and intrinsic motivation. IEEE Transactions on Autonomous Mental Development, 2(3):230–247, 2010.
|
| 254 |
+
John Schulman, Sergey Levine, Pieter Abbeel, Michael Jordan, and Philipp Moritz. Trust region policy optimization. In International Conference on Machine Learning, pp. 1889–1897, 2015a.
|
| 255 |
+
John Schulman, Philipp Moritz, Sergey Levine, Michael Jordan, and Pieter Abbeel. High-dimensional continuous control using generalized advantage estimation. arXiv preprint arXiv:1506.02438, 2015b.
|
| 256 |
+
John Schulman, Pieter Abbeel, and Xi Chen. Equivalence between policy gradients and soft q-learning. arXiv preprint arXiv:1704.06440, 2017.
|
| 257 |
+
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.
|
| 258 |
+
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.
|
| 259 |
+
Kenneth O Stanley and Risto Miikkulainen. Evolving neural networks through augmenting topologies. Evolutionary computation, 10(2):99–127, 2002.
|
| 260 |
+
Felipe Petroski Such, Vashisht Madhavan, Edoardo Conti, Joel Lehman, Kenneth O Stanley, and Jeff Clune. Deep neuroevolution: Genetic algorithms are a competitive alternative for training deep neural networks for reinforcement learning. arXiv preprint arXiv:1712.06567, 2017.
|
| 261 |
+
Sainbayar Sukhbaatar, Zeming Lin, Ilya Kostrikov, Gabriel Synnaeve, Arthur Szlam, and Rob Fergus. Intrinsic motivation and automatic curricula via asymmetric self-play. arXiv preprint arXiv:1703.05407, 2017.
|
| 262 |
+
Brian G Woolley and Kenneth O Stanley. On the deleterious effects of a priori objectives on evolution and representation. In Proceedings of the 13th annual conference on Genetic and evolutionary computation, pp. 957–964. ACM, 2011.
|
| 263 |
+
Yuke Zhu, Roozbeh Mottaghi, Eric Kolve, Joseph J Lim, Abhinav Gupta, Li Fei-Fei, and Ali Farhadi. Targetdriven visual navigation in indoor scenes using deep reinforcement learning. In Robotics and Automation (ICRA), 2017 IEEE International Conference on, pp. 3357–3364. IEEE, 2017.
|
| 264 |
+
Brian D Ziebart, Andrew L Maas, J Andrew Bagnell, and Anind K Dey. Maximum entropy inverse reinforcement learning. In AAAI, volume 8, pp. 1433–1438. Chicago, IL, USA, 2008.
|
| 265 |
+
|
| 266 |
+
# A PSEUDO-REWARD
|
| 267 |
+
|
| 268 |
+
The $\log p ( z )$ term in Equation 3 is a baseline that does not depend on the policy parameters $\theta$ , so one might be tempted to remove it from the objective. We provide a two justifications for keeping it. First, assume that episodes never terminate, but all skills eventually converge to some absorbing state (e.g., with all sensors broken). At this state, the discriminator cannot distinguish the skills, so its estimate is $\log q ( z \mid s ) = \log ( 1 / N )$ , where $N$ is the number of skills. For practical reasons, we want to restart the episode after the agent reaches the absorbing state. Subtracting $\log ( z )$ from the pseudo-reward at every time step in our finite length episodes is equivalent to pretending that episodes never terminate and the agent gets reward $\log ( z )$ after our “artificial” termination. Second, assuming our discriminator $q _ { \phi }$ is better than chance, we see that $q _ { \phi } ( z \mid s ) \geq p ( z )$ . Thus, subtracting the $\log p ( z )$ baseline ensures our reward function is always non-negative, encouraging the agent to stay alive. Without this baseline, an optimal agent would end the episode as soon as possible.5
|
| 269 |
+
|
| 270 |
+
# B OPTIMUM FOR GRIDWORLDS
|
| 271 |
+
|
| 272 |
+
For simple environments, we can compute an analytic solution to the DIAYN objective. For example, consider a $N \times N$ gridworld, where actions are to move up/down/left/right. Any action can be taken in any state, but the agent will stay in place if it attempts to move out of the gridworld. We use $( x , y )$ to refer to states, where $x , y \in \{ 1 , 2 , \cdots , N \}$ .
|
| 273 |
+
|
| 274 |
+
For simplicity, we assume that, for every skill, the distribution of states visited exactly equals that skill’s stationary distribution over states. To clarify, we will use $\pi _ { z }$ to refer to the policy for skill $z$ . We use $\rho _ { \pi _ { z } }$ to indicate skill $z$ ’s stationary distribution over states, and $\hat { \rho } _ { \pi _ { z } }$ as the empirical distribution over states within a single episode. Our assumption is equivalent to saying
|
| 275 |
+
|
| 276 |
+
$$
|
| 277 |
+
\rho _ { \pi _ { z } } ( s ) = \hat { \rho } _ { \pi _ { z } } ( s ) \qquad \forall s \in \mathcal { S }
|
| 278 |
+
$$
|
| 279 |
+
|
| 280 |
+
One way to ensure this is to assume infinite-length episodes.
|
| 281 |
+
|
| 282 |
+
We want to show that a set of skills that evenly partitions the state space is the optimum of the DIAYN objective for this task. While we will show this only for the 2-skill case, the 4 skill case is analogous.
|
| 283 |
+
|
| 284 |
+
(a) Optimum Skills for Gridworld with 2 Skills
|
| 285 |
+
|
| 286 |
+

|
| 287 |
+
Figure 10: Optimum for Gridworlds: For gridworld environments, we can compute an analytic solution to the DIAYN objective.
|
| 288 |
+
|
| 289 |
+

|
| 290 |
+
|
| 291 |
+
(b) Policy for one of the optimal skills. The agent stays in place when it attempts to leave the gridworld.
|
| 292 |
+
|
| 293 |
+
The optimum policies for a set of two skills are those which evenly partition the state space. We will show that a top/bottom partition is one such (global) optima. The left/right case is analogous.
|
| 294 |
+
|
| 295 |
+
Lemma B.1. A pair of skills with state distributions given below (and shown in Figure $I O$ ) are an optimum for the DIAYN objective with no entropy regularization $\dot { \alpha } = 0$ ).
|
| 296 |
+
|
| 297 |
+
$$
|
| 298 |
+
\rho _ { \pi _ { 1 } } ( x , y ) = \frac { 2 } { N ^ { 2 } } \delta ( y \leq N / 2 ) a n d \rho _ { \pi _ { 2 } } ( x , y ) = \frac { 2 } { N ^ { 2 } } \delta ( y > N / 2 )
|
| 299 |
+
$$
|
| 300 |
+
|
| 301 |
+
Before proving Lemma B.1, we note that there exist policies that achieve these stationary distributions. Figure 10b shows one such policy, were each arrow indicates a transition with probability $\textstyle { \frac { 1 } { 4 } }$ . Note that when the agent is in the bottom row of yellow states, it does not transition to the green states, and instead stays in place with probability $\frac { 1 } { 4 }$ . Note that the distribution in Equation 4 satisfies the detailed balance equations (Murphy, 2012).
|
| 302 |
+
|
| 303 |
+
Proof. Recall that the DIAYN objective with no entropy regularization is:
|
| 304 |
+
|
| 305 |
+
$$
|
| 306 |
+
- \mathscr { H } [ Z \ | \ S ] + \mathscr { H } [ Z ]
|
| 307 |
+
$$
|
| 308 |
+
|
| 309 |
+
Because the skills partition the states, we can always infer the skill from the state, so $\mathcal { H } [ Z \mid S ] = 0$ . By construction, the prior distribution over $\mathcal { H } [ Z ]$ is uniform, so $\mathcal { H } [ Z ] = \log ( 2 )$ is maximized. Thus, a set of two skills that partition the state space maximizes the un-regularized DIAYN objective.
|
| 310 |
+
|
| 311 |
+
Next, we consider the regularized objective. In this case, we will show that while an even partition is not perfectly optimal, it is “close” to optimal, and its “distance” from optimal goes to zero as the gridworld grows in size. This analysis will give us additional insight into the skills preferred by the DIAYN objective.
|
| 312 |
+
|
| 313 |
+
Lemma B.2. A pair of skills with state distributions given given in Equation $^ { 4 }$ achieve an DIAYN objective within a factor of $O ( 1 / N )$ of the optimum, where $N$ is the gridworld size.
|
| 314 |
+
|
| 315 |
+
Proof. Recall that the DIAYN objective with no entropy regularization is:
|
| 316 |
+
|
| 317 |
+
$$
|
| 318 |
+
{ \mathcal { H } } [ A \mid S , Z ] - { \mathcal { H } } [ Z \mid S ] + { \mathcal { H } } [ Z ]
|
| 319 |
+
$$
|
| 320 |
+
|
| 321 |
+
We have already computed the second two terms in the previous proof: $ \mathcal { H } [ Z ~ \vert ~ S ] = ~ 0$ and $\mathcal { H } [ Z ] = \log ( 2 )$ . For computing the first term, it is helpful to define the set of “border states” for a particular skill as those that do not neighbor another skill. For skill 1 defined in Figure 10 (colored yellow), the border states are: $\{ ( x , y ) \mid y = 4 \}$ . Now, computing the first term is straightforward:
|
| 322 |
+
|
| 323 |
+
$$
|
| 324 |
+
{ \begin{array} { r l } & { { \mathcal { H } } [ A \mid S , Z ] = { \cfrac { 2 } { N ^ { 2 } } } { \biggl ( } \underbrace { ( N / 2 - 1 ) N } _ { \mathrm { n o n - b o r d e r ~ s t a t e s } } \log ( 4 ) + \underbrace { N } _ { \mathrm { b o r d e r ~ s t a t e s } } \ { \frac { 3 } { 4 } } \log ( 4 ) { \biggr ) } } \\ & { \qquad = { \cfrac { 2 \log ( 4 ) } { N ^ { 2 } } } \left( { \frac { 1 } { 2 } } N ^ { 2 } - { \cfrac { 1 } { 4 } } N \right) } \\ & { \qquad = \log ( 4 ) ( 1 - { \cfrac { 1 } { 2 N } } ) } \end{array} }
|
| 325 |
+
$$
|
| 326 |
+
|
| 327 |
+
Thus, the overall objective is within $\frac { \log ( 4 ) } { 2 N }$ of optimum.
|
| 328 |
+
|
| 329 |
+

|
| 330 |
+
Figure 11: The DIAYN objective prefers skills that $( L e f t )$ partition states into sets with short borders and (Right) which correspond to bottleneck states.
|
| 331 |
+
|
| 332 |
+
Note that the term for maximum entropy over actions $( { \mathcal { H } } [ A \mid S , Z ] )$ comes into conflict with the term for discriminability $( - { \mathcal { H } } [ Z \mid S ] )$ at states along the border between two skills. Everything else being equal, this conflict encourages DIAYN to produce skills that have small borders, as shown in Figure 11. For example, in a gridworld with dimensions $N < M$ , a pair of skills that split along the first dimension (producing partitions of size $( N , M / 2 ) )$ would achieve a larger (better) objective than skills that split along the second dimension. This same intuition that DIAYN seeks to minimize the border length between skills results in DIAYN preferring partitions that correspond to bottleneck states (see Figure 11b).
|
| 333 |
+
|
| 334 |
+
# C EXPERIMENTAL DETAILS
|
| 335 |
+
|
| 336 |
+
In our experiments, we use the same hyperparameters as those in Haarnoja et al. (2018), with one notable exception. For the Q function, value function, and policy, we use neural networks with 300 hidden units instead of 128 units. We found that increasing the model capacity was necessary to learn many diverse skills. When comparing the “skill initialization” to the “random initialization” in Section 4.2, we use the same model architecture for both methods. To pass skill $z$ to the Q function, value function, and policy, we simply concatenate $z$ to the current state $s _ { t }$ . As in Haarnoja et al. (2018), epochs are 1000 episodes long. For all environments, episodes are at most 1000 steps long, but may be shorter. For example, the standard benchmark hopper environment terminates the episode once it falls over. Figures 2 and 5 show up to 1000 epochs, which corresponds to at most 1 million steps. We found that learning was most stable when we scaled the maximum entropy objective $( { \mathcal { H } } [ A \mid S , Z ]$ in Eq. 1) by $\alpha = 0 . 1$ . We use this scaling for all experiments.
|
| 337 |
+
|
| 338 |
+
# C.1 ENVIRONMENTS
|
| 339 |
+
|
| 340 |
+
Most of our experiments used the following, standard RL environments (Brockman et al., 2016): HalfCheetah-v1, Ant-v1, Hopper-v1, MountainCarContinuous- $\mathbf { \nabla \cdot v 0 }$ , and InvertedPendulum-v1. The simple 2D navigation task used in Figures 2a and 6 was constructed as follows. The agent starts in the center of the unit box. Observations $s \in [ 0 , 1 ] ^ { 2 }$ are the agent’s position. Actions $a \in [ - 0 . 1 , 0 . 1 ] ^ { 2 }$ directly change the agent’s position. If the agent takes an action to leave the box, it is projected to the closest point inside the box.
|
| 341 |
+
|
| 342 |
+
The cheetah hurdle environment is a modification of HalfCheetah-v1, where we added boxes with shape $H = 0 . 2 5 m , W = 0 . 1 m , D = 1 . 0 m$ , where the width dimension is along the same axis as the cheetah’s forward movement. We placed the boxes ever 3 meters, start at $x = - 1 m$ .
|
| 343 |
+
|
| 344 |
+
The ant navigation environment is a modification of Ant-v1. To improve stability, we follow Pong et al. (2018) and lower the gear ratio of all joints to 30. The goals are the corners of a square, centered at the origin, with side length of 4 meters: $[ ( 2 , 2 ) , ( 2 , - 2 ) , ( - 2 , - 2 ) , ( - 2 , 2 ) , ( 2 , 2 ) ]$ . The ant starts at the origin, and receives a reward of $+ 1$ when its center of mass is within 0.5 meters of the correct next goal. Each reward can only be received once, so the maximum possible reward is $+ 5$ .
|
| 345 |
+
|
| 346 |
+
# C.2 HIERARCHICAL RL EXPERIMENT
|
| 347 |
+
|
| 348 |
+
For the 2D navigation experiment shown in Figure 6, we first learned a set of skills on the point environment. Next, we introduced a reward function $r _ { g } ( s ) = - \| s - g \| _ { 2 } ^ { 2 }$ penalizing the distance from the agent’s state to some goal, and applied the hierarchical algorithm above. In this task, the DIAYN skills provided sufficient coverage of the state space that the hierarchical policy only needed to take a single action (i.e., choose a single skill) to complete the task.
|
| 349 |
+
|
| 350 |
+
# D MORE ANALYSIS OF DIAYN SKILLS
|
| 351 |
+
|
| 352 |
+
# D.1 TRAINING OBJECTIVES
|
| 353 |
+
|
| 354 |
+

|
| 355 |
+
Figure 12: Objectives: We plot the two terms from our objective (Eq. 1) throughout training. While the entropy regularizer (blue) quickly plateaus, the discriminability term (orange) term continues to increase, indicating that our skills become increasingly diverse without collapsing to deterministic policies. This plot shows the mean and standard deviation across 5 seeds for learning 20 skills in half cheetah environment. Note that $\log _ { 2 } ( 1 / 2 0 ) \approx - 3$ , setting a lower bound for $\log q _ { \phi } ( z \mid s )$ .
|
| 356 |
+
|
| 357 |
+
To provide further intuition into our approach, Figure 12 plots the two terms in our objective throughout training. Our skills become increasingly diverse throughout training without converging to deterministic policies.
|
| 358 |
+
|
| 359 |
+

|
| 360 |
+
Figure 13: We repeated the experiment from Figure 2 with 5 random seeds to illustrate the robustness of our method to random seed.
|
| 361 |
+
|
| 362 |
+
To illustrate the stability of DIAYN to random seed, we repeated the experiment in Figure 2 for 5 random seeds. Figure 13 illustrates that the random seed has little effect on the training dynamics.
|
| 363 |
+
|
| 364 |
+
# D.2 EFFECT OF ENTROPY REGULARIZATION
|
| 365 |
+
|
| 366 |
+
# Question 9. Does entropy regularization lead to more diverse skills?
|
| 367 |
+
|
| 368 |
+
To answer this question, we apply our method to a 2D point mass. The agent controls the orientation and forward velocity of the point, with is confined within a 2D box. We vary the entropy regularization $\alpha$ , with larger values of $\alpha$ corresponding to policies with more stochastic actions. With small $\alpha$ , we learn skills that move
|
| 369 |
+
|
| 370 |
+

|
| 371 |
+
|
| 372 |
+
large distances in different directions but fail to explore large parts of the state space. Increasing $\alpha$ makes the skills visit a more diverse set of states, which may help with exploration in complex state spaces. It is difficult to discriminate skills when $\alpha$ is further increased.
|
| 373 |
+
|
| 374 |
+
# D.3 DISTRIBUTION OVER TASK REWARD
|
| 375 |
+
|
| 376 |
+

|
| 377 |
+
Figure 15: Task reward of skills learned without reward: While our skills are learned without the task reward function, we evaluate each with the task reward function for analysis. The wide range of rewards shows the diversity of the learned skills. In the hopper and half cheetah tasks, many skills achieve large task reward, despite not observing the task reward during training. As discussed in prior work (Henderson et al., 2017; Duan et al., 2016), standard model-free algorithms trained directly on the task reward converge to scores of 1000 - 3000 on hopper, 1000 - 5000 on cheetah, and 700 - 2000 on ant.
|
| 378 |
+
|
| 379 |
+
In Figure 15, we take the skills learned without any rewards, and evaluate each of them on the standard benchmark reward function. We compare to random (untrained) skills. The wide distribution over rewards is evidence that the skills learned are diverse. For hopper, some skills hop or stand for the entire episode, receiving a reward of at least 1000. Other skills aggressively hop forwards or dive backwards, and receive rewards between 100 and 1000. Other skills fall over immediately and receive rewards of less than 100. The benchmark half cheetah reward includes a control penalty for taking actions. Unlike random skills, learned skills rarely have task reward near zero, indicating that all take actions to become distinguishable. Skills that run in place, flop on their nose, or do backflips receive reward of -100. Skills that receive substantially smaller reward correspond to running quickly backwards, while skills that receive substantially larger reward correspond to running forward. Similarly, the benchmark ant task reward includes both a control penalty and a survival bonus, so random skills that do nothing receive a task reward near 1000. While no single learned skill learns to run directly forward and obtain a task reward greater than 1000, our learned skills run in different patterns to become discriminable, resulting in a lower task reward.
|
| 380 |
+
|
| 381 |
+
# D.4 EXPLORATION
|
| 382 |
+
|
| 383 |
+
# Question 10. Does DIAYN explore effectively in complex environments?
|
| 384 |
+
|
| 385 |
+
We apply DIAYN to three standard RL benchmark environments: half-cheetah, hopper, and ant. In all environments, we learn diverse locomotion primitives, as shown in Figure 3. Despite never receiving any reward, the half cheetah and hopper learn skills that move forward and achieve large task reward on the corresponding RL benchmarks, which all require them to move forward at a fast pace. Half cheetah and hopper also learn skills that move backwards, corresponding to receiving a task reward much smaller than what a random policy would receive. Unlike hopper and half cheetah, the ant is free to move in the XY plane. While it learns skills that move in different directions, most skills move in arcs rather than straight lines, meaning that we rarely learn a single skill that achieves large task reward on the typical task of running forward. In the appendix, we visualize the objective throughout training.
|
| 386 |
+
|
| 387 |
+
In Figure 16, we evaluate all skills on three reward functions: running (maximize X coordinate), jumping (maximize Z coordinate) and moving (maximize L2 distance from origin). For each skill, DIAYN learns some skills that achieve high reward. We compare to single policy trained with a pure exploration objective (VIME (Houthooft et al., 2016)). Whereas previous work (e.g., Pathak et al. (2017); Bellemare et al. (2016); Houthooft et al. (2016)) finds a single policy that explores well, DIAYN optimizes a collection of policies, which enables more diverse exploration.
|
| 388 |
+
|
| 389 |
+

|
| 390 |
+
Figure 16: Exploration: We take DIAYN skills learned without a reward function, and evaluate on three natural reward functions: running, jumping, and moving away from the origin. For all tasks, DIAYN learns some skills that perform well. In contrast, a single policy that maximizes an exploration bonus (VIME) performs poorly on all tasks.
|
| 391 |
+
|
| 392 |
+
# E LEARNING $p ( z )$
|
| 393 |
+
|
| 394 |
+
We used our method as a starting point when comparing to VIC (Gregor et al., 2016) in Section 4.2. While $p ( z )$ is fixed in our method, we implement VIC by learning $p ( z )$ . In this section, we describe how we learned $p ( z )$ , and show the effect of learning $p ( z )$ rather than leaving it fixed.
|
| 395 |
+
|
| 396 |
+
# E.1 HOW TO LEARN $p ( z )$
|
| 397 |
+
|
| 398 |
+
We choose $p ( z )$ to optimize the following objective, where $p _ { z } ( s )$ is the distribution over states induced by skill $s$ :
|
| 399 |
+
|
| 400 |
+
$$
|
| 401 |
+
\begin{array} { l } { \displaystyle \mathcal { H } [ S , Z ] = \mathcal { H } [ Z ] - \mathcal { H } [ Z \mid S ] } \\ { \displaystyle = \sum _ { z } - p ( z ) \log p ( z ) + \sum _ { z } \mathbb { E } _ { s \sim p _ { z } ( s ) } \left[ \log p ( z \mid s ) \right] } \\ { \displaystyle = \sum _ { z } p ( z ) \left( \mathbb { E } _ { s \sim p _ { z } ( s ) } \left[ \log p ( z \mid s ) \right] - \log p ( z ) \right) } \end{array}
|
| 402 |
+
$$
|
| 403 |
+
|
| 404 |
+
For clarity, we define $p _ { z } ^ { t } ( s )$ as the distribution over states induced by skill $z$ at epoch $t$ , and define $\ell _ { t } ( z )$ as an approximation of $\mathbb { E } { [ \log p ( z \mid s ) ] }$ using the policy and discriminator from epoch $t$ :
|
| 405 |
+
|
| 406 |
+
$$
|
| 407 |
+
\ell _ { t } ( z ) \triangleq \mathbb { E } _ { s \sim p _ { z } ^ { t } ( s ) } [ \log q _ { t } ( z \mid s ) ]
|
| 408 |
+
$$
|
| 409 |
+
|
| 410 |
+
Noting that $p ( z )$ is constrained to sum to 1, we can optimize this objective using the method of Lagrange multipliers. The corresponding Lagrangian is
|
| 411 |
+
|
| 412 |
+
$$
|
| 413 |
+
\mathcal { L } ( p ) = \sum _ { z } p ( z ) \left( \ell _ { t } ( z ) - \log p ( z ) \right) + \lambda \left( \sum _ { z } p ( z ) - 1 \right)
|
| 414 |
+
$$
|
| 415 |
+
|
| 416 |
+
whose derivative is
|
| 417 |
+
|
| 418 |
+
$$
|
| 419 |
+
\begin{array} { c } { \displaystyle \frac { \partial \mathcal { L } } { \partial p ( z ) } = p \epsilon z \mathfrak { T } \left( \frac { - 1 } { p ( z ) } \right) + \ell _ { t } ( z ) - \log p ( z ) + \lambda } \\ { = \ell _ { t } ( z ) - \log p ( z ) + \lambda - 1 } \end{array}
|
| 420 |
+
$$
|
| 421 |
+
|
| 422 |
+
Setting the derivative equal to zero, we get
|
| 423 |
+
|
| 424 |
+
$$
|
| 425 |
+
\log p ( z ) = \ell _ { t } ( z ) + \lambda - 1
|
| 426 |
+
$$
|
| 427 |
+
|
| 428 |
+
and finally arrive at
|
| 429 |
+
|
| 430 |
+
$$
|
| 431 |
+
p ( z ) \propto e ^ { \ell _ { t } ( z ) }
|
| 432 |
+
$$
|
| 433 |
+
|
| 434 |
+

|
| 435 |
+
Figure 17: Effect of learning $p ( z )$ : We plot the effective number of skills that are sampled from the skill distribution $p ( z )$ throughout training. Note how learning $p ( z )$ greatly reduces the effective number on inverted pendulum and mountain car. We show results from 3 random seeds for each environment.
|
| 436 |
+
|
| 437 |
+

|
| 438 |
+
Figure 18: Learning $p ( z )$ with varying number of skills: We repeat the experiment in Figure 4 for varying sizes of $z$ . Regardless of the size of $z$ , learning $p ( z )$ causes the effective number of skills to drop to less than 10. The two subplots show the same data $( L e f t )$ on a linear scale and $( R i g h t )$ logarithmic scale. We plot the mean and standard deviation across 3 random seeds.
|
| 439 |
+
|
| 440 |
+
# E.2 EFFECT OF LEARNING $p ( z )$
|
| 441 |
+
|
| 442 |
+
In this section, we briefly discuss the effect of learning $p ( z )$ rather than leaving it fixed. To study the effect of learning $p ( z )$ , we compared the entropy of $p ( z )$ throughout training. When $p ( z )$ is fixed, the entropy is a constant $( \log ( 5 0 ) \approx 3 . 9 $ ). To convert nats to a more interpretable quantity, we compute the effective number of skills by exponentiation the entropy:
|
| 443 |
+
|
| 444 |
+
Figure 17 shows the effective number of skills for half cheetah, inverted pendulum, and mountain car. Note how the effective number of skills drops by a factor of 10x when we learn $p ( z )$ . This observation supports our claim that learning $p ( z )$ results in learning fewer diverse skills. Figure 18 is a repeat of the experiment in Figure 17, where we varying the dimension of $z$ . Note that the dimension of $z$ equals the maximum number of skills that the agent could learn. We observe that the effective number of skills plummets throughout training, even when using a high-dimensional vector for $z$ .
|
| 445 |
+
|
| 446 |
+
# F VISUALIZING LEARNED SKILLS
|
| 447 |
+
|
| 448 |
+
# F.1 CLASSIC CONTROL TASKS
|
| 449 |
+
|
| 450 |
+
In this section, we visualize the skills learned for inverted pendulum and mountain car without a reward. Not only does our approach learn skills that solve the task without rewards, it learns multiple distinct skills for solving the task. Figure 19 shows the X position of the agent across time, within one episode. For inverted pendulum (Fig. 19a), we plot only skills that solve the task. Horizontal lines with different X coordinates correspond to skills balancing the pendulum at different positions along the track. The periodic lines correspond to skills that oscillate back and forth while balancing the pendulum. Note that skills that oscillate have different X positions, amplitudes, and periods. For mountain car (Fig. 19b), skills that climb the mountain employ a variety of strategies for to do so. Most start moving backwards to gather enough speed to summit the mountain, while others start forwards, then go backwards, and then turn around to summit the mountain. Additionally, note that skills differ in when the turn around and in their velocity (slope of the green lines).
|
| 451 |
+
|
| 452 |
+

|
| 453 |
+
Figure 19: Visualizing Skills: For every skill, we collect one trajectory and plot the agent’s X coordinate across time. For inverted pendulum (top), we only plot skills that balance the pendulum. Note that among balancing skills, there is a wide diversity of balancing positions, control frequencies, and control magnitudes. For mountain car (bottom), we show skills that achieve larger reward (complete the task), skills with near-zero reward, and skills with very negative reward. Note that skills that solve the task (green) employ varying strategies.
|
| 454 |
+
|
| 455 |
+

|
| 456 |
+
Figure 20: Half cheetah skills: We show skills learned by half-cheetah with no reward.
|
| 457 |
+
|
| 458 |
+
# F.2 SIMULATED ROBOT TASKS
|
| 459 |
+
|
| 460 |
+
Figures 20, 21, and 22 show more skills learned without reward.
|
| 461 |
+
|
| 462 |
+

|
| 463 |
+
Figure 21: Hopper Skills: We show skills learned by hopper with no reward.
|
| 464 |
+
|
| 465 |
+

|
| 466 |
+
Figure 22: Ant skills: We show skills the ant learns without any supervision. Ant learns (top row) to move right, (middle row) to move left, (bottom row, left to right) to move up, to move down, to flip on its back, and to rotate in place.
|
| 467 |
+
|
| 468 |
+

|
| 469 |
+
Figure 23: Imitating an expert: Across 600 imitation tasks, we find our method more closely matches the expert than all baselines.
|
| 470 |
+
|
| 471 |
+
# G IMITATION LEARNING
|
| 472 |
+
|
| 473 |
+
Given the expert trajectory, we use our learned discriminator to estimate which skill was most likely to have generated the trajectory:
|
| 474 |
+
|
| 475 |
+
$$
|
| 476 |
+
\hat { z } = \underset { z } { \arg \operatorname* { m a x } } \Pi _ { s _ { t } \in \tau ^ { * } } q _ { \phi } ( z \mid s _ { t } )
|
| 477 |
+
$$
|
| 478 |
+
|
| 479 |
+
As motivation for this optimization problem, note that each skill induces a distribution over states, $p ^ { z } \triangleq p ( s \mid z )$ . We use $p ^ { * }$ to denote the distribution over states for the expert policy. With a fixed prior distribution $p ( z )$ and a perfect discriminator $q _ { \phi } ( z \mid s ) = p ( z \mid s )$ , we have $p ( s \mid z ) \propto q _ { \phi } ( z \mid s )$ as a function of $z$ . Thus, Equation $\mathbf { G }$ is an M-projection of the expert distribution over states onto the family of distributions over states, $\mathcal { P } = \{ p ^ { z } \}$ :
|
| 480 |
+
|
| 481 |
+
$$
|
| 482 |
+
\arg \operatorname* { m i n } _ { p ^ { z } \in \mathcal { P } } D ( p ^ { * } \mid \mid p ^ { z } )
|
| 483 |
+
$$
|
| 484 |
+
|
| 485 |
+
For clarity, we omit a constant that depends only on $p ^ { * }$ . Note that the use of an M-projection, rather than an I-projection, helps guarantee that the retrieved skill will visit all states that the expert visits (Bishop, 2016). In our experiments, we solve Equation 5 by simply iterating over skills.
|
| 486 |
+
|
| 487 |
+
# G.1 IMITATION LEARNING EXPERIMENTS
|
| 488 |
+
|
| 489 |
+
The “expert” trajectories are actually generated synthetically in these experiments, by running a different random seed of our algorithm. A different seed is used to ensure that the trajectories are not actually produced by any of the currently available skills. Of course, in practice, the expert trajectories might be provided by any other means, including a human. For each expert trajectory, we retrieve the closest DIAYN skill $\hat { z }$ using Equation 4.2.3. Evaluating $q _ { \phi } ( \hat { z } \mid \tau ^ { * } )$ gives us an estimate of the probability that the imitation will match the expert (e.g., for a safety critical setting). This quantity is useful for predicting how accurately our method will imitate an expert before executing the imitation policy. In a safety critical setting, a user may avoid attempting tasks where this score is low. We compare our method to three baselines. The “low entropy” baseline is a variant on our method with lower entropy regularization. The “learned $p ( z ) ^ { \dag }$ baseline learns the distribution over skills. Note that Variational Intrinsic Control (Gregor et al., 2016) is a combination of the “low entropy” baseline and the “learned $p ( z ) ^ { \prime }$ ” baseline. Finally, the “few skills” baseline learns only 5 skills, whereas all other methods learn 50. Figure 23 shows the results aggregated across 600 imitation tasks. The X-axis shows the discriminator score, our estimate for how well the imitation policy will match the expert. The Y-axis shows the true distance between the trajectories, as measured by L2 distance in state space. For all methods, the distance between the expert and the imitation decreases as the discriminator’s score increases, indicating that the discriminator’s score is a good predictor of task performance. Our method consistently achieves the lowest trajectory distance among all methods. The “low entropy” baseline is slightly worse, motivating our decision to learn maximum entropy skills. When imitating tasks using the “few skills” baseline, the imitation trajectories are even further from the expert trajectory. This is expected – by learning more skills, we obtain a better “coverage” over the space of skills. A “learn $p ( z ) ^ { : }$ ” baseline that learns the distribution over skills also performs poorly. Recalling that Gregor et al. (2016) is a combination of the “low entropy” baseline and the “learn $p ( z ) ^ { , , }$ baseline, this plot provides evidence that using maximum entropy policies and fixing the distribution for $p ( z )$ are two factors that enabled our method to scale to more complex tasks.
|
md/train/SkgzYiRqtX/SkgzYiRqtX.md
ADDED
|
@@ -0,0 +1,269 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# GRAPH NEURAL NETWORKS WITH GENERATED PARAMETERS FOR RELATION EXTRACTION
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Recently, progress has been made towards improving relational reasoning in machine learning field. Among existing models, graph neural networks (GNNs) is one of the most effective approaches for multi-hop relational reasoning. In fact, multi-hop relational reasoning is indispensable in many natural language processing tasks such as relation extraction. In this paper, we propose to generate the parameters of graph neural networks (GP-GNNs) according to natural language sentences, which enables GNNs to process relational reasoning on unstructured text inputs. We verify GP-GNNs in relation extraction from text. Experimental results on a human-annotated dataset and two distantly supervised datasets show that our model achieves significant improvements compared to baselines. We also perform a qualitative analysis to demonstrate that our model could discover more accurate relations by multi-hop relational reasoning.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Recent years, graph neural networks (GNNs) have been applied to various fields of machine learning, including node classification (Kipf & Welling, 2016), relation classification (Schlichtkrull et al., 2017), molecular property prediction (Gilmer et al., 2017), few-shot learning (Garcia & Bruna, 2018), and achieve promising results on these tasks. These works have demonstrated GNNs’ strong power to process relational reasoning on graphs.
|
| 12 |
+
|
| 13 |
+
Relational reasoning aims to abstractly reason about entities/objects and their relations, which is an important part of human intelligence. Besides graphs, relational reasoning is also of great importance in many natural language processing tasks such as question answering, relation extraction, summarization, etc. Consider the example shown in Fig. 1, existing relation extraction models could easily extract the facts that Luc Besson directed a film Leon: The Professional ´ and that the film is in English, but fail to infer the relationship between Luc Besson and English without multi-hop relational reasoning. By considering the reasoning patterns, one can discover that Luc Besson could speak English following a reasoning logic that Luc Besson directed Leon: The Professional ´ and this film is in English indicates Luc Besson could speak English. However, most existing GNNs can only process multi-hop relational reasoning on pre-defined graphs and cannot be directly applied in natural language relational reasoning. Enabling multi-hop relational reasoning in natural languages remains an open problem.
|
| 14 |
+
|
| 15 |
+
To address this issue, in this paper, we propose graph neural networks with generated parameters (GP-GNNs), to adapt graph neural networks to solve the natural language relational reasoning task. GP-GNNs first constructs a fully-connected graph with the entities in the sequence of text. After that, it employs three modules to process relational reasoning: (1) an encoding module which enables edges to encode rich information from natural languages, (2) a propagation module which propagates relational information among various nodes, and (3) a classification module which makes predictions with node representations. As compared to traditional GNNs, GP-GNNs could learn edges’ parameters from natural languages, extending it from performing inferring on only non-relational graphs or graphs with a limited number of edge types to unstructured inputs such as texts.
|
| 16 |
+
|
| 17 |
+
In the experiments, we apply GP-GNNs to a classic natural language relational reasoning task: relation extraction from text. We carry out experiments on Wikipedia corpus aligned with Wikidata knowledge base (Vrandeciˇ c & Kr ´ otzsch, 2014) and build a human annotated test set as well as ¨ two distantly labeled test sets with different levels of denseness.Experiment results show that our model outperforms other state-of-the-art models on relation extraction task by considering multihop relational reasoning. We also perform a qualitative analysis which shows that our model could discover more relations by reasoning more robustly as compared to baseline models.
|
| 18 |
+
|
| 19 |
+

|
| 20 |
+
Figure 1: An example of relation extraction from plain text. Given a sentence with several entities marked, we model the interaction between these entities by generating the weights of graph neural networks. Modeling the relationship between “Leon” and “English” as well as “Luc Besson” helps ´ discover the relationship between “Luc Besson” and “English”.
|
| 21 |
+
|
| 22 |
+
Our main contributions are in two-fold:
|
| 23 |
+
|
| 24 |
+
(1) We extend a novel graph neural network model with generated parameters, to enable relational message-passing with rich text information, which could be applied to process relational reasoning on unstructured inputs such as natural languages.
|
| 25 |
+
|
| 26 |
+
(2) We verify our GP-GNNs in the task of relation extraction from text, which demonstrates its ability on multi-hop relational reasoning as compared to those models which extract relationships separately. Moreover, we also present three datasets, which could help future researchers compare their models in different settings.
|
| 27 |
+
|
| 28 |
+
# 2 RELATED WORK
|
| 29 |
+
|
| 30 |
+
# 2.1 GRAPH NEURAL NETWORKS (GNNS)
|
| 31 |
+
|
| 32 |
+
GNNs were first proposed in (Scarselli et al., 2009) and are trained via the Almeida-Pineda algorithm (Almeida, 1987). Later the authors in Li et al. (2016) replace the Almeida-Pineda algorithm with the more generic backpropagation and demonstrate its effectiveness empirically. Gilmer et al. (2017) propose to apply GNNs to molecular property prediction tasks. Garcia & Bruna (2018) shows how to use GNNs to learn classifiers on image datasets in a few-shot manner. Gilmer et al. (2017) study the effectiveness of message-passing in quantum chemistry. Dhingra et al. (2017) apply message-passing on a graph constructed by coreference links to answer relational questions. There are relatively fewer papers discussing how to adapt GNNs to natural language tasks. For example, Marcheggiani & Titov (2017) propose to apply GNNs to semantic role labeling and Schlichtkrull et al. (2017) apply GNNs to knowledge base completion tasks. Zhang et al. (2018) apply GNNs to relation extraction by encoding dependency trees, and De Cao et al. (2018) apply GNNs to multi-hop question answering by encoding co-occurence and co-reference relationships. Although they also consider applying GNNs to natural language processing tasks, they still perform message-passing on predefined graphs. Johnson (2017) introduces a novel neural architecture to generate a graph based on the textual input and dynamically update the relationship during the learning process. In sharp contrast, this paper focuses on extracting relations from real-world relation datasets.
|
| 33 |
+
|
| 34 |
+
# 2.2 RELATIONAL REASONING
|
| 35 |
+
|
| 36 |
+
Relational reasoning has been explored in various fields. For example, Santoro et al. (2017) propose a simple neural network to reason the relationship of objects in a picture, Xu et al. (2017) build up a scene graph according to an image, and Kipf et al. (2018) model the interaction of physical objects.
|
| 37 |
+
|
| 38 |
+
In this paper, we focus on the relational reasoning in natural language domain. Existing works (Zeng et al., 2014; 2015; Lin et al., 2016) have demonstrated that neural networks are capable of capturing the pair-wise relationship between entities in certain situations. For example, (Zeng et al., 2014) is one of the earliest works that applies a simple CNN to this task, and (Zeng et al., 2015) further extends it with piece-wise max-pooling. Nguyen & Grishman (2015) propose a multi-window version of CNN for relation extraction. Lin et al. (2016) study an attention mechanism for relation extraction tasks. Peng et al. (2017) predict n-ary relations of entities in different sentences with Graph LSTMs. Le & Titov (2018) treat relations as latent variables which are capable of inducing the relations without any supervision signals. Zeng et al. (2017) show that the relation path has an important role in relation extraction. Miwa & Bansal (2016) show the effectiveness of LSTMs (Hochreiter & Schmidhuber, 1997) in relation extraction. Christopoulou et al. (2018) proposed a walk-based model to do relation extraction. The most related work is (Sorokin & Gurevych, 2017), where the proposed model incorporates contextual relations with attention mechanism when predicting the relation of a target entity pair. The drawback of existing approaches is that they could not make full use of the multi-hop inference patterns among multiple entity pairs and their relations within the sentence.
|
| 39 |
+
|
| 40 |
+

|
| 41 |
+
Figure 2: Overall architecture: the encoding module takes a sequence of vector representations as inputs, and output a transition matrix as output; the propagation module propagates the hidden states from nodes to its neighbours with the generated transition matrix; the classification module provides task-related predictions according to nodes representations.
|
| 42 |
+
|
| 43 |
+
# 3 GRAPH NEURAL NETWORK WITH GENERATED PARAMETERS (GP-GNNS)
|
| 44 |
+
|
| 45 |
+
We first define the task of natural language relational reasoning. Given a sequence of text with $m$ entities, it aims to reason on both the text and entities and make a prediction of the labels of the entities or entity pairs.
|
| 46 |
+
|
| 47 |
+
In this section, we will introduce the general framework of GP-GNNs. GP-GNNs first build a fullyconnected graph $\mathcal { G } = ( \nu , \mathcal { E } )$ , where $\nu$ is the set of entities, and each edge $( v _ { i } , v _ { j } ) \in \mathcal { E } , v _ { i } , v _ { j } \in \mathcal { V }$ corresponds to a sequence s = xi,j0 , xi,j1 , . . . , xi,jl−1 extracted from the text. After that, GP-GNNs employ three modules including (1) encoding module, (2) propagation module and (3) classification module to proceed relational reasoning, as shown in Fig. 2.
|
| 48 |
+
|
| 49 |
+
# 3.1 ENCODING MODULE
|
| 50 |
+
|
| 51 |
+
The encoding module converts sequences into transition matrices corresponding to edges, i.e. the parameters of the propagation module, by
|
| 52 |
+
|
| 53 |
+
$$
|
| 54 |
+
\mathcal { A } _ { i , j } ^ { ( n ) } = f ( E ( x _ { 0 } ^ { i , j } ) , E ( x _ { 1 } ^ { i , j } ) , \cdot \cdot \cdot , E ( x _ { l - 1 } ^ { i , j } ) ; \theta _ { e } ^ { n } ) ,
|
| 55 |
+
$$
|
| 56 |
+
|
| 57 |
+
where $f ( \cdot )$ could be any model that could encode sequential data, such as LSTMs, GRUs, CNNs, $E ( \cdot )$ indicates an embedding function, and $\theta _ { e } ^ { n }$ denotes the parameters of the encoding module of $n$ -th layer.
|
| 58 |
+
|
| 59 |
+
# 3.2 PROPAGATION MODULE
|
| 60 |
+
|
| 61 |
+
The propagation module learns representations for nodes layer by layer. The initial embeddings of nodes, i.e. the representations of layer 0, are task-related, which could be embeddings that encode
|
| 62 |
+
|
| 63 |
+
features of nodes or just one-hot embeddings. Given representations of layer $n$ , the representations of layer $n + 1$ are calculated by
|
| 64 |
+
|
| 65 |
+
$$
|
| 66 |
+
\mathbf { h } _ { i } ^ { ( n + 1 ) } = \sum _ { v _ { j } \in \mathcal { N } ( v _ { i } ) } \sigma ( \mathcal { A } _ { i , j } ^ { ( n ) } \mathbf { h } _ { j } ^ { ( n ) } ) ,
|
| 67 |
+
$$
|
| 68 |
+
|
| 69 |
+
where $\mathcal { N } ( v _ { i } )$ denotes the neighbours of node $v _ { i }$ in graph $\mathcal { G }$ and $\sigma ( \cdot )$ denotes non-linear activation function.
|
| 70 |
+
|
| 71 |
+
# 3.3 CLASSIFICATION MODULE
|
| 72 |
+
|
| 73 |
+
Generally, the classification module takes node representations as inputs and outputs predictions. Therefore, the loss of GP-GNNs could be calculated as
|
| 74 |
+
|
| 75 |
+
$$
|
| 76 |
+
\mathcal { L } = g ( \mathbf { h } _ { 0 : | \mathcal { V } | - 1 } ^ { 0 } , \mathbf { h } _ { 0 : | \mathcal { V } | - 1 } ^ { 1 } , \dots , \mathbf { h } _ { 0 : | \mathcal { V } | - 1 } ^ { K } , Y ; \theta _ { c } ) ,
|
| 77 |
+
$$
|
| 78 |
+
|
| 79 |
+
where $\theta _ { c }$ denotes the parameters of the classification module, $K$ is the number of layers in propagation module and $Y$ denotes the ground truth label. The parameters in GP-GNNs are trained by gradient descent methods.
|
| 80 |
+
|
| 81 |
+
# 4 RELATION EXTRACTION WITH GP-GNNS
|
| 82 |
+
|
| 83 |
+
Relation extraction from text is a classic natural language relational reasoning task. Given a sentence $s ~ = ~ ( x _ { 0 } , x _ { 1 } , \ldots , x _ { l - 1 } )$ , a set of relations $\mathcal { R }$ and a set of entities in this sentence ${ \mathcal V } _ { s } = \{ v _ { 1 } , v _ { 2 } , \ldots , v _ { | { \mathcal V } _ { s } | } \}$ , where each $v _ { i }$ consists of one or a sequence of tokens, relation extraction from text is to identify the pairwise relationship $r _ { v _ { i } , v _ { j } } \in \mathcal { R }$ between each entity pair $( v _ { i } , v _ { j } )$ .
|
| 84 |
+
|
| 85 |
+
In this section, we will introduce how to apply GP-GNNs to relation extraction.
|
| 86 |
+
|
| 87 |
+
# 4.1 ENCODING MODULE
|
| 88 |
+
|
| 89 |
+
To encode the context of entity pairs (or edges in the graph), we first concatenate the position embeddings with word embeddings in the sentence:
|
| 90 |
+
|
| 91 |
+
$$
|
| 92 |
+
E ( x _ { t } ^ { i , j } ) = [ { \pmb x } _ { t } ; { \pmb p } _ { t } ^ { i , j } ] ,
|
| 93 |
+
$$
|
| 94 |
+
|
| 95 |
+
where $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { t } }$ denotes the word embedding of word $x _ { t }$ and $\mathbf { \Delta } _ { \mathbf { \mathcal { P } } _ { t } ^ { i , j } }$ denotes the position embedding of word position $t$ relative to the entity pair’s position $i , j$ (Details of these two embeddings are introduced in the next two paragraphs.) After that, we feed the representations of entity pairs into encoder $f ( \cdot )$ which contains a bi-directional LSTM and a multi-layer perceptron:
|
| 96 |
+
|
| 97 |
+
$$
|
| 98 |
+
\begin{array} { r } { \boldsymbol { \mathcal { A } } _ { i , j } ^ { ( n ) } = [ \mathtt { M L P } _ { n } ( \mathtt { B i L S T M } _ { n } ( ( E ( x _ { 0 } ^ { i , j } ) , E ( x _ { 1 } ^ { i , j } ) , \cdots , E ( x _ { l - 1 } ^ { i , j } ) ) ] , } \end{array}
|
| 99 |
+
$$
|
| 100 |
+
|
| 101 |
+
where $n$ denotes the index of layer 1, $[ \cdot ]$ means reshaping a vector as a matrix, BiLSTM encodes a sequence by concatenating tail hidden states of the forward LSTM and head hidden states of the backward LSTM together and MLP denotes a multi-layer perceptron with non-linear activation $\sigma$ .
|
| 102 |
+
|
| 103 |
+
Word Representations We first map each token $x _ { t }$ of sentence $\{ x _ { 0 } , x _ { 1 } , \dotsc , x _ { l - 1 } \}$ to a $k$ - dimensional embedding vector $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { t } }$ using a word embedding matrix $W _ { e } \in \mathbb { R } ^ { | V | \times d _ { w } }$ , where $| V |$ is the size of the vocabulary. Throughout this paper, we stick to 50-dimensional GloVe embeddings pre-trained on a 6 billion corpus (Pennington et al., 2014).
|
| 104 |
+
|
| 105 |
+
Position Embedding In this work, we consider a simple entity marking scheme2: we mark each token in the sentence as either belonging to the first entity $v _ { i }$ , the second entity $v _ { j }$ or to neither of those. Each position marker is also mapped to a $d _ { p }$ -dimensional vector by a position embedding matrix $P \in \mathbb { R } ^ { 3 \times d _ { p } }$ . We use notation $\mathbf { \Delta } _ { \mathbf { \mathcal { P } } _ { t } ^ { i , j } }$ to represent the position embedding for $x _ { t }$ corresponding to entity pair $( v _ { i } , v _ { j } )$ .
|
| 106 |
+
|
| 107 |
+
# 4.2 PROPAGATION MODULE
|
| 108 |
+
|
| 109 |
+
Next, we use Eq. (2) to propagate information among nodes where the initial embeddings of nodes and number of layers are further specified as follows.
|
| 110 |
+
|
| 111 |
+
The Initial Embeddings of Nodes Suppose we are focusing on extracting the relationship between entity $v _ { i }$ and entity $v _ { j }$ , the initial embeddings of them are annotated as $\mathbf { h } _ { v _ { i } } ^ { ( 0 ) } = \pmb { a } _ { \mathrm { s u b j e c t } }$ , and $h _ { v _ { j } } ^ { ( 0 ) } = a _ { \mathrm { o b j e c t } }$ , while the initial embeddings of other entities are set to all zeros. We set special values for the head and tail entity’s initial embeddings as a kind of “flag” messages which we expect to be passed through propagation. Annotators $\mathbf { \pmb { a } } _ { \mathrm { s u b j e c t } }$ and $\mathbf { \phi } _ { a _ { \mathrm { o b j e c t } } }$ could also carry the prior knowledge about subject entity and object entity. In our experiments, we generalize the idea of Gated Graph Neural Networks (Li et al., 2016) by setting $\pmb { a } _ { \mathrm { s u b j e c t } } = [ \mathbf { 1 } ; \mathbf { 0 } ] ^ { \top }$ and $\mathbf { \Delta } \mathbf { a } _ { \mathrm { o b j e c t } } = [ \mathbf { 0 } ; \mathbf { 1 } ] ^ { \top 3 }$ .
|
| 112 |
+
|
| 113 |
+
Number of Layers In general graphs, the number of layers $K$ is chosen to be of the order of the graph diameter so that all nodes obtain information from the entire graph. In our context, however, since the graph is densely connected, the depth is interpreted simply as giving the model more expressive power. We treat $K$ as a hyper-parameter, the effectiveness of which will be discussed in detail (Sect. 5.4).
|
| 114 |
+
|
| 115 |
+
# 4.3 CLASSIFICATION MODULE
|
| 116 |
+
|
| 117 |
+
The output module takes the embeddings of the target entity pair $( v _ { i } , v _ { j } )$ as input, which are first converted by:
|
| 118 |
+
|
| 119 |
+
$$
|
| 120 |
+
\pmb { r } _ { v _ { i } , v _ { j } } = [ [ \pmb { h } _ { v _ { i } } ^ { ( 1 ) } \odot \pmb { h } _ { v _ { j } } ^ { ( 1 ) } ] ^ { \top } ; [ \pmb { h } _ { v _ { i } } ^ { ( 2 ) } \odot \pmb { h } _ { v _ { j } } ^ { ( 2 ) } ] ^ { \top } ; \dots ; [ \pmb { h } _ { v _ { i } } ^ { ( K ) } \odot \pmb { h } _ { v _ { j } } ^ { ( K ) } ] ^ { \top } ] ,
|
| 121 |
+
$$
|
| 122 |
+
|
| 123 |
+
where $\odot$ represents element-wise multiplication. This could be used for classification:
|
| 124 |
+
|
| 125 |
+
$$
|
| 126 |
+
\mathbb { P } ( r _ { v _ { i } , v _ { j } } | h , t , s ) = \mathsf { s o f t m a x } \big ( \mathtt { M L P } ( r _ { v _ { i } , v _ { j } } ) \big ) ,
|
| 127 |
+
$$
|
| 128 |
+
|
| 129 |
+
where $r _ { v _ { i } , v _ { j } } \in \mathcal { R }$ , and MLP denotes a multi-layer perceptron module.
|
| 130 |
+
|
| 131 |
+
We use cross entropy here as the classification loss
|
| 132 |
+
|
| 133 |
+
$$
|
| 134 |
+
\mathcal { L } = \sum _ { s \in S } \sum _ { i \neq j } \log \mathbb { P } ( r _ { v _ { i } , v _ { j } } | i , j , s ) ,
|
| 135 |
+
$$
|
| 136 |
+
|
| 137 |
+
where $r _ { v _ { i } , v _ { j } }$ denotes the relation label for entity pair $( v _ { i } , v _ { j } )$ and $S$ denotes the whole corpus.
|
| 138 |
+
|
| 139 |
+
In practice, we stack the embeddings for every target entity pairs together to infer the underlying relationship between each pair of entities. We use PyTorch (Paszke et al., 2017) to implement our models. To make it more efficient, we avoid using loop-based, scalar-oriented code by matrix and vector operations.
|
| 140 |
+
|
| 141 |
+
# 5 EXPERIMENTS
|
| 142 |
+
|
| 143 |
+
Our experiments mainly aim to: (1) showing that our best models could improve the performance of relation extraction under a variety of settings; (2) illustrating that how the number of layers affect the performance of our model; and (3) performing a qualitative investigation to highlight the difference between our models and baseline models. In both part (1) and part (2), we do three subparts of experiments: (i) we will first show that our models could improve instance-level relation extraction on a human annotated test set, and (ii) then we will show that our models could also help enhance the performance of bag-level relation extraction on a distantly labeled test set 4, and (iii) we also split a subset of distantly labeled test set, where the number of entities and edges is large.
|
| 144 |
+
|
| 145 |
+
# 5.1 EXPERIMENT SETTINGS
|
| 146 |
+
|
| 147 |
+
# 5.1.1 DATASETS
|
| 148 |
+
|
| 149 |
+
Distantly labeled set Sorokin & Gurevych (2017) have proposed a dataset with Wikipedia corpora. There is a small difference between our task and theirs: our task is to extract the relationship between every pair of entities in the sentence, whereas their task is to extract the relationship between the given entity pair and the context entity pairs. Therefore, we need to modify their dataset: (1) We added reversed edges if they are missing from a given triple, e.g. if triple (Earth, part of, Solar System) exists in the sentence, we add a reversed label, (Solar System, has a member, Earth), to it; (2) For all of the entity pairs with no relations, we added “NA” labels to them.5 We use the same training set for all of the experiments.
|
| 150 |
+
|
| 151 |
+
Human annotated test set Based on the test set provided by (Sorokin & Gurevych, 2017), 5 annotators6 are asked to label the dataset. They are asked to decide whether or not the distant supervision is right for every pair of entities. Only the instances accepted by all 5 annotators are incorporated into the human annotated test set. There are 350 sentences and 1,230 triples in this test set.
|
| 152 |
+
|
| 153 |
+
Dense distantly labeled test set We further split a dense test set from the distantly labeled test set. Our criteria are: (1) the number of entities should be strictly larger than 2; and (2) there must be at least one circle (with at least three entities) in the ground-truth label of the sentence 7. This test set could be used to test our methods’ performance on sentences with the complex interaction between entities. There are 1,350 sentences and more than 17,915 triples and 7,906 relational facts in this test set.
|
| 154 |
+
|
| 155 |
+
# 5.1.2 MODELS FOR COMPARISON
|
| 156 |
+
|
| 157 |
+
We select the following models for comparison, the first four of which are our baseline models.
|
| 158 |
+
|
| 159 |
+
Context-Aware RE, proposed by Sorokin & Gurevych (2017). This model utilizes attention mechanism to encode the context relations for predicting target relations. It was the state-of-the-art models on Wikipedia dataset. This baseline is implemented by ourselves based on authors’ public repo8.
|
| 160 |
+
|
| 161 |
+
Multi-Window CNN. Zeng et al. (2014) utilize convolutional neural networks to classify relations. Different from the original version of CNN proposed in (Zeng et al., 2014), our implementation, follows (Nguyen & Grishman, 2015), concatenates features extracted by three different window sizes: 3, 5, 7.
|
| 162 |
+
|
| 163 |
+
PCNN, proposed by Zeng et al. (2015). This model divides the whole sentence into three pieces and applies max-pooling after convolution layer piece-wisely. For CNN and following PCNN, the entity markers are the same as originally proposed in (Zeng et al., 2014; 2015).
|
| 164 |
+
|
| 165 |
+
LSTM or GP-GNN with $K = 1$ layer. Bi-directional LSTM (Schuster & Paliwal, 1997) could be seen as an 1-layer variant of our model.
|
| 166 |
+
|
| 167 |
+
GP-GNN with $K = 2$ or $K = 3$ layerss. These models are capable of performing 2-hop reasoning and 3-hop reasoning, respectively.
|
| 168 |
+
|
| 169 |
+
# 5.1.3 HYPER-PARAMETERS
|
| 170 |
+
|
| 171 |
+
We select the best parameters for the validation set. We select non-linear activation functions between relu and tanh, and select $d _ { n }$ among $\{ 2 , 4 , 8 , 1 2 , 1 6 \} ^ { 9 }$ . We have also tried two forms of adjacent matrices: tied-weights (set $\mathcal { A } ^ { ( n ) } = \mathcal { A } ^ { ( n + 1 ) } )$ and untied-weights. Table 1 shows our best hyper-parameter settings, which are used in all of our experiments.
|
| 172 |
+
|
| 173 |
+
Table 1: Hyper-parameters settings.
|
| 174 |
+
|
| 175 |
+
<table><tr><td>Hyper-parameters</td><td>Value</td></tr><tr><td>learning rate</td><td>0.001</td></tr><tr><td>batch size</td><td>50</td></tr><tr><td>dropout ratio</td><td>0.5</td></tr><tr><td>hidden state size</td><td>256</td></tr><tr><td>non-linear activation o</td><td>relu</td></tr><tr><td>embedding size for #layers =1</td><td>8</td></tr><tr><td>embedding size for #layers =2 and 3</td><td>12</td></tr><tr><td>adjacent matrices</td><td>untied</td></tr></table>
|
| 176 |
+
|
| 177 |
+
# 5.2 EVALUATION DETAILS
|
| 178 |
+
|
| 179 |
+
So far, we have only talked about the way to implement sentence-level relation extraction. To evaluate our models and baseline models in bag-level, we utilize a bag of sentences with given entity pair to score the relations between them. Zeng et al. (2015) formalize the bag-level relation extraction as multi-instance learning. Here, we follow their idea and define the score function of entity pair and its corresponding relation $r$ as a max-one setting:
|
| 180 |
+
|
| 181 |
+
$$
|
| 182 |
+
E ( r | v _ { i } , v _ { j } , S ) = \displaystyle \operatorname* { m a x } _ { s \in S } \mathbb { P } ( r _ { v _ { i } , v _ { j } } | i , j , s ) .
|
| 183 |
+
$$
|
| 184 |
+
|
| 185 |
+
Table 2: Results on human annotated dataset
|
| 186 |
+
|
| 187 |
+
<table><tr><td>Dataset Metric</td><td>Human Annotated Test Set Acc Macro F1</td></tr><tr><td>Multi-Window CNN</td><td>47.3 17.5</td></tr><tr><td>PCNN</td><td>30.8 3.2</td></tr><tr><td>Context-Aware RE</td><td>68.9 44.9</td></tr><tr><td>GP-GNN (#layers=1)</td><td>62.9 44.1</td></tr><tr><td>GP-GNN (#layers=2)</td><td>69.5 44.2</td></tr><tr><td>GP-GNN (#layers=3)</td><td>75.3 47.9</td></tr></table>
|
| 188 |
+
|
| 189 |
+
Table 3: Results on distantly labeled test set
|
| 190 |
+
|
| 191 |
+
<table><tr><td rowspan="2">Dataset Metric</td><td colspan="4">Distantly Labeled Test Set</td><td colspan="4">Dense Distantly Labeled Test Set</td></tr><tr><td>P@5%</td><td>P@10%</td><td>P@15%</td><td>P@20%</td><td>P@5%</td><td>P@10%</td><td>P@15%</td><td>P@20%</td></tr><tr><td>Multi-Window CNN</td><td>78.9</td><td>78.4</td><td>76.2</td><td>72.9</td><td>86.2</td><td>83.4</td><td>81.4</td><td>79.1</td></tr><tr><td>PCNN</td><td>73.0</td><td>65.4</td><td>58.1</td><td>51.2</td><td>85.3</td><td>79.1</td><td>72.4</td><td>68.1</td></tr><tr><td>Context-Aware RE</td><td>90.8</td><td>89.9</td><td>88.5</td><td>87.2</td><td>93.5</td><td>93.0</td><td>93.8</td><td>93.0</td></tr><tr><td>GP-GNN (#layers=1)</td><td>90.5</td><td>89.9</td><td>88.2</td><td>87.2</td><td>97.4</td><td>93.5</td><td>92.4</td><td>91.9</td></tr><tr><td>GP-GNN (#layers=2)</td><td>92.5</td><td>92.0</td><td>89.3</td><td>87.1</td><td>95.0</td><td>94.6</td><td>95.2</td><td>94.2</td></tr><tr><td>GP-GNN (#layers=3)</td><td>94.2</td><td>92.0</td><td>89.7</td><td>88.3</td><td>98.5</td><td>97.4</td><td>96.6</td><td>96.1</td></tr></table>
|
| 192 |
+
|
| 193 |
+
# 5.3 EFFECTIVENESS OF REASONING MECHANISM
|
| 194 |
+
|
| 195 |
+
From Table 2 and 3, we can see that our best models outperform all the baseline models significantly on all three test sets. These results indicate our model could successfully conduct reasoning on the fully-connected graph with generated parameters from natural language. These results also indicate that our model not only performs well on sentence-level relation extraction but also improves on bag-level relation extraction. Note that Context-Aware RE also incorporates context information to predict the relation of the target entity pair, however, we argue that Context-Aware RE only models the co-occurrence of various relations, ignoring whether the context relation participates in the reasoning process of relation extraction of the target entity pair. Context-Aware RE may introduce more noise, for it may mistakenly increase the probability of a relation with the similar topic with the context relations. We will give samples to illustrate this issue in Sect. 5.5. Another interesting observation is that our #layers=1 version outperforms CNN and PCNN in these three datasets. One probable reason is that sentences from Wikipedia corpus are always complex, which may be hard to model for CNN and PCNN. Similar conclusions are also reached by Zhang & Wang (2015).
|
| 196 |
+
|
| 197 |
+

|
| 198 |
+
Figure 3: The aggregated precision-recall curves of our models with different number of layers on distantly labeled test set (left) and dense distantly labeled test set (right). We also add Context Aware RE for comparison.
|
| 199 |
+
Table 4: Sample predictions from the baseline models and our GP-GNN model. Ground truth graphs are the subgraph in Wikidata knowledge graph induced by the sets of entities in the sentences. The models take sentences and entity markers as input and produce a graph containing entities (colored and bold) and relations between them. Although “No Relation” is also be seen as a type of relation, we only show other relation types in the graphs.
|
| 200 |
+
|
| 201 |
+
<table><tr><td rowspan=1 colspan=1>Sentence</td><td rowspan=1 colspan=1>Context AwareRelation Extraction</td><td rowspan=1 colspan=1>LSTM</td><td rowspan=1 colspan=1>GP-GNN (#layers = 3)</td><td rowspan=1 colspan=1>Ground Truth</td></tr><tr><td rowspan=1 colspan=1>Oozham(or Uzham)is anupcoming 2016 Malayalamdrama film written anddirected by Jeethu Josephwith Prithviraj Sukumaranin the lead role.</td><td rowspan=1 colspan=1>Prithviraj Sukumaran7cast memberOozham1directororiginal language★ 1Jeethu Joseph Malayalam</td><td rowspan=1 colspan=1>Prithviraj Sukumaran?cast memberOozhamdirectororiginal language↓Jeethu Joseph Malayalam</td><td rowspan=1 colspan=1>Prithviraj Sukumaran?cast memberOozham1 language spokendirectororiginal language? 1Jeethu Joseph Malayalam</td><td rowspan=1 colspan=1>Prithviraj Sukumaran中cast memberOozhamlanguage spokendirectororiginal language↓Jeethu Joseph Malayalam</td></tr><tr><td rowspan=1 colspan=1>The third annual of the 2006Premios Juventud (YouthAwards) edition will be heldon July 13,2006 at theBankUnited Center fromthe University of Miami inCoralGables,Florida</td><td rowspan=1 colspan=1>University of Miami located in the admini-BankUnited Centerstrative territorial entityTCoral Gables, Florida</td><td rowspan=1 colspan=1>University of Miamilocated in the admini-BankUnited Centerstrative terrtorial entityCoral Gables, Florida</td><td rowspan=1 colspan=1>University of Miami中owned byBankUnited Center Iocated in the admini-strative territorial entitylocated in the admini-strative territorial entityCoral Gables, Florida</td><td rowspan=1 colspan=1>University of Miami7owned byBankUnited Center located in the admini-strative territorial entity1Coral Gables, Florida</td></tr><tr><td rowspan=1 colspan=1>The association wasorganized in Enterprise (nowknown as Redbush)Johnson County,Kentucky in 1894 and wasincorporated in 1955,afterrelocating to Gallipolis,Ohio.</td><td rowspan=1 colspan=1>Johnson CountyIlocated in the admini-strative teritorial entitylocated in the admini-strative territorial entityRedbush4Ohio share Kentuckyboarder with</td><td rowspan=1 colspan=1>Johnson Countylocated in the admini-strative territorial entityIocated in the admini-strative territorial entityRedbushOhio Kentucky</td><td rowspan=1 colspan=1>Johnson CountyIocated in the admini-strative territorial entityIocated in the admini-strative territorial entityRedbush1Ohio Kentucky</td><td rowspan=1 colspan=1>Johnson CountyIlocated in the admini-strative teritorial entityIocated in the admini-strative territorial entityRedbushOhio Kentucky</td></tr></table>
|
| 202 |
+
|
| 203 |
+
# 5.4 THE EFFECTIVENESS OF THE NUMBER OF LAYERS
|
| 204 |
+
|
| 205 |
+
The number of layers represents the reasoning ability of our models. A $K$ -layer version has the ability to infer $K$ -hop relations. To demonstrate the effects of the number of layers, we also compare our models with different numbers of layers. From Table 2 and Table 3, we could see that on all three datasets, 3-layer version achieves the best. We could also see from Fig. 3 that as the number of layers grows, the curves get higher and higher precision, indicating considering more hops in reasoning leads to better performance. However, the improvement of the third layer is much smaller on the overall distantly supervised test set than the one on the dense subset. This observation reveals that the reasoning mechanism could help us identify relations especially on sentences where there are more entities. We could also see that on the human annotated test set 3-layer version to have a greater improvement over 2-layer version as compared with 2-layer version over 1-layer version. It is probably due to the reason that bag-level relation extraction is much easier. In real applications, different variants could be selected for different kind of sentences or we can also ensemble the prediction from different models. We leave these explorations for future work.
|
| 206 |
+
|
| 207 |
+
# 5.5 QUALITATIVE RESULTS: CASE STUDY
|
| 208 |
+
|
| 209 |
+
Tab. 4 shows qualitative results that compare our GP-GNN model and the baseline models. The results show that GP-GNN has the ability to infer the relationship between two entities with reasoning. In the first case, GP-GNN implicitly learns a logic rule $\exists y , x \xrightarrow { \sim \mathrm { c a s t - m e m b e r } } y$ original language z $x \xrightarrow { \xrightarrow { \cdots } \infty ^ { \infty } \cdots } z$ language spoken to derive (Oozham, language spoken, Malayalam) and in the second case our model implicitly learns another logic rule $\exists y , x \xrightarrow { \mathrm { { o w n e d } \cdot b y } } y \xrightarrow { \mathrm { { l o c a t e d i n } } } z \Rightarrow x \xrightarrow { \mathrm { { l o c a t e d i n } } } z$ to find the fact (BankUnited Center, located in, English). Note that (BankUnited Center, located in, English) is even not in Wikidata, but our model could identify this fact through reasoning. We also find that Context-Aware RE tends to predict relations with similar topics. For example, in the third case, share boarder with and located in are both relations about territory issues. Consequently, Context-Aware RE makes a mistake by predicting (Kentucky, share boarder with, Ohio). As we have discussed before, this is due to its mechanism to model co-occurrence of multiple relations. However, in our model, since Ohio and Johnson County have no relationship, this wrong relation is not predicted.
|
| 210 |
+
|
| 211 |
+
# 6 CONCLUSION AND FUTURE WORK
|
| 212 |
+
|
| 213 |
+
We addressed the problem of utilizing GNNs to perform relational reasoning with natural languages. Our proposed models, GP-GNNs, solves the relational message-passing task by encoding natural language as parameters and performing propagation from layer to layer. Our model can also be considered as a more generic framework for graph generation problem with unstructured input other than text, e.g. images, videos, audios. In this work, we demonstrate its effectiveness in predicting the relationship between entities in natural language and bag-level and show that by considering more hops in reasoning the performance of relation extraction could be significantly improved.
|
| 214 |
+
|
| 215 |
+
# REFERENCES
|
| 216 |
+
|
| 217 |
+
Luis B Almeida. A learning rule for asynchronous perceptrons with feedback in a combinatorial environment. In Proceedings, 1st First International Conference on Neural Networks, pp. 609– 618. IEEE, 1987.
|
| 218 |
+
Fenia Christopoulou, Makoto Miwa, and Sophia Ananiadou. A walk-based model on entity graphs for relation extraction. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers), volume 2, pp. 81–88, 2018.
|
| 219 |
+
Nicola De Cao, Wilker Aziz, and Ivan Titov. Question answering by reasoning across documents with graph convolutional networks. arXiv preprint arXiv:1808.09920, 2018.
|
| 220 |
+
Bhuwan Dhingra, Zhilin Yang, William W Cohen, and Ruslan Salakhutdinov. Linguistic knowledge as memory for recurrent neural networks. arXiv preprint arXiv:1703.02620, 2017.
|
| 221 |
+
JVictor Garcia and Joan Bruna. Few-shot learning with graph neural networks. In Proceedings of ICLR, 2018.
|
| 222 |
+
Justin Gilmer, Samuel S. Schoenholz, Patrick F. Riley, Oriol Vinyals, and George E. Dahl. Neural message passing for quantum chemistry. In Proceedings of ICML, 2017.
|
| 223 |
+
Sepp Hochreiter and Jurgen Schmidhuber. Long short-term memory. ¨ Neural computation, pp. 1735–1780, 1997.
|
| 224 |
+
Daniel D Johnson. Learning graphical state transitions. In Proceedings of ICLR, 2017.
|
| 225 |
+
Thomas Kipf, Ethan Fetaya, Kuan-Chieh Wang, Max Welling, and Richard Zemel. Neural relational inference for interacting systems. In ICML, 2018.
|
| 226 |
+
|
| 227 |
+
Thomas N Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. Proceedings of ICLR, 2016.
|
| 228 |
+
|
| 229 |
+
Phong Le and Ivan Titov. Improving entity linking by modeling latent relations between mentions, 2018.
|
| 230 |
+
|
| 231 |
+
Yujia Li, Daniel Tarlow, Marc Brockschmidt, and Richard Zemel. Gated graph sequence neural networks. Proceedings of ICLR, 2016.
|
| 232 |
+
|
| 233 |
+
Yankai Lin, Shiqi Shen, Zhiyuan Liu, Huanbo Luan, and Maosong Sun. Neural relation extraction with selective attention over instances. In Proceedings of ACL, pp. 2124–2133, 2016.
|
| 234 |
+
|
| 235 |
+
Diego Marcheggiani and Ivan Titov. Encoding sentences with graph convolutional networks for semantic role labeling. In Proceedings EMNLP, 2017.
|
| 236 |
+
|
| 237 |
+
Makoto Miwa and Mohit Bansal. End-to-end relation extraction using lstms on sequences and tree structures. In Proceedings of ACL, pp. 1105–1116, 2016.
|
| 238 |
+
|
| 239 |
+
Thien Huu Nguyen and Ralph Grishman. Relation extraction: Perspective from convolutional neural networks. In Proceedings of the 1st Workshop on Vector Space Modeling for Natural Language Processing, pp. 39–48, 2015.
|
| 240 |
+
|
| 241 |
+
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.
|
| 242 |
+
|
| 243 |
+
Nanyun Peng, Hoifung Poon, Chris Quirk, Kristina Toutanova, and Wen-tau Yih. Cross-sentence n-ary relation extraction with graph lstms. TACL, pp. 101–115, 2017.
|
| 244 |
+
|
| 245 |
+
Jeffrey Pennington, Richard Socher, and Christopher Manning. Glove: Global vectors for word representation. In Proceedings of EMNLP, pp. 1532–1543, 2014.
|
| 246 |
+
|
| 247 |
+
Adam Santoro, David Raposo, David G Barrett, Mateusz Malinowski, Razvan Pascanu, Peter Battaglia, and Tim Lillicrap. A simple neural network module for relational reasoning. In NIPS, pp. 4967–4976, 2017.
|
| 248 |
+
|
| 249 |
+
Franco Scarselli, Marco Gori, Ah Chung Tsoi, Markus Hagenbuchner, and Gabriele Monfardini. The graph neural network model. IEEE Transactions on Neural Networks, pp. 61–80, 2009.
|
| 250 |
+
|
| 251 |
+
Michael Schlichtkrull, Thomas N Kipf, Peter Bloem, Rianne van den Berg, Ivan Titov, and Max Welling. Modeling relational data with graph convolutional networks. arXiv preprint arXiv:1703.06103, 2017.
|
| 252 |
+
|
| 253 |
+
Mike Schuster and Kuldip K Paliwal. Bidirectional recurrent neural networks. IEEE Transactions on Signal Processing, pp. 2673–2681, 1997.
|
| 254 |
+
|
| 255 |
+
Daniil Sorokin and Iryna Gurevych. Context-aware representations for knowledge base relation extraction. In Proceedings of EMNLP, pp. 1784–1789, 2017.
|
| 256 |
+
|
| 257 |
+
Denny Vrandeciˇ c and Markus Kr ´ otzsch. Wikidata: a free collaborative knowledgebase. ¨ Communications of the ACM, 2014.
|
| 258 |
+
|
| 259 |
+
Danfei Xu, Yuke Zhu, Christopher B Choy, and Li Fei-Fei. Scene graph generation by iterative message passing. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, volume 2, 2017.
|
| 260 |
+
|
| 261 |
+
Daojian Zeng, Kang Liu, Siwei Lai, Guangyou Zhou, and Jun Zhao. Relation classification via convolutional deep neural network. In Proceedings of COLING, pp. 2335–2344, 2014.
|
| 262 |
+
|
| 263 |
+
Daojian Zeng, Kang Liu, Yubo Chen, and Jun Zhao. Distant supervision for relation extraction via piecewise convolutional neural networks. In Proceedings of EMNLP, pp. 1753–1762, 2015.
|
| 264 |
+
|
| 265 |
+
Wenyuan Zeng, Yankai Lin, Zhiyuan Liu, and Maosong Sun. Incorporating relation paths in neural relation extraction. In Proceedings of EMNLP, 2017.
|
| 266 |
+
|
| 267 |
+
Dongxu Zhang and Dong Wang. Relation classification via recurrent neural network. arXiv preprint arXiv:1508.01006, 2015.
|
| 268 |
+
|
| 269 |
+
Yuhao Zhang, Peng Qi, and Christopher D. Manning. Graph convolution over pruned dependency trees improves relation extraction. In Empirical Methods in Natural Language Processing (EMNLP), 2018. URL https://nlp.stanford.edu/pubs/zhang2018graph.pdf.
|
md/train/SyWvgP5el/SyWvgP5el.md
ADDED
|
@@ -0,0 +1,312 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# EPOPT: LEARNING ROBUST NEURAL NETWORK POLICIES USING MODEL ENSEMBLES
|
| 2 |
+
|
| 3 |
+
Aravind Rajeswaran1, Sarvjeet Ghotra2, Balaraman Ravindran3, Sergey Levine4 aravraj@cs.washington.edu, sarvjeet.13it236@nitk.edu.in, ravi@cse.iitm.ac.in, svlevine@eecs.berkeley.edu
|
| 4 |
+
|
| 5 |
+
1 University of Washington Seattle
|
| 6 |
+
2 NITK Surathkal
|
| 7 |
+
3 Indian Institute of Technology Madras
|
| 8 |
+
4 University of California Berkeley
|
| 9 |
+
|
| 10 |
+
# ABSTRACT
|
| 11 |
+
|
| 12 |
+
Sample complexity and safety are major challenges when learning policies with reinforcement learning for real-world tasks, especially when the policies are represented using rich function approximators like deep neural networks. Model-based methods where the real-world target domain is approximated using a simulated source domain provide an avenue to tackle the above challenges by augmenting real data with simulated data. However, discrepancies between the simulated source domain and the target domain pose a challenge for simulated training. We introduce the EPOpt algorithm, which uses an ensemble of simulated source domains and a form of adversarial training to learn policies that are robust and generalize to a broad range of possible target domains, including unmodeled effects. Further, the probability distribution over source domains in the ensemble can be adapted using data from target domain and approximate Bayesian methods, to progressively make it a better approximation. Thus, learning on a model ensemble, along with source domain adaptation, provides the benefit of both robustness and learning/adaptation.
|
| 13 |
+
|
| 14 |
+
# 1 INTRODUCTION
|
| 15 |
+
|
| 16 |
+
Reinforcement learning with powerful function approximators like deep neural networks (deep RL) has recently demonstrated remarkable success in a wide range of tasks like games (Mnih et al., 2015; Silver et al., 2016), simulated control problems (Lillicrap et al., 2015; Mordatch et al., 2015b), and graphics (Peng et al., 2016). However, high sample complexity is a major barrier for directly applying model-free deep RL methods for physical control tasks. Model-free algorithms like Q-learning, actor-critic, and policy gradients are known to suffer from long learning times (Kakade, 2003), which is compounded when used in conjunction with expressive function approximators like deep neural networks (DNNs). The challenge of gathering samples from the real world is further exacerbated by issues of safety for the agent and environment, since sampling with partially learned policies could be unstable (Garc´ıa & Fernandez, 2015). Thus, model-free deep RL methods often require a ´ prohibitively large numbers of potentially dangerous samples for physical control tasks.
|
| 17 |
+
|
| 18 |
+
Model-based methods, where the real-world target domain is approximated with a simulated source domain, provide an avenue to tackle the above challenges by learning policies using simulated data. The principal challenge with simulated training is the systematic discrepancy between source and target domains, and therefore, methods that compensate for systematic discrepancies (modeling errors) are needed to transfer results from simulations to real world using RL. We show that the impact of such discrepancies can be mitigated through two key ideas: (1) training on an ensemble of models in an adversarial fashion to learn policies that are robust to parametric model errors, as well as to unmodeled effects; and (2) adaptation of the source domain ensemble using data from the target domain to progressively make it a better approximation. This can be viewed either as an instance of model-based Bayesian RL (Ghavamzadeh et al., 2015); or as transfer learning from a collection of simulated source domains to a real-world target domain (Taylor & Stone, 2009). While a number of model-free RL algorithms have been proposed (see, e.g., Duan et al. (2016) for a survey), their high sample complexity demands use of a simulator, effectively making them model-based. We show in our experiments that such methods learn policies which are highly optimized for the specific models used in the simulator, but are brittle under model mismatch. This is not surprising, since deep networks are remarkably proficient at exploiting any systematic regularities in a simulator. Addressing robustness of DNN-policies is particularly important to transfer their success from simulated tasks to physical systems.
|
| 19 |
+
|
| 20 |
+
In this paper, we propose the Ensemble Policy Optimization (EPOpt−) algorithm for finding policies that are robust to model mismatch. In line with model-based Bayesian RL, we learn a policy for the target domain by alternating between two phases: (i) given a source (model) distribution (i.e. ensemble of models), find a robust policy that is competent for the whole distribution; (ii) gather data from the target domain using said robust policy, and adapt the source distribution. EPOpt uses an ensemble of models sampled from the source distribution, and a form of adversarial training to learn robust policies that generalize to a broad range of models. By robust, we mean insensitivity to parametric model errors and broadly competent performance for direct-transfer (also referred to as jumpstart like in Taylor & Stone (2009)). Direct-transfer performance refers to the average initial performance (return) in the target domain, without any direct training on the target domain. By adversarial training, we mean that model instances on which the policy performs poorly in the source distribution are sampled more often in order to encourage learning of policies that perform well for a wide range of model instances. This is in contrast to methods which learn highly optimized policies for specific model instances, but brittle under model perturbations. In our experiments, we did not observe significant loss in performance by requiring the policy to work on multiple models (for example, through adopting a more conservative strategy). Further, we show that policies learned using EPOpt are robust even to effects not modeled in the source domain. Such unmodeled effects are a major issue when transferring from simulation to the real world. For the model adaptation step (ii), we present a simple method using approximate Bayesian updates, which progressively makes the source distribution a better approximation of the target domain. We evaluate the proposed methods on the hopper (12 dimensional state space; 3 dimensional action space) and half-cheetah (18 dimensional state space; 6 dimensional action space) benchmarks in MuJoCo. Our experimental results suggest that adversarial training on model ensembles produces robust policies which generalize better than policies trained on a single, maximum-likelihood model (of source distribution) alone.
|
| 21 |
+
|
| 22 |
+
# 2 PROBLEM FORMULATION
|
| 23 |
+
|
| 24 |
+
We consider parametrized Markov Decision Processes (MDPs), which are tuples of the form: ${ \mathcal { M } } ( p ) \equiv < { \mathcal { S } } , { \mathcal { A } } , { \mathcal { T } } _ { p } , { \mathcal { R } } _ { p } , \gamma , S _ { 0 , p } >$ where $s$ , $\mathcal { A }$ are (continuous) states and actions respectively; $\mathcal { T } _ { p } \mathcal { R } _ { p }$ , and $S _ { 0 , p }$ are the state transition, reward function, and initial state distribution respectively, all parametrized by $p$ ; and $\gamma$ is the discount factor. Thus, we consider a set of MDPs with the same state and action spaces. Each MDP in this set could potentially have different transition functions, rewards, and initial state distributions. We use transition functions of the form $S _ { t + 1 } \equiv \mathcal { T } _ { p } ( s _ { t } , a _ { t } )$ where $\mathcal { T } _ { p }$ is a random process and $S _ { t + 1 }$ is a random variable.
|
| 25 |
+
|
| 26 |
+
We distinguish between source and target MDPs using $\mathcal { M }$ and $\mathcal { W }$ respectively. We also refer to $\mathcal { M }$ and $\mathcal { W }$ as source and target domains respectively, as is common in the transfer learning set-up. Our objective is to learn the optimal policy for $\mathcal { W }$ ; and to do so, we have access to $\mathcal { M } ( \boldsymbol { p } )$ . We assume that we have a distribution $( \mathcal { D } )$ over the source domains (MDPs) generated by a distribution over the parameters $P \equiv { \mathcal { P } } ( p )$ that capture our subjective belief about the parameters of $\mathcal { W }$ . Let $\mathcal { P }$ be parametrized by $\psi$ (e.g. mean, standard deviation). For example, $\mathcal { M }$ could be a hopping task with reward proportional to hopping velocity and falling down corresponds to a terminal state. For this task, $p$ could correspond to parameters like torso mass, ground friction, and damping in joints, all of which affect the dynamics. Ideally, we would like the target domain to be in the model class, i.e. $\{ \exists p \mid { \mathcal { M } } ( p ) = { \mathcal { W } } \}$ . However, in practice, there are likely to be unmodeled effects, and we analyze this setting in our experiments. We wish to learn a policy $\pi _ { \theta } ^ { * } ( s )$ that performs well for all $\mathcal { M } \sim \mathcal { D }$ Note that this robust policy does not have an explicit dependence on $p$ , and we require it to perform well without knowledge of $p$ .
|
| 27 |
+
|
| 28 |
+
# 3 LEARNING PROTOCOL AND EPOPT ALGORITHM
|
| 29 |
+
|
| 30 |
+
We follow the round-based learning protocol of Bayesian model-based RL. We use the term rounds when interacting with the target domain, and episode when performing rollouts with the simulator. In each round, we interact with the target domain after computing the robust policy on the current (i.e.
|
| 31 |
+
|
| 32 |
+
posterior) simulated source distribution. Following this, we update the source distribution using data from the target domain collected by executing the robust policy. Thus, in round $i$ , we update two sets of parameters: $\theta _ { i }$ , the parameters of the robust policy (neural network); and $\psi _ { i }$ , the parameters of the source distribution. The two key steps in this procedure are finding a robust policy given a source distribution; and updating the source distribution using data from the target domain. In this section, we present our approach for both of these steps.
|
| 33 |
+
|
| 34 |
+
# 3.1 ROBUST POLICY SEARCH
|
| 35 |
+
|
| 36 |
+
We introduce the EPOpt algorithm for finding a robust policy using the source distribution. EPOpt is a policy gradient based meta-algorithm which uses batch policy optimization methods as a subroutine. Batch policy optimization algorithms (Williams, 1992; Kakade, 2001; Schulman et al., 2015) collect a batch of trajectories by rolling out the current policy, and use the trajectories to make a policy update. The basic structure of EPOpt is to sample a collection of models from the source distribution, sample trajectories from each of these models, and make a gradient update based on a subset of sampled trajectories. We first define evaluation metrics for the parametrized policy, $\pi _ { \theta }$ :
|
| 37 |
+
|
| 38 |
+
$$
|
| 39 |
+
\eta _ { \mathcal { M } } ( \theta , p ) = \mathbb { E } _ { \tilde { \tau } } \left[ \sum _ { t = 0 } ^ { T - 1 } \gamma ^ { t } r _ { t } ( s _ { t } , a _ { t } ) \Bigg | p \right] ,
|
| 40 |
+
$$
|
| 41 |
+
|
| 42 |
+
$$
|
| 43 |
+
\eta _ { \mathcal { D } } ( \theta ) = \mathbb { E } _ { p \sim \mathcal { P } } \left[ \eta _ { \mathcal { M } } ( \theta , p ) \right] = \mathbb { E } _ { p \sim \mathcal { P } } \left[ \mathbb { E } _ { \hat { \tau } } \left[ \sum _ { t = 0 } ^ { T - 1 } \gamma ^ { t } r _ { t } ( s _ { t } , a _ { t } ) ~ \bigg | p \right] \right] = \mathbb { E } _ { \tau } \left[ \sum _ { t = 0 } ^ { T - 1 } \gamma ^ { t } r _ { t } ( s _ { t } , a _ { t } ) \right] .
|
| 44 |
+
$$
|
| 45 |
+
|
| 46 |
+
In (1), $\eta _ { \mathcal { M } } ( \theta , p )$ is the evaluation of $\pi _ { \theta }$ on the model $\mathcal { M } ( \boldsymbol { p } )$ , with $\tilde { \tau }$ being trajectories generated by $\mathcal { M } ( \boldsymbol { p } )$ and $\pi _ { \theta }$ : $\tilde { \tau } = \{ s _ { t } , a _ { t } , r _ { t } \} _ { t = 0 } ^ { T }$ where $s _ { t + 1 } \sim \mathcal { T } _ { p } ( s _ { t } , a _ { t } )$ , $s _ { 0 } \sim S _ { 0 , p }$ , $r _ { t } \sim \mathcal { R } _ { p } ( s _ { t } , a _ { t } )$ , and $a _ { t } \sim \pi _ { \theta } ( s _ { t } )$ . Similarly, $\eta _ { \mathcal { D } } ( \theta )$ is the evaluation of $\pi _ { \theta }$ over the source domain distribution. The corresponding expectation is over trajectories $\tau$ generated by $\mathcal { D }$ and $\pi _ { \theta }$ : ${ \tau } = \{ { s } _ { t } , { a } _ { t } , { r } _ { t } \} _ { t = 0 } ^ { T }$ , where $s _ { t + 1 } \sim \mathcal { T } _ { p _ { t } } ( s _ { t } , a _ { t } )$ , $p _ { t + 1 } = p _ { t }$ , $s _ { 0 } \sim S _ { 0 , p _ { 0 } }$ , $\boldsymbol { r } _ { t } \sim \mathcal { R } _ { p _ { t } } ( \boldsymbol { s } _ { t } , \boldsymbol { a } _ { t } )$ , $a _ { t } \sim \pi _ { \theta } ( s _ { t } )$ , and $p _ { 0 } \sim \mathcal { P }$ . With this modified notation of trajectories, batch policy optimization can be invoked for policy search.
|
| 47 |
+
|
| 48 |
+
Optimizing $\eta _ { \mathcal { D } }$ allows us to learn a policy that performs best in expectation over models in the source domain distribution. However, this does not necessarily lead to a robust policy, since there could be high variability in performance for different models in the distribution. To explicitly seek a robust policy, we use a softer version of max-min objective suggested in robust control, and optimize for the conditional value at risk (CVaR) (Tamar et al., 2015):
|
| 49 |
+
|
| 50 |
+
$$
|
| 51 |
+
\operatorname* { m a x } _ { \theta , y } \ \int _ { { \mathcal { F } } ( \theta ) } \eta _ { { \mathcal { M } } } ( \theta , p ) { \mathcal { P } } ( p ) d p \qquad s . t . \quad { \mathbb { P } } \left( \eta _ { { \mathcal { M } } } ( \theta , P ) \leq y \right) = \epsilon ,
|
| 52 |
+
$$
|
| 53 |
+
|
| 54 |
+
where $\mathcal { F } ( \theta ) = \{ p \vert \eta _ { \mathcal { M } } ( \theta , p ) \le y \}$ is the set of parameters corresponding to models that produce the worst $\epsilon$ percentile of returns, and provides the limit for the integral; $\eta _ { \mathcal { M } } ( \theta , P )$ is the random variable of returns, which is induced by the distribution over model parameters; and $\epsilon$ is a hyperparameter which governs the level of relaxation from max-min objective. The interpretation is that (2) maximizes the expected return for the worst $\epsilon$ -percentile of MDPs in the source domain distribution. We adapt the previous policy gradient formulation to approximately optimize the objective in (2). The resulting algorithm, which we call EPOpt-, generalizes learning a policy using an ensemble of source MDPs which are sampled from a source domain distribution.
|
| 55 |
+
|
| 56 |
+
In Algorithm 1, R(τk) ≡ PT −1t=0 denotes the discounted return obtained in trajectory sample $\tau _ { k }$ . In line 7, we compute the $\epsilon -$ percentile value of returns from the trajectories. In line 8, we find the subset of sampled trajectories which have returns lower than $Q _ { \epsilon }$ . Line 9 calls one step of an underlying batch policy optimization subroutine on the subset of trajectories from line 8. For the CVaR objective, it is important to use a good baseline for the value function. Tamar et al. (2015) show that without a baseline, the resulting policy gradient is biased and not consistent. We use a linear function as the baseline with a time varying feature vector to approximate the value function, similar to Duan et al. (2016). The parameters of the baseline are estimated using only the subset of trajectories with return less than $Q _ { \epsilon }$ . We found that this approach led to empirically good results.
|
| 57 |
+
|
| 58 |
+
For small values of $\epsilon$ , we observed that using the sub-sampling step from the beginning led to unstable learning. Policy gradient methods adjust parameters of policy to increase probability of trajectories
|
| 59 |
+
|
| 60 |
+
# Algorithm 1: EPOpt– for Robust Policy Search
|
| 61 |
+
|
| 62 |
+
1 Input: $\psi$ , $\theta _ { 0 }$ , niter, $N$ ,
|
| 63 |
+
2 for iteration $i = 0 , 1 , 2 , \ldots n i t e r \ \mathbf { d o }$
|
| 64 |
+
3 for $k = 1 , 2 , \dots N$ do
|
| 65 |
+
4 sample model parasample a trajectory $\tau _ { k } = \{ s _ { t } , a _ { t } , r _ { t } , s _ { t + 1 } \} _ { t = 0 } ^ { T - 1 }$ $p _ { k } \sim \mathcal { P } _ { \psi }$ from $\mathcal { M } ( \boldsymbol { p } _ { k } )$ using policy $\pi ( \theta _ { i } )$
|
| 66 |
+
6 endcompute $Q _ { \epsilon } = \epsilon$ percentile of $\{ R ( \tau _ { k } ) \} _ { k = 1 } ^ { N }$
|
| 67 |
+
8 select sub-set $\mathbb { T } = \{ \tau _ { k } : R ( \tau _ { k } ) \leq Q _ { \epsilon } \}$
|
| 68 |
+
9 Update policy: $\theta _ { i + 1 } = \mathrm { B a t c h P o l O p t } ( \theta _ { i } , \mathbb { T } )$
|
| 69 |
+
|
| 70 |
+
# 10 end
|
| 71 |
+
|
| 72 |
+
with high returns and reduce probability of poor trajectories. $\mathrm { E P O p t - } \epsilon$ due to the sub-sampling step emphasizes penalizing poor trajectories more. This might constrain the initial exploration needed to find good trajectories. Thus, we initially use a setting of $\epsilon = 1$ for few iterations before setting epsilon to the desired value. This corresponds to exploring initially to find promising trajectories and rapidly reducing probability of trajectories that do not generalize.
|
| 73 |
+
|
| 74 |
+
# 3.2 ADAPTING THE SOURCE DOMAIN DISTRIBUTION
|
| 75 |
+
|
| 76 |
+
In line with model-based Bayesian RL, we can adapt the ensemble distribution after observing trajectory data from the target domain. The Bayesian update can be written as:
|
| 77 |
+
|
| 78 |
+
$$
|
| 79 |
+
\begin{array} { r l } { \mathbb { P } ( P | \tau _ { k } ) = \displaystyle \frac { 1 } { Z } \times \mathbb { P } ( \tau _ { k } | P ) \times \mathbb { P } ( P ) } & { = \displaystyle \frac { 1 } { Z } \times \prod _ { t = 0 } ^ { T - 1 } \mathbb { P } ( S _ { t + 1 } = s _ { t + 1 } ^ { ( k ) } | s _ { t } ^ { ( k ) } , a _ { t } ^ { ( k ) } , p ) \times \mathbb { P } ( P = p ) , } \end{array}
|
| 80 |
+
$$
|
| 81 |
+
|
| 82 |
+
where $\textstyle { \frac { 1 } { Z } }$ is the partition function (normalization) required to make the probabilities sum to 1, $S _ { t + 1 }$ is the random variable representing the next state, and $\left( s _ { t } ^ { ( k ) } , a _ { t } ^ { ( k ) } , s _ { t + 1 } ^ { ( k ) } \right) _ { t = 0 } ^ { T }$ are data observed along trajectory $\tau _ { k }$ . We try to explain the target trajectory using the stochasticity in the state-transition function, which also models sensor errors. This provides the following expression for the likelihood:
|
| 83 |
+
|
| 84 |
+
$$
|
| 85 |
+
\mathbb { P } ( S _ { t + 1 } | s _ { t } , a _ { t } , p ) \equiv \mathcal { T } _ { p } ( s _ { t } , a _ { t } ) .
|
| 86 |
+
$$
|
| 87 |
+
|
| 88 |
+
We follow a sampling based approach to calculate the posterior, by sampling a set of model parameters: $p _ { i } = [ p _ { 1 } , p _ { 2 } , . . . , p _ { M } ]$ from a sampling distribution, $\mathbb { P } _ { S } ( \boldsymbol { p } _ { i } )$ . Consequently, using Bayes rule and importance sampling, we have:
|
| 89 |
+
|
| 90 |
+
$$
|
| 91 |
+
\mathbb { P } ( p _ { i } | \tau _ { k } ) \propto \mathcal { L } ( \tau _ { k } | p _ { i } ) \times \frac { \mathbb { P } _ { P } ( p _ { i } ) } { \mathbb { P } _ { S } ( p _ { i } ) } ,
|
| 92 |
+
$$
|
| 93 |
+
|
| 94 |
+
where $\mathbb { P } _ { P } ( p _ { i } )$ is the probability of drawing $p _ { i }$ from the prior distribution; and $\mathcal { L } ( \tau _ { k } | p _ { i } )$ is the likelihood of generating the observed trajectory with model parameters $p _ { i }$ . The weighted samples from the posterior can be used to estimate a parametric model, as we do in this paper. Alternatively, one could approximate the continuous probability distribution using discrete weighted samples like in case of particle filters. In cases where the prior has very low probability density in certain parts of the parameter space, it might be advantageous to choose a sampling distribution different from the prior. The likelihood can be factored using the Markov property as: L(τk|pi) = Qt P(St+1 = s(k)t+1|s(k)t , a(k)t . This simple model adaptation rule allows us to illustrate the utility of EPOpt for robust policy search, as well as its integration with model adaptation to learn policies in cases where the target model could be very different from the initially assumed distribution.
|
| 95 |
+
|
| 96 |
+
# 4 EXPERIMENTS
|
| 97 |
+
|
| 98 |
+
We evaluated the proposed EPOpt- $\cdot \epsilon$ algorithm on the 2D hopper (Erez et al., 2011) and halfcheetah (Wawrzynski, 2009) benchmarks using the MuJoCo physics simulator (Todorov et al., 2012).1 Both tasks involve complex second order dynamics and direct torque control. Underactuation, high dimensionality, and contact discontinuities make these tasks challenging reinforcement learning benchmarks. These challenges when coupled with systematic parameter discrepancies can quickly degrade the performance of policies and make them unstable, as we show in the experiments. The batch policy optimization sub-routine is implemented using TRPO. We parametrize the stochastic policy using the scheme presented in Schulman et al. (2015). The policy is represented with a Gaussian distribution, the mean of which is parametrized using a neural network with two hidden layers. Each hidden layer has 64 units, with a tanh non-linearity, and the final output layer is made of linear units. Normally distributed independent random variables are added to the output of this neural network, and we also learn the standard deviation of their distributions. Our experiments are aimed at answering the following questions:
|
| 99 |
+
|
| 100 |
+
1. How does the performance of standard policy search methods (like TRPO) degrade in the presence of systematic physical differences between the training and test domains, as might be the case when training in simulation and testing in the real world?
|
| 101 |
+
2. Does training on a distribution of models with EPOpt improve the performance of the policy when tested under various model discrepancies, and how much does ensemble training degrade overall performance (e.g. due to acquiring a more conservative strategy)?
|
| 102 |
+
3. How does the robustness of the policy to physical parameter discrepancies change when using the robust EPOpt- variant of our method?
|
| 103 |
+
4. Can EPOpt learn policies that are robust to unmodeled effects – that is, discrepancies in physical parameters between source and target domains that do not vary in the source domain ensemble?
|
| 104 |
+
5. When the initial model ensemble differs substantially from the target domain, can the ensemble be adapted efficiently, and how much data from the target domain is required for this?
|
| 105 |
+
|
| 106 |
+
In all the comparisons, performance refers to the average undiscounted return per trajectory or episode (we consider finite horizon episodic problems). In addition to the previously defined performance, we also use the $1 0 ^ { \mathrm { t h } }$ percentile of the return distribution as a proxy for the worst-case return.
|
| 107 |
+
|
| 108 |
+
# 4.1 COMPARISON TO STANDARD POLICY SEARCH
|
| 109 |
+
|
| 110 |
+
In Figure 1, we evaluate the performance of standard TRPO and $\mathrm { E P O p t } ( \epsilon = 0 . 1 )$ on the hopper task, in the presence of a simple parametric discrepancy in the physics of the system between the training (source) and test (target) domains. The plots show the performance of various policies on test domains with different torso mass. The first three plots show policies that are each trained on a single torso mass in the source domain, while the last plot illustrates the performance of EPOpt, which is trained on a Gaussian mass distribution. The results show that no single torso mass value produces a policy that is successful in all target domains. However, the EPOpt policy succeeds almost uniformly for all tested mass values. Furthermore, the results show that there is almost no degradation in the performance of EPOpt for any mass setting, suggesting that the EPOpt policy does not suffer substantially from adopting a more robust strategy.
|
| 111 |
+
|
| 112 |
+

|
| 113 |
+
Figure 1: Performance of hopper policies when testing on target domains with different torso masses. The first three plots (blue, green, and red) show the performance of policies trained with TRPO on source domains with torso mass 3, 6, and 9, respectively (denoted by $m = \mathrm { i n }$ the legend). The rightmost plot shows the performance of EPOpt $\epsilon = 0 . 1$ ) trained on a Gaussian source distribution with mean mass $\mu = 6$ and standard deviation $\sigma = 1 . 5$ . The shaded regions show the $1 0 ^ { \mathrm { t h } }$ and $9 0 ^ { \mathrm { t h } }$ percentile of the return distribution. Policies trained using traditional approaches on a single mass value are unstable for even slightly different masses, making the hopper fall over when trying to move forward. In contrast, the EPOpt policy is stable and achieves a high level of performance on the entire range of masses considered. Further, the EPOpt policy does not suffer from degradation in performance as a consequence of adopting a more robust policy.
|
| 114 |
+
|
| 115 |
+

|
| 116 |
+
Figure 2: On the left, is an illustration of the simulated 2D hopper task studied in this paper. On right, we depict the performance of policies for various model instances of the hopper task. The performance is depicted as a heat map for various model configurations, parameters of which are given in the x and y axis. The adversarially trained policy, EPOpt $\epsilon = 0 . 1$ ), is observed to generalize to a wider range of models and is more robust.
|
| 117 |
+
|
| 118 |
+
# 4.2 ANALYSIS OF ROBUSTNESS
|
| 119 |
+
|
| 120 |
+
Next, we analyze the robustness of policies trained using EPOpt on the hopper domain. For this analysis, we construct a source distribution which varies four different physical parameters: torso mass, ground friction, foot joint damping, and joint inertia (armature). This distribution is presented in Table 1. Using this source distribution, we compare between three different methods: (1) standard policy search (TRPO) trained on a single model corresponding to the mean parameters in Table 1; (2) $\mathrm { E P O p t } ( \epsilon = 1 )$ trained on the source distribution; (3) $\mathrm { E P O p t } ( \epsilon = 0 . 1 )$ – i.e. the adversarially trained policy, again trained on the previously described source distribution. The aim of the comparison is to study direct-transfer performance, similar to the robustness evaluations common in robust controller design (Zhou et al., 1996). Hence, we learn a policy using each of the methods, and then test policies on different model instances (i.e. different combinations of physical parameters) without any adaptation. The results of this comparison are summarized in Figure 2, where we present the performance of the policy for testing conditions corresponding to different torso mass and friction values, which we found to have the most pronounced impact on performance. The results indicate that $\mathrm { E P O p t } ( \epsilon = 0 . 1 )$ produces highly robust policies. A similar analysis for the $1 0 ^ { \mathrm { t h } }$ percentile of the return distribution (softer version of worst-case performance), the half-cheetah task, and different $\epsilon$ settings are presented in the appendix.
|
| 121 |
+
|
| 122 |
+
Table 1: Initial source domain distribution
|
| 123 |
+
|
| 124 |
+
<table><tr><td>Hopper</td><td>从</td><td>0</td><td>low</td><td>high</td></tr><tr><td>mass</td><td>6.0</td><td>1.5</td><td>3.0</td><td>9.0</td></tr><tr><td>ground friction</td><td>2.0</td><td>0.25</td><td>1.5</td><td>2.5</td></tr><tr><td> joint damping</td><td>2.5</td><td>1.0</td><td>1.0</td><td>4.0</td></tr><tr><td>armature</td><td>1.0</td><td>0.25</td><td>0.5</td><td>1.5</td></tr><tr><td>Half-Cheetah</td><td>μ</td><td>0</td><td>low</td><td>high</td></tr><tr><td>mass</td><td>6.0</td><td>1.5</td><td>3.0</td><td>9.0</td></tr><tr><td>ground friction</td><td>0.5</td><td>0.1</td><td>0.3</td><td>0.7</td></tr><tr><td> joint damping</td><td>1.5</td><td>0.5</td><td>0.5</td><td>2.5</td></tr><tr><td>armature</td><td>0.125</td><td>0.04</td><td>0.05</td><td>0.2</td></tr></table>
|
| 125 |
+
|
| 126 |
+

|
| 127 |
+
Figure 3: Comparison between policies trained on a fixed maximum-likelihood model with mass (6), and an ensemble where all models have the same mass (6) and other parameters varying as described in Table 1.
|
| 128 |
+
|
| 129 |
+
# 4.3 ROBUSTNESS TO UNMODELED EFFECTS
|
| 130 |
+
|
| 131 |
+
To analyze the robustness to unmodeled effects, our next experiment considers the setting where the source domain distribution is obtained by varying friction, damping, and armature as in Table 1, but does not consider a distribution over torso mass. Specifically, all models in the source domain distribution have the same torso mass (value of 6), but we will evaluate the policy trained on this distribution on target domains where the torso mass is different. Figure 3 indicates that the $\mathrm { E P O p t } ( \epsilon = 0 . 1 )$ policy is robust to a broad range of torso masses even when its variation is not considered. However, as expected, this policy is not as robust as the case when mass is also modeled as part of the source domain distribution.
|
| 132 |
+
|
| 133 |
+
# 4.4 MODEL ADAPTATION
|
| 134 |
+
|
| 135 |
+
The preceding experiments show that EPOpt can find robust policies, but the source distribution in these experiments was chosen to be broad enough such that the target domain is not too far from high-density regions of the distribution. However, for real-world problems, we might not have the domain knowledge to identify a good source distribution in advance. In such settings, model (source) adaptation allows us to change the parameters of the source distribution using data gathered from the target domain. Additionally, model adaptation is helpful when the parameters of the target domain could change over time, for example due to wear and tear in a physical system. To illustrate model adaptation, we performed an experiment where the target domain was very far from the high density regions of the initial source distribution, as depicted in Figure 4(a). In this experiment, the source distribution varies the torso mass and ground friction. We observe that progressively, the source distribution becomes a better approximation of the target domain and consequently the performance improves. In this case, since we followed a sampling based approach, we used a uniform sampling distribution, and weighted each sample with the importance weight as described in Section 3.2. Eventually, after 10 iterations, the source domain distribution is able to accurately match the target domain. Figure 4(b) depicts the learning curve, and we see that a robust policy with return more than 2500, which roughly corresponds to a situation where the hopper is able to move forward without falling down for the duration of the episode, can be discovered with just 5 trajectories from the target domain. Subsequently, the policy improves near monotonically, and EPOpt finds a good policy with just 11 episodes worth of data from the target domain. In contrast, to achieve the same level of performance on the target domain, completely model-free methods like TRPO would require more than $2 \times 1 0 ^ { 4 }$ trajectories when the neural network parameters are initialized randomly.
|
| 136 |
+
|
| 137 |
+

|
| 138 |
+
Figure 4: (a) Visualizes the source distribution during model adaptation on the hopper task, where mass and friction coefficient are varied in the source domain. The red cross indicates the unknown parameters of the target domain. The contours in the plot indicate the distribution over models (we assume a Gaussian distribution). Lighter colors and more concentrated contour lines indicate regions of higher density. Each iteration corresponds to one round (episode) of interaction with the target domain. The high-density regions gradually move toward the true model, while maintaining probability mass over a range of parameters which can explain the behavior of target domain. Figure 4(b) presents the corresponding learning curve, where the shaded region describes the 10th and 90th percentiles of the performance distribution, and the solid line is the average performance.
|
| 139 |
+
|
| 140 |
+
# 5 RELATED WORK
|
| 141 |
+
|
| 142 |
+
Robust control is a branch of control theory which formally studies development of robust policies (Zhou et al., 1996; Nilim & Ghaoui, 2005; Lim et al., 2013). However, typically no distribution over source or target tasks is assumed, and a worst case analysis is performed. Most results from this field have been concentrated around linear systems or finite MDPs, which often cannot adequately model complexities of real-world tasks. The set-up of model-based Bayesian RL maintains a belief over models for decision making under uncertainty (Vlassis et al., 2012; Ghavamzadeh et al., 2015). In Bayesian RL, through interaction with the target domain, the uncertainty is reduced to find the correct or closest model. Application of this idea in its full general form is difficult, and requires either restrictive assumptions like finite MDPs (Poupart et al., 2006), gaussian dynamics (Ross et al., 2008), or task specific innovations. Previous methods have also suggested treating uncertain model parameters as unobserved state variables in a continuous POMDP framework, and solving the POMDP to get optimal exploration-exploitation trade-off (Duff, 2003; Porta et al., 2006). While this approach is general, and allows automatic learning of epistemic actions, extending such methods to large continuous control tasks like those considered in this paper is difficult.
|
| 143 |
+
|
| 144 |
+
Risk sensitive RL methods (Delage & Mannor, 2010; Tamar et al., 2015) have been proposed to act as a bridge between robust control and Bayesian RL. These approaches allow for using subjective model belief priors, prevent overly conservative policies, and enjoy some strong guarantees typically associated with robust control. However, their application in high dimensional continuous control tasks have not been sufficiently explored. We refer readers to Garc´ıa & Fernandez (2015) for a survey ´ of related risk sensitive RL methods in the context of robustness and safety.
|
| 145 |
+
|
| 146 |
+
Standard model-based control methods typically operate by finding a maximum-likelihood estimate of the target model (Ljung, 1998; Ross & Bagnell, 2012; Deisenroth et al., 2013), followed by policy optimization. Use of model ensembles to produce robust controllers was explored recently in robotics. Mordatch et al. (2015a) use a trajectory optimization approach and an ensemble with small finite set of models; whereas we follow a sampling based direct policy search approach over a continuous distribution of uncertain parameters, and also show domain adaptation. Sampling based approaches can be applied to complex models and discrete MDPs which cannot be planned through easily. Similarly, Wang et al. (2010) use an ensemble of models, but their goal is to optimize for average case performance as opposed to transferring to a target MDP. Wang et al. (2010) use a hand engineered policy class whose parameters are optimized with CMA-ES. EPOpt on the other hand can optimize expressive neural network policies directly. In addition, we show model adaptation, effectiveness of the sub-sampling step $\epsilon < 1$ case), and robustness to unmodeled effects, all of which are important for transfering to a target MDP.
|
| 147 |
+
|
| 148 |
+
Learning of parametrized skills (da Silva et al., 2012) is also concerned with finding policies for a distribution of parametrized tasks. However, this is primarily geared towards situations where task parameters are revealed during test time. Our work is motivated by situations where target task parameters (e.g. friction) are unknown. A number of methods have also been suggested to reduce sample complexity when provided with either a baseline policy (Thomas et al., 2015; Kakade & Langford, 2002), expert demonstration (Levine & Koltun, 2013; Argall et al., 2009), or approximate simulator (Tamar et al., 2012; Abbeel et al., 2006). These are complimentary to our work, in the sense that our policy, which has good direct-transfer performance, can be used to sample from the target domain and other off-policy methods could be explored for policy improvement.
|
| 149 |
+
|
| 150 |
+
# 6 CONCLUSIONS AND FUTURE WORK
|
| 151 |
+
|
| 152 |
+
In this paper, we presented the EPOpt- $\cdot \epsilon$ algorithm for training robust policies on ensembles of source domains. Our method provides for training of robust policies, and supports an adversarial training regime designed to provide good direct-transfer performance. We also describe how our approach can be combined with Bayesian model adaptation to adapt the source domain ensemble to a target domain using a small amount of target domain experience. Our experimental results demonstrate that the ensemble approach provides for highly robust and generalizable policies in fairly complex simulated robotic tasks. Our experiments also demonstrate that Bayesian model adaptation can produce distributions over models that lead to better policies on the target domain than more standard maximum likelihood estimation, particularly in presence of unmodeled effects.
|
| 153 |
+
|
| 154 |
+
Although our method exhibits good generalization performance, the adaptation algorithm we use currently relies on sampling the parameter space, which is computationally intensive as the number of variable physical parameters increase. We observed that (adaptive) sampling from the prior leads to fast and reliable adaptation if the true model does not have very low probability in the prior. However, when this assumption breaks, we require a different sampling distribution which could produce samples from all regions of the parameter space. This is a general drawback of Bayesian adaptation methods. In future work, we plan to explore alternative sampling and parameterization schemes, including non-parametric distributions. An eventual end-goal would be to replace the physics simulator entirely with learned Bayesian neural network models, which could be adapted with limited data from the physical system. These models could be pre-trained using physics based simulators like MuJoCo to get a practical initialization of neural network parameters. Such representations are likely useful when dealing with high dimensional inputs like simulated vision from rendered images or tasks with complex dynamics like deformable bodies, which are needed to train highly generalizable policies that can successfully transfer to physical robots acting in the real world.
|
| 155 |
+
|
| 156 |
+
# ACKNOWLEDGMENTS
|
| 157 |
+
|
| 158 |
+
The authors would like to thank Emo Todorov, Sham Kakade, and students of Emo Todorov’s research group for insightful comments about the work. The authors would also like to thank Emo Todorov for the MuJoCo simulator. Aravind Rajeswaran and Balaraman Ravindran acknowledge financial support from ILDS, IIT Madras.
|
| 159 |
+
|
| 160 |
+
# REFERENCES
|
| 161 |
+
|
| 162 |
+
Pieter Abbeel, Morgan Quigley, and Andrew Y. Ng. Using inaccurate models in reinforcement learning. In ICML, 2006.
|
| 163 |
+
|
| 164 |
+
Brenna D. Argall, Sonia Chernova, Manuela Veloso, and Brett Browning. A survey of robot learning from demonstration. Robotics and Autonomous Systems, 57(5):469 – 483, 2009.
|
| 165 |
+
|
| 166 |
+
Greg Brockman, Vicki Cheung, Ludwig Pettersson, Jonas Schneider, John Schulman, Jie Tang, and Wojciech Zaremba. OpenAI Gym, 2016.
|
| 167 |
+
|
| 168 |
+
Bruno Castro da Silva, George Konidaris, and Andrew G. Barto. Learning parameterized skills. In ICML, 2012.
|
| 169 |
+
|
| 170 |
+
Marc Peter Deisenroth, Gerhard Neumann, and Jan Peters. A survey on policy search for robotics. Foundations and Trends in Robotics, 2(12):1–142, 2013.
|
| 171 |
+
|
| 172 |
+
Erick Delage and Shie Mannor. Percentile optimization for markov decision processes with parameter uncertainty. Operations Research, 58(1):203–213, 2010.
|
| 173 |
+
|
| 174 |
+
Yan Duan, Xi Chen, Rein Houthooft, John Schulman, and Pieter Abbeel. Benchmarking deep reinforcement learning for continuous control. In ICML, 2016.
|
| 175 |
+
|
| 176 |
+
Michael O. Duff. Design for an optimal probe. In ICML, 2003.
|
| 177 |
+
|
| 178 |
+
Tom Erez, Yuval Tassa, and Emanuel Todorov. Infinite-horizon model predictive control for periodic tasks with contacts. In Proceedings of Robotics: Science and Systems, 2011.
|
| 179 |
+
|
| 180 |
+
Javier Garc´ıa and Fernando Fernandez. A comprehensive survey on safe reinforcement learning. ´ Journal of Machine Learning Research, 2015.
|
| 181 |
+
|
| 182 |
+
Mohammad Ghavamzadeh, Shie Mannor, Joelle Pineau, and Aviv Tamar. Bayesian reinforcement learning: A survey. Foundations and Trends in Machine Learning, 8(5-6):359–483, 2015.
|
| 183 |
+
|
| 184 |
+
Sham Kakade. A natural policy gradient. In NIPS, 2001.
|
| 185 |
+
|
| 186 |
+
Sham Kakade. On the Sample Complexity of Reinforcement Learning. PhD thesis, University College London, 2003.
|
| 187 |
+
|
| 188 |
+
Sham Kakade and John Langford. Approximately optimal approximate reinforcement learning. In ICML, 2002.
|
| 189 |
+
|
| 190 |
+
Sergey Levine and Vladlen Koltun. Guided policy search. In ICML, 2013.
|
| 191 |
+
|
| 192 |
+
T. P. Lillicrap, J. J. Hunt, A. Pritzel, N. Heess, T. Erez, Y. Tassa, D. Silver, and D. Wierstra. Continuous control with deep reinforcement learning. ArXiv e-prints, September 2015.
|
| 193 |
+
|
| 194 |
+
Shiau Hong Lim, Huan Xu, and Shie Mannor. Reinforcement learning in robust markov decision processes. In NIPS. 2013.
|
| 195 |
+
|
| 196 |
+
Lennart Ljung. System Identification, pp. 163–173. Birkhauser Boston, Boston, MA, 1998. ¨
|
| 197 |
+
|
| 198 |
+
Volodymyr Mnih et al. Human-level control through deep reinforcement learning. Nature, 518(7540): 529–533, Feb 2015.
|
| 199 |
+
|
| 200 |
+
I. Mordatch, K. Lowrey, and E. Todorov. Ensemble-CIO: Full-body dynamic motion planning that transfers to physical humanoids. In IROS, 2015a.
|
| 201 |
+
|
| 202 |
+
Igor Mordatch, Kendall Lowrey, Galen Andrew, Zoran Popovic, and Emanuel V. Todorov. Interactive control of diverse complex characters with neural networks. In NIPS. 2015b.
|
| 203 |
+
|
| 204 |
+
Arnab Nilim and Laurent El Ghaoui. Robust control of markov decision processes with uncertain transition matrices. Operations Research, 53(5):780–798, 2005.
|
| 205 |
+
|
| 206 |
+
Xue Bin Peng, Glen Berseth, and Michiel van de Panne. Terrain-adaptive locomotion skills using deep reinforcement learning. ACM Transactions on Graphics (Proc. SIGGRAPH 2016), 2016.
|
| 207 |
+
|
| 208 |
+
Josep M. Porta, Nikos A. Vlassis, Matthijs T. J. Spaan, and Pascal Poupart. Point-based value iteration for continuous pomdps. Journal of Machine Learning Research, 7:2329–2367, 2006.
|
| 209 |
+
|
| 210 |
+
Pascal Poupart, Nikos A. Vlassis, Jesse Hoey, and Kevin Regan. An analytic solution to discrete bayesian reinforcement learning. In ICML, 2006.
|
| 211 |
+
|
| 212 |
+
S. Ross, B. Chaib-draa, and J. Pineau. Bayesian reinforcement learning in continuous pomdps with application to robot navigation. In ICRA, 2008.
|
| 213 |
+
|
| 214 |
+
Stephane Ross and Drew Bagnell. Agnostic system identification for model-based reinforcement learning. In ICML, 2012.
|
| 215 |
+
|
| 216 |
+
John Schulman, Sergey Levine, Philipp Moritz, Michael Jordan, and Pieter Abbeel. Trust region policy optimization. In ICML, 2015.
|
| 217 |
+
|
| 218 |
+
David Silver et al. Mastering the game of go with deep neural networks and tree search. Nature, 529 (7587):484–489, Jan 2016.
|
| 219 |
+
|
| 220 |
+
Aviv Tamar, Dotan Di Castro, and Ron Meir. Integrating a partial model into model free reinforcement learning. Journal of Machine Learning Research, 2012.
|
| 221 |
+
|
| 222 |
+
Aviv Tamar, Yonatan Glassner, and Shie Mannor. Optimizing the cvar via sampling. In AAAI Conference on Artificial Intelligence, 2015.
|
| 223 |
+
|
| 224 |
+
Matthew E. Taylor and Peter Stone. Transfer learning for reinforcement learning domains: A survey. Journal of Machine Learning Research, 10:1633–1685, December 2009.
|
| 225 |
+
|
| 226 |
+
Philip Thomas, Georgios Theocharous, and Mohammad Ghavamzadeh. High-confidence off-policy evaluation. In AAAI Conference on Artificial Intelligence. 2015.
|
| 227 |
+
|
| 228 |
+
E. Todorov, T. Erez, and Y. Tassa. Mujoco: A physics engine for model-based control. In 2012 IEEE/RSJ International Conference on Intelligent Robots and Systems, pp. 5026–5033, Oct 2012.
|
| 229 |
+
|
| 230 |
+
Nikos Vlassis, Mohammad Ghavamzadeh, Shie Mannor, and Pascal Poupart. Bayesian Reinforcement Learning, pp. 359–386. Springer Berlin Heidelberg, Berlin, Heidelberg, 2012.
|
| 231 |
+
|
| 232 |
+
Jack M. Wang, David J. Fleet, and Aaron Hertzmann. Optimizing walking controllers for uncertain inputs and environments. ACM Trans. Graph., 2010.
|
| 233 |
+
|
| 234 |
+
Pawel Wawrzynski. Real-time reinforcement learning by sequential actor-critics and experience replay. Neural Networks, 22:1484–1497, 2009.
|
| 235 |
+
|
| 236 |
+
Ronald J. Williams. Simple statistical gradient-following algorithms for connectionist reinforcement learning. Machine Learning, 8(3):229–256, 1992.
|
| 237 |
+
|
| 238 |
+
Kemin Zhou, John C. Doyle, and Keith Glover. Robust and Optimal Control. Prentice-Hall, Inc., Upper Saddle River, NJ, USA, 1996. ISBN 0-13-456567-3.
|
| 239 |
+
|
| 240 |
+
# A APPENDIX
|
| 241 |
+
|
| 242 |
+
# A.1 DESCRIPTION OF SIMULATED ROBOTIC TASKS CONSIDERED IN THIS WORK
|
| 243 |
+
|
| 244 |
+
Hopper: The hopper task is to make a 2D planar hopper with three joints and 4 body parts hop forward as fast as possible (Erez et al., 2011). This problem has a 12 dimensional state space and a 3 dimensional action space that corresponds to torques at the joints. We construct the source domain by considering a distribution over 4 parameters: torso mass, ground friction, armature (inertia), and damping of foot.
|
| 245 |
+
|
| 246 |
+
Half Cheetah: The half-cheetah task (Wawrzynski, 2009) requires us to make a 2D cheetah with two legs run forward as fast as possible. The simulated robot has 8 body links with an 18 dimensional state space and a 6 dimensional action space that corresponds to joint torques. Again, we construct the source domain using a distribution over the following parameters: torso and head mass, ground friction, damping, and armature (inertia) of foot joints.
|
| 247 |
+
|
| 248 |
+

|
| 249 |
+
Figure 5: Illustrations of the 2D simulated robot models used in the experiments. The hopper (a) and half-cheetah (b) tasks present the challenges of under-actuation and contact discontinuities. These challenges when coupled with parameter uncertainties lead to dramatic degradation in the quality of policies when robustness is not explicitly considered.
|
| 250 |
+
|
| 251 |
+
A video demonstration of the trained policies on these tasks can be viewed here: Supplimenrary video ( https://youtu.be/w1YJ9vwaoto )
|
| 252 |
+
|
| 253 |
+
Reward functions: For both tasks, we used the standard reward functions implemented with OpenAI gym (Brockman et al., 2016), with minor modifications. The reward structure for hopper task is:
|
| 254 |
+
|
| 255 |
+
$$
|
| 256 |
+
r ( s , a ) = v _ { x } - 0 . 0 0 1 | | a | | ^ { 2 } + b ,
|
| 257 |
+
$$
|
| 258 |
+
|
| 259 |
+
where $s$ are the states comprising of joint positions and velocities; $a$ are the actions (controls); and $v _ { x }$ is the forward velocity. $b$ is a bonus for being alive $( b = 1 )$ ). The episode terminates when $z _ { \mathrm { t o r s o } } < 0 . 7$ or when $| \theta _ { y } | < 0 . 2$ where $\theta _ { y }$ is the forward pitch of the body.
|
| 260 |
+
|
| 261 |
+
For the cheetah task, we use the reward function:
|
| 262 |
+
|
| 263 |
+
$$
|
| 264 |
+
r ( s , a ) = v _ { x } - 0 . 1 | | a | | ^ { 2 } + b ,
|
| 265 |
+
$$
|
| 266 |
+
|
| 267 |
+
the alive bonus is 1 if head of cheetah is above $- 0 . 2 5$ (relative to torso) and similarly episode terminates if the alive condition is violated.
|
| 268 |
+
|
| 269 |
+
Our implementation of the algorithms and environments are public in this repository to facilitate reproduction of results: https://github.com/aravindr93/robustRL
|
| 270 |
+
|
| 271 |
+
# A.2 HYPERPARAMETERS
|
| 272 |
+
|
| 273 |
+
1. Neural network architecture: We used a neural network with two hidden layers, each with 64 units and tanh non-linearity. The policy updates are implemented using TRPO. 2. Trust region size in TRPO: The maximum KL divergence between sucessive policy updates are constrained to be 0.01
|
| 274 |
+
|
| 275 |
+
3. Number and length of trajectory rollouts: In each iteration, we sample $N = 2 4 0$ models from the ensemble, one rollout is performed on each such model. This was implemented in parallel on multiple (6) CPUs. Each trajectory is of length $1 0 0 0 -$ same as the standard implimentations of these tasks in gym and rllab.
|
| 276 |
+
|
| 277 |
+
The results in Fig 1 and Fig 2 were generated after 150 and 200 iterations of TRPO respectively, with each iteration consisting of 240 trajectories as specified in (3) above.
|
| 278 |
+
|
| 279 |
+
# A.3 WORST-CASE ANALYSIS FOR HOPPER TASK
|
| 280 |
+
|
| 281 |
+
Figure 2 illustrates the performance of the three considered policies: viz. TRPO on mean parameters, $\mathrm { E P O p t } ( \epsilon = 1 )$ , and EPOpt $( \epsilon = 0 . 1 )$ . We similarly analyze the $1 0 ^ { \mathrm { t h } }$ percentile of the return distribution as a proxy for worst-case analysis, which is important for a robust control policy (here, distribution of returns for a given model instance is due to variations in initial conditions). The corresponding results are presented below:
|
| 282 |
+
|
| 283 |
+

|
| 284 |
+
Figure 6: $1 0 ^ { \mathrm { t h } }$ percentile of return distribution for the hopper task. EPOpt $\epsilon = 0 . 1 $ ) clearly outperforms the other approaches. The $1 0 ^ { \mathrm { t h } }$ of return distribution for EPOpt $\epsilon = 0 . 1$ ) also nearly overlaps with the expected return, indicating that the policies trained using EPOpt $\epsilon = 0 . 1$ ) are highly robust and reliable.
|
| 285 |
+
|
| 286 |
+

|
| 287 |
+
A.4 ROBUSTNESS ANALYSIS FOR HALF-CHEETAH TASK
|
| 288 |
+
Figure 7: Performance of policies for various model instances for the half-cheetah domain, similar to Figure 2. Again, it is observed that the adversarial trained policy is robust and generalizes well to all models in the source distribution.
|
| 289 |
+
|
| 290 |
+
# A.5 DIFFERENT SETTINGS FOR
|
| 291 |
+
|
| 292 |
+
Here, we analyze how different settings for $\epsilon$ influences the robustness of learned policies. The policies in this section have been trained for 200 iterations with 240 trajectory samples per iteration. Similar to the description in Section 3.1, the first 100 iterations use $\epsilon = 1$ , and the final 100 iterations use the desired $\epsilon$ . The source distribution is described in Table 1. We test the performance on a grid over the model parameters. Our results, summarized in Table 2, indicate that decreasing $\epsilon$ decreases the variance in performance, along with a small decrease in average performance, and hence enhances robustness.
|
| 293 |
+
|
| 294 |
+
Table 2: Performance statistics for different $\epsilon$ settings for the hopper task
|
| 295 |
+
|
| 296 |
+
<table><tr><td rowspan="2"></td><td colspan="8">Performance (Return)</td></tr><tr><td>mean</td><td>std</td><td></td><td></td><td>Percentiles</td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td>5</td><td>10</td><td>25</td><td>50</td><td>75</td><td>90</td></tr><tr><td rowspan="7">0.05 0.1 0.2 0.3 0.4 0.5 0.75 1.0</td><td>2889</td><td>502</td><td>1662</td><td>2633</td><td>2841</td><td>2939</td><td>2966</td><td>3083</td></tr><tr><td>3063</td><td>579</td><td>1618</td><td>2848</td><td>3223</td><td>3286</td><td>3336</td><td>3396</td></tr><tr><td>3097</td><td>665</td><td>1527</td><td>1833</td><td>3259</td><td>3362</td><td>3423</td><td>3483</td></tr><tr><td>3121</td><td>706</td><td>1461</td><td>1635</td><td>3251</td><td>3395</td><td>3477</td><td>3513</td></tr><tr><td>3126</td><td>869</td><td>1013</td><td>1241</td><td>3114</td><td>3412</td><td>3504</td><td>3546</td></tr><tr><td>3122</td><td>1009</td><td>984</td><td>1196</td><td>1969</td><td>3430</td><td>3481</td><td>3567</td></tr><tr><td>3133 3224</td><td>952 1060</td><td>1005 1198</td><td>1516 1354</td><td>2187 1928</td><td>3363 3461</td><td>3486 3557</td><td>3548 3604</td></tr><tr><td>Max-Lik</td><td>1710</td><td>1140</td><td>352</td><td>414</td><td>646</td><td>1323</td><td>3088</td><td>3272</td></tr></table>
|
| 297 |
+
|
| 298 |
+
# A.6 IMPORTANCE OF BASELINE FOR BATCHPOLOPT
|
| 299 |
+
|
| 300 |
+
As described in Section 3.1, it is important to use a good baseline estimate for the value function for the batch policy optimization step. When optimizing for the expected return, we can interpret the baseline as a variance reduction technique. Intuitively, policy gradient methods adjust parameters of the policy to improve probability of trajectories in proportion to their performance. By using a baseline for the value function, we make updates that increase probability of trajectories that perform better than average and vice versa. In practice, this variance reduction is essential for getting policy gradients to work. For the CVaR case, Tamar et al. (2015) showed that without using a baseline, the policy gradient is biased. To study importance of the baseline, we first consider the case where we do not employ the adversarial sub-sampling step, and fix $\epsilon = 1$ . We use a linear baseline with a time-varying feature vector as described in Section 3.1. Figure 8(a) depicts the learning curve for the source distribution in Table 1. The results indicate that use of a baseline is important to make policy gradients work well in practice.
|
| 301 |
+
|
| 302 |
+
Next, we turn to the case of $\epsilon < 1$ . As mentioned in section 3.1, setting a low $\epsilon$ from the start leads to unstable learning. The adversarial nature encourages penalizing poor trajectories more, which constrains the initial exploration needed to find promising trajectories. Thus we will “pre-train” by using $\epsilon = 1$ for some iterations, before switching to the desired $\epsilon$ setting. From Figure 8(a), it is clear that pre-training without a baseline is unlikely to help, since the performance is poor. Thus, we use the following setup for comparison: for 100 iterations, $\mathrm { E P O p t } ( \epsilon = 1 )$ is used with the baseline. Subsequently, we switch to $\mathrm { E P O p t } ( \epsilon = 0 . 1 )$ and run for another 100 iterations, totaling 200 iterations. The results of this experiment are depicted in Figure 8(b). This result indicates that use of a baseline is crucial for the CVaR case, without which the performance degrades very quickly. We repeated the experiment with 100 iterations of pre-training with $\epsilon = 1$ and without baseline, and observed the same effect. These empirical results reinforce the theoretical findings of Tamar et al. (2015).
|
| 303 |
+
|
| 304 |
+
# A.7 ALTERNATE POLICY GRADIENT SUBROUTINES FOR BATCHPOLOPT
|
| 305 |
+
|
| 306 |
+
As emphasized previously, EPOpt is a generic policy gradient based meta algorithm for finding robust policies. The BatchPolOpt step (line 9, Algorithm 1) calls one gradient step of a policy gradient method, the choice of which is largely orthogonal to the main contributions of this paper. For the reported results, we have used TRPO as the policy gradient method. Here, we compare the results to the case when using the classic REINFORCE algorithm. For this comparison, we use the same value function baseline parametrization for both TRPO and REINFORCE. Figure 9 depicts the learning curve when using the two policy gradient methods. We observe that performance with TRPO is significantly better. When optimizing over probability distributions, the natural gradient can navigate the warped parameter space better than the “vanilla” gradient. This observation is consistent with the findings of Kakade (2001), Schulman et al. (2015), and Duan et al. (2016).
|
| 307 |
+
|
| 308 |
+

|
| 309 |
+
Figure 8: (a) depicts the learning curve for $\mathrm { E P O p t } ( \epsilon = 1 )$ with and without baselines. The learning curves indicate that use of a baseline provides a better ascent direction, thereby enabling faster learning. Figure 8(b) depicts the learning curve when using the average return and CVaR objectives. For the comparison, we “pre-train” for 100 iterations with $\epsilon = 1$ setting and using a baseline. The results indicates that a baseline is very important for the CVaR objective $( \epsilon < 1 )$ ), without which the performance drops very quickly. Here, performance is the average return in the source distribution.
|
| 310 |
+
|
| 311 |
+

|
| 312 |
+
Figure 9: Learning curves for $\mathrm { E P O p t } ( \epsilon = 1 )$ when using the TRPO and REINFORCE methods for the BatchPolOpt step.
|
md/train/SygvZ209F7/SygvZ209F7.md
ADDED
|
@@ -0,0 +1,178 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# BIOLOGICALLY-PLAUSIBLE LEARNING ALGORITHMS CAN SCALE TO LARGE DATASETS
|
| 2 |
+
|
| 3 |
+
Will Xiao
|
| 4 |
+
Department of Molecular and Cellular Biology
|
| 5 |
+
Harvard University
|
| 6 |
+
Cambridge, MA 02138, USA
|
| 7 |
+
xiaow@fas.harvard.edu
|
| 8 |
+
|
| 9 |
+
Honglin Chen Department of Mathematics University of California, Los Angeles Los Angeles, CA 90095, USA chenhonglin@g.ucla.edu
|
| 10 |
+
|
| 11 |
+
Qianli Liao, Tomaso Poggio Center for Brains, Minds and Machines Massachusetts Institute of Technology Cambridge, MA 02139, USA lql@mit.edu, tp@csail.mit.edu
|
| 12 |
+
|
| 13 |
+
# ABSTRACT
|
| 14 |
+
|
| 15 |
+
The backpropagation (BP) algorithm is often thought to be biologically implausible in the brain. One of the main reasons is that BP requires symmetric weight matrices in the feedforward and feedback pathways. To address this “weight transport problem” (Grossberg, 1987), two biologically-plausible algorithms, proposed by Liao et al. (2016b) and Lillicrap et al. (2016), relax BP’s weight symmetry requirements and demonstrate comparable learning capabilities to that of BP on small datasets. However, a recent study by Bartunov et al. (2018) finds that although feedback alignment (FA) and some variants of target-propagation (TP) perform well on MNIST and CIFAR, they perform significantly worse than BP on ImageNet. Here, we additionally evaluate the sign-symmetry (SS) algorithm (Liao et al., 2016b), which differs from both BP and FA in that the feedback and feedforward weights do not share magnitudes but share signs. We examined the performance of sign-symmetry and feedback alignment on ImageNet and MS COCO datasets using different network architectures (ResNet-18 and AlexNet for ImageNet; RetinaNet for MS COCO). Surprisingly, networks trained with signsymmetry can attain classification performance approaching that of BP-trained networks. These results complement the study by Bartunov et al. (2018) and establish a new benchmark for future biologically-plausible learning algorithms on more difficult datasets and more complex architectures.
|
| 16 |
+
|
| 17 |
+
# 1 INTRODUCTION
|
| 18 |
+
|
| 19 |
+
Deep learning models today are highly successful in task performance, learning useful representations, and even matching representations in the brain (Yamins et al., 2014; Schrimpf et al., 2018). However, it remains a contentious issue whether these models reflect how the brain learns. Core to the problem is the fact that backpropagation, the learning algorithm underlying most of today’s deep networks, is difficult to implement in the brain given what we know about the brain’s hardware (Crick 1989; however, see Hinton 2007). One main reason why backpropagation seems implausible in the brain is that it requires sharing of feedforward and feedback weights. Since synapses are unidirectional in the brain, feedforward and feedback connections are physically distinct. Requiring them to shared their weights, even as weights are adjusted during learning, seems highly implausible.
|
| 20 |
+
|
| 21 |
+
One approach to addressing this issue is to relax the requirement for weight-symmetry in error backpropagation. Surprisingly, when the feedback weights share only the sign but not the magnitude of the feedforward weights (Liao et al., 2016b) or even when the feedback weights are random (but fixed) (Lillicrap et al., 2016), they can still guide useful learning in the network, with performance comparable to and sometimes even better than performance of backpropagation, on datasets such as MNIST and CIFAR. Here, we refer to these two algorithms, respectively, as “sign-symmetry” and “feedback alignment.” Since weight symmetry in backpropagation is required for accurately propagating the derivative of the loss function through layers, the success of asymmetric feedback algorithms indicates that learning can be supported even by inaccurate estimation of the error derivative. In feedback alignment, the authors propose that the feedforward weights learn to align with the random feedback weights, thereby allowing feedback to provide approximate yet useful learning signals (Lillicrap et al., 2016).
|
| 22 |
+
|
| 23 |
+
However, a recent paper by Bartunov et al. (2018) finds that feedback alignment and a few other biologically-plausible algorithms, including variants of target propagation, do not generalize to larger and more difficult problems such as ImageNet (Deng et al., 2009) and perform much worse than backpropagation. Nevertheless, the specific conditions Bartunov et al. tested are somewhat restrictive. They only tested locally-connected networks (i.e., weight sharing is not allowed among convolution filters at different spatial locations), a choice that is motivated by biological plausibility but in practice limits the size of the network (without weight sharing, each convolutional layer needs much more memory to store its weights), making it unclear whether poor performance was attributable solely to the algorithm, or to the algorithm on those architectures.1 Second, Bartunov et al. did not test sign-symmetry, which may be more powerful than feedback alignment since signsymmetric feedback weights may carry more information about the feedforward weights than the random feedback weights used in feedback alignment.
|
| 24 |
+
|
| 25 |
+
In this work, we re-examine the performance of sign-symmetry and feedback alignment on ImageNet and MS COCO datasets using standard ConvNet architectures (i.e., ResNet-18, AlexNet, and RetinaNet). We find that sign-symmetry can in fact train networks on both tasks, achieving similar performance to backpropagation on ImageNet and reasonable performance on MS COCO. In addition, we test the use of backpropagation exclusively in the last layer while otherwise using feedback alignment, hypothesizing that in the brain, the classifier layer may not be a fully-connected layer and may deliver the error signal through some other unspecified mechanism. Such partial feedback alignment can achieve better performance (relative to backpropagation) than in Bartunov et al. (2018). Taken together, these results extend previous findings and indicate that existing biologicallyplausible learning algorithms remain viable options both for training artificial neural networks and for modeling how learning can occur in the brain.
|
| 26 |
+
|
| 27 |
+
# 2 METHODS
|
| 28 |
+
|
| 29 |
+
Consider a layer in a feedforward neural network. Let $x _ { i }$ denote the input to the $i ^ { \mathrm { t h } }$ neuron in the layer and $y _ { j }$ the output of the $j ^ { \mathrm { t h } }$ neuron. Let $W$ denote the feedforward weight matrix and $W _ { i j }$ the connection between input $x _ { i }$ and output $y _ { j }$ . Let $f$ denote the activation function. Then, Equation 1 describes the computation in the feedforward step. Now, let $B$ denote the feedback weight matrix and $B _ { i j }$ the feedback connection between output $y _ { j }$ and input $x _ { i }$ , and let $f ^ { \prime }$ denote the derivative of the activation function $f$ . Given the objective function $E$ , the error gradient $\frac { \partial E } { \partial x _ { i } }$ calculated in the feedback step is described by Equation 2.
|
| 30 |
+
|
| 31 |
+
$$
|
| 32 |
+
\begin{array} { c } { { y _ { j } = f ( \sigma _ { j } ) , \quad \sigma _ { j } = \displaystyle \sum _ { i } W _ { i j } x _ { i } } } \\ { { \displaystyle \frac { \partial E } { \partial x _ { i } } = \sum _ { j } B _ { i j } f ^ { \prime } ( \sigma _ { j } ) \displaystyle \frac { \partial E } { \partial y _ { j } } } } \end{array}
|
| 33 |
+
$$
|
| 34 |
+
|
| 35 |
+
Standard backpropagation requires $B = W$ . Sign-symmetry (Liao et al., 2016b) relaxes the above symmetry requirement by letting $B = \mathrm { s i g n } ( W )$ , where $\mathrm { s i g n } ( \cdot )$ is the (elementwise) sign function. Feedback alignment (Lillicrap et al., 2016) uses a fixed random matrix as the feedback weight matrix $B$ . Lillicrap et al. showed that through training, $W$ is adjusted such that on average, $\mathbf { e } ^ { T } \bar { W } B \mathbf { e } > 0$ , where e is the error in the network’s output. This condition implies that the error correction signal $B \mathbf { e }$ lies within $9 0 °$ of $\mathbf { e } ^ { T } W$ , the error calculated by standard backpropagation.
|
| 36 |
+
|
| 37 |
+
We implement both algorithms in PyTorch for convolutional and fully-connected layers and post the code at https://github.com/willwx/sign-symmetry.
|
| 38 |
+
|
| 39 |
+
# 3 RESULTS
|
| 40 |
+
|
| 41 |
+
# 3.1 SIGN-SYMMETRY PERFORMS WELL ON IMAGENET
|
| 42 |
+
|
| 43 |
+
# TRAINING DETAILS
|
| 44 |
+
|
| 45 |
+
We trained ResNet-18 (He et al., 2016) on ImageNet using 5 different training settings: 1) backpropagation; 2) sign-symmetry for convolutional layers and backpropagation for the last, fully-connected layer; 3) sign-symmetry for all (convolutional and fully-connected) layers; 4) feedback alignment for convolutional layers and backpropagation for the fully-connected layer; and 5) feedback alignment for all (convolutional and fully-connected) layers. In sign-symmetry, at each backward step, feedback weights were taken as the signs of the feedforward weights, scaled by the same scale $\lambda$ used to initialize that layer.2 In feedback alignment, feedback weights were initialized once at the beginning as random variables from the same distribution used to initialize that layer. For backpropagation, standard training parameters were used (SGD with learning rate 0.1, momentum 0.9, and weight decay $1 0 ^ { - 4 }$ ). For ResNet-18 with other learning algorithms, we used SGD with learning rate $0 . 0 { \bar { 5 } } ^ { 3 }$ , while momentum and weight decay remain unchanged. For AlexNet with all learning algorithms, standard training parameters were used (SGD with learning rate 0.01, momentum 0.9, and weight decay $5 \times 1 0 ^ { - 4 }$ ). We used a version of AlexNet (Krizhevsky, 2014, as used in torchvision) which we slightly modified to add batch normalization (Ioffe & Szegedy, 2015) before every nonlinearity and consequently removed dropout. For all experiments, we used a batch size of 256, a learning rate decay of 10-fold every 10 epochs, and trained for 50 epochs.
|
| 46 |
+
|
| 47 |
+
# RESULTS
|
| 48 |
+
|
| 49 |
+

|
| 50 |
+
Figure 1: a, Top-1 and b, top-5 validation error on ImageNet for ResNet-18 and AlexNet trained with different learning algorithms. Dashed lines, ResNet-18 reference performance (Johnson et al., 2016). Sign-symmetry performed nearly as well as backpropagation, while feedback alignment performed better than previously reported when backpropagation was used to train the last layer.
|
| 51 |
+
|
| 52 |
+
In all cases, the network was able to learn (Figure 1, Table 1). Remarkably, sign-symmetry only slightly underperformed backpropagation in this benchmark large dataset, despite the fact that signsymmetry does not accurately propagate either the magnitude or the sign of the error gradient. Hence, this result is not predicted by the performance of signSGD (Bernstein et al., 2018), where weight updates use the sign of the gradients, but gradients are still calculate accurately; or XNORNet (Rastegari et al., 2016), where both feedforward and feedback weights are binary but symmetrical, so error backpropagation is still accurate. An intuitive explanation for this performance is that the skip-connections in ResNet help prevent the degradation of the gradient being passed through many layers of sign-symmetric feedback. However, sign-symmetry also performed similarly well
|
| 53 |
+
|
| 54 |
+
Table 1: ImageNet 1-crop validation accuracy of networks trained with different algorithms, all 50 epochs. BP: backpropagation; FA: feedback alignment; SS: sign-symmetry.
|
| 55 |
+
|
| 56 |
+
<table><tr><td>Architecture& Algorithm</td><td>Top-1 Val Error, %</td><td>Top-5 Val Error, %</td></tr><tr><td>ResNet-18,FA</td><td>90.52</td><td>77.32</td></tr><tr><td></td><td></td><td></td></tr><tr><td>ResNet-18,FA +last layer BP</td><td>73.01</td><td>51.24</td></tr><tr><td>ResNet-18, SS</td><td>37.91</td><td>16.18</td></tr><tr><td>ResNet-18,SS+last layer BP</td><td>37.01</td><td>15.44</td></tr><tr><td>ResNet-18,BP</td><td>33.14</td><td>12.49</td></tr><tr><td>AlexNet,FA</td><td>93.45</td><td>83.29</td></tr><tr><td>AlexNet, SS</td><td>47.57</td><td>23.68</td></tr><tr><td>AlexNet,BP</td><td>49.15</td><td>25.01</td></tr></table>
|
| 57 |
+
|
| 58 |
+
to backpropagation in a (modified) AlexNet architecture, which did not contain skip connections.
|
| 59 |
+
Therefore, skip-connections alone do not explain the performance of sign-symmetry.
|
| 60 |
+
|
| 61 |
+
In addition, although its performance was considerably worse, feedback alignment was still able to guide better learning in the network than reported by Bartunov et al. (2018, their Figure 3) if we use backpropagation in the last layer. This condition is not unreasonable since, in the brain, the classifier layer is likely not a soft-max classifier and may deliver error signals by a different mechanism. We also tested using backpropagation exclusively for the last layer in a network otherwise trained with sign-symmetry, but the effect on the performance was minimal. One possibility why sign-symmetry performed better than feedback alignment is that in sign-symmetry, the feedback weight always tracks the sign of the feedforward weight, which may reduce the burden on the feedforward weight to learn to align with the feedback weight.
|
| 62 |
+
|
| 63 |
+
Finally, in Liao et al. (2016b), Batch-Manhattan (BM) SGD was proposed as a way to stabilize training with asymmetric feedback algorithms. In our experience, standard SGD consistently worked better than BM for sign-symmetry, but BM may improve results for feedback alignment. We have not comprehensively characterized the effects of BM since many factors like learning rate can affect the outcome. Future experiments are needed to draw stronger conclusions.
|
| 64 |
+
|
| 65 |
+
# 3.2 MICROSOFT COCO DATASET
|
| 66 |
+
|
| 67 |
+
Besides the ImageNet classification task, we examined the performance of sign-symmetry on the MS COCO object detection task. Object detection is more complex than classification and might therefore require more complicated network architecture in order to achieve high accuracy. Thus, in this experiment we assessed the effectiveness of sign-symmetry in training networks that were more complicated and difficult to optimize.
|
| 68 |
+
|
| 69 |
+
# TRAINING DETAILS
|
| 70 |
+
|
| 71 |
+
We trained the state-of-the-art object detection network RetinaNet proposed by Lin et al. (2018) on the COCO trainval35k split, which consists of $8 0 \mathrm { k }$ images from train and $3 5 \mathrm { k }$ random images from the 40k-image val set. RetinaNet comprises a ResNet-FPN backbone, a classification subnet, and a bounding box regressing subnet. The network was trained with three different training settings: 1) backpropagation for all layers; 2) backpropagation for the last layer in both subnets and sign-symmetry for rest of the layers; 3) backpropagation for the last layer in both subnets and feedback alignment for rest of the layers. We used a backbone ResNet-18 pretrained on ImageNet to initialize the network. In all the experiments, the network was trained with SGD with an initial learning rate of 0.01, momentum of 0.9, and weight decay of 0.0001. We trained the network for 40k iterations with 8 images in each minibatch. The learning rate was divided by 10 at iteration 20k.
|
| 72 |
+
|
| 73 |
+
# RESULTS
|
| 74 |
+
|
| 75 |
+
The results on COCO are similar to those on ImageNet, although the performance gap between SS and BP on COCO is slightly more prominent (Figure 2). A number of factors could have potentially contributed to this result. We followed the Feature Pyramid Network (FPN) architecture design choices, optimizers, and hyperparameters reported by Lin et al. (2018); these choices are all optimized for use with backpropagation instead of sign-symmetry. Hence, the results here represent a lowerbound on the performance of sign-symmetry for training networks on the COCO dataset.
|
| 76 |
+
|
| 77 |
+

|
| 78 |
+
Figure 2: Training loss of RetinaNet on COCO dataset trained with 3 different settings: 1) backpropagation for all layers; 2) backpropagation for the last layer in both regression and classification subnets, and sign-symmetry for other layers; 3) backpropagation for the last layer in both subnets and feedback alignment for other layers. a, Object detection bounding box regression loss. b, Focal classification loss. c, Total loss.
|
| 79 |
+
|
| 80 |
+
# 4 DISCUSSION
|
| 81 |
+
|
| 82 |
+
# 4.1 COMPARING LEARNING IN SS, FA, AND BP
|
| 83 |
+
|
| 84 |
+
We ran a number of analyses to understand how sign-symmetry guides learning. Lillicrap et al. (2016) show that with feedback alignment, the alignment angles between feedforward and feedback weights gradually decrease because the feedforward weights learn to align with the feedback weights. We asked whether the same happens in sign-symmetry by computing alignment angles as in Lillicrap et al. (2016): For every pair of feedforward and feedback weight matrices, we flattened the matrices into vectors and computed the angle between the vectors. Interestingly, we found that during training, the alignment angles decreased for the last 3 layers but increased for the other layers (Figure 3a). In comparison, in the backpropagation-trained network (where $\mathrm { s i g n } ( W )$ was not used in any way), the analogous alignment angle between $W$ and $\mathrm { s i g n } ( W )$ increased for all layers. One possible explanation for the increasing trend is that as the training progresses, the feedforward weights tend to become sparse. Geometrically, this means that feedforward vectors become more aligned to the standard basis vectors and less aligned with the feedback weight vectors, which always lie on a diagonal by construction. This explanation is consistent with the similarly increasing trend of the average kurtosis of the feedforward weights (Figure 3b), which indicates that values of the weights became more dispersed during training.
|
| 85 |
+
|
| 86 |
+
Since the magnitudes of the feedforward weights were discarded when calculating the error gradients, we also looked at how sign-symmetry affected the size of the trained weights. Sign-symmetry and backpropagation resulted in weights with similar magnitudes (Figure 3c). More work is needed to elucidate how sign-symmetry guides efficient learning in the network.
|
| 87 |
+
|
| 88 |
+
# 4.2 WHY DO OUR RESULTS DIFFER FROM PREVIOUS WORK?
|
| 89 |
+
|
| 90 |
+
Our results indicate that biologically-plausible learning algorithms, specifically sign-symmetry and feedback alignment, are able to learn on ImageNet. This finding seemingly conflicts with the findings by Bartunov et al. (2018). Why do we come to such different conclusions?
|
| 91 |
+
|
| 92 |
+
First, Bartunov et al. did not test sign-symmetry, which is expected to be more powerful than feedback alignment, because it is a special case of feedback alignment that allows feedback weights to have additional information about feedforward weights. Indeed, on ImageNet, the performance of sign-symmetry approached that of backpropagation and exceeded the performance of feedback alignment by a wide margin. Another reason may be that instead of using standard ConvNets on ImageNet, Bartunov et al. only tested locally-connected networks. While the later is a more biologically plausible architecture, in practice, it is limited in size by the need to store separate weights for each spatial location. This reduced model capacity creates a bottleneck that may affect the performance of feedback alignment (see Lillicrap et al., 2016, Supplementary Note 9). Finally, the performance of feedback alignment also benefited from the use of backpropagation in the last layer in our conditions.
|
| 93 |
+
|
| 94 |
+

|
| 95 |
+
Figure 3: a, During training with sign-symmetry, alignment angles between feedforward weights $W$ and feedback weights $\mathrm { s i g n } ( W )$ decreased in the last 3 layers but increased in early layers, whereas during training with backpropagation, the analogous alignment angles increased for all layers and were overall larger. b, Kurtosis of the feedforward weight matrices increased during training. c, The magnitudes of weights trained by sign-symmetry were similar to those trained by backpropagation. Line and shading, mean $\pm$ std for epoch 50.
|
| 96 |
+
|
| 97 |
+
# 4.3 TOWARDS A MORE BIOLOGICALLY PLAUSIBLE LEARNING ALGORITHM
|
| 98 |
+
|
| 99 |
+
A major reason why backpropagation is considered implausible in the brain is that it requires exact symmetry of physically distinct feedforward and feedback pathways. Sign-symmetry and feedback alignment address this problem by relaxing this tight coupling of weights between separate pathways. Feedback alignment requires no relation at all between feedforward and feedback weights and simply depends on learning to align the two. Hence, it can be easily realized in the brain (for example, see Lillicrap et al., 2016, Supplementary Figure 3). However, empirically, we and others have found its performance to be not ideal on relatively challenging problems.
|
| 100 |
+
|
| 101 |
+
Sign-symmetry, on the other hand, introduces a mild constraint that feedforward and feedback connections be “antiparallel”: They need to have opposite directions but consistent signs. This can be achieved in the brain with two additional yet plausible conditions: First, the feedforward and feedback pathways must be specifically wired in this antiparallel way. This can be achieved by using chemical signals to guide specific targeting of axons, similar to how known mechanisms for specific wiring operate in the brain (McLaughlin & O’Leary, 2005; Huberman et al., 2008). One example scheme of how this can be achieved is shown in Figure 4. While the picture in Figure 4a is complex, most of the complexity comes from the fact that units in a ConvNet produce inconsistent outputs (i.e., both positive and negative). If the units are consistent (i.e., producing exclusively positive or negative outputs), the picture simplifies to Figure 4b. Neurons in the brain are observed to be consistent, as stated by the so-called “Dale’s Law” (Dale, 1935; Strata & Harvey, 1999). Hence, this constraint would have to be incorporated at some point in any biologically plausible network, and remains an important direction for future work. We want to remark that Figure 4 is meant to indicate the relative ease of wiring sign-symmetry in the brain (compared to, e.g., wiring a network capable of weight transport), not that the brain is known to be wired this way. Nevertheless, it represents a hypothesis that is falsifiable by experimental data, potentially in the near future.4
|
| 102 |
+
|
| 103 |
+
Related, a second desideratum is that weights should not change sign during training. While our current setting for sign-symmetry removes weight magnitude transport, it still implicitly relies on “sign transport.” However, in the brain, the sign of a connection weight depends on the type of the presynaptic neuron—e.g., glutamatergic (excitatory) or GABAergic (inhibitory)—a quality that is intrinsic to and stable for each neuron given existing evidence. Hence, if sign-symmetry is satisfied initially—for example, through specific wiring as just described—it will be satisfied throughout learning, and ”sign transport” will not be required. Thus, evaluating the capacity of sign-fixed networks to learn is another direction for future work.
|
| 104 |
+
|
| 105 |
+

|
| 106 |
+
Figure 4: The specific wiring required for sign-symmetric feedback can be achieved using axonal guidance by specific receptor-ligand recognition. Assume that an axon carrying ligand $L _ { X }$ will only synapse onto a downstream neuron carrying the corresponding receptor $R _ { X }$ . By expressing receptors and ligands in an appropriate pattern, an antiparallel wiring pattern can be established that supports sign-symmetric feedback. a, An example scheme. In this scheme, one inconsistent unit (i.e., a unit that produce both positive and negative outputs) in the network is implemented by three consistent biological neurons, so that each synapse is exclusively positive or negative. ninput neurons orthogonal ligand-receptor pairs is sufficient to implement all possible connection patterns. b, An example scheme for implementing a signsymmetric network with consistent units. Only 2 orthogonal ligand-receptor pairs are needed to implement all possible connectivities in this case. These schemes represent falsifiable hypotheses, although they do not exclude other possible implementations.
|
| 107 |
+
|
| 108 |
+
Another element of unclear biological reality, common to feedback alignment and sign-symmetry, is that the update of a synaptic connection (i.e., weight) between two feedforward neurons (A to B) depends on the activity in a third, feedback neuron C, whose activation represents the error of neuron B. One way it can be implemented biologically is for neuron C to connect to B with a constant and fixed weight. When C changes its value due to error feedback, it will directly induce a change of B’s electric potential and thus of the postsynaptic potential of the synapse between A and B, which might lead to either Long-term Potentiation (LTP) or Long-term Depression (LTD) of synapse A-B.
|
| 109 |
+
|
| 110 |
+
Biological plausibility of ResNet has been previously discussed by Liao & Poggio (2016), claiming that ResNet corresponds to an unrolled recurrent network in the visual cortex. However, it is unclear yet how backpropagation through time can be implemented in the brain. Biological plausibility of batch normalization has been discussed in Liao et al. (2016a), where they addressed the issues with online learning (i.e., one sample at a time, instead of minibatch), recurrent architecture and consistent training and testing normalization statistics.
|
| 111 |
+
|
| 112 |
+
Other biological constraints include removing weight-sharing in convolutional layers as in Bartunov et al. (2018), incorporating temporal dynamics as in Lillicrap et al. (2016), using realistic spiking neurons, addressing the sample inefficiency general to deep learning, etc. We believe that these are important yet independent issues to the problem of weight transport and that by removing the latter, we have taken a meaningful step toward biological plausibility. Nevertheless, many steps remain in the quest for a truly plausible, effective, and empirically-verified model of learning in the brain.
|
| 113 |
+
|
| 114 |
+
# 5 CONCLUSION
|
| 115 |
+
|
| 116 |
+
Recent work shows that biologically-plausible learning algorithms do not scale to challenging problems such as ImageNet. We evaluated sign-symmetry and re-evaluated feedback alignment on their effectiveness training ResNet and AlexNet on ImageNet and RetinaNet on MS COCO. We find that
|
| 117 |
+
|
| 118 |
+
1) sign-symmetry performed nearly as well as backpropagation on ImageNet, 2) slightly modified feedback alignment performed better than previously reported, and 3) both algorithms had reasonable performance on MS COCO with minimal hyperparameter tuning. Taken together, these results indicate that biologically-plausible learning algorithms, in particular sign-symmetry, remain promising options for training artificial neural networks and modeling learning in the brain.
|
| 119 |
+
|
| 120 |
+
# ACKNOWLEDGMENTS
|
| 121 |
+
|
| 122 |
+
This work was supported in part by the Center for Brains, Minds and Machines (CBMM), funded by NSF STC award CCF-1231216 and in part by C-BRIC, one of six centers in JUMP, a Semiconductor Research Corporation (SRC) program sponsored by DARPA, the National Science Foundation, Intel Corporation, and the DoD Vannevar Bush Fellowship. We gratefully acknowledge the support of NVIDIA Corporation with the donation of the DGX-1 used for this research.
|
| 123 |
+
|
| 124 |
+
# REFERENCES
|
| 125 |
+
|
| 126 |
+
Sergey Bartunov, Adam Santoro, Blake A Richards, Geoffrey E Hinton, and Timothy Lillicrap. Assessing the scalability of biologically-motivated deep learning algorithms and architectures. arXiv Preprint, 2018. URL https://arxiv.org/abs/1807.04587.
|
| 127 |
+
|
| 128 |
+
Jeremy Bernstein, Yu-Xiang Wang, Kamyar Azizzadenesheli, and Anima Anandkumar. signSGD: compressed optimisation for non-convex problems. CoRR, 2018. URL https://arxiv. org/abs/1802.04434.
|
| 129 |
+
|
| 130 |
+
Francis Crick. The recent excitement about neural networks. Nature, 337(6203):129–132, 1989. doi: 10.1038/337129a0.
|
| 131 |
+
|
| 132 |
+
Henry Dale. Pharmacology and Nerve-endings. (Walter Ernest Dixon Memorial Lecture): (Section of Therapeutics and Pharmacology). Proc. R. Soc. Med., 28(3):319–332, Jan 1935.
|
| 133 |
+
|
| 134 |
+
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, June 2009. doi: 10.1109/CVPR.2009.5206848.
|
| 135 |
+
|
| 136 |
+
Stephen Grossberg. Competitive learning: From interactive activation to adaptive resonance. Cognitive science, 11(1):23–63, 1987. doi: 10.1111/j.1551-6708.1987.tb00862.x.
|
| 137 |
+
|
| 138 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In 2016 IEEE Conference on Computer Vision and Pattern Recognition, pp. 770–778. IEEE, June 2016. doi: 10.1109/CVPR.2016.90.
|
| 139 |
+
|
| 140 |
+
Geoffrey E. Hinton. How to do backpropagation in a brain. Invited talk at the NIPS’2007 Deep Learning Workshop, 2007.
|
| 141 |
+
|
| 142 |
+
Andrew D. Huberman, Marla B. Feller, and Barbara Chapman. Mechanisms underlying development of visual maps and receptive fields. Annu. Rev. Neurosci., 31(1):479–509, July 2008. doi: 10.1146/annurev.neuro.31.060407.125533.
|
| 143 |
+
|
| 144 |
+
Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In Proc. 32nd ICML - Volume 37, ICML’15, pp. 448–456. JMLR.org, 2015. URL http://dl.acm.org/citation.cfm?id=3045118. 3045167.
|
| 145 |
+
|
| 146 |
+
Viren Jain and Michal Januszewski. Improving connectomics by an order of magnitude. https: //ai.googleblog.com/2018/07/improving-connectomics-by-order-of. html, July 2018. Accessed: 2018-11-21.
|
| 147 |
+
|
| 148 |
+
Michał Januszewski, Jorgen Kornfeld, Peter H Li, Art Pope, Tim Blakely, Larry Lindsey, Jeremy ¨ Maitin-Shepard, Mike Tyka, Winfried Denk, and Viren Jain. High-precision automated reconstruction of neurons with flood-filling networks. Nature methods, 15(8):605, July 2018. doi: 10.1038/s41592-018-0049-4.
|
| 149 |
+
|
| 150 |
+
Justin Johnson, Max Lapan, Peter G Ericson, Valentin, and Dmitry Ulyanov. CNN benchmarks. https://github.com/jcjohnson/cnn-benchmarks#resnet-cvpr, 2016. Accessed: 2018-11-24.
|
| 151 |
+
|
| 152 |
+
Alex Krizhevsky. One weird trick for parallelizing convolutional neural networks. CoRR, 2014. URL http://arxiv.org/abs/1404.5997.
|
| 153 |
+
|
| 154 |
+
Qianli Liao and Tomaso Poggio. Bridging the gaps between residual learning, recurrent neural networks and visual cortex. arXiv preprint arXiv:1604.03640, 2016.
|
| 155 |
+
|
| 156 |
+
Qianli Liao, Kenji Kawaguchi, and Tomaso Poggio. Streaming normalization: Towards simpler and more biologically-plausible normalizations for online and recurrent learning. arXiv preprint arXiv:1610.06160, 2016a.
|
| 157 |
+
|
| 158 |
+
Qianli Liao, Joel Z Leibo, and Tomaso Poggio. How important is weight symmetry in backpropagation? In Proceedings of the Thirtieth AAAI Conference on Artificial Intelligence, pp. 1837– 1844. AAAI Press, 2016b. URL http://dl.acm.org/citation.cfm?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ 3016100. 3016156.
|
| 159 |
+
|
| 160 |
+
Timothy P. Lillicrap, Daniel Cownden, Douglas B. Tweed, and Colin J. Akerman. Random synaptic feedback weights support error backpropagation for deep learning. Nature Communications, 7, 2016. doi: 10.1038/ncomms13276.
|
| 161 |
+
|
| 162 |
+
Tsung-Yi Lin, Priyal Goyal, Ross Girshick, Kaiming He, and Piotr Dollar. Focal loss for dense ´ object detection. IEEE transactions on pattern analysis and machine intelligence, 2018. doi: 10.1109/TPAMI.2018.2858826.
|
| 163 |
+
|
| 164 |
+
James H. Marshel, Marina E. Garrett, Ian Nauhaus, and Edward M. Callaway. Functional specialization of seven mouse visual cortical areas. Neuron, 72(6):1040–1054, 2011. doi: 10.1016/j.neuron.2011.11.013.
|
| 165 |
+
|
| 166 |
+
Todd McLaughlin and Dennis DM O’Leary. Molecular gradients and development of retinotopic maps. Annu. Rev. Neurosci., 28:327–355, 2005. doi: 10.1146/annurev.neuro.28.061604.135714.
|
| 167 |
+
|
| 168 |
+
Tomaso Poggio, Hrushikesh Mhaskar, Lorenzo Rosasco, Brando Miranda, and Qianli Liao. Why and when can deep-but not shallow-networks avoid the curse of dimensionality: a review. International Journal of Automation and Computing, 14(5):503–519, October 2017. doi: 10.1007/ s11633-017-1054-2.
|
| 169 |
+
|
| 170 |
+
Mohammad Rastegari, Vicente Ordonez, Joseph Redmon, and Ali Farhadi. XNOR-Net: Imagenet classification using binary convolutional neural networks. CoRR, 2016. URL https: //arxiv.org/abs/1603.05279.
|
| 171 |
+
|
| 172 |
+
Helene Schmidt, Anjali Gour, Jakob Straehle, Kevin M Boergens, Michael Brecht, and Moritz Helmstaedter. Axonal synapse sorting in medial entorhinal cortex. Nature, 549(7673):469, 2017. doi: 10.1038/nature24005.
|
| 173 |
+
|
| 174 |
+
Martin Schrimpf, Jonas Kubilius, Ha Hong, Najib J. Majaj, Rishi Rajalingham, Elias B. Issa, Kohitij Kar, Pouya Bashivan, Jonathan Prescott-Roy, Kailyn Schmidt, Daniel L. K. Yamins, and James J. DiCarlo. Brain-score: Which artificial neural network for object recognition is most brain-like? bioRxiv, 2018. URL https://www.biorxiv.org/content/early/2018/ 09/05/407007.
|
| 175 |
+
|
| 176 |
+
Piergiorgio Strata and Robin Harvey. Dale’s principle. Brain Research Bulletin, 50(5):349–350, 1999. ISSN 0361-9230. doi: 10.1016/S0361-9230(99)00100-8.
|
| 177 |
+
|
| 178 |
+
Daniel L. K. Yamins, Ha Hong, Charles F. Cadieu, Ethan A. Solomon, Darren Seibert, and James J. DiCarlo. Performance-optimized hierarchical models predict neural responses in higher visual cortex. Proc. Natl. Acad. Sci. U.S.A, 111(23):8619–8624, 2014. ISSN 0027-8424. doi: 10.1073/ pnas.1403112111.
|
md/train/SyxeqhP9ll/SyxeqhP9ll.md
ADDED
|
@@ -0,0 +1,468 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# CALIBRATING ENERGY-BASED GENERATIVE ADVERSARIAL NETWORKS
|
| 2 |
+
|
| 3 |
+
Zihang $\mathbf { D a i } ^ { 1 }$ , Amjad Almahairi2∗, Philip Bachman3, Eduard Hovy1 & Aaron Courville2
|
| 4 |
+
|
| 5 |
+
1 Language Technologies Institute, Carnegie Mellon University.
|
| 6 |
+
2 MILA, Universite de Montr ´ eal. ´
|
| 7 |
+
3 Maluuba Research.
|
| 8 |
+
|
| 9 |
+
# ABSTRACT
|
| 10 |
+
|
| 11 |
+
In this paper we propose equipping Generative Adversarial Networks with the ability to produce direct energy estimates for samples. Specifically, we develop a flexible adversarial training framework, and prove this framework not only ensures the generator converges to the true data distribution, but also enables the discriminator to retain the density information at the global optimum. We derive the analytic form of the induced solution, and analyze its properties. In order to make the proposed framework trainable in practice, we introduce two effective approximation techniques. Empirically, the experiment results closely match our theoretical analysis, verifying that the discriminator is able to recover the energy of data distribution.
|
| 12 |
+
|
| 13 |
+
# 1 INTRODUCTION
|
| 14 |
+
|
| 15 |
+
Generative Adversarial Networks (GANs) (Goodfellow et al., 2014) represent an important milestone on the path towards more effective generative models. GANs cast generative model training as a minimax game between a generative network (generator), which maps a random vector into the data space, and a discriminative network (discriminator), whose objective is to distinguish generated samples from real samples. Multiple researchers Radford et al. (2015); Salimans et al. (2016); Zhao et al. (2016) have shown that the adversarial interaction with the discriminator can result in a generator that produces compelling samples. The empirical successes of the GAN framework were also supported by the theoretical analysis of Goodfellow et al., who showed that, under certain conditions, the distribution produced by the generator converges to the true data distribution, while the discriminator converges to a degenerate uniform solution.
|
| 16 |
+
|
| 17 |
+
While GANs have excelled as compelling sample generators, their use as general purpose probabilistic generative models has been limited by the difficulty in using them to provide density estimates or even unnormalized energy values for sample evaluation.
|
| 18 |
+
|
| 19 |
+
It is tempting to consider the GAN discriminator as a candidate for providing this sort of scoring function. Conceptually, it is a trainable sample evaluation mechanism that – owing to GAN training paradigm – could be closely calibrated to the distribution modeled by the generator. If the discriminator could retain fine-grained information of the relative quality of samples, measured for instance by probability density or unnormalized energy, it could be used as an evaluation metric. Such data-driven evaluators would be highly desirable for problems where it is difficult to define evaluation criteria that correlate well with human judgment. Indeed, the real-valued discriminator of the recently introduced energy-based GANs Zhao et al. (2016) might seem like an ideal candidate energy function. Unfortunately, as we will show, the degenerate fate of the GAN discriminator at the optimum equally afflicts the energy-based GAN of Zhao et al..
|
| 20 |
+
|
| 21 |
+
In this paper we consider the questions: (i) does there exists an adversarial framework that induces a non-degenerate discriminator, and (ii) if so, what form will the resulting discriminator take? We introduce a novel adversarial learning formulation, which leads to a non-degenerate discriminator while ensuring the generator distribution matches the data distribution at the global optimum. We derive a general analytic form of the optimal discriminator, and discuss its properties and their relationship to the specific form of the training objective. We also discuss the connection between the proposed formulation and existing alternatives such as the approach of Kim & Bengio (2016). Finally, for a specific instantiation of the general formulation, we investigate two approximation techniques to optimize the training objective, and verify our results empirically.
|
| 22 |
+
|
| 23 |
+
# 2 RELATED WORK
|
| 24 |
+
|
| 25 |
+
Following a similar motivation, the field of Inverse Reinforcement Learning (IRL) $\mathrm { N g }$ & Russell, 2000) has been exploring ways to recover the “intrinsic” reward function (analogous to the discriminator) from observed expert trajectories (real samples). Taking this idea one step further, apprenticeship learning or imitation learning (Abbeel & $\mathrm { N g }$ , 2004; Ziebart et al., 2008) aims at learning a policy (analogous to the generator) using the reward signals recovered by IRL. Notably, Ho & Ermon draw a connection between imitation learning and GAN by showing that the GAN formulation can be derived by imposing a specific regularization on the reward function. Also, under a special case of their formulation, Ho & Ermon provide a duality-based interpretation of the problem, which inspires our theoretical analysis. However, as the focus of (Ho & Ermon, 2016) is only on the policy, the authors explicitly propose to bypass the intermediate IRL step, and thus provide no analysis of the learned reward function.
|
| 26 |
+
|
| 27 |
+
The GAN models most closely related to our proposed framework are energy-based GAN models of Zhao et al. (2016) and Kim & Bengio (2016). In the next section, We show how one can derive both of these approaches from different assumptions regarding regularization of the generative model.
|
| 28 |
+
|
| 29 |
+
# 3 ALTERNATIVE FORMULATION OF ADVERSARIAL TRAINING
|
| 30 |
+
|
| 31 |
+
# 3.1 BACKGROUND
|
| 32 |
+
|
| 33 |
+
Before presenting the proposed formulation, we first state some basic assumptions required by the analysis, and introduce notations used throughout the paper.
|
| 34 |
+
|
| 35 |
+
Following the original work on GANs (Goodfellow et al., 2014), our analysis focuses on the nonparametric case, where all models are assumed to have infinite capacities. While many of the nonparametric intuitions can directly transfer to the parametric case, we will point out cases where this transfer fails. We assume a finite data space throughout the analysis, to avoid technical machinery out of the scope of this paper. Our results, however, can be extended to continuous data spaces, and our experiments are indeed performed on continuous data.
|
| 36 |
+
|
| 37 |
+
Let $\mathcal { X }$ be the data space under consideration, and $\begin{array} { r } { \mathcal { P } = \{ p \ | \ p ( x ) \ge 0 , \forall x \in \mathcal { X } , \sum _ { x \in \mathcal { X } } p ( x ) = 1 \} } \end{array}$ be the set of all proper distributions defined on $\mathcal { X }$ . Then, $p _ { \mathrm { d a t a } } \in \mathcal { P } : \mathcal { X } \mapsto \mathbb { R }$ and $p _ { \mathrm { g e n } } \in \mathcal { P } :$ $\mathcal { X } \mapsto \mathbb { R }$ will denote the true data distribution and the generator distribution. $\mathbb { E } _ { x \sim p } f ( x )$ denotes the expectation of the quantity $f ( x )$ w.r.t. $x$ drawn from $p$ . Finally, the term “discriminator” will refer to any structure that provides training signals to the generator based on some measure of difference between the generator distribution and the real data distribution, which which includes but is not limited to $f$ -divergence.
|
| 38 |
+
|
| 39 |
+
# 3.2 PROPOSED FORMULATION
|
| 40 |
+
|
| 41 |
+
In order to understand the motivation of the proposed approach, it is helpful to analyze the optimization dynamics near convergence in GANs first.
|
| 42 |
+
|
| 43 |
+
When the generator distribution matches the data distribution, the training signal (gradient) w.r.t. the discriminator vanishes. At this point, assume the discriminator still retains density information, and views some samples as more real and others as less. This discriminator will produce a training signal (gradient) w.r.t. the generator, pushing the generator to generate samples that appear more real to the discriminator. Critically, this training signal is the sole driver of the generator’s training. Hence, the generator distribution will diverge from the data distribution. In other words, as long as the discriminator retains relative density information, the generator distribution cannot stably match the data distribution. Thus, in order to keep the generator stationary as the data distribution, the discriminator must assign flat (exactly the same) density to all samples at the optimal.
|
| 44 |
+
|
| 45 |
+
From the analysis above, the fundamental difficulty is that the generator only receives a single training signal (gradient) from the discriminator, which it has to follow. To keep the generator stationary, this single training signal (gradient) must vanish, which requires a degenerate discriminator. In this work, we propose to tackle this single training signal constraint directly. Specifically, we introduce a novel adversarial learning formulation which incorporates an additional training signal to the generator, such that this additional signal can
|
| 46 |
+
|
| 47 |
+
• balance (cancel out) the discriminator signal at the optimum, so that the generator can stay stationary even if the discriminator assigns non-flat density to samples • cooperate with the discriminator signal to make sure the generator converges to the data distribution, and the discriminator retains the correct relative density information
|
| 48 |
+
|
| 49 |
+
The proposed formulation can be written as the following minimax training objective,
|
| 50 |
+
|
| 51 |
+
$$
|
| 52 |
+
\operatorname* { m a x } _ { c } \operatorname* { m i n } _ { p _ { \mathrm { g e n } } \in \mathcal { P } } \quad \underset { x \sim p _ { \mathrm { g e n } } } { \mathbb { E } } \left[ c ( x ) \right] - \underset { x \sim p _ { \mathrm { d a t a } } } { \mathbb { E } } \left[ c ( x ) \right] + K ( p _ { \mathrm { g e n } } ) ,
|
| 53 |
+
$$
|
| 54 |
+
|
| 55 |
+
where $c ( x ) : \mathcal { X } \mapsto \mathbb { R }$ is the discriminator that assigns each data point an unbounded scalar cost, and $K ( p _ { \mathrm { g e n } } ) : \mathcal { P } \mapsto \mathbb { R }$ is some (functionally) differentiable, convex function of $p _ { \mathrm { g e n } }$ . Compared to the original GAN, despite the similar minimax surface form, the proposed fomulation has two crucial distinctions.
|
| 56 |
+
|
| 57 |
+
Firstly, while the GAN discriminator tries to distinguish “fake” samples from real ones using binary classification, the proposed discriminator achieves that by assigning lower cost to real samples and higher cost to “fake” one. This distinction can be seen from the first two terms of Eqn. (1), where the discriminator $c ( x )$ is trained to widen the expected cost gap between “fake” and real samples, while the generator is adversarially trained to minimize it. In addition to the different adversarial mechanism, a calibrating term $K ( p _ { \mathrm { g e n } } )$ is introduced to provide a countervailing source of training signal for $p _ { \mathrm { g e n } }$ as we motivated above. For now, the form of $K ( p _ { \mathrm { g e n } } )$ has not been specified. But as we will see later, its choice will directly decide the form of the optimal discriminator $c ^ { * } ( x )$ .
|
| 58 |
+
|
| 59 |
+
With the specific optimization objective, we next provide theoretical characterization of both the generator and the discriminator at the global optimum.
|
| 60 |
+
|
| 61 |
+
Define $L ( p _ { \mathrm { g e n } } , c ) = \mathbb { E } _ { \boldsymbol { x } \sim p _ { \mathrm { g e n } } } \left[ c ( \boldsymbol { x } ) \right] - \mathbb { E } _ { \boldsymbol { x } \sim p _ { \mathrm { d a t a } } } \left[ c ( \boldsymbol { x } ) \right] + K ( p _ { \mathrm { g e n } } )$ , then $L ( p _ { \mathrm { g e n } } , c )$ is the Lagrange dual function of the following optimization problem
|
| 62 |
+
|
| 63 |
+
$$
|
| 64 |
+
\begin{array} { r l } { \underset { p _ { \mathrm { g e n } } \in \mathcal { P } } { \operatorname* { m i n } } } & { K ( p _ { \mathrm { g e n } } ) } \\ { \mathrm { s . t . } } & { p _ { \mathrm { g e n } } ( x ) - p _ { \mathrm { d a t a } } ( x ) = 0 , \forall x \in \mathcal { X } } \end{array}
|
| 65 |
+
$$
|
| 66 |
+
|
| 67 |
+
where $c ( x ) , \forall x$ appears in $L ( p _ { \mathrm { g e n } } , c )$ as the dual variables introduced for the equality constraints. This duality relationship has been observed previously in (Ho & Ermon, 2016, equation (7)) under the adversarial imitation learning setting. However, in their case, the focus was fully on the generator side (induced policy), and no analysis was provided for the discriminator (reward function).
|
| 68 |
+
|
| 69 |
+
In order to characterize $c ^ { * }$ , we first expand the set constraint on $p _ { \mathrm { g e n } }$ into explicit equality and inequality constraints:
|
| 70 |
+
|
| 71 |
+
$$
|
| 72 |
+
\begin{array} { r l } { \displaystyle \underset { p _ { \mathrm { g e n } } } { \mathrm { m i n } } } & { K ( p _ { \mathrm { g e n } } ) } \\ { \mathrm { s . t . } } & { p _ { \mathrm { g e n } } ( x ) - p _ { \mathrm { d a t a } } ( x ) = 0 , \forall x } \\ & { - p _ { \mathrm { g e n } } ( x ) \leq 0 , \forall x } \\ & { \displaystyle \sum _ { x \in \mathcal { X } } p _ { \mathrm { g e n } } ( x ) - 1 = 0 . } \end{array}
|
| 73 |
+
$$
|
| 74 |
+
|
| 75 |
+
Notice that $K ( p _ { \mathrm { g e n } } )$ is a convex function of $p _ { \mathrm { g e n } } ( x )$ by definition, and both the equality and inequality constraints are affine functions of $p _ { \mathrm { g e n } } ( x )$ . Thus, problem (2) is a convex optimization problem. What’s more, since (i) $\mathrm { d o m } _ { K }$ is open, and (ii) there exists a feasible solution $p _ { \mathrm { g e n } } = p _ { \mathrm { d a t a } }$ to (3), by the refined Slater’s condition (Boyd $\&$ Vandenberghe, 2004, page 226), we can further verify that strong duality holds for (3). With strong duality, a typical approach to characterizing the optimal solution is to apply the Karush-Kuhn-Tucker (KKT) conditions, which gives rise to this theorem:
|
| 76 |
+
|
| 77 |
+
Proposition 3.1. By the KKT conditions of the convex problem (3), at the global optimum, the optimal generator distribution $p _ { g e n } ^ { * }$ matches the true data distribution $p _ { d a t a }$ , and the optimal discriminator $c ^ { * } ( x )$ has the following form:
|
| 78 |
+
|
| 79 |
+
$$
|
| 80 |
+
c ^ { * } ( x ) = - \frac { \partial K ( p _ { g e n } ) } { \partial p _ { g e n } ( x ) } \bigg | _ { p _ { g e n } = p _ { d a t a } } - \lambda ^ { * } + \mu ^ { * } ( x ) , \forall x \in \mathcal { X } ,
|
| 81 |
+
$$
|
| 82 |
+
|
| 83 |
+
$$
|
| 84 |
+
w h e r e \quad \mu ^ { * } ( x ) = \left\{ \begin{array} { l l } { 0 , } & { p _ { d a t a } ( x ) > 0 } \\ { u _ { x } , } & { p _ { d a t a } ( x ) = 0 } \end{array} , \right.
|
| 85 |
+
$$
|
| 86 |
+
|
| 87 |
+
The detailed proof of proposition 3.1 is provided in appendix A.1. From (4), we can see the exact form of the optimal discriminator depends on the term $K ( p _ { \mathrm { g e n } } )$ , or more specifically its gradient. But, before we instantiate $K ( p _ { \mathrm { g e n } } )$ with specific choices and show the corresponding forms of $c ^ { * } ( x )$ , we first discuss some general properties of $c ^ { * } ( x )$ that do not depend on the choice of $K$ .
|
| 88 |
+
|
| 89 |
+
Weak Support Discriminator. As part of the optimal discriminator function, the term $\mu ^ { * } ( x )$ plays the role of support discriminator. That is, it tries to distinguish the support of the data distribution, i.e. $\bar { \mathrm { S U P P } } ( p _ { \mathrm { d a t a } } ) ~ = ~ \{ x ~ \in ~ \mathcal { X } ~ | ~ \ p _ { \mathrm { d a t a } } ( x ) ~ > ~ 0 \}$ , from its complement set with zeroprobability, i.e. $\operatorname { S U P P } ( p _ { \mathrm { d a t a } } ) ^ { \complement } = \{ x \in \mathcal { X } \mid p _ { \mathrm { d a t a } } ( x ) = 0 \}$ . Specifically, for any $x \in { \mathrm { ~ S U P P } } ( p _ { \mathrm { d a t a } } )$ and $x ^ { \prime } \in \mathsf { s u p p } ( p _ { \mathrm { d a t a } } ) ^ { \complement }$ , it is guaranteed that $\mu ^ { * } ( x ) \leq \mu ^ { * } ( x ^ { \prime } )$ . However, because $\mu ^ { * } ( \cdot )$ is underdetermined, there is nothing preventing the inequality from degenerating into an equality. Therefore, we name it the weak support discriminator. But, in all cases, $\bar { \mu ^ { * } } ( \cdot )$ assigns zero cost to all data points within the support. As a result, it does not possess any fine-grained density information inside of the data support. It is worth pointing out that, in the parametric case, because of the smoothness and the generalization properties of the parametric model, the learned discriminator may generalize beyond the data support.
|
| 90 |
+
|
| 91 |
+
Global Bias. In (4), the term $\lambda ^ { * }$ is a scalar value shared for all $x$ . As a result, it does not affect the relative cost among data points, and only serves as a global bias for the discriminator function.
|
| 92 |
+
|
| 93 |
+
Having discussed general properties, we now consider some specific cases of the convex function $K$ , and analyze the resulting optimal discriminator $c ^ { * } ( x )$ in detail.
|
| 94 |
+
|
| 95 |
+
1. First, let us consider the case where $K$ is the negative entropy of the generator distribution, i.e. $K ( p _ { \mathrm { g e n } } ) = - H ( p _ { \mathrm { g e n } } )$ . Taking the derivative of the negative entropy w.r.t. $p _ { \mathrm { g e n } } ( x )$ , we have
|
| 96 |
+
|
| 97 |
+
$$
|
| 98 |
+
c _ { \mathrm { e n t } } ^ { * } ( x ) = - \log p _ { \mathrm { d a t a } } ( x ) - 1 - \lambda ^ { * } + \mu ^ { * } ( x ) , \forall x \in \mathcal { X } ,
|
| 99 |
+
$$
|
| 100 |
+
|
| 101 |
+
where $\mu ^ { * } ( x )$ and $\lambda ^ { * }$ have the same definitions as in (4).
|
| 102 |
+
|
| 103 |
+
Up to a constant, this form of $c _ { \mathrm { e n t } } ^ { * } ( x )$ is exactly the energy function of the data distribution $p _ { \mathrm { d a t a } } ( x )$ . This elegant result has deep connections to several existing formulations, which include max-entropy imitation learning (Ziebart et al., 2008) and the directed-generator-trained energybased model (Kim & Bengio, 2016). The core difference is that these previous formulations are originally derived from maximum-likelihood estimation, and thus the minimax optimization is only implicit. In contrast, with an explicit minimax formulation we can develop a better understanding of the induced solution. For example, the global bias $\lambda ^ { * }$ suggests that there exists more than one stable equilibrium the optimal discriminator can actually reach. Further, $\mu ^ { * } ( x )$ can be understood as a support discriminator that poses extra cost on generator samples which fall in zero-probability regions of data space.
|
| 104 |
+
|
| 105 |
+
2. When $\begin{array} { r } { K ( p _ { \mathrm { g e n } } ) = \frac { 1 } { 2 } \sum _ { x \in \mathcal { X } } p _ { \mathrm { g e n } } ( x ) ^ { 2 } = \frac { 1 } { 2 } \| p _ { \mathrm { g e n } } \| _ { 2 } ^ { 2 } } \end{array}$ , which can be understood as posing $\ell _ { 2 }$ regularization on $p _ { \mathrm { g e n } }$ , we have $\frac { \partial K ( p _ { \mathrm { g e n } } ) } { \partial p _ { \mathrm { g e n } } ( x ) } \big | _ { p _ { \mathrm { g e n } } = p _ { \mathrm { d a t a } } } = p _ { \mathrm { d a t a } } ( x )$ , and it follows
|
| 106 |
+
|
| 107 |
+
$$
|
| 108 |
+
c _ { \ell _ { 2 } } ^ { * } ( x ) = - p _ { \mathrm { d a t a } } ( x ) - \lambda ^ { * } + \mu ^ { * } ( x ) , \forall x \in \mathcal { X } ,
|
| 109 |
+
$$
|
| 110 |
+
|
| 111 |
+
with $\mu ^ { * } ( x ) , \lambda ^ { * }$ similarly defined as in (4).
|
| 112 |
+
|
| 113 |
+
Surprisingly, the result suggests that the optimal discriminator $c _ { \ell _ { 2 } } ^ { * } ( x )$ directly recovers the negative probability $- p _ { \mathrm { d a t a } } ( x )$ , shifted by a constant. Thus, similar to the entropy solution (5), it fully retains the relative density information of data points within the support.
|
| 114 |
+
|
| 115 |
+
However, because of the under-determined term $\mu ^ { * } ( x )$ , we cannot recover the distribution density $p _ { \mathrm { d a t a } }$ exactly from either $c _ { \ell _ { 2 } } ^ { * }$ or $c _ { \mathrm { e n t } } ^ { * }$ if the data support is finite. Whether this ambiguity can be resolved is beyond the scope of this paper, but poses an interesting research problem.
|
| 116 |
+
|
| 117 |
+
3. Finally, let’s consider consider a degenerate case, where $K ( p _ { \mathrm { g e n } } )$ is a constant. That is, we dont provide any additional training signal for pgen at all. With $K \mathsf { ( } p _ { \mathsf { g e n } } ) =$ const, we simply have
|
| 118 |
+
|
| 119 |
+
$$
|
| 120 |
+
c _ { \mathrm { c s t } } ^ { * } ( x ) = \lambda ^ { * } + \mu ^ { * } ( x ) , \forall x \in \mathcal { X } ,
|
| 121 |
+
$$
|
| 122 |
+
|
| 123 |
+
whose discriminative power is fully controlled by the weak support discriminator $\mu ^ { * } ( x )$ . Thus, it follows that $c _ { \mathrm { { c s t } } } ^ { * } ( x )$ won’t be able to discriminate data points within the support of $p _ { \mathrm { d a t a } }$ , and its power to distinguish data from $\operatorname { S U P P } ( p _ { \mathrm { d a t a } } )$ and $\mathrm { S U P P } ( p _ { \mathrm { d a t a } } ) ^ { \complement }$ is weak. This closely matches the intuitive argument in the beginning of this section.
|
| 124 |
+
|
| 125 |
+
Note that when $K ( p _ { \mathrm { g e n } } )$ is a constant, the objective function (1) simplifies to:
|
| 126 |
+
|
| 127 |
+
$$
|
| 128 |
+
\operatorname* { m a x } _ { c } \operatorname* { m i n } _ { p _ { \mathrm { g e n } } \in \mathcal { P } } ~ \operatorname* { \mathbb { E } } _ { x \sim p _ { \mathrm { g e n } } } \big [ c ( x ) \big ] - \operatorname* { \mathbb { E } } _ { x \sim p _ { \mathrm { d a t a } } } \big [ c ( x ) \big ] ,
|
| 129 |
+
$$
|
| 130 |
+
|
| 131 |
+
which is very similar to the EBGAN objective (Zhao et al., 2016, equation (2) and (4)). As we show in appendix A.2, compared to the objective in (8), the EBGAN objective puts extra constraints on the allowed discriminator function. In spite of that, the EBGAN objective suffers from the single-training-signal problem and does not guarantee that the discriminator will recover the real energy function (see appendix A.2 for detailed analysis).
|
| 132 |
+
|
| 133 |
+
As we finish the theoretical analysis of the proposed formulation, we want to point out that simply adding the same term $K ( p _ { \mathrm { g e n } } )$ to the original GAN formulation will not lead to both a generator that matches the data distribution, and a discriminator that retains the density information (see appendix A.3 for detailed analysis).
|
| 134 |
+
|
| 135 |
+
# 4 PARAMETRIC INSTANTIATION WITH ENTROPY APPROXIMATION
|
| 136 |
+
|
| 137 |
+
While the discussion in previous sections focused on the non-parametric case, in practice we are limited to a finite amount of data, and the actual problem involves high dimensional continuous spaces. Thus, we resort to parametric representations for both the generator and the discriminator. In order to train the generator using standard back-propagation, we do not parametrize the generator distribution directly. Instead, we parametrize a directed generator network that transforms random noise $z \sim p _ { z } ( z )$ to samples from a continuous data space $\mathbb { R } ^ { n }$ . Consequently, we don’t have analytical access to the generator distribution, which is defined implicitly by the generator network’s noise data mapping. However, the regularization term $K ( p _ { \mathrm { g e n } } )$ in the training objective (1) requires the generator distribution. Faced with this problem, we focus on the max-entropy formulation, and exploit two different approximations of the regularization term $K ( p _ { \mathrm { g e n } } ) = - H \bar { ( p _ { \mathrm { g e n } } ) }$ .
|
| 138 |
+
|
| 139 |
+
# 4.1 NEAREST-NEIGHBOR ENTROPY GRADIENT APPROXIMATION
|
| 140 |
+
|
| 141 |
+
The first proposed solution is built upon an intuitive interpretation of the entropy gradient. Firstly, since we construct $p _ { \mathrm { g e n } }$ by applying a deterministic, differentiable transform $g _ { \theta }$ to samples $z$ from a fixed distribution $p _ { z }$ , we can write the gradient of $H ( p _ { \mathrm { g e n } } )$ with respect to the generator parameters $\theta$ as follows:
|
| 142 |
+
|
| 143 |
+
$$
|
| 144 |
+
- \nabla _ { \theta } H ( p _ { \mathrm { g e n } } ) = \mathbb { E } _ { z \sim p _ { z } } \left[ \nabla _ { \theta } \log p _ { \mathrm { g e n } } ( g _ { \theta } ( z ) ) \right] = \mathbb { E } _ { z \sim p _ { z } } \left[ { \frac { \partial g _ { \theta } ( z ) } { \partial \theta } } { \frac { \partial \log p _ { \mathrm { g e n } } ( g _ { \theta } ( z ) ) } { \partial g _ { \theta } ( z ) } } \right] ,
|
| 145 |
+
$$
|
| 146 |
+
|
| 147 |
+
where the first equality relies on the “reparametrization trick”. Equation 9 implies that, if we can compute the gradient of the generator log-density $\log p _ { \mathrm { g e n } } ( x )$ w.r.t. any $x = g _ { \theta } ( z )$ , then we can directly construct the Monte-Carlo estimation of the entropy gradient $\nabla _ { \boldsymbol { \theta } } H ( p _ { \mathrm { g e n } } )$ using samples from the generator.
|
| 148 |
+
|
| 149 |
+
Intuitively, for any generated data $x = g _ { \theta } ( z )$ , the term $\frac { \partial \log p _ { \mathrm { g e n } } ( x ) } { \partial x }$ essentially describes the direction of local change in the sample space that will increase the log-density. Motivated by this intuition, we propose to form a local Gaussian approximation $p _ { \mathrm { g e n } } ^ { i }$ of $p _ { \mathrm { g e n } }$ around each point $x _ { i }$ in a batch of samples $\{ x _ { 1 } , . . . , x _ { n } \}$ from the generator, and then compute the gradient ∂ log pgen(xi) based on the
|
| 150 |
+
|
| 151 |
+
Gaussian approximation. Specifically, each local Gaussian approximation $p _ { \mathrm { g e n } } ^ { i }$ is formed by finding the $k$ nearest neighbors of $x _ { i }$ in the batch $\{ x _ { 1 } , . . . , x _ { n } \}$ , and then placing an isotropic Gaussian distribution at their mean (i.e. maximimum likelihood). Based on the isotropic Gaussian approximation, the resulting gradient has the following form
|
| 152 |
+
|
| 153 |
+
$$
|
| 154 |
+
\frac { \partial \log p _ { \mathrm { g e n } } ( x _ { i } ) } { \partial x _ { i } } \approx \mu _ { i } - x _ { i } , \quad \mathrm { ~ w h e r e ~ } \mu _ { i } = \frac { 1 } { k } \sum _ { x ^ { \prime } \in \mathrm { K N N } ( x _ { i } ) } x ^ { \prime } \mathrm { ~ i s ~ t h e ~ m e a n ~ o f ~ t h e ~ G a u s s i a n }
|
| 155 |
+
$$
|
| 156 |
+
|
| 157 |
+
Finally, note the scale of this gradient approximation may not be reliable. To fix this problem, we normalize the approximated gradient into unit norm, and use a single hyper-parameter to model the scale for all $x$ , leading to the following entropy gradient approximation
|
| 158 |
+
|
| 159 |
+
$$
|
| 160 |
+
- \nabla _ { \theta } H ( p _ { \mathrm { g e n } } ) \approx \alpha \frac { 1 } { k } \sum _ { x _ { i } = g _ { \theta } ( z _ { i } ) } \frac { \mu _ { i } - x _ { i } } { \| \mu _ { i } - x _ { i } \| _ { 2 } }
|
| 161 |
+
$$
|
| 162 |
+
|
| 163 |
+
where $\alpha$ is the hyper-parameter and $\mu _ { i }$ is defined as in equation (10).
|
| 164 |
+
|
| 165 |
+
An obvious weakness of this approximation is that it relies on Euclidean distance to find the $k$ nearest neighbors. However, Euclidean distance is usually not the proper metric to use when the effective dimension is very high. As the problem is highly challenging, we leave it for future work.
|
| 166 |
+
|
| 167 |
+
# 4.2 VARIATIONAL LOWER BOUND ON THE ENTROPY
|
| 168 |
+
|
| 169 |
+
Another approach we consider relies on defining and maximizing a variational lower bound on the entropy $\bar { H ( p _ { \mathrm { g e n } } ( x ) ) }$ of the generator distribution. We can define the joint distribution over observed data and the noise variables as $p _ { \mathrm { g e n } } ( x , z ) = p _ { \mathrm { g e n } } ( x \mid z ) p _ { \mathrm { g e n } } ( z )$ , where simply $p _ { \mathrm { g e n } } ( z ) = p _ { z } ( z )$ is a fixed prior. Using the joint, we can also define the marginal $p _ { \mathrm { g e n } } ( x )$ and the posterior $p _ { \mathrm { g e n } } ( z \mid x )$ . We can also write the mutual information between the observed data and noise variables as:
|
| 170 |
+
|
| 171 |
+
$$
|
| 172 |
+
\begin{array} { r } { I ( p _ { \mathtt { g e n } } ( x ) ; p _ { \mathtt { g e n } } ( z ) ) = H ( p _ { \mathtt { g e n } } ( x ) ) - H ( p _ { \mathtt { g e n } } ( x \mid z ) ) } \\ { = H ( p _ { \mathtt { g e n } } ( z ) ) - H ( p _ { \mathtt { g e n } } ( z \mid x ) ) , } \end{array}
|
| 173 |
+
$$
|
| 174 |
+
|
| 175 |
+
where $H ( p _ { \mathrm { g e n } } ( . \ | \ . ) )$ denotes the conditional entropy. By reorganizing terms in this definition, we can write the entropy $H ( p _ { \mathrm { g e n } } ( x ) )$ as:
|
| 176 |
+
|
| 177 |
+
$$
|
| 178 |
+
H ( p _ { \mathrm { g e n } } ( x ) ) = H ( p _ { \mathrm { g e n } } ( z ) ) - H ( p _ { \mathrm { g e n } } ( z \mid x ) ) + H ( p _ { \mathrm { g e n } } ( x \mid z ) )
|
| 179 |
+
$$
|
| 180 |
+
|
| 181 |
+
We can think of $p _ { \mathrm { g e n } } ( x \mid z )$ as a peaked Gaussian with a fixed, diagonal covariance, and hence its conditional entropy is constant and can be dropped. Furthermore, $\bar { H } ( p _ { \mathrm { g e n } } ( z ) )$ is also assumed to be fixed a priori. Hence, we can maximize $H ( p _ { \mathrm { g e n } } ( x ) )$ by minimizing the conditional entropy:
|
| 182 |
+
|
| 183 |
+
$$
|
| 184 |
+
H ( p _ { \mathrm { g e n } } ( z \mid x ) ) = \mathbb { E } _ { x \sim p _ { \mathrm { g e n } } ( x ) } \left[ \mathbb { E } _ { z \sim p _ { \mathrm { g e n } } ( z \mid x ) } \left[ - \log p _ { \mathrm { g e n } } ( z \mid x ) \right] \right]
|
| 185 |
+
$$
|
| 186 |
+
|
| 187 |
+
Optimizing this term is still problematic, because (i) we do not have access to the posterior $p _ { \mathrm { g e n } } ( z \mid x )$ , and (ii) we cannot sample from it. Therefore, we instead minimize a variational upper bound defined by an approximate posterior $q _ { \mathrm { g e n } } ( z \mid x )$ :
|
| 188 |
+
|
| 189 |
+
$$
|
| 190 |
+
\begin{array} { r l } & { H ( p _ { \mathrm { g e n } } ( z \mid x ) ) = \mathbb { E } _ { x \sim p _ { \mathrm { g e n } } ( x ) } \left[ \mathbb { E } _ { z \sim p _ { \mathrm { g e n } } ( z \mid x ) } \left[ - \log q _ { \mathrm { g e n } } ( z \mid x ) \right] - \mathrm { K L } ( p _ { \mathrm { g e n } } ( z \mid x ) | | q _ { \mathrm { g e n } } ( z \mid x ) ) \right] } \\ & { \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad } \\ & { \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad } \\ & { \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad } \\ & { \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad } \\ & { \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad } \\ & { \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad } \\ & { \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad } \end{array}
|
| 191 |
+
$$
|
| 192 |
+
|
| 193 |
+
We can also rewrite the variational upper bound as:
|
| 194 |
+
|
| 195 |
+
$$
|
| 196 |
+
\mathcal { U } ( q _ { \mathrm { g e n } } ) = \mathbb { E } _ { x , z \sim p _ { \mathrm { g e n } } ( x , z ) } \left[ - \log q _ { \mathrm { g e n } } ( z \mid x ) \right] = \mathbb { E } _ { z \sim p _ { \mathrm { g e n } } ( z ) } \left[ \mathbb { E } _ { x \sim p _ { \mathrm { g e n } } ( x \mid z ) } \left[ - \log q _ { \mathrm { g e n } } ( z \mid x ) \right] \right] ,
|
| 197 |
+
$$
|
| 198 |
+
|
| 199 |
+
which can be optimized efficiently with standard back-propagation and Monte Carlo integration of the relevant expectations based on independent samples drawn from the joint $p _ { \mathrm { g e n } } ( x , z )$ . By minimizing this upper bound on the conditional entropy $H ( p _ { \mathrm { g e n } } ( z \mid x ) )$ , we are effectively maximizing a variational lower bound on the entropy $H ( p _ { \mathrm { g e n } } ( x ) )$ .
|
| 200 |
+
|
| 201 |
+

|
| 202 |
+
Figure 1: True energy functions and samples from synthetic distributions. Green dots in the sample plots indicate the mean of each Gaussian component.
|
| 203 |
+
|
| 204 |
+
# 5 EXPERIMENTS
|
| 205 |
+
|
| 206 |
+
In this section, we verify our theoretical results empirically on several synthetic and real datasets. In particular, we evaluate whether the discriminator obtained from the entropy-regularized adversarial training can capture the density information (in the form of energy), while making sure the generator distribution matches the data distribution. For convenience, we refer to the obtained models as EGAN-Ent. Our experimental setting follows closely recommendations from Radford et al. (2015), except in Sec. 5.1 where we use fully-connected models (see appendix B.1 for details).
|
| 207 |
+
|
| 208 |
+
# 5.1 SYNTHETIC LOW-DIMENSIONAL DATA
|
| 209 |
+
|
| 210 |
+
First, we consider three synthetic datasets in 2-dimensional space, which are drawn from the following distributions: (i) Mixture of 4 Gaussians with equal mixture weights, (ii) Mixture of 200 Gaussians arranged as two spirals (100 components each spiral), and (iii) Mixture of 2 Gaussians with highly biased mixture weights, $P ( c _ { 1 } ) = 0 . 9 , P ( c _ { 2 } ) = 0 . 1$ . We visualize the ground-truth energy of these distributions along with 100K training samples in Figure 1. Since the data lies in 2-dimensional space, we can easily visualize both the learned generator (by drawing samples) and the discriminator for direct comparison and evaluation. We evaluate here our EGAN-Ent model using both approximations: the nearest-neighbor based approximation (EGAN-Ent-NN) and the variational-inference based approximation (EGAN-Ent-VI), and compare them with two baselines: the original GAN and the energy based GAN with no regularization (EGAN-Const).
|
| 211 |
+
|
| 212 |
+
Experiment results are summarized in Figure 2 for baseline models, and Figure 3 for the proposed models. As we can see, all four models can generate perfect samples. However, for the discriminator, both GAN and EGAN-Const lead to degenerate solution, assigning flat energy inside the empirical data support. In comparison, EGAN-Ent-VI and EGAN-Ent-NN clearly capture the density information, though to different degrees. Specifically, on the equally weighted Gaussian mixture and the two-spiral mixture datasets, EGAN-Ent-NN tends to give more accurate and fine-grained solutions compared to EGAN-Ent-VI. However, on the biased weighted Gaussian mixture dataset, EGAN-Ent-VI actually fails to captures the correct mixture weights of the two modes, incorrectly assigning lower energy to the mode with lower probability (smaller weight). In contrast, EGANEnt-NN perfectly captures the bias in mixture weight, and obtains a contour very close to the ground truth.
|
| 213 |
+
|
| 214 |
+
To better quantify these differences, we present detailed comparison based on KL divergence in appendix B.2. What’s more, the performance difference between EGAN-Ent-VI and EGAN-Ent-NN on biased Gaussian mixture reveals the limitations of the variational inference based approximation, i.e. providing inaccurate gradients. Due to space consideratiosn, we refer interested readers to the appendix B.3 for a detailed discussion.
|
| 215 |
+
|
| 216 |
+
# 5.2 RANKING NIST DIGITS
|
| 217 |
+
|
| 218 |
+
In this experiment, we verify that the results in synthetic datasets can translate into data with higher dimensions. While visualizing the learned energy function is not feasible in high-dimensional space, we can verify whether the learned energy function learns relative densities by inspecting the ranking of samples according to their assigned energies. We train on $2 8 \times 2 8$ images of a single handwritten digit from the NIST dataset. 2 We compare the ability of EGAN-Ent-NN with both EGAN-Const and GAN on ranking a set of 1,000 images, half of which are generated samples and the rest are real test images. Figures 4 and 5 show the top-100 and bottom-100 ranked images respectively for each model, after training them on digit 1. We also show in Figure 7 the mean of all training samples, so we can get a sense of what is the most common style (highest density) of digit 1 in NIST. We can notice that all of the top-ranked images by EGAN-Ent-NN look similar to the mean sample. In addition, the lowest-ranked images are clearly different from the mean image, with either high (clockwise or counter-clockwise) rotation degrees from the mean, or an extreme thickness level. We do not see such clear distinction in other models. We provide in the appendix B.4 the ranking of the full set of images.
|
| 219 |
+
|
| 220 |
+

|
| 221 |
+
Figure 2: Learned energies and samples from baseline models whose discriminator cannot retain density information at the optimal. In the sample plots, blue dots indicate generated samples, and red dots indicate real ones.
|
| 222 |
+
|
| 223 |
+

|
| 224 |
+
|
| 225 |
+
Figure 3: Learned energies and samples from proposed models whose discriminator can retain density information at the optimal. Blue dots are generated samples, and red dots are real ones.
|
| 226 |
+
|
| 227 |
+
# 5.3 SAMPLE QUALITY ON NATURAL IMAGE DATASETS
|
| 228 |
+
|
| 229 |
+
In this last set of experiments, we evaluate the visual quality of samples generated by our model in two datasets of natural images, namely CIFAR-10 and CelebA. We employ here the variationalbased approximation for entropy regularization, which can scale well to high-dimensional data. Figure 6 shows samples generated by EGAN-Ent-VI. We can see that despite the noisy gradients provided by the variational approximation, our model is able to generate high-quality samples.
|
| 230 |
+
|
| 231 |
+

|
| 232 |
+
Figure 4: 100 highest-ranked images out of 1000 generated and reals (bounding box) samples.
|
| 233 |
+
|
| 234 |
+

|
| 235 |
+
Figure 5: 100 lowest-ranked images out of 1000 generated and reals (bounding box) samples.
|
| 236 |
+
|
| 237 |
+
We futher validate the quality of our model’s samples on CIFAR-10 using the Inception score proposed by (Salimans et al., 2016) 3. Table 1 shows the scores of our EGAN-Ent-VI, the best GAN model from Salimans et al. (2016) which uses only unlabeled data, and an EGAN-Const model which has the same architecture as our model. We notice that even without employing suggested techniques in Salimans et al. (2016), energy-based models perform quite similarly to the GAN model. Furthermore, the fact that our model scores higher than EGAN-Const highlights the importance of entropy regularization in obtaining good quality samples.
|
| 238 |
+
|
| 239 |
+
# 6 CONCLUSION
|
| 240 |
+
|
| 241 |
+
In this paper we have addressed a fundamental limitation in adversarial learning approaches, which is their inability of providing sensible energy estimates for samples. We proposed a novel adversarial learning formulation which results in a discriminator function that recovers the true data energy. We provided a rigorous characterization of the learned discriminator in the non-parametric setting, and proposed two methods for instantiating it in the typical parametric setting. Our experimental results verify our theoretical analysis about the discriminator properties, and show that we can also obtain samples of state-of-the-art quality.
|
| 242 |
+
|
| 243 |
+
# 7 ACKNOWLEDGEMENTS
|
| 244 |
+
|
| 245 |
+
We would like to thank the developers of Theano (Theano Development Team, 2016) for developing such a powerful tool for scientific computing. Amjad Almahairi was supported by funding from Maluuba Research.
|
| 246 |
+
|
| 247 |
+

|
| 248 |
+
Figure 6: Samples generated from our model.
|
| 249 |
+
|
| 250 |
+
<table><tr><td>Model</td><td>Our model</td><td>1Improved GANt</td><td>EGAN-Const</td></tr><tr><td>Score ± std.</td><td>7.07 ± .10</td><td>6.86 ± .06</td><td>6.7447 ± 0.09</td></tr></table>
|
| 251 |
+
|
| 252 |
+
Table 1: Inception scores on CIFAR-10. $\dagger$ As reported in Salimans et al. (2016) without using labeled data.
|
| 253 |
+
|
| 254 |
+
Figure 7: mean digit
|
| 255 |
+
|
| 256 |
+
# REFERENCES
|
| 257 |
+
|
| 258 |
+
Pieter Abbeel and Andrew $\mathrm { ~ Y ~ N ~ g ~ }$ . Apprenticeship learning via inverse reinforcement learning. In Proceedings of the twenty-first international conference on Machine learning, pp. 1. ACM, 2004.
|
| 259 |
+
|
| 260 |
+
Stephen Boyd and Lieven Vandenberghe. Convex optimization. Cambridge university press, 2004.
|
| 261 |
+
|
| 262 |
+
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.
|
| 263 |
+
|
| 264 |
+
Jonathan Ho and Stefano Ermon. Generative adversarial imitation learning. arXiv preprint arXiv:1606.03476, 2016.
|
| 265 |
+
|
| 266 |
+
Taesup Kim and Yoshua Bengio. Deep directed generative models with energy-based probability estimation. arXiv preprint arXiv:1606.03439, 2016.
|
| 267 |
+
|
| 268 |
+
A. $\mathrm { N g }$ and S. Russell. Algorithms for inverse reinforcement learning. In Icml, pp. 663–670, 2000.
|
| 269 |
+
|
| 270 |
+
Sebastian Nowozin, Botond Cseke, and Ryota Tomioka. f-gan: Training generative neural samplers using variational divergence minimization. arXiv preprint arXiv:1606.00709, 2016.
|
| 271 |
+
|
| 272 |
+
Alec Radford, Luke Metz, and Soumith Chintala. Unsupervised representation learning with deep convolutional generative adversarial networks. arXiv preprint arXiv:1511.06434, 2015.
|
| 273 |
+
|
| 274 |
+
Tim Salimans, Ian Goodfellow, Wojciech Zaremba, Vicki Cheung, Alec Radford, and Xi Chen. Improved techniques for training gans. arXiv preprint arXiv:1606.03498, 2016.
|
| 275 |
+
|
| 276 |
+
Theano Development Team. Theano: A Python framework for fast computation of mathematical expressions. arXiv e-prints, abs/1605.02688, May 2016.
|
| 277 |
+
|
| 278 |
+
Junbo Zhao, Michael Mathieu, and Yann LeCun. Energy-based generative adversarial network. arXiv preprint arXiv:1609.03126, 2016.
|
| 279 |
+
|
| 280 |
+
Brian D Ziebart, Andrew L Maas, J Andrew Bagnell, and Anind K Dey. Maximum entropy inverse reinforcement learning. In AAAI, pp. 1433–1438, 2008.
|
| 281 |
+
|
| 282 |
+
# A SUPPLEMENTARY MATERIALS FOR SECTION 3
|
| 283 |
+
|
| 284 |
+
# A.1 OPTIMAL DISCRIMINATOR FORM UNDER THE PROPOSED FORMULATION
|
| 285 |
+
|
| 286 |
+
Proof of proposition 3.1. Refining the Lagrange $L ( p _ { \mathrm { g e n } } , c )$ by introducing additional dual variables for the probability constraints (the second and third), the new Lagrange function has the form
|
| 287 |
+
|
| 288 |
+
$$
|
| 289 |
+
\langle p _ { \mathrm { g e n } } , c , \mu , \lambda \rangle = K ( p _ { \mathrm { g e n } } ) + \sum _ { x \in \mathcal X } c ( x ) \Big ( p _ { \mathrm { g e n } } ( x ) - p _ { \mathrm { d a t a } } ( x ) \Big ) - \sum _ { x \in \mathcal X } \mu ( x ) p _ { \mathrm { g e n } } ( x ) + \lambda ( \sum _ { x \in \mathcal X } p _ { \mathrm { g e n } } ( x ) - 1 )
|
| 290 |
+
$$
|
| 291 |
+
|
| 292 |
+
where $c ( x ) \in \mathbb { R } , \forall x$ , $\mu ( x ) \in \mathbb { R } _ { + } , \forall x$ , and $\lambda \in \mathbb { R }$ are the dual variables. The KKT conditions for the optimal primal and dual variables are as follows
|
| 293 |
+
|
| 294 |
+
$$
|
| 295 |
+
\begin{array} { r l r } { \frac { \partial K ( p _ { \mathrm { g e n } } ) } { \partial p _ { \mathrm { g e n } } ( x ) } | _ { p _ { \mathrm { g e n } } = p _ { \mathrm { d a t } } } + c ^ { * } ( x ) - \mu ^ { * } ( x ) + \lambda ^ { * } = 0 , } & { \forall x } & { \mathrm { ( s t a t i o n a r i t y ) } } \\ { \mu ^ { * } ( x ) p _ { \mathrm { g e n } } ^ { * } ( x ) = 0 , \forall x } & { \mathrm { ( c o m p l e m e n t s l a c k n e s s ) } } & \\ { \mu ^ { * } ( x ) \geq 0 , } & { \forall x } & { \mathrm { ( d u a l ~ f e a s i b i l i t y ) } } \\ { p _ { \mathrm { g e n } } ^ { * } ( x ) \geq 0 , } & { p _ { \mathrm { g e n } } ^ { * } ( x ) = p _ { \mathrm { d a t a } } ( x ) , } & { \forall x } & { \mathrm { ( p r i m a l ~ f e a s i b i l i t y ) } } \\ { \sum _ { x \in \mathcal { X } } p _ { \mathrm { g e n } } ( x ) = 1 } & { \mathrm { ( p r i m a l ~ f e a s i b i l i t y ) } } & \end{array}
|
| 296 |
+
$$
|
| 297 |
+
|
| 298 |
+
Rearranging the conditions above, we get $p _ { \mathrm { g e n } } ^ { * } ( x ) = p _ { \mathrm { d a t a } } ( x ) , \forall x \in \mathcal { X }$ as well as equation (4), which concludes the proof. □
|
| 299 |
+
|
| 300 |
+
# A.2 OPTIMAL CONDITIONS OF EBGAN
|
| 301 |
+
|
| 302 |
+
In (Zhao et al., 2016), the training objectives of the generator and the discriminator cannot be written as a single minimax optimization problem since the margin structure is only applied to the objective of the discriminator. In addition, the discriminator is designed to produce the mean squared reconstruction error of an auto-encoder structure. This restricted the range of the discriminator output to be non-negative, which is equivalent to posing a set constraint on the discriminator under the non-parametric setting.
|
| 303 |
+
|
| 304 |
+
Thus, to characterize the optimal generator and discriminator, we adapt the same analyzing logic used in the proof sketch of the original GAN (Goodfellow et al., 2014). Specifically, given a specific generator distribution $p _ { \mathrm { g e n } }$ , the optimal discriminator function given the generator distribution $c ^ { * } ( x ; p _ { \mathrm { g e n } } )$ can be derived by examining the objective of the discriminator. Then, the conditional optimal discriminator function is substituted into the training objective of $p _ { \mathrm { g e n } }$ , simplifying the “adversarial” training as a minimizing problem only w.r.t. $p _ { \mathrm { g e n } }$ , which can be well analyzed.
|
| 305 |
+
|
| 306 |
+
Firstly, given any generator distribution $p _ { \mathrm { g e n } }$ , the EBGAN training objective for the discriminator can be written as the following form
|
| 307 |
+
|
| 308 |
+
$$
|
| 309 |
+
\begin{array} { r l } { c ^ { * } ( x ; p _ { \mathtt { g e n } } ) = \underset { c \in \mathcal { C } } { \arg \operatorname* { m a x } } } & { { } - \underset { p _ { \mathtt { g e n } } } { \mathbb { E } } \ \operatorname* { m a x } ( 0 , m - c ( x ) ) - \underset { p _ { \mathtt { d a t a } } } { \mathbb { E } } c ( x ) } \\ { = \underset { c \in \mathcal { C } } { \arg \operatorname* { m a x } } } & { { } \underset { p _ { \mathtt { g e n } } } { \mathbb { E } } \ \operatorname* { m i n } ( 0 , c ( x ) - m ) - \underset { p _ { \mathtt { d a t a } } } { \mathbb { E } } c ( x ) } \end{array}
|
| 310 |
+
$$
|
| 311 |
+
|
| 312 |
+
where ${ \mathcal { C } } = \{ c : c ( x ) \geq 0 , \forall x \in { \mathcal { X } } \}$ is the set of allowed non-negative discriminator functions. Note this set constraint comes from the fact the mean squared reconstruction error as discussed above.
|
| 313 |
+
|
| 314 |
+
Since the problem (19) is independent w.r.t. each $x$ , the optimal solution can be easily derived as
|
| 315 |
+
|
| 316 |
+
$$
|
| 317 |
+
c ^ { * } ( x ; p _ { \mathrm { g e n } } ) = { \left\{ \begin{array} { l l } { 0 , } & { p _ { \mathrm { g e n } } ( x ) < p _ { \mathrm { d a t a } } ( x ) } \\ { m , } & { p _ { \mathrm { g e n } } ( x ) > p _ { \mathrm { d a t a } } ( x ) } \\ { \alpha _ { x } , } & { p _ { \mathrm { g e n } } ( x ) = p _ { \mathrm { d a t a } } ( x ) > 0 } \\ { \beta _ { x } , } & { p _ { \mathrm { g e n } } ( x ) = p _ { \mathrm { d a t a } } ( x ) = 0 } \end{array} \right. }
|
| 318 |
+
$$
|
| 319 |
+
|
| 320 |
+
where $\alpha _ { x } \in [ 0 , m ]$ is an under-determined number, a $\beta _ { x } \in [ 0 , \infty )$ is another under-determined nonnegative real number, and the subscripts in $m , \alpha _ { x } , \beta _ { x }$ reflect that fact that these under-determined values can be distinct for different $x$ .
|
| 321 |
+
|
| 322 |
+
This way, the overall training objective can be cast into a minimization problem w.r.t. $p _ { \mathrm { g e n } }$
|
| 323 |
+
|
| 324 |
+
$$
|
| 325 |
+
\begin{array} { r } { p _ { \mathrm { g e n } } ^ { * } = \underset { p _ { \mathrm { g e n } } \in \mathcal { P } } { \arg \operatorname* { m i n } } \ \underset { x \sim p _ { \mathrm { g e n } } } { \mathbb { E } } c ^ { * } \big ( x ; p _ { \mathrm { g e n } } \big ) - \underset { x \sim p _ { \mathrm { d a t a } } } { \mathbb { E } } c ^ { * } \big ( x ; p _ { \mathrm { g e n } } \big ) } \\ { = \underset { p _ { \mathrm { g e n } } \in \mathcal { P } } { \arg \operatorname* { m i n } } \ \underset { x \in \mathcal { X } } { \sum } \Big [ p _ { \mathrm { g e n } } ( x ) - p _ { \mathrm { d a t a } } ( x ) \Big ] c ^ { * } \big ( x ; p _ { \mathrm { g e n } } \big ) } \end{array}
|
| 326 |
+
$$
|
| 327 |
+
|
| 328 |
+
where the second term of the first line is implicitly defined as the problem is an adversarial game between $p _ { \mathrm { g e n } }$ and $c$ .
|
| 329 |
+
|
| 330 |
+
Proposition A.1. The global optimal of the EBGAN training objective is achieved if and only if $p _ { g e n } = p _ { d a t a }$ . At that point, $c ^ { * } ( x )$ is fully under-determined.
|
| 331 |
+
|
| 332 |
+
Proof. The proof is established by showing contradiction.
|
| 333 |
+
|
| 334 |
+
Firstly, assume the optimal $p _ { \mathrm { g e n } } ^ { * } \neq p _ { \mathrm { d a t a } }$ . Thus, there must exist a non-equal set $\mathcal { X } _ { \neq } = \{ x \mid p _ { \mathrm { d a t a } } ( x ) \neq$ $p _ { \mathrm { g e n } } ^ { * } ( x ) \}$ , which can be further splitted into two subsets, the greater-than set ${ \mathcal { X } } _ { > } = \{ x \mid p _ { \mathrm { g e n } } ^ { * } ( x ) >$ $p _ { \mathrm { d a t a } } ( x ) \}$ , and the less-than set $\mathcal { X } _ { < } = \{ x \mid p _ { \mathrm { g e n } } ^ { * } ( x ) < p _ { \mathrm { d a t a } } ( x ) \}$ . Similarly, we define the equal set $\mathcal { X } _ { = } = \{ \boldsymbol { x } : p _ { \mathrm { g e n } } ^ { * } ( \boldsymbol { x } ) = p _ { \mathrm { d a t a } } ( \boldsymbol { x } ) \}$ . Obviously, $\mathscr X _ { > } \bigcup \mathscr X _ { < } \bigcup \mathscr X _ { = } = \mathscr X$ .
|
| 335 |
+
|
| 336 |
+
Let $\begin{array} { r } { L ( p _ { \mathrm { g e n } } ) = \sum _ { x \in \mathcal { X } } \Big [ p _ { \mathrm { g e n } } ( x ) - p _ { \mathrm { d a t a } } ( x ) \Big ] c ^ { * } ( x ; p _ { \mathrm { g e n } } ) } \end{array}$ , substituting the results from equation (20) into (21), the $L ( p _ { \mathrm { g e n } } ) ^ { * }$ can be written as
|
| 337 |
+
|
| 338 |
+
$$
|
| 339 |
+
\begin{array} { r l } & { L ( p _ { \mathrm { g e n } } ^ { * } ) = \displaystyle \sum _ { x \in \mathcal { X } _ { < } \bigcup \mathcal { X } _ { < } \bigcup \mathcal { X } _ { = } } \left[ p _ { \mathrm { g e n } } ^ { * } ( x ) - p _ { \mathrm { d a t a } } ( x ) \right] c ^ { * } ( x ; p _ { \mathrm { g e n } } ^ { * } ) } \\ & { \quad \quad = \displaystyle \sum _ { x \in \mathcal { X } _ { < } } \left[ p _ { \mathrm { g e n } } ^ { * } ( x ) - p _ { \mathrm { d a t a } } ( x ) \right] c ^ { * } ( x ; p _ { \mathrm { g e n } } ^ { * } ) + \displaystyle \sum _ { x \in \mathcal { X } _ { > } } \left[ p _ { \mathrm { g e n } } ^ { * } ( x ) - p _ { \mathrm { d a t a } } ( x ) \right] c ^ { * } ( x ; p _ { \mathrm { g e n } } ^ { * } ) } \\ & { \quad \quad = m \displaystyle \sum _ { x \in \mathcal { X } _ { > } } p _ { \mathrm { g e n } } ^ { * } ( x ) - p _ { \mathrm { d a t a } } ( x ) } \\ & { \quad \quad > 0 } \end{array}
|
| 340 |
+
$$
|
| 341 |
+
|
| 342 |
+
However, when $p _ { \mathrm { g e n } } ^ { \prime } = p _ { \mathrm { d a t a } }$ , we have
|
| 343 |
+
|
| 344 |
+
$$
|
| 345 |
+
L ( p _ { \mathrm { g e n } } ^ { \prime } ) = 0 < L ( p _ { \mathrm { g e n } } ^ { * } )
|
| 346 |
+
$$
|
| 347 |
+
|
| 348 |
+
which contradicts the optimal (miminum) assumption of $p _ { \mathrm { g e n } } ^ { * }$ . Hence, the contradiction concludes that at the global optimal, $p _ { \mathrm { g e n } } ^ { * } = p _ { \mathrm { d a t a } }$ . By equation (20), it directly follows that $c ^ { * } ( x ; p _ { \mathrm { g e n } } ^ { * } ) = \alpha _ { x }$ , which completes the proof. □
|
| 349 |
+
|
| 350 |
+
# A.3 ANALYSIS OF ADDING ADDITIONAL TRAINING SIGNAL TO GAN FORMULATION
|
| 351 |
+
|
| 352 |
+
To show that simply adding the same training signal to GAN will not lead to the same result, it is more convenient to directly work with the formulation of $f$ -GAN (Nowozin et al., 2016, equation (6)) family, which include the original GAN formulation as a special case.
|
| 353 |
+
|
| 354 |
+
Specifically, the general $f$ -GAN formulation takes the following form
|
| 355 |
+
|
| 356 |
+
$$
|
| 357 |
+
\operatorname* { m a x } _ { c } \operatorname* { m i n } _ { p _ { \mathrm { g e n } } \in \mathcal { P } } ~ \operatorname* { \mathbb { E } } _ { x \sim p _ { \mathrm { g e n } } } \big [ f ^ { \star } ( c ( x ) ) \big ] - \operatorname* { \mathbb { E } } _ { x \sim p _ { \mathrm { d a t a } } } \big [ c ( x ) \big ] ,
|
| 358 |
+
$$
|
| 359 |
+
|
| 360 |
+
where the $f ^ { \star } ( \cdot )$ denotes the convex conjugate (Boyd & Vandenberghe, 2004) of the $f$ -divergence function. The optimal condition of the discriminator can be found by taking the variation w.r.t. $c$ , which gives the optimal discriminator
|
| 361 |
+
|
| 362 |
+
$$
|
| 363 |
+
c ^ { * } ( x ) = f ^ { \prime } ( \frac { p _ { \mathrm { d a t a } } ( x ) } { p _ { \mathrm { g e n } } ( x ) } )
|
| 364 |
+
$$
|
| 365 |
+
|
| 366 |
+
where $f ^ { \prime } ( \cdot )$ is the first-order derivative of $f ( \cdot )$ . Note that, even when we add an extra term $L ( p _ { \mathrm { g e n } } )$ to equation (24), since the term $K ( p _ { \mathrm { g e n } } )$ is a constant w.r.t. the discriminator, it does not change the result given by equation (25) about the optimal discriminator. As a consequence, for the optimal discriminator to retain the density information, it effectively means $p _ { \mathrm { g e n } } \neq p _ { \mathrm { d a t a } }$ . Hence, there will be a contradiction if both $c ^ { * } ( x )$ retains the density information, and the generator matches the data distribution.
|
| 367 |
+
|
| 368 |
+
Intuitively, this problem roots in the fact that $f$ -divergence is quite “rigid” in the sense that given the $p _ { \mathrm { g e n } } ( x )$ it only allows one fixed point for the discriminator. In comparison, the divergence used in our proposed formulation, which is the expected cost gap, is much more flexible. By the expected cost gap itself, i.e. without the $K ( p _ { \mathrm { g e n } } )$ term, the optimal discriminator is actually under-determined.
|
| 369 |
+
|
| 370 |
+
# B SUPPLEMENTARY MATERIALS FOR SECTION 5
|
| 371 |
+
|
| 372 |
+
# B.1 EXPERIMENT SETTING
|
| 373 |
+
|
| 374 |
+
Here, we specify the neural architectures used for experiements presented in Section 5.
|
| 375 |
+
|
| 376 |
+
Firstly, for the Egan-Ent-VI model, we parameterize the approximate posterior distribution $q _ { \mathrm { g e n } } ( z \mid$ $x$ ) with a diagonal Gaussian distribution, whose mean and covariance matrix are the output of a trainable inference network, i.e.
|
| 377 |
+
|
| 378 |
+
$$
|
| 379 |
+
{ \begin{array} { r l } { q _ { \mathrm { g e n } } ( z \mid x ) = { \mathcal { N } } ( \mu , \mathbf { I } \sigma ^ { 2 } ) } & { } \\ { \mu , \log \sigma = f ^ { \mathrm { i n f e r } } ( x ) } \end{array} }
|
| 380 |
+
$$
|
| 381 |
+
|
| 382 |
+
where $f ^ { \mathrm { i n f e r } }$ denotes the inference network, and I is the identity matrix. Note that the Inference Network only appears in the Egan-Ent-VI model.
|
| 383 |
+
|
| 384 |
+
For experiments with the synthetic datasets, the following fully-connected feed forward neural networks are employed
|
| 385 |
+
|
| 386 |
+
• Generator: FC(4,128)-BN-ReLU-FC(128,128)-BN-ReLU-FC(128,2) • Discriminator: FC(2,128)-ReLU-FC(128,128)-ReLU-FC(128,1) • Inference Net: FC(2,128)-ReLU-FC(128,128)-ReLU-FC(128,4\*2)
|
| 387 |
+
|
| 388 |
+
where FC and BN denote fully-connected layer and batch normalization layer respectively. Note that since the input noise to the generator has dimension 4, the Inference Net output has dimension $4 \star 2$ , where the first 4 elements correspond the inferred mean, and the last 4 elements correspond to the inferred diagonal covariance matrix in log scale.
|
| 389 |
+
|
| 390 |
+
For the handwritten digit experiment, we closely follow the DCGAN (Radford et al., 2015) architecture with the following configuration
|
| 391 |
+
|
| 392 |
+
• Generator: FC(10, $5 1 2 \star 7 \star 7$ )-BN-ReLU-DC(512,256;4c2s)-BN-ReLU -DC(256,128;4c2s)-BN-ReLU-DC(128,1;3c1s)-Sigmoid • Discriminator: CV(1,64;3c1s)-BN-LRec-CV(64,128;4c2s)-BN-LRec -CV(128,256;4c2s)-BN-LRec-FC( $2 5 6 \star 7 \star 7$ ,1) • Inference Net: CV(1,64;3c1s)-BN-LRec-CV(64,128;4c2s)-BN-LRec -CV(128,256;4c2s)-BN-LRec-FC( $2 5 6 \star 7 \star 7$ , ${ 1 0 \star 2 }$ )
|
| 393 |
+
|
| 394 |
+
Here, LRec is the leaky rectified non-linearity recommended by Radford et al. (2015). In addition, $\mathrm { C V } ( 1 2 8 , 2 5 6 , 4 \mathrm { c } 2 \mathrm { s } )$ denotes a convolutional layer with 128 input channels, 256 output channels, and kernel size 4 with stride 2. Similarly, DC $( 2 5 6 , 1 2 8 , 4 \mathrm { c } 2 \mathrm { s } )$ ) denotes a corresponding transposed convolutional operation. Compared to the original DCGAN architecture, the discriminator under our formulation does not have the last sigmoid layer which squashes a scalar value into a probability in [0, 1].
|
| 395 |
+
|
| 396 |
+
For celebA experiment with $6 4 \times 6 4$ color images, we use the following architecture
|
| 397 |
+
|
| 398 |
+
• Generator: FC(10, $5 1 2 \star 4 \star 4$ )-BN-ReLU-DC(512,256;4c2s)-BN-ReLU-DC(256,128;4c2s) -BN-ReLU-DC(256,128;4c2s)-BN-ReLU-DC(128,3;4c2s)-Tanh
|
| 399 |
+
• Discriminator: CV(3,64;4c2s)-BN-LRec-CV(64,128;4c2s)-BN-LRec-CV(128,256;4c2s) -BN-LRec-CV(256,256;4c2s)-BN-LRec-FC( $2 5 6 \star 4 \star 4$ ,1)
|
| 400 |
+
• Inference Net: CV(3,64;4c2s)-BN-LRec-CV(64,128;4c2s)-BN-LRec-CV(128,256;4c2s) -BN-LRec-CV(256,256;4c2s)-BN-LRec-FC(256\*4\*4, $^ { 1 0 \star 2 }$ )
|
| 401 |
+
|
| 402 |
+
For Cifar10 experiment, where the image size is $3 2 \times 3 2$ , similar architecture is used
|
| 403 |
+
|
| 404 |
+
• Generator: FC(10, $5 1 2 \star 4 \star 4$ )-BN-ReLU-DC(512,256;4c2s)-BN-ReLU-DC(256,128;3c1s) -BN-ReLU-DC(256,128;4c2s)-BN-ReLU-DC(128,3;4c2s)-Tanh
|
| 405 |
+
• Discriminator: CV(3,64;3c1s)-BN-LRec-CV(64,128;4c2s)-BN-LRec-CV(128,256;4c2s) -BN-LRec-CV(256,256;4c2s)-BN-LRec-FC( $2 5 6 \star 4 \star 4$ ,1)
|
| 406 |
+
• Inference Net: CV(3,64;3c1s)-BN-LRec-CV(64,128;4c2s)-BN-LRec-CV(128,256;4c2s) -BN-LRec-CV(256,256;4c2s)-BN-LRec-FC( $2 5 6 \star 4 \star 4$ , ${ 1 0 \star 2 }$ )
|
| 407 |
+
|
| 408 |
+
Given the chosen architectures, we follow Radford et al. (2015) and use Adam as the optimization algorithm. For more detailed hyper-parameters, please refer to the code.
|
| 409 |
+
|
| 410 |
+
B.2 QUANTITATIVE COMPARISON OF DIFFERENT MODELS
|
| 411 |
+
|
| 412 |
+
<table><tr><td></td><td></td><td></td><td>Gaussian Mixture:</td><td></td><td>KL(pdatallPemp)=0.0291,</td><td></td><td>KL(pempllPdata)=0.0159</td><td></td><td></td><td></td></tr><tr><td>KL Divergence</td><td>e|pgen|lPemp</td><td></td><td></td><td></td><td>PempllPpgenPgenllPpataPdatallpgen|PdiscllpempPempllPdisc</td><td></td><td></td><td>Ppdis ll Pdata Pdatall Pdisc| PgenllPdisc</td><td></td><td>Pdisell Pgen</td></tr><tr><td>GAN</td><td>0.3034</td><td>0.5024</td><td>0.2498</td><td>0.4807</td><td>6.7587</td><td>2.0648</td><td>6.2020</td><td>2.0553</td><td>2.4596</td><td>7.0895</td></tr><tr><td>EGAN-Const</td><td>0.2711</td><td>0.4888</td><td>0.2239</td><td>0.4735</td><td>6.7916</td><td>2.1243</td><td>6.2159</td><td>2.1149</td><td>2.5062</td><td>7.0553</td></tr><tr><td>EGAN-Ent-VI EGAN-Ent-NN</td><td>0.1422 0.1131</td><td>0.1367</td><td>0.0896 0.0621</td><td>0.1214</td><td>0.8866</td><td>0.6532</td><td>0.7215 0.0901</td><td>0.6442 0.1187</td><td>0.7711</td><td>1.0638</td></tr><tr><td></td><td></td><td>0.1006</td><td></td><td>0.0862</td><td>0.0993</td><td>0.1356</td><td></td><td></td><td>0.1905</td><td>0.1208</td></tr><tr><td>Biased Gaussian Mixture:</td><td colspan="10">KL(pdata|lPpemp)= 0.0273, KL(pempllPdata) =0.0144</td></tr><tr><td>KL Divergence丨Pgen llPemp</td><td></td><td>PempllPgenPgenllPdataPdatallPgen|PdisellpempPempllPdisc</td><td></td><td></td><td></td><td></td><td>Ppdis ll Pdata Pdatall Pdisc| PgenllPdisc</td><td></td><td></td><td>Pdisell Pgen</td></tr><tr><td>GAN</td><td>0.0788</td><td>0.0705</td><td>0.0413</td><td>0.0547</td><td>7.1539</td><td>2.5230</td><td>6.4927</td><td>2.5018</td><td>2.5205</td><td>7.1140</td></tr><tr><td>EGAN-Const</td><td>0.1545 0.0576</td><td>0.1649</td><td>0.1211</td><td>0.1519</td><td>7.1568</td><td>2.5269</td><td>6.4969</td><td>2.5057</td><td>2.5860</td><td>7.1995</td></tr><tr><td>EGAN-Ent-VI EGAN-Ent-NN</td><td>0.0784</td><td>0.0668 0.0574</td><td>0.0303 0.0334</td><td>0.0518 0.0422</td><td>3.9151</td><td>1.3574 0.3480</td><td>2.9894 0.5199</td><td>1.3365</td><td>1.4052 0.3250</td><td>4.0632</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td>0.8505</td><td></td><td></td><td>0.3299 KL(pempllPdata) =1.2349</td><td></td><td>0.7835</td></tr><tr><td></td><td colspan="10">Two-spiral Gaussian Mixture: KL(pdatallPpemp) = 0.3892</td></tr><tr><td>KL Divergence</td><td>e|pgenllPemp</td><td>Pemp ll Pgen</td><td>Pgen|lPdata</td><td></td><td>Pdat |l Pgen| Pdisc llPempPempll Pdisc</td><td></td><td></td><td>Pdisc|l PdataPdatallPdisc| Pgen|lPdisc</td><td></td><td>PdiselPgen</td></tr><tr><td>GAN</td><td>0.5297</td><td>0.2701</td><td>0.3758</td><td>0.7240</td><td>6.3507</td><td>1.7180</td><td>4.3818</td><td>1.0866</td><td>1.6519</td><td>5.7694</td></tr><tr><td>EGAN-Const EGAN-Ent-VI</td><td>0.7473 0.2014</td><td>1.0325</td><td>0.7152</td><td>1.6703 0.8399</td><td>5.9930</td><td>1.5732</td><td>3.9749 0.3061</td><td>0.9703 0.4037</td><td>1.8380 0.4324</td><td>6.0471 0.9917</td></tr><tr><td>EGAN-Ent-NN</td><td></td><td>0.1260</td><td>0.4283</td><td></td><td>1.1099</td><td>0.3508</td><td></td><td></td><td></td><td>0.1686</td></tr><tr><td></td><td>0.1246</td><td>0.1147</td><td>0.4475</td><td>1.2435</td><td>0.1036</td><td>0.0857</td><td>0.4086</td><td>0.7917</td><td>0.1365</td><td></td></tr></table>
|
| 413 |
+
|
| 414 |
+
Table 2: Pairwise KL divergence between distributions. Bold face indicate the lowest divergence within group.
|
| 415 |
+
|
| 416 |
+
In order to quantify the quality of recovered distributions, we compute the pairwise KL divergence of the following four distributions:
|
| 417 |
+
|
| 418 |
+
• The real data distribution with analytic form, denoted as pdata • The empirical data distribution approximated from the 100K training data, denoted as $p _ { \mathrm { e m p } }$ • The generator distribution approximated from 100K generated data, denoted as $p _ { \mathrm { g e n } }$ • The discriminator distribution re-normalized from the learned energy, denoted as $p _ { \mathrm { d i s c } }$
|
| 419 |
+
|
| 420 |
+
Since the synthetic datasets are two dimensional, we approximate both the empirical data distribution and the generator distribution using the simple histogram estimation. Specifically, we divide the canvas into a 100-by-100 grid, and assign each sample into its nearest grid cell based on euclidean distance. Then, we normalize the number of samples in each cell into a proper distribution. When recovering the discriminator distribution from the learned energy, we assume that $\mu ^ { * } ( x ) = 0$ (i.e. infinite data support), and discretize the distribution into the same grid cells
|
| 421 |
+
|
| 422 |
+
$$
|
| 423 |
+
p _ { \mathrm { d i s c } } ( x ) = \frac { \exp ( - c ^ { * } ( x ) ) } { \sum _ { x ^ { \prime } \in \mathrm { G r i d } } \exp ( - c ^ { * } ( x ^ { \prime } ) ) } , \forall x \in \mathrm { G r i d }
|
| 424 |
+
$$
|
| 425 |
+
|
| 426 |
+
Based on these approximation, Table 2 summarizes the results. For all measures related to the discriminator distribution, EGAN-Ent-VI and EGAN-Ent-NN significantly outperform the other two baseline models, which matches our visual assessment in Figure 2 and 3. Meanwhile, the generator distributions learned from our proposed framework also achieve relatively lower divergence to both the empirical data distribution and the true data distribution.
|
| 427 |
+
|
| 428 |
+
In order to understand the performance difference between EGAN-Ent-VI and EGAN-Ent-NN, we analyze the quality of the entropy gradient approximation during training. To do that, we visualize some detailed training information in Figure 8.
|
| 429 |
+
|
| 430 |
+

|
| 431 |
+
(b) Training details under nearest neighbor entropy approximation
|
| 432 |
+
Figure 8: For convenience, we will use Fig. (i,j) to refer to the subplot in row i, column j. Fig. (1,1): current energy plot. Fig. (1,2): frequency map of generated samples in the current batch. Fig. (1,3): frequency map of real samples in the current batch. Fig-(1,4): frequency difference between real and generated samples. Fig. (2,1) comparison between more generated from current model and real sample. Fig. (2,2): the discriminator gradient w.r.t. each training sample. Fig. (2,3): the entropy gradient w.r.t. each training samples. Fig. (2,4): all gradient (discriminator $^ +$ entropy) w.r.t. each training sample.
|
| 433 |
+
|
| 434 |
+
As we can see in figure 8a, the viarational entropy gradient approximation w.r.t. samples is not accurate:
|
| 435 |
+
|
| 436 |
+
• It is inaccurate in terms of gradient direction. Ideally, the direction of the entropy gradient should be pointing from the center of its closest mode towards the surroundings, with the direction orthogonal to the implicit contour in Fig. (1,2). However, the direction of gradients in the Fig. (2,3) does not match this.
|
| 437 |
+
|
| 438 |
+
• It is inaccurate in magnitude. As we can see, the entropy approximation gradient (Fig. (2,3)) has much larger norm than the discriminator gradient (Fig. (2,2)). As a result, the total gradient (Fig. (2,4)) is fully dominated by the entropy approximation gradient. Thus, it usually takes much longer for the generator to learn to generate rare samples, and the training also proceeds much slower compared to the nearest neighbor based approximation.
|
| 439 |
+
|
| 440 |
+
In comparison, the nearest neighbor based gradient approximation is much more accurate as shown in 8b. As a result, it leads to more accurate energy contour, as well as faster training. What’s more, from Figure 8b Fig. (2,4), we can see the entropy gradient does have the cancel-out effect on the discriminator gradient, which again matches our theory.
|
| 441 |
+
|
| 442 |
+
# B.4 RANKING NIST DIGITS
|
| 443 |
+
|
| 444 |
+
Figure 9 shows the ranking of all 1000 generated and real images (from the test set) for three models: EGAN-Ent-NN, EGAN-Const, and GAN. We can clearly notice that in EGAN-Ent-NN the topranked digits look very similar to the mean digit. From the upper-left corner to the lower-right corner, the transition trend is: the rotation degree increases, and the digits become increasingly thick or thin compared to the mean. In addition, samples in the last few rows do diverge away from the mean image: either highly diagonal to the right or left, or have different shape: very thin or thick, or typewriter script. Other models are not able to achieve a similar clear distinction for high versus low probability images. Finally, we consistently observe the same trend in modeling other digits, which are not shown in this paper due to space constraint.
|
| 445 |
+
|
| 446 |
+
# B.5 CLASSIFIER PERFORMANCE AS A PROXY MEASURE
|
| 447 |
+
|
| 448 |
+
As mentioned in Section 5, evaluating the proposed formulation quantitatively on high-dimensional data is extremely challenging. Here, in order to provide more quantitative intuitions on the learned discriminator at convergence, we adopt a proxy measure. Specifically, we take the last-layer activation of the converged discriminator network as fixed pretrained feature, and build a linear classifier upon it. Hypothetically, if the discriminator does not degenerate, the extracted last-layer feature should maintain more information about the data points, especially compared to features from degenerated discriminators. Following this idea, we first train EGAN-Ent-NN, EGAN-Const, and GAN on the MNIST till convergence, and then extract the last-layer activation from their discriminator networks as fixed feature input. Based on fixed feature, a randomly initialized linear classifier is trained to do classification on MNIST. Based on 10 runs (with different initialization) of each of the three models, the test classification performance is summarized in Table 3. For comparison purpose, we also include a baseline where the input features are extracted from a discriminator network with random weights.
|
| 449 |
+
|
| 450 |
+
<table><tr><td>Test error(%)|</td><td>EGAN-Ent-NN</td><td>EGAN-Const</td><td>GAN</td><td>Random</td></tr><tr><td>Min</td><td>1.160</td><td>1.280</td><td>1.220</td><td>3.260</td></tr><tr><td>Mean</td><td>1.190</td><td>1.338</td><td>1.259</td><td>3.409</td></tr><tr><td>Std.</td><td>0.024</td><td>0.044</td><td>0.032</td><td>0.124</td></tr></table>
|
| 451 |
+
|
| 452 |
+
Table 3: Test performance of linear classifiers based on last-layer discriminator features.
|
| 453 |
+
|
| 454 |
+
Based on the proxy measure, EGAN-Ent-NN seems to maintain more information of data, which suggests that the discriminator from our proposed formulation is more informative. Despite the positive result, it is important to point out that maintaining information about categories does not necessarily mean maintaining information about the energy (density). Thus, this proxy measure should be understood cautiously.
|
| 455 |
+
|
| 456 |
+

|
| 457 |
+
|
| 458 |
+

|
| 459 |
+
|
| 460 |
+
7 / 1 / /
|
| 461 |
+
/ 小 1 / . / 1 小 1 / / 1 7 / / /
|
| 462 |
+
|
| 463 |
+
# (b) EGAN-Const
|
| 464 |
+
|
| 465 |
+

|
| 466 |
+
Figure 9: 1000 generated and test images (bounding box) ranked according their assigned energies.
|
| 467 |
+
|
| 468 |
+
(c) GAN
|
md/train/TNkPBBYFkXg/TNkPBBYFkXg.md
ADDED
|
@@ -0,0 +1,252 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# HETEROFL: COMPUTATION AND COMMUNICATION EFFICIENT FEDERATED LEARNING FOR HETEROGENEOUS CLIENTS
|
| 2 |
+
|
| 3 |
+
Enmao Diao
|
| 4 |
+
Department of Electrical and Computer Engineering
|
| 5 |
+
Duke University
|
| 6 |
+
Durhm, NC 27705, USA
|
| 7 |
+
enmao.diao@duke.edu
|
| 8 |
+
Jie Ding
|
| 9 |
+
School of Statistics
|
| 10 |
+
University of Minnesota-Twin Cities
|
| 11 |
+
Minneapolis, MN 55455, USA
|
| 12 |
+
dingj@umn.edu
|
| 13 |
+
Vahid Tarokh
|
| 14 |
+
Department of Electrical and Computer Engineering
|
| 15 |
+
Duke University
|
| 16 |
+
Durhm, NC 27705, USA
|
| 17 |
+
vahid.tarokh@duke.edu
|
| 18 |
+
|
| 19 |
+
# ABSTRACT
|
| 20 |
+
|
| 21 |
+
Federated Learning (FL) is a method of training machine learning models on private data distributed over a large number of possibly heterogeneous clients such as mobile phones and IoT devices. In this work, we propose a new federated learning framework named HeteroFL to address heterogeneous clients equipped with very different computation and communication capabilities. Our solution can enable the training of heterogeneous local models with varying computation complexities and still produce a single global inference model. For the first time, our method challenges the underlying assumption of existing work that local models have to share the same architecture as the global model. We demonstrate several strategies to enhance FL training and conduct extensive empirical evaluations, including five computation complexity levels of three model architecture on three datasets. We show that adaptively distributing subnetworks according to clients’ capabilities is both computation and communication efficient.
|
| 22 |
+
|
| 23 |
+
# 1 INTRODUCTION
|
| 24 |
+
|
| 25 |
+
Mobile devices and the Internet of Things (IoT) devices are becoming the primary computing resource for billions of users worldwide (Lim et al., 2020). These devices generate a significant amount of data that can be used to improve numerous existing applications (Hard et al., 2018). From the privacy and economic point of view, due to these devices’ growing computational capabilities, it becomes increasingly attractive to store data and train models locally. Federated learning (FL) (Konecnˇ y et al., 2016; McMahan et al., 2017) is a distributed machine learning framework that \` enables a number of clients to produce a global inference model without sharing local data by aggregating locally trained model parameters. A widely accepted assumption is that local models have to share the same architecture as the global model (Li et al., 2020b) to produce a single global inference model. With this underlying assumption, we have to limit the global model complexity for the most indigent client to train its data. In practice, the computation and communication capabilities of each client may vary significantly and even dynamically. It is crucial to address heterogeneous clients equipped with very different computation and communication capabilities.
|
| 26 |
+
|
| 27 |
+
In this work, we propose a new federated learning framework called HeteroFL to train heterogeneous local models with varying computation complexities and still produce a single global inference model. This model heterogeneity differs significantly from the classical distributed machine learning framework where local data are trained with the same model architecture (Li et al., 2020b; Ben-Nun & Hoefler, 2019). It is natural to adaptively distribute subnetworks according to clients’ capabilities. However, to stably aggregate heterogeneous local models to a single global model under various heterogeneous settings is not apparent. Addressing these issues is thus a key component of our work. Our main contributions of this work are three-fold.
|
| 28 |
+
|
| 29 |
+
• We identify the possibility of model heterogeneity and propose an easy-to-implement framework HeteroFL that can train heterogeneous local models and aggregate them stably and effectively into a single global inference model. Our approach outperforms state-ofthe-art results without introducing additional computation overhead. Our proposed solution addresses various heterogeneous settings where different proportions of clients have distinct capabilities. Our results demonstrate that even when the model heterogeneity changes dynamically, the learning result from our framework is still stable and effective. We introduce several strategies for improving FL training and demonstrate that our method is robust against the balanced non-IID statistical heterogeneity. Also, the proposed method can reduce the number of communication rounds needed to obtain state-of-the-art results. Experimental studies have been performed to evaluate the proposed approach.
|
| 30 |
+
|
| 31 |
+
# 2 RELATED WORK
|
| 32 |
+
|
| 33 |
+
Federated Learning aims to train massively distributed models at a large scale (Bonawitz et al., 2019). FedAvg proposed by McMahan et al. (2017) is currently the most widely adopted FL baseline, which reduces communication cost by allowing clients to train multiple iterations locally. Major challenges involved in FL include communication efficiency, system heterogeneity, statistical heterogeneity, and privacy (Li et al., 2020b). To reduce communication costs in FL, some studies propose to use data compression techniques such as quantization and sketching (Konecnˇ y et al., \` 2016; Alistarh et al., 2017; Ivkin et al., 2019), and some propose to adopt split learning (Thapa et al., 2020). To tackle system heterogeneity, techniques of asynchronous communication and active sampling of clients have been developed (Bonawitz et al., 2019; Nishio & Yonetani, 2019). Statistical heterogeneity is the major battleground for current FL research. A research trend is to adapt the global model to accommodate personalized local models for non-IID data (Liang et al., 2020), e.g., by integrating FL with other frameworks such as assisted learning (Xian et al., 2020), metalearning (Jiang et al., 2019; Khodak et al., 2019), multi-task learning (Smith et al., 2017), transfer learning (Wang et al., 2019; Mansour et al., 2020), knowledge distillation (Li & Wang, 2019) and lottery ticket hypothesis (Li et al., 2020a). Nevertheless, these personalization methods often introduce additional computation and communication overhead that may not be necessary. Another major concern of FL is data privacy (Lyu et al., 2020), as model gradient updates can reveal sensitive information (Melis et al., 2019) and even local training data (Zhu et al., 2019; Zhao et al., 2020).
|
| 34 |
+
|
| 35 |
+
To our best knowledge, what we present is the first work that allows local models to have different architectures from the global model. Heterogeneous local models can allow local clients to adaptively contribute to the training of global models. System heterogeneity and communication efficiency can be well addressed by our approach, where local clients can optimize low computation complexity models and therefore communicate a small number of model parameters. To address statistical heterogeneity, we propose a ”Masking Trick” for balanced non-IID data partition in classification problems. We also propose a modification of Batch Normalization (BN) (Ioffe & Szegedy, 2015) as privacy concern of running estimates hinders the usage of advanced deep learning models.
|
| 36 |
+
|
| 37 |
+
# 3 HETEROGENEOUS FEDERATED LEARNING
|
| 38 |
+
|
| 39 |
+
# 3.1 HETEROGENEOUS MODELS
|
| 40 |
+
|
| 41 |
+
Federated Learning aims to train a global inference model from locally distributed data $\{ X _ { 1 } , \ldots , X _ { m } \}$ across $m$ clients. The local models are parameterized by model parameters $\{ W _ { 1 } , \ldots , W _ { m } \}$ . The server will receive local model parameters and aggregate them into a global model $W _ { g }$ through model averaging. This process iterates multiple communication rounds and can be formulated as $\begin{array} { r } { W _ { g } ^ { t } = \frac { 1 } { m } \sum _ { i = 1 } ^ { m } W _ { i } ^ { t } } \end{array}$ at iteration $t$ . At the next iteration, $W _ { g } ^ { t }$ is transmitted to a subset of local clients and update their local models as $W _ { i } ^ { t + 1 } = W _ { g } ^ { t }$ .
|
| 42 |
+
|
| 43 |
+

|
| 44 |
+
Figure 1: Global model parameters $W _ { g }$ are distributed to $m = 6$ local clients with $p = 3$ computation complexity levels.
|
| 45 |
+
|
| 46 |
+
In this work, we focus on the relaxation of the assumption that local models need to share the same architecture as the global model. Since our primary motivation is to reduce the computation and communication complexity of local clients, we consider local models to have similar architecture but can shrink their complexity within the same model class. To simplify global aggregation and local update, it is tempting to propose local model parameters to be a subset of global model parameters $W _ { i } ^ { i + 1 } \subseteq W _ { g } ^ { i }$ . However, this raises several new challenges like the optimal way to select subsets of global model parameters, compatibility of the-state-of-art model architecture, and minimum modification from the existing FL framework. We develop Heterogeneous Federated Learning (HeteroFL) to address these issues in the context of deep learning models.
|
| 47 |
+
|
| 48 |
+
A variety of works show that we can modulate the size of deep neural networks by varying the width and depth of networks (Zagoruyko & Komodakis, 2016; Tan & Le, 2019). Because we aim to reduce the computation complexity of local models, we choose to vary the width of hidden channels. In this way, we can significantly reduce the number of local model parameters, while the local and global model architectures are also within the same model class, which stabilizes global model aggregation.
|
| 49 |
+
|
| 50 |
+
We demonstrate our method of selecting subsets of global model parameters $W _ { l }$ for a single hidden layer parameterized by $W _ { g } \in \mathbf { R } ^ { d _ { g } \times k _ { g } }$ in Fig. 1, where $d _ { g }$ and $k _ { g }$ are the output and input channel size of this layer. It is possible to have multiple computation complexity levels $W _ { l } ^ { p } \subset W _ { l } ^ { p - 1 } \cdot \cdot \cdot \subset$ $W _ { l } ^ { 1 }$ as illustrated in Fig. 1. Let $r$ be the hidden channel shrinkage ratio such that $d _ { l } ^ { p } = r ^ { p - 1 } d _ { g }$ and $k _ { l } ^ { p } = r ^ { p - 1 } k _ { g }$ . It follows that the size of local model parameters $| W _ { l } ^ { p } | = r ^ { 2 ( p - 1 ) } | W _ { g } |$ and the model shrinkage ratio $\begin{array} { r } { R = \frac { | W _ { l } ^ { p } | } { | W _ { g } | } = r ^ { 2 ( p - 1 ) } } \end{array}$ . With this construction, we can adaptively allocate subsets of global model parameters according to the corresponding capabilities of local clients. Suppose that number of clients in each computation complexity level is $\bar { \{ m _ { 1 } , \ldots , m _ { p } \} }$ . Specifically, we perform global aggregation in the following way.
|
| 51 |
+
|
| 52 |
+
$$
|
| 53 |
+
\begin{array} { c l l } { { } } & { { \displaystyle W _ { l } ^ { p } = \frac { 1 } { m } \sum _ { i = 1 } ^ { m } W _ { i } ^ { p } , } } & { { \displaystyle W _ { l } ^ { p - 1 } \setminus W _ { l } ^ { p } = \frac { 1 } { m - m _ { p } } \sum _ { i = 1 } ^ { m - m _ { p } } W _ { i } ^ { p - 1 } \setminus W _ { i } ^ { p } , \ldots } } \\ { { } } & { { } } & { { } } \\ { { } } & { { \displaystyle W _ { l } ^ { 1 } \setminus W _ { l } ^ { 2 } = \frac { 1 } { m - m _ { 2 : p } } \sum _ { i = 1 } ^ { m - m _ { 2 : p } } W _ { i } ^ { 1 } \setminus W _ { i } ^ { 2 } } } \\ { { } } & { { } } & { { } } \\ { { } } & { { \displaystyle W _ { g } = W _ { l } ^ { 1 } = W _ { l } ^ { p } \cup ( W _ { l } ^ { p - 1 } \setminus W _ { l } ^ { p } ) \cup \ldots \cup ( W _ { l } ^ { 1 } \setminus W _ { l } ^ { 2 } ) } } \end{array}
|
| 54 |
+
$$
|
| 55 |
+
|
| 56 |
+
For notational convenience, we have dropped the iteration index $t$ . We denote the $\boldsymbol { W } _ { i } ^ { p }$ as a matrix/tensor. The $W _ { g } ^ { t } [$ [: $d _ { m } , \colon k _ { m } ]$ denotes the upper left submatrix with a size of $d _ { m } \times k _ { m }$ . Also, $W _ { g } ^ { p - 1 , t + 1 } \setminus W _ { g } ^ { p , t + 1 }$ denotes the set of elements included in $W _ { g } ^ { p - 1 , t + 1 }$ but excluded in $W _ { g } ^ { p , t + 1 }$ .
|
| 57 |
+
|
| 58 |
+
We exemplify the above equations using Fig. 1. The first part of Equation (1) shows that the smallest part of model parameters (blue, $p \ = \ 3$ ) is aggregated from all the local clients that contain it.
|
| 59 |
+
|
| 60 |
+
In the second part of Equation (1), the set difference between part $p - 1$ (orange) and $p$ (blue) of model parameters is aggregated from local clients with computation complexity level smaller than $p - 1$ . In Equation (2), the red part of model parameters can be similarly aggregated from $m - m _ { 2 : p } = m _ { 1 }$ clients. In Equation (3), the global model parameters $\boldsymbol { W } _ { g } ^ { t }$ is constructed from the union of all disjoint sets of the partition. In summary, each parameter will be averaged from those clients whose allocated parameter matrix contains that parameter. Thus, a model of an intermediate complexity will have parameters fully averaged with all the other larger models but partially with smaller models (according to the corresponding upper left submatrix).
|
| 61 |
+
|
| 62 |
+
Several works show that wide neural networks can drop a tremendous number of parameters per layer and still produce acceptable results (Han et al., 2015; Frankle & Carbin, 2018). The intuition is thus to perform global aggregation across all local models, at least on one subnetwork. To stabilize global model aggregation, we also allocate a fixed subnetwork for every computation complexity level. Our proposed inclusive subsets of global model parameters also guarantee that smaller local models will aggregate with more local models.
|
| 63 |
+
|
| 64 |
+
Thus, small local models can benefit more from global aggregation by performing less global aggregation for part of larger local model parameters. We empirically found that this approach produces better results than uniformly sampled subnetworks for each client or computation complexity level.
|
| 65 |
+
|
| 66 |
+
# 3.2 STATIC BATCH NORMALIZATION
|
| 67 |
+
|
| 68 |
+
After global model parameters are distributed to active local clients, we can optimize local model parameters with private data. It is well-known that the latest deep learning models usually adopt Batch Normalization (BN) to facilitate and stabilize optimization. However, classical FedAvg and most recent works avoid BN. A major concern of BN is that it requires running estimates of representations at every hidden layer. Uploading these statistics to the server will cause higher communication costs and privacy issues Andreux et al. (2020) proposes to track running statistics locally.
|
| 69 |
+
|
| 70 |
+
We highlight an adaptation of BN named as static Batch Normaliztion (sBN) for optimizing privacy constrained heterogeneous models. During the training phase, sBN does not track running estimates and simply normalize batch data. We do not track the local running statistics as the size of local models may also vary dynamically. This method is suitable for HeteroFL as every communication round is independent. After the training process finishes, the server sequentially query local clients and cumulatively update global BN statistics. There exist privacy concerns about calculating global statistics cumulatively and we hope to address those issues in the future work. We also empirically found this trick significantly outperforms other forms of normalization methods including the InstanceNorm (Ulyanov et al., 2016), GroupNorm (Wu & He, 2018), and LayerNorm (Ba et al., 2016) as shown in Table 4 and Table 5.
|
| 71 |
+
|
| 72 |
+
# 3.3 SCALER
|
| 73 |
+
|
| 74 |
+
There still exists another cornerstone of our HeteroFL framework. Because we need to optimize local models for multiple epochs, local model parameters at different computation complexity levels will digress to various scales. This known phenomenon was initially discussed by the dropout (Srivastava et al., 2014). To directly use the full model during the inference phase, inverted dropout with dropout rate $q$ scales representations with $\frac { 1 } { 1 - q }$ during the training phase. In practice, dropout is usually attached after the activation layer as the selection of subnetworks is performed with masking. Our method directly selects subnetworks from the subsets of global model parameters. Therefore, we append a Scaler module right after the parametric layer and before the sBN and activation layers. The Scaler module scales representations by $\frac { 1 } { r ^ { p - 1 } }$ during the training phase. After the global aggregation, the global model can be directly used for inference without scaling. To further illustrate this point, we include a comprehensive ablation study in Tables 4 and 5. A typical linear hidden layer used in our HeteroFL framework can be formulated as
|
| 75 |
+
|
| 76 |
+
$$
|
| 77 |
+
y = \phi ( \mathrm { s B N } ( \mathrm { S c a l e r } ( X _ { m } W _ { m } ^ { p } + b _ { m } ^ { p } ) ) )
|
| 78 |
+
$$
|
| 79 |
+
|
| 80 |
+
where $y$ is the output, $\phi ( \cdot )$ denotes a non-linear activation layer, e.g ReLU(), and $W _ { m } ^ { p } , b _ { m } ^ { p }$ are the weight and bias for local model $m$ at computation complexity level $p$ . With all the practical methods mentioned above, we propose the complete pseudo-code for our HeteroFL framework in Algorithm 1. The local capabilities information $L _ { m }$ is an abstraction of the computation and communication capabilities of a local client $m$ . Once this information is communicated to the server, the server can know the model complexity that should be allocated to the client. We can also optionally update learning rates to facilitate optimization and local capabilities information if changing dynamically.
|
| 81 |
+
|
| 82 |
+
Algorithm 1: HeteroFL: Heterogeneous Federated Learning
|
| 83 |
+
|
| 84 |
+
<table><tr><td>Input:Data Xi distributed on M local clients, the fraction C of active clients per communication round, the number of local epochs E,the local minibatch size B,the learning rate η, the global model parameterized by Wg, the channel shrinkage ratio r, and the number of computation complexity levels P. System executes: Initialize Wg a and local capabilities information L1:K for each communication round t = O,1, 2,... do Mt ← max(C ·M,1) St ←random set of Mt clients for each client m ∈ St in parallel do Determine computation complexity level p based on Lm rm←r(p-1),dm←rmdg,km←rmkg Wt ←Wt[: dm,: km] Wt+1 ← ClientUpdate(m,rm, Wt) m m end for each computation complexity level p do Mt-Mp:P,t Wp-1,t+1\Wp.t+1 1 g end Wt+1 ← Up=1 Wp-1,t+1\Wp,t+1 9 g g Update L1:K,n (Optional) end Query representation statistics from local clients (Optional) ClientUpdate (m,rm,Wm): Bm ← Split local data Xm into batches of size B for each local epoch e from 1 to E do for batch bm ∈ Bm do Wm ← Wm-nVl(Wm,rm;bm)</td></tr></table>
|
| 85 |
+
|
| 86 |
+
# 4 EXPERIMENTAL RESULTS
|
| 87 |
+
|
| 88 |
+
We trained over 600 individual models for exploring and demonstrating the effectiveness of our method. We experimented with MNIST and CIFAR10 image classification tasks and the WikiText2 language modeling task (LeCun et al., 1998; Krizhevsky et al., 2009; Merity et al., 2016; Devlin et al., 2018).
|
| 89 |
+
|
| 90 |
+
Our experiments are performed with three different models including a CNN for MNIST, a preactivated ResNet (PreResNet18) (He et al., 2016) for CIFAR10 and a Transformer (Vaswani et al., 2017) for WikiText2. We replace BN in CNN and PreResNet18 with our proposed sBN, and attach the Scaler module after each convolution layer. To study federated optimization, we adopt data partition the same as in (McMahan et al., 2017; Liang et al., 2020). We have 100 clients, and the fraction $C$ of active clients per communication round is 0.1 throughout our experiments. For IID data partition, we uniformly assign the same number of data examples for each client. For balanced non-IID data partition, we assume that the label distribution is skewed, where clients will only have examples at most from two classes and the number of examples per class is balanced. We note that there exist other kinds of non-IID data partition, e.g., the unbalanced non-IID data partition where clients may hold unbalanced labeled dataset and the feature distribution skew where clients may hold different features. We conduct a masked language modeling task with a $15 \%$ masking rate and uniformly assign balanced data examples for each client. It needs to point out that each client will roughly have 3000 different words in their local dataset, while the total vocabulary size is 33278. The details regarding hyperparameters and model architecture can be found in Table 6 of the Appendix.
|
| 91 |
+
|
| 92 |
+
To study the effectiveness of our proposed HeteroFL framework, we construct five different computation complexity levels $\{ a , b , c , d , e \}$ with the hidden channel shrinkage ratio $r = 0 . 5$ . We have tried various shrinkage ratios, and we found that it is most illustrative to use the discrete complexity levels 0.5, 0.25, 0.125, and 0.0625 (relative to the most complex model). For example, model ‘a’ has all the model parameters, while models ‘b’ to ‘e’ have the effective shrinkage ratios 0.5, 0.25, 0.125, and 0.0625. We note that the complexity of ‘e’ is close to a logistic regression model. Our experiments indicated that the ratio can be arbitrary between $( 0 , 1 ]$ and dynamically change. In practice, using a dictionary of discrete complexity levels are convenient for coordination purposes.
|
| 93 |
+
|
| 94 |
+
Each local client is assigned an initial computation complexity level. We annotate $F i x$ for experiments with a fixed assignment of computation complexity levels, and Dynamic for local clients uniformly sampling computation complexity levels at each communication round. We perform distinct experiments for $F i x$ and Dynamic assignments. All the figures are based on the $F i x$ scenario, where we considered models of different sizes, and each client is allocated with a fixed size. All the tables are based on the Dynamic scenario, where we randomly vary the allocation of clients’ model complexity, and the ratio of the number of weak learners is fixed to $50 \%$ .
|
| 95 |
+
|
| 96 |
+
The $\mathbf { X }$ -axis of figures represents the average model parameters. When $10 \%$ clients use the model ’a’ and $90 \%$ use the model ’e’, the average number of model parameters is $0 . 1 \times$ (size of model ‘a’) $^ +$ $0 . 9 \times$ (size of model ‘e’). We interpolate this partition from $10 \%$ to $100 \%$ with step size $10 \%$ to demonstrate the effect of proportionality of clients with various computation complexity levels.
|
| 97 |
+
|
| 98 |
+
To demonstrate the effect of dynamically varying computation and communication capabilities, we uniformly sample from various combinations of computation complexity levels. For example, model ’a-b-c-d-e’ means that we uniformly sample from all possible available levels for every active client at each communication round. We show the number of model parameters, FLOPs, and Space (MB) to indicate the computation and communication requirements of our methods. For example, since we uniformly sample levels, model $a - e$ calculates computational metrics by averaging those of model $a$ and $e$ . The ratio is calculated between the number of parameters of a given model with respect to its $100 \%$ global model.
|
| 99 |
+
|
| 100 |
+
We compare our results to other baseline methods like Standalone, FedAvg, and LG-FedAvg gathered from (Liang et al., 2020). Standalone means there is no communication between clients and the server. In our experimental studies, we considered more complex models compared with the existing work. In particular, the baseline models in LG-FedAvg used MLP (on MNIST) and CNN (on CIFAR10). In terms of the number of parameters, our models ‘a-e’ (on MNIST) and ‘b-e’ (on CIFAR10) are comparable with those baselines. In terms of the FLOPs, our model ‘d-e’ (on MNIST and CIFAR10) can be compared with those baselines. The single-letter models ‘a’, ‘b’, $\cdot _ { \mathrm { c } } ,$ , ‘d’, ‘e’ are our implementations of the FedAvg equipped with the sBN and Masking CrossEntropy. The takeaway of Table 2 is that a weak learner that can only train a small model ‘e’ (on CIFAR10) $( 7 7 . 0 9 \% )$ can boost its performance to ‘c-e’ $( 8 6 . 8 8 \% )$ , ‘b-e’ $( 8 9 . 1 0 \% )$ , or ‘a-e’ $( 9 0 . 2 9 \% )$ , which are close to the scenario where all the learners are strong, namely $\mathsf { c } ( 8 7 . 5 5 \% )$ , ${ \mathsf { b } } ( 8 9 . 8 2 \% )$ , or $\mathbf { a } ( 9 1 . 9 9 \% )$ . In particular, in ‘c-e’, ‘b- $\cdot \mathrm { e } '$ , or ‘a-e’, half of the clients are trained with larger models $\cdot _ { \mathrm { c } } \cdot$ , $\cdot _ { \mathrm { { b } } } ,$ , or ‘a’, while the other half are trained with the model ‘e’. Only the aggregated global models $\cdot _ { \mathrm { c } } ,$ , ‘b’, or ‘a’ are used during the testing stage. Although weak clients train smaller models $\cdot _ { \mathrm { e } } ,$ , they will test with the largest models $\cdot _ { \mathrm { c } } \cdot$ , $\mathbf { \widetilde { b } } ^ { \prime }$ , or $\mathbf { \dot { a } } _ { } ^ { }$ to gain better performance.
|
| 101 |
+
|
| 102 |
+
Full results including other possible combinations can be found in appendix in Table 7-9. Finally, our method is robust to dynamically varying model complexities. It is worth noting that our method does not incur any additional computation overhead and can be readily adapted to existing applications.
|
| 103 |
+
|
| 104 |
+
We also perform experiments for balanced non-IID data partition and provide a simple trick to achieve comparable results. As mentioned earlier, most state-of-the-art results ofbalanced non-IID datasets suggest the personalization of local models to achieve better local results (Smith et al., 2017; Liang et al., 2020; Li et al., 2020a). Here, the Local results assume that the training data distribution and test data distribution for each local client are the same, and assign zero probability for those classes that are not presented to a client during training. The Global results were calculated from the global model applied to the test data directly. The Local results were cumulatively averaged from the performance of each data example on each local client. Zhao et al. (2018) showed that the failure of non-IID FL is related to the weight divergence among local model parameters trained locally for many iterations. The weight divergence mostly occurs in the last classification layer of networks.
|
| 105 |
+
|
| 106 |
+

|
| 107 |
+
Figure 2: Interpolation experimental results for CIFAR10 (IID) dataset between global model complexity ((a) a, (b) b, (c) c, (d) d) and various smaller model complexities.
|
| 108 |
+
|
| 109 |
+
Thus, instead of a full Cross-Entropy Loss for all classes, we are motivated to train each local model only with their corresponding classes. In this way, each local model will train a sub-task given locally available label information. Specifically, we mask out the output of the model before passing it Cross-Entropy Loss, which we named as Masked Cross-Entropy Loss. We experimented with several different ways of masking, we find replacing the last layer outputs that are not associated with local labels with zero achieves both stable and comparable local and global results. When aggregating local model parameters, we do not aggregate the untrained parameters in the last classification layers. Either the server can infer this information implicitly, or the local clients can report which classes they have to the server explicitly. We provide a comprehensive ablation study in Tables 5. The results show that Masked Cross-Entropy Loss significantly improve local performance and moderately global performance of balanced non-IID data partition task. Since our primary focus is to address model heterogeneity, we leave the analysis of this trick to future work. We show the results of $F i x$ experiments in appendix in Fig. 5-8. Dynamic non-IID results are also included in Table 1-3. The results show that our method performs comparably to those with personalized local models. Our method is readily adaptable, free of computation overhead, and only rely on the single global model for testing local and global results. It allows local clients to switch to another subtask simply by changing its mask without querying the server for others’ personalized models.
|
| 110 |
+
|
| 111 |
+
We show the learning curves of $50 \%$ Fix and Dynamic assignments in appendix in Fig. 9-11. The learning curves show that the optimization of HeteroFL for the IID dataset is stable and efficient. Our method achieves better results with a fewer number of communication rounds, e.g., 800 for Heterofl and 1800 for LG-FedAvg (Liang et al., 2020). We empirically discover gradient clipping stabilizes the optimization of HeteroFL as it prevents small models from gradient explosion. We can therefore adopt a universal learning rate for heterogeneous local models. It is also perceivable that aggregation of model parameters trained with non-IID data makes the optimization less stable. Results of Dynamic show that global aggregation of dynamically varying computation complexities is stable.
|
| 112 |
+
|
| 113 |
+
Table 1: Results of combination of various computation complexity levels for MNIST dataset. Full results can be found in Table 7.
|
| 114 |
+
|
| 115 |
+
<table><tr><td rowspan="2">Model</td><td rowspan="2">Ratio</td><td rowspan="2">Parameters</td><td rowspan="2">FLOPs</td><td rowspan="2">Space (MB)</td><td colspan="3">Accuracy</td></tr><tr><td rowspan="2">ID</td><td colspan="2">Non-IID</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td>Local</td><td>Global</td></tr><tr><td>a</td><td>1.00</td><td>1.6 M</td><td>80.5M</td><td>5.94</td><td>99.53</td><td>99.85</td><td>98.92</td></tr><tr><td>a-e</td><td>0.50</td><td>782K</td><td>40.5 M</td><td>2.98</td><td>99.46</td><td>99.89</td><td>98.96</td></tr><tr><td>a-b-c-d-e</td><td>0.27</td><td>416K</td><td>21.6M</td><td>1.59</td><td>99.46</td><td>99.85</td><td>98.29</td></tr><tr><td>b</td><td>1.00</td><td>391K</td><td>20.5M</td><td>1.49</td><td>99.53</td><td>99.87</td><td>99.10</td></tr><tr><td>b-e</td><td>0.51</td><td>199K</td><td>10.4M</td><td>0.76</td><td>99.51</td><td>99.67</td><td>98.51</td></tr><tr><td>b-c-d-e</td><td>0.33</td><td>131K</td><td>6.9 M</td><td>0.50</td><td>99.52</td><td>99.88</td><td>98.99</td></tr><tr><td>c</td><td>1.00</td><td>99K</td><td>5.3M</td><td>0.38</td><td>99.35</td><td>99.56</td><td>96.34</td></tr><tr><td>c-e</td><td>0.53</td><td>53K</td><td>2.9 M</td><td>0.20</td><td>99.39</td><td>99.79</td><td>97.27</td></tr><tr><td>c-d-e</td><td>0.44</td><td>44 K</td><td>2.4M</td><td>0.17</td><td>99.31</td><td>99.76</td><td>97.85</td></tr><tr><td>d</td><td>1.00</td><td>25K</td><td>1.4M</td><td>0.10</td><td>99.17</td><td>99.86</td><td>97.86</td></tr><tr><td>d-e</td><td>0.63</td><td>16K</td><td>909 K</td><td>0.06</td><td>99.19</td><td>99.63</td><td>97.70</td></tr><tr><td>e</td><td>1.00</td><td>7K</td><td>400K</td><td>0.03</td><td>98.66</td><td>99.07</td><td>92.84</td></tr><tr><td>Standalone (Liang et al.,2020)</td><td>1.00</td><td>633K</td><td>1.3M</td><td>2.42</td><td>86.24</td><td>98.72</td><td>30.41</td></tr><tr><td>FedAvg (Liang et al.,2020)</td><td>1.00</td><td>633K</td><td>1.3 M</td><td>2.42</td><td>97.93</td><td>98.20</td><td>98.20</td></tr><tr><td>LG-FedAvg (Liang et al., 2020)</td><td>1.00</td><td>633K</td><td>1.3 M</td><td>2.42</td><td>97.93</td><td>98.54</td><td>98.17</td></tr></table>
|
| 116 |
+
|
| 117 |
+
<table><tr><td rowspan="2">Model</td><td rowspan="2">Ratio</td><td rowspan="2">Parameters</td><td rowspan="2">FLOPs</td><td rowspan="2">Space (MB)</td><td colspan="3">Accuracy</td></tr><tr><td rowspan="2">IID</td><td colspan="2">Non-IID</td></tr><tr><td></td><td></td><td></td><td></td><td>Local</td><td></td><td>Global</td></tr><tr><td>a</td><td>1.00</td><td>9.6M</td><td>330.2M</td><td>36.71</td><td>91.19</td><td>92.38</td><td>56.88</td></tr><tr><td>a-e</td><td>0.50</td><td>4.8 M</td><td>165.9 M</td><td>18.43</td><td>90.29</td><td>92.10</td><td>59.11</td></tr><tr><td>a-b-c-d-e</td><td>0.27</td><td>2.6M</td><td>88.4M</td><td>9.78</td><td>88.83</td><td>92.49</td><td>61.64</td></tr><tr><td>b</td><td>1.00</td><td>2.4M</td><td>83.3M</td><td>9.19</td><td>89.82</td><td>93.83</td><td>55.45</td></tr><tr><td>b-e</td><td>0.51</td><td>1.2 M</td><td>42.4 M</td><td>4.67</td><td>89.10</td><td>90.68</td><td>59.81</td></tr><tr><td>b-c-d-e</td><td>0.33</td><td>801K</td><td>27.9 M</td><td>3.05</td><td>87.92</td><td>91.90</td><td>59.10</td></tr><tr><td>C</td><td>1.00</td><td>604K</td><td>21.2 M</td><td>2.30</td><td>87.55</td><td>91.09</td><td>55.12</td></tr><tr><td>c-e</td><td>0.53</td><td>321K</td><td>11.3 M</td><td>1.22</td><td>86.88</td><td>91.83</td><td>63.47</td></tr><tr><td>c-d-e</td><td>0.44</td><td>265K</td><td>9.4M</td><td>1.01</td><td>85.79</td><td>91.49</td><td>55.42</td></tr><tr><td>d</td><td>1.00</td><td>152K</td><td>5.5M</td><td>0.58</td><td>84.21</td><td>90.77</td><td>61.13</td></tr><tr><td>d-e</td><td>0.63</td><td>95K</td><td>3.5M</td><td>0.36</td><td>82.93</td><td>90.89</td><td>56.16</td></tr><tr><td>e</td><td>1.00</td><td>38K</td><td>1.5 M</td><td>0.15</td><td>77.09</td><td>89.62</td><td>54.16</td></tr><tr><td>Standalone (Liang et al., 2020)</td><td>1.00</td><td>1.8 M</td><td>3.6M</td><td>6.88</td><td>16.90</td><td>87.93</td><td>10.03</td></tr><tr><td>FedAvg (Liang et al., 2020)</td><td>1.00</td><td>1.8M</td><td>3.6M</td><td>6.88</td><td>67.74</td><td>58.99</td><td>58.99</td></tr><tr><td>LG-FedAvg (Liang et al., 2020)</td><td>1.00</td><td>1.8 M</td><td>3.6M</td><td>6.88</td><td>69.76</td><td>91.77</td><td>60.79</td></tr></table>
|
| 118 |
+
|
| 119 |
+
Table 2: Results of combination of various computation complexity levels for CIFAR10 dataset. Full results can be found in Table 8.
|
| 120 |
+
|
| 121 |
+
# 5 CONCLUSIONS AND FUTURE WORK
|
| 122 |
+
|
| 123 |
+
We propose Heterogeneous Federated Learning (HeteroFL), which shows the possibility of coordinatively training local models much smaller than a global model to produce a single global inference model. Our experiments show that FL can be made more practical by introducing HeteroFL and sBN and Mased Cross-Entropy Loss, as HeteroFL fully exploits local clients’ capabilities and achieves better results with a fewer number of communication rounds. We demonstrate our results with various model architectures, including CNN, PreResNet18, and Transformer, and show that our method is robust to statistical heterogeneity and dynamically varying local capabilities. A future direction is to distinct model classes as well as model heterogeneity. Also, the proposed methods may be emulated to address heterogeneous few-shot learning, multi-modal learning, and multi-task learning.
|
| 124 |
+
|
| 125 |
+
Table 3: Results of combination of various computation complexity levels for WikiText2 dataset. Full results can be found in Table 9.
|
| 126 |
+
|
| 127 |
+
<table><tr><td>Model</td><td>Ratio</td><td>Parameters</td><td>FLOPs</td><td>Space (MB)</td><td>Perplexity</td></tr><tr><td>a</td><td>1.00</td><td>19.3 M</td><td>1.4 B</td><td>73.49</td><td>3.37</td></tr><tr><td>a-e</td><td>0.53</td><td>10.2 M</td><td>718.6M</td><td>38.86</td><td>3.75</td></tr><tr><td>a-b-c-d-e</td><td>0.37</td><td>7.2 M</td><td>496.6 M</td><td>27.55</td><td>3.55</td></tr><tr><td>b</td><td>1.00</td><td>9.1 M</td><td>614.8M</td><td>34.74</td><td>3.46</td></tr><tr><td>b-e</td><td>0.56</td><td>5.1 M</td><td>342.0M</td><td>19.49</td><td>3.90</td></tr><tr><td>b-c-d-e</td><td>0.46</td><td>4.2 M</td><td>278.7M</td><td>16.07</td><td>3.64</td></tr><tr><td>C</td><td>1.00</td><td>4.4 M</td><td>290.1 M</td><td>16.92</td><td>3.62</td></tr><tr><td>c-e</td><td>0.62</td><td>2.8M</td><td>179.7M</td><td>10.57</td><td>3.89</td></tr><tr><td>c-d-e</td><td>0.58</td><td>2.6M</td><td>166.7M</td><td>9.85</td><td>3.66</td></tr><tr><td>d</td><td>1.00</td><td>2.2M</td><td>140.7M</td><td>8.39</td><td>3.83</td></tr><tr><td>d-e</td><td>0.75</td><td>1.7 M</td><td>105.0 M</td><td>6.31</td><td>3.90</td></tr><tr><td>e</td><td>1.00</td><td>1.1 M</td><td>69.3 M</td><td>4.23</td><td>7.41</td></tr></table>
|
| 128 |
+
|
| 129 |
+
Table 4: Ablation Study of IID scenarios. The single-letter models ’a’ and ’e’ are FedAvg equiped with various normalization methods. The sBN significantly outperforms other existing normalization methods, including the InstanceNorm (IN), GroupNorm (GN) (the number of group $\mathrm { G } { = } 4$ ), and LayerNorm (LN). Scaler is used for HeteroFL to train models of different sizes and moderately improve the results.
|
| 130 |
+
|
| 131 |
+
<table><tr><td rowspan="2">Model</td><td rowspan="2">Normalization</td><td rowspan="2">Scaler</td><td colspan="2">Accuracy IID</td></tr><tr><td>MNIST</td><td>CIFAR10</td></tr><tr><td rowspan="5">a</td><td>None</td><td rowspan="4">N/A</td><td>99.2</td><td>81.3</td></tr><tr><td>IN</td><td>99.5</td><td>87.7</td></tr><tr><td>GN</td><td>99.5</td><td>81.0</td></tr><tr><td>LN</td><td>99.5</td><td>77.3</td></tr><tr><td>sBN</td><td></td><td>99.6</td><td>91.7</td></tr><tr><td rowspan="5">e</td><td>None</td><td rowspan="5">N/A</td><td>98.6</td><td>58.1</td></tr><tr><td>IN</td><td>97.4</td><td>66.4</td></tr><tr><td>GN</td><td>98.7</td><td>62.6</td></tr><tr><td>LN</td><td>98.6</td><td>53.7</td></tr><tr><td>sBN</td><td>98.7</td><td>77.0</td></tr><tr><td rowspan="5">a-e</td><td>None</td><td rowspan="2">X</td><td>99.5</td><td>80.1</td></tr><tr><td>sBN</td><td>99.0</td><td>90.1</td></tr><tr><td>None</td><td rowspan="4">『</td><td>99.2</td><td>80.4</td></tr><tr><td>IN</td><td>99.5</td><td>86.6</td></tr><tr><td>GN</td><td>99.5</td><td>76.0</td></tr><tr><td>LN</td><td>99.4</td><td>71.7</td></tr><tr><td rowspan="2"></td><td></td><td></td><td></td><td></td></tr><tr><td>sBN</td><td></td><td>99.5</td><td>90.1</td></tr></table>
|
| 132 |
+
|
| 133 |
+
# ACKNOWLEDGMENTS
|
| 134 |
+
|
| 135 |
+
This work was supported by the Office of Naval Research (ONR) under grant number N00014-18- 1-2244, and the Army Research Office (ARO) under grant number W911NF-20-1-0222.
|
| 136 |
+
|
| 137 |
+
# REFERENCES
|
| 138 |
+
|
| 139 |
+
Dan Alistarh, Demjan Grubic, Jerry Li, Ryota Tomioka, and Milan Vojnovic. Qsgd: Communication-efficient sgd via gradient quantization and encoding. In Advances in Neural Information Processing Systems, pp. 1709–1720, 2017.
|
| 140 |
+
|
| 141 |
+
Mathieu Andreux, Jean Ogier du Terrail, Constance Beguier, and Eric W Tramel. Siloed federated learning for multi-centric histopathology datasets. In Domain Adaptation and Representation Transfer, and Distributed and Collaborative Learning, pp. 129–139. Springer, 2020.
|
| 142 |
+
|
| 143 |
+
Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E Hinton. Layer normalization. arXiv preprint arXiv:1607.06450, 2016.
|
| 144 |
+
|
| 145 |
+
Tal Ben-Nun and Torsten Hoefler. Demystifying parallel and distributed deep learning: An in-depth concurrency analysis. ACM Computing Surveys (CSUR), 52(4):1–43, 2019.
|
| 146 |
+
|
| 147 |
+
Keith Bonawitz, Hubert Eichner, Wolfgang Grieskamp, Dzmitry Huba, Alex Ingerman, Vladimir Ivanov, Chloe Kiddon, Jakub Konecnˇ y, Stefano Mazzocchi, H Brendan McMahan, et al. Towards \` federated learning at scale: System design. arXiv preprint arXiv:1902.01046, 2019.
|
| 148 |
+
|
| 149 |
+
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.
|
| 150 |
+
|
| 151 |
+
Jonathan Frankle and Michael Carbin. The lottery ticket hypothesis: Finding sparse, trainable neural networks. arXiv preprint arXiv:1803.03635, 2018.
|
| 152 |
+
|
| 153 |
+
Song Han, Huizi Mao, and William J Dally. Deep compression: Compressing deep neural networks with pruning, trained quantization and huffman coding. arXiv preprint arXiv:1510.00149, 2015.
|
| 154 |
+
|
| 155 |
+
Andrew Hard, Kanishka Rao, Rajiv Mathews, Swaroop Ramaswamy, Franc¸oise Beaufays, Sean Augenstein, Hubert Eichner, Chloe Kiddon, and Daniel Ramage. Federated learning for mobile´ keyboard prediction. arXiv preprint arXiv:1811.03604, 2018.
|
| 156 |
+
|
| 157 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Identity mappings in deep residual networks. In European conference on computer vision, pp. 630–645. Springer, 2016.
|
| 158 |
+
|
| 159 |
+
Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. arXiv preprint arXiv:1502.03167, 2015.
|
| 160 |
+
|
| 161 |
+
Nikita Ivkin, Daniel Rothchild, Enayat Ullah, Ion Stoica, Raman Arora, et al. Communicationefficient distributed sgd with sketching. In Advances in Neural Information Processing Systems, pp. 13144–13154, 2019.
|
| 162 |
+
|
| 163 |
+
Yihan Jiang, Jakub Konecnˇ y, Keith Rush, and Sreeram Kannan. Improving federated learning per- \` sonalization via model agnostic meta learning. arXiv preprint arXiv:1909.12488, 2019.
|
| 164 |
+
|
| 165 |
+
Mikhail Khodak, Maria-Florina F Balcan, and Ameet S Talwalkar. Adaptive gradient-based metalearning methods. In Advances in Neural Information Processing Systems, pp. 5917–5928, 2019.
|
| 166 |
+
|
| 167 |
+
Jakub Konecnˇ y, H Brendan McMahan, Felix X Yu, Peter Richt\` arik, Ananda Theertha Suresh, and´ Dave Bacon. Federated learning: Strategies for improving communication efficiency. arXiv preprint arXiv:1610.05492, 2016.
|
| 168 |
+
|
| 169 |
+
Alex Krizhevsky et al. Learning multiple layers of features from tiny images. 2009.
|
| 170 |
+
|
| 171 |
+
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.
|
| 172 |
+
|
| 173 |
+
Ang Li, Jingwei Sun, Binghui Wang, Lin Duan, Sicheng Li, Yiran Chen, and Hai Li. Lotteryfl: Personalized and communication-efficient federated learning with lottery ticket hypothesis on non-iid datasets. arXiv preprint arXiv:2008.03371, 2020a.
|
| 174 |
+
|
| 175 |
+
Daliang Li and Junpu Wang. Fedmd: Heterogenous federated learning via model distillation. arXiv preprint arXiv:1910.03581, 2019.
|
| 176 |
+
|
| 177 |
+
Tian Li, Anit Kumar Sahu, Ameet Talwalkar, and Virginia Smith. Federated learning: Challenges, methods, and future directions. IEEE Signal Processing Magazine, 37(3):50–60, 2020b.
|
| 178 |
+
Paul Pu Liang, Terrance Liu, Liu Ziyin, Ruslan Salakhutdinov, and Louis-Philippe Morency. Think locally, act globally: Federated learning with local and global representations. arXiv preprint arXiv:2001.01523, 2020.
|
| 179 |
+
Wei Yang Bryan Lim, Nguyen Cong Luong, Dinh Thai Hoang, Yutao Jiao, Ying-Chang Liang, Qiang Yang, Dusit Niyato, and Chunyan Miao. Federated learning in mobile edge networks: A comprehensive survey. IEEE Communications Surveys & Tutorials, 2020.
|
| 180 |
+
Lingjuan Lyu, Han Yu, and Qiang Yang. Threats to federated learning: A survey. arXiv preprint arXiv:2003.02133, 2020.
|
| 181 |
+
Yishay Mansour, Mehryar Mohri, Jae Ro, and Ananda Theertha Suresh. Three approaches for personalization with applications to federated learning. arXiv preprint arXiv:2002.10619, 2020.
|
| 182 |
+
Brendan McMahan, Eider Moore, Daniel Ramage, Seth Hampson, and Blaise Aguera y Arcas. Communication-efficient learning of deep networks from decentralized data. In Artificial Intelligence and Statistics, pp. 1273–1282. PMLR, 2017.
|
| 183 |
+
Luca Melis, Congzheng Song, Emiliano De Cristofaro, and Vitaly Shmatikov. Exploiting unintended feature leakage in collaborative learning. In 2019 IEEE Symposium on Security and Privacy (SP), pp. 691–706. IEEE, 2019.
|
| 184 |
+
Stephen Merity, Caiming Xiong, James Bradbury, and Richard Socher. Pointer sentinel mixture models. arXiv preprint arXiv:1609.07843, 2016.
|
| 185 |
+
Takayuki Nishio and Ryo Yonetani. Client selection for federated learning with heterogeneous resources in mobile edge. In ICC 2019-2019 IEEE International Conference on Communications (ICC), pp. 1–7. IEEE, 2019.
|
| 186 |
+
Virginia Smith, Chao-Kai Chiang, Maziar Sanjabi, and Ameet S Talwalkar. Federated multi-task learning. In Advances in Neural Information Processing Systems, pp. 4424–4434, 2017.
|
| 187 |
+
Nitish Srivastava, Geoffrey Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov. Dropout: a simple way to prevent neural networks from overfitting. The journal of machine learning research, 15(1):1929–1958, 2014.
|
| 188 |
+
Mingxing Tan and Quoc V Le. Efficientnet: Rethinking model scaling for convolutional neural networks. arXiv preprint arXiv:1905.11946, 2019.
|
| 189 |
+
Chandra Thapa, Mahawaga Arachchige Pathum Chamikara, and Seyit Camtepe. Splitfed: When federated learning meets split learning. arXiv preprint arXiv:2004.12088, 2020.
|
| 190 |
+
Dmitry Ulyanov, Andrea Vedaldi, and Victor Lempitsky. Instance normalization: The missing ingredient for fast stylization. arXiv preprint arXiv:1607.08022, 2016.
|
| 191 |
+
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.
|
| 192 |
+
Kangkang Wang, Rajiv Mathews, Chloe Kiddon, Hubert Eichner, Franc¸oise Beaufays, and Daniel ´ Ramage. Federated evaluation of on-device personalization. arXiv preprint arXiv:1910.10252, 2019.
|
| 193 |
+
Yuxin Wu and Kaiming He. Group normalization. In Proceedings of the European conference on computer vision (ECCV), pp. 3–19, 2018.
|
| 194 |
+
Xun Xian, Xinran Wang, Jie Ding, and Reza Ghanadan. Assisted learning: a framework for multiorganization learning. NeurIPS 2020 (spotlight), 2020.
|
| 195 |
+
Sergey Zagoruyko and Nikos Komodakis. Wide residual networks. arXiv preprint arXiv:1605.07146, 2016.
|
| 196 |
+
|
| 197 |
+
Bo Zhao, Konda Reddy Mopuri, and Hakan Bilen. idlg: Improved deep leakage from gradients. arXiv preprint arXiv:2001.02610, 2020.
|
| 198 |
+
|
| 199 |
+
Yue Zhao, Meng Li, Liangzhen Lai, Naveen Suda, Damon Civin, and Vikas Chandra. Federated learning with non-iid data. arXiv preprint arXiv:1806.00582, 2018.
|
| 200 |
+
|
| 201 |
+
Ligeng Zhu, Zhijian Liu, and Song Han. Deep leakage from gradients. In Advances in Neural Information Processing Systems, pp. 14774–14784, 2019.
|
| 202 |
+
|
| 203 |
+
# A APPENDIX
|
| 204 |
+
|
| 205 |
+
The appendix contains supplementary experimental results. In Table 5 we show the ablation study of Non-IID experiments. Compared to results of IID experiments shown in Table 4, Table .5 shows the ablation study Maksed CrossEntropy which is shown beneficial for balanced Non-IID data partition. In Table 6, we show the hyperparameters adopted in our experiments. In Figure 3 and 4, we show the Fix complexity assignments of MNIST and WikiText with iid data partition experiments. From Figure 6 to 8, we show the Fix complexity assignments for all balanced Non-IID data partition experiments. Figure 9 to 11, we show the learning curve of experiments with Dyanmic complexity assignments. The complete results for all experiments with Dyanmic complexity assignments can be found in Table 7, 8, and 9.
|
| 206 |
+
|
| 207 |
+
Table 5: Ablation Study of Non-IID scenarios. The Masked CrossEntropy is used for Non-IID experiments. It significantly improves the local performance and moderately improves global performance. Single letter model ’a’ and ’e’ are FedAvg equipped with various normalization methods. The sBN significantly outperforms other existing normalization methods, including InstanceNorm (IN), GroupNorm (GN) (the number of group $\mathrm { G } { = } 4$ ), and LayerNorm (LN). Scaler is used for HeteroFL to train models of different sizes and moderately improve the results.
|
| 208 |
+
|
| 209 |
+
<table><tr><td rowspan="2">Model</td><td rowspan="2">Normalization</td><td rowspan="2">Scaler</td><td rowspan="2">Masked CrossEntropy</td><td colspan="4">Accuracy Non-IID</td></tr><tr><td>MNIST</td><td></td><td>CIFAR10</td><td></td></tr><tr><td rowspan="7">a</td><td>None</td><td></td><td></td><td>Local 97.4</td><td>Global 97.4</td><td>Local 42.6</td><td>Global 42.8</td></tr><tr><td>sBN</td><td>N/A</td><td>X</td><td>99.4</td><td>99.4</td><td>53.4</td><td>53.7</td></tr><tr><td>None</td><td></td><td></td><td>99.7</td><td>95.6</td><td>91.7</td><td>58.5</td></tr><tr><td>IN</td><td rowspan="4">N/A</td><td rowspan="4">!</td><td>99.8</td><td>98.7</td><td>88.4</td><td>43.7</td></tr><tr><td>GN</td><td>99.7</td><td>98.3</td><td>91.2</td><td>58.2</td></tr><tr><td>LN</td><td>99.8</td><td>98.3</td><td>89.9</td><td>54.2</td></tr><tr><td>SBN</td><td>99.9</td><td>98.6</td><td>92.1</td><td>59.2</td></tr><tr><td rowspan="6">e</td><td>None</td><td rowspan="2">N/A</td><td rowspan="2">X</td><td>96.2</td><td>96.0</td><td>38.9</td><td>38.2</td></tr><tr><td>sBN</td><td>90.1</td><td>90.1</td><td>40.7</td><td>40.4</td></tr><tr><td>None</td><td rowspan="4">N/A</td><td rowspan="4">√</td><td>99.5</td><td>96.5</td><td>86.6</td><td>48.9</td></tr><tr><td>IN</td><td>98.5</td><td>89.8</td><td>83.7</td><td>37.0</td></tr><tr><td>GN</td><td>99.2</td><td>92.2</td><td>83.5</td><td>36.7</td></tr><tr><td>LN</td><td>99.3 99.3</td><td>94.0</td><td>82.6</td><td>40.0</td></tr><tr><td rowspan="11">a-e</td><td>sBN None</td><td>X</td><td>X</td><td>96.8</td><td>94.2 96.9</td><td>90.1 37.8</td><td>52.9 37.4</td></tr><tr><td>sBN</td><td></td><td></td><td>99.2</td><td>99.2</td><td>41.0</td><td>41.3</td></tr><tr><td>None sBN</td><td rowspan="2">X</td><td rowspan="2">√</td><td></td><td>95.7</td><td></td><td></td></tr><tr><td></td><td>99.4 99.8</td><td>98.0</td><td>89.1 90.7</td><td>52.8</td></tr><tr><td></td><td rowspan="2">√</td><td></td><td></td><td></td><td></td><td>57.7</td></tr><tr><td>None sBN</td><td>X</td><td>97.3 99.3</td><td>97.3 99.3</td><td>34.6 46.0</td><td>34.4</td></tr><tr><td></td><td></td><td rowspan="4">√</td><td>99.5</td><td></td><td></td><td></td><td>46.7</td></tr><tr><td>None</td><td rowspan="3">√</td><td>99.8</td><td></td><td>95.8</td><td>90.3</td><td>55.6</td></tr><tr><td>IN GN</td><td>99.5</td><td></td><td>98.7 96.2</td><td>87.0 88.7</td><td>34.4 49.7</td></tr><tr><td>LN</td><td>99.5</td><td>96.2</td><td></td><td>78.5</td><td>25.0</td></tr><tr><td></td><td></td><td rowspan="4"></td><td rowspan="4"></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>sBN</td><td></td><td>99.8</td><td>98.2</td><td>92.8</td><td>60.4</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td></tr></table>
|
| 210 |
+
|
| 211 |
+
Table 6: Hyperparameters and model architecture used in our experiments.
|
| 212 |
+
|
| 213 |
+
<table><tr><td>Data Model</td><td></td><td>MNIST CNN</td><td>CIFAR10 PreResNet18</td><td>WikiText2 Transformer</td></tr><tr><td>Hidden size</td><td></td><td>[64,128,256,512]</td><td>[64,128,256,512]</td><td>[512, 512,512, 512]</td></tr><tr><td>Local Epoch E</td><td></td><td>5</td><td>5</td><td>1</td></tr><tr><td>Local Batch Size B</td><td></td><td>10</td><td>10</td><td>100</td></tr><tr><td>Optimizer</td><td></td><td></td><td>SGD</td><td></td></tr><tr><td>Momentum</td><td></td><td></td><td>0.9</td><td></td></tr><tr><td>Weight decay</td><td>0.01</td><td></td><td>5.00E-04</td><td></td></tr><tr><td>Learning rate n</td><td></td><td></td><td>0.1</td><td>0.1</td></tr><tr><td>Communication rounds</td><td>ID</td><td>200</td><td>400</td><td>100</td></tr><tr><td></td><td>non-IID</td><td>400</td><td>800</td><td>200</td></tr><tr><td>Decay schedule (0.1)</td><td>IID</td><td>[100]</td><td>[150,250]</td><td>[25,50]</td></tr><tr><td></td><td>non-IID</td><td>[200]</td><td>[300,500]</td><td>[50,100]</td></tr><tr><td>Embedding Size</td><td></td><td></td><td></td><td>256</td></tr><tr><td>Number of heads</td><td></td><td>N/A</td><td></td><td>8</td></tr><tr><td>Dropout</td><td></td><td></td><td></td><td>0.2</td></tr><tr><td>Sequence length</td><td></td><td></td><td></td><td>64</td></tr></table>
|
| 214 |
+
|
| 215 |
+

|
| 216 |
+
Figure 3: Interpolation experimental results for MNIST (IID) dataset between global model complexity ((a) a, (b) b, (c) c, (d) d) and various smaller model complexities.
|
| 217 |
+
|
| 218 |
+

|
| 219 |
+
Figure 4: Interpolation experimental results for WikiText2 (IID) dataset between global model complexity ((a) a, (b) b, (c) c, (d) d) and various smaller model complexities.
|
| 220 |
+
|
| 221 |
+

|
| 222 |
+
Figure 5: Interpolation experimental results for MNIST (non-IID, Local) dataset between global model complexity ((a) a, (b) b, (c) c, (d) d) and various smaller model complexities.
|
| 223 |
+
|
| 224 |
+

|
| 225 |
+
Figure 6: Interpolation experimental results for CIFAR10 (non-IID, Local) dataset between global model complexity ((a) a, (b) b, (c) c, (d) d) and various smaller model complexities.
|
| 226 |
+
|
| 227 |
+

|
| 228 |
+
Figure 7: Interpolation experimental results for MNIST (non-IID, Global) dataset between global model complexity ((a) a, (b) b, (c) c, (d) d) and various smaller model complexities.
|
| 229 |
+
|
| 230 |
+

|
| 231 |
+
Figure 8: Interpolation experimental results for CIFAR10 (non-IID, Global) dataset between global model complexity ((a) a, (b) b, (c) c, (d) d) and various smaller model complexities.
|
| 232 |
+
|
| 233 |
+

|
| 234 |
+
Figure 9: Learning curves of MNIST datasets with $50 \%$ Fix and Dynamic computation complexity assignments.
|
| 235 |
+
|
| 236 |
+

|
| 237 |
+
Figure 10: Learning curves of CIFAR10 datasets with $50 \%$ Fix and Dynamic computation complexity assignments.
|
| 238 |
+
|
| 239 |
+

|
| 240 |
+
Figure 11: Learning curves of WikiText2 datasets with $50 \%$ Fix and Dynamic computation complexity assignments.
|
| 241 |
+
|
| 242 |
+
<table><tr><td rowspan="2">Model</td><td rowspan="2">Ratio</td><td rowspan="2">Parameters</td><td rowspan="2">FLOPs</td><td rowspan="2">Space (MB)</td><td rowspan="2"></td><td colspan="2">Accuracy</td></tr><tr><td rowspan="2">IID</td><td colspan="2">Non-IID</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td>Local</td><td>Global</td></tr><tr><td>a</td><td>1.00</td><td>1.6 M</td><td>80.5M</td><td>5.94</td><td>99.53</td><td>99.85</td><td>98.92</td></tr><tr><td>a-b</td><td>0.63</td><td>974.1 K</td><td>50.5M</td><td>3.72</td><td>99.54</td><td>99.96</td><td>99.10</td></tr><tr><td>a-c</td><td>0.53</td><td>827.9 K</td><td>42.9 M</td><td>3.16</td><td>99.52</td><td>99.89</td><td>99.12</td></tr><tr><td>a-d</td><td>0.51</td><td>791.1 K</td><td>41.0 M</td><td>3.02</td><td>99.54</td><td>99.81</td><td>98.37</td></tr><tr><td>a-e</td><td>0.50</td><td>781.7 K</td><td>40.5M</td><td>2.98</td><td>99.46</td><td>99.89</td><td>98.96</td></tr><tr><td>a-b-c</td><td>0.44</td><td>682.4K</td><td>35.4M</td><td>2.60</td><td>99.53</td><td>99.90</td><td>98.72</td></tr><tr><td>a-b-d</td><td>0.42</td><td>657.8 K</td><td>34.1M</td><td>2.51</td><td>99.52</td><td>99.78</td><td>98.02</td></tr><tr><td>a-b-e</td><td>0.42</td><td>651.6K</td><td>33.8M</td><td>2.49</td><td>99.54</td><td>99.95</td><td>98.92</td></tr><tr><td>a-c-d</td><td>0.36</td><td>560.4K</td><td>29.1M</td><td>2.14</td><td>99.57</td><td>99.95</td><td>99.34</td></tr><tr><td>a-c-e</td><td>0.36</td><td>554.1 K</td><td>28.7M</td><td>2.11</td><td>99.52</td><td>99.94</td><td>98.43</td></tr><tr><td>a-d-e</td><td>0.34</td><td>529.6K</td><td>27.4 M</td><td>2.02</td><td>99.57</td><td>99.80</td><td>98.92</td></tr><tr><td>a-b-c-d</td><td>0.33</td><td>518.1K</td><td>26.9 M</td><td>1.98</td><td>99.54</td><td>99.80</td><td>99.03</td></tr><tr><td>a-b-c-e</td><td>0.33</td><td>513.4 K</td><td>26.7M</td><td>1.96</td><td>99.46</td><td>99.69</td><td>97.53</td></tr><tr><td>a-b-d-e</td><td>0.32</td><td>495.0 K</td><td>25.7M</td><td>1.89</td><td>99.49</td><td>99.85</td><td>98.66</td></tr><tr><td>a-c-d-e</td><td>0.27</td><td>421.9 K</td><td>21.9 M</td><td>1.61</td><td>99.54</td><td>99.84</td><td>98.80</td></tr><tr><td>a-b-c-d-e</td><td>0.27</td><td>415.8K</td><td>21.6M</td><td>1.59</td><td>99.46</td><td>99.85</td><td>98.29</td></tr><tr><td>b</td><td>1.00</td><td>391.4 K</td><td>20.5M</td><td>1.49</td><td>99.53</td><td>99.87</td><td>99.10</td></tr><tr><td>b-c</td><td>0.63</td><td>245.1 K</td><td>12.9 M</td><td>0.94</td><td>99.49</td><td>99.87</td><td>99.05</td></tr><tr><td>b-d</td><td>0.53</td><td>208.3K</td><td>11.0 M</td><td>0.79</td><td>99.44</td><td>99.85</td><td>98.95</td></tr><tr><td>b-e</td><td>0.51</td><td>199.0K</td><td>10.4 M</td><td>0.76</td><td>99.51</td><td>99.67</td><td>98.51</td></tr><tr><td>b-c-d</td><td>0.44</td><td>171.9 K</td><td>9.1M</td><td>0.66</td><td>99.54</td><td>99.84</td><td>98.98</td></tr><tr><td>b-c-e</td><td>0.42</td><td>165.6K</td><td>8.7M</td><td>0.63</td><td>99.51</td><td>99.85</td><td>98.20</td></tr><tr><td>b-d-e</td><td>0.36</td><td>141.1 K</td><td>7.4M</td><td>0.54</td><td>99.48</td><td>99.89</td><td>98.72</td></tr><tr><td>b-c-d-e</td><td>0.33</td><td>130.5K</td><td>6.9 M</td><td>0.50</td><td>99.52</td><td>99.88</td><td>98.99</td></tr><tr><td>C</td><td>1.00</td><td>98.9K</td><td>5.3 M</td><td>0.38</td><td>99.35</td><td>99.56</td><td>96.34</td></tr><tr><td>c-d</td><td>0.63</td><td>62.1K</td><td>3.4M</td><td>0.24</td><td>99.38</td><td>99.92</td><td>99.05</td></tr><tr><td>c-e</td><td>0.53</td><td>52.8K</td><td>2.9 M</td><td>0.20</td><td>99.39</td><td>99.79</td><td>97.27</td></tr><tr><td>c-d-e</td><td>0.44</td><td>43.6K</td><td>2.4M</td><td>0.17</td><td>99.31</td><td>99.76</td><td>97.85</td></tr><tr><td>d</td><td>1.00</td><td>25.3K</td><td>1.4 M</td><td>0.10</td><td>99.17</td><td>99.86</td><td>97.86</td></tr><tr><td>d-e</td><td>0.63</td><td>15.9 K</td><td>909.5K</td><td>0.06</td><td>99.19</td><td>99.63</td><td>97.70</td></tr><tr><td>e</td><td>1.00</td><td>6.6K</td><td>400.5K</td><td>0.03</td><td>98.66</td><td>99.07</td><td>92.84</td></tr><tr><td>Standalone (Liang et al.,2020)</td><td>1.00</td><td>633.2 K</td><td>1.3 M</td><td>2.42</td><td>86.24</td><td>98.72</td><td>30.41</td></tr><tr><td>FedAvg (Liang et al., 2020)</td><td>1.00</td><td>633.2K</td><td>1.3 M</td><td>2.42</td><td>97.93</td><td>98.20</td><td>98.20</td></tr><tr><td>LG-FedAvg (Liang et al., 2020)</td><td>1.00</td><td>633.2K</td><td>1.3 M</td><td>2.42</td><td>97.93</td><td>98.54</td><td>98.17</td></tr></table>
|
| 243 |
+
|
| 244 |
+
Table 7: Results of combination of various computation complexity levels for MNIST dataset.
|
| 245 |
+
|
| 246 |
+
<table><tr><td rowspan="2">Model</td><td rowspan="2">Ratio</td><td rowspan="2">Parameters</td><td rowspan="2">FLOPs</td><td rowspan="2">Space (MB)</td><td colspan="3">Accuracy</td></tr><tr><td rowspan="2">IID</td><td colspan="2">Non-IID</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td>Local</td><td>Global</td></tr><tr><td>a</td><td>1.00</td><td>9.6M</td><td>330.2 M</td><td>36.71</td><td>91.19</td><td>92.38</td><td>56.88</td></tr><tr><td>a-b</td><td>0.63</td><td>6.0M</td><td>206.8M</td><td>22.95</td><td>90.60</td><td>91.35</td><td>59.93</td></tr><tr><td>a-c</td><td>0.53</td><td>5.1M</td><td>175.7M</td><td>19.50</td><td>90.59</td><td>92.83</td><td>60.25</td></tr><tr><td>a-d</td><td>0.51</td><td>4.9 M</td><td>167.9 M</td><td>18.64</td><td>90.28</td><td>91.78</td><td>56.54</td></tr><tr><td>a-e</td><td>0.50</td><td>4.8M</td><td>165.9 M</td><td>18.43</td><td>90.29</td><td>92.10</td><td>59.11</td></tr><tr><td>a-b-c</td><td>0.44</td><td>4.2M</td><td>144.9 M</td><td>16.07</td><td>89.70</td><td>90.41</td><td>54.16</td></tr><tr><td>a-b-d</td><td>0.42</td><td>4.1M</td><td>139.7M</td><td>15.49</td><td>89.98</td><td>90.29</td><td>51.79</td></tr><tr><td>a-b-e</td><td>0.42</td><td>4.0M</td><td>138.4M</td><td>15.35</td><td>89.79</td><td>90.79</td><td>62.17</td></tr><tr><td>a-c-d</td><td>0.36</td><td>3.5M</td><td>119.0 M</td><td>13.20</td><td>89.47</td><td>89.82</td><td>53.13</td></tr><tr><td>a-c-e</td><td>0.36</td><td>3.4M</td><td>117.6 M</td><td>13.05</td><td>89.35</td><td>93.59</td><td>57.30</td></tr><tr><td>a-d-e</td><td>0.34</td><td>3.3M</td><td>112.4 M</td><td>12.48</td><td>88.75</td><td>91.11</td><td>56.74</td></tr><tr><td>a-b-c-d</td><td>0.33</td><td>3.2M</td><td>110.1 M</td><td>12.19</td><td>89.33</td><td>91.32</td><td>54.50</td></tr><tr><td>a-b-c-e</td><td>0.33</td><td>3.2 M</td><td>109.1M</td><td>12.09</td><td>89.37</td><td>92.52</td><td>61.56</td></tr><tr><td>a-b-d-e</td><td>0.32</td><td>3.1M</td><td>105.1M</td><td>11.65</td><td>89.40</td><td>91.80</td><td>56.78</td></tr><tr><td>a-c-d-e</td><td>0.27</td><td>2.6M</td><td>89.6M</td><td>9.93</td><td>88.42</td><td>91.50</td><td>62.15</td></tr><tr><td>a-b-c-d-e</td><td>0.27</td><td>2.6M</td><td>88.4M</td><td>9.78</td><td>88.83</td><td>92.49</td><td>61.64</td></tr><tr><td>b</td><td>1.00</td><td>2.4M</td><td>83.3M</td><td>9.19</td><td>89.82</td><td>93.83</td><td>55.45</td></tr><tr><td>b-c</td><td>0.63</td><td>1.5M</td><td>52.3M</td><td>5.75</td><td>89.00</td><td>89.96</td><td>52.29</td></tr><tr><td>b-d</td><td>0.53</td><td>1.3 M</td><td>44.4M</td><td>4.88</td><td>89.18</td><td>91.78</td><td>51.07</td></tr><tr><td>b-e</td><td>0.51</td><td>1.2 M</td><td>42.4 M</td><td>4.67</td><td>89.10</td><td>90.68</td><td>59.81</td></tr><tr><td>b-c-d</td><td>0.44</td><td>1.1 M</td><td>36.7M</td><td>4.02</td><td>88.35</td><td>92.79</td><td>58.09</td></tr><tr><td>b-c-e</td><td>0.42</td><td>1.0 M</td><td>35.3M</td><td>3.88</td><td>87.98</td><td>91.98</td><td>58.28</td></tr><tr><td>b-d-e</td><td>0.36</td><td>866.3K</td><td>30.1M</td><td>3.30</td><td>88.06</td><td>91.94</td><td>54.02</td></tr><tr><td>b-c-d-e</td><td>0.33</td><td>800.7K</td><td>27.9 M</td><td>3.05</td><td>87.92</td><td>91.90</td><td>59.10</td></tr><tr><td>C</td><td>1.00</td><td>603.8K</td><td>21.2 M</td><td>2.30</td><td>87.55</td><td>91.09</td><td>55.12</td></tr><tr><td>c-d</td><td>0.63</td><td>377.8K</td><td>13.4M</td><td>1.44</td><td>86.75</td><td>91.58</td><td>54.61</td></tr><tr><td>c-e</td><td>0.53</td><td>321.1K</td><td>11.3 M</td><td>1.22</td><td>86.88</td><td>91.83</td><td>63.47</td></tr><tr><td>c-d-e</td><td>0.44</td><td>264.6K</td><td>9.4M</td><td>1.01</td><td>85.79</td><td>91.49</td><td>55.42</td></tr><tr><td>d</td><td>1.00</td><td>151.8 K</td><td>5.5M</td><td>0.58</td><td>84.21</td><td>90.77</td><td>61.13</td></tr><tr><td>d-e</td><td>0.63</td><td>95.1K</td><td>3.5M</td><td>0.36</td><td>82.93</td><td>90.89</td><td>56.16</td></tr><tr><td>e</td><td>1.00</td><td>38.4K</td><td>1.5 M</td><td>0.15</td><td>77.09</td><td>89.62</td><td>54.16</td></tr><tr><td>Standalone (Liang et al.,2020)</td><td>1.00</td><td>1.8 M</td><td>3.6M</td><td>6.88</td><td>16.90</td><td>87.93</td><td>10.03</td></tr><tr><td>FedAvg (Liang et al.,2020)</td><td>1.00</td><td>1.8 M</td><td>3.6M</td><td>6.88</td><td>67.74</td><td>58.99</td><td>58.99</td></tr><tr><td>LG-FedAvg (Liang et al., 2020)</td><td>1.00</td><td>1.8M</td><td>3.6M</td><td>6.88</td><td>69.76</td><td>91.77</td><td>60.79</td></tr></table>
|
| 247 |
+
|
| 248 |
+
Table 8: Results of combination of various computation complexity levels for CIFAR10 dataset.
|
| 249 |
+
|
| 250 |
+
<table><tr><td>Model</td><td>Ratio</td><td>Parameters</td><td>FLOPs</td><td>Space (MB)</td><td>Perplexity</td></tr><tr><td>a</td><td>1.00</td><td>19.3M</td><td>1.4 B</td><td>73.49</td><td>3.37</td></tr><tr><td>a-b</td><td>0.74</td><td>14.2 M</td><td>991.4M</td><td>54.12</td><td>3.31</td></tr><tr><td>a-c</td><td>0.62</td><td>11.8 M</td><td>829.0M</td><td>45.20</td><td>3.71</td></tr><tr><td>a-b-c</td><td>0.57</td><td>10.9M</td><td>757.6M</td><td>41.72</td><td>3.42</td></tr><tr><td>a-d</td><td>0.56</td><td>10.7M</td><td>754.3 M</td><td>40.94</td><td>3.74</td></tr><tr><td>a-b-d</td><td>0.53</td><td>10.2M</td><td>707.8 M</td><td>38.87</td><td>3.53</td></tr><tr><td>a-e</td><td>0.53</td><td>10.2M</td><td>718.6M</td><td>38.86</td><td>3.75</td></tr><tr><td>a-b-e</td><td>0.51</td><td>9.8M</td><td>684.0M</td><td>37.49</td><td>3.47</td></tr><tr><td>b</td><td>1.00</td><td>9.1M</td><td>614.8M</td><td>34.74</td><td>3.46</td></tr><tr><td>a-b-c-d</td><td>0.45</td><td>8.8M</td><td>603.4M</td><td>33.39</td><td>3.61</td></tr><tr><td>a-c-d</td><td>0.45</td><td>8.6M</td><td>599.6M</td><td>32.93</td><td>4.08</td></tr><tr><td>a-b-c-e</td><td>0.44</td><td>8.5M</td><td>585.5M</td><td>32.34</td><td>3.50</td></tr><tr><td>a-c-e</td><td>0.43</td><td>8.3M</td><td>575.8M</td><td>31.54</td><td>3.65</td></tr><tr><td>a-b-d-e</td><td>0.41</td><td>7.9M</td><td>548.2M</td><td>30.21</td><td>3.64</td></tr><tr><td>a-d-e</td><td>0.39</td><td>7.5 M</td><td>526.0M</td><td>28.70</td><td>4.02</td></tr><tr><td>a-b-c-d-e</td><td>0.37</td><td>7.2M</td><td>496.6M</td><td>27.55</td><td>3.55</td></tr><tr><td>b-c</td><td>0.74</td><td>6.8M</td><td>452.4M</td><td>25.83</td><td>3.45</td></tr><tr><td>a-c-d-e</td><td>0.35</td><td>6.8M</td><td>467.0M</td><td>25.76</td><td>3.92</td></tr><tr><td>b-d</td><td>0.62</td><td>5.7M</td><td>377.7M</td><td>21.57</td><td>3.70</td></tr><tr><td>b-c-d</td><td>0.58</td><td>5.2M</td><td>348.5M</td><td>20.02</td><td>3.47</td></tr><tr><td>b-e</td><td>0.56</td><td>5.1M</td><td>342.0M</td><td>19.49</td><td>3.90</td></tr><tr><td>b-c-e</td><td>0.54</td><td>4.9M</td><td>324.7M</td><td>18.63</td><td>3.46</td></tr><tr><td>C</td><td>1.00</td><td>4.4M</td><td>290.1M</td><td>16.92</td><td>3.62</td></tr><tr><td>b-c-d-e</td><td>0.46</td><td>4.2M</td><td>278.7M</td><td>16.07</td><td>3.64</td></tr><tr><td>b-d-e</td><td>0.45</td><td>4.1M</td><td>274.9M</td><td>15.79</td><td>3.92</td></tr><tr><td>c-d</td><td>0.75</td><td>3.3M</td><td>215.4M</td><td>12.66</td><td>3.46</td></tr><tr><td>c-e</td><td>0.62</td><td>2.8M</td><td>179.7M</td><td>10.57</td><td>3.89</td></tr><tr><td>c-d-e</td><td>0.58</td><td>2.6M</td><td>166.7 M</td><td>9.85</td><td>3.66</td></tr><tr><td>d</td><td>1.00</td><td>2.2M</td><td>140.7M</td><td>8.39</td><td>3.83</td></tr><tr><td>d-e</td><td>0.75</td><td>1.7M</td><td>105.0M</td><td>6.31</td><td>3.90</td></tr><tr><td>e</td><td>1.00</td><td>1.1 M</td><td>69.3M</td><td>4.23</td><td>7.41</td></tr></table>
|
| 251 |
+
|
| 252 |
+
Table 9: Results of combination of various computation complexity levels for WikiText2 dataset.
|
md/train/Vfs_2RnOD0H/Vfs_2RnOD0H.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/train/Xp5BhDKdil5/Xp5BhDKdil5.md
ADDED
|
@@ -0,0 +1,210 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Low-Rank Subspaces in GANs
|
| 2 |
+
|
| 3 |
+
Jiapeng Zhu1 Ruili Feng2,3 Yujun Shen4 Deli Zhao2 Zheng-Jun Zha3 Jingren Zhou2 Qifeng Chen1∗
|
| 4 |
+
|
| 5 |
+
1Hong Kong University of Science and Technology 2Alibaba Group 3University of Science and Technology of China 4ByteDance Inc.
|
| 6 |
+
{jengzhu0, ruilifengustc, shenyujun0302, zhaodeli}@gmail.com
|
| 7 |
+
zhazj@ustc.edu.cn jingren.zhou@alibaba-inc.com cqf@ust.hk
|
| 8 |
+
|
| 9 |
+
# Abstract
|
| 10 |
+
|
| 11 |
+
The latent space of a Generative Adversarial Network (GAN) has been shown to encode rich semantics within some subspaces. To identify these subspaces, researchers typically analyze the statistical information from a collection of synthesized data, and the identified subspaces tend to control image attributes globally (i.e., manipulating an attribute causes the change of an entire image). By contrast, this work introduces low-rank subspaces that enable more precise control of GAN generation. Concretely, given an arbitrary image and a region of interest (e.g., eyes of face images), we manage to relate the latent space to the image region with the Jacobian matrix and then use low-rank factorization to discover steerable latent subspaces. There are three distinguishable strengths of our approach that can be aptly called LowRankGAN. First, compared to analytic algorithms in prior work, our low-rank factorization of Jacobians is able to find the low-dimensional representation of attribute manifold, making image editing more precise and controllable. Second, low-rank factorization naturally yields a null space of attributes such that moving the latent code within it only affects the outer region of interest. Therefore, local image editing can be simply achieved by projecting an attribute vector into the null space without relying on a spatial mask as existing methods do. Third, our method can robustly work with a local region from one image for analysis yet well generalize to other images, making it much easy to use in practice. Extensive experiments on state-of-the-art GAN models (including StyleGAN2 and BigGAN) trained on various datasets demonstrate the effectiveness of our LowRankGAN1.
|
| 12 |
+
|
| 13 |
+
# 1 Introduction
|
| 14 |
+
|
| 15 |
+
Generative Adversarial Networks (GANs), which can produce high-fidelity images visually indistinguishable from real ones [18, 19, 4], have made tremendous progress in many real-world applications [16, 39, 32, 10, 38, 27, 7, 34]. Some recent studies [12, 26, 17] show that pre-trained GAN models spontaneously learn rich knowledge in latent spaces such that moving latent codes towards some certain directions can cause corresponding attribute change in images. In this way, we are able to control the generation process by identifying semantically meaningful latent subspaces.
|
| 16 |
+
|
| 17 |
+
For latent semantic discovery, one of the most straightforward ways is to first generate a collection of image synthesis, then label these images regarding a target attribute, and finally find the latent separation boundary through supervised training [12, 26, 17]. Prior work [30, 25, 14] has pointed out that the above pipeline could be limited by the labeling step (e.g., unable to identify semantics beyond well-defined annotations) and proposed to find steerable directions of the latent space in an unsupervised manner, such as using Principal Component Analysis (PCA) [14]. However, existing approaches prefer to discover global semantics, which alter the entire image as a whole and fail to relate a latent subspace to some particular image region. Consequently, they highly rely on spatial masks [29, 8, 2] to locally control the GAN generation, which is of more practical usage.
|
| 18 |
+
|
| 19 |
+
In this work, we bridge this gap by introducing a low-rank subspace of GAN latent space. Our approach, called LowRankGAN, starts with an arbitrary synthesis together with a region of interest, such as the eyes and nose in a face image or the ground in a scene image. Then, we manage to relate the latent space and the image region via computing the Jacobian matrix with the pre-trained generator. After that comes the core part of our algorithm, which is to perform low-rank factorization based on the resulting Jacobian matrix. Different from other analytic methods, the low-rank factorization of Jacobians is capable of uncovering the intrinsic low-dimensional representation of attribute manifold, thus helping solve more precise editing direction to the target attribute. Besides, the low-rank factorization naturally yields a null space of attributes such that moving the latent code within this subspace mainly affects the remaining image region. With such an appealing property, we can achieve local image control by projecting an attribute vector into the null space and using the projected result to modulate the latent code. This observation is far beyond trivial because the latent code is commonly regarded to act on the entire feature map of GAN generator [13, 4, 18]. We also find that the low-rank subspace derived from local regions of one image is widely applicable to other images. In other words, our approach requires only one sample instead of abundant data for analysis. More astonishingly, supposing that we identify a changing-color boundary on one car image, we can use this boundary to change the color of cars from other images, even the cars locate at a different spatial area or with different shapes. This suggests that the GAN latent space is locally semantic-aware. Moreover, LowRankGAN is strongly robust to the starting image region for Jacobian matrix computation. For instance, to control the sky in synthesized images, our algorithm does not necessarily rely on a rigid sky segmentation mask but can also satisfyingly work with a casual bounding box that marks the sky region (partially or completely), making it much easy to use in practice.
|
| 20 |
+
|
| 21 |
+
Our main contributions are summarized as follows. First, we study low-rank subspaces of the GAN latent space and manage to locally control the GAN image generation by simply modulating the latent code without the need for spatial masks. Second, our method can discover latent directions regarding local regions of only one image yet generalize to all images, shedding light on the intrinsic semantic-aware structure of GAN latent space. Third, we conduct comprehensive experiments to demonstrate the effectiveness and robustness of our algorithm on a wide range of models and datasets.
|
| 22 |
+
|
| 23 |
+
# 2 Related Work
|
| 24 |
+
|
| 25 |
+
Interpreting well-trained GAN models [1, 17, 26] has recently received wide attention because this can help us understand the internal representation learned by GANs [34] and further control the generation process [35, 38]. It is shown that some subspaces in the GAN latent space are highly related to the attributes occurring in the output images. To identify these semantically meaningful subspaces, existing approaches fall into two folds, i.e., supervised [12, 27, 17, 22] and unsupervised [30, 14, 25, 28]. On the one hand, supervised approaches seek help from off-the-shelf attribute classifiers [12, 27] or simple image transformations [17, 22] to annotate a set of synthesized data and then learn the latent subspaces from the labeled data. On the other hand, unsupervised approaches try to discover steerable latent dimensions by statistically analyzing the latent space [14], maximizing the mutual information between the latent space and the image space [30], or exploring model parameters [25, 28]. However, all of the subspaces detected by these approaches tend to control global image attributes such that the entire image will be modified if we edit a particular attribute. To achieve local image control, a common practice is to introduce a spatial mask [29, 8, 2, 34, 37], which works together with the intermediate feature maps of the GAN generator.
|
| 26 |
+
|
| 27 |
+
Compared to prior work, our LowRankGAN has the following differences: no spatial masks of objects are needed to perform precise local editing, and generic attribute vectors can be obtained with only one image synthesis and arbitrary local regions of interest without any training or statistical analysis on a large amount of data. To our best knowledge, we are the first to demonstrate the effectiveness of low-rank factorization in interpreting generative adversarial models. Although there are also some works using the Jacobian matrix to analyze the GAN latent space [24, 6, 31], the low-rank subspace enables precise generation control by providing the indispensable null space.
|
| 28 |
+
|
| 29 |
+
# 3 Low-Rank GAN
|
| 30 |
+
|
| 31 |
+
Let $z \in \mathbb { R } ^ { d _ { z } }$ and $G ( \cdot )$ denote the input latent code and the generator of a GAN, respectively. Prior work [12, 26, 17] has observed the relationship between some latent subspaces and image attributes such that we can achieve semantic manipulation on the synthesized sample, $G ( z )$ , by linearly transforming the latent code
|
| 32 |
+
|
| 33 |
+
$$
|
| 34 |
+
\pmb { x } ^ { \mathrm { e d i t } } = G ( \pmb { z } + \alpha \pmb { n } ) ,
|
| 35 |
+
$$
|
| 36 |
+
|
| 37 |
+
where $\mathbf { \nabla } _ { \mathbf { \pmb { n } } }$ denotes an attribute vector within the latent space, and $\alpha$ is the editing strength. However, the latent subspaces identified by existing approaches tend to manipulate the entire image as a whole and fail to control a local image region. Differently, our proposed LowRankGAN confirms that Eq. (1) can also be used to locally control the image generation. The following parts describe how to discover the low-rank subspaces from a pre-trained GAN model as well as its practical usage.
|
| 38 |
+
|
| 39 |
+
# 3.1 Degenerate Jacobian
|
| 40 |
+
|
| 41 |
+
First, we give the definition of Jacobian matrix. Let the real image $\pmb { x } \in \mathcal { R } ^ { d _ { x } }$ be in the $d _ { x }$ -dimensional space and the input prior $z \in \mathcal { R } ^ { d _ { z } }$ be of dimension $d _ { z }$ . For an arbitrary point $_ { z }$ , the Jacobian matrix $J _ { z }$ of the generator $G ( \cdot )$ with respect to $_ z$ is defined as $\begin{array} { r } { ( J _ { z } ) _ { j , k } = \bar { \frac { \partial \bar { G } ( z ) _ { j } } { \partial z _ { k } } } } \end{array}$ ∂G(z)j , where (Jz)j,k is the $( j , k )$ -th entry of $J _ { z } \in \mathcal { R } ^ { d _ { x } \times d _ { z } }$ . By the Taylor series, the first-order approximation to the edited result can be written as
|
| 42 |
+
|
| 43 |
+
$$
|
| 44 |
+
G ( z + \alpha { \pmb n } ) = G ( { \pmb z } ) + \alpha { \pmb J } _ { z } { \pmb n } + o ( \alpha ) .
|
| 45 |
+
$$
|
| 46 |
+
|
| 47 |
+
An effective editing direction should significantly alter $G ( z )$ , which can be attained by maximizing the following variance
|
| 48 |
+
|
| 49 |
+
$$
|
| 50 |
+
n = { \underset { \| \pmb { n } \| _ { 2 } = 1 } { \operatorname { a r g m a x } } } \ \| G ( \boldsymbol { z } + \alpha \pmb { n } ) - G ( \boldsymbol { z } ) \| _ { 2 } ^ { 2 } \approx { \underset { \| \pmb { n } \| _ { 2 } = 1 } { \operatorname { a r g m a x } } } \alpha ^ { 2 } \pmb { n } ^ { T } J _ { \boldsymbol { z } } ^ { T } J _ { \boldsymbol { z } } \pmb { n } .
|
| 51 |
+
$$
|
| 52 |
+
|
| 53 |
+
It is easy to know that the above optimization admits a closed-form solution, which is the eigenvector associated with the largest eigenvalue. Therefore, the subspace spanned by editing directions is the principal subspace of $\breve { J } _ { z } ^ { T } J _ { z }$ .
|
| 54 |
+
|
| 55 |
+
For GAN architectures, previous work [11] has proven and demonstrated that the Jacobian matrix $J _ { z } ^ { T } J _ { z }$ is degenerate, which is described by the following theorem.
|
| 56 |
+
|
| 57 |
+
Theorem 1 Assume that the real data $\mathcal { X }$ lie in some underlying manifold of dimension $d i m ( \mathcal X )$ embedded in the pixel space. Let $z _ { k } \in \mathcal { R } ^ { d _ { z } }$ denote the latent code of the $k$ -th layer of the generator of GAN over $\mathcal { X }$ and $J _ { z _ { k } }$ be the Jacobian of the generator with respect to $z _ { k }$ . Then we have $r a n k ( { J } _ { z _ { k + 1 } } ^ { T } { J } _ { z _ { k + 1 } } ) \leq r a n k ( { J } _ { z _ { k } } ^ { T } { J } _ { z _ { k } } ) \leq d _ { z }$ , where rank $( J _ { z } ^ { T } J _ { z } )$ denotes the rank of the Jacobian. Further, $; f d i m ( \mathcal { X } ) < d _ { z }$ , then ran $\mathbf { \sigma } ( J _ { z _ { k } } ^ { T } J _ { z _ { k } } ) < d _ { z }$ .
|
| 58 |
+
|
| 59 |
+
Theorem 1 says that the rank of the Jacobian $J _ { z } ^ { T } J _ { z }$ might be progressively reduced, and the manifold characterized by the generator admits a low-dimensional structure under a mild condition. Therefore, the attribute subspace must admit the analogous structure, which can be found by low-rank factorization of the Jacobian $J _ { z } ^ { T } J _ { z }$ .
|
| 60 |
+
|
| 61 |
+
# 3.2 Low-Rank Jacobian Subspace
|
| 62 |
+
|
| 63 |
+
In practice, the numerical evaluation indicates that the Jacobian is actually of full rank, implying that it is perturbed with noise during the highly nonlinear generation process. If we assume that such perturbation is sparse, then the low-dimensional structure of the attribute manifold can be perfectly revealed by low-rank factorization of $J _ { z } ^ { T } J _ { z }$ with corruption.
|
| 64 |
+
|
| 65 |
+
Given a low-rank matrix $M$ corrupted with sparse noise, the low-rank factorization can be formulated as $M = L + S$ , where $\pmb { L }$ is the low-rank matrix and $_ { s }$ is the corrupted sparse matrix. Directly solving this problem is actually very hard due to the non-convexity of the optimization. Hopefully, it can reduce to a tractable convex problem [33]:
|
| 66 |
+
|
| 67 |
+
$$
|
| 68 |
+
\operatorname* { m i n } _ { \pmb { L } , \pmb { S } } \| \pmb { L } \| _ { * } + \lambda \| \pmb { S } \| _ { 1 } \qquad \mathrm { s . t . } \quad \pmb { M } = \pmb { L } + \pmb { S } ,
|
| 69 |
+
$$
|
| 70 |
+
|
| 71 |
+
where $\begin{array} { r } { \| \pmb { L } \| _ { * } = \sum _ { i } \sigma _ { i } ( \boldsymbol { M } ) } \end{array}$ is the nuclear norm defined by the sum of all singular values, $\| S \| _ { 1 } =$ $\textstyle \sum _ { i j } | M _ { i j } |$ is the $\ell _ { 1 }$ norm defined by the sum of all absolute values in $_ { s }$ , and $\lambda$ is a positive weight parameter to balance the sparsity and the low rank. The convex optimization in Eq. (4) is also referred to as Principal Component Pursuit $( P C P )$ [5], which can be solved by the Alternating Directions Method of Multipliers (ADMM) [21, 3]. The detailed introduction of low-rank factorization and ADMM is presented in the Supplementary Material. Suppose that the solution for $J _ { z } ^ { T } J _ { z }$ in Eq. (4) is
|
| 72 |
+
|
| 73 |
+

|
| 74 |
+
Figure 1: Framework of LowRankGAN, which is able to precisely control the image generation of GANs. (a) Given an arbitrary synthesis and a region of interest, i.e., region A under mask, we relate the image region to the latent space with Jacobian matrix. The proposed low-rank subspace (red circle) is derived by performing low-rank factorization on the Jacobian, which naturally yields a null space (green circles). (b, c) The low-rank subspace and the null space correspond to the editing of region A and region B, respectively.
|
| 75 |
+
|
| 76 |
+
$$
|
| 77 |
+
M = J _ { z } ^ { T } J _ { z } = L ^ { * } + S ^ { * } ,
|
| 78 |
+
$$
|
| 79 |
+
|
| 80 |
+
where $L ^ { * }$ is the low-rank representation of $J _ { z } ^ { T } J _ { z }$ , which has rank $r$ corresponding to $r$ attributes in images. By singular value decomposition (SVD), we are able to specify those attributes
|
| 81 |
+
|
| 82 |
+
$$
|
| 83 |
+
U , \Sigma , V ^ { T } = \mathrm { S V D } ( L ^ { * } ) ,
|
| 84 |
+
$$
|
| 85 |
+
|
| 86 |
+
where $\pmb { \Sigma }$ is a diagonal matrix sorted by singular values, $U$ and $V = [ \pmb { v } _ { 1 } , \dots , \pmb { v } _ { r } , \dots , \pmb { v } _ { d _ { z } } ]$ are the matrices of left and right singular matrices containing $r$ attribute vectors associated with $r$ attributes. With $V$ , we can simply edit a specific attribute of an image by using $[ { \pmb v } _ { 1 } , \ldots , { \pmb v } _ { r } ]$ according to Eq. (1). In this paper, we mainly focus on the local control of an image. So we compute the Jacobian matrix with a specified region $M _ { \mathrm { r e g i o n } }$ in an image.
|
| 87 |
+
|
| 88 |
+
# 3.3 Precise Control via Null Space Projection
|
| 89 |
+
|
| 90 |
+
Here, a precise control means that the pixels in the remaining region change as little as possible when editing a specific region. For instance, if we want to close the eyes in a face image, the ideal scenario is that the other regions, such as mouth, nose, hair, and background, will keep unchanged. Previous works [14, 25, 22, 30] could edit some attributes in a specific region but without any control on the rest region, which actually results in a global change on the image when editing the region of interest. We solve the problem via algebraic principle and propose a universal method to fulfill the precise control by utilizing the null space of the Jacobian.
|
| 91 |
+
|
| 92 |
+
As shown in Fig. 1, if we want to edit some attributes (e.g., change color) of region A (the car body in the image), the ideal manipulation is that the remaining region B in the image will preserve unedited. A natural idea is that we could project the specific attribute vector ${ \mathbf { } } v _ { i }$ of region A into a space where the perturbation on the attribute direction has no effect on region B yet has an influence on region A. Specifically, we have attained $r _ { a }$ attribute vectors in $V$ that can change the attributes of region A, and the rest $d _ { z } - r _ { a }$ vectors in $V$ barely influence the region A. Similarly, we can also attain the attribute matrix $B = [ b _ { 1 } , \dots , b _ { d _ { z } } ]$ for region B via Eq. (6), which has $r _ { b }$ attribute vectors changing region B, and the remaining $d _ { z } - r _ { b }$ vectors barely influence the region B but contains some vectors that have some influence on region A. Note that $r _ { a } , r _ { b }$ are the rank of the matrices on regions A and B after performing low-rank factorization, respectively. We let $\boldsymbol { B } = [ B _ { 1 } , B _ { 2 } ]$ , where $\mathbf { \bar { \mathbf { B } } } _ { 1 } = [ \pmb { b } _ { 1 } , \dots , \pmb { b } _ { r _ { b } } ]$ and $B _ { 2 } = [ b _ { r _ { b } + 1 } , \ldots , b _ { d _ { z } } ]$ . Thus, the change in region B can be relieved by projecting the attribute vector ${ \mathbf { } } v _ { i }$ of region A to the orthogonal complementary space of $\scriptstyle { B _ { 1 } }$ , which we formulate as
|
| 93 |
+
|
| 94 |
+
$$
|
| 95 |
+
\pmb { p } = ( \pmb { I } - \pmb { B } _ { 1 } \pmb { B } _ { 1 } ^ { T } ) \pmb { v } _ { i } = \pmb { B } _ { 2 } \pmb { B } _ { 2 } ^ { T } \pmb { v } _ { i } ,
|
| 96 |
+
$$
|
| 97 |
+
|
| 98 |
+
where $\pmb { I }$ is the identity matrix. For our low-rank case, it is easy to know that $B _ { 2 }$ is the null space of the Jacobian of region B, i.e., the subspace associated with zero singular values.
|
| 99 |
+
|
| 100 |
+
However, a complete precise control might restrict the degree of editing in some special circumstances. For instance, the size of eyes will be limited if the eyebrows are kept still during editing. Or the edition of opening the mouth without any change of the chin is nearly impossible. Considering this factor, we propose precision relaxation to alleviate this issue. Recall that the total precise control is performed by projecting ${ \mathbf { } } v _ { i }$ into the null space of $\textbf { { B } }$ , where all the singular values are zeros. Hence, we can involve several attribute vectors that have small singular values in order to increase the diversity. We define the $r _ { \mathrm { r e l a x } }$ as the number of vectors used for relaxation. So the projection subspace becomes $B _ { 1 } = [ b _ { 1 } , \dots , b _ { r _ { \mathrm { r e l a x } } } ]$ and $B _ { 2 } = [ b _ { r _ { \mathrm { r e l a x } } } , \ldots , b _ { r _ { b } + 1 } , \ldots , b _ { d _ { z } } ]$ . Obviously, the larger $r _ { \mathrm { r e l a x } }$ is, the larger diversity we obtain. Otherwise, a small $r _ { \mathrm { r e l a x } }$ will result in little diversity.
|
| 101 |
+
|
| 102 |
+

|
| 103 |
+
Figure 2: Illustration of the effect of null spaces. (a, d) The masked regions B and A are used to obtain the null spaces through the low-rank decomposition of the Jacobians. (b, e) The images are manipulated by altering the latent code within the derived null spaces. (c, f) The heatmaps of the $\ell _ { 1 }$ loss between (a) and (b), (d) and (e), respectively, suggesting that editing within the null space barely affects the masked region of interest.
|
| 104 |
+
|
| 105 |
+
# 4 Experiments
|
| 106 |
+
|
| 107 |
+
In this section, we conduct experiments on two state-of-the-art GAN models, StyleGAN2 [19] and BigGAN [4], to validate the effectiveness of our proposed method. The datasets we use are diverse, including FFHQ [18], LSUN [36] and ImageNet [9]. For metrics, we use Fréchet Inception Distance (FID) [15], Sliced Wasserstein Distance (SWD) [23], and masked Mean Squared Error (MSE). For segmentation models, [20] is used for face data, and PixelLib is used for LSUN. First, we show the property of the null space obtained by low-rank decomposition and then show the improvement brought by the null space projection. Second, the direction we obtain from one image could be easily applied to the other images are verified. Third, the strong robustness to the mask is tested as well, and several state-of-the-art methods are chosen for comparison. At last, the ablation study on the parameter $\lambda$ in Eq. (4) and parameter $r _ { \mathrm { r e l a x } }$ in Sec. 3.3 can be found in the Supplementary Material.
|
| 108 |
+
|
| 109 |
+
# 4.1 Precise Generation Control with LowRankGAN
|
| 110 |
+
|
| 111 |
+
Property of Null Spaces. First, we show the property of the null space obtained by the low-rank decomposition using a church model. For convenience, we separate the church image into two parts, e.g., the sky and the rest, as shown in Fig. 2a and Fig. 2d. According to Sec. 3.2, we obtain $\mathbf { \bar { J } } _ { z } ^ { T } \mathbf { J } _ { z } = \mathbf { M } _ { \mathrm { B } }$ for the masked region in Fig. 2a. And then, the low-rank decomposition on $M _ { \mathrm { B } }$ is conducted to get the null space of region B. We choose the vector in the null space to edit Fig. 2a and get the editing result as shown in Fig. 2b. Fig. 2c shows the $\ell _ { 1 }$ loss heatmap between Fig. 2a and Fig. 2b, in which we could find the null space of region B will affect region A yet could keep region B nearly unchanged. All pixel values of Fig. 2a and Fig. 2b are in range [0, 255] when computing the $\ell _ { 1 }$ loss. The same process is conducted on Fig. 2d-f, in which we could also find that the null space of region A has an influence on region B but has little influence on region A. Hence, we could project the principal vectors of region A into the null space of region B to edit region A yet keep region B unchanged, thus accomplishing the precise generation control only by linear operation of latent codes.
|
| 112 |
+
|
| 113 |
+
Editing with Null Space Projection. Here, we will validate the effectiveness of the null space projection proposed in Sec. 3.3 on StyleGAN2 and BigGAN. For convenience, let ${ \mathbf { } } v _ { i }$ represent the attribute vector obtained by Eq. (6) of a specific region and $\mathbf { \nabla } p _ { i }$ denote the projected vector through Eq. (7) into the null space. First, we study via StyleGAN2 pre-trained on FFHQ [18]. The eyes and the mouth are chosen as the regions to edit. As shown in Fig. 3, the remaining region changes violently when only using ${ \mathbf { } } v _ { i }$ to control the specific attribute. For example, when closing the eyes of the man, the other attributes such as nose, mouth, and hair have an obvious alteration, and some artifacts appear as well. And when closing the mouth, the size of the face is deformed, and the hair is increased as well. On the contrary, when using $\mathbf { \nabla } _ { \pmb { p } _ { i } }$ to control the attributes in those images, the editing results are significantly improved, and the changes in the other regions are barely perceptible by human eyes. Second, we study via BigGAN on two categories. As shown in Fig. 3, we select the object center as the region of interest and then obtain the attribute vectors through $M _ { \mathrm { { c e n t e r } } }$ . Directly using the attribute vector ${ \mathbf { } } v _ { i }$ will significantly change the background when editing. For instance, the background of the indigo bird will be blurred, and there appear some white dots in the background of the bubble when changing the size. Rather, when using the projected singular vector $\pmb { p } _ { i }$ , the surroundings can keep intact as much as possible. All these results are consistent with the phenomenon in Fig. 2.
|
| 114 |
+
|
| 115 |
+

|
| 116 |
+
Figure 3: Precise generation control via the null space projection on StyleGAN2 [19] and BigGAN [4]. For each image attribute, the original attribute vector identified from the region of interest (under green masks or red boxes) acts as changing the image globally (e.g., the face shape change in the top row and the background change in the bottom row). By contrast, our approach with null space projection leads to more satisfying local editing results.
|
| 117 |
+
|
| 118 |
+
We also give the quantitative results in Tab. 1a on StyleGAN2. Besides the FID metric, the masked Mean Squared Error (MSE) is also used to qualify the change in the rest region when editing a specific region. Taking closing eyes as an example, we do not compute the loss using the eyes and their surroundings, shown with green masks in Fig. 3. This metric measures the change in the other region when editing a specific region. Obviously, the low masked MSE means high precision control. As shown in Tab. 1a, after the null space projection, both FID and MSE metrics decrease. Both the qualitative and quantitative results show that after the null space projection, we could achieve more precise control over a specific region on StyleGAN2 and BigGAN. More results can be found in the Supplementary Material.
|
| 119 |
+
|
| 120 |
+
# 4.2 Generalization from One Image to Others
|
| 121 |
+
|
| 122 |
+
Results on Versatile GANs. A question here is whether each image needs to compute the corresponding Jacobian for editing since our method requires to compute the Jacobian of the images. The answer is no, and we show that the attribute vectors obtained by our algorithm in one image could be used to effectively edit itself or the other images. As shown in Fig. 4, the reference images and the corresponding green masks indicate the images and the regions we use to find the attributes vectors, which are then used to edit the target images. From Fig. 4, we could summarize the following advantages of our method: First, the masks are unnecessary to be aligned between the reference images and target images to manipulate the targets. For example, we obtain an attribute vector that could change the hair color from the masked region of the reference image, which can change the hair color of the target images regardless of their hairstyles. And for the car, the body of the target cars varies from the shape, pose, color, etc. However, the attribute vector attained from the masked region of the reference image successfully changed the colors of the car bodies of diverse styles. Second, for conditional GANs like BigGAN, the direction attained from one category can not only be used to edit the category itself but also be used to edit other categories. For instance, we obtain a direction from the snowbird that could change its pose, which can change the pose of the other categories such as robin, owl, dog, and butterfly. Last but not least, we achieve all the local editing by just linearly shifting the latent codes instead of operating in the feature maps, making LowRankGAN easy to use.
|
| 123 |
+
|
| 124 |
+
Applications. Besides the qualitative results shown in Fig. 4, we also give the quantitative results in Fig. 5. And to quantitatively measure the degree of the closed eyes or mouth, we count the pixels in the eyes or mouth using the segmentation model released by [20]. We first select 10,000 images that have open eyes when they have pixels of more than 200. After collecting images, we use the attribute vector (closing eyes) obtained from the image shown in Fig. 4 to edit those images. After editing, the number of pixels in the eyes of each image is reported in Fig. 5a. For the closed mouth, the process is exactly the same as the closed eyes, and the result is reported in Fig. 5b. We also perform statistics on the number of pixels in the eyes and mouth of the real data and synthesized data and report them in Fig. 5. Interestingly, in real data or synthesized data, only a few images have few
|
| 125 |
+
|
| 126 |
+

|
| 127 |
+
Figure 4: Generalization of the latent semantic from the local region of one synthesis to other samples on StyleGAN2 [19] faces, StyleGAN2 cars, and BigGAN [4]. Our approach does not require the target image to have the same masked region as the reference image. For example, cars can have different shapes and locations. The results on BigGAN even suggest that the pose semantic identified from one category can be applied to other categories.
|
| 128 |
+
|
| 129 |
+

|
| 130 |
+
(a) Number of Pixels in Eyes
|
| 131 |
+
|
| 132 |
+

|
| 133 |
+
(b) Number of Pixels in a Mouth
|
| 134 |
+
Figure 5: Comparison among the real data distribution, synthesized data distribution, and the shifted data distribution with our LowRankGAN, regarding closing-eyes and closing-mouth attributes. We use the number of pixels from a segmented object (i.e., eyes or a mouth) to evaluate whether the eyes and mouth are closed. By analyzing only one image, we can make around $9 0 \%$ people close their eyes or mouths, yielding an application to augment the real data with rare samples.
|
| 135 |
+
|
| 136 |
+
Table 1: Quantitative comparison results on (a) the effect of using null space projection, and (b) the image quality from various image editing approaches [14, 25].
|
| 137 |
+
|
| 138 |
+
(a) Comparison on whether to use projection.
|
| 139 |
+
|
| 140 |
+
<table><tr><td>Methods</td><td>Close Eyes</td><td></td><td>Close Mouth</td></tr><tr><td></td><td>FID↓</td><td>MSE↓</td><td>FID↓MSE↓</td></tr><tr><td>w/o Projection</td><td>9.14</td><td>0.0014</td><td>9.47 0.00063</td></tr><tr><td>w/Projection</td><td>8.01</td><td>0.00099</td><td>7.69 0.00020</td></tr></table>
|
| 141 |
+
|
| 142 |
+
(b) Comparison with other methods.
|
| 143 |
+
|
| 144 |
+
<table><tr><td>Methods</td><td>FID↓</td><td>SWD↓User Study</td></tr><tr><td>GANSpace [14]</td><td>7.91 10.46 7.57</td><td>5.4%</td></tr><tr><td>SeFa [25]</td><td>7.50</td><td>37.6%</td></tr><tr><td>LowRankGAN (Ours) 7.30</td><td>6.70</td><td>56.0%</td></tr></table>
|
| 145 |
+
|
| 146 |
+
pixels in the eyes (61 and 49 for the real and synthesized data, respectively). This means that the images with closed eyes are rather scarce in real or synthesized data. Thereby, a potential application of our algorithm could be data augmentation. A detailed data augmentation experiment can be found in the Supplementary Material.
|
| 147 |
+
|
| 148 |
+
# 4.3 Robustness of LowRankGAN to Regions of Interest
|
| 149 |
+
|
| 150 |
+
What surprises us is that our method is extremely robust to the mask (or to the region), which further enables our method could be easily used even if we do not have a segmentation model contrary to the previous works [29, 2, 34, 37]. As shown in Fig. 6, for each group, the mask varies from the size, position, and shape, but the attribute vectors we solve from those masked regions play nearly the same role when editing the target image. For instance, if we want to find some eye-related semantic, like closing eyes in Fig. 6, we could either use a segmentation model [20] to get the precise pixels of eyes or just use some coarse masks that users specify as the green masks shown in Fig. 6. The attribute vector of closing the eyes of the target can be derived from any Jacobian of those masked regions. For the church and car, we could either use the segmentation masks or the random masks as the green regions shown in Fig. 6. The same editing results can be achieved by any attribute vectors from the Jacobians of those masked regions, adding clouds to the sky of the church or changing the color of the car to the target image. One of the possible reasons for this robustness might be that the semantic in a specific region will lie in the same latent subspace. Therefore, the subspace for a sub-region of this specific region could coincide with the global one, and moving in this subspace will affect the whole region. Note that in the experiments of car and church, for the small mask regions, a relatively larger $r _ { \mathrm { r e l a x } }$ is needed. Here we set $r _ { \mathrm { r e l a x } } = 2 0$ .
|
| 151 |
+
|
| 152 |
+
# 4.4 Comparison with Existing Alternatives
|
| 153 |
+
|
| 154 |
+
Now we compare our method with the state-of-the-art algorithms. We compare our method with GANSpace [14] and SeFa [25] on StyleGAN2, which are the two state-of-the-art unsupervised approaches to image editing. We find the most relevant vectors that can control the smile and hair in GANSpace and SeFa, according to their papers. As shown in Fig. 7, both GANSpace and SeFa have some degree of influence on the other region when editing a specific region. For example, when adding the smile, the identity of GANSpace is changed as well as hairstyle. When changing the hair color, GANSpace just has little activation on this attribute, while SeFa has an obvious change in the background. Meanwhile, the eyes of the women are altered as well. Instead, our method has a negligible change on other attributes when adding the smile or changing the hair color.
|
| 155 |
+
|
| 156 |
+

|
| 157 |
+
Figure 6: Robustness of LowRankGAN to the region of interest for analysis. For example, to edit the color of a car, our algorithm does not necessarily require a rigid segmentation mask but can also work well with an offhand bounding box and give similar results.
|
| 158 |
+
|
| 159 |
+

|
| 160 |
+
Figure 7: Comparison on image local editing with GANSpace [14] and SeFa [25]. Our LowRankGAN can better preserve the information beyond the target region.
|
| 161 |
+
|
| 162 |
+
Besides the qualitative results shown in Fig. 7, we also give the quantitative results in Tab. 1b on smiling. About user study, twelve students are invited to perform the evaluation. All students have a computer vision background. Each one is assigned fifty original images and the associated editing results (adding smile) obtained from different methods. Then they are asked to discriminate the image-editing quality of different methods. They are $1 2 \times 5 0 = 6 0 0$ votes. We get 595 valid votes because, in some cases, some students cannot tell which method performs best. The result of the user study is reported in Tab. 1b. We could see that our method surpasses the others for all metrics.
|
| 163 |
+
|
| 164 |
+
# 5 Conclusion and Limitation
|
| 165 |
+
|
| 166 |
+
In this work, we propose low-rank subspaces to perform controllable generation in GANs. The low-rank decomposition of the Jacobian matrix established between an arbitrary image and the latent space yields a null space, which enables image local editing by simply altering the latent code with no need for spatial masks. We also find that the low-rank subspaces identified from the local region of one image can be robustly applicable to other images, revealing the internal semantic-aware structure of the GAN latent space. Extensive experiments demonstrate the powerful performance of our algorithm on precise generation control with well-trained GAN models.
|
| 167 |
+
|
| 168 |
+
As for the limitation, the proposed LowRankGAN is able to precisely control the local region of GAN synthesized images. As discussed in Sec. 4.3, our method is robust to the region of interest. For example, to edit the eyes of faces, we do not need accurate eye segmentation yet only require a rough region around the eyes. This yields a shortcoming of our approach, which is that it almost fails to achieve pixel-level control. More concretely, our LowRankGAN can only perform editing by treating eyes as a whole, but fails to edit every individual pixel of eyes. We also find that our algorithm tends to control both eyes simultaneously. As a result, it is hard to close only one eye by keeping the other open.
|
| 169 |
+
|
| 170 |
+
# References
|
| 171 |
+
|
| 172 |
+
[1] D. Bau, J.-Y. Zhu, H. Strobelt, B. Zhou, J. B. Tenenbaum, W. T. Freeman, and A. Torralba. GAN dissection: Visualizing and understanding generative adversarial networks. In Int. Conf. Learn. Represent., 2019. 2
|
| 173 |
+
[2] D. Bau, H. Strobelt, W. Peebles, J. Wulff, B. Zhou, J.-Y. Zhu, and A. Torralba. Semantic photo manipulation with a generative image prior. ACM Trans. Graph., 2020. 2, 8
|
| 174 |
+
[3] S. Boyd, N. Parikh, and E. Chu. Distributed optimization and statistical learning via the alternating direction method of multipliers. Now Publishers Inc, 2011. 4
|
| 175 |
+
[4] A. Brock, J. Donahue, and K. Simonyan. Large scale GAN training for high fidelity natural image synthesis. In Int. Conf. Learn. Represent., 2019. 1, 2, 5, 6, 7
|
| 176 |
+
[5] E. J. Candès, X. Li, Y. Ma, and J. Wright. Robust principal component analysis? Journal of the ACM (JACM), 2011. 4
|
| 177 |
+
[6] C.-H. Chiu, Y. Koyama, Y. Lai, T. Igarashi, and Y. Yue. Human-in-the-loop differential subspace search in high-dimensional latent space. ACM Trans. Graph., 2020. 2
|
| 178 |
+
[7] Y. Choi, Y. Uh, J. Yoo, and J.-W. Ha. StarGAN v2: Diverse image synthesis for multiple domains. In IEEE Conf. Comput. Vis. Pattern Recog., 2020. 1
|
| 179 |
+
[8] E. Collins, R. Bala, B. Price, and S. Susstrunk. Editing in style: Uncovering the local semantics of GANs. In IEEE Conf. Comput. Vis. Pattern Recog., 2020. 2
|
| 180 |
+
[9] J. Deng, W. Dong, R. Socher, L.-J. Li, K. Li, and L. Fei-Fei. ImageNet: A large-scale hierarchical image database. In IEEE Conf. Comput. Vis. Pattern Recog., 2009. 5
|
| 181 |
+
[10] J. Donahue and K. Simonyan. Large scale adversarial representation learning. In Adv. Neural Inform. Process. Syst., 2019. 1
|
| 182 |
+
[11] R. Feng, D. Zhao, and Z. Zha. On noise injection in generative adversarial networks. In Int. Conf. Mach. Learn., 2021. 3
|
| 183 |
+
[12] L. Goetschalckx, A. Andonian, A. Oliva, and P. Isola. GANalyze: Toward visual definitions of cognitive image properties. In Int. Conf. Comput. Vis., 2019. 1, 2, 3
|
| 184 |
+
[13] I. Goodfellow, J. Pouget-Abadie, M. Mirza, B. Xu, D. Warde-Farley, S. Ozair, A. Courville, and Y. Bengio. Generative adversarial networks. In Adv. Neural Inform. Process. Syst., 2014. 2
|
| 185 |
+
[14] E. Härkönen, A. Hertzmann, J. Lehtinen, and S. Paris. GANSpace: Discovering interpretable GAN controls. In Adv. Neural Inform. Process. Syst., 2020. 1, 2, 4, 8, 9
|
| 186 |
+
[15] M. Heusel, H. Ramsauer, T. Unterthiner, B. Nessler, and S. Hochreiter. GANs trained by a two time-scale update rule converge to a local nash equilibrium. In Adv. Neural Inform. Process. Syst., 2017. 5
|
| 187 |
+
[16] X. Huang and S. Belongie. Arbitrary style transfer in real-time with adaptive instance normalization. In Int. Conf. Comput. Vis., 2017. 1
|
| 188 |
+
[17] A. Jahanian, L. Chai, and P. Isola. On the" steerability" of generative adversarial networks. In Int. Conf. Learn. Represent., 2020. 1, 2, 3
|
| 189 |
+
[18] T. Karras, S. Laine, and T. Aila. A style-based generator architecture for generative adversarial networks. In IEEE Conf. Comput. Vis. Pattern Recog., 2019. 1, 2, 5
|
| 190 |
+
[19] T. Karras, S. Laine, M. Aittala, J. Hellsten, J. Lehtinen, and T. Aila. Analyzing and improving the image quality of StyleGAN. In IEEE Conf. Comput. Vis. Pattern Recog., 2020. 1, 5, 6, 7
|
| 191 |
+
[20] C.-H. Lee, Z. Liu, L. Wu, and P. Luo. MaskGAN: Towards diverse and interactive facial image manipulation. In IEEE Conf. Comput. Vis. Pattern Recog., 2020. 5, 6, 8
|
| 192 |
+
[21] Z. Lin, M. Chen, and Y. Ma. The augmented lagrange multiplier method for exact recovery of corrupted low-rank matrices. arXiv preprint arXiv:1009.5055, 2010. 4
|
| 193 |
+
[22] A. Plumerault, H. L. Borgne, and C. Hudelot. Controlling generative models with continuous factors of variations. In Int. Conf. Learn. Represent., 2020. 2, 4
|
| 194 |
+
[23] J. Rabin, G. Peyré, J. Delon, and M. Bernot. Wasserstein barycenter and its application to texture mixing. In International Conference on Scale Space and Variational Methods in Computer Vision, 2011. 5
|
| 195 |
+
[24] A. Ramesh, Y. Choi, and Y. LeCun. A spectral regularizer for unsupervised disentanglement. In Int. Conf. Mach. Learn., 2019. 2
|
| 196 |
+
[25] Y. Shen and B. Zhou. Closed-form factorization of latent semantics in GANs. In IEEE Conf. Comput. Vis. Pattern Recog., 2021. 1, 2, 4, 8, 9
|
| 197 |
+
[26] Y. Shen, J. Gu, X. Tang, and B. Zhou. Interpreting the latent space of GANs for semantic face editing. In IEEE Conf. Comput. Vis. Pattern Recog., 2020. 1, 2, 3
|
| 198 |
+
[27] Y. Shen, C. Yang, X. Tang, and B. Zhou. InterFaceGAN: Interpreting the disentangled face representation learned by GANs. IEEE Trans. Pattern Anal. Mach. Intell., 2020. 1, 2
|
| 199 |
+
[28] N. Spingarn-Eliezer, R. Banner, and T. Michaeli. GAN steerability without optimization. In Int. Conf. Learn. Represent., 2021. 2
|
| 200 |
+
[29] R. Suzuki, M. Koyama, T. Miyato, T. Yonetsuji, and H. Zhu. Spatially controllable image synthesis with internal representation collaging. arXiv preprint arXiv:1811.10153, 2018. 2, 8
|
| 201 |
+
[30] A. Voynov and A. Babenko. Unsupervised discovery of interpretable directions in the GAN latent space. In Int. Conf. Mach. Learn., 2020. 1, 2, 4
|
| 202 |
+
[31] B. Wang and C. R. Ponce. The geometry of deep generative image models and its applications. In Int. Conf. Learn. Represent., 2021. 2
|
| 203 |
+
[32] T.-C. Wang, M.-Y. Liu, J.-Y. Zhu, G. Liu, A. Tao, J. Kautz, and B. Catanzaro. Video-to-video synthesis. In Adv. Neural Inform. Process. Syst., 2018. 1
|
| 204 |
+
[33] J. Wright and Y. Ma. High-Dimensional Data Analysis with Low-Dimensional Models: Principles, Computation, and Applications. Cambridge University Press, 2021. 3
|
| 205 |
+
[34] Y. Xu, Y. Shen, J. Zhu, C. Yang, and B. Zhou. Generative hierarchical features from synthesizing images. In IEEE Conf. Comput. Vis. Pattern Recog., 2021. 1, 2, 8
|
| 206 |
+
[35] C. Yang, Y. Shen, and B. Zhou. Semantic hierarchy emerges in deep generative representations for scene synthesis. Int. J. Comput. Vis., 2021. 2
|
| 207 |
+
[36] F. Yu, A. Seff, Y. Zhang, S. Song, T. Funkhouser, and J. Xiao. LSUN: Construction of a large-scale image dataset using deep learning with humans in the loop. arXiv preprint arXiv:1506.03365, 2015. 5
|
| 208 |
+
[37] C. Zhang, Y. Xu, and Y. Shen. Decorating your own bedroom: Locally controlling image generation with generative adversarial networks. arXiv preprint arXiv:2105.08222, 2021. 2, 8
|
| 209 |
+
[38] J. Zhu, Y. Shen, D. Zhao, and B. Zhou. In-domain GAN inversion for real image editing. Eur. Conf. Comput. Vis., 2020. 1, 2
|
| 210 |
+
[39] J.-Y. Zhu, T. Park, P. Isola, and A. A. Efros. Unpaired image-to-image translation using cycle-consistent adversarial networks. In Int. Conf. Comput. Vis., 2017. 1
|
md/train/aUX5Plaq7Oy/aUX5Plaq7Oy.md
ADDED
|
@@ -0,0 +1,388 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# LEARNING CONTINUOUS-TIME PDES FROM SPARSE DATA WITH GRAPH NEURAL NETWORKS
|
| 2 |
+
|
| 3 |
+
Valerii Iakovlev, Markus Heinonen & Harri Lähdesmäki
|
| 4 |
+
|
| 5 |
+
Department of Computer Science
|
| 6 |
+
Aalto University
|
| 7 |
+
Helsinki, Finland
|
| 8 |
+
{valerii.iakovlev, markus.o.heinonen, harri.lahdesmaki}@aalto.fi
|
| 9 |
+
|
| 10 |
+
# ABSTRACT
|
| 11 |
+
|
| 12 |
+
The behavior of many dynamical systems follow complex, yet still unknown partial differential equations (PDEs). While several machine learning methods have been proposed to learn PDEs directly from data, previous methods are limited to discretetime approximations or make the limiting assumption of the observations arriving at regular grids. We propose a general continuous-time differential model for dynamical systems whose governing equations are parameterized by message passing graph neural networks. The model admits arbitrary space and time discretizations, which removes constraints on the locations of observation points and time intervals between the observations. The model is trained with continuous-time adjoint method enabling efficient neural PDE inference. We demonstrate the model’s ability to work with unstructured grids, arbitrary time steps, and noisy observations. We compare our method with existing approaches on several well-known physical systems that involve first and higher-order PDEs with state-of-the-art predictive performance.
|
| 13 |
+
|
| 14 |
+
# 1 INTRODUCTION
|
| 15 |
+
|
| 16 |
+
We consider continuous dynamical systems with a state $u ( \mathbf { x } , t ) \in \mathbb { R }$ that evolves over time $t \in \mathbb { R } _ { + }$ and spatial locations $\mathbf { x } \in \dot { \Omega } \subset \mathbb { R } ^ { D }$ of a bounded domain $\Omega$ . We assume the system is governed by an unknown partial differential equation (PDE)
|
| 17 |
+
|
| 18 |
+
$$
|
| 19 |
+
\dot { u } ( \mathbf { x } , t ) : = \frac { d u ( \mathbf { x } , t ) } { d t } = F ( \mathbf { x } , u , \nabla _ { \mathbf { x } } u , \nabla _ { \mathbf { x } } ^ { 2 } u , \dots ) ,
|
| 20 |
+
$$
|
| 21 |
+
|
| 22 |
+
where the temporal evolution $\dot { u }$ of the system depends on the current state $u$ and its spatial first and higher-order partial derivatives w.r.t. the coordinates $\mathbf { x }$ . Such PDE models are the cornerstone of natural sciences, and are widely applicable to modelling of propagative systems, such as behavior of sound waves, fluid dynamics, heat dissipation, weather patterns, disease progression or cellular kinetics (Courant & Hilbert, 2008). Our objective is to learn the differential $F$ from data.
|
| 23 |
+
|
| 24 |
+
There is a long history of manually deriving mechanistic PDE equations for specific systems (Cajori, 1928), such as the Navier-Stokes fluid dynamics or the Schrödinger’s quantum equations, and approximating their solution forward in time numerically (Ames, 2014). These efforts are complemented by data-driven approaches to infer any unknown or latent coefficients in the otherwise known equations (Isakov, 2006; Berg & Nyström, 2017; Santo et al., 2019), or in partially known equations (Freund et al., 2019; Seo & Liu, 2019b; Seo et al., 2020). A series of methods have studied neural proxies of known PDEs for solution acceleration (Lagaris et al., 1998; Raissi et al., 2017; Weinan & Yu, 2018; Sirignano & Spiliopoulos, 2018) or for uncertainty quantification (Khoo et al., 2017).
|
| 25 |
+
|
| 26 |
+
Related work. Recently the pioneering work of Long et al. (2017) proposed a fully non-mechanistic method PDE-Net, where the governing equation $F$ is learned from system snapshot observations as a convolutional neural network (CNN) over the input domain discretised into a spatio-temporal grid. Further works have extended the approach with residual CNNs (Ruthotto & Haber, 2019), symbolic neural networks (Long et al., 2019), high-order autoregressive networks (Geneva & Zabaras, 2020), and feed-forward networks (Xu et al., 2019). These models are fundamentally limited to discretizing the input domain with a sample-inefficient grid, while they also do not support continuous evolution over time, rendering them unable to handle temporally or spatially sparse or non-uniform observations commonly encountered in realistic applications.
|
| 27 |
+
|
| 28 |
+
Models such as (Battaglia et al., 2016; Chang et al., 2016; Sanchez-Gonzalez et al., 2018) are related to the interaction networks where object’s state evolves as a function of its neighboring objects, which forms dynamic relational graphs instead of grids. In contrast to the dense solution fields of PDEs, these models apply message-passing between small number of moving and interacting objects, which deviates from PDEs that are strictly differential functions.
|
| 29 |
+
|
| 30 |
+
In Poli et al. (2019) graph neural ordinary differential equations (GNODE) were proposed as a framework for modeling continuous-time signals on graphs. The main limitations of this framework in application to learning PDEs are the lack of spatial information about physical node locations and lack of motivation for why this type of model could be suitable. Our work can be viewed as connecting graph-based continuous-time models with data-driven learning of PDEs in spatial domain through a classical PDE solution technique.
|
| 31 |
+
|
| 32 |
+
Contributions. In this paper we propose to learn free-form, continuous-time, a priori fully unknown PDE model $F$ from sparse data measured on arbitrary timepoints and locations of the coordinate domain $\Omega$ with graph neural networks (GNN). Our contributions are:
|
| 33 |
+
|
| 34 |
+
• We introduce continuous-time representation and learning of the dynamics of PDE-driven systems
|
| 35 |
+
We propose efficient graph representation of the domain structure using the method of lines with message passing neural networks
|
| 36 |
+
• We achieve state-of-the-art learning performance on realistic PDE systems with irregular data, and our model is highly robust to data sparsity
|
| 37 |
+
|
| 38 |
+
Scripts and data for reproducing the experiments can be found in this github repository.
|
| 39 |
+
|
| 40 |
+
Table 1: Comparison of machine-learning based PDE learning methods.
|
| 41 |
+
|
| 42 |
+
<table><tr><td>Model</td><td>Unknown PDE learning</td><td>Continuous time</td><td>Free-form spatial domain</td><td>Free-form initial/boundary conditions</td><td>Reference</td></tr><tr><td>PINN</td><td></td><td></td><td></td><td></td><td>Raissi et al. (2017)</td></tr><tr><td>AR</td><td></td><td></td><td></td><td></td><td>Geneva & Zabaras (2020)</td></tr><tr><td>PDE-net</td><td></td><td></td><td></td><td></td><td>Long et al. (2017)</td></tr><tr><td>DPM</td><td></td><td>xx/</td><td>xxxx</td><td></td><td>Freund et al. (2019)</td></tr><tr><td>DPGN</td><td></td><td>X</td><td></td><td></td><td>Seo & Liu (2019b)</td></tr><tr><td>PA-DGN</td><td>X</td><td></td><td></td><td>xx/ννν</td><td>Seo et al. (2020)</td></tr><tr><td>Ours</td><td>【</td><td>√</td><td>√</td><td>√</td><td></td></tr></table>
|
| 43 |
+
|
| 44 |
+
# 2 METHODS
|
| 45 |
+
|
| 46 |
+
In this Section we consider the problem of learning the unknown function $F$ from observations $( \mathbf { y } ( t _ { 0 } ) , \ldots , \mathbf { y } ( t _ { M } ) ) \in \mathbb { R } ^ { N \times ( M + \bar { 1 } ) }$ of the system’s state ${ \bf u } ( t ) = ( u ( { \bf x } _ { 1 } , t ) , \dots , u ( { \bf x } _ { N } , t ) ) ^ { T }$ at $N$ arbitrary spatial locations $\left( \mathbf { x } _ { 1 } , \ldots , \mathbf { x } _ { N } \right)$ and at $M + 1$ time points $\left( t _ { 0 } , \ldots , t _ { M } \right)$ . We introduce efficient graph convolution neural networks surrogates operating over continuous-time to learn PDEs from sparse data. Note that while we consider arbitrarily sampled spatial locations and time points, we do not consider the case of partially observed vectors $\mathbf { y } ( t _ { i } )$ i.e. when data at some location is missing at some time point. Partially observed vectors, however, could be accounted by masking the nodes with missing observations when calculating the loss. The function $F$ is assumed to not depend on global values of the spatial coordinates i.e. we assume the system does not contain position-dependent fields (Section 2.1).
|
| 47 |
+
|
| 48 |
+
We apply the method of lines (MOL) (Schiesser, 2012) to numerically solve Equation 1. The MOL consists of selecting $N$ nodes in $\Omega$ and discretizing spatial derivatives in $F$ at these nodes. We place the nodes to the observation locations $\left( \mathbf { x } _ { 1 } , \ldots , \mathbf { x } _ { N } \right)$ . The discretization leads to $F$ being approximated by $\hat { F }$ and produces the following system of ordinary differential equations (ODEs) whose solution asymptotically approximates the solution of Equation 1
|
| 49 |
+
|
| 50 |
+
$$
|
| 51 |
+
\begin{array} { r } { \dot { \mathbf { u } } ( t ) = \left( \begin{array} { c } { \dot { u } _ { 1 } ( t ) } \\ { \vdots } \\ { \dot { u } _ { N } ( t ) } \end{array} \right) = \left( \begin{array} { c } { \frac { d u ( \mathbf { x } _ { 1 } , t ) } { d t } } \\ { \vdots } \\ { \frac { d u ( \mathbf { x } _ { N } , t ) } { d t } } \end{array} \right) \approx \left( \begin{array} { c } { \hat { F } ( \mathbf { x } _ { 1 } , \mathbf { x } _ { N ( 1 ) } , u _ { 1 } , u _ { N ( 1 ) } ) } \\ { \vdots } \\ { \hat { F } ( \mathbf { x } _ { N } , \mathbf { x } _ { N ( N ) } , u _ { N } , u _ { N ( N ) } ) } \end{array} \right) \in \mathbb { R } ^ { N } . } \end{array}
|
| 52 |
+
$$
|
| 53 |
+
|
| 54 |
+
As the discretized $\hat { F }$ inherits its unknown nature from the true PDE function $F$ , we approximate $\hat { F }$ by a learnable neural surrogate function.
|
| 55 |
+
|
| 56 |
+
The system’s state at $\mathbf { x } _ { i }$ is defined as $u _ { i }$ , while $\mathcal { N } ( i )$ is a set of indices of neighboring nodes other than $i$ that are required to evaluate $\hat { F }$ at $\mathbf { x } _ { i }$ , and $\mathbf { x } _ { \mathcal { N } ( i ) }$ with $u _ { \mathcal { N } ( i ) }$ are positions and states of nodes $\mathcal { N } ( i )$ . This shows that the temporal derivative $\dot { u } _ { i }$ of $u _ { i }$ depends not only on the location and state at the node $i$ , but also on locations and states of neighboring nodes, resulting in a locally coupled system of ODEs.
|
| 57 |
+
|
| 58 |
+
Each ODE in the system follows the solution at a fixed location $\mathbf { x } _ { i }$ . Numerous ODE solvers have been proposed (such as Euler and Runge-Kutta solvers) to solve the full system
|
| 59 |
+
|
| 60 |
+
$$
|
| 61 |
+
{ \bf u } ( t ) = { \bf u } ( 0 ) + \int _ { 0 } ^ { t } \dot { { \bf u } } ( \tau ) d \tau ,
|
| 62 |
+
$$
|
| 63 |
+
|
| 64 |
+
where $0 \leq \tau \leq t$ is a cumulative intermediate time variable. Solving equation 3 forward in time scales linearly both with respect to the number of nodes $N$ and the number of evaluated time points $M$ , while saturating the input space $\Omega$ requires a large number of nodes. In practice, PDEs are often applied for two- and three-dimensional spatial systems where the method is efficient.
|
| 65 |
+
|
| 66 |
+
# 2.1 POSITION-INVARIANT GRAPH NEURAL NETWORK DIFFERENTIAL
|
| 67 |
+
|
| 68 |
+
After introducing Equation 2, we transition from learning $F$ to learning $\hat { F }$ . The value of $\hat { F }$ at a node $i$ must depend only on the nodes $i$ and $\mathcal { N } ( i )$ . Furthermore, the number of arguments and their order in $\hat { F }$ is not known in advance and might be different for each node. This means that our model $\hat { F }$ must be able to work with an arbitrary number of arguments and must be invariant to permutations of their order. Graph neural networks (GNNs) (Wu et al., 2020) satisfy these requirements. In a more restricted setting, where the number of neighbors and their order is known, (e.g. if the grid is uniform) other types of models such as multilayer perceptrons and convolutional neural networks can be used as well.
|
| 69 |
+
|
| 70 |
+
We consider a type of GNNs called message passing neural networks (MPNNs) (Gilmer et al., 2017) to represent $\hat { F }$ as
|
| 71 |
+
|
| 72 |
+
$$
|
| 73 |
+
\hat { F } _ { \theta } ( \mathbf { x } _ { \mathcal { N } ( i ) } - \mathbf { x } _ { i } , u _ { i } , u _ { \mathcal { N } ( i ) } ) ,
|
| 74 |
+
$$
|
| 75 |
+
|
| 76 |
+
where $\mathbf { x } _ { \mathcal { N } ( i ) } - \mathbf { x } _ { i } = \{ \mathbf { x } _ { j } - \mathbf { x } _ { i } : j \in \mathcal { N } ( i ) \}$ and $\theta$ denote parameters of the MPNN.
|
| 77 |
+
|
| 78 |
+
This formulation assumes the absence of position-dependent quantities in $\hat { F }$ , but models based on this formulation are invariant to translations and rotations of $\Omega$ , which makes generalization to systems with different node positions feasible, and prevents overfitting by memorizing position-specific dynamics.
|
| 79 |
+
|
| 80 |
+
We use MPNNs, which is a type of spatial-based GNNs, due to their flexibility and computational efficiency. The main alternative – spectral-based GNNs – have relatively poor scaling with the number of nodes and learn global, or domain-dependent, filters due to the need to perform eigenvalue decomposition of the Laplacian matrix.
|
| 81 |
+
|
| 82 |
+

|
| 83 |
+
Figure 1: Delaunay triangulation for a set of points. Green and orange points are considered to be neighbors as they share the same edge.
|
| 84 |
+
|
| 85 |
+
# 2.2 MESSAGE PASSING NEURAL NETWORKS
|
| 86 |
+
|
| 87 |
+
Let a graph $G = ( V , E )$ contain nodes $V = \{ \mathbf { x } _ { i } \} _ { i = 1 } ^ { N }$ , defined by the measurement positions, and undirected edges $\dot { E } \stackrel { - } { = } \{ e _ { i j } \}$ , and assume each node and edge are associated with a node feature $\mathbf { v } _ { i }$ and an edge feature ${ \bf e } _ { i j }$ , respectively. We use the node neighborhood $\mathcal { N } ( i )$ to define edges. Neighbors for each node were selected by applying Delaunay triangulation to the measurement positions. Two nodes were considered to be neighbors if they lie on the same edge of at least one triangle (Figure 1). Delaunay triangulation has such useful properties as maximizing the minimum angle within each triangle in the triangulation and containing the nearest neighbor of each node which helps to obtain a good quality discretization of $\Omega$
|
| 88 |
+
|
| 89 |
+
In message passing graph neural networks we propagate a latent state for $K \geq 1$ graph layers, where each layer $k$ consists of first aggregating messages $\mathbf { m } _ { i } ^ { ( k ) }$ for each node $i$ , and then updating the corresponding node states ${ \bf h } _ { i } ^ { ( k ) }$ ,
|
| 90 |
+
|
| 91 |
+
$$
|
| 92 |
+
\begin{array} { r c l } { { } } & { { } } & { { { \bf m } _ { i } ^ { ( k + 1 ) } = \displaystyle \bigoplus _ { j \in \mathcal { N } ( i ) } \phi ^ { ( k ) } \left( { \bf h } _ { i } ^ { ( k ) } , { \bf h } _ { j } ^ { ( k ) } , { \bf e } _ { i j } \right) , } } \\ { { } } & { { } } & { { { \bf h } _ { i } ^ { ( k + 1 ) } = \gamma ^ { ( k ) } \left( { \bf h } _ { i } ^ { ( k ) } , { \bf m } _ { i } ^ { ( k + 1 ) } \right) , } } \end{array}
|
| 93 |
+
$$
|
| 94 |
+
|
| 95 |
+
where $\oplus$ denotes a permutation invariant aggregation function (e.g. sum, mean, max), and $\phi ^ { ( k ) } , \gamma ^ { ( k ) }$ are differentiable functions parameterized by deep neural networks. At any time $\tau$ , we initialise the latent states h(0)i $\mathbf { h } _ { i } ^ { ( 0 ) } = \mathbf { v } _ { i } = u _ { i } \bar { ( \tau ) }$ and node features to the current state $u _ { i } ( \tau )$ of the system. We define edge features $\mathbf { e } _ { i j } : = \mathbf { x } _ { j } - \mathbf { x } _ { i }$ as location differences. Finally, we use the node states at the last graph layer of the MPNN to evaluate the PDE surrogate
|
| 96 |
+
|
| 97 |
+
$$
|
| 98 |
+
\frac { d \hat { u } ( \mathbf x _ { i } , t ) } { d t } = \hat { F } _ { \theta } ( \mathbf x _ { \mathcal { N } ( i ) } - \mathbf x _ { i } , u _ { i } , u _ { \mathcal { N } ( i ) } ) = \mathbf h _ { i } ^ { ( K ) } ,
|
| 99 |
+
$$
|
| 100 |
+
|
| 101 |
+
which is used to solve Equation 3 for the estimated states $\hat { \mathbf { u } } ( t ) = ( \hat { u } ( \mathbf { x } _ { 1 } , t ) , \dots , \hat { u } ( \mathbf { x } _ { N } , t ) )$ .
|
| 102 |
+
|
| 103 |
+
# 2.3 ADJOINT METHOD FOR LEARNING CONTINUOUS-TIME MPNN SURROGATES
|
| 104 |
+
|
| 105 |
+
Parameters of $\hat { F } _ { \theta }$ are defined by $\theta$ which is the union of parameters of functions $\phi ^ { ( k ) } , \gamma ^ { ( k ) } , k =$ $1 , \ldots , K$ in the MPNN. We fit $\theta$ by minimizing the mean squared error between the observed states $( \mathbf { y } ( t _ { 0 } ) , \dots , \mathbf { y } ( t _ { M } ) )$ and the estimated states $( \hat { \mathbf { u } } ( t _ { 0 } ) , \ldots , \hat { \mathbf { u } } ( t _ { M } ) )$ ,
|
| 106 |
+
|
| 107 |
+
$$
|
| 108 |
+
\begin{array} { l } { \displaystyle \mathcal { L } ( \boldsymbol { \theta } ) = \int _ { t _ { 0 } } ^ { t _ { M } } \ell ( t , \hat { \mathbf { u } } ) d t = \int _ { t _ { 0 } } ^ { t _ { M } } \frac { 1 } { M + 1 } \sum _ { i = 0 } ^ { M } | | \hat { \mathbf { u } } ( t _ { i } ) - \mathbf { y } ( t _ { i } ) | | _ { 2 } ^ { 2 } \delta ( t - t _ { i } ) d t } \\ { \displaystyle \quad = \frac { 1 } { M + 1 } \sum _ { i = 1 } ^ { M } | | \hat { \mathbf { u } } ( t _ { i } ) - \mathbf { y } ( t _ { i } ) | | _ { 2 } ^ { 2 } . } \end{array}
|
| 109 |
+
$$
|
| 110 |
+
|
| 111 |
+
While discrete-time neural PDE models evaluate the system state only at measurement time points, more accurate continuous-time solution for the estimated state generally requires many more evaluations of the system state. If an adaptive solver is used to obtain the estimated states, the number of time steps performed by the solver might be significantly larger than $M$ . The amount of memory required to evaluate the gradient of $\mathcal { L } ( \boldsymbol { \theta } )$ by backpropagation scales linearly with the number of solver time steps. This typically makes backpropagation infeasible due to large memory requirements. We use an alternative approach, which allows computing the gradient for memory cost, which is independent from the number of the solver time steps. The approach was presented in Chen et al. (2018) for neural ODEs and is based on the adjoint method (Pontryagin, 2018). The adjoint method consists of a single forward ODE pass 3 until state $\hat { \mathbf { u } } ( t _ { M } )$ at the final time $t _ { M }$ , and subsequent backward ODE pass solving the gradients. The backward pass is performed by first solving the adjoint equation
|
| 112 |
+
|
| 113 |
+
$$
|
| 114 |
+
\dot { \mathbf { \boldsymbol { \mathsf { X } } } } ( t ) ^ { T } = \frac { \partial \ell } { \partial \hat { \mathbf { u } } ( t ) } - \mathbf { \boldsymbol { \mathsf { \boldsymbol { \mathsf { X } } } } } ( t ) ^ { T } \frac { \partial \hat { F } } { \partial \hat { \mathbf { u } } ( t ) } .
|
| 115 |
+
$$
|
| 116 |
+
|
| 117 |
+
for the adjoint variables $\lambda$ from $t = t _ { M }$ until $t = 0$ with $\lambda ( t _ { M } ) = 0$ , and then computing
|
| 118 |
+
|
| 119 |
+
$$
|
| 120 |
+
\frac { d \mathcal { L } } { d \theta } = - \int _ { 0 } ^ { T } \lambda ( t ) ^ { T } \frac { \partial \hat { F } } { \partial \theta } d t
|
| 121 |
+
$$
|
| 122 |
+
|
| 123 |
+
to obtain the final gradient.
|
| 124 |
+
|
| 125 |
+

|
| 126 |
+
Figure 2: a) Relative test errors for different grid sizes. b) Visualization of the true and learned system dynamics (grids are shown in the first column).
|
| 127 |
+
|
| 128 |
+
# 3 EXPERIMENTS
|
| 129 |
+
|
| 130 |
+
We evaluate our model’s performance in learning the dynamics of known physical systems. We compare to state-of-the-art competing methods, and begin by performing ablation studies to measure how our model’s performance depends on measurement grid sizes, interval between observations, irregular sampling, amount of data and amount of noise.
|
| 131 |
+
|
| 132 |
+
# 3.1 CONVECTION-DIFFUSION ABLATION STUDIES
|
| 133 |
+
|
| 134 |
+
The convection-diffusion equation is a partial differential equation that can be used to model a variety of physical phenomena related to the transfer of particles, energy, and other physical quantities inside a physical system. The transfer occurs due to two processes: convection and diffusion. The convection-diffusion equation is defined as
|
| 135 |
+
|
| 136 |
+
$$
|
| 137 |
+
\frac { \partial u ( x , y , t ) } { \partial t } = D \nabla ^ { 2 } u ( x , y , t ) - \mathbf { v } \cdot \nabla u ( x , y , t ) ,
|
| 138 |
+
$$
|
| 139 |
+
|
| 140 |
+
where $u$ is the concentration of some quantity of interest (full problem specification and setup are in Appendix A). Quality of the model’s predictions was evaluated using the relative error between the observed states $\mathbf { y } ( t _ { i } )$ and the estimated states $\hat { \mathbf { u } } ( t _ { i } )$ :
|
| 141 |
+
|
| 142 |
+
$$
|
| 143 |
+
E r r = \frac { \| \mathbf { y } ( t _ { i } ) - \hat { \mathbf { u } } ( t _ { i } ) \| } { \| \mathbf { y } ( t _ { i } ) \| } .
|
| 144 |
+
$$
|
| 145 |
+
|
| 146 |
+
In all following experiments, unless otherwise stated, the training data contains 24 simulations on the time interval $[ 0 , 0 . 2 ]$ sec and the test data contains 50 simulations on the time interval $[ 0 , 0 . 6 ]$ sec. The data is randomly downsampled from high fidelity simulations, thus all train and test simulations have different node positions while the number of nodes remains constant. Examples from the train and test sets are shown in Figure 14.
|
| 147 |
+
|
| 148 |
+
Different grid sizes. This experiment tests our model’s capability to learn from data with different density of observation points. The time step was set to 0.02 sec resulting in 11 training time points per simulation. The number of observation points $\mathbf { x } _ { i }$ (and consequently nodes in the GNN) was set to 3000, 1500 and 750. The resulting grids are shown in the first column of Figure 2b. Figure 2 shows relative test errors and models’ predictions.
|
| 149 |
+
|
| 150 |
+
The performance of the model decreases with the number of nodes in the grid. Nonetheless, even with the smallest grid, the model was able to learn a reasonably accurate approximation of the system’s dynamics and generalize beyond the training time interval.
|
| 151 |
+
|
| 152 |
+
Different measurement time interval. As will be shown in the following experiments, models with a constant time step are sensitive to the length of the time interval between observations. While showing good performance when the time step is small, such models fail to generalize if the time step is increased. This experiment shows our model’s ability to learn from data with relatively large time intervals between observations.
|
| 153 |
+
|
| 154 |
+

|
| 155 |
+
Figure 3: a) Relative test errors for different time grids. b) Visualization of the true and learned system dynamics (grids are shown in the first column).
|
| 156 |
+
|
| 157 |
+
We used 11, 4 and 2 evenly spaced time points for training. The number of nodes was set to 3000. Figure 3 shows relative test errors and models’ predictions. The model is able to recover the continuous-time dynamics of the system even when trained with four time point per simulation. Increasing the frequency of observation does not significantly improve the performance. An example of a training simulation with four time points is shown in Figure 11.
|
| 158 |
+
|
| 159 |
+
Irregular time step. Observations used for training might not be recorded with a constant time step. This might cause trouble for models that are built with this assumption. This experiment tests our model’s ability to learn from data observed at random points in time.
|
| 160 |
+
|
| 161 |
+
The model is trained on two time grids. The first time grid has a constant time step 0.02 sec. The second grid is the same as the first one but with each time point perturbed by noise an irregu $\epsilon \sim \mathcal { N } ( 0 , ( \frac { 0 . 0 2 } { 6 } ) ^ { 2 } )$ . This gives a time grid withe time step for test data was set to 0.01 sec. The number of nodes was set to 3000. Relative test errors are shown in Figure 4. In both cases the model achieves similar performance. This demonstrates the continuous-time nature of our model as training and predictions are not restricted to evenly spaced time grids as with most other methods. None of the previous methods that learn free form (i.e., neural network parameterised) PDEs can be trained with data that is sampled irregularly over time.
|
| 162 |
+
|
| 163 |
+

|
| 164 |
+
Figure 4: Relative test errors for regular and irregular time grids.
|
| 165 |
+
|
| 166 |
+
Different amount of data. In this experiment, the model is trained on 1, 5, 10 and 24 simulations. The test data contains 50 simulations. The time step was set to 0.01 sec. The number of nodes was set to 3000. Relative test errors are shown in Figure 5. Performance of the model improves as the amount of training data increases. It should be noted that despite using more data, the relative error does not converge to zero.
|
| 167 |
+
|
| 168 |
+

|
| 169 |
+
Figure 5: Relative test errors for different amounts of training data.
|
| 170 |
+
|
| 171 |
+
Varying amount of additive noise. We apply additive
|
| 172 |
+
noise $\epsilon \sim \mathcal { N } ( 0 , \sigma ^ { 2 } )$ to training data with $\sigma$ set to 0.01,
|
| 173 |
+
0.02, and 0.04 while the largest magnitude of the observed
|
| 174 |
+
states is 1. The time step was set to 0.01 sec. The number
|
| 175 |
+
of nodes was set to 3000. Noise was added only to the
|
| 176 |
+
training data. The relative test errors are shown in Figure 6. The model’s performance decreases as grows but even at $\sigma = 0 . 0 4$ it remains quite high.
|
| 177 |
+
|
| 178 |
+
$\sigma$
|
| 179 |
+
|
| 180 |
+
The proposed model was compared to two models presented in the literature: PDE-Net (Long et al., 2017) and DPGN (Seo & Liu, 2019a). PDE-Net is based on a convolutional neural network and employs a constant timestepping scheme resembling the Euler method. DPGN is based on a graph neural network and implements timestepping as an evolution map in the latent space.
|
| 181 |
+
|
| 182 |
+
We used the PDE-Net implementation provided in Long et al. (2017) except that we pass filter values through an MLP consisting of 2 hidden layers 60 neurons each and tanh nonlinearities which helps to improve stability and performance of the model. We use $5 \times 5$ and $3 \times 3$ filters without moment constraints and maximum PDE order set to 4 and 2 respectively.The number of $\delta t$ -blocks was set to the number of time steps in the training data. Our implementation of DPGN followed that from Seo & Liu (2019a) with latent diffusivity $\alpha = 0 . 0 0 1$ . The number of parameters in all models was close to $2 0 \mathrm { k }$ .
|
| 183 |
+
|
| 184 |
+

|
| 185 |
+
Figure 6: Relative test errors for different amounts of noise in the training data.
|
| 186 |
+
|
| 187 |
+
The training data contains 24 simulations on the time interval $[ 0 , \bar { 0 } . 2 ]$ sec with the following time steps: 0.01, 0.02 and $0 . 0 4 ~ \mathrm { s e c }$ . The test data contains 50 simulations on the time interval $[ 0 , 0 . 6 ]$ sec with the same time steps. The data was generated on a $5 0 \times 5 0$ regular grid as PDEnet cannot be applied to arbitrary spatial grids. Separate models were trained for each time step. The performance of the models was evaluated using the mean of relative test error averaged over time.
|
| 188 |
+
|
| 189 |
+
Mean relative test errors of the models are shown in Figure 7. The figure shows that performance of the discretetime models is strongly dependent on the time step while performance of the continuous-time model remains at the same level. At the smallest timestep, PDE-Net with $5 \times 5$ filters outperforms other models due to having access to a larger neighborhood of nodes which allows the model to make more accurate predictions. However, larger filter size does not improve stability.
|
| 190 |
+
|
| 191 |
+

|
| 192 |
+
Figure 7: Mean relative errors of models trained with different time steps.
|
| 193 |
+
|
| 194 |
+
We note that some discrete-time models, e.g. DPGN, could be modified to incorporate the time step as their input. Comparison with this type of models would be redundant since Figure 7 already demonstrates the best case performance for such models (when trained and tested with constant time step).
|
| 195 |
+
|
| 196 |
+
Importance of relative positional information. We test our model with and without relative node positions that are encoded as the edge features in our MPNN on grids with a different number of nodes. Smaller number of nodes results in higher distance variability between neighboring nodes (Figure 12) which should increase the dependence of the model accuracy on the relative spatial information. By removing spatial information from our model, we recover GNODE. The models were tested on the heat (Appendix B) and convection-diffusion equations. A full description of the experiment is in Appendix D. The results are shown in Figure 8.
|
| 197 |
+
|
| 198 |
+
Surprisingly, GNODE shows good results on the purely diffusive heat equation. Nonetheless, the performance of GNODE noticeably differs from that of our model that includes the spatial information. Furthermore, the performance difference almost doubles as the number of nodes is decreased from $100 \%$ to $50 \%$ .
|
| 199 |
+
|
| 200 |
+

|
| 201 |
+
Figure 8: Mean relative test errors of models with and without relative node positions.
|
| 202 |
+
|
| 203 |
+

|
| 204 |
+
Figure 9: a) Relative test errors for heat equation. b) True and learned system dynamics.
|
| 205 |
+
|
| 206 |
+

|
| 207 |
+
Figure 10: a) Relative test errors for Burgers’ equations. b) True and learned system dynamics.
|
| 208 |
+
|
| 209 |
+
When applied to the convection-diffusion equation, GNODE fail to learn the dynamics irrespective of the number of nodes. This can be explained by the presence of the convective term which transports the field in a specific direction thus making positional information particularly important for accurately predicting changes in the field.
|
| 210 |
+
|
| 211 |
+
# 3.3 OTHER DYNAMICAL SYSTEMS
|
| 212 |
+
|
| 213 |
+
The model was tested on two more dynamical systems in order to evaluate its ability to work with a wider range of problems. We selected the heat equation and the Burgers’ equations for that purpose. The heat equation is one of the simplest PDEs while the Burgers’ equations are more complex than the convection-diffusion equation due to the presence of nonlinear convective terms. The increase in the problems’ difficulty allows to trace the change in the model’s performance as we move from simpler to more complex dynamics while keeping the number of model parameters fixed.
|
| 214 |
+
|
| 215 |
+
Heat equation. The heat equation describes the behavior of diffusive systems. The equation is defined as $\begin{array} { r } { \frac { \partial u } { \partial t } = D \nabla ^ { 2 } u } \end{array}$ , where $u$ is the temperature field (see Appendix B for details). Figure 9 shows relative errors and model predictions for a random test case. The heat equation describes simpler dynamics than the convection diffusion equation which allowed the model to achieve slightly smaller test errors.
|
| 216 |
+
|
| 217 |
+
Burgers’ equations. The Burgers’ equations is a system of two coupled nonlinear PDEs. It describes the behavior of dissipative systems with nonlinear propagation effects. The equations are defined in a vector form as ∂u(x,y,t)∂t = D∇2u(x, y, t) − u(x, y, t) · ∇u(x, y, t), where u is the velocity vector field (see Appendix C for details). For visualization and error measurement purposes, the velocity vector field is converted to a scalar field defined by the velocity magnitude at each node. Figure 10 shows relative errors and model predictions for a random test case.
|
| 218 |
+
|
| 219 |
+
The Burgers’ equations describe more complex dynamics than the previous two cases which is reflected in higher relative test errors. Visual comparison of the true and predicted states shows that the model was able to achieve sufficient accuracy at approximating the unknown dynamics.
|
| 220 |
+
|
| 221 |
+
# 4 CONCLUSION
|
| 222 |
+
|
| 223 |
+
We present a continuous-time model of dynamical systems whose behavior is governed by PDEs. The model accurately recovers the system’s dynamics even when observation points are sparse and the data is recorded at irregular time intervals. Comparison with discrete-time models reveals the advantage of continuous-time models for datasets with larger time intervals between observations, which is typical for real-world applications where measurements can be either tedious or costly, or both. Discretization of the coordinate domain with the method of lines provides a general modeling framework in which arbitrary surrogate functions can be used for approximating $\hat { F }$ . The continuoustime nature of the model enables the use of various time integrators ranging from the Euler method to highly accurate adaptive methods. This allows to optimize the choice of the surrogate function and time integration scheme depending on the structure of the data.
|
| 224 |
+
|
| 225 |
+
# REFERENCES
|
| 226 |
+
|
| 227 |
+
William F Ames. Numerical methods for partial differential equations. Academic press, 2014.
|
| 228 |
+
|
| 229 |
+
Peter Battaglia, Razvan Pascanu, Matthew Lai, Danilo Jimenez Rezende, et al. Interaction networks for learning about objects, relations and physics. In Advances in neural information processing systems, pp. 4502–4510, 2016.
|
| 230 |
+
|
| 231 |
+
Jens Berg and Kaj Nyström. Neural network augmented inverse problems for pdes. arXiv preprint arXiv:1712.09685, 2017.
|
| 232 |
+
|
| 233 |
+
Florian Cajori. The early history of partial differential equations and integration. The American Mathematical Monthly, 35(9):459–467, 1928.
|
| 234 |
+
|
| 235 |
+
Michael B Chang, Tomer Ullman, Antonio Torralba, and Joshua B Tenenbaum. A compositional object-based approach to learning physical dynamics. arXiv preprint arXiv:1612.00341, 2016.
|
| 236 |
+
|
| 237 |
+
Ricky T. Q. Chen, Yulia Rubanova, Jesse Bettencourt, and David Duvenaud. Neural ordinary differential equations. Advances in Neural Information Processing Systems, 2018.
|
| 238 |
+
|
| 239 |
+
Richard Courant and David Hilbert. Methods of Mathematical Physics: Partial Differential Equations. John Wiley & Sons, 2008.
|
| 240 |
+
|
| 241 |
+
Jonathan B Freund, Jonathan F MacArt, and Justin Sirignano. Dpm: A deep learning pde augmentation method (with application to large-eddy simulation). arXiv preprint arXiv:1911.09145, 2019.
|
| 242 |
+
|
| 243 |
+
Nicholas Geneva and Nicholas Zabaras. Modeling the dynamics of pde systems with physicsconstrained deep auto-regressive networks. Journal of Computational Physics, 403:109056, 2020.
|
| 244 |
+
|
| 245 |
+
Justin Gilmer, Samuel S. Schoenholz, Patrick F. Riley, Oriol Vinyals, and George E. Dahl. Neural message passing for quantum chemistry. CoRR, abs/1704.01212, 2017. URL http://arxiv. org/abs/1704.01212.
|
| 246 |
+
|
| 247 |
+
Victor Isakov. Inverse problems for partial differential equations, volume 127. Springer, 2006.
|
| 248 |
+
|
| 249 |
+
Yuehaw Khoo, Jianfeng Lu, and Lexing Ying. Solving parametric pde problems with artificial neural networks. arXiv preprint arXiv:1707.03351, 2017.
|
| 250 |
+
|
| 251 |
+
Isaac E Lagaris, Aristidis Likas, and Dimitrios I Fotiadis. Artificial neural networks for solving ordinary and partial differential equations. IEEE transactions on neural networks, 9(5):987–1000, 1998.
|
| 252 |
+
|
| 253 |
+
Zichao Long, Yiping Lu, Xianzhong Ma, and Bin Dong. Pde-net: Learning pdes from data. arXiv preprint arXiv:1710.09668, 2017.
|
| 254 |
+
|
| 255 |
+
Zichao Long, Yiping Lu, and Bin Dong. Pde-net 2.0: Learning pdes from data with a numericsymbolic hybrid deep network. Journal of Computational Physics, 399:108925, 2019.
|
| 256 |
+
|
| 257 |
+
Michael Poli, Stefano Massaroli, Junyoung Park, Atsushi Yamashita, Hajime Asama, and Jinkyoo Park. Graph neural ordinary differential equations. arXiv preprint arXiv:1911.07532, 2019.
|
| 258 |
+
|
| 259 |
+
L.S. Pontryagin. Mathematical Theory of Optimal Processes. CRC Press, 2018. ISBN 9781351433068. URL https://books.google.fi/books?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ et9aDwAAQBAJ.
|
| 260 |
+
|
| 261 |
+
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.
|
| 262 |
+
|
| 263 |
+
Martin Riedmiller and Heinrich Braun. Rprop - a fast adaptive learning algorithm. Technical report, Proc. of ISCIS VII), Universitat, 1992.
|
| 264 |
+
|
| 265 |
+
Lars Ruthotto and Eldad Haber. Deep neural networks motivated by partial differential equations. Journal of Mathematical Imaging and Vision, pp. 1–13, 2019.
|
| 266 |
+
|
| 267 |
+
Alvaro Sanchez-Gonzalez, Nicolas Heess, Jost Tobias Springenberg, Josh Merel, Martin Riedmiller, Raia Hadsell, and Peter Battaglia. Graph networks as learnable physics engines for inference and control. arXiv preprint arXiv:1806.01242, 2018.
|
| 268 |
+
|
| 269 |
+
Niccolò Dal Santo, Simone Deparis, and Luca Pegolotti. Data driven approximation of parametrized pdes by reduced basis and neural networks. arXiv preprint arXiv:1904.01514, 2019.
|
| 270 |
+
|
| 271 |
+
W.E. Schiesser. The Numerical Method of Lines: Integration of Partial Differential Equations. Elsevier Science, 2012. ISBN 9780128015513. URL https://books.google.fi/books? id $^ { = 2 }$ YDNCgAAQBAJ.
|
| 272 |
+
|
| 273 |
+
Sungyong Seo and Yan Liu. Differentiable physics-informed graph networks. CoRR, abs/1902.02950, 2019a. URL http://arxiv.org/abs/1902.02950.
|
| 274 |
+
|
| 275 |
+
Sungyong Seo and Yan Liu. Differentiable physics-informed graph networks. arXiv preprint arXiv:1902.02950, 2019b.
|
| 276 |
+
|
| 277 |
+
Sungyong Seo, Chuizheng Meng, and Yan Liu. Physics-aware difference graph networks for sparselyobserved dynamics. In International Conference on Learning Representations, 2020.
|
| 278 |
+
|
| 279 |
+
Justin Sirignano and Konstantinos Spiliopoulos. Dgm: A deep learning algorithm for solving partial differential equations. Journal of Computational Physics, 375:1339–1364, 2018.
|
| 280 |
+
|
| 281 |
+
E Weinan and Bing Yu. The deep ritz method: a deep learning-based numerical algorithm for solving variational problems. Communications in Mathematics and Statistics, 6(1):1–12, 2018.
|
| 282 |
+
|
| 283 |
+
Zonghan Wu, Shirui Pan, Fengwen Chen, Guodong Long, Chengqi Zhang, and S Yu Philip. A comprehensive survey on graph neural networks. IEEE Transactions on Neural Networks and Learning Systems, 2020.
|
| 284 |
+
|
| 285 |
+
Hao Xu, Haibin Chang, and Dongxiao Zhang. Dl-pde: Deep-learning based data-driven discovery of partial differential equations from discrete and noisy data. arXiv preprint arXiv:1908.04463, 2019.
|
| 286 |
+
|
| 287 |
+
# A CONVECTION-DIFFUSION ABLATION STUDIES
|
| 288 |
+
|
| 289 |
+
The convection-diffusion equation is a partial differential equation that can be used to model a variety of physical phenomena related to the transfer of particles, energy, and other physical quantities inside a physical system. The transfer occurs due to two processes: convection and diffusion.
|
| 290 |
+
|
| 291 |
+
Training and testing data was obtained by solving the following initial-boundary value problem on $\Omega = [ 0 , \bar { 2 } \pi ] \times [ 0 , \bar { 2 \pi } ]$ with periodic boundary conditions:
|
| 292 |
+
|
| 293 |
+
$$
|
| 294 |
+
\begin{array} { r l r l } & { \displaystyle \frac { \partial u ( x , y , t ) } { \partial t } = D \nabla ^ { 2 } u ( x , y , t ) - \mathbf { v } \cdot \nabla u ( x , y , t ) , } & & { ( x , y ) \in \Omega , t \geq 0 , } \\ & { u ( x , 0 , t ) = u ( x , 2 \pi , t ) , } & & { x \in [ 0 , 2 \pi ] , t \geq 0 , } \\ & { u ( 0 , y , t ) = u ( 2 \pi , y , t ) , } & & { y \in [ 0 , 2 \pi ] , t \geq 0 , } \\ & { u ( x , y , 0 ) = u _ { 0 } ( x , y ) , } & & { ( x , y ) \in \Omega , } \end{array}
|
| 295 |
+
$$
|
| 296 |
+
|
| 297 |
+
where the diffusion coefficient $D$ was set to 0.25 and the velocity field $\mathbf { v }$ was set to $( 5 . 0 , 2 . 0 ) ^ { T }$ . The initial conditions $u _ { 0 } ( x , y )$ were generated as follows:
|
| 298 |
+
|
| 299 |
+
$$
|
| 300 |
+
\begin{array} { l } { \displaystyle \tilde { u } _ { 0 } ( x , y ) = \sum _ { k , l = - N } ^ { N } \lambda _ { k l } \cos \left( k x + l y \right) + \gamma _ { k l } \sin \left( k x + l y \right) } \\ { \displaystyle u _ { 0 } ( x , y ) = \frac { \tilde { u } _ { 0 } ( x , y ) - \operatorname* { m i n } \tilde { u } _ { 0 } ( x , y ) } { \operatorname* { m a x } \tilde { u } _ { 0 } ( x , y ) - \operatorname* { m i n } \tilde { u } _ { 0 } ( x , y ) } , } \end{array}
|
| 301 |
+
$$
|
| 302 |
+
|
| 303 |
+
where $N = 4$ and $\lambda _ { k l } , \gamma _ { k l } \sim { \mathcal { N } } ( 0 , 1 )$ . The generated data contains $N _ { s }$ simulations. Each simulation contains values of $u ( x , y , t )$ at time points $( t _ { 1 } , \dots , t _ { M } )$ and locations $\left( \mathbf { x } _ { 1 } , \ldots , \mathbf { x } _ { N } \right)$ , where ${ \bf x } _ { n } =$ $( x _ { n } , y _ { n } )$ . Numerical solutions that represent the true dynamics were obtained using the backward Euler solver with the time step of 0.0002 seconds on a computational grid with 4100 nodes. Training and testing data used in the following experiments is downsampled from these solutions. Quality of the model’s predictions was evaluated using the relative error between the observed states $\mathbf { y } ( t _ { i } )$ and the estimated states $\hat { \mathbf { u } } ( t _ { i } )$ :
|
| 304 |
+
|
| 305 |
+
$$
|
| 306 |
+
E r r = \frac { \| \mathbf { y } ( t _ { i } ) - \hat { \mathbf { u } } ( t _ { i } ) \| } { \| \mathbf { y } ( t _ { i } ) \| } .
|
| 307 |
+
$$
|
| 308 |
+
|
| 309 |
+
The model used for all following experiments contains a single graph layer. The mean was selected as the aggregation function. Functions $\phi ^ { ( 1 ) } ( u _ { i } , \cdot )$ and $\gamma ^ { ( 1 ) } ( u _ { i } , u _ { j } - u _ { i } , \mathbf { x } _ { j } - \mathbf { x } _ { i } )$ were represented by multilayer perceptrons with 3 hidden layers and hyperbolic tangent activation functions. Input/output sizes for $\phi ^ { ( 1 ) }$ and $\gamma ^ { ( 1 ) }$ were set to $4 / 4 0$ and 41/1 respectively. The number of hidden neurons was set to 60. This gives approximately $2 0 \mathrm { k }$ trainable parameters.
|
| 310 |
+
|
| 311 |
+
We followed the implementation of the adjoint method and ODE solvers from torchdiffeq Python package (Chen et al., 2018). In all following experiments, adaptive-order implicit Adams solver was used with rtol and atol set to $1 . 0 \cdot 1 0 ^ { - 7 }$ . Rprop (Riedmiller & Braun, 1992) optimizer was used with learning rate set to $1 . 0 \cdot 1 0 ^ { - 6 }$ and batch size set to 24.
|
| 312 |
+
|
| 313 |
+
# B HEAT EQUATION EXPERIMENT
|
| 314 |
+
|
| 315 |
+
Training and testing data was obtained by solving the following initial-boundary value problem on $\Omega = ( 0 , 1 ) \times ( 0 , 1 )$ with Dirichlet boundary conditions:
|
| 316 |
+
|
| 317 |
+
$$
|
| 318 |
+
\begin{array} { r l r } & { \displaystyle \frac { \partial u ( x , y , t ) } { \partial t } = D \nabla ^ { 2 } u ( x , y , t ) , } & { \qquad ( x , y ) \in \Omega , \ t \geq 0 , } \\ & { u ( x , y , t ) = u _ { 0 } ( x , y ) , } & { \qquad ( x , y ) \in \partial \Omega , \ t \geq 0 , } \\ & { u ( x , y , 0 ) = u _ { 0 } ( x , y ) , } & { \qquad ( x , y ) \in \Omega , } \end{array}
|
| 319 |
+
$$
|
| 320 |
+
|
| 321 |
+
where $\partial \Omega$ denotes the boundaries of $\Omega$ and diffusion coefficient $D$ was set to 0.2. The initial conditions $u _ { 0 } ( x , y )$ were generated as follows:
|
| 322 |
+
|
| 323 |
+
$$
|
| 324 |
+
\begin{array} { l } { \displaystyle \tilde { u } _ { 0 } ( x , y ) = \sum _ { k , l = - N } ^ { N } \lambda _ { k l } \cos \left( k x + l y \right) + \gamma _ { k l } \sin \left( k x + l y \right) } \\ { \displaystyle u _ { 0 } ( x , y ) = \frac { \tilde { u } _ { 0 } ( x , y ) - \operatorname* { m i n } \tilde { u } _ { 0 } ( x , y ) } { \operatorname* { m a x } \tilde { u } _ { 0 } ( x , y ) - \operatorname* { m i n } \tilde { u } _ { 0 } ( x , y ) } , } \end{array}
|
| 325 |
+
$$
|
| 326 |
+
|
| 327 |
+
where $N = 1 0$ and $\lambda _ { k l } , \gamma _ { k l } \sim \mathcal { N } ( 0 , 1 )$ . The generated data contains $N _ { s }$ simulations. Each simulation contains values of $u ( x , y , t )$ at time points $( t _ { 1 } , \dots , t _ { M } )$ and locations $\left( \mathbf { x } _ { 1 } , \ldots , \mathbf { x } _ { N } \right)$ , where ${ \bf x } _ { n } =$ $( x _ { n } , y _ { n } )$ . Numerical solutions that represent the true dynamics were obtained using the backward Euler solver with the time step of 0.0001 seconds on a computational grid with 4100 nodes. Training and testing data used in the experiments with the heat equation is downsampled from these solutions.
|
| 328 |
+
|
| 329 |
+
The model used for all experiments with the heat equation contains a single graph layer. The mean was selected as the aggregation function. Functions $\phi ^ { ( 1 ) } ( u _ { i } , \cdot )$ and $\gamma ^ { ( 1 ) } ( u _ { i } , u _ { j } - u _ { i } , \mathbf { x } _ { j } - \mathbf { x } _ { i } )$ were represented by multilayer perceptrons with 3 hidden layers and hyperbolic tangent activation functions. Input/output sizes for $\phi ^ { ( 1 ) }$ and $\gamma ^ { ( 1 ) }$ were set to $4 / 4 0$ and 41/1 respectively. The number of hidden neurons was set to 60. This gives approximately $2 0 \mathrm { k }$ trainable parameters.
|
| 330 |
+
|
| 331 |
+
We followed the implementation of the adjoint method and ODE solvers from torchdiffeq Python package (Chen et al., 2018). In all following experiments, adaptive-order implicit Adams solver was used with rtol and atol set to $1 . 0 \cdot 1 0 ^ { - 7 }$ . Rprop (Riedmiller & Braun, 1992) optimizer was used with learning rate set to $1 . 0 \cdot 1 0 ^ { - 6 }$ and batch size set to 24.
|
| 332 |
+
|
| 333 |
+
In the experiment, the training data contains 24 simulations on the time interval [0, 0.1] sec with time step 0.005 sec resulting in 21 time point. The test data contains 50 simulations on the time interval $[ 0 , 0 . 3 ]$ sec with the same time step. The number of observation points $\mathbf { x } _ { i }$ was set to 4100.
|
| 334 |
+
|
| 335 |
+
# C BURGERS’ EQUATIONS EXPERIMENT
|
| 336 |
+
|
| 337 |
+
Training and testing data was obtained by solving the following initial-boundary value problem on $\Omega = [ 0 , \bar { 2 } \pi ] \times [ 0 , \bar { 2 \pi } ]$ with periodic boundary conditions:
|
| 338 |
+
|
| 339 |
+
$$
|
| 340 |
+
\begin{array} { r l r } & { \frac { \partial \mathbf { u } ( x , y , t ) } { \partial t } = D \nabla ^ { 2 } \mathbf { u } ( x , y , t ) - \mathbf { u } ( x , y , t ) \cdot \nabla \mathbf { u } ( x , y , t ) , } & { \quad ( x , y ) \in \Omega , t \geq 0 , } \\ & { \mathbf { u } ( x , 0 , t ) = \mathbf { u } ( x , 2 \pi , t ) , } & { \quad t \geq 0 , } \\ & { \mathbf { u } ( 0 , y , t ) = \mathbf { u } ( 2 \pi , y , t ) , } & { \quad t \geq 0 , } \\ & { \mathbf { u } ( x , y , 0 ) = \mathbf { u } _ { 0 } ( x , y ) , } & { \quad ( x , y ) \in \Omega , t = 0 , } \end{array}
|
| 341 |
+
$$
|
| 342 |
+
|
| 343 |
+
where the diffusion coefficient $D$ was set to 0.15. The unknown function is now vector-valued. Therefore, the initial conditions $\mathbf { u } _ { 0 } ( x , y )$ for each component were generated as follows:
|
| 344 |
+
|
| 345 |
+
$$
|
| 346 |
+
\begin{array} { l } { \displaystyle \tilde { u } _ { 0 } ( x , y ) = \sum _ { k , l = - N } ^ { N } \lambda _ { k l } \cos \left( k x + l y \right) + \gamma _ { k l } \sin \left( k x + l y \right) } \\ { \displaystyle u _ { 0 } ( x , y ) = 6 \times \left( \frac { \tilde { u } _ { 0 } ( x , y ) - \operatorname* { m i n } \tilde { u } _ { 0 } ( x , y ) } { \operatorname* { m a x } \tilde { u } _ { 0 } ( x , y ) - \operatorname* { m i n } \tilde { u } _ { 0 } ( x , y ) } - 0 . 5 \right) , } \end{array}
|
| 347 |
+
$$
|
| 348 |
+
|
| 349 |
+
where $N = 2$ and $\lambda _ { k l } , \gamma _ { k l } \sim { \mathcal { N } } ( 0 , 1 )$ . The generated data contains $N _ { s }$ simulations. Each simulation contains values of $u ( x , y , t )$ at time points $( t _ { 1 } , \dots , t _ { M } )$ and locations $\left( \mathbf { x } _ { 1 } , \ldots , \mathbf { x } _ { N } \right)$ , where ${ \bf x } _ { n } =$ $( x _ { n } , y _ { n } )$ . Numerical solutions that represent the true dynamics were obtained using the backward Euler solver with the time step of 0.0016 seconds on a computational grid with 5446 nodes. Training and testing data used in the experiments with the heat equation is downsampled from these solutions.
|
| 350 |
+
|
| 351 |
+
The model used for all experiments with the Burgers’ equations contains a single graph layer. The mean was selected as the aggregation function. Functions $\phi ^ { ( 1 ) } ( u _ { i } , \cdot )$ and $\gamma ^ { ( 1 ) } ( u _ { i } , u _ { j } - u _ { i } , \mathbf { x } _ { j } - \mathbf { x } _ { i } )$ were represented by multilayer perceptrons with 3 hidden layers and hyperbolic tangent activation functions. Input/output sizes for $\bar { \phi } ^ { ( 1 ) }$ and $\gamma ^ { ( 1 ) }$ were set to $6 / 4 0$ and 41/2 respectively. The number of hidden neurons was set to 60. This gives approximately $2 0 \mathrm { k }$ trainable parameters.
|
| 352 |
+
|
| 353 |
+
We followed the implementation of the adjoint method and ODE solvers from torchdiffeq Python package (Chen et al., 2018). In all following experiments, adaptive-order implicit Adams solver was used with rtol and atol set to $1 . 0 \cdot 1 0 ^ { - 7 }$ . Rprop (Riedmiller & Braun, 1992) optimizer was used with learning rate set to $1 . 0 \cdot 1 0 ^ { - 6 }$ and batch size set to 24.
|
| 354 |
+
|
| 355 |
+
In the experiment, the training data contains 24 simulations on the time interval [0, 0.8] sec with time step 0.04 sec resulting in 21 time point. The test data contains 50 simulations on the time interval $[ 0 , 2 . 4 ]$ sec with the same time step. The number of observation points $\mathbf { x } _ { i }$ was set to 5000.
|
| 356 |
+
|
| 357 |
+
# D RELATIVE POSITIONAL INFORMATION EXPERIMENT
|
| 358 |
+
|
| 359 |
+
Data generation, time intervals, models and hyper parameters for this experiment are described in Appendix B for the heat equation, and Appendix A and Section 3.1 for the convection diffusion equation.
|
| 360 |
+
|
| 361 |
+
For the heat equation, $100 \%$ of nodes corresponds to 1000 nodes while for the convection-diffusion equation it corresponds to 3000 nodes. The number of training time points was set to 21 in both cases.
|
| 362 |
+
|
| 363 |
+
# E EXTRA FIGURES
|
| 364 |
+
|
| 365 |
+

|
| 366 |
+
Figure 11: Differences between observations in a train case with 4 time points.
|
| 367 |
+
|
| 368 |
+

|
| 369 |
+
Figure 12: Relative node distances for graphs with different number of nodes. a) 1000 nodes, b) 750 nodes, c) 500 nodes.
|
| 370 |
+
|
| 371 |
+

|
| 372 |
+
Figure 13: Snapshots of train (a) and test (b) simulations for the heat equation.
|
| 373 |
+
|
| 374 |
+

|
| 375 |
+
Figure 14: Snapshots of train (a) and test (b) simulations for the convection-diffusion equation.
|
| 376 |
+
|
| 377 |
+

|
| 378 |
+
Figure 15: Snapshots of train (a) and test (b) simulations for the Burgers’ equations.
|
| 379 |
+
|
| 380 |
+
# F APPLYING TRAINED MODELS TO GRIDS OF DIFFERENT SIZES
|
| 381 |
+
|
| 382 |
+
Figure 2b shows grids with different numbers of nodes. The grid with 3000 nodes nodes contains neighborhoods of similar shapes and sizes while neighborhoods in the grid with 750 nodes differ in shapes and sizes over a much larger range. This suggests that models trained on the grid with 750 nodes would work reasonably well on grids with 1500 and 3000 nodes, but not vice versa. We demonstrate this in the table below. The data and models used for this experiments are the same as in Section 3.1.
|
| 383 |
+
|
| 384 |
+
Table 2: Mean relative errors of models trained on some grid and applied to other grids.
|
| 385 |
+
|
| 386 |
+
<table><tr><td rowspan=1 colspan=1>ModelGrid size</td><td rowspan=1 colspan=1>3000</td><td rowspan=1 colspan=1>1500</td><td rowspan=1 colspan=1>750</td></tr><tr><td rowspan=1 colspan=1>3000</td><td rowspan=1 colspan=1>0.013± 0.001</td><td rowspan=1 colspan=1>0.017 ±0.001</td><td rowspan=1 colspan=1>0.043 ± 0.004</td></tr><tr><td rowspan=1 colspan=1>1500</td><td rowspan=1 colspan=1>0.050±0.005</td><td rowspan=1 colspan=1>0.032 ±0.001</td><td rowspan=1 colspan=1>0.036 ±0.001</td></tr><tr><td rowspan=1 colspan=1>750</td><td rowspan=1 colspan=1>0.142 ± 0.034</td><td rowspan=1 colspan=1>0.086 ±0.004</td><td rowspan=1 colspan=1>0.073± 0.004</td></tr></table>
|
| 387 |
+
|
| 388 |
+
The model trained on 3000 nodes generalizes poorly to coarser grids while the model trained on 750 grids performs fairly well on all grids. The model trained on 750 nodes performs better on test data with 3000 and 1500 nodes than with 750 nodes. This is because the finer grid allows to make more accurate predictions, therefore the error does not grow as large as for the coarse grid with 750 nodes.
|
md/train/bFMWXJRn58/bFMWXJRn58.md
ADDED
|
@@ -0,0 +1,450 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Gradient Clipping Helps in Non-Smooth Stochastic Optimization with Heavy-Tailed Noise
|
| 2 |
+
|
| 3 |
+
Anonymous Author(s)
|
| 4 |
+
Affiliation
|
| 5 |
+
Address
|
| 6 |
+
email
|
| 7 |
+
|
| 8 |
+
# Abstract
|
| 9 |
+
|
| 10 |
+
1 Thanks to their practical efficiency and random nature of the data, stochastic
|
| 11 |
+
2 first-order methods are standard for training large-scale machine learning models.
|
| 12 |
+
3 Random behavior may cause a particular run of an algorithm to result in a highly
|
| 13 |
+
4 suboptimal objective value, whereas theoretical guarantees are usually proved
|
| 14 |
+
5 for the expectation of the objective value. Thus, it is essential to theoretically
|
| 15 |
+
6 guarantee that algorithms provide small objective residual with high probability.
|
| 16 |
+
7 Existing methods for non-smooth stochastic convex optimization have complexity
|
| 17 |
+
8 bounds with the dependence on the confidence level that is either negative-power or
|
| 18 |
+
9 logarithmic but under an additional assumption of sub-Gaussian (light-tailed) noise
|
| 19 |
+
10 distribution that may not hold in practice, e.g., in several NLP tasks. In our paper,
|
| 20 |
+
11 we resolve this issue and derive the first high-probability convergence results with
|
| 21 |
+
12 logarithmic dependence on the confidence level for non-smooth convex stochastic
|
| 22 |
+
13 optimization problems with non-sub-Gaussian (heavy-tailed) noise. To derive our
|
| 23 |
+
14 results, we propose novel stepsize rules for two stochastic methods with gradient
|
| 24 |
+
15 clipping. Moreover, our analysis works for generalized smooth objectives with
|
| 25 |
+
16 Hölder-continuous gradients, and for both methods, we provide an extension for
|
| 26 |
+
17 strongly convex problems. Finally, our results imply that the first (accelerated)
|
| 27 |
+
18 method we consider also has optimal iteration and oracle complexity in all the
|
| 28 |
+
19 regimes, and the second one is optimal in the non-smooth setting.
|
| 29 |
+
|
| 30 |
+
# 20 1 Introduction
|
| 31 |
+
|
| 32 |
+
21 Stochastic first-order optimization methods like SGD [32], Adam [20], and their various modifi
|
| 33 |
+
22 cations are extremely popular in solving a number of different optimization problems, especially
|
| 34 |
+
23 those appearing in statistics [36], machine learning, and deep learning [13]. The success of these
|
| 35 |
+
24 methods in real-world applications motivates the researchers to investigate theoretical properties
|
| 36 |
+
25 for the methods and to develop new ones with better convergence guarantees. Typically, stochastic
|
| 37 |
+
26 methods are analyzed in terms of the convergence in expectation (see [12, 24, 15] and references
|
| 38 |
+
27 therein), whereas high-probability complexity results are established much rarely. However, as
|
| 39 |
+
28 illustrated in [14], guarantees in terms of the convergence in expectation have much worse correlation
|
| 40 |
+
29 with the real behavior of the methods than high-probability convergence guarantees when the noise
|
| 41 |
+
30 in the stochastic gradients has heavy-tailed distribution.
|
| 42 |
+
31 Recent studies [35, 34, 41] show that in several popular problems such as training BERT [37] on
|
| 43 |
+
32 Wikipedia dataset the noise in the stochastic gradients is heavy-tailed. Moreover, in [41], the authors
|
| 44 |
+
33 justify empirically that in such cases SGD works significantly worse than clipped-SGD [30] and
|
| 45 |
+
34 Adam. Therefore, it is important to theoretically study the methods’ convergence when the noise is
|
| 46 |
+
35 heavy-tailed.
|
| 47 |
+
36 For convex and strongly convex problems with Lipschitz continuous gradient, i.e., smooth convex and
|
| 48 |
+
37 strongly convex problems, this question was properly addressed in [25, 3, 14] where the first high
|
| 49 |
+
38 probability complexity bounds with logarithmic dependence on the confidence level were derived
|
| 50 |
+
39 for the stochastic problems with heavy-tailed noise. However, a number of practically important
|
| 51 |
+
40 problems are non-smooth on the whole space [40, 22]. For example, in deep neural network training,
|
| 52 |
+
41 the loss function often grows polynomially fast when the norm of the network’s weights goes to
|
| 53 |
+
42 infinity. Moreover, non-smoothness of the activation functions such as ReLU or loss functions such
|
| 54 |
+
43 as hinge loss implies the non-smoothness of the whole problem. While being well-motivated by
|
| 55 |
+
44 practical applications, the existing high-probability convergence guarantees for stochastic first-order
|
| 56 |
+
45 methods applied to solve non-smooth convex optimization problems with heavy-tailed noise depend
|
| 57 |
+
46 on the negative power of the confidence level that dramatically increases the number of iterations
|
| 58 |
+
47 required to obtain high accuracy of the solution with probability close to one. Such a discrepancy in
|
| 59 |
+
48 the theory between algorithms for stochastic smooth and non-smooth problems leads us to the natural
|
| 60 |
+
49 question: is it possible to obtain high-probability complexity bounds with logarithmic dependence
|
| 61 |
+
50 on the confidence level for non-smooth convex stochastic problems with heavy-tailed noise? In this
|
| 62 |
+
51 paper, we give a positive answer to this question. To achieve this we focus on gradient clipping
|
| 63 |
+
52 methods [30, 10, 23, 22, 40, 41].
|
| 64 |
+
|
| 65 |
+
# 1.1 Preliminaries
|
| 66 |
+
|
| 67 |
+
Before we describe our contributions in detail, we formally state the considered setup.
|
| 68 |
+
|
| 69 |
+
55 Stochastic optimization. We focus on the following problem
|
| 70 |
+
|
| 71 |
+
$$
|
| 72 |
+
\operatorname* { m i n } _ { x \in \mathbb { R } ^ { n } } f ( x ) , \quad f ( x ) = \mathbb { E } _ { \xi } \left[ f ( x , \xi ) \right] ,
|
| 73 |
+
$$
|
| 74 |
+
|
| 75 |
+
56 where $f ( x )$ is a convex but possibly non-smooth function. Next, we assume that at each point $x \in \mathbb { R } ^ { n }$
|
| 76 |
+
57 we have an access to the unbiased estimator $\nabla f ( x , \xi )$ of $\nabla f ( x )$ with uniformly bounded variance
|
| 77 |
+
|
| 78 |
+
$$
|
| 79 |
+
\begin{array} { r } { \mathbb { E } _ { \xi } [ \nabla f ( x , \xi ) ] = \nabla f ( x ) , \quad \mathbb { E } _ { \xi } \left[ \| \nabla f ( x , \xi ) - \nabla f ( x ) \| _ { 2 } ^ { 2 } \right] \le \sigma ^ { 2 } , \quad \sigma > 0 . } \end{array}
|
| 80 |
+
$$
|
| 81 |
+
|
| 82 |
+
58 This assumption on the stochastic oracle is widely used in stochastic optimization literature [11,
|
| 83 |
+
59 12, 19, 21, 26]. We emphasize that we do not assume that the stochastic gradients have so-called
|
| 84 |
+
60 “light tails” [21], i.e., sub-Gaussian noise distribution meaning that $\mathbb { P } \{ \| \nabla f ( \bar { x } , \xi ) - \nabla f ( x ) \| _ { 2 } > b \} \le$
|
| 85 |
+
61 $2 \exp \bigl ( - b ^ { 2 } / ( 2 \sigma ^ { 2 } ) \bigr )$ for all $b > 0$ .
|
| 86 |
+
|
| 87 |
+
62 Level of smoothness. Finally, we assume that function $f$ has $( \nu , M _ { \nu } )$ -Hölder continuous gradients on a compact set 63 $Q \subseteq \mathbb { R } ^ { n }$ for some $\nu \in [ 0 , 1 ]$ , $M _ { \nu } > 0$ meaning that
|
| 88 |
+
|
| 89 |
+
$$
|
| 90 |
+
\| \nabla f ( x ) - \nabla f ( y ) \| _ { 2 } \leq M _ { \nu } \| x - y \| _ { 2 } ^ { \nu } \quad \forall x , y \in Q .
|
| 91 |
+
$$
|
| 92 |
+
|
| 93 |
+
64 When $\nu = 1$ inequality (3) implies $M _ { 1 }$ -smoothness of $f$ , and when $\nu = 0$ we have that $\nabla f ( x )$
|
| 94 |
+
65 has bounded variation which is equivalent to being uniformly bounded. Moreover, when $\nu = 0$
|
| 95 |
+
66 differentiability of $f$ is not needed, and one can assume uniform boundedness of the subgradients of
|
| 96 |
+
67 $f$ . Linear regression in the case when the noise has generalized Gaussian distribution (Example 4.4
|
| 97 |
+
68 from [2]) serves as a natural example of the situation with $\nu \in ( 0 , 1 )$ . Moreover, when (3) holds for
|
| 98 |
+
69 $\nu = 0$ and $\nu = 1$ simultaneously then it holds for all $\nu \in [ 0 , 1 ]$ with $M _ { \nu } \leq M _ { 0 } ^ { 1 - \nu } M _ { 1 } ^ { \nu }$ [28]. As we
|
| 99 |
+
70 show in our results, the set $Q$ should contain the ball centered at the solution $x ^ { * }$ of (1) with radius
|
| 100 |
+
71 $2 R _ { 0 } = 2 \lVert x ^ { 0 } - x ^ { * } \rVert _ { 2 }$ , where $x ^ { 0 }$ is a starting point of the method, i.e., our analysis does not require (3)
|
| 101 |
+
72 to hold on $\mathbb { R } ^ { n }$ .
|
| 102 |
+
73 High-probability convergence. For a given accuracy $\varepsilon > 0$ and confidence level $\beta \in ( 0 , 1 )$ we
|
| 103 |
+
74 are interested in finding $\varepsilon$ -solutions of problem (1) with probability at least $1 - \beta$ , i.e., such $\widehat { x }$ that
|
| 104 |
+
75 $\mathbb { P } \{ f ( \widehat { x } ) - f ( x ^ { * } ) \leq \varepsilon \} \geq 1 - \beta$ b. For brevity, we will call such (in general, random) points $\widehat { x }$ as
|
| 105 |
+
76 $( \varepsilon , \beta )$ b-solution of (1). Moreover, by high-probability complexity of a stochastic method $\mathcal { M }$ b we mean
|
| 106 |
+
77 the sufficient number of oracle calls, i.e., number of $\nabla f ( x , \xi )$ computations, needed to guarantee that
|
| 107 |
+
78 the output of $\mathcal { M }$ is an $( \varepsilon , \beta )$ -solution of (1).
|
| 108 |
+
|
| 109 |
+
Table 1: Summary of known and new high-probability complexity bounds for solving (1) with $f$ being convex and having $( \nu , M _ { \nu } )$ -Hölder continuous gradients. Columns: “Ref.” $=$ reference, “Complexity” $=$ high-probability complexity (ε – accuracy, $\beta$ – confidence level, numerical constants and logarithmic factors are omitted), $\mathrm { \ddot { H } T \vec { \bf \Phi } = }$ heavy-tailed noise, $ { \mathrm { ^ 6 } } \mathrm { U } { \mathrm { D } } ^ { { \prime } { = } }$ unbounded domain, “HCC” $=$ Hölder continuity of the gradient is required only on the compact set. The results labeled by $\clubsuit$ are obtained from the convergence guarantees in expectation via Markov’s inequality. Negative-power dependencies on the confidence level $\beta$ are colored in red.
|
| 110 |
+
|
| 111 |
+
<table><tr><td rowspan=1 colspan=1>Method</td><td rowspan=1 colspan=1>Ref.</td><td rowspan=1 colspan=5>Complexity</td><td rowspan=1 colspan=1>V</td><td rowspan=1 colspan=1>HT?</td><td rowspan=1 colspan=1>UD?</td><td rowspan=1 colspan=1>HCC?</td></tr><tr><td rowspan=1 colspan=1>SGD</td><td rowspan=1 colspan=1>[26]</td><td rowspan=1 colspan=2>max</td><td rowspan=1 colspan=3>MR²R2 , 2</td><td rowspan=1 colspan=1>0</td><td rowspan=1 colspan=1>×</td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=1>X</td></tr><tr><td rowspan=1 colspan=1>AC-SA</td><td rowspan=1 colspan=1>[11, 21]</td><td rowspan=1 colspan=3>MR²max,2E</td><td rowspan=1 colspan=2></td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=1>X</td></tr><tr><td rowspan=1 colspan=1>SIGMA</td><td rowspan=1 colspan=1>[6]</td><td rowspan=1 colspan=4>2 2(1+v)M3R1+3v max2,1+3v</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>[0,1]</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>【</td><td rowspan=1 colspan=1>X</td></tr><tr><td rowspan=1 colspan=1>SGD</td><td rowspan=1 colspan=1>[26]*</td><td rowspan=1 colspan=2>max</td><td rowspan=1 colspan=3>MRβ²2,β2²</td><td rowspan=1 colspan=1>0</td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>X</td></tr><tr><td rowspan=1 colspan=1>AC-SA</td><td rowspan=1 colspan=1>[11,21]*</td><td rowspan=1 colspan=3>MRmax,B²²2βε</td><td rowspan=1 colspan=2></td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>【</td><td rowspan=1 colspan=1>【</td><td rowspan=1 colspan=1>X</td></tr><tr><td rowspan=1 colspan=1>SIGMA</td><td rowspan=1 colspan=1>[6]</td><td rowspan=1 colspan=4>2 2(1+v)R1+3v ²max22,B22β1+3v1+3v</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>[0,1]</td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=1>X</td></tr><tr><td rowspan=1 colspan=1>clipped-SSTM</td><td rowspan=1 colspan=1>[14]</td><td rowspan=1 colspan=3>MRmax1,2E</td><td rowspan=1 colspan=2></td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>【</td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=1>X</td></tr><tr><td rowspan=1 colspan=1>clipped-SGD</td><td rowspan=1 colspan=1>[14]</td><td rowspan=1 colspan=5>max MR²R,E 2</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>『</td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=1>X</td></tr><tr><td rowspan=1 colspan=1>clipped-SSTM</td><td rowspan=1 colspan=1>Thm. 2.2</td><td rowspan=1 colspan=4>2 2(1+v)M1+3vRO1+3v ²max2,2e1+3v</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>[0,1]</td><td rowspan=1 colspan=1>[</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>【</td></tr><tr><td rowspan=1 colspan=1>clipped-SGD</td><td rowspan=1 colspan=1>Thm. 3.1</td><td rowspan=1 colspan=1>max</td><td rowspan=1 colspan=2>2M1+VR²ε2</td><td rowspan=1 colspan=2></td><td rowspan=1 colspan=1>[0,1]</td><td rowspan=1 colspan=1>【</td><td rowspan=1 colspan=1>「</td><td rowspan=1 colspan=1>r</td></tr></table>
|
| 112 |
+
|
| 113 |
+
# 79 1.2 Contributions
|
| 114 |
+
|
| 115 |
+
• We propose novel stepsize rules for clipped-SSTM [14] to handle the problems with Hölder continuous gradients and derive high-probability complexity guarantees for convex stochastic optimization problems without using “light tails” assumption, i.e., we prove that our version of clipped-SSTM
|
| 116 |
+
|
| 117 |
+
$$
|
| 118 |
+
\mathcal { O } \left( \operatorname* { m a x } \left\{ D \ln ^ { \frac { 2 ( 1 + \nu ) } { 1 + 3 \nu } } \frac { D } { \beta } , \frac { \sigma ^ { 2 } R _ { 0 } ^ { 2 } } { \varepsilon ^ { 2 } } \ln \frac { D } { \beta } \right\} \right) , \quad D = \frac { M _ { \nu } ^ { \frac { 2 } { 1 + 3 \nu } } R _ { 0 } ^ { \frac { 2 ( 1 + \nu ) } { 1 + 3 \nu } } } { \varepsilon ^ { \frac { 2 } { 1 + 3 \nu } } }
|
| 119 |
+
$$
|
| 120 |
+
|
| 121 |
+
84 high-probability complexity. Unlike all previous high-probability complexity results in this setup
|
| 122 |
+
85 with $\nu < 1$ (see Tbl. 1), our result depends only logarithmically on the confidence level $\beta$ that
|
| 123 |
+
86 is highly important when $\beta$ is small. Moreover, up to the difference in logarithmic factors the
|
| 124 |
+
87 derived complexity guarantees meet the known lower bounds [21, 17] obtained for the problems
|
| 125 |
+
88 with light-tailed noise. In particular, when $\nu = 1$ we recover accelerated convergence rate [29, 21].
|
| 126 |
+
89 That is, neglecting the logarithmic factors our results are unimprovable and, surprisingly coincide
|
| 127 |
+
90 with the best-known results in the “light-tailed case”.
|
| 128 |
+
|
| 129 |
+
• We derive the first high-probability complexity bounds for clipped-SGD when the objective 2 functions is convex with $( \nu , M _ { \nu } )$ -Hölder continuous gradient and the noise is heavy tailed., i.e., we 3 derive
|
| 130 |
+
|
| 131 |
+
$$
|
| 132 |
+
\mathcal { O } \left( \operatorname* { m a x } \left\{ D ^ { 2 } , \operatorname* { m a x } \left\{ D ^ { 1 + \nu } , \frac { \sigma ^ { 2 } R _ { 0 } ^ { 2 } } { \varepsilon ^ { 2 } } \right\} \ln \frac { D ^ { 2 } + D ^ { 1 + \nu } } { \beta } \right\} \right) , \quad D = \frac { M _ { \nu } ^ { \frac { 1 } { 1 + \nu } } R _ { 0 } } { \varepsilon ^ { \frac { 1 } { 1 + \nu } } }
|
| 133 |
+
$$
|
| 134 |
+
|
| 135 |
+
94 high-probability complexity bound. Interestingly, when $\nu = 0$ the derived bound for clipped-SGD
|
| 136 |
+
95 has better dependence on the logarithms than the corresponding one for clipped-SSTM. Moreover,
|
| 137 |
+
96 neglecting the dependence on $\varepsilon$ under the logarithm, our bound for clipped-SGD has the same
|
| 138 |
+
|
| 139 |
+
Table 2: Summary of known and new high-probability complexity bounds for solving (1) with $f$ being $\mu$ -strongly convex and having $( \nu , M _ { \nu } )$ -Hölder continuous gradients. Columns: “Ref.” $=$ reference, “Complexity” $=$ high-probability complexity $\varepsilon -$ accuracy, $\beta$ – confidence level, numerical constants and logarithmic factors are omitted), $\mathrm { \ddot { H } T \vec { \bf \Phi } = }$ heavy-tailed noise, $ { \mathrm { ^ 6 } } \mathrm { U } { \mathrm { D } } ^ { { \prime } { = } }$ unbounded domain, “HCC” $=$ Hölder continuity of the gradient is required only on the compact set. The results labeled by $\clubsuit$ are obtained from the convergence guarantees in expectation via Markov’s inequality. Negative-power dependencies on the confidence level $\beta$ are colored in red.
|
| 140 |
+
|
| 141 |
+
<table><tr><td rowspan=1 colspan=1>Method</td><td rowspan=1 colspan=1>Ref.</td><td rowspan=1 colspan=6>Complexity</td><td rowspan=1 colspan=1>V</td><td rowspan=1 colspan=1>HT?</td><td rowspan=1 colspan=1>UD?</td><td rowspan=1 colspan=1>HCC?</td></tr><tr><td rowspan=1 colspan=1>SGD</td><td rowspan=1 colspan=1>[26]</td><td rowspan=1 colspan=3>max</td><td rowspan=1 colspan=1>Mg²μ,μ</td><td rowspan=1 colspan=2></td><td rowspan=1 colspan=1>0</td><td rowspan=1 colspan=1>×</td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=1>×</td></tr><tr><td rowspan=1 colspan=1>AC-SA</td><td rowspan=1 colspan=1>[11,21]</td><td rowspan=1 colspan=2>max</td><td rowspan=1 colspan=2>M1gμ,με</td><td rowspan=1 colspan=2></td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>×</td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=1>×</td></tr><tr><td rowspan=1 colspan=1>SIGMA</td><td rowspan=1 colspan=1>[6]</td><td rowspan=1 colspan=6>N,gmaxμY,213v M 1N=My13v+ (1+ve1-v</td><td rowspan=1 colspan=1>[0,1]</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>【</td><td rowspan=1 colspan=1>×</td></tr><tr><td rowspan=1 colspan=1>SGD</td><td rowspan=1 colspan=1>[26]</td><td rowspan=1 colspan=2>max</td><td></td><td rowspan=1 colspan=3>M8²μBuβε</td><td rowspan=1 colspan=1>0</td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>X</td></tr><tr><td rowspan=1 colspan=1>AC-SA</td><td rowspan=1 colspan=1>[11,21]*</td><td rowspan=1 colspan=2>max</td><td rowspan=1 colspan=4>M1b²1√β</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>!</td><td rowspan=1 colspan=1>【</td><td rowspan=1 colspan=1>×</td></tr><tr><td rowspan=1 colspan=1>SIGMA</td><td rowspan=1 colspan=1>[6]</td><td rowspan=1 colspan=6>maxN,8²2u},e=βe,213v M 1N=My1+3v+(+v1-v)</td><td rowspan=1 colspan=1>[0,1]</td><td rowspan=1 colspan=1>!</td><td rowspan=1 colspan=1>[</td><td rowspan=1 colspan=1>X</td></tr><tr><td rowspan=1 colspan=1>R-clipped-SSTM</td><td rowspan=1 colspan=1>[14]</td><td rowspan=1 colspan=2>max</td><td rowspan=1 colspan=4>√M1b²μ²</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=1>X</td></tr><tr><td rowspan=1 colspan=1>R-clipped-SGD</td><td rowspan=1 colspan=1>[14]</td><td rowspan=1 colspan=6>max M162,Hμ</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>【</td><td rowspan=1 colspan=1>【</td><td rowspan=1 colspan=1>X</td></tr><tr><td rowspan=1 colspan=1>R-clipped-SSTM</td><td rowspan=1 colspan=1>Thm. 2.1</td><td rowspan=1 colspan=6>max N,g²μEN= My 1+3v M² 1+3v(μ1+veI-v)</td><td rowspan=1 colspan=1>[0,1]</td><td rowspan=1 colspan=1>【</td><td rowspan=1 colspan=1>r</td><td rowspan=1 colspan=1>厂</td></tr><tr><td rowspan=1 colspan=1>R-clipped-SGD</td><td rowspan=1 colspan=1>Thm. 3.2</td><td rowspan=1 colspan=1>max</td><td rowspan=1 colspan=4>2 2 品MT1+v2(1-ν) ,2μEμIvRo1+v μeI+v</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>[0,1]</td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=1>丫</td><td rowspan=1 colspan=1></td></tr></table>
|
| 142 |
+
|
| 143 |
+
dependence on the confidence level as the tightest known result in this case under the “light tails” assumption [16].
|
| 144 |
+
|
| 145 |
+
• Using restarts technique we extend the obtained results for clipped-SSTM and clipped-SGD to the strongly convex case (see Tbl. 2). As in the convex case, the obtained results are superior to all previous known results in the general setup we consider.
|
| 146 |
+
|
| 147 |
+
102 • As one of the key contributions of this work, we emphasize that in our theoretical results it is
|
| 148 |
+
103 sufficient to assume Hölder continuity of the gradients of $f$ only on the ball with radius $2 R _ { 0 } =$
|
| 149 |
+
104 $2 \lVert x ^ { 0 } - x ^ { * } \rVert _ { 2 }$ and centered at a solution of the problem. This makes our results applicable to much
|
| 150 |
+
105 larger class of problems than functions with Hölder continuous gradients on $\mathbb { R } ^ { n }$ , e.g., our analysis
|
| 151 |
+
106 works even for polynomially growing objectives.
|
| 152 |
+
107 • To test the performance of the considered methods we conduct several numerical experiments
|
| 153 |
+
108 on image classification and NLP tasks, and observe that 1) clipped-SSTM and clipped-SGD
|
| 154 |
+
109 show a comparable performance with SGD on the image classification task, when the noise
|
| 155 |
+
110 distribution is almost sub-Gaussian, 2) converge much faster than SGD on the NLP task, when the
|
| 156 |
+
111 noise distribution is heavy-tailed, and 3) clipped-SSTM achieves a comparable performance with
|
| 157 |
+
112 Adam on the NLP task enjoying both the best known theoretical guarantees and good practical
|
| 158 |
+
113 performance.
|
| 159 |
+
|
| 160 |
+
# 114 1.3 Related work
|
| 161 |
+
|
| 162 |
+
115 Light-tailed noise. The theory of high-probability complexity bounds for convex stochastic op
|
| 163 |
+
116 timization with light-tailed noise is well-developed. Lower bounds and optimal methods for the
|
| 164 |
+
117 problems with $( \nu , M _ { \nu } )$ -Hölder continuous gradients are obtained in [26] for $\nu = 0$ , and in [11] for
|
| 165 |
+
118 $\nu = 1$ . Up to the logarithmic dependencies these high-probability convergence bounds coincide with
|
| 166 |
+
119 the corresponding results for the convergence in expectation (see first two rows of Tbl. 1) While not
|
| 167 |
+
120 being directly derived in the literature, the lower bound for the case when $\nu \in ( 0 , 1 )$ can be obtained
|
| 168 |
+
121 as a combination of lower bounds in the deterministic [27, 17] and smooth stochastic settings [11].
|
| 169 |
+
122 The corresponding optimal methods are analyzed in [4, 6] through the lens of inexact oracle.
|
| 170 |
+
123 Heavy-tailed noise. Unlike in the “light-tailed” case, the first theoretical guarantees with reasonable
|
| 171 |
+
124 dependence on both the accuracy $\varepsilon$ and the confidence level $\beta$ appeared just recently. In [25], the
|
| 172 |
+
125 first such results without acceleration [29] were derived for Mirror Descent with special truncation
|
| 173 |
+
126 technique for smooth $( \nu = 1$ ) convex problems on a bounded domain, and then were accelerated and
|
| 174 |
+
127 extended in [14]. For the strongly convex problems the first accelerated high-probability convergence
|
| 175 |
+
128 guarantees were obtained in [3] for the special method called proxBoost requiring solving auxiliary
|
| 176 |
+
129 nontrivial problems at each iteration. These bounds were tightened in [14].
|
| 177 |
+
130 In contrast, for the case when $\nu < 1$ and, in particular, when $\nu = 0$ the best-known high-probability
|
| 178 |
+
131 complexity bounds suffer from the negative-power dependence on the confidence level $\beta$ , i.e., have
|
| 179 |
+
132 a factor $1 / \beta ^ { \alpha }$ for some $\alpha > 0$ , that affects the convergence rate dramatically for small enough
|
| 180 |
+
133 $\beta$ . Without additional assumptions on the tails these results are obtained via Markov’s inequality
|
| 181 |
+
134 $\mathbb { P } \{ f ( x ) - f ( x ^ { * } ) > \varepsilon \} < \mathbb { E } [ f ( x ) - f ( x ^ { * } ) ] _ { / \varepsilon }$ from the guarantees for the convergence in expectation to
|
| 182 |
+
135 the accuracy $\varepsilon \beta$ , see the results labeled by $\clubsuit$ in Tbl. 1. Under an additional assumption on noise
|
| 183 |
+
136 tails that $\mathbb { P } \boldsymbol { \tilde { \{ \| \nabla \boldsymbol { f } } ( \boldsymbol { x } , \boldsymbol { \xi } ) - \nabla \boldsymbol { f } ( \boldsymbol { x } ) \| _ { 2 } ^ { 2 } > s \sigma ^ { 2 } \tilde { \boldsymbol { \xi } } = O ( s ^ { - \alpha } ) }$ for $\alpha > 2$ these results can be tightened [9]
|
| 184 |
+
137 when $\nu = 0$ as ${ \cal O } \left( M _ { 0 } ^ { 2 } R _ { 0 } ^ { 2 } \operatorname* { m a x } \left\{ \ln \left( \beta ^ { - 1 } \right) / \varepsilon ^ { 2 } , \left( 1 / \beta \varepsilon ^ { \alpha } \right) ^ { 2 / ( 3 \alpha - 2 ) } \right\} \right)$ without removing the negative-power
|
| 185 |
+
138 dependence on the confidence level $\beta$ . Different stepsize policies allow to change the last term in
|
| 186 |
+
139 max to $\beta ^ { - \frac { 1 } { 2 \alpha - 1 } } \varepsilon ^ { - \frac { 2 \alpha } { 2 \alpha - 1 } }$ without removing the negative-power dependence on $\beta$ .
|
| 187 |
+
140 Gradient clipping. The methods based on gradient clipping [30] and normalization [18] are popular
|
| 188 |
+
141 in different machine learning and deep learning tasks due to their robustness in practice to the noise
|
| 189 |
+
142 in the stochastic gradients and rapid changes of the objective function [13]. In [40, 22], clipped-GD
|
| 190 |
+
143 and clipped-SGD are theoretically studied in applications to non-smooth problems that can grow
|
| 191 |
+
144 polynomially fast when $\lVert x - x ^ { * } \rVert _ { 2 } \to \infty$ showing the superiority of gradient clipping methods
|
| 192 |
+
145 to the methods without clipping. The results from [40] are obtained for non-convex problems
|
| 193 |
+
146 with almost surely bounded noise, and in [22], the authors derive the stability and expectation
|
| 194 |
+
147 convergence guarantees for strongly convex under assumption that the central $p$ -th moment of the
|
| 195 |
+
148 stochastic gradient is bounded for $p \geq 2$ . Since the authors of [22] do not provide convergence
|
| 196 |
+
149 guarantees with explicit dependencies on all important parameters of the problem it complicates direct
|
| 197 |
+
150 comparison with our results. Nevertheless, convergence guarantees from [22] are sub-linear and are
|
| 198 |
+
151 given for the convergence in expectation, and, as a consequence, the corresponding high-probability
|
| 199 |
+
152 convergence results obtained via Markov’s inequality also suffer from negative-power dependence on
|
| 200 |
+
153 the confidence level. Next, in [41], the authors establish several expectation convergence guarantees
|
| 201 |
+
154 for clipped-SGD and prove their optimality in the non-convex case under assumption that the central
|
| 202 |
+
155 $\alpha$ -moment of the stochastic gradient is uniformly bounded, where $\alpha \in ( 1 , 2 ]$ . It turns out that
|
| 203 |
+
156 clipped-SGD is able to converge even when $\alpha < 2$ , whereas vanilla SGD can diverge in this setting.
|
| 204 |
+
|
| 205 |
+
# 57 2 Clipped Stochastic Similar Triangles Method
|
| 206 |
+
|
| 207 |
+
In this section, we propose a novel variation of Clipped Stochastic Similar Triangles Method [14] adjusted to the class of objectives with Hölder continuous gradients (clipped-SSTM, see Alg. 1).
|
| 208 |
+
|
| 209 |
+
160 The method is based on the clipping of the stochastic gradients:
|
| 210 |
+
|
| 211 |
+
$$
|
| 212 |
+
\mathrm { c l i p } ( \nabla f ( x , \pmb { \xi } ) , \lambda ) = \operatorname* { m i n } \left\{ 1 , \frac { \lambda } { \| \nabla f ( x , \pmb { \xi } ) \| _ { 2 } } \right\} \nabla f ( x , \pmb { \xi } )
|
| 213 |
+
$$
|
| 214 |
+
|
| 215 |
+
161 where $\begin{array} { r } { \nabla f ( x , \xi ) = \frac { 1 } { m } \sum _ { i = 1 } ^ { m } \nabla f ( x , \xi _ { i } ) } \end{array}$ is a mini-batched stochastic gradient. Gradient clipping
|
| 216 |
+
162 ensures that the resulting vector has a norm bounded by the clipping level $\lambda$ . Since the clipped
|
| 217 |
+
163 stochastic gradient cannot have arbitrary large norm, the clipping helps to avoid unstable behavior of
|
| 218 |
+
164 the method when the noise is heavy-tailed and the clipping level $\lambda$ is properly adjusted.
|
| 219 |
+
165 However, unlike the stochastic gradient, clipped stochastic gradient is a biased estimate of $\nabla f ( x )$ :
|
| 220 |
+
166 the smaller the clipping level the larger the bias. The biasedness of the clipped stochastic gradient
|
| 221 |
+
|
| 222 |
+
Input: starting point $x ^ { 0 }$ , number of iterations $N$ , batchsizes $\{ m _ { k } \} _ { k = 1 } ^ { N }$ , stepsize parameter $\alpha$ , clipping parameter $B$ , Hölder exponent $\nu \in [ 0 , 1 ]$ .
|
| 223 |
+
1: Set $A _ { 0 } = \alpha _ { 0 } = 0$ , $y ^ { 0 } = \overset { \cdot } { z } { } ^ { 0 } = x ^ { 0 }$
|
| 224 |
+
2: for $k = 0 , \ldots , N - 1$ do
|
| 225 |
+
3: Set $\alpha _ { k + 1 } = \alpha ( k + 1 ) ^ { \frac { 2 \nu } { 1 + \nu } }$ , $\begin{array} { r } { A _ { k + 1 } = A _ { k } + \alpha _ { k + 1 } , \lambda _ { k + 1 } = \frac { B } { \alpha _ { k + 1 } } } \end{array}$
|
| 226 |
+
4: $x ^ { k + 1 } = ( A _ { k } y ^ { k } + \alpha _ { k + 1 } z ^ { k } ) \big / A _ { k + 1 }$
|
| 227 |
+
5: $\begin{array} { r } { \frac { 1 } { m _ { k } } \sum _ { i = 1 } ^ { m _ { k } } \nabla f ( x ^ { k + 1 } , \xi _ { i } ^ { k } ) } \end{array}$ Draw mini-batch $m _ { k }$ of fresh i.i.d. samples $\xi _ { 1 } ^ { k } , \ldots , \xi _ { m _ { k } } ^ { k }$ and compute $\nabla f ( x ^ { k + 1 } , \pmb { \xi } ^ { k } ) =$
|
| 228 |
+
6: Compute $\widetilde { \nabla } f ( x ^ { k + 1 } , \pmb { \xi } ^ { k } ) = \mathrm { c l i p } ( \nabla f ( x ^ { k + 1 } , \pmb { \xi } ^ { k } ) , \lambda _ { k + 1 } ) \ \mathrm { u s i n g } \ ( 4 _ { { \cal N } }$
|
| 229 |
+
7: 8: $z ^ { k + 1 } = z ^ { k } - \alpha _ { k + 1 } \widetilde { \nabla } f ( x ^ { k + 1 } , \pmb { \xi } ^ { k } )$ $y ^ { k + 1 } = ( A _ { k } y ^ { k } + \alpha _ { k + 1 } z ^ { k + 1 } ) \big / A _ { k + 1 }$
|
| 230 |
+
|
| 231 |
+
9: end for Output: $y ^ { N }$
|
| 232 |
+
|
| 233 |
+
167 complicates the analysis of the method. On the other hand, to circumvent the negative effect of
|
| 234 |
+
168 the heavy-tailed noise on the high-probability convergence one should choose $\lambda$ to be not too large.
|
| 235 |
+
169 Therefore, the question on the appropriate choice of the clipping level is highly non-trivial.
|
| 236 |
+
170 Fortunately, there exists a simple but insightful observation that helps us to obtain the right formula
|
| 237 |
+
171 for the clipping level $\lambda _ { k }$ in clipped-SSTM: if $\lambda _ { k }$ is chosen in such a way that $\| \nabla f ( x ^ { \bar { k } } ) \| _ { 2 } \leq \lambda _ { k } / 2$
|
| 238 |
+
172 with high probability, then for the realizations $\nabla f ( x ^ { k + 1 } , \pmb { \xi } ^ { k } )$ of the mini-batched stochastic gradient
|
| 239 |
+
173 such that $\| \nabla f ( x ^ { k + 1 } , \pmb { \xi } ^ { k } ) - \nabla f ( x ^ { k + 1 } ) \| _ { 2 } \leq \lambda _ { k } / 2$ the clipping is an identity operator. Next, if the
|
| 240 |
+
174 probability mass of such realizations is big enough then the bias of the clipped stochastic gradient is
|
| 241 |
+
175 properly bounded that helps to derive needed convergence guarantees. It turns out that the choice
|
| 242 |
+
176 $\lambda _ { k } \sim 1 / \alpha _ { k }$ ensures the method convergence with needed rate and high enough probability.
|
| 243 |
+
177 Guided by this observation we derive the precise expressions for all the parameters of clipped-SSTM
|
| 244 |
+
178 and derive high-probability complexity bounds for the method. Below we provide a simplified version
|
| 245 |
+
179 of the main result for clipped-SSTM in the convex case. The complete formulation and the full proof
|
| 246 |
+
180 of the theorem are deferred to Appendix B.1 (see Thm. B.1).
|
| 247 |
+
|
| 248 |
+
181 Theorem 2.1. Assume that function $f$ is convex and its gradient satisfy (3) with $\nu \in [ 0 , 1 ]$ , $M _ { \nu } > 0$ 182 on $Q = B _ { 2 R _ { 0 } } = \{ x \in \mathbb { R } ^ { n } \mid \| x - x ^ { * } \| _ { 2 } \leq 2 R _ { 0 } \}$ , where $R _ { 0 } \geq \| x ^ { 0 } - x ^ { * } \| _ { 2 }$ . Then there exist such a choice of parameters that clipped-SSTM achieves 183 $f ( y ^ { N } ) - { \dot { f } } ( x ^ { * } ) \leq { \dot { \varepsilon } }$ with probability at least
|
| 249 |
+
|
| 250 |
+
184 $1 - \beta$ after $\mathcal { O } \left( D \ln ^ { \frac { 2 ( 1 + \nu ) } { 1 + 3 \nu } } \frac { D } { \beta } \right)$ iterations with $\begin{array} { r } { D = \frac { M _ { \nu } ^ { \frac { 2 } { 1 + 3 \nu } } R _ { 0 } ^ { \frac { 2 ( 1 + \nu ) } { 1 + 3 \nu } } } { \varepsilon ^ { \frac { 2 } { 1 + 3 \nu } } } } \end{array}$ and requires
|
| 251 |
+
|
| 252 |
+
$$
|
| 253 |
+
\mathcal { O } \left( \operatorname* { m a x } \left\{ D \ln ^ { \frac { 2 ( 1 + \nu ) } { 1 + 3 \nu } } \frac { D } { \beta } , \frac { \sigma ^ { 2 } R _ { 0 } ^ { 2 } } { \varepsilon ^ { 2 } } \ln \frac { D } { \beta } \right\} \right) o r a c l e c a l l s .
|
| 254 |
+
$$
|
| 255 |
+
|
| 256 |
+
185 The obtained result has only logarithmic dependence on the confidence level $\beta$ and optimal depen
|
| 257 |
+
186 dence on the accuracy $\varepsilon$ up to logarithmic factors [21, 17] for all $\nu \in [ 0 , 1 ]$ . Moreover, we emphasize
|
| 258 |
+
187 that our result does not require $f$ to have $( \nu , M _ { \nu } )$ -Hölder continuous gradient on the whole space.
|
| 259 |
+
188 This is because we prove that for the proposed choice of parameters the iterates of clipped-SSTM
|
| 260 |
+
189 stay inside the ball $B _ { 2 R _ { 0 } } = \{ x \in \bar { \mathbb { R } ^ { \bar { n } } } | \bar { \| x - x ^ { * } \| _ { 2 } } \leq 2 \bar { R } _ { 0 } \}$ with probability at least $1 - \beta$ , and,
|
| 261 |
+
190 as a consequence, Hölder continuity of the gradient is required only inside this ball. In particular,
|
| 262 |
+
191 this means that the better starting point leads not only to the reduction of $R _ { 0 }$ , but also it can reduce
|
| 263 |
+
192 $M _ { \nu }$ . Moreover, our result is applicable to much wider class of functions than the standard class of
|
| 264 |
+
193 functions with Hölder continuous gradients in $\mathbb { R } ^ { n }$ , e.g., to the problems with polynomial growth.
|
| 265 |
+
194 For the strongly convex problems, we consider restarted version of Alg. 1 (R-clipped-SSTM, see
|
| 266 |
+
195 Alg. 2) and derive high-probability complexity result for this version. Below we provide a simplified
|
| 267 |
+
196 version of the result. The complete formulation and the full proof of the theorem are deferred to
|
| 268 |
+
197 Appendix B.2 (see Thm. B.2).
|
| 269 |
+
198 Theorem 2.2. Assume that function $f$ is $\mu$ -strongly convex and its gradient satisfy (3) with $\nu \in [ 0 , 1 ]$ ,
|
| 270 |
+
199 $M _ { \nu } > 0$ on $Q = B _ { 2 R _ { 0 } } = \{ x \in \mathbb { R } ^ { n } \mid \| x - x ^ { * } \| _ { 2 } \leq 2 R _ { 0 } \}$ , where $\bar { R _ { 0 } } \geq \| x ^ { 0 } - x ^ { * } \| _ { 2 }$ . Then there exist
|
| 271 |
+
|
| 272 |
+
# Algorithm 2 Restarted clipped-SSTM (R-clipped-SSTM): case $\nu \in [ 0 , 1 ]$
|
| 273 |
+
|
| 274 |
+
Input: startibatchsiz $x ^ { 0 }$ u, $\tau$ steps of clipped-SST, stepsize parameters arts , cli $\{ N _ { t } \} _ { t = 1 } ^ { \tau }$ $\{ m _ { k } ^ { 1 } \} _ { k = 1 } ^ { N _ { 1 } - 1 }$ $\{ m _ { k } ^ { 2 } \} _ { k = 1 } ^ { N _ { 2 } - 1 } , \dots , \{ m _ { k } ^ { \tau } \} _ { k = 1 } ^ { N _ { \tau } - 1 }$ $\{ \alpha ^ { t } \} _ { t = 1 } ^ { \tau }$ $\{ B _ { t } \} _ { t = 1 } ^ { \tau }$ , Hölder exponent $\nu \in [ 0 , 1 ]$ .
|
| 275 |
+
1: $\hat { x } ^ { 0 } = x ^ { 0 }$
|
| 276 |
+
2: for 3: Run clipped-SSTM (Alg. 1) for $t = 1 , \ldots , \tau$ do $N _ { t }$ iterations with batchsizes $\{ m _ { k } ^ { t } \} _ { k = 1 } ^ { N _ { t } - 1 }$ , stepsize parameter $\alpha _ { t }$ , clipping parameter $B _ { t }$ , and starting point . Define the output of clipped-SSTM by .
|
| 277 |
+
|
| 278 |
+
4: end for Output: ${ \hat { x } } ^ { \tau }$
|
| 279 |
+
|
| 280 |
+
such a choice of parameters that R-clipped-SSTM achieves 200 $f ( \hat { x } ^ { \tau } ) - f ( x ^ { * } ) \leq \varepsilon$ with probability at 201 least $1 - \beta$ after
|
| 281 |
+
|
| 282 |
+
$$
|
| 283 |
+
\hat { N } = O \left( D \ln ^ { \frac { 2 ( 1 + \nu ) } { 1 + 3 \nu } } \frac { D } { \beta } \right) , \quad D = \operatorname* { m a x } \left\{ \left( \frac { M _ { \nu } } { \mu R _ { 0 } ^ { 1 - \nu } } \right) ^ { \frac { 2 } { 1 + 3 \nu } } \ln \frac { \mu R _ { 0 } ^ { 2 } } { \varepsilon } , \left( \frac { M _ { \nu } ^ { 2 } } { \mu ^ { 1 + \nu } \varepsilon ^ { 1 - \nu } } \right) ^ { \frac { 1 } { 1 + 3 \nu } } \right\}
|
| 284 |
+
$$
|
| 285 |
+
|
| 286 |
+
202 iterations of Alg. 1 in total and requires
|
| 287 |
+
|
| 288 |
+
$$
|
| 289 |
+
O \left( \operatorname * { m a x } \left\{ D \ln ^ { \frac { 2 ( 1 + \nu ) } { 1 + 3 \nu } } \frac { D } { \beta } , \frac { \sigma ^ { 2 } } { \mu \varepsilon } \ln \frac { D } { \beta } \right\} \right) o r a c l e c a l l s .
|
| 290 |
+
$$
|
| 291 |
+
|
| 292 |
+
203 Again, the obtained result has only logarithmic dependence on the confidence level $\beta$ and, as our
|
| 293 |
+
204 result in the convex case, it has optimal dependence on the accuracy $\varepsilon$ up to logarithmic factors
|
| 294 |
+
205 depending on $\beta$ [21, 17] for all $\nu \in [ 0 , 1 ]$ .
|
| 295 |
+
|
| 296 |
+
# 206 3 SGD with clipping
|
| 297 |
+
|
| 298 |
+
In this section, we present a new variant of clipped-SGD [30] properly adjusted to the class of objectives with $( \nu , M _ { \nu } )$ -Hölder continuous gradients (see Alg. 3).
|
| 299 |
+
|
| 300 |
+
Algorithm 3 Clipped Stochastic Gradient Descent (clipped-SGD): case $\nu \in [ 0 , 1 ]$
|
| 301 |
+
|
| 302 |
+
Input: starting point $x ^ { 0 }$ , number of iterations $N$ , batchsize $m$ , stepsize $\gamma$ , clipping parameter $B > 0$ . 1: for $k = 0 , \ldots , N - 1$ do
|
| 303 |
+
2: Draw mini-batch of $m$ fresh i.i.d. samples $\xi _ { 1 } ^ { k } , \ldots , \xi _ { m } ^ { k }$ and compute $\nabla f ( x ^ { k + 1 } , \pmb { \xi } ^ { k } ) \ =$ $\begin{array} { r } { \frac { 1 } { m } \sum _ { i = 1 } ^ { m } \nabla f ( x ^ { k + 1 } , \xi _ { i } ^ { k } ) } \end{array}$
|
| 304 |
+
3: Compute $\widetilde { \nabla } f ( x ^ { k } , \pmb { \xi } ^ { k } ) = \mathrm { c l i p } ( \nabla f ( x ^ { k } , \pmb { \xi } ^ { k } ) , \lambda ) \mathrm { u s i n g } ( 4 ) \mathrm { w i t h } \lambda = { B } / \gamma$
|
| 305 |
+
4: $\boldsymbol { x } ^ { k + 1 } = \boldsymbol { x } ^ { k } - \gamma \widetilde { \nabla } f ( \boldsymbol { x } ^ { k } , \pmb { \xi } ^ { k } )$
|
| 306 |
+
|
| 307 |
+
Output: 5: end for $\begin{array} { r } { \bar { x } ^ { N } = \frac { 1 } { N } \sum _ { k = 0 } ^ { N - 1 } x ^ { k } } \end{array}$
|
| 308 |
+
|
| 309 |
+
209 We emphasize that as for clipped-SSTM we use clipping level $\lambda$ inversely proportional to the stepsize
|
| 310 |
+
210 $\gamma$ . Below we provide a simplified version of the main result for clipped-SGD in the convex case. The
|
| 311 |
+
211 complete formulation and the full proof of the theorem are deferred to Appendix C.1 (see Thm. C.1).
|
| 312 |
+
212 Theorem 3.1. Assume that function $f$ is convex and its gradient satisfy (3) with $\nu \in [ 0 , 1 ]$ , $M _ { \nu } > 0$
|
| 313 |
+
213 on $Q = B _ { 2 R _ { 0 } } = \{ x \in \mathbb { R } ^ { n } \mid \| x - x ^ { * } \| _ { 2 } \leq 2 R _ { 0 } \}$ , where $R _ { 0 } \geq \| x ^ { 0 } - x ^ { * } \| _ { 2 }$ . Then there exist such $a$
|
| 314 |
+
214 choice of parameters that clipped-SGD achieves $f ( { \bar { x } } ^ { N } ) - f ( x ^ { * } ) \leq \varepsilon$ with probability at least $1 - \beta$
|
| 315 |
+
215 after
|
| 316 |
+
|
| 317 |
+
$$
|
| 318 |
+
\mathcal { O } \left( \operatorname* { m a x } \left\{ D ^ { 2 } , D ^ { 1 + \nu } \ln \frac { D ^ { 2 } + D ^ { 1 + \nu } } { \beta } \right\} \right) , \quad D = \frac { M _ { \nu } ^ { \frac { 1 } { 1 + \nu } } R _ { 0 } } { \varepsilon ^ { \frac { 1 } { 1 + \nu } } }
|
| 319 |
+
$$
|
| 320 |
+
|
| 321 |
+
216 iterations and requires
|
| 322 |
+
|
| 323 |
+
$$
|
| 324 |
+
\mathcal { O } \left( \operatorname* { m a x } \left\{ D ^ { 2 } , \operatorname* { m a x } \left\{ D ^ { 1 + \nu } , \frac { \sigma ^ { 2 } R _ { 0 } ^ { 2 } } { \varepsilon ^ { 2 } } \right\} \ln \frac { D ^ { 2 } + D ^ { 1 + \nu } } { \beta } \right\} \right) o r a c l e c a l l s .
|
| 325 |
+
$$
|
| 326 |
+
|
| 327 |
+
217 As all our results in the paper, this result for clipped-SGD has two important features: 1) the
|
| 328 |
+
218 dependence on the confidence level $\beta$ is logarithmic and 2) Hölder continuity is required only on
|
| 329 |
+
219 the ball ${ \cal B } _ { 2 { \cal R } _ { 0 } }$ centered at the solution. Moreover, up to the difference in the expressions under
|
| 330 |
+
220 the logarithm the dependence on $\varepsilon$ in the result for clipped-SGD is the same as in the tightest
|
| 331 |
+
221 known results for non-accelerated SGD-type methods [4, 16]. Finally, we emphasize that for $\nu < 1$
|
| 332 |
+
222 the logarithmic factors appearing in the complexity bound for clipped-SSTM are worse than the
|
| 333 |
+
223 corresponding factor in the complexity bound for clipped-SGD. Therefore, clipped-SGD has the
|
| 334 |
+
224 best known high-probability complexity results in the case when $\nu = 0$ and $f$ is convex.
|
| 335 |
+
|
| 336 |
+
225 For the strongly convex problems, we consider restarted version of Alg. 3 (R-clipped-SGD, see Alg. 4) and derive high-probability complexity result for this version. Below we provide a simplified
|
| 337 |
+
|
| 338 |
+
# Algorithm 4 Restarted clipped-SGD (R-clipped-SGD): case $\nu \in [ 0 , 1 ]$
|
| 339 |
+
|
| 340 |
+
Input: starting point $x ^ { 0 }$ , number of restarts $\tau$ , number of steps of clipped-SGD in restarts $\{ N _ { t } \} _ { t = 1 } ^ { \tau }$ , batchsizes $\{ m _ { t } \} _ { k = 1 } ^ { \tau }$ , stepsizes $\{ \gamma _ { t } \} _ { t = 1 } ^ { \tau }$ , clipping parameters $\{ B _ { t } \} _ { t = 1 } ^ { \tau }$
|
| 341 |
+
1: $\hat { x } ^ { 0 } = x ^ { 0 }$
|
| 342 |
+
2: for $t = 1 , \ldots , \tau$ do
|
| 343 |
+
3: Run clipped-SGD (Alg. 3) for $N _ { t }$ iterations with batchsize $m _ { t }$ , stepsize $\gamma _ { t }$ , clipping parameter $B _ { t }$ , and starting point $\hat { x } ^ { t - 1 }$ . Define the output of clipped-SGD by $\hat { x } ^ { t }$ .
|
| 344 |
+
4: end for
|
| 345 |
+
|
| 346 |
+
Output: ${ \hat { x } } ^ { \tau }$
|
| 347 |
+
|
| 348 |
+
version of the result. The complete formulation and the full proof of the theorem are deferred to Appendix C.2 (see Thm. C.2).
|
| 349 |
+
|
| 350 |
+
Theorem 3.2. Assume that function $f$ is $\mu$ -strongly convex and its gradient satisfy (3) with $\nu \in [ 0 , 1 ]$ $M _ { \nu } > 0$ on $Q = B _ { 2 R _ { 0 } } = \{ x \in \mathbb { R } ^ { n } \mid \| x - x ^ { * } \| _ { 2 } \leq 2 R _ { 0 } \}$ , where $R _ { 0 } \geq \| x ^ { 0 } - x ^ { * } \| _ { 2 }$ . Then there exist such a choice of parameters that R-clipped-SGD achieves $f ( { \bar { x } } ^ { N } ) - f ( x ^ { * } ) \leq \varepsilon$ with probability at least $1 - \beta$ after
|
| 351 |
+
|
| 352 |
+
$$
|
| 353 |
+
\mathcal { O } \left( \operatorname* { m a x } \left\{ D _ { 1 } ^ { \frac { 2 } { 1 + \nu } } \ln \frac { \mu R _ { 0 } ^ { 2 } } { \varepsilon } , D _ { 2 } ^ { \frac { 2 } { 1 + \nu } } , \operatorname* { m a x } \left\{ D _ { 1 } \ln \frac { \mu R _ { 0 } ^ { 2 } } { \varepsilon } , D _ { 2 } \right\} \ln \frac { D } { \beta } \right\} \right)
|
| 354 |
+
$$
|
| 355 |
+
|
| 356 |
+
233 iterations of Alg. 3 in total and requires
|
| 357 |
+
|
| 358 |
+
234
|
| 359 |
+
|
| 360 |
+
$$
|
| 361 |
+
\begin{array} { r } { \mathcal { O } \left( \operatorname* { m a x } \left\{ D _ { 1 } ^ { \frac { 2 } { 1 + \nu } } \ln \frac { \mu R _ { 0 } ^ { 2 } } { \varepsilon } , D _ { 2 } ^ { \frac { 2 } { 1 + \nu } } , \operatorname* { m a x } \left\{ D _ { 1 } \ln \frac { \mu R _ { 0 } ^ { 2 } } { \varepsilon } , D _ { 2 } , \frac { \sigma ^ { 2 } } { \mu \varepsilon } \right\} \ln \frac { D } { \beta } \right\} \right) \ o r a c l e c a l l s , w } \\ { D _ { 1 } = \frac { M _ { \nu } } { \mu R _ { 0 } ^ { 1 - \nu } } , D _ { 2 } = \frac { M _ { \nu } } { \mu ^ { \frac { 1 + \nu } { 2 } } \varepsilon ^ { \frac { 1 - \nu } { 2 } } } , D = ( D _ { 1 } ^ { \frac { 2 } { 1 + \nu } } + D _ { 1 } ) \ln \frac { \mu R _ { 0 } ^ { 2 } } { \varepsilon } + D _ { 2 } + D _ { 2 } ^ { \frac { 2 } { 1 + \nu } } . } \end{array}
|
| 362 |
+
$$
|
| 363 |
+
|
| 364 |
+
235 As in the convex case, for $\nu < 1$ the log factors appearing in the complexity bound for R-clipped
|
| 365 |
+
236 SSTM are worse than the corresponding factor in the bound for R-clipped-SGD. Thus, R-clipped
|
| 366 |
+
237 SGD has the best known high-probability complexity results for strongly convex $f$ and $\nu = 0$ .
|
| 367 |
+
|
| 368 |
+
# 4 Numerical experiments
|
| 369 |
+
|
| 370 |
+
39 We tested the performance of the methods on the following problems:
|
| 371 |
+
|
| 372 |
+
• BERT fine-tuning on CoLA dataset [38]. We use pretrained BERT from Transformers library [39] (bert-base-uncased) and freeze all layers except the last two linear ones. • ResNet-18 training on ImageNet-100 (first 100 classes of ImageNet [33]).
|
| 373 |
+
|
| 374 |
+
243 First, we study the noise distribution for both problem as follows: at the starting point we sample
|
| 375 |
+
244 large enough number of batched stochastic gradients $\nabla f ( x ^ { 0 } , \pmb { \xi } _ { 1 } ) , \dots , \nabla f ( x ^ { 0 } , \pmb { \xi } _ { K } )$ with batchsize
|
| 376 |
+
245 32 and plot the histograms for $\| \nabla f ( x ^ { 0 } , \pmb { \xi } _ { 1 } ) - \nabla f ( x ^ { 0 } ) \| _ { 2 } , \ldots , \| \nabla \tilde { f } ( x ^ { 0 } , \pmb { \xi } _ { K } ) - \nabla \tilde { f } ( x ^ { 0 } ) \|$ k2, see Fig. 1.
|
| 377 |
+
246 As one can see, the noise distribution for BERT $^ +$ CoLA is substantially non-sub-Gaussian, whereas
|
| 378 |
+
247 the distribution for ResNet- ${ 1 8 + }$ Imagenet-100 is almost Gaussian.
|
| 379 |
+
248 Next, we compared 4 different optimizers on these problems: Adam, SGD (with Momentum),
|
| 380 |
+
249 clipped-SGD (with Momentum and coordinate-wise clipping) and clipped-SSTM (with norm
|
| 381 |
+
250 clipping and $\nu = 1$ ). The results are presented in Fig. 2. We observed that the noise distributions do
|
| 382 |
+
251 not change significantly along the trajectories of the considered methods, see Appendix D. During
|
| 383 |
+
252 the hyper-parameters search we compared different batchsizes, emulated via gradient accumulation
|
| 384 |
+
253 (thus we compare methods with different batchsizes by the number of base batches used). The base
|
| 385 |
+
254 batchsize was 32 for both problems, stepsizes and clipping levels were tuned. One can find additional
|
| 386 |
+
255 details regarding our experiments in Appendix D.
|
| 387 |
+
256 Image classification. On ResNet- $^ { 1 8 + }$ ImageNet-100 task, SGD performs relatively well, and
|
| 388 |
+
257 even ties with Adam (with batchsize of $4 \times 3 2$ ) in validation loss. clipped-SSTM (with batchsize of
|
| 389 |
+
258 $2 \times 3 2 )$ ) also ties with Adam and clipped-SGD is not far from them. The results were averaged from
|
| 390 |
+
259 5 different launches (with different starting points/weight initializations). Since the noise distribution
|
| 391 |
+
260 is almost Gaussian even vanilla SGD performs well, i.e., gradient clipping is not required. At the
|
| 392 |
+
261 same time, the clipping does not slow down the convergence significantly.
|
| 393 |
+
62 Text classification. On BERT $^ +$ CoLA task, when the noise distribution is heavy-tailed, the methods
|
| 394 |
+
63 with clipping outperform SGD by a large margin. This result is in good correspondence with the
|
| 395 |
+
64 derived high-probability complexity bounds for clipped-SGD, clipped-SSTM and the best-known
|
| 396 |
+
65 ones for SGD. Moreover, clipped-SSTM (with batchsize of $8 \times 3 2$ ) achieves the same loss on
|
| 397 |
+
66 validation as Adam, and has better accuracy. These results were averaged from 5 different train-val
|
| 398 |
+
67 splits and 20 launches (with different starting points/weight initializations) for each of the splits, 100
|
| 399 |
+
68 launches in total.
|
| 400 |
+
|
| 401 |
+

|
| 402 |
+
Figure 1: Noise distribution of the stochastic gradients for ResNet-18 on ImageNet-100 and BERT fine-tuning on the CoLA dataset before the training. Red lines: probability density functions with means and variances empirically estimated by the samples. Batch count is the total number of samples used to build a histogram.
|
| 403 |
+
|
| 404 |
+

|
| 405 |
+
Figure 2: Train and validation loss $^ +$ accuracy for different optimizers on both problems. Here, “batch count” denotes the total number of used stochastic gradients.
|
| 406 |
+
|
| 407 |
+
69 References [1] George Bennett. Probability inequalities for the sum of independent random variables. Journal of the American Statistical Association, 57(297):33–45, 1962. [2] Caroline Chaux, Patrick L Combettes, Jean-Christophe Pesquet, and Valérie R Wajs. A variational formulation for frame-based inverse problems. Inverse Problems, 23(4):1495–1518, jun 2007. [3] Damek Davis, Dmitriy Drusvyatskiy, Lin Xiao, and Junyu Zhang. From low probability to high confidence in stochastic convex optimization. Journal of Machine Learning Research, 22(49):1–38, 2021. [4] Olivier Devolder. Exactness, inexactness and stochasticity in first-order methods for large-scale convex optimization. PhD thesis, PhD thesis, 2013. [5] Olivier Devolder, François Glineur, and Yurii Nesterov. First-order methods of smooth convex optimization with inexact oracle. Mathematical Programming, 146(1):37–75, 2014. [6] Pavel Dvurechensky and Alexander Gasnikov. Stochastic intermediate gradient method for convex problems with stochastic inexact oracle. Journal of Optimization Theory and Applications, 171(1):121–145, 2016. [7] Kacha Dzhaparidze and JH Van Zanten. On bernstein-type inequalities for martingales. Stochastic processes and their applications, 93(1):109–117, 2001. [8] David A Freedman et al. On tail probabilities for martingales. the Annals of Probability, 3(1):100–118, 1975. [9] Alexander Vladimirovich Gasnikov, Yu E Nesterov, and Vladimir Grigor’evich Spokoiny. On the efficiency of a randomized mirror descent algorithm in online optimization problems. Computational Mathematics and Mathematical Physics, 55(4):580–596, 2015. [10] Jonas Gehring, Michael Auli, David Grangier, Denis Yarats, and Yann N Dauphin. Convolutional sequence to sequence learning. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pages 1243–1252. JMLR. org, 2017. [11] Saeed Ghadimi and Guanghui Lan. Optimal stochastic approximation algorithms for strongly convex stochastic composite optimization i: A generic algorithmic framework. SIAM Journal on Optimization, 22(4):1469–1492, 2012. [12] Saeed Ghadimi and Guanghui Lan. Stochastic first-and zeroth-order methods for nonconvex stochastic programming. SIAM Journal on Optimization, 23(4):2341–2368, 2013. [13] Ian Goodfellow, Yoshua Bengio, and Aaron Courville. Deep Learning. MIT Press, 2016. http://www.deeplearningbook.org. [14] Eduard Gorbunov, Marina Danilova, and Alexander Gasnikov. Stochastic optimization with heavy-tailed noise via accelerated gradient clipping. In H. Larochelle, M. Ranzato, R. Hadsell, M. F. Balcan, and H. Lin, editors, Advances in Neural Information Processing Systems, volume 33, pages 15042–15053. Curran Associates, Inc., 2020. [15] Robert Mansel Gower, Nicolas Loizou, Xun Qian, Alibek Sailanbayev, Egor Shulgin, and Peter Richtárik. Sgd: General analysis and improved rates. In International Conference on Machine Learning, pages 5200–5209, 2019. [16] Vincent Guigues, Anatoli Juditsky, and Arkadi Nemirovski. Non-asymptotic confidence bounds for the optimal value of a stochastic program. Optimization Methods and Software, 32(5):1033– 1058, 2017. [17] Cristóbal Guzmán and Arkadi Nemirovski. On lower complexity bounds for large-scale smooth convex optimization. Journal of Complexity, 31(1):1–14, 2015. [18] Elad Hazan, Kfir Levy, and Shai Shalev-Shwartz. Beyond convexity: Stochastic quasi-convex optimization. In Advances in Neural Information Processing Systems, pages 1594–1602, 2015.
|
| 408 |
+
|
| 409 |
+
[19] Anatoli Juditsky, Arkadi Nemirovski, et al. First order methods for nonsmooth convex largescale optimization, i: general purpose methods. Optimization for Machine Learning, pages 121–148, 2011. 319 [20] Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014. [21] Guanghui Lan. An optimal method for stochastic composite optimization. Mathematical Programming, 133(1-2):365–397, 2012. [22] Vien V Mai and Mikael Johansson. Stability and convergence of stochastic gradient clipping: Beyond lipschitz continuity and smoothness. arXiv preprint arXiv:2102.06489, 2021. [23] Aditya Krishna Menon, Ankit Singh Rawat, Sashank J Reddi, and Sanjiv Kumar. Can gradient clipping mitigate label noise? In International Conference on Learning Representations, 2020. [24] Eric Moulines and Francis R Bach. Non-asymptotic analysis of stochastic approximation algorithms for machine learning. In Advances in Neural Information Processing Systems, pages 451–459, 2011. [25] Aleksandr Viktorovich Nazin, AS Nemirovsky, Aleksandr Borisovich Tsybakov, and AB Juditsky. Algorithms of robust stochastic optimization based on mirror descent method. Automation and Remote Control, 80(9):1607–1627, 2019. [26] Arkadi Nemirovski, Anatoli Juditsky, Guanghui Lan, and Alexander Shapiro. Robust stochastic approximation approach to stochastic programming. SIAM Journal on optimization, 19(4):1574– 1609, 2009. [27] Arkadi Semenovich Nemirovsky and David Borisovich Yudin. Problem complexity and method efficiency in optimization. 1983. [28] Yu Nesterov. Universal gradient methods for convex optimization problems. Mathematical Programming, 152(1-2):381–404, 2015. [29] Yurii E Nesterov. A method for solving the convex programming problem with convergence rate o $( 1 / \mathrm { k } ^ { \cdot } 2 )$ . In Dokl. akad. nauk Sssr, volume 269, pages 543–547, 1983. [30] Razvan Pascanu, Tomas Mikolov, and Yoshua Bengio. On the difficulty of training recurrent neural networks. In International conference on machine learning, pages 1310–1318, 2013. [31] 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, highperformance deep learning library. In H. Wallach, H. Larochelle, A. Beygelzimer, F. d'Alché- Buc, E. Fox, and R. Garnett, editors, Advances in Neural Information Processing Systems 32, pages 8024–8035. Curran Associates, Inc., 2019. [32] Herbert Robbins and Sutton Monro. A stochastic approximation method. The annals of mathematical statistics, pages 400–407, 1951. [33] Olga Russakovsky, Jia Deng, Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma, Zhiheng Huang, Andrej Karpathy, Aditya Khosla, Michael Bernstein, Alexander C. Berg, and Li Fei-Fei. ImageNet Large Scale Visual Recognition Challenge. International Journal of Computer Vision (IJCV), 115(3):211–252, 2015. [34] Umut ¸Sim¸sekli, Mert Gürbüzbalaban, Thanh Huy Nguyen, Gaël Richard, and Levent Sagun. On the heavy-tailed theory of stochastic gradient descent for deep neural networks. arXiv preprint arXiv:1912.00018, 2019. [35] Umut Simsekli, Levent Sagun, and Mert Gurbuzbalaban. A tail-index analysis of stochastic gradient noise in deep neural networks. arXiv preprint arXiv:1901.06053, 2019. [36] Vladimir Spokoiny et al. Parametric estimation. finite sample theory. The Annals of Statistics, 40(6):2877–2909, 2012.
|
| 410 |
+
|
| 411 |
+
[37] 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.
|
| 412 |
+
[38] Alex Warstadt, Amanpreet Singh, and Samuel R Bowman. Neural network acceptability judgments. arXiv preprint arXiv:1805.12471, 2018.
|
| 413 |
+
[39] Thomas Wolf, Lysandre Debut, Victor Sanh, Julien Chaumond, Clement Delangue, Anthony Moi, Pierric Cistac, Tim Rault, Rémi Louf, Morgan Funtowicz, Joe Davison, Sam Shleifer, Patrick von Platen, Clara Ma, Yacine Jernite, Julien Plu, Canwen Xu, Teven Le Scao, Sylvain Gugger, Mariama Drame, Quentin Lhoest, and Alexander M. Rush. Transformers: State-of-theart natural language processing. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing: System Demonstrations, pages 38–45, Online, October 2020. Association for Computational Linguistics.
|
| 414 |
+
[40] Jingzhao Zhang, Tianxing He, Suvrit Sra, and Ali Jadbabaie. Why gradient clipping accelerates training: A theoretical justification for adaptivity. In International Conference on Learning Representations, 2020.
|
| 415 |
+
[41] Jingzhao Zhang, Sai Praneeth Karimireddy, Andreas Veit, Seungyeon Kim, Sashank Reddi, Sanjiv Kumar, and Suvrit Sra. Why are adaptive methods good for attention models? In H. Larochelle, M. Ranzato, R. Hadsell, M. F. Balcan, and H. Lin, editors, Advances in Neural Information Processing Systems, volume 33, pages 15383–15393. Curran Associates, Inc., 2020.
|
| 416 |
+
|
| 417 |
+
# 384 Checklist
|
| 418 |
+
|
| 419 |
+
1. For all authors...
|
| 420 |
+
|
| 421 |
+
(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes]
|
| 422 |
+
(b) Did you describe the limitations of your work? [Yes] Section 1.1 describes all assumptions that we use
|
| 423 |
+
(c) Did you discuss any potential negative societal impacts of your work? [No] Our results are primarily theoretical, therefore, such a discussion is not applicable.
|
| 424 |
+
(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
|
| 425 |
+
|
| 426 |
+
2. If you are including theoretical results...
|
| 427 |
+
|
| 428 |
+
(a) Did you state the full set of assumptions of all theoretical results? [Yes] Section 1.1 describes all assumptions that we use.
|
| 429 |
+
(b) Did you include complete proofs of all theoretical results? [Yes] Appendix B and C include the complete proofs of all the results we derive.
|
| 430 |
+
|
| 431 |
+
3. If you ran experiments...
|
| 432 |
+
|
| 433 |
+
(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 our code in the supplementary material.
|
| 434 |
+
(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] See Appendix D.
|
| 435 |
+
(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [No] Instead of it, we show the averaged trajectories of the methods’ convergence.
|
| 436 |
+
(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 Appendix D.
|
| 437 |
+
|
| 438 |
+
4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
|
| 439 |
+
|
| 440 |
+
(a) If your work uses existing assets, did you cite the creators? [Yes] (b) Did you mention the license of the assets? [No] We use only publicly available resources.
|
| 441 |
+
|
| 442 |
+
(c) Did you include any new assets either in the supplemental material or as a URL? [No]
|
| 443 |
+
(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [No] We use only publicly available resources.
|
| 444 |
+
(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A]
|
| 445 |
+
|
| 446 |
+
5. If you used crowdsourcing or conducted research with human subjects...
|
| 447 |
+
|
| 448 |
+
(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
|
| 449 |
+
(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A]
|
| 450 |
+
(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]
|
md/train/d20KTY2VrNk/d20KTY2VrNk.md
ADDED
|
@@ -0,0 +1,250 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Instance-Dependent Label-Noise Learning under Structural Causal Models
|
| 2 |
+
|
| 3 |
+
Yu Yao1 Tongliang Liu1† Mingming Gong2 Bo Han3 Gang Niu4 Kun Zhang5
|
| 4 |
+
|
| 5 |
+
1TML Lab, University of Sydney; 2University of Melbourne; 3Hong Kong Baptist University; 4RIKEN AIP; 5Carnegie Mellon University
|
| 6 |
+
|
| 7 |
+
# Abstract
|
| 8 |
+
|
| 9 |
+
Label noise generally degenerates the performance of deep learning algorithms because deep neural networks easily overfit label errors. Let $X$ and $Y$ denote the instance and clean label, respectively. When $Y$ is a cause of $X$ , according to which many datasets have been constructed, e.g., SVHN and CIFAR, the distributions of $P ( X )$ and $P ( { Y \vert } X )$ are generally entangled. This means that the unsupervised instances are helpful to learn the classifier and thus reduce the side effect of label noise. However, it remains elusive on how to exploit the causal information to handle the label-noise problem. We propose to model and make use of the causal process in order to correct the label-noise effect. Empirically, the proposed method outperforms all state-of-the-art methods on both synthetic and real-world labelnoise datasets.
|
| 10 |
+
|
| 11 |
+
# 1 Introduction
|
| 12 |
+
|
| 13 |
+
Learning with noisy labels can be dated back to [1] and has recently drawn a lot of attention [15, 19, 11, 10, 28]. In real life, large-scale datasets are likely to contain label noise. It is partly because that many cheap but imperfect data collection methods such as crowd-sourcing and web crawling are widely used to build large-scale datasets. Training with such data usually lead to poor generalization abilities of deep neural networks because they can memorize noisy labels [2, 33].
|
| 14 |
+
|
| 15 |
+
To improve the generalization ability of training with noisy labels, one family of existing label-noise learning methods is to model how the label noise was generated [17, 19, 27, 34, 14]. Specifically, these methods try to reveal the transition relationship from clean labels to noisy labels of instances, i.e., the distribution $P ( \tilde { Y } | Y , X )$ , where $\tilde { Y }$ , $Y$ and $X$ are the random variables for the noisy label, latent clean label, and instance, respectively. The advantage of modelling label noise is that given only the noisy data, when the transition relationship is identifiable, classifiers can be learned to converge to the optimal ones defined by the clean data, with theoretical guarantees. However, the transition relationship is not identifiable in general. To make it identifiable, various assumptions have been made on the transition relationship. For example, Natarajan et al. [17] assume that the transition relationship is instance independent, i.e., $P ( \tilde { Y } | Y , X ) = \bar { P } ( \tilde { Y } | Y )$ ; Xia et al. [30] assume that the $P ( { \tilde { Y } } | Y , X )$ is dependent on different parts of an instance. Cheng et al. [7] assume that the label noise rates are upper bounded. In practice, these assumptions may not be satisfied and are generally hard to be verified given noisy data alone.
|
| 16 |
+
|
| 17 |
+
Inspired by causal learning [20, 25, 21, 23], we provide a causal perspective of label-noise learning method named CausalNL. We exploit the causal information to help identifiability of the transition matrix $P ( { \tilde { Y } } | Y , X )$ other than making assumptions directly on the transition relationship.
|
| 18 |
+
|
| 19 |
+
Specifically, we assume that the data containing instancedependent label noise is generated according to the causal graph in Fig. 1. For example, for the Street View House Numbers (SVHN) dataset [18], $X$ represents the image containing the digit; $Y$ represents the clean label of the digit shown on the plate; $Z$ represents the latent variable that captures the information affecting the generation of the images, e.g., orientation, lighting, and font style. Here $Y$ is naturally a cause of $X$ and the causal generative process can be described in the following way. First, the house plate is generated according to the street number and attached to the front door. Then, the house plate is captured by a camera (installed in a Google street view car) to form $X$ , taking into account of other factors such as illumination and viewpoint. Finally, the images containing house numbers are collected and relabeled to form the dataset. Let us denote the annotated label by the noisy label $\tilde { Y }$ as the annotator may not be always reliable, especially when the dataset is very large but the budget is limited. During the annotation process, the noisy labels were generated according to both the images and the range of predefined digit numbers. Hence, both $X$ and $Y$ are causes of $\tilde { Y }$ . Note that most existing image datasets are collected with the causal relationship that $Y$ causes $X$ . For example, see the widely used FashionMNIST and CIFAR. When we synthesize instance-dependent label noise based on them, we will have the causal graph illustrated in Fig. 1. Note also that some datasets are generated with the causal relationship that $X$ causes $Y$ . Other than using domain knowledge, the different causal relationships can be verified by employing causal discovery [26, 25, 21, 37].
|
| 20 |
+
|
| 21 |
+

|
| 22 |
+
Figure 1: A graphical causal model which reveals a generative process of the data which contains instancedependent label noise, where the shaded variables are observable and the unshaded variables are latent.
|
| 23 |
+
|
| 24 |
+
When the latent clean label $Y$ is a cause of $X$ , $P ( X )$ will generally contain some information about $P ( { Y \vert } X )$ . This is because, under such a generative process, the distributions of $P ( X )$ and $P ( { Y \vert } X )$ are entangled [22, 39]. To help estimate $P ( { Y \vert } X )$ with $P ( X )$ , we make use of the causal generative process to estimate $P ( X | Y )$ , which directly benefits from $P ( X )$ by generative modeling. The modeling of $P ( X | Y )$ in turn encourages the identifiability of the transition relationship and helps learn $P ( { Y \vert } X )$ . For example, in Fig. 2(a), we have added instance-dependent label-noise with a rate $45 \%$ (i.e., $\mathrm { I D L N } { - } 4 5 \% )$ to the MOON dataset and employed different methods [10, 36] to solve the label-noise learning problem. As illustrated in Fig. 2(b) and Fig. 2(c), previous methods fail to infer clean labels. In contrast, by constraining the conditional distribution of the instances, i.e., restricting the data of each class to be on a manifold by setting the dimension of the latent variable $Z$ to be 1-dimensional, the label transition as well as the clean labels can be successfully recovered (by the proposed method), which is showed in Fig. 2(d). It is worth noting that the idea of finding $P ( { Y \vert } X )$ by modeling $P ( Y )$ and $P ( X | Y )$ instead has been exploited in the context of domain adaptation; for instance, it inspires target shift, (generalized) conditional shift and other settings for domain adaptation [38, 9]
|
| 25 |
+
|
| 26 |
+
Specifically, to make use of the causal graph to contribute to the identifiability of the transition matrix, we propose a causally inspired deep generative method, which models the causal structure with all the observable and latent variables, i.e., the instance $X$ , the noisy label $\tilde { Y }$ , the latent feature $Z$ , and the latent clean label $Y$ . The proposed generative model captures the variables’ relationship indicated by the causal graph. Furthermore, built on the variational autoencoder (VAE) framework [12], we build an inference network which could efficiently infer the latent variables $Z$ and $Y$ when maximising the marginal likelihood $p ( X , { \tilde { Y } } )$ on the given noisy data. In the decoder phase, the data will be reconstructed by exploiting the conditional distribution of instances $P ( X | Y , Z )$ and the transition relationship $P ( { \tilde { Y } } | Y , X )$ , i.e.,
|
| 27 |
+
|
| 28 |
+
$$
|
| 29 |
+
p _ { \theta } ( X , \tilde { Y } ) = \int _ { z , y } P ( Z = z ) P ( Y = y ) p _ { \theta _ { 1 } } ( X | Y = y , Z = z ) p _ { \theta _ { 2 } } ( \tilde { Y } | Y = y , X ) \mathrm { d } z \mathrm { d } y
|
| 30 |
+
$$
|
| 31 |
+
|
| 32 |
+
will be exploited, where $\theta : = \left( \theta _ { 1 } , \theta _ { 2 } \right)$ are the parameters of the causal generative model (more details can be found in Section 3). Ay a high level, according to the equation, given the noisy data and the distributions of $Z$ and $Y$ , constraining $p _ { \theta _ { 1 } } ( X | Y , Z )$ will also greatly reduce the uncertainty of $p _ { \theta _ { 2 } } ( { \tilde { Y } } | Y , X )$ and thus contribute to the identifiability of the transition matrix. Note that adding a constraint on $p _ { \theta _ { 1 } } ( X | Y , Z )$ is natural; for example, images often have a low-dimensional manifold [3]. We can restrict $P ( Z )$ to fulfill the constraint on $p _ { \theta _ { 1 } } ( X | Y , Z )$ . By exploiting the causal structure and the constraint on instances to better model label noise, the proposed method significantly outperforms the baselines. When the label noise rate is large, the superiority is evidenced by a large gain in the classification performance.
|
| 33 |
+
|
| 34 |
+

|
| 35 |
+
Figure 2: (a) An illustration of the MOON training dataset which contains $4 5 \%$ of instance-dependent label noise. Different instances have different noise rates which are randomly generated according to Xia et al. [30]. (b)-(d) The illustration of the classification performance of co-teaching, mixup, and our method, respectively.
|
| 36 |
+
|
| 37 |
+
The rest of the paper is organized as follows. In Section 2, we briefly review the background knowledge of label-noise learning and causality. In Section 3, we formulate our method, named CausalNL, and discuss how it helps to learn a clean classifier, followed by the implementation details. Experimental validations are provided in Section 4. Section 5 concludes the paper.
|
| 38 |
+
|
| 39 |
+
# 2 Noisy Labels and Causality
|
| 40 |
+
|
| 41 |
+
In this section, firstly, we introduce how to model label noise. Then, we introduce the structural causal model and discuss how to exploit the model to encourage the identifiability of the transition relationship and help learn the classifier.
|
| 42 |
+
|
| 43 |
+
Transition Relationship To build a statistically consistent classifier that converges to the optimal classifier defined on clean data by only employing noisy data, the transition relationship $P ( \tilde { Y } | Y , X )$ has to be identified. Given an instance, the conditional distribution can be written in an $C \times C$ matrix which is called the transition matrix [19, 29, 30], where $C$ represents the number of classes. Specifically, for each instance $x$ , there is a transition matrix $T ( x )$ . The $i j$ -th entry of the transition matrix is $T _ { i j } ( x ) = P ( \tilde { Y } = i | Y = j , X = x )$ , which represents the probability that the instance $x$ with the clean label $Y = j$ will have a noisy label $\tilde { Y } = i$ .
|
| 44 |
+
|
| 45 |
+
The transition matrix has been widely studied to build statistically consistent classifiers, because the clean class posterior distribution $P ( \pmb { Y } | \pmb { x } ) = [ P ( \pmb { Y } = 1 | \pmb { X } = \pmb { x } ) , \dots , P ( \pmb { Y } = C | \pmb { X } = \pmb { x } ) ] ^ { \top }$ can be inferred by using the transition matrix and the noisy class posterior $P ( \tilde { Y } | x ) = [ P ( \tilde { Y } =$ $1 | X = x ) , \ldots , P ( \tilde { Y } = C | X = x ) ] ^ { \top }$ , i.e., we have $P ( \tilde { \mathbf { Y } } | x ) = T ( x ) P ( \mathbf { Y } | x )$ . Specifically, the transition matrix has been used to modify loss functions to build risk-consistent estimators; see, e.g., [8, 19, 35, 28], and has been used to correct hypotheses to build classifier-consistent algorithms; see, e.g., [17, 24, 19]. Moreover, the state-of-the-art statically inconsistent algorithms [11, 10] also use diagonal entries of the transition matrix to help select reliable examples used for training.
|
| 46 |
+
|
| 47 |
+
However, the distribution $P ( { \tilde { Y } } | Y , X )$ is not generally identifiable [28]. To make it identifiable, one has to resort to additional assumptions. The most widely used assumption is that given clean label $Y$ , the noisy label $\tilde { Y }$ is conditionally independent of instance $X$ , i.e., $\mathbf { \bar { \xi } } P ( \tilde { Y } | Y , X ) = P ( \tilde { Y } | Y )$ . Under such an assumption, the transition relationship $P ( \tilde { Y } | Y )$ can be successfully identified with the anchor point assumption [15, 34, 14]. However, in the real-world scenarios, this assumption may be hard to satisfied. Although $P ( \tilde { Y } | Y )$ can be used to approximate $P ( { \tilde { Y } } | Y , X )$ , the approximation error can be large in many cases. As for the efforts to model the instance-dependent transition matrix directly, existing methods rely on rather strong assumptions, e.g., the bounded noise rate assumption [7], the part-dependent label noise assumption [30], and the requirement of additional information about the transition matrix [4]. Although the assumptions help the methods achieve superior performance empirically, they are generally difficult to verify or fulfill, limiting their applications in practice.
|
| 48 |
+
|
| 49 |
+
Structural Causal Model Motivated by the limitation of the current methods, we provide a new causal perspective to learn the identifiable of instance-dependent label noise model. Here we briefly introduce some background knowledge of causality [25] used in this paper. A structural causal model (SCM) consists of a set of variables connected by a set of functions. It represents a flow of information and reveals causal relationships among all the variables, providing a fine-grained description of the data generation process. The causal structure encoded by SCMs can be represented as a graphical casual model as shown in Fig. 1, where each node is a variable and each edge is a function involving noise. The SCM corresponding to the graph in Fig. 1 can be written as
|
| 50 |
+
|
| 51 |
+

|
| 52 |
+
Figure 3: A working flow of our method.
|
| 53 |
+
|
| 54 |
+
$$
|
| 55 |
+
Z = \epsilon _ { Z } , Y = \epsilon _ { Y } , X = f ( Z , Y , \epsilon _ { X } ) , \tilde { Y } = f ( X , Y , \epsilon _ { \tilde { Y } } ) ,
|
| 56 |
+
$$
|
| 57 |
+
|
| 58 |
+
where $\epsilon _ { Z } , \epsilon _ { Y } ,$ $\epsilon _ { X }$ and $\epsilon _ { \tilde { Y } }$ are independent exogenous variables, and they sometimes also called error variables. For example, $\epsilon _ { X }$ are an error variable for $X$ , which is responsible for any difference between the actual value of $X$ and the value predicted on the basis of $Z$ and $Y$ alone. Each equation specifies a distribution of a variable conditioned on its parents (which are an empty set for root cause variables in the graph).
|
| 59 |
+
|
| 60 |
+
By making use of the SCM, the benefit of the instances to learning the classifier can be clearly explained. Specifically, the instance $X$ is a function of its label $Y$ and latent feature $Z$ , which means that the instance $X$ is generated from $Y$ and $Z$ . Therefore $X$ must contains information about its clean label $Y$ and latent feature $Z$ . That is the reason that $P ( X )$ can help identify $P ( { Y \vert } X )$ and also $P ( Z | X )$ . However, since we do not have clean labels, it is hard to fully identify $P ( { Y \vert } X )$ from $P ( X )$ in the unsupervised setting. For example, on the MOON dataset shown in Fig. 2 , we can possibly discover the two clusters by enforcing the manifold constraint, but it is impossible to see which class each cluster belongs to. We show in the following that we can make use of the property of $P ( X | Y )$ to help model label noise, i.e., encourage the identifiability of the transition relationship, thereby learning a better classifier.
|
| 61 |
+
|
| 62 |
+
Specifically, under the Markov condition [20], which intuitively means the independence of exogenous variables, the joint distribution $P ( \tilde { Y } , X , Y , Z )$ specified by the SCM can be factorized as follows.
|
| 63 |
+
|
| 64 |
+
$$
|
| 65 |
+
P ( X , \tilde { Y } , Y , Z ) = P ( Y ) P ( Z ) P ( X | Y , Z ) P ( \tilde { Y } | Y , X ) .
|
| 66 |
+
$$
|
| 67 |
+
|
| 68 |
+
This motivates us to extend VAE [12] to perform inference in our causal model to fit the noisy data in the next section. In the decoder phase, given the noisy data and the distributions of $Z$ and $Y$ , adding a constraint on $P ( X | Y , Z )$ will reduce the uncertainty in the distribution $P ( { \tilde { Y } } | Y , X )$ . In other words, modeling of $P ( X | Y , Z )$ will encourage the identifiability of the transition relationship and thus better model label noise. Since $P ( { \tilde { Y } } | Y , X )$ functions as a bridge to connect the noisy labels to clean labels, we accordingly can better learn $P ( { Y \vert } X )$ or the classifier by only using the noisy data.
|
| 69 |
+
|
| 70 |
+
There are normally two ways to add constraints on the instances, i.e., assuming a specific parametric generative model or introducing prior knowledge of the instances. In this paper, since we mainly study the image classification problem with noisy labels, we focus on the manifold property of images and apply the low-dimensional manifold constraint to the instances.
|
| 71 |
+
|
| 72 |
+
# 3 Causality Captured Instance-Dependent Label-Noise Learning
|
| 73 |
+
|
| 74 |
+
In this section, we propose a structural generative method which captures the causal relationship and utilizes $P ( X )$ to help identify the label-noise transition matrix, and therefore, our method leads to a better classifier that assigns more accurate labels.
|
| 75 |
+
|
| 76 |
+
# 3.1 Variational Inference under the Structural Causal Model
|
| 77 |
+
|
| 78 |
+
To model the generation process of noisy data and to approximate the distribution of the noisy data, our method is designed to follow the causal factorization (see Eq. 2). Specifically, our model contains two decoder networks which jointly model a distribution $p _ { \theta } ( X , { \tilde { Y } } | Y , Z )$ and two encoder (inference) networks which jointly model the posterior distribution $q _ { \phi } ( Z , Y | X )$ . Here we discuss each component of our model in detail.
|
| 79 |
+
|
| 80 |
+
Let the two decoder networks model the distributions $p _ { \theta _ { 1 } } ( X | Y , Z )$ and $p _ { \theta _ { 2 } } ( { \tilde { Y } } | Y , X )$ , respectively. Let $\theta _ { 1 }$ and $\theta _ { 2 }$ be learnable parameters of the distributions. Without loss of generality, we set $p ( Z )$ to a standard normal distribution and $p ( Y )$ to a uniform distribution. Then, modeling the joint distribution in Eq. 2 boils down to modeling the distribution $p _ { \theta } ( X , { \tilde { Y } } | Y , Z )$ , which is decomposed as follows:
|
| 81 |
+
|
| 82 |
+
$$
|
| 83 |
+
\begin{array} { r } { p _ { \theta } ( X , \tilde { Y } | Y , Z ) = p _ { \theta _ { 1 } } ( X | Y , Z ) p _ { \theta _ { 2 } } ( \tilde { Y } | Y , X ) . } \end{array}
|
| 84 |
+
$$
|
| 85 |
+
|
| 86 |
+
To infer latent variables $Z$ and $Y$ with only observable variables $X$ and $\tilde { Y }$ , we design an inference network which model the variational distribution $q _ { \phi } ( Z , Y | \tilde { Y } , X )$ . Specifically, let $q _ { \phi _ { 2 } } ( Z | Y , X )$ and $q _ { \phi _ { 1 } } ( Y | \tilde { Y } , X )$ be the distributions parameterized by learnable parameters $\phi _ { 1 }$ and $\phi _ { 2 }$ , and then the posterior distribution can be decomposed as follows:
|
| 87 |
+
|
| 88 |
+
$$
|
| 89 |
+
q _ { \phi } ( Z , Y | \tilde { Y } , X ) = q _ { \phi _ { 2 } } ( Z | Y , X ) q _ { \phi _ { 1 } } ( Y | \tilde { Y } , X ) ,
|
| 90 |
+
$$
|
| 91 |
+
|
| 92 |
+
where we do not include $\tilde { Y }$ as a conditioning variable in $q _ { \phi _ { 2 } } ( Z | Y , X )$ because the causal graph implies $Z \perp \tilde { Y } | X , Y$ . One problem with this posterior form is that we cannot directly employ $q _ { \phi _ { 1 } } ( Y | \tilde { Y } , X )$ to predict labels on the test data, on which $\tilde { Y }$ is absent.
|
| 93 |
+
|
| 94 |
+
To reduce computational costs and to allow our method efficiently infer clean labels, we approximate $q _ { \phi _ { 1 } } ( Y | \tilde { Y } , X )$ by assuming that given the instance $X$ , the clean label $Y$ is conditionally independent from the noisy label $\tilde { Y }$ , i.e., $q _ { \phi _ { 1 } } ( Y | \tilde { Y } , X ) = q _ { \phi _ { 1 } } ( Y | X )$ . This approximation is expected not to have very large approximation error because the images contain sufficient information to predict the clean labels. Thus, we could simplify Eq. 4 as follows
|
| 95 |
+
|
| 96 |
+
$$
|
| 97 |
+
q _ { \phi } ( Z , Y | X ) = q _ { \phi _ { 2 } } ( Z | Y , X ) q _ { \phi _ { 1 } } ( Y | X ) ,
|
| 98 |
+
$$
|
| 99 |
+
|
| 100 |
+
such that our encoder networks model $q _ { \phi _ { 2 } } ( Z | Y , X )$ and $q _ { \phi _ { 1 } } ( Y | X )$ , respectively. This way, $q _ { \phi _ { 1 } } ( Y | X )$ can be used to infer clean labels efficiently.2 We also found that the encoder network modelling $q _ { \phi _ { 1 } } ( Y | X )$ can directly act as a regularizer, which helps to identify $p _ { \theta _ { 2 } } ( { \tilde { Y } } | Y , X )$ . Moreover, be benefited from this, our method can serve as a general framework which can be easily integrated with the current discriminative label-noise methods [28, 16, 10], and we will showcase it by collaborating co-teaching [10] with our method.
|
| 101 |
+
|
| 102 |
+
Optimization of Parameters Because the marginal distribution $p _ { \theta } ( X , { \tilde { Y } } )$ is usually intractable, to learn the set of parameters $\{ \theta _ { 1 } , \theta _ { 2 } , \phi _ { 1 } , \phi _ { 2 } \}$ given only noisy data, we follow the variational inference framework [5] to maximize the negative evidence lower-bound $\operatorname { E L B O } ( x , \tilde { y } )$ of the marginal likelihood of each datapoint $( x , \tilde { y } )$ instead of maximizing the marginal likelihood itself. By ensembling our decoder and encoder networks, $\operatorname { E L B O } ( x , \tilde { y } )$ is derived as follows:
|
| 103 |
+
|
| 104 |
+
$$
|
| 105 |
+
\begin{array} { r l } & { \mathrm { E L B O } ( x , \tilde { y } ) = \mathbb { E } _ { ( z , y ) \sim q _ { \phi } ( Z , Y \mid x ) } \left[ \log p _ { \theta _ { 1 } } ( x \vert y , z ) \right] + \mathbb { E } _ { y \sim q _ { \phi _ { 1 } } ( Y \mid x ) } \left[ \log p _ { \theta _ { 2 } } ( \tilde { y } \vert y , x ) \right] } \\ & { \phantom { = \ } - k l ( q _ { \phi _ { 1 } } ( Y \vert x ) \| p ( Y ) ) - \mathbb { E } _ { y \sim q _ { \phi _ { 1 } } ( Y \mid x ) } \left[ k l ( q _ { \phi } ( Z \vert y , x ) \| p ( Z ) ) \right] , } \end{array}
|
| 106 |
+
$$
|
| 107 |
+
|
| 108 |
+
where $k l ( \cdot )$ is the Kullback–Leibler divergence between two distributions. The derivation details are left out in Appendix A. Our model learns the class-conditional distribution $P ( X | Y )$ by maximizing the first expectation in ELBO, which is equivalent to minimizing the reconstruction loss [12]. By learning $P ( X )$ , the inference network $q _ { \phi _ { 1 } } ( Y | X )$ has to select a suitable parameter $\phi ^ { * }$ which samples the $y$ and $z$ to minimize the reconstruction loss $\mathbb { E } _ { ( z , y ) \sim q _ { \phi } ( Z , Y | x ) } \left[ \log p _ { \theta _ { 1 } } ( x | y , z ) \right]$ . When the dimension of $Z$ is chosen to be much smaller than that of $X$ , to obtain a smaller reconstruction error, the decoder has to utilize the information provided by $Y$ , and force the value of $Y$ to be useful for
|
| 109 |
+
|
| 110 |
+
# Algorithm 1 CausalNL
|
| 111 |
+
|
| 112 |
+
Input: A noisy sample $S$ , Average noise rate $\rho$ , Total epoch $T _ { m a x }$ , Batch size $N$ .
|
| 113 |
+
1: For $\mathrm { T } = 1 , \dots , T _ { m a x }$ :
|
| 114 |
+
2: For mini-batch $\bar { S } = \{ x _ { i } \} _ { i = 0 } ^ { N } , \tilde { L } = \{ \tilde { y } _ { i } \} _ { i = 0 } ^ { N }$ in $S$ :
|
| 115 |
+
3: Feed $\bar { S }$ to encoders $\hat { q } _ { \phi _ { 1 } ^ { 1 } }$ and $\hat { q } _ { \phi _ { 1 } ^ { 2 } }$ to get clean label sets $L _ { 1 }$ and $L _ { 2 }$ , respectively;
|
| 116 |
+
4: Feed $( \bar { S } , L _ { 1 } )$ to encoder $\hat { q } _ { \phi _ { 2 } ^ { 1 } }$ to get a representation set $H _ { 1 }$ , feed $( \bar { S } , L _ { 2 } )$ to $\hat { q } _ { \phi _ { 2 } ^ { 2 } }$ to get $H _ { 2 }$ ;
|
| 117 |
+
5: Update $\hat { q } _ { \phi _ { 2 } ^ { 1 } }$ and $\hat { q } _ { \phi _ { 2 } ^ { 2 } }$ with co-teaching loss;
|
| 118 |
+
6: Feed $( L _ { 1 } , H _ { 1 } )$ to decoder $\hat { p } _ { \theta _ { 1 } ^ { 1 } }$ to get reconstructed dataset $\bar { S } _ { 1 }$ , feed $( L _ { 2 } , H _ { 2 } )$ to $\hat { p } _ { \theta _ { 1 } ^ { 2 } }$ to get $\bar { S } _ { 2 }$ ;
|
| 119 |
+
7: Feed $( { \bar { S } } _ { 1 } , L _ { 1 } )$ to decoder $\hat { p } _ { \theta _ { 2 } ^ { 1 } }$ to get predicted noisy labels ${ \tilde { L } } _ { 1 }$ , feed $( \bar { S } _ { 2 } , L _ { 2 } )$ to $\hat { p } _ { \theta _ { 2 } ^ { 2 } }$ to get ${ \tilde { L } } _ { 2 }$ ;
|
| 120 |
+
8: Update networks $\hat { q } _ { \phi _ { 1 } ^ { 1 } }$ , $\hat { q } _ { \phi _ { 2 } ^ { 1 } }$ , $\hat { p } _ { \theta _ { 1 } ^ { 1 } }$ and $\hat { p } _ { \theta _ { 2 } ^ { 1 } }$ by calculating ELBO on $( \bar { S } , \bar { S } _ { 1 } , \tilde { L } , \tilde { L } _ { 1 } )$ , update
|
| 121 |
+
networks $\hat { q } _ { \phi _ { 1 } ^ { 2 } }$ , $\hat { q } _ { \phi _ { 2 } ^ { 2 } }$ , $\hat { p } _ { \theta _ { 1 } ^ { 2 } }$ and $\hat { p } _ { \theta _ { 2 } ^ { 2 } }$ by calculating ELBO on $( \bar { S } , \bar { S } _ { 2 } , \tilde { L } , \tilde { L } _ { 2 } )$ ;
|
| 122 |
+
|
| 123 |
+
Output: The inference network $\hat { q } _ { \phi _ { 1 } ^ { 1 } }$
|
| 124 |
+
|
| 125 |
+
prediction. Furthermore, we constrain the $Y$ to be a one-hot vector, and then $Y$ could be a cluster ID of which the manifold of the $X$ belongs.
|
| 126 |
+
|
| 127 |
+
So far, the latent variable $Y$ can be inferred as a cluster ID instead of a clean class ID. To further link the clusters to clean labels, a naive approach is to select some reliable examples and keep the cluster numbers to be consistent with the noisy labels on these examples. In such a way, the latent representation $Z$ and clean label $Y$ can be effectively inferred, and therefore, it encourages the identifiability of the transition relationship $p _ { \theta _ { 2 } } ( { \tilde { Y } } | Y , { \tilde { X } } )$ . To achieve this, instead of explicitly selecting the reliable example in advance, our method is trained end-to-end, i.e., reliable examples are selected dynamically during the update of parameters of our model by using the co-teaching technique [10]. The advantage of this approach is that the selection bias of the reliable example [6] can be greatly reduced. Intuitively, the accurately selected reliable examples can encourage the identifiability of $p _ { \theta _ { 2 } } ( { \tilde { Y } } | Y , X )$ and $p _ { \theta _ { 1 } } ( X | Y , Z )$ , and the accurately estimated $p _ { \theta _ { 2 } } ( { \tilde { Y } } | Y , X )$ and $p _ { \theta _ { 1 } } ( X | Y , Z )$ will encourage the network to select more reliable examples.
|
| 128 |
+
|
| 129 |
+
# 3.2 Practical Implementation
|
| 130 |
+
|
| 131 |
+
Our method is summarized in Algorithm 1 and illustrated in Fig. 3. Here we introduce the structure of our model and loss functions.
|
| 132 |
+
|
| 133 |
+
Model Structure Because we incorporate co-teaching in our model training, we need to add a copy of the decoder and encoders in our method. As the two branches share the same architectures, we first present the details of the first branch and then briefly introduce the second branch.
|
| 134 |
+
|
| 135 |
+
For the first branch, we need a set of encoders and decoders to model the distributions in Eq. 3 and 5. Specifically, we have two encoder networks
|
| 136 |
+
|
| 137 |
+
$$
|
| 138 |
+
Y _ { 1 } = \hat { q } _ { \phi _ { 1 } ^ { 1 } } ( X ) , ~ Z _ { 1 } \sim \hat { q } _ { \phi _ { 2 } ^ { 1 } } ( X , Y _ { 1 } )
|
| 139 |
+
$$
|
| 140 |
+
|
| 141 |
+
for Eq. 5 and two decoder networks
|
| 142 |
+
|
| 143 |
+
$$
|
| 144 |
+
X _ { 1 } = \hat { p } _ { \theta _ { 1 } ^ { 1 } } ( Y _ { 1 } , Z _ { 1 } ) , \ \tilde { Y } _ { 1 } = \hat { p } _ { \theta _ { 2 } ^ { 1 } } ( X _ { 1 } , Y _ { 1 } )
|
| 145 |
+
$$
|
| 146 |
+
|
| 147 |
+
for Eq. 3. The first encoder ${ \hat { q } } _ { \phi _ { 1 } ^ { 1 } } ( X )$ takes an instance $X$ as input ${ \hat { q } } _ { \phi _ { 1 } ^ { 1 } } ( X )$ and output a predicted clean label $Y _ { 1 }$ . The second encoder ${ \hat { q } } _ { \phi _ { 2 } ^ { 1 } } ( X , Y _ { 1 } )$ takes both the instance $X$ and the generated label $Y _ { 1 }$ as input and outputs a latent feature $Z _ { 1 }$ . Then the generated $Y _ { 1 }$ and $Z _ { 1 }$ are passed through the decoder $\hat { p } _ { \theta _ { 1 } ^ { 1 } } ( Y _ { 1 } , Z _ { 1 } )$ which will generate a reconstructed image $X _ { 1 }$ . Finally, the generated $X _ { 1 }$ and $Y _ { 1 }$ are the input to another decoder $\hat { p } _ { \theta _ { 2 } ^ { 1 } } ( X _ { 1 } , Y _ { 1 } )$ which returns predicted noisy labels $\tilde { Y } _ { 1 }$ . It is worth mentioning that the reparameterization trick [12] is used for sampling, so as to allow backpropagation in $\hat { q } _ { \phi _ { 2 } ^ { 1 } } ( X , Y _ { 1 } )$ .
|
| 148 |
+
|
| 149 |
+
Similarly, the encoder and decoder networks in the second branch are defined as follows:
|
| 150 |
+
|
| 151 |
+
$$
|
| 152 |
+
Y _ { 2 } = \hat { q } _ { \phi _ { 1 } ^ { 2 } } ( X ) , Z _ { 2 } \sim \hat { q } _ { \phi _ { 2 } ^ { 2 } } ( X , Y _ { 2 } ) , X _ { 2 } = \hat { p } _ { \theta _ { 1 } ^ { 2 } } ( Y _ { 2 } , Z _ { 2 } ) , \tilde { Y } _ { 2 } = \hat { p } _ { \theta _ { 2 } ^ { 2 } } ( X _ { 2 } , Y _ { 2 } ) .
|
| 153 |
+
$$
|
| 154 |
+
|
| 155 |
+
During training, we let two encoders ${ \hat { q } } _ { \phi _ { 1 } ^ { 1 } } ( X )$ and $\hat { q } _ { \phi _ { 1 } ^ { 2 } } ( X )$ teach each other given every mini-batch.
|
| 156 |
+
|
| 157 |
+
Loss Functions We divide the loss functions into two parts. The first part is the negative ELBO in Eq. 6, and the second part is a co-teaching loss. The detailed formulation is leaved in Appendix B.
|
| 158 |
+
|
| 159 |
+
For the negative ELBO, the first term $- \mathbb { E } _ { ( z , y ) \sim q _ { \phi } ( Z , Y \mid x ) } \left[ \log p _ { \theta _ { 1 } } ( x \mid y , z ) \right]$ is a reconstruction loss, and we use the $\ell { 1 }$ loss for reconstruction. The second term is $- \mathbb { E } _ { y \sim q _ { \phi _ { 1 } } ( Y | x ) } \left[ \log p _ { \theta _ { 2 } } ( \tilde { y } | y , x ) \right]$ , which aims to learn noisy labels given inference $y$ and $x$ , and can be simply replaced by the cross-entropy loss on outputs of both decoders $\hat { p } _ { \theta _ { 2 } ^ { 1 } } ( X _ { 1 } , Y _ { 1 } )$ and $\hat { p } _ { \theta _ { 2 } ^ { 2 } } ( X _ { 2 } , Y _ { 2 } )$ with the noisy labels contained in the training data. The additional two terms are two regularizers. To calculate $k l ( q _ { \phi _ { 1 } } ( Y | x ) | | p ( Y ) )$ , we assume that the prior $P ( Y )$ is a uniform distribution. Then minimizing $k l ( q _ { \phi _ { 1 } } ( Y | x ) | | p ( Y ) )$ is equivalent to maximizing the entropy of $q _ { \phi _ { 1 } } ( Y | x )$ for each instance $x$ , i.e., $\begin{array} { r } { - \sum _ { y } q _ { \phi _ { 1 } } ( y | x ) \log q _ { \phi _ { 1 } } ( y | x ) } \end{array}$ . The benefit for having this term is that it could reduce the overfiting problem of the inference network. For $\mathbb { E } _ { y \sim q _ { \phi _ { 1 } } ( Y | x ) } \left[ k l ( q _ { \phi } ( Z | y , x ) | | p ( Z ) ) \right]$ , we let $p ( Z )$ be a standard multivariate Gaussian distribution. Empirically, $q _ { \phi } ( Z | y , x )$ is modeled by the encoders ${ \hat { q } } _ { \phi _ { 1 } ^ { 1 } } ( X )$ and $\hat { q } _ { \phi _ { 1 } ^ { 2 } } ( X )$ which are designed to be deterministic mappings, therefore, the expectation can be removed, and only the $k l$ term $k l ( q _ { \phi } ( Z | y , x ) | | p ( Z ) )$ is left. When $p ( Z )$ is a Gaussian distribution, the $k l$ term nicely has a closed form solution [12], i.e., $\begin{array} { r l r } { \mathrm { ~ } } & { { } } & { - \frac { 1 } { 2 } \sum _ { j = 1 } ^ { J } ( 1 + \log ( ( \sigma _ { j } ) ^ { 2 } ) - ( \mu _ { j } ) ^ { 2 } - ( \sigma _ { j } ) ^ { 2 } ) } \end{array}$ , where $J$ is the dimension of a latent representation $z$ , and $\sigma _ { j }$ and $\mu _ { j }$ are the encoder outputs.
|
| 160 |
+
|
| 161 |
+
For the co-teaching loss, we follow the work of Han et al. [10]. Intuitively, two encoders ${ \hat { q } } _ { \phi _ { 1 } ^ { 1 } } ( X )$ and ${ \hat { q } } _ { \phi _ { 1 } ^ { 2 } } ( X )$ feed all data forward and selects some data of possibly clean labels. Then, two networks communicate with each other to select possible clean data in this mini-batch and use them for training. Finally, each encoder backpropagates over the data selected by its peer network and updates itself by cross-entropy loss.
|
| 162 |
+
|
| 163 |
+
# 4 Experiments
|
| 164 |
+
|
| 165 |
+
In this section, we compare the classification accuracy of proposed method with popular label-noise learning algorithms [15, 19, 11, 10, 28, 36, 16] on both synthetic and real-world datasets.
|
| 166 |
+
|
| 167 |
+
# 4.1 Experimental Setup
|
| 168 |
+
|
| 169 |
+
Datasets We examine the efficacy of our approach on manually corrupted versions of four datasets, i.e., FashionMNIST [31], SVHN [18], CIFAR10, CIFAR100 [13], and one real-world noisy dataset, i.e., Clothing1M [32]. FashionMNIST contains 60,000 training images and 10,000 test images with 10 classes; SVHN contains 73,257 training images and 26,032 test images with 10 classes. CIFAR10 contains 50,000 training images and 10,000 test images. CIFAR10 and CIFAR100 both contain 50,000 training images and 10,000 test images but the former has 10 classes of images, and the latter has 10 classes of images. The four datasets contain clean data. We add instance-dependent label noise to the training sets manually according to Xia et al. [30]. Clothing1M has 1M images with real-world noisy labels and $1 0 \mathrm { k }$ images with clean labels for testing. For all the synthetic noisy datasets, the experiments are repeated 5 times.
|
| 170 |
+
|
| 171 |
+
Network structure and optimization For a fair comparison, all experiments are conducted on NVIDIA Tesla V100, and all methods are implemented by PyTorch. Dimension of the latent representation $Z$ is set to 25 for all synthetic noisy datasets. For encoder networks ${ \hat { q } } _ { \phi _ { 1 } ^ { 1 } } ( X )$ and $\hat { q } _ { \phi _ { 1 } ^ { 2 } } ( X )$ , we use the same network structures with the baseline method. Specially, we use a ResNet-18 network for FashionMNIST, a ResNet-34 network for SVHN and CIFAR10, a ResNet-50 network for CIFAR100 without pretraining. For Clothing1M, we use ResNet-50 networks pre-trained on ImageNet. The data-augmentation methods random crop and horizontal flip are used for our method. For Clothing1M, we use a ResNet-50 network pre-trained on ImageNet, and the clean training data is not used. The dimensionality of the latent representation $Z$ is set to 100. Due to limited space, we leave the detailed structure of other decoders and encoders in Appendix C.
|
| 172 |
+
|
| 173 |
+
Baselines and measurements We compare the proposed method with the following state-of-the-art approaches: (i). CE, which trains the standard deep network with the cross-entropy loss on noisy datasets. (ii). Decoupling [16], which trains two networks on samples whose predictions from the two networks are different. (iii). MentorNet [11] and Co-teaching [10], which mainly handle noisy labels by training on instances with small loss values. (iv). Forward [19], Reweight [15], and T-Revision [28]. These approaches utilize a class-dependent transition matrix $T$ to correct the loss function. For these baselines, we follow the experiments settings of the original papers. We report average test accuracy on over the last ten epochs of each model on the clean test set. Higher classification accuracy means that the algorithm is more robust to the label noise.
|
| 174 |
+
|
| 175 |
+
Table 1: Means and standard deviations (percentage) of classification accuracy on FashionMNIST with different label noise levels.
|
| 176 |
+
|
| 177 |
+
<table><tr><td></td><td>IDN-20%</td><td>IDN-30%</td><td>IDN-40%</td><td>IDN-45%</td><td>IDN-50%</td></tr><tr><td>CE</td><td>88.54±0.32</td><td>88.38±0.42</td><td>84.22±0.35</td><td>69.72±0.72</td><td>52.32±0.68</td></tr><tr><td>Co-teaching</td><td>91.21±0.31</td><td>90.30±0.42</td><td>89.10±0.29</td><td>86.78±0.90</td><td>63.22±1.56</td></tr><tr><td>Decoupling</td><td>90.70±0.28</td><td>90.34±0.36</td><td>88.78±0.44</td><td>87.54±0.53</td><td>68.32±1.77</td></tr><tr><td>MentorNet</td><td>91.57±0.29</td><td>90.52±0.41</td><td>88.14±0.76</td><td>85.12±0.76</td><td>61.62±1.42</td></tr><tr><td>Mixup</td><td>88.68±0.37</td><td>88.02±0.37</td><td>85.47±0.55</td><td>79.57±0.75</td><td>66.02±2.58</td></tr><tr><td>Forward</td><td>90.05±0.43</td><td>88.65±0.43</td><td>86.27±0.48</td><td>73.35±1.03</td><td>58.23±3.14</td></tr><tr><td>Reweight</td><td>90.27±0.27</td><td>89.58±0.37</td><td>87.04±0.32</td><td>80.69±0.89</td><td>64.13±1.23</td></tr><tr><td>T-Revision</td><td>91.58±0.31</td><td>90.11±0.61</td><td>89.46±0.42</td><td>84.01±1.14</td><td>68.99±1.04</td></tr><tr><td>CausalNL</td><td>90.84±0.31</td><td>90.68±0.37</td><td>90.01±0.45</td><td>88.75±0.81</td><td>78.19±1.01</td></tr></table>
|
| 178 |
+
|
| 179 |
+
Table 2: Means and standard deviations (percentage) of classification accuracy on SVHN with different label noise levels.
|
| 180 |
+
|
| 181 |
+
<table><tr><td></td><td>IDN-20%</td><td>IDN-30%</td><td>IDN-40%</td><td>IDN-45%</td><td>IDN-50%</td></tr><tr><td>CE</td><td>91.51±0.45</td><td>91.21±0.43</td><td>87.87±1.12</td><td>67.15±1.65</td><td>51.01±3.62</td></tr><tr><td>Co-teaching</td><td>93.93±0.31</td><td>92.06±0.31</td><td>91.93±0.81</td><td>89.33±0.71</td><td>67.62±1.99</td></tr><tr><td>Decoupling</td><td>90.02±0.25</td><td>91.59±0.25</td><td>88.27±0.42</td><td>84.57±0.89</td><td>65.14±2.79</td></tr><tr><td>MentorNet</td><td>94.08±0.12</td><td>92.73±0.37</td><td>90.41±0.49</td><td>87.45±0.75</td><td>61.23±2.82</td></tr><tr><td>Mixup</td><td>89.73±0.37</td><td>90.02±0.35</td><td>85.47±0.63</td><td>82.41±0.62</td><td>68.95±2.58</td></tr><tr><td>Forward</td><td>91.89±0.31</td><td>91.59±0.23</td><td>89.33±0.53</td><td>80.15±1.91</td><td>62.53±3.35</td></tr><tr><td>Reweight</td><td>92.44±0.34</td><td>92.32±0.51</td><td>91.31±0.67</td><td>85.93±0.84</td><td>64.13±3.75</td></tr><tr><td>T-Revision</td><td>93.14±0.53</td><td>93.51±0.74</td><td>92.65±0.76</td><td>88.54±1.58</td><td>64.51±3.42</td></tr><tr><td>CausalNL</td><td>94.06±0.23</td><td>93.86±0.65</td><td>93.82±0.64</td><td>93.19±0.93</td><td>85.41±2.95</td></tr></table>
|
| 182 |
+
|
| 183 |
+
Table 3: Means and standard deviations (percentage) of classification accuracy on CIFAR10 with different label noise levels.
|
| 184 |
+
|
| 185 |
+
<table><tr><td></td><td>IDN-20%</td><td>IDN-30%</td><td>IDN-40%</td><td>IDN-45%</td><td>IDN-50%</td></tr><tr><td>CE</td><td>75.81±0.26</td><td>69.15±0.65</td><td>62.45±0.86</td><td>51.72±1.34</td><td>39.42±2.52</td></tr><tr><td>Co-teaching</td><td>80.96±0.31</td><td>78.56±0.61</td><td>73.41±0.78</td><td>71.60±0.79</td><td>45.92±2.21</td></tr><tr><td>Decoupling</td><td>78.71±0.15</td><td>75.17±0.58</td><td>61.73±0.34</td><td>58.61±1.73</td><td>50.43±2.19</td></tr><tr><td>MentorNet</td><td>81.03±0.24</td><td>77.22±0.47</td><td>71.83±0.49</td><td>66.18±0.64</td><td>47.89±2.03</td></tr><tr><td>Mixup</td><td>73.17±0.34</td><td>70.02±0.31</td><td>61.56±0.71</td><td>56.45±0.67</td><td>48.95±2.58</td></tr><tr><td>Forward</td><td>74.64±0.26</td><td>69.75±0.56</td><td>60.21±0.75</td><td>48.81±2.59</td><td>46.27±1.30</td></tr><tr><td>Reweight</td><td>76.23±0.25</td><td>70.12±0.72</td><td>62.58±0.46</td><td>51.54±0.92</td><td>45.46±2.56</td></tr><tr><td>T-Revision</td><td>76.15±0.37</td><td>70.36±0.54</td><td>64.09±0.37</td><td>52.42±1.01</td><td>49.02±2.13</td></tr><tr><td>CausalNL</td><td>81.47±0.32</td><td>80.38±0.44</td><td>77.53±0.45</td><td>78.60±1.06</td><td>67.39±1.24</td></tr></table>
|
| 186 |
+
|
| 187 |
+
# 4.2 Classification Accuracy Evaluation
|
| 188 |
+
|
| 189 |
+
Results on synthetic noisy datasets Tables 1, 2, 3, and 4 report the classification accuracy on the datasets of $F$ -MNIST, SVHN, CIFAR-10, and CIFAR100, respectively. The synthetic experiments reveal that our method is powerful in handling instance-dependent label noise particularly in the situation of high noise rates. Specifically, for all datasets, the classification accuracy of our method decrease much slower than that of baseline methods. Additionally, the classification accuracies on these datasets are improved by using CausalNL, which implies that our method should capture the underlying data generation process, and then $Y$ should be a cause of $X$ for all these datasets.
|
| 190 |
+
|
| 191 |
+
Table 4: Means and standard deviations (percentage) of classification accuracy on CIFAR100 with different label noise levels.
|
| 192 |
+
|
| 193 |
+
<table><tr><td></td><td>IDN-20%</td><td>IDN-30%</td><td>IDN-40%</td><td>IDN-45%</td><td>IDN-50%</td></tr><tr><td>CE</td><td>30.42±0.44</td><td>24.15±0.78</td><td>21.45±0.70</td><td>15.23±1.32</td><td>14.42±2.21</td></tr><tr><td>Co-teaching</td><td>37.96±0.53</td><td>33.43±0.74</td><td>28.04±1.43</td><td>25.60±0.93</td><td>23.97±1.91</td></tr><tr><td>Decoupling</td><td>36.53±0.49</td><td>30.93±0.88</td><td>27.85±0.91</td><td>23.81±1.31</td><td>19.59±2.12</td></tr><tr><td>MentorNet</td><td>38.91±0.54</td><td>34.23±0.73</td><td>31.89±1.19</td><td>27.53��1.23</td><td>24.15±2.31</td></tr><tr><td>Mixup</td><td>32.92±0.76</td><td>29.76±0.87</td><td>25.92±1.26</td><td>23.13±2.15</td><td>21.31±1.32</td></tr><tr><td>Forward</td><td>36.38±0.92</td><td>33.17±0.73</td><td>26.75±0.93</td><td>21.93±1.29</td><td>19.27±2.11</td></tr><tr><td>Reweight</td><td>36.73±0.72</td><td>31.91±0.91</td><td>28.39±1.46</td><td>24.12±1.41</td><td>20.23±1.23</td></tr><tr><td>T-Revision</td><td>37.24±0.85</td><td>36.54±0.79</td><td>27.23±1.13</td><td>25.53±1.94</td><td>22.54±1.95</td></tr><tr><td>CausalNL</td><td>41.47±0.43</td><td>40.98±0.62</td><td>34.02±0.95</td><td>33.34±1.13</td><td>32.129±2.23</td></tr></table>
|
| 194 |
+
|
| 195 |
+
Table 5: Classification accuracy on Clothing1M. In the experiments, only noisy samples are exploited to train and validate the deep model.
|
| 196 |
+
|
| 197 |
+
<table><tr><td>CE</td><td>Decoupling</td><td>MentorNet</td><td>Co-teaching</td><td>Forward</td><td>Reweight</td><td>T-Revision</td><td>caualNL</td></tr><tr><td>68.88</td><td>54.53</td><td>56.79</td><td>60.15</td><td>69.91</td><td>70.40</td><td>70.97</td><td>72.24</td></tr></table>
|
| 198 |
+
|
| 199 |
+
For noisy $F$ -MNIST, SVHN and CIFAR-10, in the easy case IDN- $20 \%$ , almost all methods work well. When the noise rate is $30 \%$ , the advantages of causalNL begin to show. We surpassed all methods obviously. When the noise rate raises, all the baselines are gradually defeated. Finally, in the hardest case, i.e., IDN- $50 \%$ , the superiority of causalNL widens the gap of performance. The classification accuracy of causalNL is at least over $10 \%$ higher than the best baseline method. For noisy CIFAR-100, none of the methods works well. However, causalNL still overtakes the other methods with clear gaps for all different levels of noise rate.
|
| 200 |
+
|
| 201 |
+
Results on the real-world noisy dataset On the real-world noisy dataset Clothing1M, our method causalNL outperforms all the baselines, as shown in Table 5. The experimental results also show that the noise type in Clothing1M is more likely to be instance-dependent label noise, suggesting that the instance-independent assumption on the transition matrix sometimes can be strong.
|
| 202 |
+
|
| 203 |
+
# 5 Conclusion
|
| 204 |
+
|
| 205 |
+
In this paper, we have investigated how to use $P ( X )$ to help learn instance-dependent label noise. Specifically, previous assumptions are made on the transition matrix, and the assumptions are hard to be verified and might be violated on real-world datasets. From inspired by a causal perspective, when $Y$ is a cause of $X$ , then $P ( X )$ should contain useful information to infer the clean label $Y$ . We propose a novel generative approach called causalNL for instance-dependent label-noise learning. Our model makes use of the causal graph to contribute to the identifiability of the transition matrix, and therefore helps learn clean labels. In order to learn $P ( X )$ , compared to the previous methods, our method contains more parameters. But experiments on both synthetic and real-world noisy datasets show that a bit sacrifice on computational efficiency is worth it, i.e., the classification accuracy of casualNL significantly outperforms all the state-of-the-art methods. Additionally, the results also indicates that in classification problems, $Y$ can usually be considered as a cause of $X$ , and suggests that the understanding and modeling of the data generation process can help leverage additional information that is useful in solving advanced machine learning problems concerning the relationship between different modules of the data joint distribution. In our future work, we will study the theoretical properties of our method and establish identifiability results under certain assumptions on the data-generative process.
|
| 206 |
+
|
| 207 |
+
# Acknowledgments
|
| 208 |
+
|
| 209 |
+
TL was partially supported by Australian Research Council Projects DP-180103424, DE-190101473, and IC-190100031. GM was supported by Australian Research Council Project DE210101624. BH was supported by supported by the RGC Early Career Scheme No. 22200720 and NSFC Young Scientists Fund No. 62006202. GN was supported by JST AIP Acceleration Research Grant Number JPMJCR20U3, Japan. KZ was supported in part by the National Institutes of Health (NIH) under Contract R01HL159805, by the United States Air Force under Contract No. FA8650-17-C7715, by the NSF-Convergence Accelerator Track-D award #2134901, and by a grant from Apple. The NIH or NSF is not responsible for the views reported in this article. The authors thank the reviewers and the meta-reviewer for their helpful and constructive comments on this work.
|
| 210 |
+
|
| 211 |
+
# References
|
| 212 |
+
|
| 213 |
+
[1] Dana Angluin and Philip Laird. Learning from noisy examples. Machine Learning, 2(4): 343–370, 1988. [2] Devansh Arpit, Stanisław Jastrz˛ebski, Nicolas Ballas, David Krueger, Emmanuel Bengio, Maxinder S Kanwal, Tegan Maharaj, Asja Fischer, Aaron Courville, Yoshua Bengio, et al. A closer look at memorization in deep networks. In International Conference on Machine Learning, pages 233–242. PMLR, 2017.
|
| 214 |
+
[3] Mikhail Belkin, Partha Niyogi, and Vikas Sindhwani. Manifold regularization: A geometric framework for learning from labeled and unlabeled examples. Journal of machine learning research, 7(11), 2006.
|
| 215 |
+
[4] Antonin Berthon, Bo Han, Gang Niu, Tongliang Liu, and Masashi Sugiyama. Confidence scores make instance-dependent label-noise learning possible. In ICML, 2021.
|
| 216 |
+
[5] David M Blei, Alp Kucukelbir, and Jon D McAuliffe. Variational inference: A review for statisticians. Journal of the American statistical Association, 112(518):859–877, 2017.
|
| 217 |
+
[6] Hao Cheng, Zhaowei Zhu, Xingyu Li, Yifei Gong, Xing Sun, and Yang Liu. Learning with instance-dependent label noise: A sample sieve approach. In ICLR, 2021.
|
| 218 |
+
[7] Jiacheng Cheng, Tongliang Liu, Kotagiri Ramamohanarao, and Dacheng Tao. Learning with bounded instance and label-dependent label noise. In ICML, 2020.
|
| 219 |
+
[8] Jacob Goldberger and Ehud Ben-Reuven. Training deep neural-networks using a noise adaptation layer. In ICLR, 2017.
|
| 220 |
+
[9] Mingming Gong, Kun Zhang, Tongliang Liu, Dacheng Tao, Clark Glymour, and Bernhard Schölkopf. Domain adaptation with conditional transferable components. In International conference on machine learning, pages 2839–2848. PMLR, 2016.
|
| 221 |
+
[10] Bo Han, Quanming Yao, Xingrui Yu, Gang Niu, Miao Xu, Weihua Hu, Ivor Tsang, and Masashi Sugiyama. Co-teaching: Robust training of deep neural networks with extremely noisy labels. In NeurIPS, pages 8527–8537, 2018.
|
| 222 |
+
[11] Lu Jiang, Zhengyuan Zhou, Thomas Leung, Li-Jia Li, and Li Fei-Fei. MentorNet: Learning data-driven curriculum for very deep neural networks on corrupted labels. In ICML, pages 2309–2318, 2018.
|
| 223 |
+
[12] Diederik P Kingma and Max Welling. Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114, 2013.
|
| 224 |
+
[13] Alex Krizhevsky. Learning multiple layers of features from tiny images. Technical report, 2009.
|
| 225 |
+
[14] Xuefeng Li, Tongliang Liu, Bo Han, Gang Niu, and Masashi Sugiyama. Provably end-to-end label-noise learning without anchor points. In ICML, 2021.
|
| 226 |
+
[15] Tongliang Liu and Dacheng Tao. Classification with noisy labels by importance reweighting. IEEE Transactions on pattern analysis and machine intelligence, 38(3):447–461, 2016.
|
| 227 |
+
[16] Eran Malach and Shai Shalev-Shwartz. Decoupling" when to update" from" how to update". In NeurIPS, pages 960–970, 2017.
|
| 228 |
+
[17] Nagarajan Natarajan, Inderjit S Dhillon, Pradeep K Ravikumar, and Ambuj Tewari. Learning with noisy labels. In NeurIPS, pages 1196–1204, 2013.
|
| 229 |
+
[18] Yuval Netzer, Tao Wang, Adam Coates, Alessandro Bissacco, Bo Wu, and Andrew $\mathrm { Y . N g }$ . Reading digits in natural images with unsupervised feature learning. In NIPS Workshop on Deep Learning and Unsupervised Feature Learning, 2011.
|
| 230 |
+
[19] Giorgio Patrini, Alessandro Rozza, Aditya Krishna Menon, Richard Nock, and Lizhen Qu. Making deep neural networks robust to label noise: A loss correction approach. In CVPR, pages 1944–1952, 2017.
|
| 231 |
+
[20] Judea Pearl. Causality: Models, Reasoning, and Inference. Cambridge University Press, New York, NY, USA, 2000. ISBN 0-521-77362-8.
|
| 232 |
+
[21] Jonas Peters, Dominik Janzing, and Bernhard Schölkopf. Elements of causal inference: foundations and learning algorithms. The MIT Press, 2017.
|
| 233 |
+
[22] B Schölkopf, D Janzing, J Peters, E Sgouritsa, K Zhang, and J Mooij. On causal and anticausal learning. In 29th International Conference on Machine Learning (ICML 2012), pages 1255– 1262. International Machine Learning Society, 2012.
|
| 234 |
+
[23] Bernhard Schölkopf. Causality for machine learning. arXiv preprint arXiv:1911.10500, 2019.
|
| 235 |
+
[24] Clayton Scott. A rate of convergence for mixture proportion estimation, with application to learning from noisy labels. In AISTATS, pages 838–846, 2015.
|
| 236 |
+
[25] Peter Spirtes and Kun Zhang. Causal discovery and inference: concepts and recent methodological advances. In Applied informatics, volume 3, pages 1–28. SpringerOpen, 2016.
|
| 237 |
+
[26] Peter Spirtes, Clark N Glymour, Richard Scheines, David Heckerman, Christopher Meek, Gregory Cooper, and Thomas Richardson. Causation, prediction, and search. MIT press, 2000.
|
| 238 |
+
[27] Songhua Wu, Xiaobo Xia, Tongliang Liu, Bo Han, Mingming Gong, Nannan Wang, Haifeng Liu, and Gang Niu. Class2simi: A noise reduction perspective on learning with noisy labels. In International Conference on Machine Learning, pages 11285–11295. PMLR, 2021.
|
| 239 |
+
[28] Xiaobo Xia, Tongliang Liu, Nannan Wang, Bo Han, Chen Gong, Gang Niu, and Masashi Sugiyama. Are anchor points really indispensable in label-noise learning? In NeurIPS, pages 6835–6846, 2019.
|
| 240 |
+
[29] Xiaobo Xia, Tongliang Liu, Nannan Wang, Bo Han, Chen Gong, Gang Niu, and Masashi Sugiyama. Are anchor points really indispensable in label-noise learning? In NeurIPS, pages 6838–6849, 2019.
|
| 241 |
+
[30] Xiaobo Xia, Tongliang Liu, Bo Han, Nannan Wang, Mingming Gong, Haifeng Liu, Gang Niu, Dacheng Tao, and Masashi Sugiyama. Part-dependent label noise: Towards instance-dependent label noise. In NeurIPS, 2020.
|
| 242 |
+
[31] Han Xiao, Kashif Rasul, and Roland Vollgraf. Fashion-mnist: a novel image dataset for benchmarking machine learning algorithms. arXiv preprint arXiv:1708.07747, 2017.
|
| 243 |
+
[32] Tong Xiao, Tian Xia, Yi Yang, Chang Huang, and Xiaogang Wang. Learning from massive noisy labeled data for image classification. In CVPR, pages 2691–2699, 2015.
|
| 244 |
+
[33] Quanming Yao, Hansi Yang, Bo Han, Gang Niu, and James T Kwok. Searching to exploit memorization effect in learning with noisy labels. In ICML, 2020.
|
| 245 |
+
[34] Yu Yao, Tongliang Liu, Bo Han, Mingming Gong, Jiankang Deng, Gang Niu, and Masashi Sugiyama. Dual t: Reducing estimation error for transition matrix in label-noise learning. In NeurIPS, 2020.
|
| 246 |
+
[35] Xiyu Yu, Tongliang Liu, Mingming Gong, and Dacheng Tao. Learning with biased complementary labels. In ECCV, pages 68–83, 2018.
|
| 247 |
+
[36] Hongyi Zhang, Moustapha Cisse, Yann N Dauphin, and David Lopez-Paz. mixup: Beyond empirical risk minimization. In ICLR, 2018.
|
| 248 |
+
[37] Kun Zhang and Aapo Hyvarinen. On the identifiability of the post-nonlinear causal model. arXiv preprint arXiv:1205.2599, 2012.
|
| 249 |
+
[38] Kun Zhang, Mingming Gong, and Bernhard Schölkopf. Multi-source domain adaptation: A causal view. In Twenty-ninth AAAI conference on artificial intelligence, 2015.
|
| 250 |
+
[39] Kun Zhang, Jiji Zhang, and Bernhard Schölkopf. Distinguishing cause from effect based on exogeneity. arXiv preprint arXiv:1504.05651, 2015.
|
md/train/fmiwLdJCmLS/fmiwLdJCmLS.md
ADDED
|
@@ -0,0 +1,343 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# On the Importance of Gradients for Detecting Distributional Shifts in the Wild
|
| 2 |
+
|
| 3 |
+
Rui Huang
|
| 4 |
+
Department of Computer Sciences
|
| 5 |
+
University of Wisconsin-Madison huangrui@cs.wisc.edu Andrew Geng
|
| 6 |
+
Department of Computer Sciences⇤
|
| 7 |
+
University of Wisconsin-Madison ageng@wisc.edu Yixuan Li
|
| 8 |
+
Department of Computer Sciences
|
| 9 |
+
University of Wisconsin-Madison sharonli@cs.wisc.edu
|
| 10 |
+
|
| 11 |
+
# Abstract
|
| 12 |
+
|
| 13 |
+
Detecting out-of-distribution (OOD) data has become a critical component in ensuring the safe deployment of machine learning models in the real world. Existing OOD detection approaches primarily rely on the output or feature space for deriving OOD scores, while largely overlooking information from the gradient space. In this paper, we present GradNorm, a simple and effective approach for detecting OOD inputs by utilizing information extracted from the gradient space. GradNorm directly employs the vector norm of gradients, backpropagated from the KL divergence between the softmax output and a uniform probability distribution. Our key idea is that the magnitude of gradients is higher for indistribution (ID) data than that for OOD data, making it informative for OOD detection. GradNorm demonstrates superior performance, reducing the average FPR95 by up to $1 6 . 3 3 \%$ compared to the previous best method. Code and data available: https://github.com/deeplearning-wisc/gradnorm_ood.
|
| 14 |
+
|
| 15 |
+
# 1 Introduction
|
| 16 |
+
|
| 17 |
+
When deploying machine learning models in the real world, there is an increasingly important question to ask: “Is the model making a faithful prediction for something it was trained on, or is the model making an unreliable prediction for something it has not been exposed to during training?” We desire models that are not only accurate on their familiar data distribution, but also aware of uncertainty outside the training distribution. This gives rise to the importance of out-of-distribution (OOD) detection, which determines whether an input is in-distribution (ID) or OOD. As of recently a plethora of literature has emerged to address the problem of OOD uncertainty estimation [2, 13, 14, 16, 24, 26–29, 31, 32, 41].
|
| 18 |
+
|
| 19 |
+
The main challenge in OOD uncertainty estimation stems from the fact that modern deep neural networks can easily produce overconfident predictions on OOD inputs $\textcircled { 1 3 4 } \textcircled { 1 }$ . This phenomenon makes the separation between ID and OOD data a non-trivial task. Much of the prior work focused on deriving OOD uncertainty measurements from the activation space of the neural network, e.g., using model output [13, 14, 24, 27, 29] or feature representations $[ [ 2 6 ] ]$ . Yet, this leaves an alternative space—model parameter and its gradient space—largely unexplored. Will a model react to ID and OOD inputs differently in its gradient space, and if so, can we discover distinctive signatures to separate ID and OOD data from gradients?
|
| 20 |
+
|
| 21 |
+
In this paper, we tackle this key question by exploring and exploiting the richness of the gradient space, ultimately showing that gradients carry surprisingly useful signals for OOD detection. Formally, we present GradNorm, a simple and effective approach for detecting OOD inputs by utilizing gradient extracted from a pre-trained neural network. Specifically, GradNorm employs the vector norm of gradients directly as an OOD scoring function. Gradients are backpropagated from the KullbackLeibler (KL) divergence $\pmb { \mathbb { Z } } 3 \|$ between the softmax output and a uniform distribution. ID data is expected to have larger KL divergence because the prediction tends to concentrate on one of the ground-truth classes and is therefore less uniformly distributed. As depicted in Figure $\bigstar \bigstar$ our key idea is that the gradient norm of the KL divergence is higher for ID data than that for OOD data, making it informative for OOD uncertainty estimation.
|
| 22 |
+
|
| 23 |
+
We provide both empirical and theoretical insights, demonstrating the superiority of GradNorm over both output-based and feature-based methods. Empirically, we establish superior performance on a large-scale ImageNet benchmark, as well as a suite of common OOD detection benchmarks. GradNorm outperforms the previous best method by a large margin, with up to $1 6 . 3 3 \%$ reduction in false-positive rate (FPR95). Theoretically, we show that GradNorm captures the joint information between the feature and the output space. The joint information results in an overall stronger separability than using either feature or output space alone.
|
| 24 |
+
|
| 25 |
+
Our key results and contributions are summarized as follows.
|
| 26 |
+
|
| 27 |
+
• We propose GradNorm, a simple and effective gradient-based OOD uncertainty estimation method, which is both label-agnostic (no label required for backpropagation) and OODagnostic (no outlier data required). GradNorm reduces the average FPR95 by $1 6 . 3 3 \%$ compared to the current best method.
|
| 28 |
+
• We perform comprehensive analyses that improve understandings of the gradient-based method under (1) different network architectures, (2) gradient norms extracted at varying depths, (3) different loss functions for backpropagation, and (4) different vector norms for aggregating gradients.
|
| 29 |
+
We perform a mathematical analysis of GradNorm and show that it can be decomposed into two terms, jointly characterizing information from both feature and output space, which demonstrates superiority.
|
| 30 |
+
|
| 31 |
+
# 2 Preliminaries
|
| 32 |
+
|
| 33 |
+
We start by recalling the general setting of the supervised learning problem. We denote by $\chi = \mathbb { R } ^ { d }$ the input space and $\mathcal { Y } _ { . . } = \left\{ 1 , 2 , . . . , C \right\}$ the output space. A learner is given access to a set of training data $\bar { D } = \mathbf { \bar { \chi } } _ { } ( ( \mathbf { x } _ { i } , y _ { i } ) \mathbf { \chi } _ { i = 1 } ^ { N }$ drawn from an unknown joint data distribution $P$ defined on $\mathcal { X } \times \mathcal { V }$ . A neural network $f ( \mathbf { x } ; \theta ) : \mathcal { X } \xrightarrow { } \mathbb { R } ^ { C }$ minimizes the empirical risk:
|
| 34 |
+
|
| 35 |
+
$$
|
| 36 |
+
R _ { \mathcal { L } } ( f ) = \mathbb { E } _ { D } ( \mathcal { L } _ { \mathrm { C E } } ( f ( \mathbf { x } ; \boldsymbol { \theta } ) , y ) ) ,
|
| 37 |
+
$$
|
| 38 |
+
|
| 39 |
+
where $\theta$ is the parameters of the network, and $\mathcal { L } _ { \mathrm { C E } }$ is the commonly used cross-entropy loss:
|
| 40 |
+
|
| 41 |
+
$$
|
| 42 |
+
\mathcal { L } _ { \mathrm { C E } } ( f ( \mathbf { x } ) , y ) = - \log \frac { e ^ { f _ { y } ( \mathbf { x } ) / T } } { \sum _ { c = 1 } ^ { C } e ^ { f _ { c } ( \mathbf { x } ) / T } } .
|
| 43 |
+
$$
|
| 44 |
+
|
| 45 |
+
Specifically, $f _ { y } ( \mathbf { x } )$ denotes the $y$ -th element of $f ( \mathbf { x } )$ corresponding to the ground-truth label $y$ , and $T$ is the temperature.
|
| 46 |
+
|
| 47 |
+
Problem statement Out-of-distribution (OOD) detection can be formulated as a binary classification problem. In practice, OOD is often defined by a distribution that simulates unknowns encountered during deployment time, such as samples from an irrelevant distribution whose label set has no intersection with $\mathcal { V }$ and therefore should not be predicted by the model. Given a classifier $f$ learned on training samples from in-distribution $P$ , the goal is to design a binary function estimator,
|
| 48 |
+
|
| 49 |
+
$$
|
| 50 |
+
g ( \mathbf { x } ) = \left\{ \begin{array} { l l } { \operatorname { i n } , } & { \operatorname { i f } S ( \mathbf { x } ) \geq \gamma } \\ { \operatorname { o u t } , } & { \operatorname { i f } S ( \mathbf { x } ) < \gamma , } \end{array} \right.
|
| 51 |
+
$$
|
| 52 |
+
|
| 53 |
+
that classifies whether a sample $\mathbf { x } \in \mathcal { X }$ is from $P$ or not. $\gamma$ is commonly chosen so that a high fraction (e.g., $9 5 \%$ ) of ID data is correctly classified. The key challenge is to derive a scoring function $S ( \mathbf { x } )$ that captures OOD uncertainty. Previous approaches have primarily relied on the model’s output or features for OOD uncertainty estimation. Instead, our approach seeks to compute $S ( \mathbf { x } )$ based on the information extracted from the gradient space, which we describe in the next section.
|
| 54 |
+
|
| 55 |
+
# 3 Gradient-based OOD Detection
|
| 56 |
+
|
| 57 |
+
In this section, we describe our method GradNorm. We start by introducing the loss function for backpropagation and then describe how to leverage the gradient norm for OOD uncertainty estimation.
|
| 58 |
+
|
| 59 |
+
We calculate gradients $w . r . t$ . each parameter by backpropagating the Kullback-Leibler (KL) divergence $\mathbb { \left[ \left. 2 3 \right] \right. }$ between the softmax output and a uniform distribution. Formally, KL divergence quantifies how close a model-predicted distribution $q = \left\{ q _ { i } \right\}$ is to a reference probability distribution $\bar { p } = \{ p _ { i } \}$ ,
|
| 60 |
+
|
| 61 |
+
$$
|
| 62 |
+
D _ { \mathrm { K L } } ( p \mid \mid q ) = \sum _ { i } p _ { i } \log { \frac { p _ { i } } { q _ { i } } } = - \sum _ { i } p _ { i } \log q _ { i } + \sum _ { i } p _ { i } \log p _ { i } = H ( p , q ) - H ( p ) .
|
| 63 |
+
$$
|
| 64 |
+
|
| 65 |
+
In particular, we set the reference distribution to be uniform $\mathbf { u } = [ 1 / C , 1 / C , . . . , 1 / C ] \in \mathbb { R } ^ { C }$ . The predictive probability distribution is the softmax output. Our KL divergence for backpropagation can be written as:
|
| 66 |
+
|
| 67 |
+
$$
|
| 68 |
+
D _ { \mathrm { K L } } ( \mathbf { u } \mid \mid \mathrm { s o f t m a x } ( f ( \mathbf { x } ) ) = - \frac { 1 } { C } \sum _ { c = 1 } ^ { C } \log \frac { e ^ { f _ { c } ( \mathbf { x } ) / T } } { \sum _ { j = 1 } ^ { C } e ^ { f _ { j } ( \mathbf { x } ) / T } } - H ( \mathbf { u } ) ,
|
| 69 |
+
$$
|
| 70 |
+
|
| 71 |
+
where the first term is the cross-entropy loss between the softmax output and a uniform vector $\mathbf { u }$ , and the second term $H ( \mathbf { u } )$ is a constant. The KL divergence measures how much the predictive distribution is away from the uniform distribution. Intuitively, ID data is expected to have larger KL divergence because the prediction tends to concentrate on the ground-truth class and is thus distributed less uniformly.
|
| 72 |
+
|
| 73 |
+
GradNorm as OOD score For a given parameter $w$ , the gradient of the above KL divergence is:
|
| 74 |
+
|
| 75 |
+
$$
|
| 76 |
+
\frac { \partial D _ { \mathrm { K L } } ( \mathbf { u } \mid | \operatorname { s o f t m a x } ( f ( \mathbf { x } ) ) } { \partial w } = \frac { 1 } { C } \sum _ { i = 1 } ^ { C } \frac { \partial \mathcal { L } _ { \mathrm { C E } } ( f ( \mathbf { x } ) , i ) } { \partial w } ,
|
| 77 |
+
$$
|
| 78 |
+
|
| 79 |
+
where $w$ is a component of network parameter $\theta$ . Notice that the gradient of the entropy term is 0, i.e. $\partial H ( \mathbf { u } ) / \partial w = \bar { 0 }$ . In other words, the gradient of KL divergence is equivalent to averaging the derivative of the categorical cross-entropy loss for all labels.
|
| 80 |
+
|
| 81 |
+

|
| 82 |
+
Figure 1: An example of two-dimensional input space. Input data is depicted in the $x y$ -plane, while gradient norm for each input is depicted in the $z$ - dimension. The magnitude of gradients is higher for ID data (light green) than that for OOD data (deep blue).
|
| 83 |
+
|
| 84 |
+
We now define the OOD score via a vector norm of gradients of the selected parameters:
|
| 85 |
+
|
| 86 |
+
$$
|
| 87 |
+
S ( \mathbf { x } ) = \| \frac { \partial D _ { \mathrm { K L } } ( \mathbf { u } \parallel \mathrm { s o f t m a x } ( f ( \mathbf { x } ) ) } { \partial \mathbf { w } } \| _ { p } ,
|
| 88 |
+
$$
|
| 89 |
+
|
| 90 |
+
where $\lVert \cdot \rVert _ { p }$ denotes $L _ { p }$ -norm and w is the set of parameters in vector form2. We term our method GradNorm, short for gradient norm. In practice, GradNorm can be conveniently implemented by calculating the cross-entropy loss between the predicted softmax probability and a uniform vector as the target. We will discuss the choices and impacts of the selected parameter set w in Section 4.2.
|
| 91 |
+
|
| 92 |
+
Rationale of GradNorm Our operating hypothesis is that using the KL divergence for backpropagation, the gradient norm is higher for ID data than that for OOD data. As we show in Section $\check { \boxed { 4 . 2 } }$ using the gradient norm of the KL divergence is more effective than using the KL divergence directly. Moreover, GradNorm derived from the KL divergence with a uniform target offers two advantages over gradient norms derived from the standard cross-entropy loss.
|
| 93 |
+
|
| 94 |
+
• First, our method is label-agnostic and does not require any ground-truth label. It can be flexibly used during inference time when the label is unavailable for either ID or OOD data. • Second, it captures the uncertainty across all categories, providing more information for OOD detection. We will provide empirical evidence to show the importance of utilizing all labels in Section 4.2.
|
| 95 |
+
|
| 96 |
+
Table 1: Main Results. OOD detection performance comparison between GradNorm and baselines. All methods utilize the standard ResNetv2-101 model trained on ImageNet $\mathbb { Z }$ . The classification model is trained on ID data only. $\uparrow$ indicates larger values are better, while $\downarrow$ indicates smaller values are better. All values are percentages. All methods are post hoc and can be directly used for pre-trained models.
|
| 97 |
+
|
| 98 |
+
<table><tr><td rowspan="2">Method Space</td><td rowspan="2">Method</td><td colspan="2">iNaturalist</td><td colspan="2">SUN</td><td colspan="2">Places</td><td colspan="2">Textures</td><td colspan="2">Average</td></tr><tr><td>FPR95 √</td><td>AUROC 个</td><td>FPR95 √</td><td>AUROC →</td><td>FPR95 √</td><td>AUROC 个</td><td>FPR95 √</td><td>AUROC 个</td><td>FPR95 √</td><td>AUROC →</td></tr><tr><td rowspan="3">Output</td><td>MSP</td><td>63.69</td><td>87.59</td><td>79.98</td><td>78.34</td><td>81.44</td><td>76.76</td><td>82.73</td><td>74.45</td><td>76.96</td><td>79.29</td></tr><tr><td>ODIN</td><td>62.69</td><td>89.36</td><td>71.67</td><td>83.92</td><td>76.27</td><td>80.67</td><td>81.31</td><td>76.30</td><td>72.99</td><td>82.56</td></tr><tr><td>Energy29</td><td>64.91</td><td>88.48</td><td>65.33</td><td>85.32</td><td>73.02</td><td>81.37</td><td>80.87</td><td>75.79</td><td>71.03</td><td>82.74</td></tr><tr><td>Feature</td><td>Mahalanobis </td><td>96.34</td><td>46.33</td><td>88.43</td><td>65.20</td><td>89.75</td><td>64.46</td><td>52.23</td><td>72.10</td><td>81.69</td><td>62.02</td></tr><tr><td>Gradient</td><td>GradNorm (ours)</td><td>50.03</td><td>90.33</td><td>46.48</td><td>89.03</td><td>60.86</td><td>84.82</td><td>61.42</td><td>81.07</td><td>54.70</td><td>86.31</td></tr></table>
|
| 99 |
+
|
| 100 |
+
# 4 Experiments
|
| 101 |
+
|
| 102 |
+
In this section, we evaluate GradNorm on a large-scale OOD detection benchmark with ImageNet-1k as in-distribution dataset $\boxed { 1 1 6 }$ . We describe experimental setup in Section 4.1 and demonstrate the superior performance of GradNorm over existing approaches in Section $4 . 2 ,$ followed by extensive ablations and analyses that improve the understandings of our approach.
|
| 103 |
+
|
| 104 |
+
# 4.1 Experimental Setup
|
| 105 |
+
|
| 106 |
+
Dataset We use the large-scale ImageNet OOD detection benchmark proposed by Huang and Li [16]. ImageNet benchmark is not only more realistic (with higher resolution images) but also more challenging (with a larger label space of 1,000 categories). We evaluate on four OOD test datasets, which are from subsets of iNaturalist [43], SUN [47], Places [51], and Textures [5], with non-overlapping categories w.r.t. ImageNet-1k (see Appendix ${ \bf B . l }$ for detail). The evaluations span a diverse range of domains including fine-grained images, scene images, and textural images. We further evaluate on CIFAR benchmarks that are routinely used in literature (see Appendix $\overset { \smile } { \mathbf { A } ) }$ .
|
| 107 |
+
|
| 108 |
+
Model and hyperparameters We use Google BiT-S models3 [21] pre-trained on ImageNet-1k with a ResNetv2-101 architecture $\mathbb { m }$ . We report performance on an alternative architecture, DenseNet121 [15], in Section $\boxed { 4 . 2 }$ Additionally, we use $L _ { 1 }$ -norm-based OOD scores as the default and explore the effect of other $\overline { { L _ { p } } }$ -norms in Section $4 . 2 .$ The temperature parameter $T$ is set to be 1 unless specified otherwise, and we explore the effect of different temperatures in Section $\boxed { 4 . 2 }$ At test time, all images are resized to $4 8 0 \times 4 8 0$ .
|
| 109 |
+
|
| 110 |
+
# 4.2 Results and Ablation Studies
|
| 111 |
+
|
| 112 |
+
Comparison with output- and feature-based methods The results for ImageNet evaluations are shown in Table $\mathbb { L }$ where GradNorm demonstrates superior performance. We report OOD detection performance for each OOD test dataset, as well as the average over the four datasets. For a fair comparison, all the methods use the same pre-trained backbone, without regularizing with auxiliary outlier data. In particular, we compare with MSP $\mathbb { \lVert 1 3 \rVert }$ , ODIN $ { \mathbb { \left[ \left[ 2 7 \right] \right] } }$ , Mahalanobis $\bar { \left\| 2 6 \right\| }$ , as well as Energy [29]. Details and hyperparameters of baseline methods can be found in Appendix B.2.
|
| 113 |
+
|
| 114 |
+
GradNorm outperforms the best output-based baseline, Energy score $\mathbb { \left| \mathbb { Z } 9 \right| }$ , by $1 6 . 3 3 \%$ in FPR95. GradNorm also outperforms a competitive feature-based method, Mahalanobis $\left[ \left[ 2 6 \right] \right]$ , by $2 6 . 9 9 \%$ in FPR95. We hypothesize that the increased size of label space makes the class-conditional Gaussian density estimation less viable. It is also worth noting that significant overheads can be introduced by some methods. For instance, Mahalanobis $\left[ \left[ 2 6 \right] \right]$ requires collecting feature representations from intermediate layers over the entire training set, which is expensive for large-scale datasets such as ImageNet. In contrast, GradNorm can be conveniently used through a simple gradient calculation without hyper-parameter tuning or additional training.
|
| 115 |
+
|
| 116 |
+
Gradients from the last layer is sufficiently informative In this ablation, we investigate several variants of GradNorm where the gradients are extracted from different network depths. Specifically, we consider gradients of (1) block n: all trainable parameters in the $n$ -th block, (2) all parameters: all trainable parameters from all layers of the network, and (3) last layer parameters: weight parameters from the last fully connected (FC) layer.
|
| 117 |
+
|
| 118 |
+

|
| 119 |
+
Figure 2: Comparison of $L _ { 1 }$ -norm distributions of last layer gradients between KL divergence with uniform target and KL divergence with one-hot target. We show in-distribution data in green and OOD data in gray.
|
| 120 |
+
|
| 121 |
+
Table $2$ contrasts the OOD detection performance using different gradient space. For each setting, we report the FPR95 and AUROC averaged across four OOD datasets. We observe that gradients from deeper layers tend to yield significantly better performance than shallower layers. This is desirable since gradients w.r.t. deeper layers are computationally more efficient than shallower layers. Interestingly,GradNorm obtained from the last linear layer yield the best results among all variants. Practically, one only needs to perform backpropagation $w . r . t$ . the last linear layer, which incurs negligible computations. Therefore, our main results are based on the norm of gradients extracted from weight parameters in the last FC layer of the neural network.
|
| 122 |
+
|
| 123 |
+
Table 2: Effect of GradNorm using different subset of gradients. Gradient norm derived from deeper layers yield better OOD detection performance.
|
| 124 |
+
|
| 125 |
+
<table><tr><td>Gradient Space</td><td>FPR95 √</td><td>AUROC →</td></tr><tr><td>Block 1</td><td>73.52</td><td>76.41</td></tr><tr><td>Block 2</td><td>74.34</td><td>76.63</td></tr><tr><td>Block 3</td><td>71.73</td><td>78.11</td></tr><tr><td>Block 4</td><td>65.07</td><td>85.11</td></tr><tr><td>All params</td><td>69.35</td><td>81.14</td></tr><tr><td>Last layer params</td><td>54.70</td><td>86.31</td></tr></table>
|
| 126 |
+
|
| 127 |
+
GradNorm with one-hot v.s. uniform targets In this ablation, we contrast GradNorm derived using uniform targets (ours) v.s. one-hot targets. Specifically, our scoring function Equation $5$ i s equivalent to
|
| 128 |
+
|
| 129 |
+
$$
|
| 130 |
+
S ( \mathbf { x } ) = \| \frac { 1 } { C } \sum _ { i = 1 } ^ { C } \frac { \partial \mathcal { L } _ { \mathrm { C E } } ( f ( \mathbf { x } ) , i ) } { \partial \mathbf { w } } \| ,
|
| 131 |
+
$$
|
| 132 |
+
|
| 133 |
+
which captures the gradient of cross-entropy loss across all labels. In contrast, we compare against an alternative scoring function that utilizes only one dominant class label:
|
| 134 |
+
|
| 135 |
+
$$
|
| 136 |
+
S _ { \mathrm { o n e - h o t } } ( \mathbf { x } ) = \| \frac { \partial \mathcal { L } _ { \mathrm { C E } } ( f ( \mathbf { x } ) , \hat { y } ) } { \partial \mathbf { w } } \| ,
|
| 137 |
+
$$
|
| 138 |
+
|
| 139 |
+
where $\hat { y }$ is the predicted class with the largest output.
|
| 140 |
+
|
| 141 |
+
We first analyze the score distributions using uniform targets (top) and one-hot targets (bottom) for ID and OOD data in Figure $2 .$ There are two salient observations we can draw: (1) using uniform target (ours), gradients of ID data indeed have larger magnitudes than those of OOD data, as the softmax prediction tends to be less uniformly distributed (and therefore results in a larger KL divergence). In contrast, the gradient norm using one-hot targets shows the opposite trend, with ID data having lower magnitudes. This is also expected since the training objective explicitly minimizes the cross-entropy loss, which results in smaller gradients for the majority of ID data. (2) The score distribution using one-hot targets displays a strong overlapping between ID (green) and OOD (gray) data, with large variances. In contrast, our method GradNorm can significantly improve the separability between ID and OOD data, resulting in better OOD detection performance.
|
| 142 |
+
|
| 143 |
+
Figure $\textcircled { 3 }$ reports the OOD detection performance using uniform targets (ours) v.s. one-hot targets. We use $L _ { 1 }$ -norm in both cases. For one-hot targets, we use the negative norm, i.e. $- S _ { \mathrm { o n e - h o t } } ( \mathbf { x } )$ , to align with the convention that ID data has higher scores. GradNorm with uniform targets outperforms its counterpart with one-hot targets by a large margin. For instance, GradNorm reduces FPR95 by $4 8 . 3 5 \%$ when evaluated on the SUN dataset. Our analysis signifies the importance of measuring OOD uncertainty using all label information.
|
| 144 |
+
|
| 145 |
+

|
| 146 |
+
Figure 3: OOD detection performance (FPR95) comparison between uniform (ours) v.s. one-hot target.
|
| 147 |
+
|
| 148 |
+
GradNorm is effective on alternative neural network architecture We evaluate GradNorm on a different architecture DenseNet-121 $\mathbb { \lVert \rVert \cdot \rVert }$ , and report performance in Table $\textcircled { 3 }$ GradNorm is consistently effective, outperforming the best baseline, Energy $\mathbb { \left[ \left[ 2 9 \right] \right] }$ , by $1 0 . 2 9 \%$ in FPR95.
|
| 149 |
+
|
| 150 |
+
<table><tr><td rowspan="2">Method Space</td><td rowspan="2">Method</td><td colspan="2">iNaturalist</td><td colspan="2">SUN</td><td colspan="2">Places</td><td colspan="2">Textures</td><td colspan="2">Average</td></tr><tr><td>FPR95 √</td><td>AUROC →</td><td>FPR95 √</td><td>AUROC 个</td><td>FPR95 √</td><td>AUROC →</td><td>FPR95 √</td><td>AUROC 个</td><td>FPR95 √</td><td>AUROC →</td></tr><tr><td rowspan="3">Output</td><td>MSP3</td><td>48.55</td><td>89.16</td><td>69.39</td><td>80.46</td><td>71.42</td><td>80.11</td><td>68.51</td><td>78.69</td><td>64.47</td><td>82.11</td></tr><tr><td>ODIN</td><td>37.00</td><td>93.29</td><td>57.30</td><td>86.12</td><td>61.91</td><td>84.14</td><td>56.49</td><td>84.62</td><td>53.18</td><td>87.04</td></tr><tr><td>Energy 29</td><td>36.39</td><td>93.29</td><td>54.91</td><td>86.53</td><td>59.98</td><td>84.29</td><td>53.87</td><td>85.07</td><td>51.29</td><td>87.30</td></tr><tr><td>Feature</td><td>Mahalanobis 网</td><td>97.36</td><td>42.24</td><td>98.24</td><td>41.17</td><td>97.32</td><td>47.27</td><td>62.78</td><td>56.53</td><td>88.93</td><td>46.80</td></tr><tr><td>Gradient</td><td>GradNorm (ours)</td><td>23.87</td><td>93.97</td><td>43.04</td><td>87.79</td><td>53.92</td><td>83.04</td><td>43.16</td><td>87.48</td><td>41.00</td><td>88.07</td></tr></table>
|
| 151 |
+
|
| 152 |
+
Table 3: OOD detection performance comparison on a different architecture, DenseNet-121 [15]. Model is trained on ImageNet-1k $\bar { \mathbb { Z } }$ as the ID dataset. All methods are post hoc and can be directly used for pre-trained models.
|
| 153 |
+
|
| 154 |
+
$L _ { 1 }$ -norm is the most effective How does the choice of $L _ { p }$ -norm in Equation $5$ affect the OOD detection performance? To understand this, we show in Figure $\boxed { 4 }$ the comparison using $L _ { 1 \sim 4 }$ -norm, $L _ { \infty }$ -norm, as well as the fraction norm (with $p = 0 . 3$ ). Compared with higher-order norms, $L _ { 1 }$ -norm achieves the best OOD detection performance on all four datasets. We hypothesize that $L _ { 1 }$ -norm is better suited since it captures information equally from all dimensions in the gradient space, whereas higher-order norms will unfairly highlight larger elements rather than smaller elements (due to the effect of the exponent $p$ ). In the extreme case, $L _ { \infty }$ -norm only considers the largest element (in absolute value) and results in the worst OOD detection performance among all norms. On the other hand, the fraction norm overall does not outperform $L _ { 1 }$ -norm. We additionally provide results for more $L _ { p }$ -norms in Appendix $\bigtriangledown$ with $p = \{ 0 . \bar { 3 } , 0 . 5 , 0 . 8 , 1 , 2 , 3 , 4 , 5 , 6 , \infty \}$ .
|
| 155 |
+
|
| 156 |
+

|
| 157 |
+
Figure 4: OOD detection performance comparison under different $L _ { p }$ -norms. We show FPR95 (left) and AUROC (right).
|
| 158 |
+
|
| 159 |
+
Effect of temperature scaling We evaluate our method GradNorm with different temperatures $T$ from $T = 0 . 5$ to $T = 1 0 2 4$ . As shown in Figure $\textcircled{5}$ $T = 1$ is optimal, while either increasing or decreasing the temperature will degrade the performance. This can be explained mathematically via the $V$ term in Equation $9 .$ . Specifically, using a large temperature will result in a smoother softmax distribution, with · efj /TPC efj /T closer to 1 (and V ! 0). This leads to a less distinguishable
|
| 160 |
+
|
| 161 |
+

|
| 162 |
+
distribution between ID and OOD. Our method can be hyperparameter-free by setting $T = 1$ . For completeness, we have included numerical results under a wider range of $T$ in Appendix D.
|
| 163 |
+
|
| 164 |
+
GradNorm is more effective than directly using KL divergence We provide an ablation, contrasting the performance of using GradNorm v.s. using the KL divergence derived from Equation $3$ as OOD scoring function. The results are show in Figure $6 ,$ where GradNorm yields significantly better performance than the KL divergence directly extracted from the output space, demonstrating the superiority of gradient space for OOD detection.
|
| 165 |
+
|
| 166 |
+

|
| 167 |
+
Figure 5: OOD detection performance of GradNorm with varying temperature parameter $T$ . We show AUROC (left) and FPR95 (right).
|
| 168 |
+
Figure 6: Comparison between GradNorm v.s. directly using the KL divergence as scoring function.
|
| 169 |
+
|
| 170 |
+
Effect of model capacity In this ablation, we explore the OOD detection performance of GradNorm with varying model capacities. For the ease of experiments, we directly use Google BiT-S models pre-trained on ImageNet1k [7]. We compare the performance of the following model family (in increasing size): BiT-S-R50x1, BiTS-R101x1, BiT-S-R50x3, BiT-S-R152x2, BiT-S-R101x3. All models are ResNetv2 architectures with varying depths and width factors. The average performance on 4 OOD datasets is reported in Table 4. OOD detection performance is optimal when the model size is relatively small
|
| 171 |
+
|
| 172 |
+
<table><tr><td>Model Size (depth x width)</td><td>FPR95 √</td><td>AUROC 个</td></tr><tr><td>50x1</td><td>56.91</td><td>84.17</td></tr><tr><td>101x1</td><td>55.84</td><td>84.63</td></tr><tr><td>50x3</td><td>61.74</td><td>81.89</td></tr><tr><td>152x2</td><td>61.76</td><td>81.33</td></tr><tr><td>101x3</td><td>66.20</td><td>78.89</td></tr></table>
|
| 173 |
+
|
| 174 |
+
Table 4: OOD detection performance as the model capacity increases.
|
| 175 |
+
|
| 176 |
+
(ResNetv2-101x1), while further increasing model capacity will degrade the performance. Our experiments suggest that overparameterization can make gradients less distinguishable between ID and OOD data and that GradNorm is more suitable under a mild model capacity.
|
| 177 |
+
|
| 178 |
+
# 5 Analysis of Gradient-based Method
|
| 179 |
+
|
| 180 |
+
In this section, we analyze the best variant of GradNorm, $L _ { 1 }$ -norm of the last layer gradients (see Section $\boxed { 4 . 2 }$ , and provide insights on the mathematical interpretations. Specifically, we denote the last FC layer in a neural network by:
|
| 181 |
+
|
| 182 |
+
$$
|
| 183 |
+
f ( \mathbf { x } ) = \mathbf { W } ^ { \top } \mathbf { x } + \mathbf { b } ,
|
| 184 |
+
$$
|
| 185 |
+
|
| 186 |
+
where $f = [ f _ { 1 } , f _ { 2 } , \ldots , f _ { C } ] ^ { \top } \in \mathbb { R } ^ { C }$ is the logit output, $\mathbf { x } = [ x _ { 1 } , x _ { 2 } , \ldots , x _ { m } ] ^ { \top } \in \mathbb { R } ^ { m }$ is the input feature vector, $\mathbf { W } \in \mathbb { R } ^ { m \times C }$ is the weight matrix, and $\mathbf { b } \in \mathbb { R } ^ { C }$ is the bias vector.
|
| 187 |
+
|
| 188 |
+

|
| 189 |
+
Figure 7: We show the distributions of the two summations decomposed from the $L _ { 1 }$ -norm of the last layer gradient, for both in-distribution data (blue) and out-of-distribution data (gray).
|
| 190 |
+
|
| 191 |
+
GradNorm captures joint information between feature and output First we can rewrite the KL divergence between the softmax prediction and the uniform target as:
|
| 192 |
+
|
| 193 |
+
$$
|
| 194 |
+
\begin{array} { r l } { \displaystyle D _ { \mathrm { K L } } ( \mathbf { u } \| \mathrm { s o f t m a x } ( f ( \mathbf { x } ) ) ) = - \frac { 1 } { C } \sum _ { c = 1 } ^ { C } \log \frac { e ^ { f _ { c } / T } } { \sum _ { j = 1 } ^ { C } e ^ { f _ { j } / T } } - H ( \mathbf { u } ) } & { } \\ { \displaystyle } & { = - \frac { 1 } { C } \left( \frac { 1 } { T } \sum _ { c = 1 } ^ { C } f _ { c } - C \cdot \log \sum _ { j = 1 } ^ { C } e ^ { f _ { j } / T } \right) - H ( \mathbf { u } ) . } \end{array}
|
| 195 |
+
$$
|
| 196 |
+
|
| 197 |
+
Then we consider the derivative of $D _ { \mathrm { K L } }$ w.r.t. each output logit $f _ { c }$ :
|
| 198 |
+
|
| 199 |
+
$$
|
| 200 |
+
\begin{array} { l } { \displaystyle \frac { \partial D _ { \mathrm { K L } } } { \partial f _ { c } } = - \frac { 1 } { C T } \left( 1 - C T \cdot \frac { \partial \left( \log { \sum _ { j = 1 } ^ { C } e ^ { f _ { j } / T } } \right) } { \partial f _ { c } } \right) } \\ { \displaystyle = - \frac { 1 } { C T } \left( 1 - C \cdot \frac { e ^ { f _ { c } / T } } { \sum _ { j = 1 } ^ { C } e ^ { f _ { j } / T } } \right) . } \end{array}
|
| 201 |
+
$$
|
| 202 |
+
|
| 203 |
+
Next the derivative of $D _ { \mathrm { K L } } w . r . t .$ the weight matrix can be written as:
|
| 204 |
+
|
| 205 |
+
$$
|
| 206 |
+
\frac { \partial D _ { \mathrm { K L } } } { \partial \mathbf { W } } = \mathbf { x } \frac { \partial D _ { \mathrm { K L } } } { \partial f } = - \frac { 1 } { C T } \cdot [ x _ { 1 } , x _ { 2 } , \dots , x _ { m } ] ^ { \top } [ 1 - C \cdot \frac { e ^ { f _ { 1 } / T } } { \sum _ { j = 1 } ^ { C } e ^ { f _ { j } / T } } , \\\\\dots , 1 - C \cdot \frac { e ^ { f _ { C } / T } } { \sum _ { j = 1 } ^ { C } e ^ { f _ { j } / T } } ] .
|
| 207 |
+
$$
|
| 208 |
+
|
| 209 |
+
Finally, the $L _ { 1 }$ -norm of gradients of the weight matrix is simply the sum of absolute values of all elements in the gradient matrix:
|
| 210 |
+
|
| 211 |
+
$$
|
| 212 |
+
\begin{array} { r l } & { S ( \mathbf { x } ) = \displaystyle \sum _ { i = 1 } ^ { m } \sum _ { j = 1 } ^ { C } \left| \left( \frac { \partial D _ { \mathrm { K L } } } { \partial \mathbf { W } } \right) _ { i j } \right| = \displaystyle \frac { 1 } { C T } \sum _ { i = 1 } ^ { m } \left( | x _ { i } | \left( \sum _ { j = 1 } ^ { C } \left| 1 - C \cdot \frac { e ^ { f _ { j } / T } } { \sum _ { j = 1 } ^ { C } e ^ { f _ { j } / T } } \right| \right) \right) } \\ & { \quad \quad = \displaystyle \frac { 1 } { C T } \left( \sum _ { i = 1 } ^ { m } | x _ { i } | \right) \left( \sum _ { j = 1 } ^ { C } \left| 1 - C \cdot \frac { e ^ { f _ { j } / T } } { \sum _ { j = 1 } ^ { C } e ^ { f _ { j } / T } } \right| \right) } \\ & { \quad \quad \triangleq \frac { 1 } { C T } U \cdot V , } \end{array}
|
| 213 |
+
$$
|
| 214 |
+
|
| 215 |
+
where the fisecond term multiplicative term characterizes inform $\begin{array} { r } { U = \sum _ { i = 1 } ^ { m } | x _ { i } | } \end{array}$ is the put sp $L _ { 1 }$ -norm of the feature vector $\mathbf { x }$ , and the $V$
|
| 216 |
+
|
| 217 |
+
Ablation on $U$ and $V$ In Figure $^ { 7 }$ we plot distribution densities of $U$ and $V$ , for both ID and OOD data. It is important to note that $U$ and $V$ measure statistical distributions in the feature space and the output space, respectively. Therefore, GradNorm captures the joint information between the feature and the output space. The multiplication of both $U$ and $V$ results in an overall stronger separability between ID and OOD, as seen in Figure $2 \mathrm { a } .$ We report the OOD detection performance using $U$ and $V$ individually as scoring functions in Table 5, both of which are less competitive than GradNorm.
|
| 218 |
+
|
| 219 |
+
<table><tr><td rowspan="3">Method</td><td colspan="2">iNaturalist</td><td colspan="2">SUN</td><td colspan="2">Places</td><td colspan="2">Textures</td><td colspan="2">Average</td></tr><tr><td>FPR95 √</td><td>AUROC →</td><td>FPR95 ←</td><td>AUROC →</td><td>FPR95 ←</td><td>AUROC →</td><td>FPR95 ↓</td><td>AUROC →</td><td>FPR95 √</td><td>AUROC 个</td></tr><tr><td>U (feature space)</td><td>77.84</td><td>74.33</td><td>61.90</td><td>78.74</td><td>76.42</td><td>72.75</td><td>67.84</td><td>72.77</td><td>71.00</td><td>74.65</td></tr><tr><td>V (output space)</td><td>66.14</td><td>88.45</td><td>69.49</td><td>83.13</td><td>75.95</td><td>78.98</td><td>81.13</td><td>76.06</td><td>73.18</td><td>81.66</td></tr><tr><td>U · V (joint space)</td><td>50.05</td><td>90.33</td><td>46.48</td><td>89.03</td><td>60.86</td><td>84.82</td><td>61.42</td><td>81.07</td><td>54.70</td><td>86.31</td></tr></table>
|
| 220 |
+
|
| 221 |
+
Table 5: OOD detection performance using the decomposed $U$ (feature space) and $V$ (output space) as scoring functions. Model is ResNetv2-101 trained on ImageNet-1k [7].
|
| 222 |
+
|
| 223 |
+
# 6 Discussion
|
| 224 |
+
|
| 225 |
+
To the best of our knowledge, there is very limited prior work studying how to use gradients for OOD detection. In this section, we discuss connections and differences between GradNorm and previous OOD detection approaches that utilize gradient information, in particular ODIN (Section $\mathbf { \bar { 6 . 1 } }$ and Lee and AlRegib’s approach (Section $\check { \boxed { 6 . 2 } }$ .
|
| 226 |
+
|
| 227 |
+
# 6.1 Comparison with ODIN
|
| 228 |
+
|
| 229 |
+
Our work is inspired by ODIN [27], which first explored using gradient information for OOD detection. In particular, ODIN proposed using input pre-processing by adding small perturbations obtained from the input gradients. The goal of ODIN perturbations is to increase the softmax score of any given input by reinforcing the model’s belief in the predicted label. Ultimately the perturbations have been found to create a greater gap between the softmax scores of ID and OOD inputs, thus making them more separable and improving the performance of OOD detection.
|
| 230 |
+
|
| 231 |
+
It is important to note that ODIN only uses gradients implicitly through input perturbation, and OOD scores are still derived from the output space of the perturbed inputs. Different from ODIN, GradNorm utilizes information solely obtained from the gradient space. The effectiveness of GradNorm beckons a revisiting of combining information obtainable from the gradient space and the output space, which could provide a stronger method. We leave this question for future exploration.
|
| 232 |
+
|
| 233 |
+
# 6.2 Comparison with Lee and AlRegib
|
| 234 |
+
|
| 235 |
+
Lee and AlRegib [25] proposed to train an auxiliary binary classifier using gradient information from ID and OOD data. Importantly, they do not directly use gradient norms for OOD detection, but instead, use them as the input for training a separate binary classifier. Furthermore, the binary classifier is trained on the OOD datasets, which can unfairly overfit the test data and does not suit OOD-agnostic settings in the real world. In contrast, our methodology mitigates the shortcomings in that GradNorm (1) does not require any new model training, (2) is hyperparameter-free, and (3) is suitable for OOD-agnostic settings. For these reasons, these two methods are not directly comparable. However, for completeness, we also reproduce Lee and AlRegib’s method using random noise as a surrogate of OOD data and compare it with GradNorm in Appendix E. GradNorm outperforms their approach by $1 5 . 4 5 \%$ in FPR95 in this fair comparison.
|
| 236 |
+
|
| 237 |
+
Moreover, we provide comprehensive ablation studies and analyses on different design choices in using gradient-based methods for OOD detection (network architectures, gradients at different layers, loss functions for backpropagation, different $L _ { p }$ -norms, diverse evaluation datasets, and different temperatures, etc.), which were previously not studied in $\mathbb { \left. \overline { { 2 5 } } \right. }$ . In particular, Lee and AlRegib utilize $L _ { 2 }$ -norm gradients without comparing them with other norms. Our ablation study leads to the new finding that $L _ { 1 }$ -norm works best among all variants with GradNorm, and outperforms $L _ { 2 }$ -norm by up to $2 2 . 3 1 \%$ in FPR95. Furthermore, Lee and AlRegib utilize gradients from all layers to train a separate binary classifier, which can cause the computational cost to become intractable for deeper and larger models. In contrast, with GradNorm we show that the last layer gradient will always yield the best performance among all gradient set selections. Consequently, GradNorm incurs negligible computational cost. We believe such thorough understandings will be valuable for the field.
|
| 238 |
+
|
| 239 |
+
# 7 Related Work
|
| 240 |
+
|
| 241 |
+
OOD uncertainty estimation with discriminative models The problem of classification with rejection can date back to early works on abstention [3, 9], which considered simple model families such as SVMs [6]. A comprehensive survey on OOD detection can be found in [49]. We highlight representative works for post hoc detection. The phenomenon of neural networks’ overconfidence to OOD data is revealed by Nguyen et al. [34]. Early works attempted to improve the OOD uncertainty estimation by proposing the ODIN score [27], OpenMax [1], and Mahalanobis distance [26]. Recent work by $\boxed { \mathrm { L i u ~ e t ~ a l . } } \boxed { \mathbb { Z } 9 }$ proposed using an energy score for OOD uncertainty estimation, which can be easily derived from a discriminative classifier and demonstrated advantages over the softmax confidence score both empirically and theoretically. $\boxed { \mathrm { W a n g ~ e t ~ a l . } \boxed { \| 4 4 \| } }$ further showed an energy-based approach can improve OOD uncertainty estimation for multi-label classification networks. Huang and Li $\mathbb { \lVert 1 6 \rVert }$ revealed that approaches developed for common CIFAR benchmarks might not translate effectively into a large-scale ImageNet benchmark, highlighting the need to evaluate OOD uncertainty estimation in a large-scale real-world setting. Existing approaches derive OOD scores from either output or feature space. In contrast, we show that gradient space carries surprisingly useful information for OOD uncertainty estimation, which was underexplored in the literature.
|
| 242 |
+
|
| 243 |
+
OOD uncertainty estimation with generative models Alternative approaches for detecting OOD inputs resort to generative models that directly estimate density [8, 17, 18, 35, 38, 42]. An input is deemed as OOD if it lies in the low-likelihood regions. A plethora of literature has emerged to utilize generative models for OOD detection [19, 37, 39, 40, 45, 46, 48]. Interestingly, Nalisnick et al. [32] showed that deep generative models can assign a high likelihood to OOD data. Moreover, generative models can be prohibitively challenging to train and optimize, and the performance can often lag behind the discriminative counterpart. In contrast, our method relies on a discriminative classifier, which is easier to optimize and achieves stronger performance.
|
| 244 |
+
|
| 245 |
+
Distributional shifts Distributional shifts have attracted increasing research interests $\left[ \left[ 2 0 \right] \right]$ . It is important to recognize and differentiate various types of distributional shift problems. Literature in OOD detection is commonly concerned about model reliability and detection of label-space shifts [13, 27, 29], where the OOD inputs have disjoint labels w.r.t. ID data and therefore should not be predicted by the model. Meanwhile, some works considered covariate shifts in the input space [30, 36], where inputs can be corruption-shifted or domain-shifted [14]. However, covariate shifts are commonly used to evaluate model robustness $\mathbb { \lVert 1 2 \rVert }$ and domain generalization performance $\lVert 5 2 \rVert$ , where the label space $\mathcal { V }$ remains the same during test time. It is important to note that our work focuses on the detection of shifts where the model should not make any prediction, instead of covariate shifts where the model is expected to generalize.
|
| 246 |
+
|
| 247 |
+
# 8 Conclusion
|
| 248 |
+
|
| 249 |
+
In this paper, we propose GradNorm, a novel OOD uncertainty estimation approach utilizing information extracted from the gradient space. Experimental results show that our gradient-based method can improve the performance of OOD detection by up to $1 6 . 3 3 \%$ in FPR95, establishing superior performance. Extensive ablations provide further understandings of our approach. We hope that our research brings to light the informativeness of gradient space, and inspires future work to utilize gradient space for OOD uncertainty estimation.
|
| 250 |
+
|
| 251 |
+
# 9 Societal Impact
|
| 252 |
+
|
| 253 |
+
Our project aims to improve the reliability and safety of modern machine learning models. This stands to benefit a wide range of fields and societal activities. We believe out-of-distribution uncertainty estimation is an increasingly critical component of systems that range from consumer and business applications (e.g., digital content understanding) to transportation (e.g., driver assistance systems and autonomous vehicles), and to health care (e.g., unseen disease identification). Through this work and by releasing our code, we hope to provide machine learning researchers with a new methodological perspective and offer machine learning practitioners an easy-to-use tool that renders safety against OOD data in the real world. While we do not anticipate any negative consequences to our work, we hope to continue to build on our framework in future work.
|
| 254 |
+
|
| 255 |
+
# Acknowledgement
|
| 256 |
+
|
| 257 |
+
Research is supported by the Office of the Vice Chancellor for Research and Graduate Education (OVCRGE) with funding from the Wisconsin Alumni Research Foundation (WARF).
|
| 258 |
+
|
| 259 |
+
References
|
| 260 |
+
[1] Abhijit Bendale and Terrance E Boult. Towards open set deep networks. In CVPR, 2016.
|
| 261 |
+
[2] Jiefeng Chen, Yixuan Li, Xi Wu, Yingyu Liang, and Somesh Jha. Atom: Robustifying out-ofdistribution detection using outlier mining. In Proceedings of European Conference on Machine Learning and Principles and Practice of Knowledge Discovery in Databases (ECML PKDD), 2021.
|
| 262 |
+
[3] CK Chow. On optimum recognition error and reject tradeoff. IEEE Transactions on information theory, 16(1):41–46, 1970.
|
| 263 |
+
[4] M. Cimpoi, S. Maji, I. Kokkinos, S. Mohamed, , and A. Vedaldi. Describing textures in the wild. In Proceedings of the IEEE Conf. on Computer Vision and Pattern Recognition (CVPR), 2014.
|
| 264 |
+
[5] Mircea Cimpoi, Subhransu Maji, Iasonas Kokkinos, Sammy Mohamed, and Andrea Vedaldi. Describing textures in the wild. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 3606–3613, 2014.
|
| 265 |
+
[6] Corinna Cortes and Vladimir Vapnik. Support-vector networks. Machine learning, 20(3): 273–297, 1995.
|
| 266 |
+
[7] Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A largescale hierarchical image database. In 2009 IEEE conference on computer vision and pattern recognition, pages 248–255. Ieee, 2009.
|
| 267 |
+
[8] Laurent Dinh, Jascha Sohl-Dickstein, and Samy Bengio. Density estimation using real NVP. In 5th International Conference on Learning Representations, ICLR 2017, 2017.
|
| 268 |
+
[9] Giorgio Fumera and Fabio Roli. Support vector machines with embedded reject option. In International Workshop on Support Vector Machines, pages 68–82. Springer, 2002.
|
| 269 |
+
[10] Ian J. Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. In International Conference on Learning Representations, ICLR 2015, 2015.
|
| 270 |
+
[11] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Identity mappings in deep residual networks. In European conference on computer vision, pages 630–645. Springer, 2016.
|
| 271 |
+
[12] Dan Hendrycks and Thomas Dietterich. Benchmarking neural network robustness to common corruptions and perturbations. arXiv preprint arXiv:1903.12261, 2019.
|
| 272 |
+
[13] Dan Hendrycks and Kevin Gimpel. A baseline for detecting misclassified and out-of-distribution examples in neural networks. In 5th International Conference on Learning Representations, ICLR 2017, 2017.
|
| 273 |
+
[14] Yen-Chang Hsu, Yilin Shen, Hongxia Jin, and Zsolt Kira. Generalized odin: Detecting outof-distribution image without learning from out-of-distribution data. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 10951–10960, 2020.
|
| 274 |
+
[15] 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, pages 4700–4708, 2017.
|
| 275 |
+
[16] Rui Huang and Yixuan Li. Towards scaling out-of-distribution detection for large semantic space. Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, 2021.
|
| 276 |
+
[17] Xun Huang, Yixuan Li, Omid Poursaeed, John E Hopcroft, and Serge J Belongie. Stacked generative adversarial networks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, volume 2, page 3, 2017.
|
| 277 |
+
[18] Diederik P. Kingma and Max Welling. Auto-encoding variational bayes. In Yoshua Bengio and Yann LeCun, editors, 2nd International Conference on Learning Representations, ICLR 2014, 2014.
|
| 278 |
+
|
| 279 |
+
[19] Polina Kirichenko, Pavel Izmailov, and Andrew G Wilson. Why normalizing flows fail to detect out-of-distribution data. Advances in Neural Information Processing Systems, 33, 2020.
|
| 280 |
+
|
| 281 |
+
[20] Pang Wei Koh, Shiori Sagawa, Sang Michael Xie, Marvin Zhang, Akshay Balsubramani, Weihua Hu, Michihiro Yasunaga, Richard Lanas Phillips, Irena Gao, Tony Lee, et al. Wilds: A benchmark of in-the-wild distribution shifts. In International Conference on Machine Learning, pages 5637–5664. PMLR, 2021.
|
| 282 |
+
|
| 283 |
+
[21] Alexander Kolesnikov, Lucas Beyer, Xiaohua Zhai, Joan Puigcerver, Jessica Yung, Sylvain Gelly, and Neil Houlsby. Big transfer (bit): General visual representation learning. In ECCV 2020, 2020.
|
| 284 |
+
|
| 285 |
+
[22] Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny images. 2009.
|
| 286 |
+
|
| 287 |
+
[23] Solomon Kullback and Richard A Leibler. On information and sufficiency. The annals of mathematical statistics, 22(1):79–86, 1951.
|
| 288 |
+
|
| 289 |
+
[24] Balaji Lakshminarayanan, Alexander Pritzel, and Charles Blundell. Simple and scalable predictive uncertainty estimation using deep ensembles. In Advances in neural information processing systems, pages 6402–6413, 2017.
|
| 290 |
+
|
| 291 |
+
[25] Jinsol Lee and Ghassan AlRegib. Gradients as a measure of uncertainty in neural networks. In 2020 IEEE International Conference on Image Processing (ICIP), pages 2416–2420. IEEE, 2020.
|
| 292 |
+
|
| 293 |
+
[26] Kimin Lee, Kibok Lee, Honglak Lee, and Jinwoo Shin. A simple unified framework for detecting out-of-distribution samples and adversarial attacks. In Advances in Neural Information Processing Systems, pages 7167–7177, 2018.
|
| 294 |
+
|
| 295 |
+
[27] Shiyu Liang, Yixuan Li, and Rayadurgam Srikant. Enhancing the reliability of out-ofdistribution image detection in neural networks. In 6th International Conference on Learning Representations, ICLR 2018, 2018.
|
| 296 |
+
|
| 297 |
+
[28] Ziqian Lin, Sreya Dutta Roy, and Yixuan Li. Mood: Multi-level out-of-distribution detection. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, 2021.
|
| 298 |
+
|
| 299 |
+
[29] Weitang Liu, Xiaoyun Wang, John Owens, and Yixuan Li. Energy-based out-of-distribution detection. Advances in Neural Information Processing Systems, 2020.
|
| 300 |
+
|
| 301 |
+
[30] Andrey Malinin, Neil Band, German Chesnokov, Yarin Gal, Mark JF Gales, Alexey Noskov, Andrey Ploskonosov, Liudmila Prokhorenkova, Ivan Provilkov, Vatsal Raina, et al. Shifts: A dataset of real distributional shift across multiple large-scale tasks. arXiv preprint arXiv:2107.07455, 2021.
|
| 302 |
+
|
| 303 |
+
[31] Sina Mohseni, Mandar Pitale, JBS Yadawa, and Zhangyang Wang. Self-supervised learning for generalizable out-of-distribution detection. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pages 5216–5223, 2020.
|
| 304 |
+
|
| 305 |
+
[32] Eric Nalisnick, Akihiro Matsukawa, Yee Whye Teh, Dilan Gorur, and Balaji Lakshminarayanan. Do deep generative models know what they don’t know? In International Conference on Learning Representations, 2018.
|
| 306 |
+
|
| 307 |
+
[33] Yuval Netzer, Tao Wang, Adam Coates, Alessandro Bissacco, Bo Wu, and Andrew Y Ng. Reading digits in natural images with unsupervised feature learning. 2011.
|
| 308 |
+
|
| 309 |
+
[34] Anh Nguyen, Jason Yosinski, and Jeff Clune. Deep neural networks are easily fooled: High confidence predictions for unrecognizable images. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 427–436, 2015.
|
| 310 |
+
|
| 311 |
+
[35] Aäron van den Oord, Nal Kalchbrenner, Oriol Vinyals, Lasse Espeholt, Alex Graves, and Koray Kavukcuoglu. Conditional image generation with pixelcnn decoders. In Proceedings of the 30th International Conference on Neural Information Processing Systems, pages 4797–4805, 2016.
|
| 312 |
+
|
| 313 |
+
[37] Jie Ren, Peter J Liu, Emily Fertig, Jasper Snoek, Ryan Poplin, Mark Depristo, Joshua Dillon, and Balaji Lakshminarayanan. Likelihood ratios for out-of-distribution detection. In Advances in Neural Information Processing Systems, pages 14680–14691, 2019.
|
| 314 |
+
|
| 315 |
+
[38] Danilo Jimenez Rezende, Shakir Mohamed, and Daan Wierstra. Stochastic backpropagation and approximate inference in deep generative models. In International conference on machine learning, pages 1278–1286. PMLR, 2014.
|
| 316 |
+
|
| 317 |
+
[39] Robin Tibor Schirrmeister, Yuxuan Zhou, Tonio Ball, and Dan Zhang. Understanding anomaly detection with deep invertible networks through hierarchies of distributions and features. arXiv preprint arXiv:2006.10848, 2020.
|
| 318 |
+
|
| 319 |
+
[40] Joan Serrà, David Álvarez, Vicenç Gómez, Olga Slizovskaia, José F. Núñez, and Jordi Luque. Input complexity and out-of-distribution detection with likelihood-based generative models. In International Conference on Learning Representations, 2020.
|
| 320 |
+
|
| 321 |
+
[41] Yiyou Sun, Chuan Guo, and Yixuan Li. React: Out-of-distribution detection with rectified activations. In Advances in Neural Information Processing Systems, 2021.
|
| 322 |
+
|
| 323 |
+
[42] Esteban G Tabak and Cristina V Turner. A family of nonparametric density estimation algorithms. Communications on Pure and Applied Mathematics, 66(2):145–164, 2013.
|
| 324 |
+
|
| 325 |
+
[43] Grant Van Horn, Oisin Mac Aodha, Yang Song, Yin Cui, Chen Sun, Alex Shepard, Hartwig Adam, Pietro Perona, and Serge Belongie. The inaturalist species classification and detection dataset. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 8769–8778, 2018.
|
| 326 |
+
|
| 327 |
+
[44] Haoran Wang, Weitang Liu, Alex Bocchieri, and Yixuan Li. Can multi-label classification networks know what they don’t know? Advances in Neural Information Processing Systems, 2021.
|
| 328 |
+
|
| 329 |
+
[45] Ziyu Wang, Bin Dai, David Wipf, and Jun Zhu. Further analysis of outlier detection with deep generative models. Advances in Neural Information Processing Systems, 33, 2020.
|
| 330 |
+
|
| 331 |
+
[46] Jim Winkens, Rudy Bunel, Abhijit Guha Roy, Robert Stanforth, Vivek Natarajan, Joseph R Ledsam, Patricia MacWilliams, Pushmeet Kohli, Alan Karthikesalingam, Simon Kohl, et al. Contrastive training for improved out-of-distribution detection. arXiv preprint arXiv:2007.05566, 2020.
|
| 332 |
+
|
| 333 |
+
[47] Jianxiong Xiao, James Hays, Krista A Ehinger, Aude Oliva, and Antonio Torralba. Sun database: Large-scale scene recognition from abbey to zoo. In 2010 IEEE computer society conference on computer vision and pattern recognition, pages 3485–3492. IEEE, 2010.
|
| 334 |
+
|
| 335 |
+
[48] Zhisheng Xiao, Qing Yan, and Yali Amit. Likelihood regret: An out-of-distribution detection score for variational auto-encoder. Advances in Neural Information Processing Systems, 33, 2020.
|
| 336 |
+
|
| 337 |
+
[49] Jingkang Yang, Kaiyang Zhou, Yixuan Li, and Ziwei Liu. Generalized out-of-distribution detection: A survey. arXiv preprint arXiv:2110.11334, 2021.
|
| 338 |
+
|
| 339 |
+
[50] 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.
|
| 340 |
+
|
| 341 |
+
[51] Bolei Zhou, Agata Lapedriza, Aditya Khosla, Aude Oliva, and Antonio Torralba. Places: A 10 million image database for scene recognition. IEEE transactions on pattern analysis and machine intelligence, 40(6):1452–1464, 2017.
|
| 342 |
+
|
| 343 |
+
[52] Kaiyang Zhou, Ziwei Liu, Yu Qiao, Tao Xiang, and Chen Change Loy. Domain generalization: A survey. arXiv preprint arXiv:2103.02503, 2021.
|
md/train/h3qQzodaAq7/h3qQzodaAq7.md
ADDED
|
@@ -0,0 +1,214 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Alpha-IoU: A Family of Power Intersection over Union Losses for Bounding Box Regression
|
| 2 |
+
|
| 3 |
+
Jiabo $\mathbf { H e } ^ { 1 , 3 , * }$ , Sarah Erfani1, Xingjun $\mathbf { M } \mathbf { a } ^ { 2 , \dagger }$ , James Bailey1, Ying $\mathbf { C } \mathbf { h } \mathbf { i } ^ { 3 , \dagger }$ , Xian-Sheng $\mathbf { H } \mathbf { u } \mathbf { a } ^ { 3 }$
|
| 4 |
+
|
| 5 |
+
1School of Computing and Information Systems, The University of Melbourne 2School of Computer Science, Fudan University 3DAMO Academy, Alibaba Group {jiaboh@student., sarah.erfani@, baileyj@}unimelb.edu.au
|
| 6 |
+
danxjma@gmail.com, {xinyi.cy, xiansheng.hxs}@alibaba-inc.com
|
| 7 |
+
|
| 8 |
+
# Abstract
|
| 9 |
+
|
| 10 |
+
Bounding box (bbox) regression is a fundamental task in computer vision. So far, the most commonly used loss functions for bbox regression are the Intersection over Union (IoU) loss and its variants. In this paper, we generalize existing IoUbased losses to a new family of power IoU losses that have a power IoU term and an additional power regularization term with a single power parameter $\alpha$ We call this new family of losses the $\alpha$ -IoU losses and analyze properties such as order preservingness and loss/gradient reweighting. Experiments on multiple object detection benchmarks and models demonstrate that $\alpha$ -IoU losses, 1) can surpass existing IoU-based losses by a noticeable performance margin; 2) offer detectors more flexibility in achieving different levels of bbox regression accuracy by modulating $\alpha$ ; and 3) are more robust to small datasets and noisy bboxes.
|
| 11 |
+
|
| 12 |
+
# 1 Introduction
|
| 13 |
+
|
| 14 |
+
Bounding box (bbox) regression localizes an object in an image/video by predicting a bbox for the object, which is fundamental to object detection, localization, and tracking. For example, the most advanced object detectors often consist of a bbox regression branch and a classification branch with the bbox regression branch generating bboxes to localize objects for classification. In this work, we explore more effective loss functions for bbox regression in the context of object detection.
|
| 15 |
+
|
| 16 |
+
Whilst early works in object detection use $\ell _ { n }$ -norm losses [11] for bbox regression, recent works directly adopt the localization performance metric, i.e., Intersection over Union (IoU), as the localization loss [28, 39]. Compared with $\ell _ { n }$ -norm losses, the IoU loss is invariant to bbox scales, thus helping train better detectors. However, the IoU loss suffers from the gradient vanishing problem when the predicted bboxes are not overlapping with the ground truth, which tends to slow down convergence and result in inaccurate detectors. This has motivated the design of several improved IoU-based losses including Generalized IoU (GIoU), Distance-IoU (DIoU) and Complete IoU (CIoU). GIoU introduces a penalty term into the IoU loss to alleviate the gradient vanishing problem [32], while DIoU and CIoU consider the central point distance and aspect ratio between predicted bboxes and their ground truth in penalty terms [43].
|
| 17 |
+
|
| 18 |
+
In this paper, we present a new family of IoU losses obtained by applying power transformations to existing IoU-based losses. We first apply the Box-Cox transformation [2] to the IoU loss $\mathcal { L } _ { \mathrm { I o U } } =$ $1 - I o U$ and generalize it to a power IoU loss: $\mathcal { L } _ { \alpha \mathrm { - I o U } } = ( 1 - I o U ^ { \alpha } ) / \alpha , ~ \alpha > 0$ , denoted as $\alpha$ -IoU. We further simplify $\alpha$ -IoU to $\mathcal { L } _ { \alpha - \mathrm { I o U } } = 1 - I o U ^ { \alpha }$ for $\alpha \nrightarrow 0$ and extend it to a more general form with an additional power regularization term (see equation (3)). This allows us to generalize existing IoU-based losses, including GIoU, DIoU, and CIoU, to a new family of power IoU losses (see equation (4)) for more accurate bbox regression as well as object detection.
|
| 19 |
+
|
| 20 |
+
We show that, relative to ${ \mathcal { L } } _ { \mathrm { I o U } }$ , ${ \mathcal { L } } _ { \alpha - { \mathrm { I o U } } }$ with $\alpha > 1$ up-weights both the loss and gradient of high IoU objects, leading to improved bbox regression accuracy. When $0 < \alpha < 1$ , it down-weights high IoU objects which we find hurts regression accuracy. The power parameter $\alpha$ can serve as a knob to adapt $\alpha$ -IoU losses to meeting different levels of bbox regression accuracy (precision measured under different IoU thresholds), with $\alpha > 1$ for high regression accuracy (i.e., high IoU thresholds) by focusing more on those high IoU objects. We also empirically show that $\alpha$ is not overly sensitive to different models or datasets, with $\alpha = 3$ performing consistently well in most cases. The family of $\alpha$ -IoU losses can be easily applied for improving state-of-the-art detectors under both clean and noisy bbox settings without introducing additional parameters to these models (making any modifications to training algorithms), nor increasing their training/inference time.
|
| 21 |
+
|
| 22 |
+
In summary, our main contributions are as follows:
|
| 23 |
+
|
| 24 |
+
• We propose a new family of power IoU losses called $\alpha$ -IoU for accurate bbox regression and object detection. $\alpha$ -IoU presents a unified power generalization of existing IoU-based losses.
|
| 25 |
+
• We analyze a set of properties of $\alpha$ -IoU, including order preservingness and loss/gradient reweighting, to show that a proper choice of $\alpha$ (i.e., $\alpha > 1$ ) can help improve bbox regression accuracy by adaptively up-weighting the loss and gradient of high IoU objects.
|
| 26 |
+
• We empirically show, on multiple benchmark object detection datasets and models, that $\alpha$ -IoU losses can consistently outperform existing IoU-based losses and provide more robustness for small datasets and noisy bboxes.
|
| 27 |
+
|
| 28 |
+
# 2 Related Work
|
| 29 |
+
|
| 30 |
+
Object Detection Models. There exist two mainstream types of detection models: anchor-based and anchor-free detectors. Anchor-based detectors can be further divided into two-stage and onestage models. Two-stage anchor-based detectors (e.g., R-CNN series [11, 31, 14, 3], HTC [5], and TSD [33]) are firstly proposed in object detection tasks, which are composed of region proposal networks (RPNs) and classifiers. RPNs generate a large number of foreground and background region proposals, followed by networks to classify objects in the proposals. Towards real-time object detection, one-stage anchor-based detectors (e.g., YOLO series [29, 30, 1], RetinaNet [21], and SSD [24]) are developed to predict bboxes and categories at the same time, thus no longer need RPNs. Anchor boxes with prior scales and aspect ratios should be defined before training anchor-based detectors. Techniques have been proposed to mitigate the sensitivity of these models to hand-picked anchor boxes, for example, attention-based fusion networks [31] and clustering algorithms [30]. These techniques learn prior anchors from the training set for every sliding window or grid cell.
|
| 31 |
+
|
| 32 |
+
Recently, anchor-free detectors such as CornerNet [16], CenterNet1 [8], ExtremeNet [45], and CentripetalNet [7], have also been proposed to get rid of anchor priors. These models first predict locations of keypoints (corners, centroids, or extreme points), then group them into the same bboxes if they are geometrically aligned. There also exist other models that generate pixel-wise results. For example, CenterNet2 estimates pixel-level categories of objects along with their sizes and offsets [44]. FCOS generates pixel-wise classification, centerness, and bbox (top, down, left, right) results using multi-head CNNs [34], followed by the Adaptive Training Sample Selection (ATSS) [40] as an improvement on automatically selecting positive and negative samples. In addition, transformers (e.g., DETR series [4, 46]) have also been developed for object detection without anchor generation or non-maximum suppression (NMS), achieving the performance on par with the above CNN-based detectors. In this work, we propose a new family of generalized IoU losses to improve the performance of these detectors without any architectural modifications, which is orthogonal to the above research.
|
| 33 |
+
|
| 34 |
+
Bounding Box Regression Losses. Anchor-based detectors regress offsets between ground-truth bboxes and their closest anchors, while anchor-free detectors predict keypoints of objects with some frameworks also generating the sizes of the bboxes. The predicted offsets or keypoints (w/ or w/o bbox sizes) are then mapped back to the pixel space for generating the bboxes. Localization losses usually compare the generated bboxes with their ground truth. Early works adopt $\ell _ { n }$ -norm losses [11] for bbox regression, which have been found sensitive to varying bbox scales. Recent works replace them with the IoU loss and its variants such as BIoU, GIoU, DIoU and CIoU for bbox regression, as IoU is the metric for localization and it is scale-invariant [28, 39]. The Bounded IoU (BIoU) loss maximizes the IoU overlap between the region of interest (RoI) and the ground truth based on a set of IoU upper bounds [35]. GIoU is proposed to address the problem of gradient vanishing on non-overlapping examples, which are examples having non-overlapping predicted bboxes with the ground truth (IoU is zero) [32]. DIoU and CIoU [43] losses further consider the overlapping area, central point distance, and aspect ratio in IoU and the regularization terms. These regularization terms can help improve the convergence speed as well as the final detection performance. There are also losses designed to focus more on high IoU objects, for example, the Rectified IoU (RIoU) loss [36], and the Focal and Efficient IoU (Focal-EIoU) loss [41]. These loss functions increase gradients of those examples that are in high bbox regression accuracy. However, RIoU and Focal-EIoU are neither concise nor generalized compared with other IoU-based losses. In this paper, we apply a power transformation to generalize the above vanilla IoU loss and regularized IoU-based losses for both their IoU and regularization terms. The new family of generalized losses improve bbox regression accuracy by adaptively reweighting the loss and gradient of high and low IoU objects.
|
| 35 |
+
|
| 36 |
+
There are also works on AutoML-based loss function search for computer vision tasks [23, 18, 17]. Despite their advantage in saving human efforts, these methods are very expensive in searching qualified loss functions (e.g., days of searching time on multiple GPUs), and probably with limited performance improvement based on existing losses [23]. We will empirically compare with one of these losses in our experiments.
|
| 37 |
+
|
| 38 |
+
# 3 $\alpha$ -IoU Losses for Bounding Box Regression
|
| 39 |
+
|
| 40 |
+
# 3.1 Preliminaries
|
| 41 |
+
|
| 42 |
+
We study the problem of bbox regression in object detection. Let $\pmb { X } \in \mathbb { R } ^ { d _ { x } }$ be the input space and $\pmb { Y } \in \mathbb { R } ^ { \tilde { d } _ { y } }$ be the annotation space, with $d _ { x }$ and $d _ { y }$ denoting the input and annotation dimensions, respectively. Given a dataset $D = \{ ( { \bf x } _ { i } , { \bf y } _ { i } ) \} _ { i = 1 } ^ { n }$ of $n$ training examples with each $( { \pmb x } _ { i } , { \pmb y } _ { i } ) \in$ $( X \times Y )$ , the task is to learn a function $f$ (represented by a detector network) that maps the input space to the annotation space $f : X \to Y$ . In object detection, each $\pmb { y } _ { i } = ( c _ { i , k } , B _ { i , k } ) _ { k = 1 } ^ { m _ { i } }$ , where $m _ { i }$ is the total number of objects in $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { i } }$ , $c _ { i , k }$ is the category of the $k ^ { t h }$ object in $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { i } }$ and $B _ { i , k }$ is its bbox.
|
| 43 |
+
|
| 44 |
+
The bbox regression performance is measured by the Intersection over Union (IoU) metric between the predicted bbox $B$ and the ground truth $B ^ { g t }$ $\ d ^ { 3 } \ d ^ { g t } \colon \bar { I o U } = | B \cap B ^ { g t } | / | B \cup B ^ { g t } |$ . Positive examples (both true and false positives) are determined from the set of predictions according to an IoU threshold, based on which the Average Precision (AP) over all categories of objects can be calculated. E.g., $\mathrm { { A P } _ { 5 0 } }$ measures the AP of objects localized by bboxes with an IoU that is above the threshold 0.5. The final performance of a detector is commonly evaluated by the mean Average Precision (mAP) across multiple IoU thresholds. For instance, the popular metric $\mathrm { m A P _ { 5 0 : 9 5 } }$ measures the mAP of examples across the set of IoU thresholds ranging from 0.5 to 0.95 with a stride of 0.05.
|
| 45 |
+
|
| 46 |
+
# 3.2 $\alpha$ -IoU Losses
|
| 47 |
+
|
| 48 |
+
The vanilla IoU loss is defined as $\mathcal { L } _ { \mathrm { I o U } } = 1 - I o U .$ . We first apply the Box-Cox transformation3 [2] and generalize the IoU loss to an $\alpha$ -IoU loss:
|
| 49 |
+
|
| 50 |
+
$$
|
| 51 |
+
\mathcal { L } _ { \alpha \cdot \mathrm { I o U } } = \frac { 1 - I o U ^ { \alpha } } { \alpha } , \alpha > 0 .
|
| 52 |
+
$$
|
| 53 |
+
|
| 54 |
+
By modulating the parameter $\alpha$ in $\alpha$ -IoU, one can derive most of the IoU terms in existing losses, e.g., $\log ( I o U )$ , $I o U$ and $I o U ^ { 2 }$ . When $\alpha 0$ , we obtain $\begin{array} { r } { \operatorname* { l i m } _ { \alpha \to 0 } \mathcal { L } _ { \alpha \mathrm { { \cdot } I o U } } = - \mathrm { l o g } ( I o U ) = \mathcal { L } _ { \mathrm { l o g } ( \mathrm { I o U } ) } } \end{array}$ [39] (see the proof in Appendix A). We recover the IoU loss with $\alpha = 1$ : $\mathcal { L } _ { \mathrm { 1 - I o U } } = 1 - I o U = \mathcal { L } _ { \mathrm { I o U } }$ And $\mathcal { L } _ { \mathrm { 2 - I o U } } = \textstyle { \frac { 1 } { 2 } } ( 1 - I o \dot { U } ^ { 2 } ) = \textstyle { \frac { 1 } { 2 } } \mathcal { L } _ { \mathrm { I o U } ^ { 2 } }$ , when $\alpha = 2$ . We can also extend the above $\alpha$ -IoU formula to loss functions with multiple IoU terms (e.g. RIoU [36]) by using multiple $\alpha$ values.
|
| 55 |
+
|
| 56 |
+

|
| 57 |
+
Figure 1: Correlation between IoU and $\mathcal { L } _ { \alpha \mathrm { { - I o U } } } ~ = ~ 1 - ~ I o U ^ { \alpha }$ (left) and its absolute gradient $| \nabla _ { \mathrm { I o U } } \mathcal { L } _ { \alpha - \mathrm { I o U } } |$ (right) with different $\alpha ~ \in ~ [ 0 . 5 , 3 ]$ . According to both plots, ${ \mathcal { L } } _ { \alpha - { \mathrm { I o U } } }$ reweights all objects adaptively and distinctively for $0 < \alpha < 1$ vs. $\alpha > 1$ $\langle \alpha = 1$ marks the IoU loss).
|
| 58 |
+
|
| 59 |
+
We simplify the above $\alpha$ -IoU formula for $\alpha > 0$ and $\alpha \nrightarrow 0$ , as in this case, the denominator $\alpha$ in equation (1) is just a positive constant in the objective. This gives us two cases of the $\alpha$ -IoU loss for $\alpha 0$ and $\alpha \not 0$ , respectively:
|
| 60 |
+
|
| 61 |
+
$$
|
| 62 |
+
\mathcal { L } _ { \alpha \mathrm { - I o U } } = \left\{ { { - \mathrm { l o g } ( I o U ) , ~ \alpha \to 0 } , } \atop { 1 - I o U ^ { \alpha } , ~ \alpha \to 0 . } \right.
|
| 63 |
+
$$
|
| 64 |
+
|
| 65 |
+
Here, we are more interested in the case $\alpha \nrightarrow 0$ as most state-of-the-art IoU-based losses have an $\alpha \geq 1$ . We then extend the above $\alpha$ -IoU loss for $\alpha \not 0$ to a more general form by introducing a power penalty/regularization term into the formula:
|
| 66 |
+
|
| 67 |
+
$$
|
| 68 |
+
{ \mathcal { L } } _ { \alpha - \mathrm { I o U } } = 1 - I o U ^ { \alpha _ { 1 } } + { \mathcal { P } } ^ { \alpha _ { 2 } } ( B , B ^ { g t } ) ,
|
| 69 |
+
$$
|
| 70 |
+
|
| 71 |
+
where $\alpha _ { 1 } > 0$ , $\alpha _ { 2 } > 0$ , and $\mathcal { P } ^ { \alpha _ { 2 } } ( B , B ^ { g t } )$ denotes any penalty term computed based on $B$ and $B ^ { g t }$ . This simple extension allows a straightforward generalization of existing IoU-based losses to their $\alpha$ -IoU versions. In Appendix B.2.1, we empirically show that ${ \mathcal { L } } _ { \alpha - { \mathrm { I o U } } }$ is not sensitive to $\alpha _ { 2 }$ . We thus maintain the power consistency between the IoU term and the penalty term and take $\alpha _ { 1 } = \alpha _ { 2 }$ as a simple choice when training the detectors.
|
| 72 |
+
|
| 73 |
+
With the above $\alpha$ -IoU formula, we can now generalize the commonly used IoU-based losses including $\mathcal { L } _ { \mathrm { I o U } } , \mathcal { L } _ { \mathrm { G I o U } } , \mathcal { L } _ { \mathrm { D I o U } }$ , and ${ \mathcal { L } } _ { \mathrm { C I o U } }$ using the same power parameter $\alpha$ for the IoU and penalty terms:
|
| 74 |
+
|
| 75 |
+
$$
|
| 76 |
+
\begin{array} { r l r } & { } & { \mathcal { L } _ { \mathrm { I o U } } = 1 - I o U \Longrightarrow \mathcal { L } _ { \alpha \mathrm { \cdot I o U } } = 1 - I o U ^ { \alpha } , } \\ & { } & { \mathcal { L } _ { \mathrm { G I o U } } = 1 - I o U + \frac { \left| C \setminus ( B \cup B ^ { g t } ) \right| } { \left| C \right| } \Longrightarrow \mathcal { L } _ { \alpha \mathrm { \cdot G I o U } } = 1 - I o U ^ { \alpha } + ( \frac { \left| C \setminus ( B \cup B ^ { g t } ) \right| } { \left| C \right| } ) ^ { \alpha } , } \\ & { } & { \mathcal { L } _ { \mathrm { D I o U } } = 1 - I o U + \frac { \rho ^ { 2 } ( b , b ^ { g t } ) } { c ^ { 2 } } \Longrightarrow \mathcal { L } _ { \alpha \mathrm { \cdot D I o U } } = 1 - I o U ^ { \alpha } + \frac { \rho ^ { 2 \alpha } ( b , b ^ { g t } ) } { c ^ { 2 \alpha } } , \ ~ } \\ & { } & { \mathcal { L } _ { \mathrm { C I o U } } = 1 - I o U + \frac { \rho ^ { 2 } ( b , b ^ { g t } ) } { c ^ { 2 } } + \beta v \Longrightarrow \mathcal { L } _ { \alpha \mathrm { \cdot C I o U } } = 1 - I o U ^ { \alpha } + \frac { \rho ^ { 2 \alpha } ( b , b ^ { g t } ) } { c ^ { 2 \alpha } } + ( \beta v ) ^ { \alpha } , } \end{array}
|
| 77 |
+
$$
|
| 78 |
+
|
| 79 |
+
where $C$ in ${ \mathcal { L } } _ { \mathrm { G I o U } }$ denotes the smallest convex shape enclosing $B$ and $B ^ { g t }$ ; $^ { b }$ and $\mathbf { \delta } _ { b } \mathbf { \mathcal { I } ^ { t } }$ in ${ \mathcal { L } } _ { \mathrm { D I o U } }$ denote central points of $B$ and $B ^ { g t }$ with $\rho ( \cdot )$ being the Euclidean distance and $c$ being the diagonal length of the smallest enclosing box; and in ${ \mathcal { L } } _ { \mathrm { C I o U } }$ , $\begin{array} { r } { v = \frac { 4 } { \pi ^ { 2 } } ( a r c t a n \frac { w ^ { g t } } { h ^ { g t } } - a r c t a n \frac { w } { h } ) ^ { 2 } } \end{array}$ , $\begin{array} { r } { \beta = \frac { v } { ( 1 - I o U ) + v } } \end{array}$ . They give us the family of power IoU losses for bbox regression with their original versions recovered at $\alpha = 1$ . Note that the above $\alpha$ -IoU generalization can be easily extended to more complex loss functions that have multiple IoU or penalty terms (e.g., $\mathcal { L } _ { \alpha - \mathrm { C I o U } } )$ ). Next, we will analyze the properties of $\alpha$ -IoU losses when $\alpha$ takes different values.
|
| 80 |
+
|
| 81 |
+
# 3.3 Properties of $\alpha$ -IoU Losses
|
| 82 |
+
|
| 83 |
+
Here, we focus on the vanilla $\alpha$ -IoU formula $\mathcal { L } _ { \alpha - \mathrm { I o U } } = 1 - I o U ^ { \alpha }$ to analyze its properties, as the penalty terms may affect these properties differently. Figure 1 illustrates the correlation between IoU and ${ \mathcal { L } } _ { \alpha - { \mathrm { I o U } } }$ (left) and the magnitude of its gradient w.r.t. IoU, i.e., $| \nabla _ { \mathrm { I o U } } \mathcal { L } _ { \alpha - \mathrm { I o U } } |$ (right). One key observation is that the IoU loss (i.e., $\alpha = 1$ ) has a linear correlation with IoU and the gradient is a constant, while ${ \mathcal { L } } _ { \alpha - { \mathrm { I o U } } }$ reweights objects adaptively (according to their IoU values) following different reweighting schemes with $0 < \alpha < 1$ versus $\alpha > 1$ .
|
| 84 |
+
|
| 85 |
+
The power transformation in ${ \mathcal { L } } _ { \alpha - { \mathrm { I o U } } }$ preserves key properties of ${ \mathcal { L } } _ { \mathrm { I o U } }$ as a performance metric, including non-negativity, identity of indiscernibles, symmetry, and triangle inequality [32]. Furthermore, we analyze the following important properties of ${ \mathcal { L } } _ { \alpha - { \mathrm { I o U } } }$ with detailed derivations deferred to Appendix A. We first let $B _ { i }$ and $B _ { j }$ be two predicted bboxes by two different models $M _ { i }$ and $M _ { j }$ respectively, and $B _ { i }$ and $B _ { j }$ correspond to the same ground truth $B ^ { g t }$ with $I o U ( B _ { i } , B ^ { g t } ) < I o U ( \bar { B _ { j } } , B ^ { g t } )$ . Then we have the first property of ${ \mathcal { L } } _ { \alpha }$ -IoU:
|
| 86 |
+
|
| 87 |
+
Property 1 (Order Preservingness). ${ \mathcal { L } } _ { \alpha }$ -IoU preserves the orders of both IoU and $\mathcal { L } _ { I o U }$ : I ${ } ^ { \circ } o \bar { U } ( B _ { i } , B ^ { g t } ) \ < I o U ( B _ { j } , B ^ { g t } ) ^ { - } \iff \ \mathcal { L } _ { I o U } ( B _ { i } , B ^ { g t } ) > \ \mathcal { L } _ { I o U } ( B _ { j } , B ^ { g t } ) \iff \ \mathcal { L } _ { \alpha \cdot I o U } ( B _ { i } , B ^ { g t } ) >$ $\mathcal { L } _ { \alpha - I o U } ( B _ { j } , B ^ { g t } )$ .
|
| 88 |
+
|
| 89 |
+
The above property indicates that both ${ \mathcal { L } } _ { \alpha - { \mathrm { I o U } } }$ and ${ \mathcal { L } } _ { \mathrm { I o U } }$ are monotonically decreasing functions w.r.t. $I o U$ . As ${ \mathcal { L } } _ { \alpha - { \mathrm { I o U } } }$ preserves the order of ${ \mathcal { L } } _ { \mathrm { I o U } }$ strictly, it is guaranteed that arg $\mathrm { m i n } _ { B } \mathcal { L } _ { \alpha \mathrm { - I o U } } ( B , B ^ { g t } )$ is identical to arg $\operatorname* { m a x } _ { B } I o U ( B , B ^ { g t } )$ and arg $\mathrm { m i n } _ { B } \bar { \mathcal { L } } _ { \mathrm { I o U } } ( \bar { B , B ^ { g t } } )$ . In other words, the optimal solution arg $\operatorname* { m a x } _ { B } I o U ( B , \bar { B ^ { g t } } )$ can be obtained by minimizing either ${ \mathcal { L } } _ { \alpha - { \mathrm { I o U } } }$ or ${ \mathcal { L } } _ { \mathrm { I o U } }$ . Following this, the adaptive relative loss reweighting scheme of ${ \mathcal { L } } _ { \alpha - { \mathrm { I o U } } }$ can be characterized by the second property:
|
| 90 |
+
|
| 91 |
+
Property 2 (Relative Loss Reweighting). Compared with $\mathcal { L } _ { I o U }$ , $\mathcal { L } _ { \alpha - I o U }$ adaptively reweights the relative loss of all objects by $w _ { \mathcal { L } _ { r } } = \mathcal { L } _ { \alpha \cdot I o U } / \mathcal { L } _ { I o U } = 1 + ( I o U - I o U ^ { \alpha } ) / ( 1 - I o U )$ , with $w _ { \mathscr { L } _ { r } } ( I o U =$ $0 ) = 1$ , and $\begin{array} { r } { \operatorname* { l i m } _ { I o U \to 1 } w _ { \mathcal { L } _ { r } } = \alpha } \end{array}$ .
|
| 92 |
+
|
| 93 |
+
The second property indicates that ${ \mathcal { L } } _ { \alpha - { \mathrm { I o U } } }$ will adaptively down-weight and up-weight the relative loss of all objects according to their IoUs when $0 < \alpha < 1$ and $\alpha > 1$ , respectively. We further note that, when $\alpha > 1$ , the reweighting factor $w _ { \mathcal { L } _ { r } }$ increases monotonically with the increase of IoU $( w _ { \boldsymbol { L } _ { r } }$ grows from 1 to $\alpha$ ) while decreasing monotonically with the increase of IoU when $0 < \alpha < 1 ( w _ { \mathcal { L } _ { r } }$ decays from 1 to $\alpha$ ). We will empirically show that the up-weighting scheme of ${ \mathcal { L } } _ { \alpha - { \mathrm { I o U } } }$ with $\alpha > 1$ can help the model focus more on high IoU objects to improve both the localization (i.e., predict more high IoU objects) and detection (i.e., more accurate at high APs) performance4. Similarly, we can obtain the third property of adaptive relative gradient reweighting owned by ${ \mathcal { L } } _ { \alpha - { \mathrm { I o U } } }$ as follows:
|
| 94 |
+
|
| 95 |
+
Property 3 (Relative Gradient Reweighting). Compared with $\mathcal { L } _ { I o U ; }$ , $\mathcal { L } _ { \alpha - I o U }$ adaptively reweights the relative gradient of all objects by $\begin{array} { r } { w _ { \bar { \nabla } _ { r } } = \bar { | } \nabla _ { I o U } \mathcal { L } _ { \alpha - I o U } | / | \nabla _ { I o U } \mathcal { L } _ { I o U } | = \alpha I o U ^ { \bar { \alpha } - 1 } } \end{array}$ , with the turning point at $I o U = \alpha ^ { \frac { 1 } { 1 - \alpha } } \in ( 0 , \frac { 1 } { e } )$ when $0 < \alpha < 1$ and $I o U = \alpha ^ { \frac { 1 } { 1 - \alpha } } \in ( \textstyle { \frac { 1 } { e } } , 1 )$ when $\alpha > 1$ .
|
| 96 |
+
|
| 97 |
+
When $\alpha > 1$ , the above reweighting factor $w _ { \nabla _ { r } }$ increases monotonically with the increase of IoU, while decreasing monotonically with the increase of IoU when $0 \textless \alpha \textless 1$ . This relative gradient reweighting scheme is also adaptive to IoU, with the turning point from up-weighting to down-weighting at $\overline { { I o U } } = \alpha ^ { \frac { 1 } { 1 - \alpha } } \in ( 0 , \frac { 1 } { e } )$ when $0 \textless \alpha \textless 1$ , and from down-weighting to upweighting at $I o U = \alpha ^ { \frac { 1 } { 1 - \alpha } } \in ( \frac { 1 } { e } , 1 )$ when $\alpha > 1$ . The gradient reweighting scheme is bounded by $w _ { \nabla _ { r } } ( I o U = 1 ) = \alpha$ , i.e., $0 \leq w _ { \nabla _ { r } } \leq \alpha$ when $\alpha > 1$ , and $w _ { \nabla _ { r } } \geq \alpha$ when $0 < \alpha < 1$ . This relative gradient reweighting scheme allows the model to learn objects with adaptive speeds (i.e., different gradients) according to their IoUs. Theoretically, when $\alpha = 2$ , $| \nabla _ { \mathrm { I o U } } \mathcal { L } _ { \alpha - \mathrm { I o U } } | > | \overline { { \nabla } } _ { \mathrm { I o U } } \mathcal { L } _ { \mathrm { I o U } } |$ for $I o U \in ( 0 . 5 , 1 ]$ , which accelerates the learning of all positive IoU objects at $\mathrm { { A P } _ { 5 0 } }$ . However, we empirically show that $\alpha$ -IoU losses with $\alpha = 3$ perform more competitively than those with $\alpha = 2$ in most cases. It is probable that $\alpha \cdot$ -IoU losses with $\alpha = 3$ further up-weight the relative loss of objects with $I o U \in ( 0 . 5 , 1 ]$ , although $\alpha$ -IoU losses with $\alpha = 2$ also beat existing baselines (see Figure 6). This property is both data-agnostic and model-agnostic, so we recommend $\alpha = 3$ or $\alpha \in [ 2 , 3 ]$ in practical use for other datasets and models.
|
| 98 |
+
|
| 99 |
+
The above loss and gradient reweighting schemes can also be inferred from Figure 1, with detailed proofs in Appendix A. To summarize, ${ \mathcal { L } } _ { \alpha - { \mathrm { I o U } } }$ trains better detectors than ${ \mathcal { L } } _ { \mathrm { I o U } }$ for the following reasons. First, the same optimal IoU can be achieved by ${ \mathcal { L } } _ { \alpha - { \mathrm { I o U } } }$ as that by ${ \mathcal { L } } _ { \mathrm { I o U } }$ (Property 1). Second, ${ \mathcal { L } } _ { \alpha - { \mathrm { I o U } } }$ with $\alpha > 1$ focuses more on high IoU objects by up-weighting their relative loss (Property
|
| 100 |
+
|
| 101 |
+
2). Third, ${ \mathcal { L } } _ { \alpha - { \mathrm { I o U } } }$ with $\alpha > 1$ helps detectors learn faster on high IoU objects (here $I o U \in ( \alpha ^ { \frac { 1 } { 1 - \alpha } } , 1 ] )$ through up-weighting their relative gradient (Property 3). In Appendix A, we also provide an analysis of the absolute loss and gradient reweighting properties (Property 4 and 5), showing the additions of $\alpha$ -IoU to IoU. Specifically, when $\alpha > 1$ , ${ \mathcal { L } } _ { \alpha - { \mathrm { I o U } } }$ adds an absolute loss weight to ${ \mathcal { L } } _ { \mathrm { I o U } }$ (i.e., $w _ { \mathscr { L } _ { a } } = \mathscr { L } _ { \alpha \mathrm { - I o U } } - \mathscr { L } _ { \mathrm { I o U } } = I o U - I o U ^ { \alpha } > 0$ for $I o U \in ( 0 , 1 ) )$ , which creates more space for optimization on all levels of objects (Property 4). Likewise, ${ \mathcal { L } } _ { \alpha - { \mathrm { I o U } } }$ puts an absolute gradient weight for high IoU objects (i.e., $\bar { w } _ { \nabla _ { a } } = | \bar { \nabla } _ { \mathrm { I o U } } \mathcal { L } _ { \alpha \mathrm { - I o U } } | - | \nabla _ { \mathrm { I o U } } \mathcal { L } _ { \mathrm { I o U } } | = \alpha I o U ^ { \alpha - 1 } - 1 \bar { > } 0$ for $I o U \in ( \alpha ^ { \frac { 1 } { 1 - \alpha } } , 1 ] )$ such that the learning of high IoU objects is accelerated (Property 5). Both of the absolute and relative properties of ${ \mathcal { L } } _ { \alpha - { \mathrm { I o U } } }$ are adaptive to the IoU values of the objects. Such reweighting schemes will provide more flexibility in achieving different levels of bbox regression accuracies (AP measured under different IoU thresholds).
|
| 102 |
+
|
| 103 |
+
Learning Dynamics of ${ \mathcal { L } } _ { \alpha \mathbf { - } \mathbf { I 0 } \mathbf { U } }$ . Training with ${ \mathcal { L } } _ { \alpha - { \mathrm { I o U } } }$ is a dynamic process and should be interpreted based on both the absolute and relative properties. With $\alpha > 1$ , easy examples will be learned first with increasing speed towards $I o U = 1$ , while hard examples will be learned gradually and accelerated later on as their IoU improves. We will empirically show in Figure 3 that up-weighting the loss and gradient of high IoU objects can boost the training at the later stage. As a comparison, we will also show that $\alpha$ -IoU losses with $0 < \alpha < 1$ tend to degrade the final performance in Section 4.4. Reducing the loss and gradient of high IoU objects ends up with more poorly localized objects.
|
| 104 |
+
|
| 105 |
+
# 4 Experiments
|
| 106 |
+
|
| 107 |
+
# 4.1 Datasets and Training Setup
|
| 108 |
+
|
| 109 |
+
We conduct all experiments on two popular benchmarks, i.e., PASCAL VOC [9] and MS COCO [22]. On the PASCAL VOC benchmark, we train all models on the trainval set $2 0 0 7 + 2 0 1 2$ (containing 16, 551 images from 20 categories) and evaluate them on the test set 2007 (containing 4, 952 images) [9]. On the MS COCO benchmark, we train all models on the training set 2017 (containing 118K images from 80 categories) and evaluate them on the val set 2017 (containing 5K images) [22]. We train all state-of-the-art models with the original implementation released by the authors. Specifically, we follow the original implementation’s training protocol with default parameters and the number of training epochs with different losses [31, 32, 43, 4]. Implementation details of all models are given in Appendix B.1. All experiments are run with NVIDIA V100 GPUs. Code is available at https://github.com/Jacobi93/Alpha-IoU.
|
| 110 |
+
|
| 111 |
+
# 4.2 Results and Analysis
|
| 112 |
+
|
| 113 |
+
We first validate the effectiveness of $\alpha$ -IoU losses in training both anchor-based and anchor-free models on the two datasets. We choose YOLOv5s (i.e., YOLOv5 small) and YOLOv5x (i.e., YOLOv5 extra large) as one-stage anchor-based models, and DETR (ResNet-50) as an anchor-free model. Both $\alpha$ -IoU losses (i.e., ${ \mathcal { L } } _ { \alpha - { \mathrm { I o U } } }$ and $\mathcal { L } _ { \alpha - \mathrm { D I o U } } )$ are generalized from existing baselines following equation (4). From Table 1, we can observe that $\alpha$ -IoU losses surpass existing losses consistently across multiple models and datasets in terms of both mAP and $\mathrm { m A P _ { 7 5 : 9 5 } }$ , especially at the high bbox regression accuracy $\mathrm { m A P _ { 7 5 : 9 5 } }$ . The superiority of $\alpha$ -IoU losses is more pronounced at high accuracy levels, which might reach more than $6 0 \%$ relative improvement at $\mathsf { A P } _ { 9 5 }$ . Interestingly, $\alpha$ -IoU losses tend to help more of light models (e.g., YOLOv5s with 7.3M parameters and 17 GFLOPs) than heavy models (e.g., YOLOv5x with $8 7 . 7 \mathbf { M }$ parameters and 218.8 GFLOPs). This indicates that $\alpha$ -IoU losses hold more advantage while training light models in computing-resource-limited scenarios, such as mobile devices, autonomous vehicles, and robots.
|
| 114 |
+
|
| 115 |
+
The consistent improvements on both PASCAL VOC and MS COCO demonstrate the stability of $\alpha$ -IoU losses across different datasets. In addition, we also verify its robustness to extremely small training sets in Appendix B.2.2, where $\alpha$ -IoU losses beat existing losses at various scales, i.e., from 4K $2 5 \%$ trainval set of PASCAL VOC $2 0 0 7 { + } 2 0 1 2 ,$ ) to 118K (the entire training set of MS COCO 2017) samples. It is possible that $\alpha$ -IoU losses may not perform well if measured by a single low AP metric. For example, there may be less than $0 . 5 \%$ performance drop at $\mathrm { { A P } _ { 5 0 } }$ when $\alpha = 3$ , however, this is compensated by the significant boost at high APs. With some examples from the test set of PASCAL VOC 2007 (Figure 4) and the val set of MS COCO 2017 (Figure 5), we show that $\alpha$ -IoU losses are able to localize objects more accurately than the baselines with more true positives and fewer false positives.
|
| 116 |
+
|
| 117 |
+
Table 1: The performance of YOLOv5s, YOLOv5x and DETR models trained using different localization losses on PASCAL VOC and MS COCO benchmarks. Results are obtained on the test set of PASCAL VOC 2007 and the val set of MS COCO 2017. mAP denotes $\mathrm { m A P _ { 5 0 : 9 5 } }$ ; $\mathrm { m A P _ { 7 5 : 9 5 } }$ denotes the mean AP over $\mathsf { A P } _ { 7 5 }$ , $\mathbf { A P } _ { 8 0 } , \cdot \cdot \cdot , \mathbf { A P } _ { 9 5 }$ . "rela. improv." stands for the relative improvement. $\alpha = 3$ is used for all $\alpha$ -IoU losses in all experiments.
|
| 118 |
+
|
| 119 |
+
<table><tr><td rowspan="2">Method</td><td rowspan="2">Loss</td><td rowspan="2"></td><td colspan="5">PASCAL VOC</td><td colspan="2"></td><td colspan="5">MS COCO</td></tr><tr><td>AP50</td><td>AP75</td><td>AP85 AP95</td><td></td><td>mAP</td><td>mAP75:95l</td><td>AP50</td><td>AP75</td><td>AP85</td><td>AP95</td><td>mAP</td><td>mAP75:95</td></tr><tr><td rowspan="5">YOLOv5s</td><td rowspan="5">LIoU Lα-loU rela. improv.</td><td>78.81 78.62</td><td>58.04 58.78</td><td>35.07 38.16</td><td>2.34 3.64</td><td>52.74 53.61</td><td>32.45 34.46</td><td>55.51</td><td>38.59</td><td>23.58</td><td></td><td>2.07</td><td>36.29</td><td>21.82</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>55.25</td><td>39.69</td><td>25.85</td><td>3.35</td><td>37.01</td><td>23.66</td></tr><tr><td></td><td>-0.24%</td><td>1.27%</td><td>8.81%</td><td>55.56%</td><td>1.65%</td><td>6.21%</td><td>-0.47%</td><td>2.85%</td><td>9.63%</td><td>61.84%</td><td>1.98%</td><td>8.43%</td></tr><tr><td>LDIoU</td><td>78.19</td><td>57.77</td><td>34.89</td><td>2.36</td><td>52.30</td><td>32.17</td><td>55.67</td><td>39.01</td><td>23.56</td><td>2.03</td><td>36.36</td><td>21.95</td></tr><tr><td>Lα-DIoU rela. improv.</td><td>78.33 0.18%</td><td>59.24 38.46</td><td>3.50</td><td></td><td>53.76</td><td>34.66</td><td>55.84</td><td>39.49</td><td>25.49</td><td>3.30</td><td>36.74</td><td>23.34</td></tr><tr><td rowspan="6">YOLOv5x</td><td colspan="10">LIoU</td><td rowspan="6">8.19%</td><td colspan="10">62.56%</td></tr><tr><td></td><td>85.24</td><td>2.54%</td><td>10.23%</td><td>48.31%</td><td>2.79% 63.95</td><td>7.72%</td><td></td><td>0.31%</td><td>1.23%</td><td></td><td></td><td>1.05%</td><td>6.32%</td></tr><tr><td>Lα-IoU</td><td>84.83</td><td>70.08 70.20</td><td>53.08 53.75</td><td>10.88 13.74</td><td>64.25</td><td>46.78 48.06</td><td></td><td>67.36 67.72</td><td>52.15 52.61</td><td>38.22 38.62</td><td>9.31 9.76</td><td>48.42 48.67</td><td>34.42 34.72</td></tr><tr><td>rela. improv.</td><td>-0.48%</td><td>0.17%</td><td>1.26%</td><td>26.29%</td><td>0.47%</td><td></td><td>2.73%</td><td>0.53%</td><td>0.88%</td><td>1.05%</td><td>4.83%</td><td>0.52%</td><td>0.87%</td></tr><tr><td>LDIoU</td><td>85.04</td><td>71.05</td><td>53.71</td><td>11.11</td><td>64.21</td><td>47.30</td><td></td><td>67.54</td><td>52.03</td><td>38.02</td><td>8.58</td><td>48.38</td><td>34.16</td></tr><tr><td>La-DloU rela.improv.</td><td>84.90</td><td>71.34</td><td>54.23</td><td>13.85</td><td>64.49</td><td>48.40</td><td></td><td></td><td>52.65</td><td>39.28</td><td>10.29</td><td>48.81</td><td>35.42</td></tr><tr><td rowspan="8">DETR</td><td rowspan="8">LIoU</td><td>-0.16%</td><td>0.41%</td><td>0.97%</td><td></td><td>24.66%</td><td>0.44%</td><td>2.32%</td><td>67.42 -0.18%</td><td>1.19%</td><td>3.31%</td><td></td><td>19.93%</td><td>0.89%</td><td>3.68%</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td>76.50</td><td>53.85</td><td>29.54</td><td>1.62</td><td>49.78</td><td>28.82</td><td>59.38</td><td>41.67</td><td>26.13</td><td></td><td>3.52</td><td>39.23</td><td>24.37</td></tr><tr><td>La-loU rela.improv.</td><td>76.22 -0.37%</td><td>55.03 2.19%</td><td>32.30 9.34%</td><td>2.28 40.74%</td><td>51.12 2.69%</td><td>31.08 7.84%</td><td>59.61 0.39%</td><td>42.65 2.35%</td><td>28.57 9.34%</td><td></td><td>5.09 44.60%</td><td>40.18 2.42%</td><td>26.44 8.49%</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>LDIoU</td><td>76.26 76.44</td><td>54.09</td><td>29.23</td><td>1.56</td><td>49.91</td><td>28.68</td><td></td><td>59.28</td><td>41.62</td><td>26.09</td><td>3.54</td><td>39.25</td><td>24.48</td></tr><tr><td>La-DloU rela. improv.</td><td>0.24%</td><td>54.89 1.48%</td><td>31.48 7.70%</td><td>2.44</td><td>50.96 2.10%</td><td>30.60 6.69%</td><td>59.38</td><td>42.34 1.73%</td><td></td><td>28.23</td><td>5.36</td><td>39.94 1.76%</td><td>26.05</td></tr><tr><td></td><td></td><td></td><td></td><td>56.41%</td><td></td><td></td><td>0.17%</td><td></td><td></td><td>8.20%</td><td>51.41%</td><td></td><td>6.41%</td></tr></table>
|
| 120 |
+
|
| 121 |
+

|
| 122 |
+
Figure 2: IoU distributions between predicted bboxes and their ground truth after NMS.
|
| 123 |
+
|
| 124 |
+

|
| 125 |
+
Figure 3: Validation mAPs $( \mathrm { m A P _ { 5 0 : 9 5 } } )$ across 300 training epochs.
|
| 126 |
+
|
| 127 |
+
We further analyze the bbox regression accuracy by showing the IoU distributions between the predicted bboxes and their ground truth for YOLOv5s trained using different losses on PASCAL VOC. After NMS with the IoU threshold being 0.5, we visualize the number of positively predicted bboxes under different IoU thresholds from 0.5 to 0.9 in Figure 2, showing that $\alpha$ -IoU losses detect more positive objects than baseline losses across all IoU thresholds. Particularly, $\alpha$ -IoU losses detect approximately $1 \%$ more positive objects than the baselines when $I o U \ge 0 . 5$ , and $1 1 \%$ more high IoU objects when $I o U \ge 0 . 9$ . This demonstrates that $\alpha$ -IoU boosts both the precisions and recalls of detectors. $\alpha$ -IoU is extremely advantageous in pushing low IoU objects to high IoU objects by up-weighting their loss, thus outperforming baseline losses significantly at the high accuracy level and contributing to the improvement of the final detection performance (Table 1).
|
| 128 |
+
|
| 129 |
+
Moreover, Figure 3 shows that $\alpha$ -IoU losses are able to boost the late training stage (e.g., after 200 epochs) through up-weighting the gradient of high IoU objects, while almost having no negative impact on the early training stage (e.g., the first 100 epochs). When $\alpha > 1$ , the relative gradient weight is $0 \leq w _ { \nabla _ { r } } < 1$ for $0 \leq I o U < \alpha ^ { \frac { 1 } { 1 - \alpha } }$ , while $1 \leq w _ { \nabla _ { r } } \leq \alpha$ for $\alpha ^ { \frac { 1 } { 1 - \alpha } } \leq \hat { I o U } \leq 1$ , as analyzed in Property 3 and illustrated in Figure 1 (right). This property helps tune down the gradients of low IoU objects at the early training stage, which has a smoothing effect (reduces the high variance in parameter update caused by hard examples) that helps stabilize the model training when gradients are large at the early stage. On the other hand, the gradient up-weighting is well-bounded by $w _ { \nabla _ { r } } \leq \alpha$ , which makes up-weighting relatively safe for high IoU objects, as the original loss and gradient are small for these examples, so is the learning rate.
|
| 130 |
+
|
| 131 |
+

|
| 132 |
+
Figure 4: Example results on the test set of PASCAL VOC 2007 using YOLOv5s trained by ${ \mathcal { L } } _ { \mathrm { I o U } }$ (top row) and ${ \mathcal { L } } _ { \alpha - { \mathrm { I o U } } }$ with $\alpha = 3$ (bottom row). ${ \mathcal { L } } _ { \alpha - { \mathrm { I o U } } }$ performs better than ${ \mathcal { L } } _ { \mathrm { I o U } }$ because it can localize objects more accurately (image 1 and 2), thus can detect more true positive objects (image 3 to 5) and fewer false positive objects (image 6 and 7).
|
| 133 |
+
|
| 134 |
+

|
| 135 |
+
Figure 5: Example results on the val set of MS COCO 2017 using YOLOv5s trained by ${ \mathcal { L } } _ { \mathrm { I o U } }$ (top row) and ${ \mathcal { L } } _ { \alpha - { \mathrm { I o U } } }$ with $\alpha = 3$ (bottom row). ${ \mathcal { L } } _ { \alpha }$ -IoU performs better than ${ \mathcal { L } } _ { \mathrm { I o U } }$ because it can localize objects more accurately (image 1), thus can detect more true positive objects (image 2 to 5) and fewer false positive objects (image 4 to 7). Note that ${ \mathcal { L } } _ { \alpha - { \mathrm { I o U } } }$ detects both more true positive and fewer false positive objects in image 4 and 5 than ${ \mathcal { L } } _ { \mathrm { I o U } }$ .
|
| 136 |
+
|
| 137 |
+
We also conduct an experiment to compare our $\alpha$ -IoU with a set of existing IoU-based losses in training a popular two-stage anchor-based model, Faster R-CNN (ResNet-50-FPN). In Table 2, results at the top are reproduced using the MMDetection toolbox [6] while those in the middle are reported results in the original papers [43, 41, 23]. Results at the bottom are obtained by replacing existing losses with their $\alpha$ -IoU versions (i.e., improve based on top results using MMDetection). The results on MS COCO demonstrate that $\alpha$ -IoU losses are quite competitive compared with existing baselines in terms of both mAP and $\mathrm { m A P _ { 7 5 : 9 5 } }$ . Note that the Autoloss searches both the classification loss and the localization loss, thus taking a huge amount of searching time [23]. In contrast, $\alpha$ -IoU losses only need an easy modification of the localization loss and win the Autoloss without causing any additional computational overhead.
|
| 138 |
+
|
| 139 |
+
# 4.3 Robustness to Noisy Bounding Boxes
|
| 140 |
+
|
| 141 |
+
It happens quite often that people annotate inaccurate bboxes in images/videos as the ground truth, even with computer-assisted annotation tools. However, there is little work on the robustness of localization losses to noisy bboxes, even though a number of methods have been proposed for robust learning with noisy labels, anchors, and bboxes [27, 26, 12, 10, 15, 37, 38, 25, 19, 20]. Here, we fill this gap by conducting a set of experiments to evaluate the robustness of different localization losses to noisy bboxes. We show that $\alpha$ -IoU is more robust to noisy bboxes as they focus less on the low IoU objects, creating a suppression effect on the learning of the noisy bbox examples. Considering that open datasets like PASCAL VOC and MS COCO are carefully annotated, we synthesize a set of common noisy bboxes by perturbing normalized bboxes in the entire training set. The perturbations follow a uniform noise distribution in $[ - \eta w , \eta w ]$ at horizontal coordinates $\scriptstyle { \dot { x } }$ and $w$ ) and $[ - \eta h , \eta h ]$ at vertical coordinates $y$ and $h$ ), where $\eta$ is the noise rate [20]. We then constrain all the noisy bboxes by the following boundary conditions:
|
| 142 |
+
|
| 143 |
+
$$
|
| 144 |
+
0 < w < 1 , ~ 0 < h < 1 , ~ \frac { 1 } { 2 } w \leq x \leq 1 - \frac { 1 } { 2 } w , ~ \frac { 1 } { 2 } h \leq y \leq 1 - \frac { 1 } { 2 } h .
|
| 145 |
+
$$
|
| 146 |
+
|
| 147 |
+
Table 2: The performance of Faster R-CNN (ResNet-50-FPN) with $1 \times$ schedule and single scale training on MS COCO using different localization losses. Results are obtained on the val set of MS COCO 2017. mAP denotes $\mathrm { m A P _ { 5 0 : 9 5 } }$ ; $\mathrm { m A P _ { 7 5 : 9 5 } }$ denotes the mean AP over $\mathsf { A P } _ { 7 5 }$ , $\mathbf { A P } _ { 8 0 } , \cdot \cdot \cdot , \mathbf { A P } _ { 9 5 }$ . $\mathsf { A P } _ { s }$ , $\mathsf { A P } _ { m }$ , and $\mathsf { A P } _ { l }$ denote the AP for small, medium, and large objects, respectively. † marks the reproduced results from the MMDetection toolbox [6], while ∗ marks the results in the original papers. "–" represents the missing results in papers. $\alpha = 3$ is used for all $\alpha$ -IoU losses in all experiments. The top two best results in every column are boldfaced.
|
| 148 |
+
|
| 149 |
+
<table><tr><td>Loss</td><td>AP50</td><td>AP75</td><td>AP80</td><td>AP85</td><td>AP90</td><td>AP95</td><td>mAP</td><td>mAP75:95|</td><td>APs</td><td>APm</td><td>APt</td></tr><tr><td>+e1</td><td>58.13</td><td>40.45</td><td>33.56</td><td>23.39</td><td>11.09</td><td>1.24</td><td>37.37</td><td>21.95</td><td>21.20</td><td>40.96</td><td>48.13</td></tr><tr><td>LIoU</td><td>58.12</td><td>41.23</td><td>34.03</td><td>24.43</td><td>12.42</td><td>1.61</td><td>37.88</td><td>22.74</td><td>21.61</td><td>41.63</td><td>49.11</td></tr><tr><td>LGIoU</td><td>58.18</td><td>41.00</td><td>33.52</td><td>24.13</td><td>11.97</td><td>1.51</td><td>37.62</td><td>22.43</td><td>21.49</td><td>41.07</td><td>48.90</td></tr><tr><td>+LBIoU</td><td>58.05</td><td>40.57</td><td>33.54</td><td>23.85</td><td>11.10</td><td>1.19</td><td>37.43</td><td>22.05</td><td>21.57</td><td>41.00</td><td>48.17</td></tr><tr><td>*LIoU</td><td>/</td><td>40.79</td><td>/</td><td></td><td>1</td><td>1</td><td>37.93</td><td></td><td>21.58</td><td>40.82</td><td>50.14</td></tr><tr><td>*LGIoU</td><td>1</td><td>41.11</td><td></td><td></td><td>1</td><td></td><td>38.02</td><td></td><td>21.45</td><td>41.06</td><td>50.21</td></tr><tr><td>*LDIoU</td><td>1</td><td>41.11</td><td></td><td></td><td>1</td><td>1</td><td>38.09</td><td>1</td><td>21.66</td><td>41.18</td><td>50.32</td></tr><tr><td>*LCIoU</td><td>1</td><td>41.96</td><td></td><td></td><td></td><td></td><td>38.65</td><td></td><td>21.32</td><td>41.83</td><td>51.51</td></tr><tr><td>*LFocal-EIoU</td><td>59.10</td><td>42.40</td><td></td><td></td><td></td><td></td><td>38.90</td><td></td><td>21.20</td><td>41.10</td><td>50.20</td></tr><tr><td>*Autoloss</td><td>58.60</td><td>41.80</td><td>1</td><td>一</td><td>1</td><td>1</td><td>38.50</td><td>1</td><td>22.00</td><td>42.20</td><td>50.20</td></tr><tr><td>Lα-IoU</td><td>58.81</td><td>41.94</td><td>34.81</td><td>25.36</td><td>13.27</td><td>1.81</td><td>38.96</td><td>23.44</td><td>22.14</td><td>42.11</td><td>50.36</td></tr><tr><td>La-GloU</td><td>59.01</td><td>42.00</td><td>35.13</td><td>25.14</td><td>13.09</td><td>2.03</td><td>39.18</td><td>23.46</td><td>22.05</td><td>42.19</td><td>50.08</td></tr><tr><td>Lα-DIoU</td><td>59.27</td><td>42.18</td><td>35.25</td><td>25.47</td><td>13.32</td><td>1.95</td><td>39.43</td><td>23.65</td><td>22.10</td><td>42.10</td><td>50.43</td></tr><tr><td>La-CloU</td><td>59.09</td><td>41.92</td><td>35.01</td><td>25.08</td><td>13.04</td><td>1.98</td><td>39.25</td><td>23.41</td><td>21.94</td><td>41.88</td><td>50.01</td></tr></table>
|
| 150 |
+
|
| 151 |
+
Table 3: The performance of YOLOv5s trained using different localization losses on simulated noisy trainval sets of PASCAL VOC $2 0 0 7 { + } 2 0 1 2$ under noise rates $\eta = 0 . 1 , 0 . 2$ , and 0.3. Results are obtained on the clean test set of PASCAL VOC 2007. mAP denotes $\mathrm { m A P _ { 5 0 : 9 5 } }$ ; $\mathrm { m A P _ { 7 5 : 9 5 } }$ denotes the mean AP over $\mathsf { A P } _ { 7 5 }$ , $\mathbf { A P } _ { 8 0 } , \cdot \cdot \cdot , \mathbf { A P } _ { 9 5 }$ . "rela. improv." stands for the relative improvement. $\alpha = 3$ is used for all $\alpha$ -IoU losses in all experiments.
|
| 152 |
+
|
| 153 |
+
<table><tr><td>Noise</td><td>Loss</td><td>AP50</td><td>AP55</td><td>AP60</td><td>AP65</td><td>AP70</td><td>AP75</td><td>AP80</td><td>AP85</td><td>AP90</td><td>AP95</td><td>mAP</td><td>mAP75:95</td></tr><tr><td rowspan="6">0.1</td><td>LIoU La-IoU</td><td>74.48 74.67</td><td>71.57 71.94</td><td>68.08 68.73</td><td>63.29 64.27</td><td>56.55 57.75</td><td>47.12 48.50</td><td>33.06 36.88</td><td>17.53 21.25</td><td>4.16 6.30</td><td>0.26 0.28</td><td>43.61 45.06</td><td>20.43</td></tr><tr><td>rela. improv.</td><td>0.26%</td><td>0.52%</td><td>0.95%</td><td>1.55%</td><td>2.12%</td><td>2.93%</td><td>11.55%</td><td>21.22%</td><td>51.44%</td><td>7.69%</td><td>3.32%</td><td>22.64 10.85%</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>LDIoU</td><td>74.09</td><td>71.46</td><td>67.88</td><td>63.09</td><td>56.18</td><td>46.71</td><td>32.67</td><td>17.50</td><td>4.43</td><td>0.23</td><td>43.42</td><td>20.31</td></tr><tr><td>La-DloU</td><td>74.38</td><td>71.95</td><td>68.10</td><td>63.52</td><td>57.18</td><td>48.47</td><td>35.90</td><td>20.89</td><td>6.37</td><td>0.33</td><td>44.71</td><td>22.39</td></tr><tr><td>rela. improv.</td><td>0.39%</td><td>0.69%</td><td>0.32%</td><td>0.68%</td><td>1.78%</td><td>3.77%</td><td>9.89%</td><td>19.37%</td><td>43.79%</td><td>43.48%</td><td>2.97%</td><td>10.26%</td></tr><tr><td rowspan="6">0.2</td><td>LIoU La-loU</td><td>67.82</td><td>63.93</td><td>58.22</td><td>50.11</td><td>39.31</td><td>26.33</td><td>13.51</td><td>4.55</td><td>0.66</td><td>0.05</td><td>32.45</td><td>9.02</td></tr><tr><td></td><td>68.20</td><td>64.21</td><td>58.77</td><td>51.59</td><td>40.66</td><td>29.20</td><td>16.11</td><td>6.06</td><td>1.31</td><td>0.10</td><td>33.62</td><td>10.56</td></tr><tr><td>rela. improv.</td><td>0.56%</td><td>0.44%</td><td>0.94%</td><td>2.95%</td><td>3.43%</td><td>10.90%</td><td>19.25%</td><td>33.19%</td><td>98.48%</td><td>100%</td><td>3.61%</td><td>17.03%</td></tr><tr><td>LDIoU</td><td>67.39</td><td>62.94</td><td>57.29</td><td>49.25</td><td>39.40</td><td>27.13</td><td>13.78</td><td>4.52</td><td>0.68</td><td>0.02</td><td>32.24</td><td>9.23</td></tr><tr><td>La-DloU</td><td>68.26</td><td>64.49</td><td>59.59</td><td>51.99</td><td>41.19</td><td>29.12</td><td>15.77</td><td>5.84</td><td>1.25</td><td>0.21</td><td>33.77</td><td>10.44</td></tr><tr><td>rela.improv.</td><td>1.29%</td><td>2.46%</td><td>4.01%</td><td>5.56%</td><td>4.54%</td><td>7.34%</td><td>14.44%</td><td>29.20%</td><td>83.82%</td><td>950%</td><td>4.75%</td><td>13.14%</td></tr><tr><td rowspan="6">0.3</td><td>LIoU La-IoU</td><td>56.54</td><td>49.69</td><td>40.67</td><td>30.80</td><td>19.99</td><td>11.13</td><td>4.81</td><td>1.43</td><td>0.31</td><td>0.04</td><td>21.54</td><td>3.54</td></tr><tr><td></td><td>58.59</td><td>51.58</td><td>43.23</td><td>32.93</td><td>22.27</td><td>12.52</td><td>5.91</td><td>2.16</td><td>0.73</td><td>0.12</td><td>23.00</td><td>4.29</td></tr><tr><td>rela. improv.</td><td>3.63%</td><td>3.80%</td><td>6.29%</td><td>6.92%</td><td>11.41%</td><td>12.49%</td><td>22.87%</td><td>51.05%</td><td>135%</td><td>200%</td><td>6.78%</td><td>20.99%</td></tr><tr><td>LDIoU</td><td>56.84</td><td>49.82</td><td>41.50</td><td></td><td>20.80</td><td>11.22</td><td>4.84</td><td>1.51</td><td>0.46</td><td></td><td></td><td></td></tr><tr><td></td><td>58.45</td><td>51.94</td><td>43.9</td><td>32.06 33.78</td><td>22.57</td><td>12.89</td><td>6.34</td><td>2.42</td><td>0.65</td><td>0.07</td><td>21.91 23.31</td><td>3.62 4.49</td></tr><tr><td>La-DIoU rela. improv.</td><td>2.83%</td><td>4.26%</td><td>5.78%</td><td>5.36%</td><td>8.51%</td><td>14.88%</td><td>30.99%</td><td>60.26%</td><td>41.30%</td><td>0.16 129%</td><td>6.39%</td><td>24.09%</td></tr></table>
|
| 154 |
+
|
| 155 |
+
We test $\eta = 0 . 1 , 0 . 2 , 0 . 3$ in our experiments, with the average IoU between the noisy bboxes and their clean versions dropping to 0.833, 0.710, and 0.613, respectively. Examples of the synthesized noisy bboxes can be found in Appendix B.4. As shown in Table 3, $\alpha$ -IoU improves the baseline losses (i.e., ${ \mathcal { L } } _ { \mathrm { I o U } }$ and ${ \mathcal { L } } _ { \mathrm { { D I o U } } } ,$ ) considerably in these noisy scenarios. We gain increasing relative improvements from $\mathrm { { A P } _ { 5 0 } }$ to $\mathsf { A P } _ { 9 5 }$ , which accumulate to a more significant improvement in $\mathrm { m A P _ { 7 5 : 9 5 } }$ . Note that $\alpha$ -IoU losses also outperform the baselines at $\mathrm { { A P } _ { 5 0 } }$ across all noisy scenarios, which is not always the case when bboxes are clean (Table 1). Furthermore, $\alpha$ -IoU losses are noticeably more robust against more severe noises. For instance, the relative improvement of $\mathcal { L } _ { \alpha \mathrm { - D I o U } }$ over ${ \mathcal { L } } _ { \mathrm { D I o U } }$ increases from $2 . 9 7 \% / 1 0 . 2 6 \%$ to $6 . 3 9 \% / 2 4 . 0 9 \%$ according to $\mathrm { m A P / m A P _ { 7 5 : 9 5 } }$ when the noise rate $\eta$ rises from 0.1 to 0.3. These results confirm the advantage of $\alpha$ -IoU losses in noisy bbox scenarios.
|
| 156 |
+
|
| 157 |
+

|
| 158 |
+
Figure 6: The performance of YOLOv5 models trained using $\alpha$ -IoU with different $\alpha$ values and evaluated on the clean test set of PASCAL VOC 2007. Black dashed lines denote baselines (i.e., the family of $\alpha$ -IoU with $\alpha = 1$ ) while red dashed lines denote the family of $\alpha$ -IoU with $\alpha = 3$ .
|
| 159 |
+
|
| 160 |
+
# 4.4 Sensitivity to power parameter $\alpha$
|
| 161 |
+
|
| 162 |
+
Here, we evaluate the performance of $\alpha$ -IoU with varying $\alpha$ values $( \alpha \in [ 0 . 5 , 5 ] )$ ) via a set of experiments with ${ \mathcal { L } } _ { \alpha - { \mathrm { I o U } } }$ and $\mathcal { L } _ { \alpha - \mathrm { D I o U } }$ . The results are shown in Figure 6 for YOLOv5s on PASCAL VOC in both clean and various noisy bbox scenarios. It is evident that $\alpha$ -IoU losses with $\alpha \in [ 2 , 4 ]$ perform competitively well across all scenarios, with $\alpha = 3$ performing the best in most cases. When $\alpha > 3$ , $\alpha$ -IoU losses tend to perform worse on low APs than the baselines (i.e., $\alpha$ -IoU with $\alpha = 1 \AA$ ), although the performance at high APs gains more improvement. We also test an extreme case with $\alpha = 1 0$ , in which the performance drops by $5 . 6 1 \% / 1 \dot { 0 } . 9 2 \% / 2 3 . 8 8 \% / 3 1 . 8 2 \%$ on average compared with $\alpha = 3$ under noise rates $\eta = 0 / 0 . 1 / 0 . 2 / 0 . 3$ , respectively. More specifically, it becomes worse than the baselines according to either mAP or $\mathrm { m A P _ { 7 5 : 9 5 } }$ . This indicates that a proper choice of $\alpha$ is crucial for $\alpha$ -IoU losses. Our recommendation is to tune $\alpha \in [ 2 , 3 ]$ for most applications or directly use $\alpha = 3$ when tuning is too expensive. Note that $\alpha \in [ 3 , 4 ]$ may be a better choice when high levels of bbox regression accuracy is desired, e.g., $\mathrm { m A P _ { 7 5 : 9 5 } }$ is the preferred performance metric. It is possible that $\alpha < 1$ is a better choice for certain applications, although $\alpha$ -IoU losses with $\alpha < 1$ perform consistently worse than the baselines in our experiments.
|
| 163 |
+
|
| 164 |
+
# 5 Conclusions
|
| 165 |
+
|
| 166 |
+
In this paper, we proposed a unified formula $\alpha$ -IoU to generalize existing IoU-based losses to a new family of power IoU losses. By modulating the power parameter $\alpha$ , $\alpha$ -IoU offers the flexibility to achieve different levels of bbox regression accuracy when training an object detector. We analyzed the order preservingness and the loss/gradient reweighting properties of $\alpha$ -IoU, and showed that $\alpha$ -IoU can improve bbox regression accuracy through up-weighting the loss and gradient of high IoU objects. Experiments with multiple detection models and benchmark datasets demonstrated that $\alpha$ -IoU losses can consistently outperform existing IoU-based losses, especially at the high Average Precisions (APs). $\alpha$ -IoU has the potential to be widely applied in real-world object detection applications as 1) it improves existing IoU-based losses, 2) it benefits light models, 3) it is extremely advantageous on small datasets, and 4) it is more robust to noisy bboxes. For future work, we will explore new generalization formulas for other metric-derived loss functions [13], such as Dice, Hausdorff distance, and Chamfer distance losses.
|
| 167 |
+
|
| 168 |
+
# Societal Impacts
|
| 169 |
+
|
| 170 |
+
The proposed loss functions can help train high-performance object detectors for impactful applications such as self-driving, face recognition and video surveillance. While not our initial intention, these models could potentially be manipulated by adversaries or unauthorized users for malicious purposes. This could compromise the safety or privacy of certain individuals. We believe strict regulations should be established to prevent such illegitimate exploitations.
|
| 171 |
+
|
| 172 |
+
# References
|
| 173 |
+
|
| 174 |
+
[1] A. Bochkovskiy, C.-Y. Wang, and H.-Y. M. Liao. Yolov4: Optimal speed and accuracy of object detection. arXiv preprint arXiv:2004.10934, 2020.
|
| 175 |
+
[2] G. E. Box and D. R. Cox. An analysis of transformations. Journal of the Royal Statistical Society: Series B (Methodological), 26(2):211–243, 1964. [3] Z. Cai and N. Vasconcelos. Cascade r-cnn: Delving into high quality object detection. In CVPR, pages 6154–6162, 2018. [4] N. Carion, F. Massa, G. Synnaeve, N. Usunier, A. Kirillov, and S. Zagoruyko. End-to-end object detection with transformers. In ECCV, pages 213–229. Springer, 2020. [5] K. Chen, J. Pang, J. Wang, Y. Xiong, X. Li, S. Sun, W. Feng, Z. Liu, J. Shi, W. Ouyang, et al. Hybrid task cascade for instance segmentation. In CVPR, pages 4974–4983, 2019.
|
| 176 |
+
[6] K. Chen, J. Wang, J. Pang, Y. Cao, Y. Xiong, X. Li, S. Sun, W. Feng, Z. Liu, J. Xu, et al. Mmdetection: Open mmlab detection toolbox and benchmark. arXiv preprint arXiv:1906.07155, 2019.
|
| 177 |
+
[7] Z. Dong, G. Li, Y. Liao, F. Wang, P. Ren, and C. Qian. Centripetalnet: Pursuing high-quality keypoint pairs for object detection. In CVPR, pages 10519–10528, 2020. [8] K. Duan, S. Bai, L. Xie, H. Qi, Q. Huang, and Q. Tian. Centernet: Keypoint triplets for object detection. In ICCV, pages 6569–6578, 2019. [9] M. Everingham, L. Van Gool, C. K. Williams, J. Winn, and A. Zisserman. The pascal visual object classes (voc) challenge. IJCV, 88(2):303–338, 2010.
|
| 178 |
+
[10] J. Gao, J. Wang, S. Dai, L.-J. Li, and R. Nevatia. Note-rcnn: Noise tolerant ensemble rcnn for semi-supervised object detection. In ICCV, pages 9508–9517, 2019.
|
| 179 |
+
[11] R. Girshick. Fast r-cnn. In ICCV, pages 1440–1448, 2015.
|
| 180 |
+
[12] B. Han, Q. Yao, X. Yu, G. Niu, M. Xu, W. Hu, I. W. Tsang, and M. Sugiyama. Co-teaching: Robust training of deep neural networks with extremely noisy labels. In NeurIPS, 2018.
|
| 181 |
+
[13] J. He, S. Erfani, S. Wijewickrema, S. O’Leary, and K. Ramamohanarao. Learning non-unique segmentation with reward-penalty dice loss. In IJCNN, pages 1–8. IEEE, 2020.
|
| 182 |
+
[14] K. He, G. Gkioxari, P. Dollár, and R. Girshick. Mask r-cnn. In ICCV, pages 2961–2969, 2017.
|
| 183 |
+
[15] M. Khodabandeh, A. Vahdat, M. Ranjbar, and W. G. Macready. A robust learning approach to domain adaptive object detection. In ICCV, pages 480–490, 2019.
|
| 184 |
+
[16] H. Law and J. Deng. Cornernet: Detecting objects as paired keypoints. In ECCV, pages 734–750, 2018.
|
| 185 |
+
[17] H. Li, T. Fu, J. Dai, H. Li, G. Huang, and X. Zhu. Autoloss-zero: Searching loss functions from scratch for generic tasks. arXiv preprint arXiv:2103.14026, 2021.
|
| 186 |
+
[18] H. Li, C. Tao, X. Zhu, X. Wang, G. Huang, and J. Dai. Auto seg-loss: Searching metric surrogates for semantic segmentation. arXiv preprint arXiv:2010.07930, 2020.
|
| 187 |
+
[19] H. Li, Z. Wu, C. Zhu, C. Xiong, R. Socher, and L. S. Davis. Learning from noisy anchors for one-stage object detection. In CVPR, pages 10588–10597, 2020.
|
| 188 |
+
[20] J. Li, C. Xiong, R. Socher, and S. Hoi. Towards noise-resistant object detection with noisy annotations. arXiv preprint arXiv:2003.01285, 2020.
|
| 189 |
+
[21] T.-Y. Lin, P. Goyal, R. Girshick, K. He, and P. Dollár. Focal loss for dense object detection. In ICCV, pages 2980–2988, 2017.
|
| 190 |
+
[22] T.-Y. Lin, M. Maire, S. Belongie, J. Hays, P. Perona, D. Ramanan, P. Dollár, and C. L. Zitnick. Microsoft coco: Common objects in context. In ECCV, pages 740–755. Springer, 2014.
|
| 191 |
+
[23] P. Liu, G. Zhang, B. Wang, H. Xu, X. Liang, Y. Jiang, and Z. Li. Loss function discovery for object detection via convergence-simulation driven search. arXiv preprint arXiv:2102.04700, 2021.
|
| 192 |
+
[24] W. Liu, D. Anguelov, D. Erhan, C. Szegedy, S. Reed, C.-Y. Fu, and A. C. Berg. Ssd: Single shot multibox detector. In ECCV, pages 21–37. Springer, 2016.
|
| 193 |
+
[25] X. Ma, H. Huang, Y. Wang, S. Romano, S. Erfani, and J. Bailey. Normalized loss functions for deep learning with noisy labels. In ICML, pages 6543–6553. PMLR, 2020.
|
| 194 |
+
[26] X. Ma, Y. Wang, M. E. Houle, S. Zhou, S. Erfani, S. Xia, S. Wijewickrema, and J. Bailey. Dimensionality-driven learning with noisy labels. In ICML, pages 3355–3364. PMLR, 2018.
|
| 195 |
+
[27] N. Natarajan, I. S. Dhillon, P. K. Ravikumar, and A. Tewari. Learning with noisy labels. NeurIPS, 26:1196–1204, 2013.
|
| 196 |
+
[28] M. A. Rahman and Y. Wang. Optimizing intersection-over-union in deep neural networks for image segmentation. In ISVC, pages 234–244. Springer, 2016.
|
| 197 |
+
[29] J. Redmon and A. Farhadi. Yolo9000: better, faster, stronger. In CVPR, pages 7263–7271, 2017.
|
| 198 |
+
[30] J. Redmon and A. Farhadi. Yolov3: An incremental improvement. arXiv preprint arXiv:1804.02767, 2018.
|
| 199 |
+
[31] S. Ren, K. He, R. Girshick, and J. Sun. Faster r-cnn: Towards real-time object detection with region proposal networks. arXiv preprint arXiv:1506.01497, 2015.
|
| 200 |
+
[32] H. Rezatofighi, N. Tsoi, J. Gwak, A. Sadeghian, I. Reid, and S. Savarese. Generalized intersection over union: A metric and a loss for bounding box regression. In CVPR, pages 658–666, 2019.
|
| 201 |
+
[33] G. Song, Y. Liu, and X. Wang. Revisiting the sibling head in object detector. In CVPR, pages 11563–11572, 2020.
|
| 202 |
+
[34] Z. Tian, C. Shen, H. Chen, and T. He. Fcos: Fully convolutional one-stage object detection. In ICCV, pages 9627–9636, 2019.
|
| 203 |
+
[35] L. Tychsen-Smith and L. Petersson. Improving object localization with fitness nms and bounded iou loss. In CVPR, pages 6877–6885, 2018.
|
| 204 |
+
[36] K. Wang and L. Zhang. Single-shot two-pronged detector with rectified iou loss. In Proceedings of the 28th ACM International Conference on Multimedia, pages 1311–1319, 2020.
|
| 205 |
+
[37] Y. Wang, X. Ma, Z. Chen, Y. Luo, J. Yi, and J. Bailey. Symmetric cross entropy for robust learning with noisy labels. In ICCV, pages 322–330, 2019.
|
| 206 |
+
[38] Z. Wang, L. Liu, and D. Tao. Deep streaming label learning. In ICML, pages 9963–9972. PMLR, 2020.
|
| 207 |
+
[39] J. Yu, Y. Jiang, Z. Wang, Z. Cao, and T. Huang. Unitbox: An advanced object detection network. In Proceedings of the 24th ACM international conference on Multimedia, pages 516–520, 2016.
|
| 208 |
+
[40] S. Zhang, C. Chi, Y. Yao, Z. Lei, and S. Z. Li. Bridging the gap between anchor-based and anchor-free detection via adaptive training sample selection. In CVPR, pages 9759–9768, 2020.
|
| 209 |
+
[41] Y.-F. Zhang, W. Ren, Z. Zhang, Z. Jia, L. Wang, and T. Tan. Focal and efficient iou loss for accurate bounding box regression. arXiv preprint arXiv:2101.08158, 2021.
|
| 210 |
+
[42] Z. Zhang and M. R. Sabuncu. Generalized cross entropy loss for training deep neural networks with noisy labels. In NeurIPS, 2018.
|
| 211 |
+
[43] Z. Zheng, P. Wang, W. Liu, J. Li, R. Ye, and D. Ren. Distance-iou loss: Faster and better learning for bounding box regression. In AAAI, pages 12993–13000, 2020.
|
| 212 |
+
[44] X. Zhou, D. Wang, and P. Krähenbühl. Objects as points. arXiv preprint, arXiv:1904.07850, 2019.
|
| 213 |
+
[45] X. Zhou, J. Zhuo, and P. Krahenbuhl. Bottom-up object detection by grouping extreme and center points. In CVPR, pages 850–859, 2019.
|
| 214 |
+
[46] X. Zhu, W. Su, L. Lu, B. Li, X. Wang, and J. Dai. Deformable detr: Deformable transformers for end-to-end object detection. arXiv preprint arXiv:2010.04159, 2020.
|
md/train/iNqrOCPRmYQ/iNqrOCPRmYQ.md
ADDED
|
@@ -0,0 +1,269 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# The Inductive Bias of Quantum Kernels
|
| 2 |
+
|
| 3 |
+
Jonas M. Kübler∗ Simon Buchholz∗ Bernhard Schölkopf
|
| 4 |
+
|
| 5 |
+
Max Planck Institute for Intelligent Systems Tübingen, Germany {jmkuebler, sbuchholz, bs}@tue.mpg.de
|
| 6 |
+
|
| 7 |
+
# Abstract
|
| 8 |
+
|
| 9 |
+
It has been hypothesized that quantum computers may lend themselves well to applications in machine learning. In the present work, we analyze function classes defined via quantum kernels. Quantum computers offer the possibility to efficiently compute inner products of exponentially large density operators that are classically hard to compute. However, having an exponentially large feature space renders the problem of generalization hard. Furthermore, being able to evaluate inner products in high dimensional spaces efficiently by itself does not guarantee a quantum advantage, as already classically tractable kernels can correspond to highor infinite-dimensional reproducing kernel Hilbert spaces (RKHS).
|
| 10 |
+
|
| 11 |
+
We analyze the spectral properties of quantum kernels and find that we can expect an advantage if their RKHS is low dimensional and contains functions that are hard to compute classically. If the target function is known to lie in this class, this implies a quantum advantage, as the quantum computer can encode this inductive bias, whereas there is no classically efficient way to constrain the function class in the same way. However, we show that finding suitable quantum kernels is not easy because the kernel evaluation might require exponentially many measurements.
|
| 12 |
+
|
| 13 |
+
In conclusion, our message is a somewhat sobering one: we conjecture that quantum machine learning models can offer speed-ups only if we manage to encode knowledge about the problem at hand into quantum circuits, while encoding the same bias into a classical model would be hard. These situations may plausibly occur when learning on data generated by a quantum process, however, they appear to be harder to come by for classical datasets.
|
| 14 |
+
|
| 15 |
+
# 1 Introduction
|
| 16 |
+
|
| 17 |
+
In recent years, much attention has been dedicated to studies of how small and noisy quantum devices [1] could be used for near term applications to showcase the power of quantum computers. Besides fundamental demonstrations [2], potential applications that have been discussed are in quantum chemistry [3], discrete optimization [4] and machine learning (ML) [5–12].
|
| 18 |
+
|
| 19 |
+
Initiated by the seminal HHL algorithm [13], early work in quantum machine learning (QML) was focused on speeding up linear algebra subroutines, commonly used in ML, offering the perspective of a runtime logarithmic in the problem size [14–17]. However, most of these works have an inverse polynomial scaling of the runtime in the error and it was shown rigorously by Ciliberto et al. [18]√ that due to the quantum mechanical measurement process a runtime complexity √ $O ( { \sqrt { n } } )$ is necessary for convergence rate $1 / \sqrt { n }$ .
|
| 20 |
+
|
| 21 |
+
Rather than speeding up linear algebra subroutines, we focus on more recent suggestions that use a quantum device to define and implement the function class and do the optimization on a classical computer. There are two ways to that: the first are so-called Quantum Neural Networks (QNN) or parametrized quantum circuits [5–7] which can be trained via gradient based optimization [5, 19–23]. The second approach is to use a predefined way of encoding the data in the quantum system and defining a quantum kernel as the inner product of two quantum states [7–11]. These two approaches essentially provide a parametric and a non-parametric path to quantum machine learning, which are closely related to each other [11]. Since the optimization of QNNs is non-convex and suffers from so-called Barren Plateaus [24], we here focus on quantum kernels, which allow for convex problems and thus lend themselves more readily to theoretical analysis.
|
| 22 |
+
|
| 23 |
+

|
| 24 |
+
Figure 1: Quantum advantage via inductive bias: (a) Data generating quantum circuit $f ( x ) =$ $\operatorname { T r } \left[ \rho ^ { V } ( x ) ( M \otimes \mathrm { i d } ) \right] = \operatorname { T r } \left[ \tilde { \rho } ^ { V } ( x ) M \right]$ . (b) The full quantum kernel $k ( x , x ^ { \prime } ) = \mathrm { T r } \left[ \rho ^ { V } ( x ) \rho ^ { V } ( x ^ { \prime } ) \right]$ is too general and cannot learn $f$ efficiently. (c) The biased quantum kernel $q ( x , x ^ { \prime } ) =$ $\operatorname { T r } \left[ \tilde { \rho } ^ { V } ( \bar { x } ) \tilde { \rho } ^ { V } ( x ^ { \prime } ) \right]$ meaningfully constrains the function space and allows to learn $f$ with little data.
|
| 25 |
+
|
| 26 |
+
The central idea of using a QML model is that it enables to do computations that are exponentially hard classically. However, also in classical ML, kernel methods allow us to implicitly work with high- or infinite dimensional function spaces [25, 26]. Thus, purely studying the expressivity of QML models [27] is not sufficient to understand when we can expect speed-ups. Only recently first steps where taken into this direction [10, 12, 28]. Assuming classical hardness of computing discrete logarithms, Liu et al. [10] proposed a task based on the computation of the discrete logarithm where the quantum computer, equipped with the right feature mapping, can learn the target function with exponentially less data than any classical (efficient) algorithm. Similarly, Huang et al. [12] analyzed generalization bounds and realized that the expressivity of quantum models can hinder generalization. They proposed a heuristic to optimize the labels of a dataset such that it can be learned well by a quantum computer but not a classical machine.
|
| 27 |
+
|
| 28 |
+
In this work, we relate the discussion of quantum advantages to the classical concept of inductive bias. The no free lunch theorem informally states that no learning algorithm can outperform other algorithms on all problems. This implies that an algorithm that performs well on one type of problem necessarily performs poorly on other problems. A standard inductive bias in ML is to prefer functions that are continuous. An algorithm with that bias, however, will then struggle to learn functions that are discontinuous. For a QML model to have an edge over classical ML models, we could thus ensure that it is equipped with an inductive bias that cannot be encoded (efficiently) with a classical machine. If a given dataset fits this inductive bias, the QML model will outperform any classical algorithm. For kernel methods, the qualitative concept of inductive bias can be formalized by analyzing the spectrum of the kernel and relating it to the target function [25, 29–33].
|
| 29 |
+
|
| 30 |
+
Our main contribution is the analysis of the inductive bias of quantum machine learning models based on the spectral properties of quantum kernels. First, we show that quantum kernel methods will fail to generalize as soon as the data embedding into the quantum Hilbert space is too expressive (Theorem 1). Then we note that projecting the quantum kernel appropriately allows to construct inductive biases that are hard to create classically (Figure 1). However, our Theorem 2 also implies that estimating the biased kernel requires exponential measurements, a phenomenon reminiscent of the Barren plateaus observed in quantum neural networks. Finally we show experiments supporting our main claims.
|
| 31 |
+
|
| 32 |
+
While our work gives guidance to find a quantum advantage in ML, this yields no recipe for obtaining a quantum advantage on a classical dataset. We conjecture that unless we have a clear idea how the data generating process can be described with a quantum computer, we cannot expect an advantage by using a quantum model in place of a classical machine learning model.
|
| 33 |
+
|
| 34 |
+
# 2 Supervised learning
|
| 35 |
+
|
| 36 |
+
We briefly introduce the setting and notation for supervised learning as a preparation for our analysis of quantum mechanical methods in this context. The goal of supervised learning is the estimation of a functional mechanism based on data generated from this mechanism. For concreteness we focus on the regression setting where we assume data is generated according to $Y = f ^ { * } ( X ) + \varepsilon$ where $\varepsilon$ denotes zero-mean noise. We focus on $X \in \mathcal { X } \subset \mathbb { R } ^ { d }$ , $Y \in \mathbb { R }$ . We denote the joint probability distribution of $( X , Y )$ by $\mathcal { D }$ and we are given $n$ i.i.d. observations $D _ { n }$ from $\mathcal { D }$ . We will refer to the marginal distribution of $X$ as $\mu$ , define the $L _ { \mu } ^ { 2 }$ inner product $\begin{array} { r } { \langle f , g \rangle = \int f ( x ) g ( x ) \mu ( \mathrm { d } x ) } \end{array}$ and denote the corresponding norm by $\| \cdot \|$ . The least square risk and the empirical risk of some hypothesis $h : \mathcal { X } \mathbb { R }$ is defined by $R ( \ddot { h } ) = \mathbb { E } _ { \mathcal { D } } \left[ ( h ( X ) - Y ) ^ { 2 } \right]$ and $R _ { n } ( h ) = \operatorname { \mathbb { E } } _ { D _ { n } } \left[ ( h ( X ) - Y ) ^ { 2 } \right]$ .
|
| 37 |
+
|
| 38 |
+
In supervised machine learning, one typically considers a hypothesis space $H$ of functions $h : \mathcal { X } \mathbb { R }$ and tries to infer argmin $\scriptstyle \displaystyle h \in H ^ { R ( h ) }$ (assuming for simplicity that the minimizer exists). Typically this is done by (regularized) empirical risk minimization $\begin{array} { r } { \operatorname * { a r g m i n } _ { h \in H } R _ { n } ( h ) + \lambda \Omega ( h ) } \end{array}$ , where $\lambda > 0$ and $\Omega$ determine the regularization. The risk of $h$ can then be decomposed in generalization and training error $R ( h ) = ( R ( \bar { h } ) - R _ { n } ( h ) ) + R _ { n } ( h )$ .
|
| 39 |
+
|
| 40 |
+
Kernel ridge regression. We will focus on solving the regression problem over a reproducing kernel Hilbert space (RKHS) [25, 26]. An RKHS $\mathcal { F }$ associated with a positive definite kernel $k : \mathcal { X } \times \mathcal { X } \to \mathbb { R }$ is the space of functions such that for all $x \in \mathcal { X }$ and $h \in { \mathcal { F } }$ the reproducing property $h ( x ) = \langle h , k ( x , \cdot ) \rangle _ { \mathcal { F } }$ holds. Kernel ridge regression regularizes the RKHS norm, i.e., $\Omega ( h ) \stackrel { \smile } { = } \| \dot { h } \| _ { \mathcal { F } } ^ { 2 }$ . With observations $\mathsf { \bar { \{ } } ( x ^ { ( i ) } , y ^ { ( i ) } ) \mathsf \} _ { i = 1 } ^ { n }$ we can compute the kernel matrix $K ( X , X ) _ { i j } = k ( x ^ { ( i ) } , x ^ { ( j ) } )$ and the Representer Theorem [34] ensures that the empirical risk minimizer of kernel ridge regression is of the form $\begin{array} { r } { \hat { f } _ { n } ^ { \lambda } ( \cdot ) = \sum _ { i = 1 } ^ { n } \alpha _ { i } k ( x ^ { ( i ) } , \cdot ) } \end{array}$ , with $\alpha = ( K ( X , X ) + \lambda \operatorname { i d } ) ^ { - 1 } y$ . The goal of our work is to study when a (quantum) kernel is suitable for learning a particular problem. The central object to study this is the integral operator.
|
| 41 |
+
|
| 42 |
+
Spectral properties and inductive bias. For kernel $k$ and marginal distribution $\mu$ , the integral operator $K$ , is defined as $\begin{array} { r } { ( K f ) ( x ) = \int k ( x , x ^ { \prime } ) f ( x ^ { \prime } ) \mu ( \mathrm { d } x ^ { \prime } ) } \end{array}$ . Mercer’s Theorem ensures that there exist a spectral decomposition of $K$ with (possibly infinitely many) eigenvalues $\gamma _ { i }$ (ordered nonincreasingly) and corresponding eigenfunctions $\phi _ { i }$ , which are orthonormal in $L _ { \mu } ^ { 2 }$ , i.e., $\langle \phi _ { i } , \phi _ { j } \rangle = \delta _ { i , j }$ . We will assume that $\begin{array} { r } { \mathrm { T r } \left[ K \right] = \sum _ { i } \gamma _ { i } = 1 } \end{array}$ which we can ensure by rescaling the kernel. We can then write $\begin{array} { r } { k ( x , x ^ { \prime } ) = \bar { \sum _ { i } \gamma _ { i } } \phi _ { i } ( \overline { { x } } ) \bar { \phi } _ { i } ( x ^ { \prime } ) } \end{array}$ . While the functions $\phi$ form a basis of $\mathcal { F }$ they might not completely span $L _ { \mu } ^ { 2 }$ . In this case we simply complete the basis and implicitly take $\gamma = 0$ for the added functions. Then we can decompose functions in $L _ { \mu } ^ { 2 }$ as
|
| 43 |
+
|
| 44 |
+
$$
|
| 45 |
+
f ( x ) = \sum _ { i } a _ { i } \phi _ { i } ( x ) .
|
| 46 |
+
$$
|
| 47 |
+
|
| 48 |
+
We have kf k 2 = P i a 2i and kf k2F = P i a 2iγi (if $f \in { \mathcal { F } } )$ ). Kernel ridge regression penalizes the RKHS norm of functions. The components corresponding to zero eigenvalues are infinitely penalized and cannot be learned since they are not in the RKHS. For large regularization $\lambda$ the solution $\hat { f } _ { n } ^ { \lambda }$ is heavily biased towards learning only the coefficients of the principal components (corresponding to the largest eigenvalues) and keeps the other coefficients small (at the risk of underfitting). Decreasing the regularization allows ridge regression to also fit the other components, however, at the potential risk of overfitting to the noise in the empirical data. Finding good choices of $\lambda$ thus balances this bias-variance tradeoff.
|
| 49 |
+
|
| 50 |
+
We are less concerned with the choice of $\lambda$ , but rather with the spectral properties of a kernel that allow for a quantum advantage. Similar to the above considerations, a target function $f$ can easily be learned if it is well aligned with the principal components of a kernel. In the easiest case, the kernel only has a single non-zero eigenvalue and is just ${ \bar { k } } ( x , x ^ { \prime } ) = f ( x ) f ( x ^ { \prime } )$ . Such a construction is arguably the simplest path to a quantum advantage in ML.
|
| 51 |
+
|
| 52 |
+
Example 1 (Trivial Quantum Advantage). Let $f$ be a scalar function that is easily computable on a quantum device but requires exponential resources to approximate classically. Generate data as $Y = f ( X ) + \epsilon$ . The kernel $k ( x , x ^ { \prime } ) = f ( x ) f ( x ^ { \prime } )$ then has an exponential advantage for learning $f$ from data.
|
| 53 |
+
|
| 54 |
+
To go beyond this trivial case, we introduce two qualitative measures to judge the quality of a kernel for learning the function $f$ . The kernel target alignment of Cristianini et al. [30] is
|
| 55 |
+
|
| 56 |
+
$$
|
| 57 |
+
A ( k , f ) = \frac { \langle k , f \otimes f \rangle } { { \langle k , k \rangle } ^ { 1 / 2 } \langle f \otimes f , f \otimes f \rangle ^ { 1 / 2 } } = \frac { \sum _ { i } \gamma _ { i } a _ { i } ^ { 2 } } { ( \sum _ { i } \gamma _ { i } ^ { 2 } ) ^ { 1 / 2 } \sum _ { i } a _ { i } ^ { 2 } }
|
| 58 |
+
$$
|
| 59 |
+
|
| 60 |
+
and measures how well the kernel fits $f$ . If $A = 1$ , learning reduces to estimating a single real parameter, whereas for $A = 0$ , learning is infeasible. We note that the kernel target alignment also weighs the contributions of $f$ depending on the corresponding eigenvalue, i.e., the alignment is better if large $| a _ { i } |$ correspond to large $\gamma _ { i }$ . The kernel target alignment was used extensively to optimize kernel functions [31] and recently also used to optimize quantum kernels [35].
|
| 61 |
+
|
| 62 |
+
In a similar spirit, the task-model alignment of Canatar et al. [32] measures how much of the signal of $f$ is captured in the first $i$ principal components: $\begin{array} { r } { C ( i ) = \sum _ { j \leq i } a _ { j } ^ { 2 } ( \sum _ { j } a _ { j } ^ { 2 } ) ^ { - 1 } } \end{array}$ . The slower $C ( i )$ approaches 1, the harder it is to learn as the target function is more spread over the eigenfunctions.
|
| 63 |
+
|
| 64 |
+
# 3 Quantum computation in machine learning
|
| 65 |
+
|
| 66 |
+
In this section we introduce hypothesis spaces containing functions whose output is given by the result of a quantum computation. For a general introduction to concepts of quantum computation we refer to the book of Nielsen and Chuang [36].
|
| 67 |
+
|
| 68 |
+
We will consider quantum systems comprising $d \in \mathbb { N }$ qubits. Discussing such systems and their algebraic properties does not require in-depth knowledge of quantum mechanics. A pure state of a single qubit is described by vector $( \alpha , \beta ) ^ { \top } \in \mathbb { C } ^ { 2 }$ s.t. $| \alpha | ^ { 2 } + | \beta | ^ { 2 } = 1$ and we write $\left| \psi \right. \stackrel { - } { = } \alpha \left| 0 \right. + \beta \left| 1 \right.$ , where $\left\{ \left| 0 \right. , \left| 1 \right. \right\}$ forms the computational basis. A $d$ qubit pure state lives in the tensor product of the single qubit state spaces, i.e., it is described by a normalized vector in $\mathbb { C } ^ { 2 ^ { d } }$ . A mixed state of a $d$ -qubit system can be described by a density operator $\boldsymbol { \rho } \in \mathbb { C } ^ { 2 ^ { d } \times 2 ^ { d } }$ , i.e., a positive definite matrix $( \rho \ge 0 )$ with unit trace $( \operatorname { T r } \left[ \rho \right] = 1 )$ ). For a pure state $| \psi \rangle$ the corresponding density operator is $\rho = \left| \psi \right. \left. \psi \right|$ (here, $\langle \psi |$ is the complex conjugate transpose of $| \psi \rangle$ ). A general density operator can be thought of as a classical probabilistic mixture of pure states. We can extract information from $\rho$ by estimating (through repeated measurements) the expectation of a suitable observable, i.e., a Hermitian operator $M = \mathbf { \bar { \boldsymbol { M } } } ^ { \dagger }$ (where the adjoint $( \cdot ) ^ { \dagger }$ is the complex conjugate of the transpose), as
|
| 69 |
+
|
| 70 |
+
$$
|
| 71 |
+
{ \mathrm { T r } } \left[ \rho M \right] .
|
| 72 |
+
$$
|
| 73 |
+
|
| 74 |
+
Put simply, the potential advantage of a quantum computer arises from its state space being exponentially large in the number of qubits $d$ , thus computing general expressions like (3) on a classical computer is exponentially hard. However, besides the huge obstacles in building quantum devices with high fidelity, the fact that the outcome of the quantum computation (3) has to be estimated from measurements often prohibits to easily harness this power, see also Wang et al. [37], Peters et al. [38]. We will discuss this in the context of quantum kernels in Section 4.
|
| 75 |
+
|
| 76 |
+
We consider parameter dependent quantum states $\rho ( x ) = U ( x ) \rho _ { 0 } U ^ { \dagger } ( x )$ that are generated by evolving the initial state $\rho _ { 0 }$ with the data dependent unitary transformation $\dot { U } ( x )$ [7, 11]. Most often we will without loss of generality assume that the initial state is $\rho _ { 0 } = \left( | 0 \rangle \langle 0 | \right) ^ { \otimes d }$ . We then define quantum machine learning models via observables $M$ of the data dependent state
|
| 77 |
+
|
| 78 |
+
$$
|
| 79 |
+
f _ { M } ( x ) = \mathrm { T r } \left[ U ( x ) \rho _ { 0 } U ^ { \dagger } ( x ) M \right] = \mathrm { T r } \left[ \rho ( x ) M \right] .
|
| 80 |
+
$$
|
| 81 |
+
|
| 82 |
+
In the following we introduce the two most common function classes suggested for quantum machine learning. We note that there also exist proposals that do not fit into the form of Eq. (4) [27, 35, 39].
|
| 83 |
+
|
| 84 |
+
Quantum neural networks. A "quantum neural network" (QNN) is defined via a variational quantum circuit (VQC) [6, 40, 41]. Here the observable $M _ { \theta }$ is parametrized by $p \in \mathbb N$ classical parameters $\theta \in \Theta \subseteq \mathbb { R } ^ { p }$ . This defines a parametric function class ${ \mathcal { F } } _ { \Theta } = \{ f _ { M _ { \theta } } | { \bar { \theta } } \in \Theta \}$ . The most common ansatz is to consider $M _ { \theta } = U ( \Theta ) M U ^ { \dag } ( \Theta )$ where $\begin{array} { r } { U ( \Theta ) = \prod _ { i } U ( \theta _ { i } ) } \end{array}$ is the composition of unitary evolutions each acting on few qubits. For this and other common models of the parametric circuit it is possible to analytically compute gradients and specific optimizers for quantum circuits based on gradient descent have been developed [5, 19–23]. Nevertheless, the optimization is usually a non-convex problem and suffers from additional difficulties due to oftentimes exponentially (in $d$ )
|
| 85 |
+
|
| 86 |
+
Table 1: Concepts in the quantum Hilbert space $\mathcal { H }$ and the reproducing kernel Hilbert space $\mathcal { F }$
|
| 87 |
+
|
| 88 |
+
<table><tr><td rowspan=1 colspan=1>Quantum Space of d qubits</td><td rowspan=1 colspan=1>RKHS</td></tr><tr><td rowspan=1 colspan=1>x → p(x) ∈ H (explicit feature map)H={ρ∈ C²αx2d|ρ=p+,ρ≥0,Tr[ρ]=1}</td><td rowspan=1 colspan=1>x I→ k(·,x) ∈ F (canonical feature map)</td></tr><tr><td rowspan=1 colspan=1>k(x,x')=Tr[p(x)p(x')]= (p(x),p(x'))H</td><td rowspan=1 colspan=1>k(x,x')=(k(-,x),k(.,x')>F</td></tr><tr><td rowspan=1 colspan=1>F ={fm|fm(.)= Tr[p(·)M],M= M+}</td><td rowspan=1 colspan=1>F= Span({k(-,x)|x ∈x})</td></tr></table>
|
| 89 |
+
|
| 90 |
+
vanishing gradients [24]. This hinders a theoretical analysis. Note that the non-convexity does not arise from the fact that the QNN can learn non-linear functions, but rather because the observable $M _ { \theta }$ depends non-linearly on the parameters. In fact, the QNN functions are linear in the fixed feature mapping $\rho ( x )$ . Therefore the analogy to classical neural networks is somewhat incomplete.
|
| 91 |
+
|
| 92 |
+
Quantum kernels. The class of functions we consider are RKHS functions where the kernel is expressed by a quantum computation. The key observation is that (4) is linear in $\rho ( x )$ . Instead of optimizing over the parametric function class $\mathcal { F } _ { \Theta }$ , we can define the nonparametric class of functions $\bar { \mathcal { F } } = \{ f _ { M } \vert f _ { M } ( \cdot ) = \mathrm { T r } \left[ \rho ( \cdot ) M \right] , M = M ^ { \dagger } \}$ .2 To endow this function class with the structure of an RKHS, observe that the expression $\operatorname { T r } \left[ \rho _ { 1 } \rho _ { 2 } \right]$ defines a scalar product on density matrices. We then define kernels via the inner product of data-dependent density matrices:
|
| 93 |
+
|
| 94 |
+
Definition 1 (Quantum Kernel [7, 8, 11]). Let $\rho : x \mapsto \rho ( x )$ be a fixed feature mapping from $\mathcal { X }$ to density matrices. Then the corresponding quantum kernel is $k ( x , x ^ { \prime } ) = \mathrm { T r } \left[ \rho ( x ) \rho ( \bar { x ^ { \prime } } ) \right]$ .
|
| 95 |
+
|
| 96 |
+
The Representer Theorem [34] reduces the empirical risk minimization over the exponentially large function class $\mathcal { F }$ to an optimization problem with a set of parameters whose dimensionality corresponds to the training set size. Since the ridge regression objective is convex (and so are many other common objective functions in ML), this can be solved efficiently with a classical computer.
|
| 97 |
+
|
| 98 |
+
In the described setting, the quantum computer is only used to estimate the kernel. For pure state encodings, this is done by inverting the data encoding transformation (taking its conjugate transpose) and measuring the probability that the resulting state equals the initial state $\rho _ { 0 }$ . To see this we use the cyclic property of the trace $k ( x , x ^ { \prime } ) = \mathrm { T r } \bar { [ \rho ( x ) \rho ( x ^ { \prime } ) ] } = \mathrm { T r } \left[ U ( x ) \rho _ { 0 } U ^ { \dagger } \dot { ( x ) } U ( x ^ { \prime } ) \rho _ { 0 } U ^ { \dagger } ( x ^ { \prime } ) \right] =$ $\mathrm { T r } \left[ \left( U ^ { \dagger } ( x ^ { \prime } ) U ( x ) \rho _ { 0 } U ^ { \dagger } ( x ) U ( x ^ { \prime } ) \right) \rho _ { 0 } \right]$ . If $\rho _ { 0 } = ( | 0 \rangle \langle 0 | ) ^ { \otimes d }$ , then $k ( x , x ^ { \prime } )$ corresponds to the probability of observing every qubit in the $\ ' _ { 0 } \cdotp$ state after the initial state was evolved with $U ^ { \dagger } ( x ^ { \prime } ) U ( x )$ . To evaluate the kernel, we thus need to estimate this probability from a finite number of measurements. For our theoretical analysis we work with the exact value of the kernel and in our experiments we also simulate the full quantum state. We discuss the difficulties related to measurements in Sec. 4.
|
| 99 |
+
|
| 100 |
+
# 4 The inductive bias of simple quantum kernels
|
| 101 |
+
|
| 102 |
+
We now study the inductive bias for simple quantum kernels and their learning performance. We first give a high level discussion of a general hurdle for quantum machine learning models to surpass classical methods and then analyze two specific kernel approaches in more detail.
|
| 103 |
+
|
| 104 |
+
Continuity in classical machine learning. Arguably the most important bias in nonparametric regression are continuity assumptions on the regression function. This becomes particularly apparent in, e.g., nearest neighbour regression or random regression forests [42] where the regression function is a weighted average of close points. Here we want to emphasize that there is a long list of results concerning the minimax optimality of kernel methods for regression problems [43–45]. In particular these results show that asymptotically the convergence of kernel ridge regression of, e.g., Sobolev functions reaches the statistical limits which also apply to any quantum method.
|
| 105 |
+
|
| 106 |
+
A simple quantum kernel. We now restrict our attention to rather simple kernels to facilitate a theoretical analysis. As indicated above we consider data in $\mathcal { X } \subset \mathbb { R } ^ { d }$ and we assume that the distribution $\mu$ of the data factorizes over the coordinates (i.e. $\mu$ can be written as $\mu = \otimes \mu _ { i } )$ . This data is embedded in a $d$ -qubit quantum circuit. Let us emphasize here that the RKHS based on a quantum state of $d$ -qubits is at most $4 ^ { d }$ dimensional, i.e., finite dimensional and in the infinite data limit $n \to \infty$ standard convergence guarantees from parametric statistics apply. Here we consider growing dimension $d \to \infty$ , and sample size polynomial in the dimension $n = n ( d ) \in \operatorname { P o l y } ( d )$ . In particular the sample size $n \ll 4 ^ { d }$ will be much smaller than the dimension of the feature space and bounds from the parametric literature do not apply.
|
| 107 |
+
|
| 108 |
+
Here we consider embeddings where each coordinate is embedded into a single qubit using a map $\varphi _ { i }$ followed by an arbitrary unitary transformation $V$ , so that we can express the embedding in the quantum Hilbert space as $| \psi ^ { V } ( \dot { x } ) \rangle = V \otimes | \varphi _ { i } ( x _ { i } ) \rangle$ with corresponding density matrix (feature map)3
|
| 109 |
+
|
| 110 |
+
$$
|
| 111 |
+
\rho ^ { V } ( x ) = | \psi ^ { V } ( x ) \rangle \langle \psi ^ { V } ( x ) | .
|
| 112 |
+
$$
|
| 113 |
+
|
| 114 |
+
Note that the corresponding kernel $k ( x , x ^ { \prime } ) = \mathrm { T r } \left[ \rho ( x ) \rho ( x ^ { \prime } ) \right]$ is independent of $V$ and factorizes $k ( x , x ^ { \prime } ) = \mathrm { T r } [ \otimes \hat { \rho _ { i } ( } x _ { i } ) \otimes \bar { \rho _ { i } } ( x _ { i } ^ { \prime } ) ] = \prod \mathrm { T r } [ \rho _ { i } ( x _ { i } ) \bar { \rho _ { i } } ( x _ { i } ^ { \prime } ) ]$ where $\rho _ { i } ( \bar { x _ { i } } ) = | \varphi _ { i } ( x _ { i } ) \rangle \langle \varphi _ { i } ( x _ { i } ) |$ . The product structure of the kernel allows us to characterize the RKHS generated by $k$ based on the one dimensional case. The embedding of a single variable can be parametrized by complex valued functions $a ( x ) , b ( x )$ as
|
| 115 |
+
|
| 116 |
+
$$
|
| 117 |
+
| \varphi _ { i } ( x ) \rangle = a ( x ) | 0 \rangle + b ( x ) | 1 \rangle .
|
| 118 |
+
$$
|
| 119 |
+
|
| 120 |
+
One important object characterizing this embedding turns out to be the mean density matrix of this embedding given by $\begin{array} { r } { \rho _ { \mu _ { i } } = \int \rho _ { i } ( y ) \overline { { \mu } } _ { i } ( \mathrm { d } y ) = \int | \tilde { \varphi _ { i } } ( y ) \rangle \langle \varphi _ { i } ( y ) | \mu _ { i } ( \mathrm { d } y ) } \end{array}$ . This can be identified with the kernel mean embedding of the distribution [46]. Note that for factorizing base measure $\mu$ the factorization $\rho _ { \mu } = \bigotimes \rho _ { \mu _ { i } }$ holds. Let us give a concrete example to clarify the setting, see Fig. 1(b).
|
| 121 |
+
|
| 122 |
+
Example 2. [11, Example III.1.] We consider the cosine kernel where $a ( x ) = \cos ( x / 2 )$ , $b ( x ) =$ $i \sin ( x / 2 )$ . This embedding can be realized using a single quantum $R _ { X } ( x ) = \exp \left( - i \frac { x } { 2 } \sigma _ { x } \right)$ gate such that $| \psi ( x ) \rangle = R _ { X } ( x ) | \bar { 0 } \rangle = \cos ( x / 2 ) | 0 \rangle + i \sin ( x / 2 ) | 1 \rangle$ . In this case the kernel is given by
|
| 123 |
+
|
| 124 |
+
$$
|
| 125 |
+
\begin{array} { r } { k ( x , x ^ { \prime } ) = | \langle 0 | R _ { X } ^ { \dagger } ( x ) R _ { X } ( x ) | 0 \rangle | ^ { 2 } = | \cos ( \frac { x } { 2 } ) \cos ( \frac { x ^ { \prime } } { 2 } ) + \sin ( \frac { x } { 2 } ) \sin ( \frac { x ^ { \prime } } { 2 } ) | ^ { 2 } = \cos ( \frac { x - x ^ { \prime } } { 2 } ) ^ { 2 } . } \end{array}
|
| 126 |
+
$$
|
| 127 |
+
|
| 128 |
+
As a reference measure $\mu$ we consider the uniform measure on $[ - \pi , \pi ]$ . Then the mean density matrix is the completely mixed state $\begin{array} { r } { \rho _ { \mu } = \frac { 1 } { 2 } } \end{array}$ id. For $\mathbb { R } ^ { d }$ valued data whose coordinates are encoded independently the kernel is given by $\begin{array} { r } { k ( x , \bar { x ^ { \prime } } ) = \prod \cos ^ { 2 } \left( ( x _ { i } - x _ { i } ^ { \prime } ) / 2 \right) } \end{array}$ and $\rho _ { \mu } = 2 ^ { - d } \mathrm { i d } _ { 2 ^ { d } \times 2 ^ { d } }$ . We emphasize that due to the kernel trick this kernel can be evaluated classically in runtime $O ( d )$ .
|
| 129 |
+
|
| 130 |
+
Quantum RKHS. We now characterize the RKHS and the eigenvalues of the integral operator for quantum kernels. The RKHS consists of all functions $f \in { \mathcal { F } }$ that can be written as $f ( x ) =$ $\mathrm { T r } \left[ \rho ( { \boldsymbol { x } } ) M \right]$ where $M \in \mathbb { C } ^ { 2 ^ { d } \times 2 ^ { d } }$ is a Hermitian operator. Using this characterization of the finite dimensional RKHS we can rewrite the infinite dimensional eigenvalue problem of the integral operator as a finite dimensional problem. The action of the corresponding integral operator on $f$ can be written as
|
| 131 |
+
|
| 132 |
+
$$
|
| 133 |
+
\begin{array} { l } { { ( K f ) ( x ) = \displaystyle \int f ( y ) k ( y , x ) \mu ( \mathrm { d } y ) = \int \mathrm { T r } \left[ M \rho ( y ) \right] \mathrm { T r } \left[ \rho ( y ) \rho ( x ) \right] \mu ( \mathrm { d } y ) } } \\ { { \mathrm { ~ } = \displaystyle \int \mathrm { T r } \left[ ( M \otimes \rho ( x ) ) ( \rho ( y ) \otimes \rho ( y ) ) \right] \mu ( \mathrm { d } y ) = \mathrm { T r } \left[ \left( M \otimes \rho ( x ) \right) \int \rho ( y ) \otimes \rho ( y ) \mu ( \mathrm { d } y ) \right] } } \end{array}
|
| 134 |
+
$$
|
| 135 |
+
|
| 136 |
+
We denote the operator $\begin{array} { r } { O _ { \mu } = \int \rho ( y ) \otimes \rho ( y ) \mu ( \mathrm { d } y ) } \end{array}$ for which $\mathrm { T r } \left[ { \cal O } _ { \mu } \right] = 1$ holds. Then we can write
|
| 137 |
+
|
| 138 |
+
$$
|
| 139 |
+
\begin{array} { r l r } & { } & { ( K f ) ( x ) = \mathrm { T r } \left[ O _ { \mu } ( M \otimes \rho ( x ) ) \right] = \mathrm { T r } \left[ O _ { \mu } ( M \otimes \mathrm { i d } ) ( \mathrm { i d } \otimes \rho ( x ) ) \right] } \\ & { } & { = \mathrm { T r } \left[ \mathrm { T r } _ { 1 } \left[ O _ { \mu } ( M \otimes \mathrm { i d } ) \right] \rho ( x ) \right] } \end{array}
|
| 140 |
+
$$
|
| 141 |
+
|
| 142 |
+
where $\operatorname { T r } _ { 1 } \left[ \cdot \right]$ refers to the partial trace over the first factor. For the definition and a proof of the last equality we refer to Appendix A. The eigenvalues of $K$ can now be identified with the eigenvalues of the linear map $T _ { \mu }$ mapping ${ \cal M } \bar { \mathrm { T r } } _ { 1 } [ O _ { \mu } ( M \otimes \mathrm { i d } ) ]$ ]. As shown in the appendix there is an eigendecomposition such that $\begin{array} { r } { T _ { \mu } ( M ) = \sum \lambda _ { i } A _ { i } \mathrm { T r } \left[ A _ { i } M \right] } \end{array}$ ] where $A _ { i }$ are orthonormal Hermitian matrices (for details, a proof and an example we refer to Appendix C). The eigenfunctions of $K$ are given by $f _ { i } ( x ) = \mathrm { T r } \left[ \bar { \rho ( } x ) A _ { i } \right]$ .
|
| 143 |
+
|
| 144 |
+
We now state a bound that controls the largest eigenvalue of the integral operator $K$ in terms of the eigenvalues of the mean density matrix $\rho _ { \mu }$ (Proof in Appendix C.2).
|
| 145 |
+
|
| 146 |
+
Lemma 1. The largest eigenvalue $\gamma _ { m a x }$ of $K$ satisfies the bound $\gamma _ { m a x } \leq \sqrt { T r \left[ \rho _ { \mu } ^ { 2 } \right] } .$
|
| 147 |
+
|
| 148 |
+
The lemma above shows that the squared eigenvalues of $K$ are bounded by $\operatorname { T r } \left[ \rho _ { \mu } ^ { 2 } \right]$ , an expression known as the purity [36] of the density matrix $\rho _ { \mu }$ , which measures the diversity of the data embedding. On the other hand the eigenvalues of $K$ are closely related to the learning guarantees of kernel ridge regression. In particular, standard generalization bounds for kernel ridge regression [47] become vacuous when $\gamma _ { m a x }$ is exponentially smaller than the training sample size (if $\bar { \mathrm { T r } } [ K ] = 1$ which holds for pure state embeddings). The next result shows that this is not just a matter of bounds.
|
| 149 |
+
|
| 150 |
+
Theorem 1. Suppose the purity of the embeddings $\rho _ { \mu _ { i } }$ satisfies $T r \left[ \rho _ { \mu _ { i } } ^ { 2 } \right] \leq \delta < 1$ as the dimension and number of qubits $d$ grows. Furthermore, suppose the training sample size only grows polynomially in $d _ { \mathrm { { ; } } }$ , i.e., $n \stackrel { - } { \leq } d ^ { l }$ for some fixed $l ~ \in ~ \mathbb { N }$ . Then there exists $d _ { 0 } ~ = ~ d _ { 0 } ( \delta , l , \varepsilon )$ such that for all $d \geq d _ { 0 }$ no function can be learned using kernel ridge regression with the $d$ -qubit kernel $k ( x , x ^ { \prime } ) =$ $T r \left[ \rho ( x ) \rho ( x ^ { \prime } ) \right]$ in the sense that for any $\breve { f } \in L ^ { 2 }$ , with probability at least $1 - \varepsilon$ for all $\lambda \geq 0$
|
| 151 |
+
|
| 152 |
+
$$
|
| 153 |
+
R ( \hat { f } _ { n } ^ { \lambda } ) \geq ( 1 - \varepsilon ) \| f \| ^ { 2 } .
|
| 154 |
+
$$
|
| 155 |
+
|
| 156 |
+
The proof of the theorem can be found in Appendix D. It relies on a general result (Theorem 3 in Appendix D) which shows that for any (not necessarily quantum) kernel the solution of kernel ridge regression cannot generalize when the largest eigenvalue in the Mercer decomposition is sufficiently small (depending on the sample size). Then the proof of Theorem 1 essentially boils down to proving a bound on the largest eigenvalue using Lemma 1.
|
| 157 |
+
|
| 158 |
+
Theorem 1 implies that generalization is only possible when the mean embedding of most coordinates is close to a pure state, i.e. the embedding $x | \varphi _ { i } ( x ) \rangle$ is almost constant. To make learning from data feasible we cannot use the full expressive power of the quantum Hilbert space but instead only very restricted embeddings allow to learn from data. This generalizes an observation already made in [12]. Since also classical methods allow to handle high-dimensional and infinite dimensional RKHS the same problem occurs for classical kernels where one solution is to adapt the bandwidth of the kernel to control the expressivity of the RKHS. In principle this is also possible in the quantum context, e.g., for the cosine embedding.
|
| 159 |
+
|
| 160 |
+
Biased kernels. We have discussed that without any inductive bias, the introduced quantum kernel cannot learn any function for large $d$ . One suggestion to reduce the expressive power of the kernel is the use of projected kernels [12]. They are defined using reduced density matrices given by $\tilde { \rho } _ { m } ^ { V } ( x ) = \mathrm { T r } _ { m + 1 \ldots d } ^ { \bullet } \left[ \rho ^ { V } ( x ) \right]$ where $\mathrm { T r } _ { m + 1 \ldots d } \left[ \cdot \right]$ denotes the partial trace over qubits $m + 1$ to $d$ (definition in Appendix A) . Then they consider the usual quantum kernel for this embedding $q _ { m } ^ { V } ( x , x ^ { \prime } ) = \mathrm { T r } \left[ \tilde { \rho } _ { m } ^ { \tilde { V } } ( x ) \tilde { \rho } _ { m } ^ { V } ( x ^ { \prime } ) \right]$ . Physically, this corresponds to just measuring the first $m$ qubits and the functions $f$ in the RKHS can be written in terms of a hermitian operator $M$ acting on $m$ qubits so that $f ( x ) = { \mathrm { \ddot { T r } } } \left[ \rho ^ { V } ( x ) ( M \otimes { \mathrm { i d } } ) \right] = { \mathrm { T r } } \left[ { \tilde { \rho } } _ { m } ^ { V } ( x ) M \right]$ . If $V$ is sufficiently complex it is assumed that $f$ is hard to compute classically [48].
|
| 161 |
+
|
| 162 |
+
Indeed above procedure reduces the generalization gap. But this comes at the price of an increased approximation error if the remaining RKHS cannot fully express the target function $f ^ { * }$ anymore, i.e., the learned function underfits. Without any reason to believe that the target function is well represented via the projected kernel, we cannot hope for a performance improvement by simply reducing the size of the RKHS in an arbitrary way. However, if we know something about the data generating process than this can lead to a meaningful inductive bias. For the projected kernel this could be that we know that the target function can be expressed as $f ^ { * } ( x ) = \mathbf { \bar { T r } } \mathbf { \bar { [ } } \tilde { \rho } _ { m } ^ { V } ( x ) M ^ { * } \mathbf { ] }$ , see Fig. 1. In this case using $q _ { m } ^ { V }$ improves the generalization error without increasing the approximation error. To emphasize this, we will henceforth refer to $q _ { m } ^ { V }$ as biased kernel.
|
| 163 |
+
|
| 164 |
+

|
| 165 |
+
Figure 2: Left: Spectral behavior of biased kernel $q$ , see Theorem 2b) and Equation (11) Right: The biased kernel $q$ , equipped with prior knowledge, easily learns the function for arbitrary number of qubits and achieves optimal mean squared error (MSE). Models that are ignorant to the structure of $f ^ { * }$ fail to learn the function. The classical kernel $k _ { \mathrm { r b f } }$ and the full quantum kernel overfit (they have low training error, but large test error). The biased kernel on the wrong qubit $q _ { w }$ has litle capacity with the wrong bias and thus underfits (training and test error essentially overlap).
|
| 166 |
+
|
| 167 |
+
We now investigate the RKHS for reduced density matrices where $V$ is a Haar-distributed random unitary matrix (proof in Appendix E).
|
| 168 |
+
|
| 169 |
+
Theorem 2. Suppose $V$ is distributed according to the Haar measure on the group of unitary matrices. Fix m. Then the following two statements hold:
|
| 170 |
+
|
| 171 |
+
a) The reduced density operator satisfies with high probability ${ \tilde { \rho } } _ { m } ^ { V } = 2 ^ { - m } \mathrm { i d } + O ( 2 ^ { - d / 2 } )$ and the projected kernel satisfies with high probability $q _ { m } ^ { V } ( x , x ^ { \prime } ) = 2 ^ { - m } + O ( 2 ^ { - d / 2 } )$ as $d \to \infty$ .
|
| 172 |
+
|
| 173 |
+
$^ b$ ) Let verag $T _ { \mu , m } ^ { V }$ denoerator h r integral operator has one eigenvalue $q _ { m } ^ { V }$ as defined above. Then thehose eigenfunction is constant $\mathbb { E } _ { V }$ $\left[ T _ { \mu , m } ^ { V } \right]$ $2 ^ { - m } + O ( 2 ^ { - 2 d } )$ (up to higher order terms of order $O ( 2 ^ { - 2 d } )$ and $2 ^ { 2 m } - 1$ eigenvalues $2 ^ { - m - d } + O ( 2 ^ { - 2 d } )$ .
|
| 174 |
+
|
| 175 |
+
The averaged intgives some indicto hold for most ral operator in the secondon of the behavior of theif the mean embedding rt of therators is suf $\underset { \ b { \alpha } } { T } _ { \mu , m } ^ { V }$ ult is not directly meaningful, however it. In particular, we expect a similar resulttly mixed. A proof of this result would $V$ $\rho _ { \mu }$ require us to bound the variance of the matrix elements of T Vµ,m which is possible using standard formula for expectations of polynomials over the unitary group but lengthy.
|
| 176 |
+
|
| 177 |
+
Note that the dimension of the RKHS for the biased kernel $q _ { m } ^ { V }$ with $m$ -qubits is bounded by $4 ^ { m }$ . This implies that learning is possible when projecting to sufficiently low dimensional biased kernels such that the training sample size satisfies $n \gtrsim 4 ^ { m } \geq \dim ( \mathcal { F } )$ .
|
| 178 |
+
|
| 179 |
+
Let us now focus on the case $m = 1$ , that is the biased kernel is solely defined via the first qubit. Assuming that Theorem 2b) also holds for fixed $V$ we can assume that the biased kernel has the form
|
| 180 |
+
|
| 181 |
+
$$
|
| 182 |
+
q ( x , x ^ { \prime } ) \equiv q _ { 1 } ^ { V } ( x , x ^ { \prime } ) = \gamma _ { 0 } \phi _ { 0 } ( x ) \phi _ { 0 } ( x ^ { \prime } ) + \sum _ { i = 1 } ^ { 3 } \gamma _ { i } \phi _ { i } ( x ) \phi _ { i } ( x ^ { \prime } ) ,
|
| 183 |
+
$$
|
| 184 |
+
|
| 185 |
+
where $\gamma _ { 0 } = 1 / 2 + O ( 2 ^ { - 2 d } )$ and $\phi _ { 0 } ( x ) = 1$ is the constant function up to terms of order $O ( 2 ^ { - 2 d } )$ . For $i = { 1 , 2 , 3 }$ we have $\gamma _ { i } = O ( 2 ^ { - d - 1 } ) = O ( 2 ^ { - d } )$ (Fig. 2) and $\phi _ { i }$ is a function that conjectured to be exponentially hard in $d$ to compute classically [48]. It is thus impossible to include a bias towards those three eigenfunctions classically. On the other hand we can include a strong bias towards the constant eigenfunction also classically. The straightforward way to do this is to center the data in the RKHS (see Appendix B for details).
|
| 186 |
+
|
| 187 |
+
Barren plateaus. Another conclusion from Theorem 2a) is that the fluctuations of the reduced density matrix around its mean are exponentially vanishing in the number of qubits. In practice the value of the kernel would be determined by measurements and exponentially many measurements are necessary to obtain exponential accuracy of the kernel function. Therefore the theorem suggests that it is not possible in practice to learn anything beyond the constant function from generic biased kernels for (modestly) large values of $d$ . This observation is closely related to the fact that for many quantum neural networks architectures, the gradient of the parameters with respect to the loss is exponentially vanishing with the system size $d$ , a phenomenon known as Barren plateaus [24, 49].
|
| 188 |
+
|
| 189 |
+
# 5 Experiments
|
| 190 |
+
|
| 191 |
+
Since for small $d$ we can simulate the biased kernel efficiently, we illustrate our theoretical findings in the following experiments. Our implementation, building on standard open source packages [50, 51], is available online.4 We consider the case described above where we know that the data was generated by measuring an observable on the first qubit, i.e., $f ^ { * } ( x ) = \mathrm { T r } \left[ \tilde { \rho } _ { 1 } ^ { V } ( x ) M ^ { * } \right]$ , but we do not know $M ^ { * }$ , see Fig. 1. We use the full kernel $k$ and the biased kernel $q$ for the case $m = 1$ . To show the effect of selecting the wrong bias, we also include the behavior of a biased kernel defined only on the second qubit, denoted as $q _ { w }$ . As a classical reference we also include the performance of a radial basis function kernel $k _ { \mathrm { r b f } } ( \boldsymbol { x } , \boldsymbol { x } ^ { \prime } ) = \exp ( - \lVert \boldsymbol { x } - \boldsymbol { x } ^ { \prime } \rVert ^ { 2 } / 2 )$ . For the experiments we fix a single qubit observable $M ^ { * } = \sigma _ { z }$ and perform the experiment for varying number $d$ of qubits. First we draw a random unitary $V$ . The dataset is then generated by drawing $N = 2 0 0$ realizations $\{ x ^ { ( i ) } \} _ { i = 1 } ^ { N }$ from the $d$ dimensional uniform distribution on $[ 0 , 2 \pi ] ^ { d }$ . We then define the labels as $y ^ { ( i ) } = c f ^ { * } ( x ^ { ( i ) } ) + \epsilon ^ { ( i ) }$ , where $f ^ { * } ( x ) = \mathrm { T r } \left[ \tilde { \rho } ^ { V } ( x ) \sigma _ { z } \right]$ , $\epsilon ^ { ( i ) }$ is Gaussian noise with $\mathrm { V a r } [ \epsilon ] = 1 0 ^ { - 4 }$ , and $c$ is chosen such that $\operatorname { V a r } [ f ( X ) ] = 1$ . Keeping the variances fixed ensures that we can interpret the behavior for varying $d$ .
|
| 192 |
+
|
| 193 |
+
We first verify our findings from Theorem 2b) and Equation (11) by estimating the spectrum of $q$ . Fig. 2 (left) shows that Theorem 2b) also holds for individual $V$ with high probability. We then use $2 / 3$ of the data for training kernel ridge regression (we fit the mean seperately) with preset regularization, and use $1 / 3$ to estimate the test error. We average the results over ten random seeds (random $V , x ^ { ( i ) } , \epsilon ^ { ( i ) } )$ and results are reported in the right panel of Fig. 2. This showcases that as the number of qubits increases, it is impossible to learn $f ^ { * }$ without the appropriate spectral bias. $k$ and $k _ { \mathrm { r b f } }$ have too little bias and overfit, whereas $q _ { w }$ has the wrong bias and severly underfits. The performance of $q _ { w }$ underlines that randomly biasing the kernel does not significantly improve the performance over the full kernel $k$ . In the appendix we show that this is not due to a bad choice of regularization, by reporting cherry-picked results over a range of regularizations.
|
| 194 |
+
|
| 195 |
+
To further illustrate the spectral properties, we empirically estimate the kernel target alignment [30] and the task-model alignment [32] that we introduced in Sec. 2. By using the centered kernel matrix (see App. B) and centering the data we can ignore the first eigenvalue in (11) corresponding the constant function. In Figure 3 (left) we show the empirical (centered) kernel target alignment for 50 random seeds. The biased kernel is the only one well aligned with the task. The right panel of Fig. 3 shows the task model alignment. This shows that $f ^ { * }$ can be completely expressed with the first four components of the biased kernel, while the other kernels essentially need the entire spectrum (we use a sample size of 200, hence the empirical kernel matrix is only 200 dimensional) and thus are unable to learn. Note that the kernel $q _ { w }$ is four dimensional, and so higher contributions correspond to functions outside its RKHS that it actually cannot even learn at all.
|
| 196 |
+
|
| 197 |
+
# 6 Discussion
|
| 198 |
+
|
| 199 |
+
We provided an analysis of the reproducing kernel Hilbert space (RKHS) and the inductive bias of quantum kernel methods. Rather than the dimensionality of the RKHS, its spectral properties determine whether learning is feasible. Working with exponentially large RKHS comes with the risk of having a correspondingly small inductive bias. This situation indeed occurs for naive quantum encodings, and hinders learning unless datasets are of exponential size. To enable learning, we necessarily need to consider models with a stronger inductive bias. Encoding a bias towards continuous functions is likely not a promising path for a quantum advantage, as this is where classical machine learning models excel.
|
| 200 |
+
|
| 201 |
+
Our results suggest that we can only achieve a quantum advantage if we know something about the data generating process and cannot efficiently encode this classically, yet are able use this information to bias the quantum model. We indeed observe an exponential advantage in the case where we know that the data comes from a single qubit observable and constrain the RKHS accordingly. However, we find that evaluating the kernel requires exponentially many measurements, an issue related to Barren Plateaus encountered in quantum neural networks.
|
| 202 |
+
|
| 203 |
+

|
| 204 |
+
Figure 3: Histogram of the kernel target alignment over 50 runs (left) and task model alignment (right) for $d = 7$ .
|
| 205 |
+
|
| 206 |
+
With fully error-corrected quantum computers it becomes feasible to define kernels with a strong bias that do not require exponentially many measurements. An example of this kind was recently presented by Liu et al. [10]: here one knows that the target function is extremely simple after computing the discrete logarithm. A quantum computer is able to encode this inductive bias by using an efficient algorithm for computing the discrete logarithm.
|
| 207 |
+
|
| 208 |
+
However, even for fully coherent quantum computers it is unclear how we can reasonably encode a strong inductive bias about a classical dataset (e.g., images of cancer cells, climate-data, etc.). The situation might be better when working with quantum data, i.e., data that is collected via observations of systems at a quantum mechanical scale. To summarize, we conclude that there is no indication that quantum machine learning will substantially improve supervised learning on classical datasets.
|
| 209 |
+
|
| 210 |
+
# Acknowledgments and Disclosure of Funding
|
| 211 |
+
|
| 212 |
+
The authors thank the anonymous reviewers for their helpful comments that made the theorems and their proofs more accessible. This work was in part supported by the German Federal Ministry of Education and Research (BMBF) through the Tübingen AI Center (FKZ: 01IS18039B) and the Machine Learning Cluster of Excellence, EXC number 2064/1 – Project number 390727645.
|
| 213 |
+
|
| 214 |
+
# References
|
| 215 |
+
|
| 216 |
+
[1] John Preskill. Quantum computing in the NISQ era and beyond. Quantum, 2:79, 2018.
|
| 217 |
+
[2] Frank Arute, Kunal Arya, Ryan Babbush, et al. Quantum supremacy using a programmable superconducting processor. Nature, 574(7779):505–510, 2019.
|
| 218 |
+
[3] Alberto Peruzzo, Jarrod McClean, Peter Shadbolt, Man-Hong Yung, Xiao-Qi Zhou, Peter J Love, Alán Aspuru-Guzik, and Jeremy L O’brien. A variational eigenvalue solver on a photonic quantum processor. Nature Communications, 5:4213, 2014.
|
| 219 |
+
[4] Edward Farhi, Jeffrey Goldstone, and Sam Gutmann. A quantum approximate optimization algorithm. arXiv:1411.4028, 2014.
|
| 220 |
+
[5] Kosuke Mitarai, Makoto Negoro, Masahiro Kitagawa, and Keisuke Fujii. Quantum circuit learning. Phys. Rev. A, 98:032309, 2018.
|
| 221 |
+
[6] Edward Farhi and Hartmut Neven. Classification with quantum neural networks on near term processors. arXiv:1802.06002, 2018.
|
| 222 |
+
[7] Vojtech Havlí ˇ cek, Antonio D Córcoles, Kristan Temme, Aram W Harrow, Abhinav Kandala, ˇ Jerry M Chow, and Jay M Gambetta. Supervised learning with quantum-enhanced feature spaces. Nature, 567(7747):209, 2019.
|
| 223 |
+
[8] Maria Schuld and Nathan Killoran. Quantum machine learning in feature Hilbert spaces. Phys. Rev. Lett., 122:040504, 2019.
|
| 224 |
+
[9] Jonas M. Kübler, Krikamol Muandet, and Bernhard Schölkopf. Quantum mean embedding of probability distributions. Phys. Rev. Research, 1:033159, 2019.
|
| 225 |
+
[10] Yunchao Liu, Srinivasan Arunachalam, and Kristan Temme. A rigorous and robust quantum speed-up in supervised machine learning. Nature Physics, 17(9):1013–1017, 2021.
|
| 226 |
+
[11] Maria Schuld. Quantum machine learning models are kernel methods. arXiv:2101.11020, 2021.
|
| 227 |
+
[12] Hsin-Yuan Huang, Michael Broughton, Masoud Mohseni, Ryan Babbush, Sergio Boixo, Hartmut Neven, and Jarrod R. McClean. Power of data in quantum machine learning. Nature Communications, 12(1):2631, 2021.
|
| 228 |
+
[13] Aram W Harrow, Avinatan Hassidim, and Seth Lloyd. Quantum algorithm for linear systems of equations. Phys. Rev. Lett., 103(15):150502, 2009.
|
| 229 |
+
[14] Patrick Rebentrost, Masoud Mohseni, and Seth Lloyd. Quantum support vector machine for big data classification. Phys. Rev. Lett., 113(13), 2014.
|
| 230 |
+
[15] Nathan Wiebe, Daniel Braun, and Seth Lloyd. Quantum algorithm for data fitting. Phys. Rev. Lett., 109:050505, 2012.
|
| 231 |
+
[16] Seth Lloyd, Masoud Mohseni, and Patrick Rebentrost. Quantum algorithms for supervised and unsupervised machine learning. arXiv:1307.0411, 2013.
|
| 232 |
+
[17] Iordanis Kerenidis and Anupam Prakash. Quantum gradient descent for linear systems and least squares. Phys. Rev. A, 101:022316, 2020.
|
| 233 |
+
[18] Carlo Ciliberto, Andrea Rocchetto, Alessandro Rudi, and Leonard Wossnig. Statistical limits of supervised quantum learning. Physical Review A, 102(4), 2020.
|
| 234 |
+
[19] Gian Giacomo Guerreschi and Mikhail Smelyanskiy. Practical optimization for hybrid quantumclassical algorithms. arXiv:1701.01450, 2017.
|
| 235 |
+
[20] Maria Schuld, Ville Bergholm, Christian Gogolin, Josh Izaac, and Nathan Killoran. Evaluating analytic gradients on quantum hardware. Physical Review A, 99(3):032331, 2019.
|
| 236 |
+
[21] James Stokes, Josh Izaac, Nathan Killoran, and Giuseppe Carleo. Quantum natural gradient. Quantum, 4:269, 2020.
|
| 237 |
+
[22] Ryan Sweke, Frederik Wilde, Johannes Jakob Meyer, Maria Schuld, Paul K Fährmann, Barthélémy Meynard-Piganeau, and Jens Eisert. Stochastic gradient descent for hybrid quantumclassical optimization. Quantum, 4:314, 2020.
|
| 238 |
+
[23] Jonas M. Kübler, Andrew Arrasmith, Lukasz Cincio, and Patrick J. Coles. An Adaptive Optimizer for Measurement-Frugal Variational Algorithms. Quantum, 4:263, 2020.
|
| 239 |
+
[24] Jarred R. McClean, Sergio Boixo, Vadim N. Smelyanskiy, Ryan Babbush, and Hartmut Neven. Barren plateaus in quantum neural network training landscapes. Nature Communications, 9: 4812, 2018.
|
| 240 |
+
[25] Bernhard Schölkopf and Alexander J. Smola. Learning with Kernels. MIT Press, Cambridge, MA, USA, 2002.
|
| 241 |
+
[26] John Shawe-Taylor and Nello Cristianini. Kernel Methods for Pattern Analysis. Cambridge University Press, 2004.
|
| 242 |
+
[27] Maria Schuld, Ryan Sweke, and Johannes Jakob Meyer. Effect of data encoding on the expressive power of variational quantum-machine-learning models. Phys. Rev. A, 103:032430, 2021.
|
| 243 |
+
[28] Hsin-Yuan Huang, Richard Kueng, and John Preskill. Information-theoretic bounds on quantum advantage in machine learning. Phys. Rev. Lett., 126:190505, 2021.
|
| 244 |
+
[29] Robert C. Williamson, Alexander J. Smola, and Bernhard Schölkopf. Generalization performance of regularization networks and support vector machines via entropy numbers of compact operators. IEEE Transactions on Information Theory, 47(6):2516–2532, 2001.
|
| 245 |
+
[30] Nello Cristianini, Jaz Kandola, Andre Elisseeff, and John Shawe-Taylor. On kernel target alignment. In Dawn E. Holmes and Lakhmi C. Jain, editors, Innovations in Machine Learning: Theory and Applications, pages 205–256. Springer Berlin Heidelberg, 2006.
|
| 246 |
+
[31] Corinna Cortes, Mehryar Mohri, and Afshin Rostamizadeh. Algorithms for learning kernels based on centered alignment. Journal of Machine Learning Research, 13(28):795–828, 2012.
|
| 247 |
+
[32] Abdulkadir Canatar, Blake Bordelon, and Cengiz Pehlevan. Spectral bias and task-model alignment explain generalization in kernel regression and infinitely wide neural networks. Nature Communications, 12(1):2914, 2021.
|
| 248 |
+
[33] Arthur Jacot, Berfin Simsek, Francesco Spadaro, Clement Hongler, and Franck Gabriel. Kernel alignment risk estimator: Risk prediction from training data. In NeurIPS, 2020.
|
| 249 |
+
[34] Bernhard Schölkopf, Ralf Herbrich, and Alexander J. Smola. A generalized representer theorem. In COLT, 2001.
|
| 250 |
+
[35] Thomas Hubregtsen, David Wierichs, Elies Gil-Fuster, Peter-Jan H. S. Derks, Paul K. Faehrmann, and Johannes Jakob Meyer. Training quantum embedding kernels on near-term quantum computers. arXiv:2105.02276, 2021.
|
| 251 |
+
[36] Michael A. Nielsen and Isaac L. Chuang. Quantum Computation and Quantum Information: 10th Anniversary Edition. Cambridge University Press, 2010.
|
| 252 |
+
[37] Xinbiao Wang, Yuxuan Du, Yong Luo, and Dacheng Tao. Towards understanding the power of quantum kernels in the NISQ era. Quantum, 5:531, 2021.
|
| 253 |
+
[38] Evan Peters, João Caldeira, Alan Ho, Stefan Leichenauer, Masoud Mohseni, Hartmut Neven, Panagiotis Spentzouris, Doug Strain, and Gabriel N. Perdue. Machine learning of high dimensional data on a noisy quantum processor. arXiv:2101.09581, 2021.
|
| 254 |
+
[39] Adrián Pérez-Salinas, Alba Cervera-Lierta, Elies Gil-Fuster, and José I. Latorre. Data reuploading for a universal quantum classifier. Quantum, 4:226, 2020.
|
| 255 |
+
[40] M. Cerezo, Andrew Arrasmith, Ryan Babbush, Simon C. Benjamin, Suguru Endo, Keisuke Fujii, Jarrod R. McClean, Kosuke Mitarai, Xiao Yuan, Lukasz Cincio, and Patrick J. Coles. Variational quantum algorithms. Nature Reviews Physics, 3(9):625–644, 2021.
|
| 256 |
+
[41] Kishor Bharti, Alba Cervera-Lierta, Thi Ha Kyaw, et al. Noisy intermediate-scale quantum (nisq) algorithms. arXiv:2101.08448, 2021.
|
| 257 |
+
[42] Leo Breiman. Random forests. Mach. Learn., 45(1):5–32, 2001.
|
| 258 |
+
[43] Andrea Caponnetto and Ernesto De Vito. Optimal rates for the regularized least-squares algorithm. Foundations of Computational Mathematics, 7(3):331–368, 2007.
|
| 259 |
+
[44] Ingo Steinwart, Don R. Hush, and Clint Scovel. Optimal rates for regularized least squares regression. In COLT, 2009.
|
| 260 |
+
[45] Simon Fischer and Ingo Steinwart. Sobolev norm learning rates for regularized least-squares algorithms. Journal of Machine Learning Research, 21(205):1–38, 2020.
|
| 261 |
+
[46] Krikamol Muandet, Kenji Fukumizu, Bharath K. Sriperumbudur, and Bernhard Schölkopf. Kernel mean embedding of distributions: A review and beyond. Found. Trends Mach. Learn., 10(1-2):1–141, 2017.
|
| 262 |
+
[47] Mehryar Mohri, Afshin Rostamizadeh, and Ameet Talwalkar. Foundations of Machine Learning. Adaptive computation and machine learning. MIT Press, 2012.
|
| 263 |
+
[48] Aram W. Harrow and Ashley Montanaro. Quantum computational supremacy. Nature, 549 (7671):203–209, 2017.
|
| 264 |
+
[49] M. Cerezo, Akira Sone, Tyler Volkoff, Lukasz Cincio, and Patrick J. Coles. Cost function dependent barren plateaus in shallow parametrized quantum circuits. Nature Communications, 12(1):1791, 2021.
|
| 265 |
+
[50] Fabian Pedregosa, Gaël Varoquaux, Alexandre Gramfort, et al. Scikit-learn: Machine learning in Python. Journal of Machine Learning Research, 12:2825–2830, 2011.
|
| 266 |
+
[51] Ville Bergholm, Josh Izaac, Maria Schuld, Christian Gogolin, and Nathan Killoran. Pennylane: Automatic differentiation of hybrid quantum-classical computations. arXiv:1811.04968, 2018.
|
| 267 |
+
[52] Vern I. Paulsen and Mrinal Raghupathi. An Introduction to the Theory of Reproducing Kernel Hilbert Spaces. Cambridge Studies in Advanced Mathematics. Cambridge University Press, 2016.
|
| 268 |
+
[53] Zbigniew Puchała and Jarosław A. Miszczak. Symbolic integration with respect to the haar measure on the unitary groups. Bulletin of the Polish Academy of Sciences: Technical Sciences, 65(No 1):21–27, 2017.
|
| 269 |
+
[54] Christoph Dankert, Richard Cleve, Joseph Emerson, and Etera Livine. Exact and approximate unitary 2-designs and their application to fidelity estimation. Phys. Rev. A, 80:012304, 2009.
|
md/train/j9Rv7qdXjd/j9Rv7qdXjd.md
ADDED
|
@@ -0,0 +1,486 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# INTERPRETABLE NEURAL ARCHITECTURE SEARCH VIA BAYESIAN OPTIMISATION WITH WEISFEILERLEHMAN KERNELS
|
| 2 |
+
|
| 3 |
+
Binxin $\mathbf { R } \mathbf { u } ^ { * }$ , Xingchen Wan∗, Xiaowen Dong, Michael A. Osborne
|
| 4 |
+
Machine Learning Research Group
|
| 5 |
+
University of Oxford, UK
|
| 6 |
+
{robin, xwan, xdong, mosb}@robots.ox.ac.uk
|
| 7 |
+
|
| 8 |
+
# ABSTRACT
|
| 9 |
+
|
| 10 |
+
Current neural architecture search (NAS) strategies focus only on finding a single, good, architecture. They offer little insight into why a specific network is performing well, or how we should modify the architecture if we want further improvements. We propose a Bayesian optimisation (BO) approach for NAS that combines the Weisfeiler-Lehman graph kernel with a Gaussian process surrogate. Our method optimises the architecture in a highly data-efficient manner: it is capable of capturing the topological structures of the architectures and is scalable to large graphs, thus making the high-dimensional and graph-like search spaces amenable to BO. More importantly, our method affords interpretability by discovering useful network features and their corresponding impact on the network performance. Indeed, we demonstrate empirically that our surrogate model is capable of identifying useful motifs which can guide the generation of new architectures. We finally show that our method outperforms existing NAS approaches to achieve the state of the art on both closed- and open-domain search spaces.
|
| 11 |
+
|
| 12 |
+
# 1 INTRODUCTION
|
| 13 |
+
|
| 14 |
+
Neural architecture search (NAS) aims to automate the design of good neural network architectures for a given task and dataset. Although different NAS strategies have led to state-of-the-art neural architectures, outperforming human experts’ design on a variety of tasks (Real et al., 2017; Zoph and Le, 2017; Cai et al., 2018; Liu et al., 2018a;b; Luo et al., 2018; Pham et al., 2018; Real et al., 2018; Zoph et al., 2018a; Xie et al., 2018), these strategies behave in a black-box fashion, which returns little design insight except for the final architecture for deployment. In this paper, we introduce the idea of interpretable NAS, extending the learning scope from simply the optimal architecture to interpretable features. These features can help explain the performance of networks searched and guide future architecture design. We make the first attempt at interpretable NAS by proposing a new NAS method, NAS-BOWL; our method combines a Gaussian process (GP) surrogate with the Weisfeiler-Lehman (WL) subtree graph kernel (we term this surrogate GPWL) and applies it within the Bayesian Optimisation (BO) framework to efficiently query the search space. During search, we harness the interpretable architecture features extracted by the WL kernel and learn their corresponding effects on the network performance based on the surrogate gradient information.
|
| 15 |
+
|
| 16 |
+
Besides offering a new perspective on interpratability, our method also improves over the existing BO-based NAS approaches. To accommodate the popular cell-based search spaces, which are noncontinuous and graph-like (Zoph et al., 2018a; Ying et al., 2019; Dong and Yang, 2020), current approaches either rely on encoding schemes (Ying et al., 2019; White et al., 2019) or manually designed similarity metrics (Kandasamy et al., 2018), both of which are not scalable to large architectures and ignore the important topological structure of architectures. Another line of work employs graph neural networks (GNNs) to construct the BO surrogate (Ma et al., 2019; Zhang et al., 2019; Shi et al., 2019); however, the GNN design introduces additional hyperparameter tuning, and the training of the GNN also requires a large amount of architecture data, which is particularly expensive to obtain in NAS. Our method, instead, uses the WL graph kernel to naturally handle the graph-like search spaces and capture the topological structure of architectures. Meanwhile, our surrogate preserves the merits of GPs in data-efficiency, uncertainty computation and automated hyperparameter treatment. In summary, our main contributions are as follows:
|
| 17 |
+
|
| 18 |
+
• We introduce a GP-based BO strategy for NAS, NAS-BOWL, which is highly query-efficient and amenable to the graph-like NAS search spaces. Our proposed surrogate model combines a GP with the WL graph kernel (GPWL) to exploit the implicit topological structure of architectures. It is scalable to large architecture cells (e.g. 32 nodes) and can achieve better prediction performance than competing methods.
|
| 19 |
+
• We propose the idea of interpretable NAS based on the graph features extracted by the WL kernel and their corresponding surrogate derivatives. We show that interpretability helps in explaining the performance of the searched neural architectures. As a singular example of concrete application, we propose a simple yet effective motif-based transfer learning baseline to warm-start search on a new image tasks.
|
| 20 |
+
• We demonstrate that our surrogate model achieves superior performance with much fewer observations in search spaces of different sizes, and that our strategy both achieves state-of-the-art performances on both NAS-Bench datasets and open-domain experiments while being much more efficient than comparable methods.
|
| 21 |
+
|
| 22 |
+
# 2 PRELIMINARIES
|
| 23 |
+
|
| 24 |
+
Graph Representation of Neural Networks Architectures in popular NAS search spaces can be represented as an acyclic directed graph (Elsken et al., 2018; Zoph et al., 2018b; Ying et al., 2019; Dong and Yang, 2020; Xie et al., 2019), where each graph node represents an operation unit or layer (e.g. a conv $3 \times 3 - \mathrm { b n - r e l u }$ in Ying et al. (2019)) and each edge defines the information flow from one layer to another. With this representation, NAS can be formulated as an optimisation problem to find the directed graph and its corresponding node operations (i.e. the directed attributed graph $G$ ) that give the best architecture validation performance $y ( G )$ : $G ^ { * } = \arg \operatorname* { m a x } _ { G } y ( G )$ .
|
| 25 |
+
|
| 26 |
+
Bayesian Optimisation and Gaussian Processes To solve the above optimisation, we adopt BO, which is a query-efficient technique for optimising a black-box, expensive-to-evaluate objective (Brochu et al., 2010). BO uses a statistical surrogate to model the objective and builds an acquisition function based on the surrogate. The next query location is recommended by optimising the acquisition function which balances the exploitation and exploration. We use a GP as the surrogate model in this work, as it can achieve competitive modelling performance with small amount of query data (Williams and Rasmussen, 2006) and give analytic predictive posterior mean $\mu ( G _ { t } | \mathcal { \bar { D } } _ { t - 1 } )$ and variance $k ( G _ { t } , G _ { t } ^ { \prime } | \mathcal { D } _ { t - 1 } )$ on the heretofore unseen graph $G _ { t }$ given $t - 1$ observations: $\mu ( G _ { t } | \mathcal { D } _ { t - 1 } ) \ = \ \mathbf { k } ( G _ { t } , G _ { 1 : t - 1 } ) \mathbf { K } _ { 1 : t - 1 } ^ { - 1 } \mathbf { y } _ { 1 : t - 1 }$ and $k ( G _ { t } , G _ { t } ^ { \prime } | \mathcal { D } _ { t - 1 } ) \ =$ $k ( G _ { t } , G _ { t } ^ { \prime } ) - \mathbf { k } ( G _ { t } , G _ { 1 : t - 1 } ) \mathbf { K } _ { 1 : t - 1 } ^ { - 1 } \mathbf { k } ( G _ { 1 : t - 1 } , G _ { t } ^ { \prime } )$ where $G _ { 1 : t - 1 } = \{ G _ { 1 } , \dots , G _ { t - 1 } \}$ and $\mathbf { y } _ { 1 : t - 1 } =$ $[ y _ { 1 } , \dotsc , y _ { t - 1 } ] ^ { \mathrm { T } }$ are the $t - 1$ observed graphs and objective function values, respectively, and $\mathcal { D } _ { t - 1 } = \{ G _ { 1 : t - 1 } , \mathbf { y } _ { 1 : t - 1 } \}$ . $[ \mathbf { K } _ { 1 : t - 1 } ] _ { i , j } = \bar { k } ( \bar { G } _ { i } , G _ { j } )$ is the $( i , j )$ -th element of Gram matrix induced on the $( i , j )$ -th training samples by $k ( \cdot , \cdot )$ , the graph kernel function. We use Expected Improvement (Mockus et al., 1978) in this work though our approach is compatible with alternative choices.
|
| 27 |
+
|
| 28 |
+
Graph Kernels Graph kernels are kernel functions defined over graphs to compute their level of similarity. A generic graph kernel may be represented by the function $k ( \cdot , \cdot )$ over a pair of graphs $G$ and $G ^ { \prime }$ (Kriege et al., 2020):
|
| 29 |
+
|
| 30 |
+
$$
|
| 31 |
+
k ( G , G ^ { \prime } ) = \langle \phi ( G ) , \phi ( G ^ { \prime } ) \rangle _ { \mathcal { H } }
|
| 32 |
+
$$
|
| 33 |
+
|
| 34 |
+
where $\phi ( \cdot )$ is some feature representation of the graph extracted by the graph kernel and $\langle \cdot , \cdot \rangle _ { \mathscr { H } }$ denotes inner product in the associated reproducing kernel Hilbert space (RKHS) (Nikolentzos et al., 2019; Kriege et al., 2020). For more detailed reviews on graph kernels, the readers are referred to Nikolentzos et al. (2019), Ghosh et al. (2018) and Kriege et al. (2020).
|
| 35 |
+
|
| 36 |
+
# Algorithm 1 NAS-BOWL Algorithm.
|
| 37 |
+
|
| 38 |
+
Optional steps of the exemplary use of motifbased warm starting (Sec 3.2) are marked in gray italics.
|
| 39 |
+
|
| 40 |
+
1: Input: Maximum BO iterations $T$ , BO batch size $b$ , acquisition function $\alpha ( \cdot )$ , initial observed data on the target task $\mathcal { D } _ { 0 }$ , Optional: past-task query data $ { \mathcal { D } } _ { \mathrm { p a s t } }$ and surrogate $S _ { \mathrm { p a s t } }$
|
| 41 |
+
2: Output: The best architecture $G _ { T } ^ { * }$
|
| 42 |
+
3: Initialise the GPWL surrogate $s$ with $\mathcal { D } _ { 0 }$
|
| 43 |
+
4: for $t = 1 , \dots , T$ do
|
| 44 |
+
5: if Pruning based on the past-task motifs then
|
| 45 |
+
6: Compute the motif importance scores (equation 3.4) with $S _ { \mathrm { p a s t } } / S$ on $\mathcal { D } _ { \mathrm { p a s t } } / \mathcal { D } _ { t }$
|
| 46 |
+
7: while $| { \mathcal { G } } _ { t } | < B$ do
|
| 47 |
+
8: Generate a batch of candidate architectures and reject those which contain none of the top $2 5 \%$ good motifs (similar procedure as Fig. 2(a))
|
| 48 |
+
9: end while
|
| 49 |
+
10: else
|
| 50 |
+
11: Generate $B$ candidate architectures $\mathcal { G } _ { t }$
|
| 51 |
+
12: end if
|
| 52 |
+
13: $\{ G _ { t , i } \} _ { i = 1 } ^ { b } = \arg \operatorname* { m a x } _ { G \in { \mathcal { G } } _ { t } } \alpha _ { t } ( G | \mathcal { D } _ { t - 1 } )$
|
| 53 |
+
14: Evaluate their validation accuracy $\{ y _ { t , i } \} _ { i = 1 } ^ { b }$
|
| 54 |
+
15: $\mathcal { D } _ { t } \mathcal { D } _ { t - 1 } \cup ( \{ G _ { t , i } \} _ { i = 1 } ^ { B } , \{ y _ { t , i } \} _ { i = 1 } ^ { b } )$
|
| 55 |
+
16: Update the surrogate $s$ with $\mathcal { D } _ { t }$
|
| 56 |
+
17: end for
|
| 57 |
+
18: Return the best architecture seen so far $G _ { T } ^ { * }$
|
| 58 |
+
|
| 59 |
+

|
| 60 |
+
Figure 1: Illustration of one WL iteration. Given two architecture cells at initialisation, WL kernel first collects the neighbourhood labels of each node (Step 1) and compress the collected $h = 0$ labels into $h = 1$ features (Step 2). Each node is then relabelled with $h = 1$ features (Step 3) and the two graphs are compared based on the histogram on both $h = 0$ and $h = 1$ features (Step 4). This WL iteration will be repeated until $h = H$ .
|
| 61 |
+
|
| 62 |
+
# 3 PROPOSED METHOD
|
| 63 |
+
|
| 64 |
+
We begin by presenting our proposed algorithm, NAS-BOWL in Algorithm 1, where there are a few key design features, namely the design of the GP surrogate suitable for architecture search (we term the surrogate GPWL) and the method to generate candidate architectures at each BO iteration. We will discuss the first one in Section 3.1. For architecture generation, we either generate the new candidates via random sampling the adjacency matrices, or use a mutation algorithm similar to those used in a number of previous works (Kandasamy et al., 2018; Ma et al., 2019; White et al., 2019; Shi et al., 2019): at each iteration, we generate the architectures by mutating a number of queried architectures that perform the best. Generating candidate architectures in this way enables us to exploit the prior information on the best architectures observed so far to explore the large search space more efficiently. We report NAS-BOWL with both strategies in our experiments. Finally, to give a demonstration of the new possibilities opened by our work, we give an exemplary practical use of intepretable motifs for transfer learning in Algorithm 1, which is elaborated in Sec 3.2.
|
| 65 |
+
|
| 66 |
+
# 3.1 SURROGATE AND GRAPH KERNEL DESIGN
|
| 67 |
+
|
| 68 |
+
To enable the GP to work effectively on the graph-like architecture search space, selecting a suitable kernel function is arguably the most important design decision. We propose to use the WeisfeilerLehman (WL) graph kernel (Shervashidze et al., 2011) to enable the direct definition of a GP surrogate on the graph-like search space. The WL kernel compares two directed graphs based on both local and global structures. It starts by comparing the node labels of both graphs via a base kernel $k _ { \mathrm { b a s e } } \big ( \phi _ { 0 } ( { \mathbf { \bar { G } } } ) , \phi _ { 0 } ( G ^ { \prime } ) \big )$ where $\phi _ { 0 } ( G )$ denotes the histogram of features at level $h = 0$ (i.e. node features) in the graph, where $h$ is both the index of WL iterations and the depth of the subtree features extracted. For the WL kernel with $h > 0$ , as shown in Fig. 1, it then proceeds to collect features at $h = 1$ by aggregating neighbourhood labels, and compare the two graphs with $k _ { \mathrm { b a s e } } \big ( \phi _ { 1 } ( G ) , \phi _ { 1 } ( G ^ { \prime } ) \big )$ based on the subtree structures of depth 1 (Shervashidze et al., 2011; Höppner and Jahnke, 2020).
|
| 69 |
+
|
| 70 |
+
The procedure then repeats until the highest iteration level $h = H$ specified and the resulting WL kernel is given by:
|
| 71 |
+
|
| 72 |
+
$$
|
| 73 |
+
k _ { \mathrm { W L } } ^ { H } ( G , G ^ { \prime } ) = \sum _ { h = 0 } ^ { H } k _ { \mathrm { b a s e } } \bigl ( \phi _ { h } ( G ) , \phi _ { h } ( G ^ { \prime } ) \bigr ) .
|
| 74 |
+
$$
|
| 75 |
+
|
| 76 |
+
In the above equation, $k _ { \mathrm { b a s e } }$ is a base kernel (such as dot product) over the vector feature embedding. As $h$ increases, the WL kernel captures higher-order features which correspond to increasingly larger neighbourhoods and features at each $h$ are concatenated to form the the final feature vector $( \phi ( G ) = [ \phi _ { 0 } ( G ) , . . . , \phi _ { H } ( G ) ] )$ . The readers are referred to App. A for more detailed algorithmic descriptions of the WL kernel.
|
| 77 |
+
|
| 78 |
+
We argue that WL is desirable for three reasons. First, in contrast to many ad hoc approaches, WL is established with proven successes on labelled and directed graphs, by which networks are represented. Second, the WL representation of graphs is expressive, topology-preserving yet interpretable: Morris et al. (2019) show that WL is as powerful as standard GNNs in terms of discrimination power. However, GNNs requires relatively large amount of training data and thus is more data-inefficient (we validate this in Sec. 5). Also, the features extracted by GNNs are harder to interpret compared to those by WL. Note that the WL kernel by itself only measures the similarity between graphs and does not aim to select useful substructures explicitly. It is our novel deployment of the WL procedure (App. A) for the NAS application that leads to the extraction of interpretable features while comparing different architectures. We further make smart use of these network features to help explain the architecture performance in Sec 3.2. Finally, WL is efficient and scalable: denoting $\{ n , m \}$ as the number of nodes and edges respectively, computing the Gram matrix on $N$ training graphs may scale $\mathcal { O } ( N H m + N ^ { 2 } H n )$ (Shervashidze et al., 2011). As we show in App. E.3, in typical cell-based spaces $H \leq 3$ suffices, suggesting that the kernel computation cost is likely eclipsed by the $\mathcal { O } ( N ^ { 3 } )$ scaling of GP we incur nonetheless. This is to be contrasted to approaches such as path encoding in White et al. (2019), which scales exponentially with $n$ without truncation, and the edit distance kernel in Jin et al. (2019), whose exact solution is NP-complete (Zeng et al., 2009).
|
| 79 |
+
|
| 80 |
+
With the above-mentioned merits, the incorporation of the WL kernel permits the usage of GP-based BO on various NAS search spaces. This enables the practitioners to harness the rich literature of GP-based BO methods on hyperparameter optimisation and redeploy them on NAS problems. Most prominently, the use of GP surrogate frees us from hand-picking the WL hyperparameter $H$ as we can automatically learn the optimal values by maximising the Bayesian marginal likelihood. As we will justify in Sec. 5 and App. E.3, this process is extremely effective. This renders a further major advantage of our method as it has no inherent hyperparameters that require manual tuning. This reaffirms with our belief that a practical NAS method itself should require minimum tuning, as it is almost impossible to run traditional hyperparameter search given the vast resources required. Other enhancements, such as improving the expressiveness of the surrogate by combining multiple types of kernels, are briefly investigated in App. C. We find the amount of performance gain depends on the NAS search space and a WL kernel alone suffices for common cell-based spaces.
|
| 81 |
+
|
| 82 |
+
# 3.2 INTERPRETABLE NAS
|
| 83 |
+
|
| 84 |
+
The unique advantage of the WL kernel is that it extracts interpretable features, i.e. network motifs from the original graphs. This in combination with our GP surrogate enables us to predict the effect of the extracted features on the architecture performance directly by examining the derivatives of the GP predictive mean w.r.t. the features. Derivatives as tools to interpret ML models have been used previously (Engelbrecht et al., 1995; Koh and Liang, 2017; Ribeiro et al., 2016) but, given the GP, we can compute these derivatives analytically. Following the notations in Sec. 2, the derivative with respect to $\phi ^ { j } ( G _ { t } )$ , the $j$ -th element of $\phi ( G _ { t } )$ (the feature vector of a graph $G _ { t }$ ) is Gaussian with an expected value:
|
| 85 |
+
|
| 86 |
+
$$
|
| 87 |
+
\mathbb { E } _ { p ( y | G _ { t } , \mathcal { D } _ { t - 1 } ) } \Big [ \frac { \partial y } { \partial \phi ^ { j } ( G _ { t } ) } \Big ] = \frac { \partial \mu } { \partial \phi ^ { j } ( G _ { t } ) } = \frac { \partial \langle \phi ( G _ { t } ) , \Phi _ { 1 : t - 1 } \rangle } { \partial \phi ^ { j } ( G _ { t } ) } \mathbf { K } _ { 1 : t - 1 } ^ { - 1 } \mathbf { y } _ { 1 : t - 1 }
|
| 88 |
+
$$
|
| 89 |
+
|
| 90 |
+
where $\Phi _ { 1 : t - 1 } = [ \phi ( G _ { 1 } ) , \dots , \phi ( G _ { t - 1 } ) ] ^ { \mathrm { T } }$ is the feature matrix stacked from the feature vectors of the previous observations. Intuitively, since each $\phi ^ { j } ( G _ { t } )$ denotes the count of a WL feature in $G _ { t }$ , its derivative naturally encodes the direction and sensitivity of the objective (in this case the predicted validation accuracy) about that feature. Computationally, since the costly term, $\mathbf { K } _ { 1 : t - 1 } ^ { - 1 } \mathbf { \dot { y } } _ { 1 : t - 1 }$ , is already computed in the posterior mean, the derivatives can be obtained at minimal additional cost.
|
| 91 |
+
|
| 92 |
+

|
| 93 |
+
|
| 94 |
+
(a) Best and worst motifs identified on N201 (CIFAR-10) dataset using 300 training samples (left) and on DARTS search space after 3 GPU days of search by NAS-BOWL (right). For DARTS space, the motif boxed in pink is featured in all optimal cells found by various NAS methods in Fig 3.
|
| 95 |
+
|
| 96 |
+

|
| 97 |
+
Figure 2: Motif discovery on N201 (CIFAR-10) and DARTS spaces.
|
| 98 |
+
|
| 99 |
+
(b) Validation accuracy distributions of the validation architectures on different tasks of N201 (left 3) and DARTS (right). all denotes the entire validation set, while good/bad denote the distributions of the architectures with at least 1 best/worst motif, respectively; dashed lines denote the distribution medians. Note that in all cases, the good subset includes the population max and in N201, the patterns solely trained on the CIFAR-10 task also transfer well to CIFAR-100/ImageNet16.
|
| 100 |
+
|
| 101 |
+
By evaluating the aforementioned derivative at some graph $G$ , we obtain the local sensitivities of the objective function around $\phi ( G )$ . To achieve global attribution of network performance w.r.t interpretable features which we are ultimately interested in, we take inspirations from the principled averaging approach featured in many gradient-based attribution methods (Sundararajan et al., 2017; Ancona et al., 2017), by computing and integrating over the aforementioned derivatives at all training samples to obtain the averaged gradient (AG). AG of the $j$ -th feature $\phi _ { j }$ is given by:
|
| 102 |
+
|
| 103 |
+
$$
|
| 104 |
+
\mathrm { A G } ( \phi ^ { j } ) = \mathbb { E } _ { G } \Big [ \frac { \partial \mu } { \partial \phi ^ { j } ( G ) } \Big ] = \int _ { \phi ^ { j } ( G ) > 0 } \frac { \partial \mu } { \partial \phi ^ { j } ( G ) } p ( \phi ^ { j } ( G ) ) d \phi ^ { j } ( G ) .
|
| 105 |
+
$$
|
| 106 |
+
|
| 107 |
+
Fortunately, in WL kernel, $\phi ^ { j } ( \cdot ) \in \mathbb { Z } ^ { \geq 0 } \forall j$ and thus $p ( \phi ^ { j } ( \cdot ) )$ is discrete, the expectation integral reduces to a weighted summation over the “prior” distribution $p ( \phi ^ { j } ( \cdot ) ) \forall j$ . To approximate $p ( \phi ^ { j } ( \cdot ) )$ , we count the number of occurrences of each feature $\phi ^ { j } ( G _ { n } )$ in all the training graphs $\{ G _ { 1 } , . . . , G _ { t - 1 } \}$ where $\phi ^ { j } ( \cdot )$ is present and assign weights according to its frequency of occurrence. Formally, denoting $\mathcal { G }$ as the subset of the training graphs where for each of its element $\phi ^ { j } > 0$ , we have
|
| 108 |
+
|
| 109 |
+
$$
|
| 110 |
+
\mathbf { A G } ( \phi ^ { j } ) \approx \frac { \sum _ { n = 1 } ^ { | \mathcal { G } | } w _ { n } ( \phi _ { j } ) \frac { \partial \mu } { \partial \phi ^ { j } ( G _ { n } ) } } { \sum _ { n = 1 } ^ { | \mathcal { G } | } w _ { n } ( \phi _ { j } ) } \mathrm { ~ w h e r e ~ } w _ { n } ( \phi _ { j } ) = \frac { 1 } { | \mathcal { G } | } \sum _ { n ^ { \prime } = 1 } ^ { | \mathcal { G } | } \delta ( \phi _ { j } ( G _ { n } ) , \phi _ { j } ( G _ { n ^ { \prime } } ) )
|
| 111 |
+
$$
|
| 112 |
+
|
| 113 |
+
where $\delta ( \cdot , \cdot )$ is the Kronecker delta function and $| \cdot |$ the cardinality of a set. Finally, we additionally incorporate the uncertainty of the derivative estimation by also normalising AG with the square root of the empirical variance (EV) to penalise high-variance (hence less trustworthy as a whole) gradient estimates closer to 0. EV may be straightforwardly computed:
|
| 114 |
+
|
| 115 |
+
$$
|
| 116 |
+
\operatorname { E V } ( \phi ^ { j } ) = \mathbb { V } _ { G } { \Big [ } { \frac { \partial \mu } { \partial \phi ^ { j } ( G ) } } { \Big ] } = \mathbb { E } _ { G } { \Big [ } { \big ( } { \frac { \partial \mu } { \partial \phi ^ { j } ( G ) } } { \big ) } ^ { 2 } { \Big ] } - { \Big ( } \mathbb { E } _ { G } { \big [ } { \frac { \partial \mu } { \partial \phi ^ { j } ( G ) } } { \Big ] } { \Big ) } ^ { 2 } .
|
| 117 |
+
$$
|
| 118 |
+
|
| 119 |
+
The resultant derivatives w.r.t. interpretable features $\mathrm { A G } ( \phi ^ { j } ) / \sqrt { \mathrm { E V } ( \phi ^ { j } ) }$ allow us to directly identify the most influential motifs on network performance. By considering the presence or absence of such motifs, we may explain the competitiveness of an architecture or the lack of it, provided the surrogate is accurate which we show is the case in Sec. 5. More importantly, beyond passive explaining, we can also actively use these features as building blocks to facilitate manual construction of promising networks, or as priors to prune the massive NAS search space, which we believe would be of interest to both human designers and NAS practitioners. To validate this, we train our GPWL on architectures drawn from various search spaces, rank all the features based on their computed derivatives and show the motifs with most positive and negative derivatives (hence the most and least desirable features)1.
|
| 120 |
+
|
| 121 |
+

|
| 122 |
+
Figure 3: Best cells discovered by (left to right) DARTS, ENAS, LaNet, BOGCN and NAS-BOWL (ours) in the DARTS search space. Note the dominance of separable convolutions (especially 3x3) in operation nodes (i.e. nodes excluding input, output and add) and the presence of highlighted structures encompassing the boxed motif in Fig. 2 in all cells.
|
| 123 |
+
|
| 124 |
+
We present the extracted network motifs on the CIFAR-10 task of NAS-Bench-201 (N201) (Dong and Yang, 2020) and DARTS search space in Fig. 2(a). The motifs extracted on other N201 image tasks (CIFAR-100/ImageNet16) and on NAS-Bench-101 (N101) (Ying et al., 2019) are shown in App. D.2. The results reveal some interesting insights on network performance: for example, almost every good motif in N201 contains $\mathsf { C o n v \_ 3 } \times 3$ and all-but-one good motifs in the DARTS results contain at least one separable conv_ $. 3 \times 3$ . In fact, this preference over (separable) convolutions is almost universally observed in many popular NAS methods (Liu et al., 2018a; Shi et al., 2019; Wang et al., 2019; Pham et al., 2018) and ours: besides skip links, the operations in their best cells are dominated by separable convolutions (Fig. 3). Moving from node operation label to higher-order topological features, in both search spaces, our GPWL consistently finds a series of high-performing motifs that entail the parallel connection from input to multiple convs often of different filter sizes – this corresponds to the grouped convolution unit critical to the success of, e.g. ResNeXt (Xie et al., 2017). A specific example is the boxed motif in Fig. 2(a), which combines parallel convs with a skip link. This motif or other highly similar ones are consistently present in the optimal cells found by many NAS methods including ours (as shown in Fig. 3) despite the disparity in their search strategies. This suggests a correlation between these motifs and good architecture performance. Another observation is that a majority of the important motifs for both search spaces in Fig. 2(a) involve the input. From this and our previous remarks on the consensus amongst NAS methods in favouring certain operations and connections, we hypothesise that at least for a cell-based search space, the network performance might be determined more by the connections in the vicinity to the inputs (on which the optimal cells produced by different NAS methods are surprisingly consistent) than other parts of the network (on which they differ). This phenomenon is partly observed in Shu et al. (2019), where the authors found that NAS algorithms tend to favour architecture cells with most intermediate nodes having direct connection with the input nodes. The verification of this hypothesis is beyond the scope of this paper, but this shows the potential of our GPWL in discovering novel yet interpretable network features, with potential implications for both NAS and manual network design.
|
| 125 |
+
|
| 126 |
+
Going beyond the qualitative arguments above, we now quantitatively validate the informativeness of the motifs discovered. After identifying the motifs, in N201, we randomly draw another 1,000 validation architectures unseen by the surrogate. Given the motifs identified in Fig. 2(a), an architecture is labelled either “good” $\geq 1$ good motif), “bad” $\geq 1$ bad motif) or neither. Note if an architecture contains both good and bad motifs, it is both “good” and “bad”. As demonstrated in Fig. 2(b), we indeed find that the presence of important motifs is predictive of network performance. A similar conclusion holds for DARTS space. However, due to the extreme cost in sampling the open-domain space, we make two modifications to our strategy. Firstly, the training samples are taken from a BO run, instead of randomly sampled. Secondly, we reuse the training samples for Fig. 2(b) instead of sampling and evaluating the hold-out sets. The key takeaway here is that motifs are effective in identifying promising and unpromising candidates, and thus can be used to aid NAS agents to partition the vast combinatorial search space, which is often considered a key challenge of NAS, and to focus on the most promising sub-regions. More importantly, the motifs are also transferable: while the patterns in Fig. 2(a) are solely trained on the CIFAR-10, they generalise well to CIFAR-100/ImageNet16 tasks – this is unsurprising, as one key motivation of cell-based search space is exactly to improve transferability of the learnt structure across related tasks (Zoph et al., 2018a). Given that motifs are the building blocks of the cells, we expect them to transfer well, too.
|
| 127 |
+
|
| 128 |
+
With this, we propose a simple transfer learning baseline as a singular demonstration of how motifs could be practically useful for NAS. Specifically, we can exploit the motifs identified on one task to warm-start the search on a related new task. With reference to Algorithm 1, under the transfer learning setup, we use a GPWL surrogate trained on the query data of a past related task $ { S _ { \mathrm { p a s t } } }$ as well as the surrogate on the new target task $\boldsymbol { S }$ to compute the AG of motifs present in queried architectures (equation 3.4) and identify the most positively influential motifs similar to Fig. 2(a) (Line 3). We then use these motifs to generate a set of candidate architectures $\mathcal { G } _ { t }$ for optimising the acquisition function at every BO iteration on the new task; Specifically, we only accept a candidate if it contains at least one of the top $2 5 \%$ good motifs (i.e. pruning rule). Finally, with more query data obtained on the target task, we will dynamically update the surrogate $s$ and the motif scores to mitigate the risk of discarding motifs purely based on the past task data. Through this, we force the BO agent to select from a smaller subset of architectures deemed more promising from a previous task, thereby “warm starting” the new task. We briefly validate this proposal in the N201 experiments of Sec. 5.
|
| 129 |
+
|
| 130 |
+
# 4 RELATED WORK
|
| 131 |
+
|
| 132 |
+
In terms of NAS strategies, there have been several recent attempts in using BO (Kandasamy et al., 2018; Ying et al., 2019; Ma et al., 2019; Shi et al., 2019; White et al., 2019). To overcome the limitations of conventional BO for discrete and graph-like NAS search spaces, Kandasamy et al. (2018) use optimal transport to design a similarity measure among neural architectures while Ying et al. (2019) and White et al. (2019) suggest encoding schemes to characterise neural architectures with discrete and categorical variables. Yet, these methods are either computationally inefficient or not scalable to large architectures/cells (Shi et al., 2019; White et al., 2019). Alternatively, several works use graph neural networks (GNNs) as the surrogate model (Ma et al., 2019; Zhang et al., 2019; Shi et al., 2019) to capture the graph structure of neural networks. However, the design of the GNN introduces many additional hyperparameters to be tuned and GNN requires a relatively large number of training data to achieve decent prediction performance as shown in Sec. 5. Another related work (Ramachandram et al., 2018) apply GP-based BO with diffusion kernels to design multimodal fusion networks; however, it assigns each possible architecture as a node in an undirected super-graph and the need for construction of and computation on such super-graphs limits the method to relatively small search spaces. In terms of interpretability, Shu et al. (2019) study the connection pattern of network cells found by popular NAS methods and find a shared tendency for choosing wide and shallow cells which enjoy faster convergence. You et al. (2020), by representing neural networks as relational graphs, observe that the network performance depends on the clustering coefficient and average path length of its graph representation. Radosavovic et al. (2020) propose a series of manual design principles derived from extensive empirical comparison to refine a ResNet-based search space. Nevertheless, all these works do not offer a NAS strategy, and purely rely on human experts to derive insights on NAS architectures from extensive empirical studies. In contrast, our method learns the interpretable feature information without human inputs while searching for the optimal architecture.
|
| 133 |
+
|
| 134 |
+
# 5 EXPERIMENTS
|
| 135 |
+
|
| 136 |
+
Surrogate Regression Performance We examine the regression performance of GPWL on several NAS datasets: NAS-Bench-101 (N101) on CIFAR-10 (Ying et al., 2019), and N201 on CIFAR-10, CIFAR-100 and ImageNet16. As both datasets only contain CIFAR-sized images and relatively small architecture cells2, to further demonstrate the scalability of our proposed methods to much larger architectures, we also construct a dataset with 547 architectures sampled from the randomly wired graph generator described in Xie et al. (2019); each architecture cell has 32 operation nodes and all the architectures are trained on the Flowers102 dataset (Nilsback and Zisserman, 2008) Similar to Ying et al. (2019); Dong and Yang (2020); Shi et al. (2019), we use Spearman’s rank correlation between predicted validation accuracy and the true validation accuracy as the performance metric, as what matters for comparing architectures is their relative performance ranking.
|
| 137 |
+
|
| 138 |
+
We compare the regression performance against various competitive baselines, including NASBOT (Kandasamy et al., 2018), GPs with path encodings (PathEncode) (White et al., 2019), GNN (Shi et al., 2019) which uses a combination of graph convolutional network and a final Bayesian linear regression layer as the surrogate, and COMBO (Oh et al., 2019)3, which use a GP with a diffusion kernel on a graph representation of the combinatorial search spaces. We report the results in Fig. 4: our GPWL surrogate clearly outperforms all competing methods on all the NAS datasets with much less training data: specifically, GPWL requires at least 3 times less data than GNN and PathEncode and 10 times less than COMBO on N201 datasets. It is also able to achieve high rank correlation on datasets with larger search spaces such as N101 and Flowers102 while requiring 20 times less data than GNN on Flowers102 and 30 times less data on N101. Moreover, in BO, uncertainty estimates are as important as the prediction accuracy; we show that GPWL produces sound uncertainty estimates in App. E.1. Finally, in addition to these surrogates previously used in NAS, we also demonstrate that our surrogate compares favourably against other popular graph kernels, as discussed in App. E.2.
|
| 139 |
+
|
| 140 |
+

|
| 141 |
+
Figure 4: Mean Spearman correlation achieved by various surrogates across 20 trials on different datasets. Error bars denote $\pm 1$ standard error. The red dashed lines are there to help with visual comparison between the performance of GPWL and other baselines.
|
| 142 |
+
|
| 143 |
+

|
| 144 |
+
Figure 5: Median test error on NAS-Bench datasets with deterministic (top row) and noisy (bottom row) observations from 20 trials. Shades denote $\pm 1$ standard error and black dotted lines are groundtruth optima. Note the seemingly large regret in N201 (ImageNet) is due to that there are only 5 out of 15.6K architectures with test error in the interval of [52.69 (optimum), 53.25].
|
| 145 |
+
|
| 146 |
+
Architecture Search on NAS-Bench Datasets We benchmark our proposed method, NAS-BOWL, against a range of existing methods, including random search, TPE (Bergstra et al., 2011), Reinforcement Learning (rl) (Zoph and Le, 2016), BO with SMAC (smacbo) (Hutter et al., 2011), regularised evolution (Real et al., 2019) and BO with GNN surrogate (gcnbo) (Shi et al., 2019). On N101, we also include BANANAS (White et al., 2019) which claims the state-of-the-art performance. In both NAS-Bench datasets, validation errors of different random seeds are provided, thereby creating noisy objective functions. We perform experiments using the deterministic setup described in White et al. (2019), where the validation errors over multiple seeds are averaged to eliminate stochasticity, and also report results with noisy objective functions. We show the test results in both setups in Fig. 5 and the validation results in App. F.3. In these figures, we use NASBOWLm and NASBOWLr to denote NAS-BOWL with architectures generated from mutating good observed candidates and from random sampling, respectively. Similarly, BANANASm/BANANASr represent the BANANAS with mutation/random sampling (White et al., 2019). On CIFAR-100/ImageNet tasks of N201, we also include NASBOWLm(TL) which is NASBOWLm with additional knowledge on motifs transferred from a previous run on the CIFAR-10 task of N201 to prune the candidate architectures as described in Sec. 3.2. The readers are referred to App. F.2 for detailed setups.
|
| 147 |
+
|
| 148 |
+
Table 1: Performances on CIFAR-10. GPU days do not include the evaluation cost of the final architecture; NAS-BOWL results from 4 random seeds on a single NVIDIA GeForce RTX 2080 Ti.
|
| 149 |
+
|
| 150 |
+
<table><tr><td>Algorithm</td><td>Avg. Error</td><td>Best Error</td><td>#Params(M)</td><td>GPU Days</td></tr><tr><td>GP-NAS (Li et al., 2020)</td><td>-</td><td>3.79</td><td>3.9</td><td>1</td></tr><tr><td>DARTS(v2) (Liu et al.,2018a)</td><td>2.76±0.09</td><td>-</td><td>3.3</td><td>4</td></tr><tr><td>ENASt (Pham et al.,2018)</td><td>-</td><td>2.89</td><td>4.6</td><td>6</td></tr><tr><td>ASHA(Li and Talwalkar,2019)</td><td>3.03±0.13</td><td>2.85</td><td>2.2</td><td>9</td></tr><tr><td>Random-WS (Xie et al.,2019)</td><td>2.85±0.08</td><td>2.71</td><td>4.3</td><td>10</td></tr><tr><td>BANANAS(White et al., 2019)</td><td>2.64</td><td>2.57</td><td>-</td><td>12</td></tr><tr><td>BOGCN(Shi et al.,2019)</td><td>-</td><td>2.61</td><td>3.5</td><td>93*</td></tr><tr><td>LaNet† (Wang et al., 2019)</td><td>2.53±0.05</td><td>-</td><td>3.2</td><td>150</td></tr><tr><td>NAS-BOWL</td><td>2.61±0.08</td><td>2.50</td><td>3.7</td><td>3</td></tr></table>
|
| 151 |
+
|
| 152 |
+
†: expanded search space from DARTS. \*: estimated by us. -: not reported.
|
| 153 |
+
|
| 154 |
+
It is evident that NAS-BOWL outperforms all baselines on all NAS-Bench tasks in achieving both lowest validation and test errors. The experiments with noisy observations further show that even in a more realistic setup with noisy objective function observations, NAS-BOWL still performs very well as it inherits the robustness against noise from the GP. The preliminary experiments on transfer learning also show that motifs contain extremely useful prior knowledge that may be transferred to warm-start a related task: notice that even the architectures at the very start without any search already perform well – this is particularly appealing, as in a realistic setting, searching directly on large-scale datasets like ImageNet from scratch is extremely expensive. While further experimental validation on a wider range of search spaces or tasks of varying degrees of similarity are required to fully verify the effectiveness of this particular method, we feel as an exemplary use of motifs, the promising preliminary results here already demonstrates the usefulness. Finally, we perform ablation studies in App. F.3.
|
| 155 |
+
|
| 156 |
+
Open-domain Search We finally test NAS-BOWL on the open-domain search space from DARTS (Liu et al., 2018a). We allow a maximum budget of 150 queries, and we follow the DARTS setup (See App. G for details): during the search phase, instead of training the final 20-cell architectures, we train a small 8-cell architectures for 50 epochs. Whereas this results in significant computational savings, it also leads to the degraded rank correlation of performance during search and evaluation stages. This leads to a more challenging setup than most other sample-based methods which train for longer epochs and/or search on the final 20-cell architectures directly. Beyond this, we also search a single cell structure and use it for the two cell types (normal and reduction) defined in DARTS search space. We also use a default maximum number of 4 operation blocks to fit the training on a single GPU; this is contrasted to, e.g. ENAS and LaNet that allow for up to 5 and 7 blocks, respectively.
|
| 157 |
+
|
| 158 |
+
We compare NAS-BOWL with other methods in Table 1, and the best cell found by NAS-BOWL is already shown in Fig. 3 in Sec. 3.2. To ensure fairness of comparison, we only include previous methods with comparable search spaces and training techniques, and exclude methods that train much longer and/or use additional tricks (Liang et al., 2019; Cai et al., 2019). It is evident that NASBOWL finds very promising architectures despite operating in a more restricted setup. Consuming 3 GPU-days, NAS-BOWL is of comparable computing cost to the one-shot methods but performs on par with or better than methods that consume orders of magnitude more resources, such as LaNet which is $5 0 \times$ more costly. Furthermore, it is worth noting that, if desired, NAS-BOWL may benefit from any higher computing budgets by relaxing the aforementioned restrictions (e.g. train longer on larger architectures during search). Finally, while we use a single GPU, NAS-BOWL can be easily deployed to run on parallel computing resources to further reduce wall-clock time.
|
| 159 |
+
|
| 160 |
+
# 6 CONCLUSION
|
| 161 |
+
|
| 162 |
+
In this paper, we propose a novel BO-based NAS strategy, NAS-BOWL, which uses a GP surrogate with the WL graph kernel. We show that our method performs competitively on both closed- and open-domain experiments with high sample efficiency. More importantly, our method represents a first step towards interpretable NAS, where we propose to learn interpretable network features to help explain the architectures found as well as guide the search on new tasks. The potential for further work is ample: we may extend the afforded interpretability in discovering more use-cases such as on multi-objective settings and broader search spaces. Moreover, while the current work deals primarily with practical NAS, we feel a thorough theoretical analysis, on e.g., convergence guarantee, would also be beneficial both for this work and the broader NAS community in general.
|
| 163 |
+
|
| 164 |
+
# REFERENCES
|
| 165 |
+
|
| 166 |
+
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 International Conference on Machine Learning (ICML), pages 2902–2911, 2017.
|
| 167 |
+
|
| 168 |
+
Barret Zoph and Quoc Le. Neural architecture search with reinforcement learning. In International Conference on Learning Representations (ICLR), 2017.
|
| 169 |
+
|
| 170 |
+
Han Cai, Tianyao Chen, Weinan Zhang, Yong Yu, and Jun Wang. Efficient architecture search by network transformation. In AAAI Conference on Artificial Intelligence, 2018.
|
| 171 |
+
|
| 172 |
+
Hanxiao Liu, Karen Simonyan, and Yiming Yang. Darts: Differentiable architecture search. arXiv preprint arXiv:1806.09055, 2018a.
|
| 173 |
+
|
| 174 |
+
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 European Conference on Computer Vision (ECCV), pages 19–34, 2018b.
|
| 175 |
+
|
| 176 |
+
Renqian Luo, Fei Tian, Tao Qin, Enhong Chen, and Tie-Yan Liu. Neural architecture optimization. In Advances in Neural Information Processing Systems (NIPS), pages 7816–7827, 2018.
|
| 177 |
+
|
| 178 |
+
Hieu Pham, Melody Guan, Barret Zoph, Quoc Le, and Jeff Dean. Efficient neural architecture search via parameter sharing. In International Conference on Machine Learning (ICML), pages 4092–4101, 2018.
|
| 179 |
+
|
| 180 |
+
Esteban Real, Alok Aggarwal, Yanping Huang, and Quoc V Le. Regularized evolution for image classifier architecture search. arXiv:1802.01548, 2018.
|
| 181 |
+
|
| 182 |
+
Barret Zoph, Vijay Vasudevan, Jonathon Shlens, and Quoc V Le. Learning transferable architectures for scalable image recognition. In Computer Vision and Pattern Recognition (CVPR), pages 8697–8710, 2018a.
|
| 183 |
+
|
| 184 |
+
Sirui Xie, Hehui Zheng, Chunxiao Liu, and Liang Lin. Snas: stochastic neural architecture search. arXiv preprint arXiv:1812.09926, 2018.
|
| 185 |
+
|
| 186 |
+
Chris Ying, Aaron Klein, Eric Christiansen, Esteban Real, Kevin Murphy, and Frank Hutter. NASBench-101: Towards reproducible neural architecture search. In International Conference on Machine Learning (ICML), pages 7105–7114, 2019.
|
| 187 |
+
|
| 188 |
+
Xuanyi Dong and Yi Yang. Nas-bench-201: Extending the scope of reproducible neural architecture search. arXiv preprint arXiv:2001.00326, 2020.
|
| 189 |
+
|
| 190 |
+
Colin White, Willie Neiswanger, and Yash Savani. Bananas: Bayesian optimization with neural architectures for neural architecture search. arXiv preprint arXiv:1910.11858, 2019.
|
| 191 |
+
|
| 192 |
+
Kirthevasan Kandasamy, Willie Neiswanger, Jeff Schneider, Barnabas Poczos, and Eric P Xing. Neural architecture search with Bayesian optimisation and optimal transport. In Advances in Neural Information Processing Systems (NIPS), pages 2016–2025, 2018.
|
| 193 |
+
|
| 194 |
+
Lizheng Ma, Jiaxu Cui, and Bo Yang. Deep neural architecture search with deep graph Bayesian optimization. In Web Intelligence (WI), pages 500–507. IEEE/WIC/ACM, 2019.
|
| 195 |
+
|
| 196 |
+
Chris Zhang, Mengye Ren, and Raquel Urtasun. Graph hypernetworks for neural architecture search. In International Conference on Learning Representations, 2019. URL https://openreview. net/forum?id $=$ rkgW0oA9FX.
|
| 197 |
+
|
| 198 |
+
Han Shi, Renjie Pi, Hang Xu, Zhenguo Li, James T Kwok, and Tong Zhang. Multi-objective neural architecture search via predictive network performance optimization, 2019.
|
| 199 |
+
|
| 200 |
+
Thomas Elsken, Jan Hendrik Metzen, and Frank Hutter. Neural architecture search: A survey. arXiv:1808.05377, 2018.
|
| 201 |
+
|
| 202 |
+
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, pages 8697–8710, 2018b.
|
| 203 |
+
|
| 204 |
+
Saining Xie, Alexander Kirillov, Ross Girshick, and Kaiming He. Exploring randomly wired neural networks for image recognition. In Proceedings of the IEEE International Conference on Computer Vision, pages 1284–1293, 2019.
|
| 205 |
+
|
| 206 |
+
Eric Brochu, Vlad M Cora, and Nando De Freitas. A tutorial on bayesian optimization of expensive cost functions, with application to active user modeling and hierarchical reinforcement learning. arXiv preprint arXiv:1012.2599, 2010.
|
| 207 |
+
|
| 208 |
+
Christopher KI Williams and Carl Edward Rasmussen. Gaussian processes for machine learning, volume 2. MIT press Cambridge, MA, 2006.
|
| 209 |
+
|
| 210 |
+
Jonas Mockus, Vytautas Tiesis, and Antanas Zilinskas. The application of bayesian methods for seeking the extremum. Towards global optimization, 2(117-129):2, 1978.
|
| 211 |
+
|
| 212 |
+
Nils M Kriege, Fredrik D Johansson, and Christopher Morris. A survey on graph kernels. Applied Network Science, 5(1):1–42, 2020.
|
| 213 |
+
|
| 214 |
+
Giannis Nikolentzos, Giannis Siglidis, and Michalis Vazirgiannis. Graph kernels: A survey. arXiv preprint arXiv:1904.12218, 2019.
|
| 215 |
+
|
| 216 |
+
Swarnendu Ghosh, Nibaran Das, Teresa Gonçalves, Paulo Quaresma, and Mahantapas Kundu. The journey of graph kernels through two decades. Computer Science Review, 27:88–111, 2018.
|
| 217 |
+
|
| 218 |
+
Nino Shervashidze, Pascal Schweitzer, Erik Jan Van Leeuwen, Kurt Mehlhorn, and Karsten M Borgwardt. Weisfeiler-lehman graph kernels. Journal of Machine Learning Research, 12(77): 2539–2561, 2011.
|
| 219 |
+
|
| 220 |
+
Frank Höppner and Maximilian Jahnke. Enriched weisfeiler-lehman kernel for improved graph clustering of source code. In International Symposium on Intelligent Data Analysis, pages 248– 260. Springer, 2020.
|
| 221 |
+
|
| 222 |
+
Christopher Morris, Martin Ritzert, Matthias Fey, William L Hamilton, Jan Eric Lenssen, Gaurav Rattan, and Martin Grohe. Weisfeiler and leman go neural: Higher-order graph neural networks. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 33, pages 4602–4609, 2019.
|
| 223 |
+
|
| 224 |
+
Haifeng Jin, Qingquan Song, and Xia Hu. Auto-keras: An efficient neural architecture search system. In Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pages 1946–1956, 2019.
|
| 225 |
+
|
| 226 |
+
Zhiping Zeng, Anthony KH Tung, Jianyong Wang, Jianhua Feng, and Lizhu Zhou. Comparing stars: On approximating graph edit distance. Proceedings of the VLDB Endowment, 2(1):25–36, 2009.
|
| 227 |
+
|
| 228 |
+
Andries Petrus Engelbrecht, Ian Cloete, and Jacek M Zurada. Determining the significance of input parameters using sensitivity analysis. In International Workshop on Artificial Neural Networks, pages 382–388. Springer, 1995.
|
| 229 |
+
|
| 230 |
+
Pang Wei Koh and Percy Liang. Understanding black-box predictions via influence functions. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pages 1885–1894. JMLR. org, 2017.
|
| 231 |
+
|
| 232 |
+
Marco Tulio Ribeiro, Sameer Singh, and Carlos Guestrin. " why should i trust you?" explaining the predictions of any classifier. In Proceedings of the 22nd ACM SIGKDD international conference on knowledge discovery and data mining, pages 1135–1144, 2016.
|
| 233 |
+
|
| 234 |
+
Mukund Sundararajan, Ankur Taly, and Qiqi Yan. Axiomatic attribution for deep networks. arXiv preprint arXiv:1703.01365, 2017.
|
| 235 |
+
|
| 236 |
+
Marco Ancona, Enea Ceolini, Cengiz Öztireli, and Markus Gross. Towards better understanding of gradient-based attribution methods for deep neural networks. arXiv preprint arXiv:1711.06104, 2017.
|
| 237 |
+
|
| 238 |
+
Linnan Wang, Saining Xie, Teng Li, Rodrigo Fonseca, and Yuandong Tian. Sample-efficient neural architecture search by learning action space. arXiv preprint arXiv:1906.06832, 2019.
|
| 239 |
+
|
| 240 |
+
Saining Xie, Ross Girshick, Piotr Dollár, Zhuowen Tu, and Kaiming He. Aggregated residual transformations for deep neural networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 1492–1500, 2017.
|
| 241 |
+
|
| 242 |
+
Yao Shu, Wei Wang, and Shaofeng Cai. Understanding architectures learnt by cell-based neural architecture search. In International Conference on Learning Representations, 2019.
|
| 243 |
+
|
| 244 |
+
Dhanesh Ramachandram, Michal Lisicki, Timothy J Shields, Mohamed R Amer, and Graham W Taylor. Bayesian optimization on graph-structured search spaces: Optimizing deep multimodal fusion architectures. Neurocomputing, 298:80–89, 2018.
|
| 245 |
+
|
| 246 |
+
Jiaxuan You, J. Leskovec, Kaiming He, and Saining Xie. Graph structure of neural networks. International Conference on Machine Learning, abs/2007.06559, 2020.
|
| 247 |
+
|
| 248 |
+
Ilija Radosavovic, Raj Prateek Kosaraju, Ross Girshick, Kaiming He, and Piotr Dollár. Designing network design spaces. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 10428–10436, 2020.
|
| 249 |
+
|
| 250 |
+
Maria-Elena Nilsback and Andrew Zisserman. Automated flower classification over a large number of classes. In 2008 Sixth Indian Conference on Computer Vision, Graphics and Image Processing, pages 722–729. IEEE, 2008.
|
| 251 |
+
|
| 252 |
+
Changyong Oh, Jakub Tomczak, Efstratios Gavves, and Max Welling. Combinatorial bayesian optimization using the graph cartesian product. In Advances in Neural Information Processing Systems, pages 2910–2920, 2019.
|
| 253 |
+
|
| 254 |
+
James S Bergstra, Rémi Bardenet, Yoshua Bengio, and Balázs Kégl. Algorithms for hyper-parameter optimization. In Advances in Neural Information Processing Systems (NIPS), pages 2546–2554, 2011.
|
| 255 |
+
|
| 256 |
+
Barret Zoph and Quoc V Le. Neural architecture search with reinforcement learning. arXiv preprint arXiv:1611.01578, 2016.
|
| 257 |
+
|
| 258 |
+
Frank Hutter, Holger H Hoos, and Kevin Leyton-Brown. Sequential model-based optimization for general algorithm configuration. In International conference on learning and intelligent optimization, pages 507–523. Springer, 2011.
|
| 259 |
+
|
| 260 |
+
Esteban Real, Alok Aggarwal, Yanping Huang, and Quoc V Le. Regularized evolution for image classifier architecture search. In Proceedings of the aaai conference on artificial intelligence, volume 33, pages 4780–4789, 2019.
|
| 261 |
+
|
| 262 |
+
Hanwen Liang, Shifeng Zhang, Jiacheng Sun, Xingqiu He, Weiran Huang, Kechen Zhuang, and Zhenguo Li. Darts+: Improved differentiable architecture search with early stopping. arXiv preprint arXiv:1909.06035, 2019.
|
| 263 |
+
|
| 264 |
+
Han Cai, Ligeng Zhu, and Song Han. ProxylessNAS: Direct neural architecture search on target task and hardware. In International Conference on Learning Representations (ICLR), 2019.
|
| 265 |
+
|
| 266 |
+
Zhihang Li, Teng Xi, Jiankang Deng, Gang Zhang, Shengzhao Wen, and Ran He. Gp-nas: Gaussian process based neural architecture search. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 11933–11942, 2020.
|
| 267 |
+
|
| 268 |
+
Liam Li and Ameet Talwalkar. Random search and reproducibility for neural architecture search. arXiv:1902.07638, 2019.
|
| 269 |
+
|
| 270 |
+
Nino Shervashidze, SVN Vishwanathan, Tobias Petri, Kurt Mehlhorn, and Karsten Borgwardt. Efficient graphlet kernels for large graph comparison. In Artificial Intelligence and Statistics, pages 488–495, 2009.
|
| 271 |
+
|
| 272 |
+
Risi Kondor and Horace Pan. The multiscale laplacian graph kernel. In Advances in Neural Information Processing Systems, pages 2990–2998, 2016.
|
| 273 |
+
|
| 274 |
+
Nathan de Lara and Edouard Pineau. A simple baseline algorithm for graph classification. arXiv preprint arXiv:1810.09155, 2018.
|
| 275 |
+
|
| 276 |
+
Hisashi Kashima, Koji Tsuda, and Akihiro Inokuchi. Marginalized kernels between labeled graphs. In Proceedings of the 20th international conference on machine learning (ICML-03), pages 321–328, 2003.
|
| 277 |
+
|
| 278 |
+
Boris Weisfeiler and Andrei A Lehman. A reduction of a graph to a canonical form and an algebra arising during this reduction. Nauchno-Technicheskaya Informatsia, 2(9):12–16, 1968.
|
| 279 |
+
|
| 280 |
+
Keyulu Xu, Weihua Hu, Jure Leskovec, and Stefanie Jegelka. How powerful are graph neural networks? arXiv preprint arXiv:1810.00826, 2018.
|
| 281 |
+
|
| 282 |
+
Thomas Gärtner, Peter Flach, and Stefan Wrobel. On graph kernels: Hardness results and efficient alternatives. In Learning theory and kernel machines, pages 129–143. Springer, 2003.
|
| 283 |
+
|
| 284 |
+
Karsten M Borgwardt and Hans-Peter Kriegel. Shortest-path kernels on graphs. In Fifth IEEE International Conference on Data Mining (ICDM’05), pages 8–pp. IEEE, 2005.
|
| 285 |
+
|
| 286 |
+
Chih-Long Lin. Hardness of approximating graph transformation problem. In International Symposium on Algorithms and Computation, pages 74–82. Springer, 1994.
|
| 287 |
+
|
| 288 |
+
Carl Edward Rasmussen. Gaussian processes in machine learning. In Summer School on Machine Learning, pages 63–71. Springer, 2003.
|
| 289 |
+
|
| 290 |
+
Mehmet Gönen and Ethem Alpaydin. Multiple kernel learning algorithms. Journal of machine learning research, 12(64):2211–2268, 2011.
|
| 291 |
+
|
| 292 |
+
Corinna Cortes, Mehryar Mohri, and Afshin Rostamizadeh. Algorithms for learning kernels based on centered alignment. The Journal of Machine Learning Research, 13(1):795–828, 2012.
|
| 293 |
+
|
| 294 |
+
Hanxiao Liu, Karen Simonyan, and Yiming Yang. DARTS: Differentiable architecture search. In International Conference on Learning Representations (ICLR), 2019.
|
| 295 |
+
|
| 296 |
+
Nils M Kriege, Pierre-Louis Giscard, and Richard Wilson. On valid optimal assignment kernels and applications to graph classification. In Advances in Neural Information Processing Systems, pages 1623–1631, 2016.
|
| 297 |
+
|
| 298 |
+
Ahsan Alvi, Binxin Ru, Jan-Peter Calliess, Stephen Roberts, and Michael A Osborne. Asynchronous batch bayesian optimisation with improved local penalisation. In International Conference on Machine Learning, pages 253–262, 2019.
|
| 299 |
+
|
| 300 |
+
James Bergstra and Yoshua Bengio. Random search for hyper-parameter optimization. Journal of machine learning research, 13(Feb):281–305, 2012.
|
| 301 |
+
|
| 302 |
+
Niranjan Srinivas, Andreas Krause, Sham M Kakade, and Matthias Seeger. Gaussian process optimization in the bandit setting: No regret and experimental design. arXiv preprint arXiv:0912.3995, 2009.
|
| 303 |
+
|
| 304 |
+
# A ALGORITHMS
|
| 305 |
+
|
| 306 |
+
Description of the WL kernel Complementary to Fig. 1 in the main tex, in this section we include a formal, algorithmic description of the WL procedure in Algorithm 2.
|
| 307 |
+
|
| 308 |
+
Algorithm 2 Weisfeiler-Lehman subtree kernel computation between two graphs Shervashidze et al. (2011)
|
| 309 |
+
|
| 310 |
+
1: Input: Graphs $\{ G _ { 1 } , G _ { 2 } \}$ , Maximum WL iterations $H$
|
| 311 |
+
2: Output: The kernel function value between the graphs $k$
|
| 312 |
+
3: Initialise the feature vectors $\{ \phi ( G _ { 1 } ) , \phi ( G _ { 2 } ) \}$ with the respective counts of original node labels i.e. the $h = 0$ WL features. (E.g. $\phi ^ { i } ( G _ { 1 } )$ is the count of $i$ -th node label of graph $G _ { 1 }$ )
|
| 313 |
+
4: for $h = 1 , \ldots , H$ do
|
| 314 |
+
5: Assign a multiset-label $M _ { h } ( v )$ to each node $v$ in $G$ consisting of the multiset $\{ l _ { h - 1 } | u \in \mathcal { N } ( v )$ , where $l _ { h - 1 } ( v )$ is the node label of node $v$ of the $h - 1$ -th WL iteration; $\mathcal { N } ( v )$ are the neighbour nodes of node $v$
|
| 315 |
+
6: Sort each elements in $M _ { h } ( v )$ in ascending order and concatenate them into string $s _ { h } ( v )$
|
| 316 |
+
7: Add $l _ { h - 1 } ( v )$ as a prefix to $s _ { h } ( v )$ .
|
| 317 |
+
8: Compress each string $s _ { h } ( v )$ using hash function $f$ so that $f ( s _ { h } ( v ) ) = f ( s _ { h } ( w ) )$ iff $s _ { h } ( v ) =$ $s _ { h } ( w )$ for two nodes $\{ v , w \}$ .
|
| 318 |
+
9: Set $l _ { h } ( v ) : = f ( s _ { h } ( v ) ) \forall v \in G$ .
|
| 319 |
+
10: Concatenate the $\phi ( G _ { 1 } ) , \phi ( G _ { 2 } )$ with the respective counts of the new labels
|
| 320 |
+
|
| 321 |
+
# 11: end for
|
| 322 |
+
|
| 323 |
+
12: Compute inner product between the feature vectors in RKHS $k = \langle \phi ( G _ { 1 } ) , \phi ( G _ { 2 } ) \rangle _ { \mathcal { H } }$
|
| 324 |
+
|
| 325 |
+
# B DETAILED REASONS FOR USING THE WL KERNEL
|
| 326 |
+
|
| 327 |
+
We argue that WL kernel is a desirable choice for the NAS application for the following reasons.
|
| 328 |
+
|
| 329 |
+
1. WL kernel is able to compare labeled and directed graphs of different sizes. As discussed in Section 2, architectures in almost all popular NAS search spaces (Ying et al., 2019; Dong and Yang, 2020; Zoph et al., 2018b; Xie et al., 2019) can be represented as directed graphs with node/edge attributes. Thus, WL kernel can be directly applied on them. On the other hand, many graph kernels either do not handle node labels (Shervashidze et al., 2009), or are incompatible with directed graphs (Kondor and Pan, 2016; de Lara and Pineau, 2018). Converting architectures into undirected graphs can result in loss of valuable information such as the direction of data flow in the architecture (we show this in Section 5).
|
| 330 |
+
|
| 331 |
+
2. WL kernel is expressive yet highly interpretable. WL kernel is able to capture substructures that go from local to global scale with increasing $h$ values. Such multi-scale comparison is similar to that enabled by a Multiscale Laplacian Kernel (Kondor and Pan, 2016) and is desirable for architecture comparison. This is in contrast to graph kernels such as Kashima et al. (2003); Shervashidze et al. (2009), which only focus on local substructures, or those based on graph spectra de Lara and Pineau (2018), which only look at global connectivities. Furthermore, the WL kernel is derived directly from the Weisfeiler-Lehman graph isomorphism test (Weisfeiler and Lehman, 1968), which is shown to be as powerful as a GNN in distinguishing non-isomorphic graphs (Morris et al., 2019; Xu et al., 2018). However, the higher-order graph features extracted by GNNs are hard to interpret by humans. On the other hand, the subtree features learnt by WL kernel (e.g. the $h = 0$ and $h = 1$ features in Figure ??) are easily interpretable.
|
| 332 |
+
|
| 333 |
+
3. WL kernel is relatively efficient and scalable. Other expressive graph kernels are often prohibitive to compute: for example, defining $\{ n , m \}$ to be the number of nodes and edges in a graph, random walk (Gärtner et al., 2003), shortest path (Borgwardt and Kriegel, 2005) and graphlet kernels (Shervashidze et al., 2009) incur a complexity of $\mathcal { O } ( \bar { n } ^ { 3 } )$ , $\mathcal { O } ( n ^ { 4 } )$ and ${ \bar { \boldsymbol { \mathcal { O } } } } ( n ^ { k } )$ respectively where $k$ is the maximum graphlet size. Another approach based on computing the architecture edit-distance (Jin et al., 2019) is also expensive: its exact solution is NP-complete (Zeng et al., 2009) and is provably difficult to approximate (Lin, 1994). On the other hand, the WL kernel only entails a complexity4 of ${ \mathcal { O } } ( H m )$ (White et al., 2019), which without truncation scales exponentially with $n$ .
|
| 334 |
+
|
| 335 |
+
# C COMBINING DIFFERENT KERNELS
|
| 336 |
+
|
| 337 |
+
In general, the sum or product of valid kernels gives another valid kernel, as such, combining different kernels to yield a better-performing kernel is commonly used in GP and Multiple Kernel Learning (MKL) literature (Rasmussen, 2003; Gönen and Alpaydin, 2011). In this section, we conduct a preliminary discussion on its usefulness to GPWL. As a singular example, we consider the additive kernel that is a linear combination of the WL kernel and the MLP kernel:
|
| 338 |
+
|
| 339 |
+
$$
|
| 340 |
+
k _ { \mathrm { a d d } } ( G _ { 1 } , G _ { 2 } ) = \alpha k _ { \mathrm { W L } } ( G _ { 1 } , G _ { 2 } ) + \beta k _ { \mathrm { M L P } } ( G _ { 1 } , G _ { 2 } ) { \mathrm { ~ s . t . ~ } } \alpha + \beta = 1 , \alpha , \beta \geq 0
|
| 341 |
+
$$
|
| 342 |
+
|
| 343 |
+
where $\alpha , \beta$ are the kernel weights. We choose WL and MLP because we expect them to extract diverse information: whereas WL processes the graph node information directly, MLP consider the spectrum of the graph Laplacian matrix, which often reflect the global properties such as the topology and the graph connectivity. We expect the more diverse features captured by the constituent kernels will lead to a more effective additive kernel. While it is possible to determine the weights in a more principled way such as jointly optimising them in the GP log-marginal likelihood, in this example we simply set $\alpha = 0 . 7$ and $\beta = 0 . 3$ . We then perform regression on NAS-Bench-101 and Flower102 datasets following the setup as in Sec. 5. We repeat each experiment 20 times and report the mean and standard deviation in Table 2, and we show the uncertainty estimate of additive kernel in Fig. 6. In both search spaces the additive kernel outperforms the constituent kernels but the gain over the WL kernel is marginal. Interestingly, while MLP performs poorly on its own, it can be seen that the complementary spectral information extracted by it can be helpful when used alongside our WL kernel. Generally, we hypothesise that as the search space increases in complexity (e.g., larger graphs, more edge connections permitted, etc), we expect that the benefits from combining different kernels to increase and we defer a more comprehensive discussion on this to a future work. As a starting point, one concrete proposal would be applying a MKL method such as ALIGNF (Cortes et al., 2012) in our context directly.
|
| 344 |
+
|
| 345 |
+
Table 2: Regression performance (i.t.o rank correlation) of additive kernels
|
| 346 |
+
|
| 347 |
+
<table><tr><td>Kernel</td><td>N101</td><td>Flower-102</td></tr><tr><td>WL + MLP</td><td>0.871±0.02</td><td>0.813±0.018</td></tr><tr><td>WLt</td><td>0.862±0.03</td><td>0.804±0.018</td></tr><tr><td>MLPt</td><td>0.458±0.07</td><td>0.492±0.12</td></tr></table>
|
| 348 |
+
|
| 349 |
+
†: Taken directly from Table 3.
|
| 350 |
+
|
| 351 |
+

|
| 352 |
+
Figure 6: Predictive vs ground-truth validation error of GPWL with additive kernel on N101 and Flower-102 in log-log scale. Error bar denotes $\pm 1$ SD from the GP posterior predictive distribution.
|
| 353 |
+
|
| 354 |
+
# D FURTHER DETAILS ON INTERPRETABILITY
|
| 355 |
+
|
| 356 |
+
# D.1 SELECTION PROCEDURE FOR MOTIF DISCOVERY
|
| 357 |
+
|
| 358 |
+
NAS-Bench datasets In the closed-domain NAS-Bench datasets (including both NAS- bench-101 and NAS-Bench-201), we randomly sample 300 architectures from their respective search space, fit the GPWL surrogate, and compute the derivatives of all the features that appeared in the training (a) Best and worst motifs identified on the N101 dataset (left), and the validation accuracy distributions in the validation architectures (right).
|
| 359 |
+
|
| 360 |
+

|
| 361 |
+
|
| 362 |
+

|
| 363 |
+
|
| 364 |
+

|
| 365 |
+
(b) Best and worst motifs identified on the CIFAR-100 task of N201 dataset (left), and the validation accuracy distributions transferred on CIFAR-10, CIFAR-100 and ImageNet (right 3).
|
| 366 |
+
|
| 367 |
+

|
| 368 |
+
(c) Best and worst motifs identified on the ImageNet task of N201 dataset (left), and the validation accuracy distributions transferred on CIFAR-10, CIFAR-100 and ImageNet (right 3).
|
| 369 |
+
|
| 370 |
+
Figure 7: Motif discovery on N101 and CIFAR-100 and ImageNet tasks of N201. Note that since N101 is trained on CIFAR-10 only, it is not possible to show the results transferred on another task. All symbols and legends have the same meaning as in Fig. 2 in the main text.
|
| 371 |
+
|
| 372 |
+
set. As a regularity constraint, we then filter the motifs to only retain those that appear for more than 10 times to ensure the estimates of the derivatives by the GPWL surrogate are accurate enough and are not swayed by noises/outliers. We finally rank the features by the numerical values of the derivatives, and present the top and bottom quantiles of the features as “best motifs” and “worst motifs” respectively in Fig. 2 in the main text and Fig. 7 in Sec. D.2.
|
| 373 |
+
|
| 374 |
+
DARTS Search Space In the open-domain search space, it is impossible to sample efficiently since each sample drawn requires us to evaluate the architecture in full, which is computationally prohibitive. Instead, we simply reuse the GPWL surrogate trained in one run of NAS-BOWL on the open-domain experiments described in Sec. 5, which contains 120 architecture5-validation accuracy pair evaluated over 3 GPU days. Due to the smaller number of available samples, here we only require each feature to appear at least twice as a prerequisite, and we select the top and bottom $15 \%$ of the features to be presented in the graphs. All other treatments are identical to the descriptions above.
|
| 375 |
+
|
| 376 |
+
# D.2 MOTIF DISCOVERY ON N101 AND OTHER TASKS OF N201
|
| 377 |
+
|
| 378 |
+
Supplementary to Fig. 2 in main text, here we outline the motifs discovered by GPWL also on the N101 search space and on the other tasks (CIFAR-100, ImageNet16) of N201 in Fig. 7. We follow the identical setup as described in both the main text and Sec. D.1. In all cases, the motifs are highly effective in separating the architecture pool, and it is also noteworthy that the motifs found in the other N201 tasks are highly consistent with those shown in Fig. 2 in the main text with only minor differences, further supporting our claim that the GPWL is capable of identifying transferable features without unduly overfitting to a particular task.
|
| 379 |
+
|
| 380 |
+

|
| 381 |
+
Figure 8: Computed motifs and ground-truth optimal cells for all 3 tasks of N201. Note that optimal CIFAR-10 cell contains motifs 1 and 3, optimal CIFAR-100 cell contains motif 3 and optimal ImageNet16 cell contains motif 2.
|
| 382 |
+
|
| 383 |
+

|
| 384 |
+
Figure 9: Predicted vs ground-truth validation error of GPWL in various NAS-Bench tasks in log-log scale. Error bar denotes $\pm 1$ SD from the GP posterior predictive distribution.
|
| 385 |
+
|
| 386 |
+
To give further concrete evidence on the working and advantage of the proposed method in N201, in Fig 8 we show the top-4 motifs in terms of the derivatives computed from one experiment on CIFAR-10 only, according to Sec 3.2, and the ground-truth best architectures in each of the three tasks included. In this case, while the optimal cells for the different tasks are similar (but not identical) and reflective of a high-level transferability of the cells, transferring the optimal cell in one task directly to another will be sub-optimal. However, using our method as described in Algorithm 1 by transferring the motifs in Fig 8(a) on CIFAR-100 and ImageNet tasks, we reduce the search space and resultantly search time drastically (as any cell to be evaluated now needs to contain one of the motifs in Fig. 8(a)) yet we do not preemptively rule out the optimal cell (as all optimal cells contain $\geq 1$ "good" motifs). As such, our method strikes a balance between performance and efficiency.
|
| 387 |
+
|
| 388 |
+
# E FURTHER REGRESSION RESULTS
|
| 389 |
+
|
| 390 |
+
# E.1 PREDICTIVE MEAN $\pm \nobreakspace 1 \nobreakspace$ STANDARD DEVIATION OF GPWL SURROGATE ON NAS DATASETS
|
| 391 |
+
|
| 392 |
+
In this section, we show the GPWL predictions on the various NAS datasets when trained with 50 samples each. It can be shown that not only a satisfactory predictive mean is produced by GPWL in terms of the rank correlation and the agreement with the ground truth, there is also sound uncertainty estimates, as we can see that in most cases the ground truths are within the error bar representing one standard deviation of the GP predictive distributions. For the training of GPWL, we always transform the validation errors (the targets of the regression) into log-scale, normalise the data and transform it back at prediction, as empirically we find this leads to better uncertainty estimates.
|
| 393 |
+
|
| 394 |
+
# E.2 COMPARISON WITH OTHER GRAPH KERNELS
|
| 395 |
+
|
| 396 |
+
We further compare the performance of WL kernel against other popular graph kernels such as (fast) Random Walk (RW) (Kashima et al., 2003; Gärtner et al., 2003), Shortest-Path (SP) (Borgwardt and Kriegel, 2005), Multiscale Laplacian (MLP) (Kondor and Pan, 2016) kernels when combined with GPs. These competing graph kernels are chosen because they represent distinct graph kernel classes and are suitable for NAS search space with small or no modifications. In each NAS dataset, we randomly sample 50 architecture data to train the GP surrogate and use another 400 architectures as the validation set to evaluate the rank correlation between the predicted and the ground-truth validation accuracy.
|
| 397 |
+
|
| 398 |
+

|
| 399 |
+
Figure 10: Spearman correlation on train/validation sets and the negative log-marginal likelihood of GP against $H$ (the maximum WL iteration) and the histograms of selected $H$ by GPWL over 20 trials on (a) N101 and (b) Flowers102.
|
| 400 |
+
|
| 401 |
+
We repeat each trial 20 times, and report the mean and standard error of all the kernel choices on all NAS datasets in Table 3. We also include the worst-case complexity of the kernel computation between a pair of graphs in the table. The results in this section justify our reasoning in App. B; combined with the interpretability benefits we discussed, WL consistently outperforms other kernels across search spaces while retaining modest computational costs. RW often comes a close competitor, but its computational complexity is worse and does not always converge. MLP, which requires us to convert directed graphs to undirected graphs, performs poorly, thereby validating that directional information is highly important.
|
| 402 |
+
|
| 403 |
+
Table 3: Regression performance (i.t.o Spearman’s rank correlation) of different graph kernels.
|
| 404 |
+
|
| 405 |
+
<table><tr><td>Kernel</td><td>Complexity</td><td>N101</td><td>CIFAR10</td><td>CIFAR100</td><td>ImageNet16</td><td>Flower-102</td></tr><tr><td>WL</td><td>O(Hm)</td><td>0.862±0.03</td><td>0.812±0.06</td><td>0.823±0.03</td><td>0.796±0.04</td><td>0.804±0.018</td></tr><tr><td>RW</td><td>0(n3)</td><td>0.801±0.04</td><td>0.809±0.04</td><td>0.782±0.06</td><td>0.795±0.03</td><td>0.759±0.04</td></tr><tr><td>SP</td><td>0(n4)</td><td>0.801±0.05</td><td>0.792±0.06</td><td>0.761±0.06</td><td>0.762±0.08</td><td>0.694±0.08</td></tr><tr><td>MLP</td><td>O(Ln5)t</td><td>0.458±0.07</td><td>0.412±0.15</td><td>0.519±0.14</td><td>0.538±0.07</td><td>0.492±0.12</td></tr></table>
|
| 406 |
+
|
| 407 |
+
†: $\overline { { L } }$ is the number of neighbours, a hyperparameter of MLP kernel.
|
| 408 |
+
|
| 409 |
+
# E.3 VALUE OF $H$ (MAXIMUM NUMBER OF WL ITERATIONS)
|
| 410 |
+
|
| 411 |
+
As discussed, the Weisfeiler-Lehman kernel is singly parameterised by $H$ , the maximum number of WL iterations. The expressive power of the kernel generally increases with $H$ , as the kernel is capable of covering increasingly global features, but at the same time we might overfit into the training set, posing a classical problem of variance-bias trade-off. In this work, by combining WL with GP, we optimise $H$ against the negative log-marginal likelihood of the GP. In this section, on different data-sets we show that this approach satisfactorily balances data-fitting with model complexity.
|
| 412 |
+
|
| 413 |
+
To verify, on both N101 and Flowers102 data-sets we described, we train GPWL surrogates on 50 random training samples. On N101, we draw another 400 testing samples and on Flowers102, we use the rest of the data-set as the validation set. We use the Spearman correlation between prediction and the ground truths of the validation set as the performance metric. We summarise our result in Fig. 10: in both data-sets, we observe a large jump in performance from $H = 0$ to 1 (measured by the improvements in both validation and training Spearman correlation), and a slight dip in validation correlation from $H = 2$ to 3, suggesting an increasing amount of overfitting if we increase $H$ further. In both cases, the automatic selection described above succeeded in finding the “sweet spot” of $H = 1$ or 2, demonstrating the effectiveness of the approach.
|
| 414 |
+
|
| 415 |
+
# F CLOSED-DOMAIN EXPERIMENTAL DETAILS
|
| 416 |
+
|
| 417 |
+
All experiments were conducted on a 36-core 2.3GHz Intel Xeon processor with 512 GB RAM.
|
| 418 |
+
|
| 419 |
+
# F.1 DATASETS
|
| 420 |
+
|
| 421 |
+
We experiment on the following datasets:
|
| 422 |
+
|
| 423 |
+
• NAS-Bench-101 (Ying et al., 2019): The search space is an acyclic directed graph with 7 nodes and a maximum of 9 edges. Besides the input node and output node, the remaining 5 operation nodes can choose one of the three possible operations: $\mathtt { c o n v 3 } \times 3 \mathtt { - b n - r e l u } .$ $\mathtt { c o n v 1 } \times \mathtt { 1 } \mathtt { - b n - r e } \mathtt { \_ }$ lu and maxpool $. 3 \times 3$ . The dataset contains all 423,624 unique neural architectures in the search space. Each architecture is trained for 108 epochs and evaluated on CIFAR10 image data. The evaluation is repeated over 3 random initialisation seeds. We can access the final training/validation/test accuracy, the number of parameters as well as training time of each architecture from the dataset. The dataset and its API can be downloaded from https://github.com/google-research/nasbench/.
|
| 424 |
+
|
| 425 |
+
• NAS-Bench-201 (Dong and Yang, 2020): The search space is an acyclic directed graph with 4 nodes and 6 edges. Each edge corresponds to an operation selected from the set of 5 possible options: $\mathtt { C O n v 1 } \times 1$ , $\mathtt { C O n v 3 } \times 3$ , avgpool $3 \times 3$ , skip-connect and zeroize. This search space is applicable to almost all up-to-date NAS algorithms. Note although the search space of NAS-Bench-201 is more general, it’s smaller than that of NAS-Bench-101. The dataset contains all 15,625 unique neural architectures in the search space. Each architecture is trained for 200 epochs and evaluated on 3 image datasets: CIFAR10, CIFAR100, ImageNet16-120. The evaluation is repeated over 3 random initialisation seeds. We can access the training accuracy/loss, validation accuracy/loss after every training epoch, the final test accuracy/loss, number of parameters as well as FLOPs from the dataset. The dataset and its API can be downloaded from https://github.com/D-X-Y/NAS-Bench-201.
|
| 426 |
+
|
| 427 |
+
• Flowers102: We generate this dataset based on the random graph generators proposed in Xie et al. (2019). The search space is an acyclic directed graph with 32 nodes and a varying number of edges. All the nodes can take one of the three possible options: input, output, $\mathtt { r e l u - c o n v 3 \times 3 - b n }$ . Thus, the graph can have multiple inputs and outputs. This search space is very different from those of NAS-Bench-101 and NAS-Bench-201 and is used to test the scalability of our surrogate model for a large-scale search space (i.t.o number of numbers in the graph). The edges/wiring/connection in the graph is created by one of the three classic random graph models: Erdos-Renyi (ER), Barabasi-Albert (BA) and Watt-Strogatz (WS). Different random graph models result in graphs of different topological structures and connectivity patterns and are defined by one or two hyperparameters. We investigate a total of 69 different sets of hyperparameters: 8 values for the hyperparameter of ER model, 6 values for the hyperparameter of BA model and 55 different value combinations for the two hyperparameters of WS model. For each hyperparameter set, we generate 8 different architectures using the random graph model and train each architecture for 250 epochs before evaluating on Flowers102 dataset. The training set-ups follow Liu et al. (2019). This results in our dataset of 552 randomly wired neural architectures.
|
| 428 |
+
|
| 429 |
+
# F.2 EXPERIMENTAL SETUP
|
| 430 |
+
|
| 431 |
+
NAS-BOWL We use a batch size $B = 5$ (i.e., at each BO iteration, architectures yielding top 5 acquisition function values are selected to be evaluated in parallel). When mutation algorithm described in Sec. 3.2 is used, we use a pool size of $P = 2 0 0$ , and half of which is generated from mutating the top-10 best performing architectures already queried and the other half is generated from random sampling to encourage more explorations in NAS-Bench-101. In NAS-Bench-201, accounting for the much smaller search space and consequently the lesser need to exploration, we simply generate all architectures from mutation. For experiments with random acquisition, we also use $P = 2 0 0$ throughout, and we also study the effect of varying $P$ later in this section. We use WL with optimal assignment (OA) (Kriege et al., 2016) for all datasets apart from NAS-Bench-201. Denoting the feature vectors of two graphs $G _ { 1 }$ and $G _ { 2 }$ as $\phi ( G _ { 1 } )$ and $\phi ( \bar { G } _ { 2 } )$ respectively, the OA inner product in the WL case is given by the histogram intersection $\begin{array} { r } { \langle \phi ( G _ { 1 } ) , \phi ( G _ { 2 } ) \rangle = \sum _ { j } \operatorname* { m i n } ( \phi ^ { j } ( G _ { 1 } ) , \bar { \phi } ^ { j } ( G _ { 2 } ) } \end{array}$ , where $\phi ^ { j } ( \cdot )$ is the $j$ -th element of the vector. On NAS-Bench-201 which features a much smaller search space which we find a simple dot product of the feature vectors $\phi ( G _ { 1 } ) ^ { \mathrm { T } } \phi ( G _ { 2 } )$ to perform empirically better. We always use 10 random samples to initialise NAS-BOWL.
|
| 432 |
+
|
| 433 |
+
On NAS-Bench-101 dataset, we always apply pruning (which is available in the NAS-Bench-101 API) to remove the invalid nodes and edges from the graphs. On NAS-Bench-201 dataset, since the architectures are defined over a DARTS-like, edge-labelled search space, we first convert the edgelabelled graphs to node-labelled graphs as a pre-processing step. It is worth noting that it is possible to use WL kernel defined over edge-labelled graphs directly (e.g the WL-edge kernel proposed by Shervashidze et al. (2011)), although in this paper we find the WL kernels over node-labelled graphs to perform empirically better.
|
| 434 |
+
|
| 435 |
+
On the transfer learning setup of N201, we first run a standard optimisation task on the CIFAR-10 task (we term this the base task) but we allow for up to an expanded budget of 250 architecture evaluations to build up the confidence of GPWL derivative estimates. We then extract the “good motifs” identified by GPWL (i.e. those features with derivatives in the top quantile). For the subsequent CIFAR100/ImageNet16 optimisations (we term this the transferred tasks). On the transferred tasks, with everything else unmodified from standard runs (e.g. budget, pool size, batch size, acquisition function choice, etc), we additionally enforce the pruning rule such that only candidates in the pool with at least 1 match to the previously identified “good motifs” are allowed for evaluations and the rest are removed. The key difference is that under standard runs, the pool of size $B$ is generated once per BO iteration via random sampling/mutation algorithm since all candidates are accepted; here, this procedure is executed for many times as required until we have a pool of $B$ architectures where each meets the pruning criteria.
|
| 436 |
+
|
| 437 |
+
BANANAS We use the code made public by the authors (White et al., 2019) (https://github. com/naszilla/bananas), and use the default settings contained in the code with the exception of the number of architectures queried at each BO iteration (i.e. BO batch size): the default is 10, but to conform to our test settings we use 5 instead. While we do not change the default pool size of $P = 2 0 0$ at each BO iteration, instead of filling the pool entirely from mutation of the best architectures, we only mutate 100 architectures from top-10 best architectures and generate the other 100 randomly to enable a fair comparison with our method. It is worth noting that neither changes led to a significant deterioration in the performance of BANANAS: under the deterministic validation error setup, the results we report are largely consistent with the results reported in White et al. (2019); under the stochastic validation error setup, our BANANAS results actually slightly outperform results in the original paper. It is finally worth noting that the public implementation of BANANAS on NAS-Bench-201 was not released by the authors.
|
| 438 |
+
|
| 439 |
+
GCNBO for NAS We implemented the GNN surrogate in Sec. 5.1 by ourselves following the description in the most recent work (Shi et al., 2019), which uses a graph convolution neural network in combination with a Bayesian linear regression layer to predict architecture performance in its BO-based NAS 6. To ensure fair comparison with our NAS-BOWL, we then define a normal Expected Improvement (EI) acquisition function based on the predictive distribution by the GNN surrogate to obtain another BO-based NAS baseline in Sec. 5.2, GCNBO. Similar to all the other baselines including our NASBOWLr and BANANASr, we use random sampling to generate candidate architectures for acquisition function optimisation. However, different from NAS-BOWL and BANANAS, GCNBO uses a batch size $B = 1$ , i.e. at each BO iteration, NAS-BOWL and BANANAS select 5 new architectures to evaluate next but GCNBO select 1 new architecture to evaluate next. This setup should favour GCNBO if we measure the optimisation performance against the number of architecture evaluations which is the metric used in Figs. 4 and 5 because at each BO iteration, GCNBO selects the next architecture $G _ { t }$ based on the most up-to-date information $\alpha _ { t } ( G | \mathcal { D } _ { t - 1 } )$ whereas NAS-BOWL and BANANAS only select one architecture $G _ { t , 1 }$ in such fully informed way but select the other four architectures $\{ G _ { t , i } \} _ { i = 2 } ^ { 5 }$ with outdated information. Specifically, in the sequential case $( B = 1$ ), $G _ { t , 2 }$ is selected only after we have evaluated $G _ { t , 1 }$ , $G _ { t , 2 }$ is selected by maximising $\alpha _ { t } ( G | \{ \mathcal { D } _ { t - 1 } , ( G _ { t , 1 } , y _ { t , 1 } ) \} )$ ; the same procedure applies for $G _ { t , 3 }$ , $G _ { t , 4 }$ and $G _ { t , 5 }$ However, in the batch case $\mathrm { B } = 5$ ) where $G _ { t , i }$ for $2 \leq i \leq 5$ need to be selected before $G _ { t , i - 1 }$ is evaluated, $\{ G _ { t , i } \} _ { i = 2 } ^ { 5 }$ are all decided based on $\alpha _ { t } ( G | \mathcal { D } _ { t - 1 } )$ like $G _ { t , 1 }$ . For a more detailed discussion on sequential $B = 1$ ) and batch $| B > 1 |$ ) BO, the readers are referred to Alvi et al. (2019).
|
| 440 |
+
|
| 441 |
+
Other Baselines For all the other baselines: random search (Bergstra and Bengio, 2012), TPE (Bergstra et al., 2011), Reinforcement Learning (Zoph and Le, 2016), BO with SMAC (Hutter et al., 2011), regularised evolution (Real et al., 2019), we follow the implementation available at https://github.com/automl/nas_benchmarks for NAS-Bench-101 (Ying et al., 2019). We modify them to be applicable on NAS-Bench-201 (Dong and Yang, 2020). Note that like GCNBO, all these methods are sequential $B = 1$ , and thus should enjoy the same advantage mentioned above when measured against the number of architectures evaluated.
|
| 442 |
+
|
| 443 |
+

|
| 444 |
+
Figure 11: Median validation error on NAS-Bench datasets with deterministic (top row) and noisy (bottom row) observations from 20 trials. Shades denote $\pm 1$ standard error.
|
| 445 |
+
|
| 446 |
+
# F.3 ADDITIONAL NAS-BENCH RESULTS
|
| 447 |
+
|
| 448 |
+
Validation Errors Against Number of Evaluations We show the validation errors against number of evaluations using both stochastic and deterministic validation errors of NAS-Bench datasets in Fig. 11. It is worth noting that regardless of whether the validation errors are stochastic or not, the test errors are always averaged to deterministic values for fair comparison. It is obvious that NAS-BOWL still outperforms the other methods under this metric in achieving lower test error or enjoying faster convergence, or having both under most circumstances. This corresponds well with the results on the test error in Fig. 5 and double-confirms the superior performance of our proposed NAS-BOWL in searching optimal architectures.
|
| 449 |
+
|
| 450 |
+
Effect of Varying Pool Size As discussed in the main text, NAS-BOWL introduces no inherent hyperparameters that require manual tuning as it relies on a non-parametric surrogate. Nonetheless, besides the surrogate, the choice on how to generate the candidate architectures requires us to specify a number of parameters such as the pool size ( $P$ , the number of candidate architectures to generate at each BO iteration) and batch size $B$ . In our main experiments, we have set $P = 2 0 0$ and $B = 5$ throughout; in this section, we consider the effect of varying $P$ to investigate whether the performance of NAS-BOWL is sensitive to this parameter.
|
| 451 |
+
|
| 452 |
+
We keep $B = 5$ but adjust $P \in \{ 5 0 , 1 0 0 , 2 0 0 , 4 0 0 \}$ , and keep all other settings to be consistent with the other experiments using the deterministic validation errors on NAS-Bench-101 (N101) (i.e. averaging the validation error seeds to remove stochasticity), and we report our results in Fig. 12 where the median result is computed from 20 experiment repeats. It can be shown that while the convergence speed varies slightly between the different $P$ choices, for all choices of $P$ apart from 50 which performs slightly worse, NAS-BOWL converges to similar validation and test errors at the end of 150 architecture evaluations – this suggests that the performance of NAS-BOWL is rather robust to the value of $P$ and that our recommendation of $P = 2 0 0$ does perform well both in terms of both the final solution returned and the convergence speed.
|
| 453 |
+
|
| 454 |
+
Ablation Studies In this section we perform ablation studies on the NAS-BOWL performance on both N101 and N201 (with deterministic validation errors). We repeat each experiment 20 times, and we present the median and standard error in terms of both validation and test performances in Fig. 13 (N101 in (a)(b) and N201 in (c)(d)). We now explain each legend as follow:
|
| 455 |
+
|
| 456 |
+

|
| 457 |
+
Figure 12: Effect of varying $P$ on NAS-BOWL in N101.
|
| 458 |
+
|
| 459 |
+
1. mutate: Full NAS-BOWL with the mutation described in Sec. 3.2 (identical to NASBOWLm in Figs. 11 and 5);
|
| 460 |
+
2. rand: NAS-BOWL with random candidate generation. This is identical to NASBOWLr in Figs. 11 and 5;
|
| 461 |
+
3. UCB: NAS-BOWL with random candidate generation, but with the acquisition function changed from Expected Improvement (EI) to Upper Confidence Bound (UCB) Srinivas et al. (2009) $\alpha _ { \mathrm { a c q } } =$ $\mu + \beta _ { n } \sigma$ , where $\mu , \sigma$ are the predictive mean and standard deviation of the GPWL surrogate, respectively and $\beta _ { n }$ is a coefficient that changes as a function of $n$ , the number of BO iterations. We select $\beta$ at initialisation $( \beta _ { 0 } )$ to 3, but decay it according to $\beta _ { n } = \beta _ { 0 } \sqrt { \textstyle { \frac { 1 } { 2 } } \log ( 2 ( n + 1 ) ) }$ as suggested by Srinivas et al. (2009), where $n$ is the number of BO iterations.
|
| 462 |
+
4. VH: NAS-BOWL with random candidate generation, but instead of leaving the value of $h$ (number of WL iterations) to be automatically determined by the optimisation of the GP log marginal likelihood, we set $h = 0$ , i.e. no WL iteration takes place and the only features we use are the counts of each type of original node operation features (e.g. conv $3 \times 3$ -bn-relu). This essentially reduces the WL kernel to a Vertex Histogram (VH) kernel.
|
| 463 |
+
|
| 464 |
+

|
| 465 |
+
Figure 13: Ablation studies of NAS-BOWL
|
| 466 |
+
|
| 467 |
+
We find that topological information and using an appropriate $h$ are highly crucial: in both N101 and N201, VH significantly underperforms the other variants, although the extent of underperformance is smaller in N201 likely due to its smaller search space. This suggests that how the nodes are connected, which are extracted as higher-order WL features, are very important, and the multi-scale feature extraction in the WL kernel is crucial to the success of NAS-BOWL. On the other hand, the choice of the acquisition function seems not to matter as much, as there is little difference between UCB and WL runs in both N101 and N201. Finally, using mutation algorithm leads to a significant improvement in the performance of NAS-BOWL, as we have already seen in the main text.
|
| 468 |
+
|
| 469 |
+
# G OPEN-DOMAIN EXPERIMENTAL DETAILS
|
| 470 |
+
|
| 471 |
+
All experiments were conducted on a machine with an Intel Xeon-W processor with 64 GB RAM and a single NVIDIA GeForce RTX 2080 Ti GPU with 11 GB VRAM.
|
| 472 |
+
|
| 473 |
+
# G.1 SEARCH SPACE
|
| 474 |
+
|
| 475 |
+
Our search space is identical to that of DARTS (Liu et al., 2018a): it is in the popular NASNet search space, and we limit the maximum number of operation nodes to be 4 (in addition to 2 input nodes and 1 input node in each cell), and the possible node operations are $3 \times 3$ and $5 \times 5$ separable convolutions $( \mathsf { s e p - c o n v - 3 } \times 3$ and $\mathsf { s e p - c o n v - } 5 \times 5 )$ , $3 \times 3$ and $5 \times 5$ dilated convolutions $( \mathrm { d i } 1 \mathrm { - c o n v - } 3 \times 3$ and $\mathrm { d i } 1 \mathrm { - c o n v - } 5 \times 5 )$ , $3 \times 3$ max pooling and average pooling $( \mathrm { m a x } - \mathsf { p o o l } - 3 \times 3$ and $\mathtt { a v g - p o o l - } 3 \times 3 )$ , identity skip connection (skip-connect) and zeroise (none).To enable the application of the GPWL surrogate without modification, we use the ENASstyle node-attributed DAG representation of the cells (this representation can be easily converted to the DARTS-style edge-attributed DAG without any loss of information). We show the best cell identified by NAS-BOWL in the DARTS search space in both edge- and node-attributed DAG representations in Fig, 14 as an example.
|
| 476 |
+
|
| 477 |
+

|
| 478 |
+
Figure 14: Equivalent representations of the best cell identified by NAS-BOWL in the DARTS search space. Our method uses the node-attributed version during search, and this cell is used for both the normal and reduction cells.
|
| 479 |
+
|
| 480 |
+
# G.2 EXPERIMENTAL SETUP
|
| 481 |
+
|
| 482 |
+
We mostly follow the setup and the code base (https://github.com/quark0/darts) from DARTS (Liu et al., 2018a), and we detail the setup in full below:
|
| 483 |
+
|
| 484 |
+
Architecture Search During the architecture search, we use half of the CIFAR-10 training data and leave the other half as the validation set. We use stack the search cell 8 times to produced a small network, and use batch size of 64 and initial number of channels of 16. As discussed, we only search one cell, and use this for both normal and reduction cells (in DARTS the two cells are searched separately). We use SGD optimiser with momentum of 0.9, weight decay of $3 \times 1 0 ^ { - 4 }$ and an initial learning rate of 0.025 which is cosine annealed to zero over 50 epochs. As known by previous works (Liu et al., 2018a), the validation performance on CIFAR-10 is very volatile, and to ameliorate this we feed the average of the validation accuracy of the final 5 epochs as the observed accuracy to the GPWL surrogate. We use the identical setup for GPWL surrogate as the NAS-Bench experiments and we use the standard mutation algorithm described to generate the candidates every BO iteration.
|
| 485 |
+
|
| 486 |
+
Architecture Evaluation After the search budget (set to 150 architectures) is exhausted, we evaluate the neural network stacked from the best architecture found, based on the validation accuracy during the search stage. During evaluation, we construct a larger network of 20 cells and is trained for 600 epochs with batch size 96 and initial number of channels of 36. Additional enhancements that are almost universally used in previous works, such as path dropout of probability 0.2, cutout, and auxiliary towers with weight 0.4 are also applied in this stage (these techniques are all identical to those used in Liu et al. (2018a)). Any other enhancements not used in DARTS such as mixup, AutoAugment and test-time data augmentation are not applied. The optimiser setting is identical to that during architecture search, with the exception that the cosine annealing is over the full 600 epochs instead of 50 during search. During this stage, we use the entire CIFAR-10 training set for training, and report best accuracy encountered during evaluation on the validation set in Table 1. We finally train the final architecture for 4 random repeats on CIFAR-10 dataset.
|
md/train/mAA1SfR_iun/mAA1SfR_iun.md
ADDED
|
@@ -0,0 +1,457 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Graph-Constrained Structure Search for Tensor Network Representation
|
| 2 |
+
|
| 3 |
+
Anonymous Author(s)
|
| 4 |
+
Affiliation
|
| 5 |
+
Address
|
| 6 |
+
email
|
| 7 |
+
|
| 8 |
+
# Abstract
|
| 9 |
+
|
| 10 |
+
1 Recent works paid effort on the structure search issue for tensor network (TN)
|
| 11 |
+
2 representation, of which the aim is to select the optimal network for TN contraction
|
| 12 |
+
3 to fit a tensor. In practice, however, it is more inclined to solve its sub-problem:
|
| 13 |
+
4 searching TN structures from candidates with a similar topology like a cycle or lat
|
| 14 |
+
5 tice. We name this problem the graph-constrained structure search, and it remains
|
| 15 |
+
6 open to this date. In this work, we conduct a thorough investigation of this issue
|
| 16 |
+
7 from both the theoretical and practical aspects. Theoretically, we prove that the
|
| 17 |
+
8 TN structures are generally irregular under graph constraints yet can be universally
|
| 18 |
+
9 embedded into a low-dimensional regular discrete space. Guided by the theoretical
|
| 19 |
+
10 results, we propose a simple algorithm, which can encode the graph-constrained
|
| 20 |
+
11 TN structures into fixed-length strings for practical purposes by a “random-key”
|
| 21 |
+
12 trick, and empirical results demonstrate the effectiveness and efficiency of the
|
| 22 |
+
13 proposed coding method on extensive benchmark TN representation tasks.
|
| 23 |
+
|
| 24 |
+
# 14 1 Introduction
|
| 25 |
+
|
| 26 |
+
15 Tensor networks (TNs) are recognized as a popular framework for solving extremely
|
| 27 |
+
16 high-dimensional problems arising in domains such as quantum simulation, machine
|
| 28 |
+
17 learning and signal processing. In general, TNs are used to represent the high
|
| 29 |
+
18 dimensional states/models/data by a network of low-dimensional tensors (a.k.a., cores),
|
| 30 |
+
19 such that the requirement on computation and storage would be significantly reduced.
|
| 31 |
+
21 It is of importance to select an appropriate structure in the practical
|
| 32 |
+
22 use of TNs. There are many studies on learning TN ranks for specific
|
| 33 |
+
23 models [26–28, 43, 46, 47] to name a few, and recently several works
|
| 34 |
+
24 paid the effort on learning more general TN structures with arbitrary
|
| 35 |
+
25 topology [17, 19, 21, 25]. Surprisingly, however, none of them can
|
| 36 |
+
26 effectively solve a seemly easier task: how to learn the optimal matching
|
| 37 |
+
27 from the modes onto the cores of a TN? For instance as illustrated in
|
| 38 |
+
28 Figure 1, there are three different candidates to represent a tensor by
|
| 39 |
+
29 tensor ring (TR) [47]. We need algorithms, which can learn the optimal
|
| 40 |
+
30 one from the three. It is actually a special case of learning the optimal
|
| 41 |
+
31 TN structures under graph constraints, a sub-problem of the existing
|
| 42 |
+
32 structure search for TN representation.
|
| 43 |
+
33 The state of affairs raises important unresolved questions. Is the afore
|
| 44 |
+
34 mentioned task really easier than the general structure search? What
|
| 45 |
+
35 are the properties of TN structures under graph constraints, and how to
|
| 46 |
+
36 effectively solve the problem in practice?
|
| 47 |
+
37 In this work, we shed light on these questions through a theoretical and empirical investigation of the
|
| 48 |
+
38 graph-constrained TN structures.
|
| 49 |
+
39 We first prove the graph constraint makes TN structures being irregular. In particular, both the
|
| 50 |
+
40 addition and random perturbation is not closed on the candidate set. This result helps to explain
|
| 51 |
+
41 why the conventional search algorithms on grids give no guarantee of feasibility of the solutions.
|
| 52 |
+
42 Furthermore, on the scale of the search problem, we prove the symmetry of the graph-constraint plays
|
| 53 |
+
43 a role to determine the cardinality of TN structures, yet there exists a universal cardinality bound
|
| 54 |
+
44 across a varies of practical TNs, such as tensor train (TT) [30], tensor ring (TR) and PEPS [38]. The
|
| 55 |
+
45 result reveals the possibility to construct a regular discrete space, from which we can represent those
|
| 56 |
+
46 irregular TN structures by elements in a compact manner.
|
| 57 |
+
47 Guided by the theoretical results, this work also sheds light on a practical solution for the graph
|
| 58 |
+
48 constrained structure search issue. We propose a novel coding method to encode TN structures into
|
| 59 |
+
49 fix-length strings by a “random-key” trick, a random mapping from TN structure space to coding
|
| 60 |
+
50 space. The regularity of the coding space allows to apply the population-based algorithms equipped
|
| 61 |
+
51 with the proposed coding method to tackling the search issue for TN representation effectively. We
|
| 62 |
+
52 conduct extensive experimentation on a variety of benchmarks. The results show that the proposed
|
| 63 |
+
53 method often obtain better TN structures than many existing rank-selection and structure search
|
| 64 |
+
54 algorithms.
|
| 65 |
+
|
| 66 |
+

|
| 67 |
+
Figure 1: Which tensor ring (TR) is the optimal?
|
| 68 |
+
|
| 69 |
+
# 55 2 Preliminaries and problem setup
|
| 70 |
+
|
| 71 |
+
In this section, we present the basic concepts on tensor network (TN), and give a formal definition of the graph-constrained structure search for TN representation.
|
| 72 |
+
|
| 73 |
+
# 2.1 Tensor network (TN) and structure search for tensor network representation (TNR)
|
| 74 |
+
|
| 75 |
+
59 An order- $N$ tensor is a multi-dimensional array of real numbers represented by $\mathcal { X } _ { i _ { 1 } , i _ { 2 } , . . . , i _ { N } } \in$
|
| 76 |
+
60 $\mathbb { R } ^ { I _ { 1 } \times I _ { 2 } \times \dots \times I _ { N } }$ , where $i _ { m }$ , $m \in [ N ]$ is defined as the index regarding the mth mode of $\mathcal { X } ^ { 1 }$ and $[ N ]$
|
| 77 |
+
61 denotes a set of integers from 1 to $N$ . Tensor contraction [10], a binary operation on tensors, is
|
| 78 |
+
62 defined as a multiplication of two tensors under their same indices. For instance, given two order-2
|
| 79 |
+
63 tensors $\mathcal { A } _ { i , j } \in \mathbb { R } ^ { \hat { I } \times J }$ , $\boldsymbol { B } _ { j , \boldsymbol { k } } \in \mathbb { R } ^ { J \times K }$ , the tensor contraction of $\mathcal { A }$ and $\boldsymbol { B }$ under the index $j$ returns
|
| 80 |
+
64 $\mathcal { C } _ { i , k } = \mathcal { A } _ { i , j } \mathcal { B } _ { j , k } \in \mathbb { R } ^ { I \times K }$ , which is equivalent to the matrix multiplication.
|
| 81 |
+
65 A tensor network $( T N )$ is roughly defined as a collection of tensors (a.k.a., cores), which are
|
| 82 |
+
66 tensor-contracted under some, or all, of their indices according to a specific pattern [29]. Recent
|
| 83 |
+
67 works [25, 42] show that the “patterns” of TNs can be precisely described by edge-weighted simple
|
| 84 |
+
68 graphs. TN structures thus can be formulated by adjacency matrices of graphs. Formally, we define
|
| 85 |
+
69 the TN with a general “pattern” as follows.
|
| 86 |
+
|
| 87 |
+
Definition 1 (Tensor network.) 70 $L e t \mathbb { A } _ { R } = \left\{ \mathbf { A } \in \left( \mathbb { Z } _ { R + 1 } \right) ^ { N \times N } | \mathbf { A } ( i , i ) = 0 \right\}$ , $\forall i \in [ N ]$ , and $\mathbf { A } = \mathbf { A } ^ { \top } \Big \}$ , 71 an order- $N$ tensor network (TN) of the size $\dot { I _ { 1 } } \times I _ { 2 } \times \cdots \times I _ { N }$ under a structure $\mathbf { A } \in \mathbb { A } _ { R }$ defines $a$ 72 mapping :
|
| 88 |
+
|
| 89 |
+
$$
|
| 90 |
+
\begin{array} { r } { \pmb { \mathcal { X } } = T N ( \pmb { \mathbb { V } } ; \mathbf { A } ) \in \mathbb { R } ^ { I _ { 1 } \times I _ { 2 } \times \cdots \times I _ { N } } , } \end{array}
|
| 91 |
+
$$
|
| 92 |
+
|
| 93 |
+
where $\mathbb { V } = \{ \mathcal { V } _ { i } , i \in [ N ] \}$ represents a collection of cores in which the size of $\nu _ { i }$ , $i \in [ N ]$ equals the multiplication of $I _ { i }$ and all non-zero entries of ${ \bf A } ( i , : )$ , and $T N ( \cdot ; \mathbf { A } )$ denotes a series of tensor contractions of $\mathbb { V }$ under the indices $I 2 5 J$ described by A.
|
| 94 |
+
|
| 95 |
+
76 We observe that Definition. 1 models a rich family of TNs with the ranks upper-bounded by $R$ (due
|
| 96 |
+
77 to $\mathbb { Z } _ { R + 1 } ,$ ), including TT, TR, PEPS and etc., but also note that the TNs that contain internal cores are
|
| 97 |
+
78 not included in this form.
|
| 98 |
+
|
| 99 |
+
Tensor network representation (TNR) of a tensor $\mathcal { X }$ is defined as finding a specific core-set $\mathbb { V }$ such that Eq. (1) holds. The structure search for TNR is thus to find the optimal matrix $\mathbf { A } \in \mathbb { A } _ { R }$ , such that $\mathcal { X }$ can be represented by $\mathbb { V }$ that satisfies Eq. (1). In particular, the search problem can be solved by
|
| 100 |
+
|
| 101 |
+
$$
|
| 102 |
+
\operatorname* { m i n } _ { \mathbf { A } \in \mathbb { A } _ { R } } \phi _ { \mathcal { X } } ( \mathbf { A } ) , \quad s . t . \ : \mathcal { X } = T N ( \mathbb { V } ; \mathbf { A } ) f o r s o m e \mathbb { V } ,
|
| 103 |
+
$$
|
| 104 |
+
|
| 105 |
+
82 where $\phi _ { \mathcal { X } } : \mathbb { A } _ { R } \mathbb { R }$ denotes a measure of the TN structures like compression ratio. Note that
|
| 106 |
+
83 similar frameworks were also introduced in works [17, 21], where the entries of A corresponds to
|
| 107 |
+
84 the TN-ranks formulated as a vector in those works. Lemma 5 in Sec. 3 will show the matrix form of
|
| 108 |
+
85 A would provide additional structural information to analyse the property of TN structures.
|
| 109 |
+
|
| 110 |
+
# 86 2.2 Graph-constrained structure search for TNR
|
| 111 |
+
|
| 112 |
+
87 The graph-constrained structure search issue is also modeled as (2) yet constraining the feasible space
|
| 113 |
+
88 $\mathbb { A } _ { R }$ into a graph-induced subset, in which the TN structures have similar topological forms. To build
|
| 114 |
+
89 the connection to graphs, we first show the existence of a bijective mapping from $\mathbb { A } _ { R }$ to a graph
|
| 115 |
+
90 space.
|
| 116 |
+
91 Lemma 2 There is a bijective mapping $\Psi : \mathbb { A } _ { R } \mathbb { G } _ { R }$ , where $\mathbb { G } _ { R }$ denotes a set containing all
|
| 117 |
+
92 possible vertex-labeled, simple yet weighted graphs $( G , f _ { R } ) = ( V , E , f _ { R } )$ with $N$ vertices and $a$
|
| 118 |
+
93 edge-weighting function $f _ { R } : e \in E [ R ]$ , and we name the unweighted part $G$ the topology of TN
|
| 119 |
+
94 a TN structure.
|
| 120 |
+
95 The claim is naturally true by the relation between graphs and the adjacency matrices. The bijection
|
| 121 |
+
96 in Lemma 2 implies that for each $\mathbf { A } \in \mathbb { A } _ { R }$ we can always find a unique $( G , f _ { R } )$ corresponding to
|
| 122 |
+
97 it. Table 1 in the supplementary material illustrates the correspondence between graphs and the
|
| 123 |
+
98 well-known TNs. We next construct graph-constrained TN structures by the isomorphism of a graph
|
| 124 |
+
99 $G _ { 0 } = ( V , E _ { 0 } )$ and the mapping $\Psi$ given in Lemma 2. A formal definition is given as follow.
|
| 125 |
+
00 Definition 3 (Graph-constrained TN structures.) Given a vertex-labeled simple graph $G _ { 0 } \ =$
|
| 126 |
+
101 $( V , E _ { 0 } )$ and the mapping $\Psi$ in Lemma 2, the TN structures under $G _ { 0 }$ are defined as
|
| 127 |
+
|
| 128 |
+
$$
|
| 129 |
+
\mathbb { H } _ { G _ { 0 } , R } = \left\{ \mathbf { H } \in \mathbb { A } _ { R } | G _ { H } \cong G _ { 0 } w h e r e \left( G _ { H } , f _ { R , H } \right) = \Psi ( \mathbf { H } ) \right\} ,
|
| 130 |
+
$$
|
| 131 |
+
|
| 132 |
+
102 where $\cong$ denotes the graph isomorphism.
|
| 133 |
+
|
| 134 |
+
103 As given in Definition 3, $\mathbb { H } _ { G _ { 0 } , R }$ is a subset of $\mathbb { A } _ { R }$ and its elements own the topologies being
|
| 135 |
+
104 isomorphic to $G _ { 0 }$ . For instance, suppose $G _ { 0 }$ to be a cycle graph of 4 vertices, i.e., $C _ { 4 }$ , then $\mathbb { H } _ { C _ { 4 } , R }$
|
| 136 |
+
105 contains all TR structures of order-4 with the ranks upper-bounded by $R$ as Figure 1. It is thus
|
| 137 |
+
106 expected to solve the mentioned optimal matching problem by searching structures on $\mathbb { H } _ { G _ { 0 } , R }$ . Not
|
| 138 |
+
107 only that, but also note $\mathbb { H } _ { G _ { 0 } , R }$ equals $\mathbb { A } _ { R }$ if $G _ { 0 }$ is a completion graph, i.e., $K _ { N }$ . Next, we define the
|
| 139 |
+
108 problem of graph-constrained structure search for TNR by $\mathbb { H } _ { G _ { 0 } , R }$ .
|
| 140 |
+
109 Definition 4 (Graph-constrained structure search for TNR.) Given a graph $G _ { 0 }$ and the corre
|
| 141 |
+
110 sponding $\mathbb { H } _ { G _ { 0 } , R }$ obtained as Definition 3, the graph-constrained structure search for TNR is to solve
|
| 142 |
+
111 the following problem:
|
| 143 |
+
|
| 144 |
+
$$
|
| 145 |
+
\operatorname* { m i n } _ { \mathbf { H } \in \mathbb { H } _ { G _ { 0 } , R } } \phi _ { \mathcal { X } } ( \mathbf { H } ) , \quad s . t . \mathcal { X } = T N ( \mathbb { V } ; \mathbf { H } ) f o r s o m e \mathbb { V } .
|
| 146 |
+
$$
|
| 147 |
+
|
| 148 |
+
112 It is shown from Definition 4 that the set $\mathbb { H } _ { G _ { 0 } , R }$ restricts the optimization process only searching on
|
| 149 |
+
113 the TN structures, which has the same topology $G _ { 0 }$ up to permutations of the vertices [5]. Moreover,
|
| 150 |
+
114 although (4) owns a similar form to its unconstrained counterpart (2), it will be proved in the next
|
| 151 |
+
115 section that the existing algorithms on (2) may be not available on the graph-constrained search issue.
|
| 152 |
+
116 Remark. Note that Definition 1 allows the entries of $\mathbf { A }$ to equal 1, which implies the rank-one
|
| 153 |
+
117 contraction between cores. According to the fact given in [25, 42] that the weight-one edges can
|
| 154 |
+
118 be removed from TNs, we thus know that the solution of (4) would have a subgraph of $G _ { 0 }$ as its
|
| 155 |
+
119 “true” topology. Therefore, solving (4) has the capability of achieving not only isomorphic but also
|
| 156 |
+
120 subgraphs of $G _ { 0 }$ .
|
| 157 |
+
|
| 158 |
+
# 121 3 Algebraic properties of graph-constrained TN structures
|
| 159 |
+
|
| 160 |
+
122 In this section, we focus on the properties of $\mathbb { H } _ { G _ { 0 } , R }$ , the set containing all TN structures constrained
|
| 161 |
+
123 under a graph $G _ { 0 }$ . From an algebraic perspective, we first show $\mathbb { H } _ { G _ { 0 } , R }$ is irregular under most of
|
| 162 |
+
124 graph constraints by proving that the set is not closed under addition and random perturbation. After
|
| 163 |
+
125 that, we analyse the cardinality of $\mathbb { H } _ { G _ { 0 } , R }$ , which reflects the scale of the search problem. We derive
|
| 164 |
+
26 the precise cardinality of $\mathbb { H } _ { G _ { 0 } , R }$ across many well-known TNs, and prove a universal cardinality
|
| 165 |
+
127 bound of $\mathbb { H } _ { G _ { 0 } , R }$ under all connected low-degree graphs.
|
| 166 |
+
28 To understand the property of $\mathbb { H } _ { G _ { 0 } , R }$ , we first prove all its elements own a factorization of the
|
| 167 |
+
29 multiplication of a rank-induced matrix and a permutation matrix.
|
| 168 |
+
130 Lemma 5 (Factorization of $\mathbb { H } _ { G _ { 0 } , R }$ .) Given a vertex-labeled simple graph $G _ { 0 } = ( V , E _ { 0 } )$ , for any
|
| 169 |
+
131 $\mathbf { H } \in \mathbb { H } _ { G _ { 0 } , R }$ , there exists a permutation matrix $\mathbf { P }$ of the size $| V | \times | V |$ and a bijective linear mapping
|
| 170 |
+
132 $\Omega _ { G _ { 0 } } : ( \mathbb { Z } _ { R + 1 } ) ^ { | E _ { 0 } | } \to ( \mathbb { Z } _ { R + 1 } ) ^ { | V | \times | V | }$ such that $\mathbf { H }$ can be factorized as
|
| 171 |
+
|
| 172 |
+
$$
|
| 173 |
+
\mathbf { H } = \mathbf { P } \boldsymbol { \Omega } _ { G _ { 0 } } ( \mathbf { r } ) \mathbf { P } ^ { \top } ,
|
| 174 |
+
$$
|
| 175 |
+
|
| 176 |
+
where 133 $| \cdot |$ denotes the cardinality and $\mathbf { r } \in \ ( \mathbb { Z } _ { R + 1 } ) ^ { | E _ { 0 } | }$ denotes the rank vector of dimension $\lvert E _ { 0 } \rvert$
|
| 177 |
+
|
| 178 |
+
134 Intuitively, Lemma 5 implies that the rank-induced matrix $\Omega _ { G _ { 0 } } ( \mathbf { r } )$ forms a linear sub-space of
|
| 179 |
+
135 dimension $\lvert E _ { 0 } \rvert$ , then $\mathbb { H } _ { G _ { 0 } , R }$ takes all “flips and rotations” of the subspace into account due to the
|
| 180 |
+
136 permutation matrix $\mathbf { P }$ . A visual illustration of $\mathbb { H } _ { G _ { 0 } , R }$ is shown on the most left of Figure 2. We can
|
| 181 |
+
137 see that $\mathbb { H } _ { G _ { 0 } , R }$ has an “irregular shape” visually, and this property is formally proved as follows.
|
| 182 |
+
|
| 183 |
+
138 Proposition 6 (Irregularity of $\mathbb { H } _ { G _ { 0 } , R } .$ .) Assuming $R \geq 2$ , the following two claims are held.
|
| 184 |
+
|
| 185 |
+
1. Addition (modulo $R + 1$ ) is not closed on $\mathbb { H } _ { G _ { 0 } , R }$ if $G _ { 0 } = ( V , E _ { 0 } )$ or its complement is not complete; 2. With a relatively sparse graph $G _ { 0 }$ , the Bernoulli-distributed perturbation on $\mathbb { H } _ { G _ { 0 } , R }$ is not closed with a probability approximately being larger than $( 1 - 1 / R ) ^ { | E _ { 0 } | }$ .
|
| 186 |
+
|
| 187 |
+
143 The proof is given as supplementary material. Proposition 6 effectively say that the operations used
|
| 188 |
+
144 in common search algorithms, such as the recombination and mutation in genetic algorithms (GAs)
|
| 189 |
+
145 or progressive search in greedy methods, cannot guarantee the outputs being contained by $\mathbb { H } _ { G _ { 0 } , R }$
|
| 190 |
+
146 leading to the invalidation of those algorithms on this issue.
|
| 191 |
+
147 Next, we jump to the cardinality of $\mathbb { H } _ { G _ { 0 } , R }$ , which reflects how many candidates we have under a
|
| 192 |
+
148 graph constraint. From a information-theoretic perspective, the cardinality is proportional to the least
|
| 193 |
+
149 required code length on TN structures in general. A smaller cardinality generally implies a easier
|
| 194 |
+
150 search process especially for the population-based algorithms. Below, we first prove the cardinality
|
| 195 |
+
151 of $\mathbb { H } _ { G _ { 0 } , R }$ under a general graph constraint.
|
| 196 |
+
|
| 197 |
+
152 Lemma 7 (Cardinality of $\mathbb { H } _ { G _ { 0 } , R }$ .) Given a vertex-labelled simple graph $G _ { 0 } = ( V , E _ { 0 } )$ , we have
|
| 198 |
+
|
| 199 |
+
$$
|
| 200 |
+
\begin{array} { r } { \log ( | \mathbb { H } _ { G _ { 0 } , R } | ) = | E _ { 0 } | \log ( R ) + \log ( | V | ! ) - \log ( | A u t ( G _ { 0 } ) | ) , } \end{array}
|
| 201 |
+
$$
|
| 202 |
+
|
| 203 |
+
where $\log ( \cdot )$ denotes the natural logarithm and $A u t ( G _ { 0 } )$ denotes the graph automorphisms of $G _ { 0 }$
|
| 204 |
+
|
| 205 |
+
154 As shown on the right of Eq. (6), the first two terms correspond to the TN-ranks and permutations as
|
| 206 |
+
155 Lemma 5, respectively, while the third term $\log ( | A u t ( G _ { 0 } ) | )$ reflects the symmetry of $G _ { 0 }$ . it implies
|
| 207 |
+
156 the cardinality of $\mathbb { H } _ { G _ { 0 } , R }$ would be small if $G _ { 0 }$ owns strong symmetry. From the TN perspective, it
|
| 208 |
+
157 means the TNs with symmetric topologies like TR and the complete TN (CTN) [48] are expected to
|
| 209 |
+
158 own a smaller size of $\mathbb { H } _ { G _ { 0 } , R }$ . For those well-known TNs, we show their corresponding cardinality of
|
| 210 |
+
159 $\mathbb { H } _ { G _ { 0 } , R }$ as follow.
|
| 211 |
+
|
| 212 |
+
60 Proposition 8 Assume order- $. N$ TN models, of which the ranks are upper-bounded by $R$ , then we have
|
| 213 |
+
|
| 214 |
+
1. TT [30]: $\log ( | \mathbb { H } _ { P _ { N } , R } | ) = ( N - 1 ) \log ( R ) + \log ( N ! ) - \log ( 2 )$
|
| 215 |
+
2. TR [47]: $\log ( | \mathbb { H } _ { C _ { N } , R } | ) = N \log ( R ) + \log \left( ( N - 1 ) ! \right) - \log ( 2 )$
|
| 216 |
+
3. CTN [48]: $\log ( | \mathbb { H } _ { K _ { N } , R } | ) = ( N ^ { 2 } - N ) \log ( R ) / 2$
|
| 217 |
+
4. T-tree [42]: $\begin{array} { r } { \cdot ( N - 1 ) \log ( R ) + \log ( N ) \leq \log ( | \mathbb { H } _ { T _ { N } , R } | ) \leq \log ( | \mathbb { H } _ { P _ { N } , R } | ) } \end{array}$
|
| 218 |
+
5. $\begin{array} { r } { P E P S \left[ 3 \delta J : \log ( | \mathbb { H } _ { L _ { m , n } } | ) \leq ( 2 m n - m - n ) \log ( R ) + \log ( ( m n ) ! ) - \log ( 4 ) \right. } \end{array}$
|
| 219 |
+
6. Tucker2 [36]: $\log ( | \mathbb { H } _ { K _ { 1 , N } } | ) = N \log ( R )$
|
| 220 |
+
|
| 221 |
+
2Note that the Tucker model is not strictly contained by Definition. 1.
|
| 222 |
+
|
| 223 |
+
168 In Proposition 8, the inequalities for the T-tree models is due to the variety of the tree structures, and
|
| 224 |
+
169 in PEPS the equality is held if $m$ and $n$ are relatively prime. We observe from Proposition 8 that
|
| 225 |
+
170 TR would have a smaller $\mathbb { H } _ { G _ { 0 } , R }$ than TT in the case of large $N$ . It is intuitively true since the TR
|
| 226 |
+
171 structure is more symmetric than the one of TT. However, we also observe that, except CTN and the
|
| 227 |
+
172 Tucker model, there always exists a factorial of $N$ in the equations for the rest of TNs. It implies that
|
| 228 |
+
173 the cardinality of $\mathbb { H } _ { G _ { 0 } , R }$ for those TNs is not significantly different from each other. Below, we prove
|
| 229 |
+
174 the fact is true for all TNs, of which the corresponding $G _ { 0 }$ is connected and low-degree.
|
| 230 |
+
|
| 231 |
+
75 Proposition 9 (A universal cardinality bound on $\mathbb { H } _ { G _ { 0 } , R }$ .) Assume $G _ { 0 } ~ = ~ ( V , E _ { 0 } )$ is connected graph and its maximum degree 76 $\Delta _ { G _ { 0 } }$ is a constant that is far less than $| V |$ , then we have
|
| 232 |
+
|
| 233 |
+
$$
|
| 234 |
+
\log ( | \mathbb { H } _ { G _ { 0 } , R } | ) \ge \mathcal { O } \left( | V | \log ( R ) + | V | \log ( | V | ) \right) ,
|
| 235 |
+
$$
|
| 236 |
+
|
| 237 |
+
177 where $\mathcal { O } ( \cdot )$ denotes the big- $o$ notation.
|
| 238 |
+
|
| 239 |
+
178 The result is proved by bounding the both $\left| E _ { 0 } \right|$ and $\left| A u t ( G _ { 0 } ) \right|$ in Lemma 5 by the maximum degree
|
| 240 |
+
179 $\Delta _ { G _ { 0 } }$ using the Handshaking lemma known in graph theory and Theorem 2 given in [22], respectively.
|
| 241 |
+
180 In addition, we also use the Stirling’s approximation [32] to obtain a tight bound for the logarithm of
|
| 242 |
+
181 factorials to further simplify the expression.
|
| 243 |
+
182 The assumption of a small $\Delta _ { G _ { 0 } }$ is reasonable since in the practical TNs the cores are expected to be
|
| 244 |
+
183 low-order (see Table 1 given in the supplementary material for instance). Proposition 9 means that
|
| 245 |
+
184 there is a $G _ { 0 }$ -independent bound on the cardinality of $\mathbb { H } _ { G _ { 0 } , R }$ for all connected and low-degree graphs,
|
| 246 |
+
185 and we can see the bound is relatively tight by intuitively comparing the results with Proposition 8.
|
| 247 |
+
186 As shown in (7), the first term $| V | \log ( R )$ corresponds to the number of all possible ranks bounded by
|
| 248 |
+
187 $R$ , and the second term $| V | \log ( | V | )$ has the same scale to $\log ( | V | ! )$ for the Stirling’s approximation.
|
| 249 |
+
188 It implies that, in the case of connected and low-degree $G _ { 0 }$ , the cardinality of $\mathbb { H } _ { G _ { 0 } , R }$ is close to the
|
| 250 |
+
189 combination of all possible $\Omega _ { G _ { 0 } } ( \mathbf { r } )$ and $\mathbf { P }$ in Lemma 5. In other words, the factorization given in
|
| 251 |
+
190 Lemma 5 is nearly unique on $\mathbb { H } _ { G _ { 0 } , R }$ . From a pragmatic perspective, the result say that we can solve
|
| 252 |
+
191 the constrained structure search issue from the factorization space as a alternative. More importantly,
|
| 253 |
+
192 such the factorization space is independent to topology, because $G _ { 0 }$ only determine the mapping $\Omega _ { G _ { 0 } }$ ,
|
| 254 |
+
193 which is bijective, linear and fixed beforehand. The result guides us to find the practical solution on
|
| 255 |
+
194 the graph-constrained structure search issue from the factorization space.
|
| 256 |
+
|
| 257 |
+
# 95 4 Encoding graph-constrained TN structures via a random-key trick
|
| 258 |
+
|
| 259 |
+
Inspired by the theoretical results, we introduce a practical coding method to embed the irregular TN structures into a regular discrete space, in which the population-based metaheuristics like GAs can be directly used for structure search. Last, experiments on a variety of benchmarks are implemented to demonstrate the effectiveness of the method.
|
| 260 |
+
|
| 261 |
+
# 4.1 Method
|
| 262 |
+
|
| 263 |
+
Figure. 2 depicts the coding process. We encode the elements of $\mathbb { H } _ { G _ { 0 } , R }$ from two ingredients: the rank-induced matrix $\Omega _ { G _ { 0 } } ( \mathbf { r } )$ and the permutation $\mathbf { P }$ as Lemma 5. For the former, since the mapping $\Omega _ { G _ { 0 } }$ is bijective and linear, the rank vector $\mathbf { r }$ of dimension $\lvert E _ { 0 } \rvert$ is directly used as the code for this ingredient.
|
| 264 |
+
|
| 265 |
+
For the latter, we randomly embed $\mathbf { P }$ into the space $[ 0 , 1 ] ^ { | V | }$ , a set of decimal number vectors, by a random-key trick [4], which is popularly used to solve the optimal sequencing tasks. For the details, the random-key representation encode a permutation with a vector of random numbers from $[ 0 , 1 ]$ , and the order of these random numbers reflects the permutation. For instance, the code (0.46, 0.91, 0.33) would represent the permutation $2 3 1$ , by which we naturally have its matrix form P. Finally,the encoded strings are simply the concatenation of the two ingredients.
|
| 266 |
+
|
| 267 |
+
211 One advantage of the random-key trick is robustness to the structure of $\mathbb { H } _ { G _ { 0 } , R }$ . Regardless of the
|
| 268 |
+
212 irregularity of $\mathbb { H } _ { G _ { 0 } , R }$ , we always have the regular key space $[ 0 , 1 ] ^ { | V | }$ , on which the operations such
|
| 269 |
+
213 as addition and perturbation are always available. It implies that the proposed coding method is
|
| 270 |
+
214 $G _ { 0 }$ -independent, and many population-based metheuristics such as the one in [25] can be directly
|
| 271 |
+
215 applied to graph-constrained structure search (see the numerical results given below.) .
|
| 272 |
+
|
| 273 |
+

|
| 274 |
+
Figure 2: Illustration of encoding the graph-constrained TN structures into fixed-length strings. As Lemma 5, the structures are factorized by the rank-induced matrix $\Omega _ { G _ { 0 } } ( \mathbf { r } )$ and permutation matrix $\mathbf { P }$ . In the method, $\Omega _ { G _ { 0 } } ( \mathbf { r } )$ is encoded by its non-zero entries, i.e. the rank-vector r, into the space $[ R ] ^ { | E _ { 0 } | }$ (the orange square). By the random-key trick, $\mathbf { P }$ is represented a vector of random number in the “key space” typically $[ 0 , 1 ] ^ { | V | }$ (the square with a mixed color in the figure). The final string is obtained by the concatenation of the two aspects. Note that, in the key space, different elements in the area with the same color represent the same permutation.
|
| 275 |
+
|
| 276 |
+
The proposed method gives more compact codes than the work in [25]. In the graph-constraint scenario, directly encoding the entries of the adjacency matrix as [25] cannot consider the “lowdimensional enssence” of $\mathbb { H } _ { G _ { 0 } , R }$ due to the irregularity. However, by the proposed method, the code length is shorted as $\mathcal { O } ( | V | )$ compared to $\mathcal { O } ( | V | ^ { 2 } )$ in [25]. A shorter code length implies faster convergence and lower computational requirement for the population-based methods in general. For the proposed method, we also prove the coding efficiency given in the supplementary material, which reflects the gap of the code length from the Shannon entropy on $\mathbb { H } _ { G _ { 0 } , R }$ .
|
| 277 |
+
|
| 278 |
+
# 4.2 Numerical results
|
| 279 |
+
|
| 280 |
+
In this section, we evaluate the practical effectiveness and efficiency of the proposed coding method on various benchmark tasks for tensor network representation (TNR).
|
| 281 |
+
|
| 282 |
+
# 4.2.1 Searching the optimal TN structures on synthetic data in TR format and beyond.
|
| 283 |
+
|
| 284 |
+
In this experiment, we examine whether using the proposed coding method can learn sufficiently good low-dimensional representation on synthetic tensors in TR (including TT) format.
|
| 285 |
+
|
| 286 |
+
Data generation. We generate batches of tensors with randomly selecting TR structures. Specifically, we first let the dimension of each tensor mode equal 3. Then, we randomly generate the TR-ranks at discrete uniform distribution on $\{ 1 , 2 , 3 , 4 \}$ and the cores at Gaussian distribution $N ( 0 , 1 )$ , and randomly permute the tensor modes after contracting the cores.
|
| 287 |
+
|
| 288 |
+
Experiment setup. The proposed coding method are directly applied to the genetic algorithm (GA) in [25] by replacing its chromosome design aspect, where we let $G _ { 0 }$ be a cycle graph and the rank bound $R$ be equal to 7. Details of hyper-parameters on the GA are introduced in the supplementary material. For comparison, we also implement various types of TR decomposition methods with adaptive rank selection, which include the singular value decomposition (SVD) based method TRSVD [47], least-squares-based method TR-ALSAR [47], Bayesian model Bayes-TR [35], and two general heuristics TR-LM [28] (exhaustive search) and TNGA [25] (population-based).
|
| 289 |
+
|
| 290 |
+
The experimental results are reported in Table 1, where the tensor order covers $\{ 4 , 6 , 8 \}$ and the 5 generated tensors for each order are denoted as Trial $\mathbf { A } { \sim } \mathbf { E }$ . For performance evaluation, we use the Eff. index [25], the ratio of number of parameters between the learned structures and the ground-truth TRs, to illustrate the model efficiency. We also illustrate the relative square error (RSE) and the generation (Gen.) of the optimal individuals in TNGA and ours in the table.
|
| 291 |
+
|
| 292 |
+
Results. As shown in Table 1, only our method can always achieve the same or lower-dimensional representation than the ground-truth. We observe that most of the TR decomposition methods fail dealing with the permutation on tensor-modes, and such the fact would limit the application of the TR methods in the practical use on high-order problems. We also observe the performance of
|
| 293 |
+
|
| 294 |
+
Table 1: Experimental results of searching structures on synthetic data in TR format. In the table, Eff. denotes the parameter ratio between the structures by different methods and the ground-truths; $R S E$ in round brackets indicates the relative square error (ignored if smaller than $1 0 ^ { - 4 }$ .) and $G e n$ . in angle brackets indicates the generation of the reported individual in TNGA and our method.
|
| 295 |
+
|
| 296 |
+
<table><tr><td rowspan="2">Trial</td><td colspan="6">Order4-Eff↑(RSE↓) Gen.↓)</td></tr><tr><td>TR-SVD [47]</td><td></td><td>TR-LM[28]TR-ALSAR[47]I</td><td>Bayes-TR [35]</td><td>TNGA [25]</td><td>Ours</td></tr><tr><td></td><td>1.00</td><td>1.00</td><td>0.21</td><td>1.00</td><td>1.00 <004)</td><td>1.00 (003)</td></tr><tr><td>A</td><td>0.64</td><td>1.00</td><td>1.00</td><td>0.64</td><td>1.00 {002</td><td>1.00 <003></td></tr><tr><td>C</td><td>1.17</td><td>1.17</td><td>0.23</td><td>1.00</td><td>1.17 {005></td><td>1.17 <003)</td></tr><tr><td>D</td><td>0.57</td><td>0.57</td><td>0.32</td><td>1.25 (0.10)</td><td>1.00 {003\</td><td>1.00 <002></td></tr><tr><td>E</td><td>0.43</td><td>0.48</td><td>0.40</td><td>0.40</td><td>1.00 <007></td><td>1.00 <003></td></tr><tr><td rowspan="2">Trial</td><td colspan="6">Order6-Eff↑(RSE↓) (Gen.↓)</td></tr><tr><td>TR-SVD [47]</td><td>TR-LM[28]</td><td>TR-ALSAR [47]</td><td>Bayes-TR [35]</td><td>TNGA [25]</td><td>Ours</td></tr><tr><td>A</td><td>0.21</td><td>0.44</td><td>0.14 (2e-3)</td><td>0.25 (2e-3)</td><td>0.82 (011)</td><td>1.00 <010)</td></tr><tr><td>B</td><td>0.14</td><td>0.15</td><td>0.14</td><td>0.44 (0.40)</td><td>0.90 (6e-3) {015)</td><td>1.00 <009)</td></tr><tr><td>C</td><td>0.57</td><td>1.00</td><td>0.85</td><td>0.29</td><td>1.00 (022)</td><td>1.00 <012></td></tr><tr><td>D</td><td>0.21</td><td>0.39</td><td>0.10</td><td>0.13</td><td>1.03 (018)</td><td>1.16 <010)</td></tr><tr><td>E</td><td>0.15</td><td>0.30</td><td>0.01 (0.02)</td><td>0.12</td><td>1.00 (016)</td><td>1.00 <007)</td></tr><tr><td rowspan="2">Trial</td><td colspan="6">Order 8-Eff↑(RSE↓) (Gen.←)</td></tr><tr><td>TR-SVD [47]</td><td>TR-LM [28]</td><td>TR-ALSAR [47]</td><td>Bayes-TR [35]</td><td>TNGA [25]</td><td>Ours</td></tr><tr><td>A</td><td>0.10</td><td>0.16</td><td>0.03 (0.20)</td><td>0.03</td><td>0.48 (017)</td><td>1.00 (019)</td></tr><tr><td>B</td><td>0.09</td><td>0.43</td><td>0.06 (0.02)</td><td>0.06 (7e-4)</td><td>0.29 (2e-3) <020)</td><td>1.02 <015)</td></tr><tr><td>C</td><td>0.03</td><td>0.31</td><td>0.02 (0.01)</td><td>0.02</td><td>0.49 (015)</td><td>1.11 <025></td></tr><tr><td>D</td><td>0.20</td><td>0.53</td><td>0.02 (0.07)</td><td>0.02 (0.02)</td><td>0.32 (027)</td><td>1.06 (013)</td></tr><tr><td>E</td><td>0.33</td><td>0.33</td><td>0.02 (0.02)</td><td>0.02 (3e-3)</td><td>0.23(023></td><td>0.88 <010)</td></tr></table>
|
| 297 |
+
|
| 298 |
+
Table 2: Experimental results of searching structures on synthetic data in various TN format. In the table, Eff. denotes the parameter ratio between the structures by different methods and the groundtruths; $R S E$ in round brackets indicates the relative square error (ignored if smaller than $1 0 ^ { - 4 }$ .) and Gen. in angle brackets indicates the generation of the reported individual of our methods. For rows, “ranks” means we fix the permutation part yet only learning the ranks, while “ranks+matching” means both the optimal ranks and permutation are learned.
|
| 299 |
+
|
| 300 |
+
<table><tr><td rowspan="2">TNs</td><td rowspan="2">Our method</td><td colspan="4">Trial-Eff↑(RSE↓) (Gen.↓)</td></tr><tr><td>A</td><td>B</td><td>C</td><td>D</td></tr><tr><td rowspan="3">T-Tree [42]</td><td>ranks</td><td>0.40 (005)</td><td>0.41 (0.02) 008)</td><td>0.40 (9e-3) (006)</td><td>0.65 (0.04) (005)</td></tr><tr><td>ranks+matching</td><td>1.29 (016)</td><td>1.17 (014)</td><td>1.11 (012)</td><td>1.55 (012)</td></tr><tr><td>ranks</td><td>0.41 (010)</td><td>0.43 (0.02) {024)</td><td>0.39 (6e-3) (027)</td><td>0.71 (005></td></tr><tr><td rowspan="2">PEPS [38]</td><td>ranks+matching</td><td>1.14 (013)</td><td>1.00 (016)</td><td>1.00 (007)</td><td>1.21 {009</td></tr><tr><td>ranks</td><td>0.49 (0.01) (014)</td><td>0.64 {010)</td><td>1.09 (012)</td><td>0.81 (006)</td></tr><tr><td rowspan="2">H-Tucker[16]</td><td>ranks+matching</td><td>1.42 (008)</td><td>1.21 1{023></td><td>1.18 (007)</td><td>1.29 (011)</td></tr><tr><td>ranks</td><td>0.72 (0.01) (012)</td><td>0.95 (011)</td><td>1.93 (011)</td><td>0.65 (0.04) (014)</td></tr><tr><td rowspan="2">MERA [11, 33]</td><td>ranks+matching</td><td>0.95 (024)</td><td>{008></td><td>2.30 (024)</td><td></td></tr><tr><td></td><td></td><td>1.32</td><td></td><td>1.00 (027)</td></tr></table>
|
| 301 |
+
|
| 302 |
+
249 TNGA appears dramatically deterioration when increasing the tensor order. As analyzed at the end of
|
| 303 |
+
250 Section 4.1, TNGA suffers from the dimension explosion of the search space. In this case, TNGA
|
| 304 |
+
251 has to search the solution from about $4 . 6 \times 1 0 ^ { 2 3 }$ candidates, which is almost $8 . 0 \times 1 0 ^ { 1 6 }$ larger than
|
| 305 |
+
252 the one of ours.
|
| 306 |
+
253 TN structure search not limit to TR. The proposed coding method is also useful for many well
|
| 307 |
+
254 known TNs in machine learning and physic not limit to TR. Under a similar setup for TR, we apply
|
| 308 |
+
255 the proposed method to the TNs including T-tree (order-7) [42], PEPS (order-6) [38], hieratical
|
| 309 |
+
256 Tucker (H-Tucker, order-6) [16] and multi-scale entanglement renormalization ansatz (MERA,
|
| 310 |
+
|
| 311 |
+
order-8) [11, 33]. Details of the data generation phase are given in the supplementary material. Table 2 illustrates the Eff., RSE and Gen. values by our method, where the rows of “ranks” mean we only learn the optimal TN-ranks while the rows of “ranks+matching” mean both the ranks and permutation are learned by our method. As shown in Table 2, our method achieves the TN structures as good as or even better than the ground-truth for various TNs. In addition, we also observe that a correct permutation on modes would significantly improve the representational power of TNs.
|
| 312 |
+
|
| 313 |
+
# 4.2.2 Benchmarks on real-world data
|
| 314 |
+
|
| 315 |
+
We consider three benchmark TNR problem on real-world data, where two of them is to represent the data and the other one is to represent learning models. Details of the experiment setup and more results are given in the supplementary material.
|
| 316 |
+
|
| 317 |
+
1. Image compression. We use GA equipped with the proposed coding method (in TR format) to compress 14 natural images randomly chosen from BSD500 [1], where images are grayscaled, resized by $2 5 6 \times 2 5 6$ , and tensorized into order-8 tensors by two different tensorization: a “Python-like” reshaping operation denoted by “Trivial” and visual data tensorization (VDT) [6, 24, 45], a image-resolution-based tensorization method. As the result, we show the compression ratio (CR, in log form) and RSE (in round brackets) by the methods TR-SVD, TR-LM and ours in Table 3, and visualize the summary statistics of the learned permutation by our method in Figure 3.
|
| 318 |
+
|
| 319 |
+
2. Image completion. The same method is also implemented on image completion, a task to predict missing pixels from the observation. In the experiment, 8 images from USCSIPI [40] are chosen and tensorized by VDT of order-9. After that, the entries are randomly removed at uniform distribution under the missing rate $\{ 5 0 \% , 7 0 \% , 9 0 \% \}$ , respectively. We show the average of RSE of predicting the missing values in Table 4 compared with the TT/TR completion methods TT-SGD [45], TRLRF [44], TRALS [39].
|
| 320 |
+
|
| 321 |
+
3. Reparameterization of tensorial Gaussian process (GP). TNR is applied to parameterizing the variational mean of GPs. In the experiment, we reparameterize the TT variational mean given in [20] by our method to search better structures. In a regression task on datasets CCPP [37], MG [14] and Protein [12], we have the TT variational mean of the order- $\{ 4 , 6 , 9 \}$ , respectively. In the result, we evaluate the performance by the number of parameters and mean square error (MSE, in the round brackets) shown in Table 5.
|
| 322 |
+
|
| 323 |
+
<table><tr><td colspan="2">TR-SVD [47]</td><td>TR-LM [28]</td><td>Ours</td></tr><tr><td>Trivial</td><td>0.95(0.14)</td><td>0.94(0.14)</td><td>1.35(0.14)</td></tr><tr><td>VDT</td><td>1.11(0.15)</td><td>1.07(0.14)</td><td>1.30(0.14)</td></tr></table>
|
| 324 |
+
|
| 325 |
+
Table 3: Average of log compression ratio and Table 4: Average of RSE on image compleRSE (in round brackets) for image decomposition. tion under various missing percentage.
|
| 326 |
+
|
| 327 |
+
<table><tr><td colspan="4">TTSGD [45] TRLRF [44] TRALS [39] Ours</td></tr><tr><td>50%</td><td>0.16</td><td>0.12</td><td>0.13 0.11</td></tr><tr><td>70%</td><td>0.17</td><td>0.13</td><td>0.13 0.12</td></tr><tr><td>90%</td><td>0.18</td><td>0.20</td><td>0.18 0.16</td></tr></table>
|
| 328 |
+
|
| 329 |
+

|
| 330 |
+
Figure 3: Visualization of statistics on the similarity to the original permutation.
|
| 331 |
+
|
| 332 |
+
Table 5: Number of parameters and MSE (in round brackets) of GP regression under three datasets.
|
| 333 |
+
|
| 334 |
+
<table><tr><td></td><td>CCPP</td><td>MG</td><td>Protein</td></tr><tr><td>TTGP [20] Ours</td><td>2640 (0.06) 2244 (0.06)</td><td>3360 (0.33) 3008 (0.33)</td><td>2880 (0.74) 2032 (0.74)</td></tr></table>
|
| 335 |
+
|
| 336 |
+
VDT is verified as a more effective way for tensorization. The results in Table 3 show that, our method owns higher compression ratio under close RSE compared to other methods. More importantly, the results show a significant difference when learning structures from two tensorization. Figure 3 illustrates the statistics on the similarity between the original permutation and the learned ones by our method. We observe from Figure 3(a) that in VDT the learned permutation is significantly closer to the original one than that in the “Trivial”. Additionally, Figure 3(b) shows the cumulative distribution function (CDF), where we can see that, in VDT the probability is larger than 0.8 for
|
| 337 |
+
|
| 338 |
+
296 the similarity being smaller than or equal to 2 . It implies that with a large probability the learned
|
| 339 |
+
297 structures in VDT own at most a pair of permutation difference compared to the original one. On the
|
| 340 |
+
298 contrary, for “Trivial” the probability is almost zero in the same interval. Hence, it is verified from
|
| 341 |
+
299 the empirical results by our method that VDT is more effective way for image tensorization than the
|
| 342 |
+
300 trivially reshaping operations.
|
| 343 |
+
301 Exploring TN structures obtains lower-dimensional representation from incomplete data. As
|
| 344 |
+
302 shown in Table 4, our method achieve a comparable performance on the image completion task.
|
| 345 |
+
303 Especially when the missing ratio is high, our method is forced to explore better TN structures not
|
| 346 |
+
304 limit to the ranks, such that the lower-dimensional representation would be applied and results in
|
| 347 |
+
305 more accurate prediction. Similar claims were also discussed in recent works [7, 17].
|
| 348 |
+
306 Tensor-reparameterization: a potential way to compress learning models. TNs are known as
|
| 349 |
+
307 an efficient framework to compress learnables variables by low-dimensional cores. In the experi
|
| 350 |
+
308 ment, we illustrate from a “proof-of-concept” level that the model would be further compressed by
|
| 351 |
+
309 $r e$ -parameterizing the learned TN in model. As shown in Table 5, we always use fewer parameters
|
| 352 |
+
310 than its “teacher” model TTGP [20] to achieve the same MSE on the three datasets. It implies that
|
| 353 |
+
311 our method give more efficient TNR by search better structures. Unlike training the model with
|
| 354 |
+
312 simultaneously searching TN structures, we empirically find that searching better structures from the
|
| 355 |
+
313 well-trained model in TN format would achieve better compression ratio. We intuitively conjecture
|
| 356 |
+
314 that, by structure search, it is likely to obtain more efficient representation for a tensor, which has
|
| 357 |
+
315 been in low-rank TN format. In the training phase, on the other hand, the models are not significantly
|
| 358 |
+
316 low-rank in general. Therefore, the tensor reparameterization often gives better performance in
|
| 359 |
+
317 practice. A rigorous analysis on this issue is still an open problem.
|
| 360 |
+
|
| 361 |
+
# 318 5 Discussion
|
| 362 |
+
|
| 363 |
+
Our experiments show good TN structures including ranks and permutations can be effectively learned in practice by the proposed coding method under extensive family of graph constraints, and our theoretical results show the the superior performance is thanks to the low-dimensional essence hidden behind the irregularity of the graph-constrained TN structures. More surprisingly, Proposition 9 shows that such the low-dimensional essence of TN structures is ubiquitous for most of practical TNs. As a consequence, we expect this work can promote the understanding on the structure search issue on tensor networks from both the theoretical and practical aspects, and the empirical claims in experiments are also expected to inspire more potential applications of TNs in machine learning.
|
| 364 |
+
|
| 365 |
+
Limitation. Theoretically, we only study the TNs, which do not contain the internal cores. Some well-known models like (H-)Tucker and MERA are not contained in the theory, although the proposed coding method works well for those models in experiments. Empirically, the proposed coding method is more suitable for the population-based methods like GAs, which are still computationally expensive compared to other heuristics. Also, the experiments on real-world benchmarks are only illustrative and proof-of-concept. More numerical results are necessary if stronger statements such as the performance improvement are expected.
|
| 366 |
+
|
| 367 |
+
# 334 6 Related works
|
| 368 |
+
|
| 369 |
+
335 Learning the optimal TN structures is a generalization of the rank selection issue for TN models [8, 9,
|
| 370 |
+
336 18, 26–28, 34, 43, 46, 47], and it is known as a tough task especially for the models that contain cycles
|
| 371 |
+
337 in the topology [3, 23, 42]. More recently, there are several studies on learning TN structures [17, 19,
|
| 372 |
+
338 21, 25] in a more general form. Another line of works that are close to ours are studies focusing on
|
| 373 |
+
339 the partition issue for H-Tucker decomposition [2, 13, 15], where the modes would be clustered to
|
| 374 |
+
340 determine the optimal tree structure. Unlike them, this work is the first to solve the optimal matching
|
| 375 |
+
341 problem as illustrated in Figure. 1. Moreover, we are the only few to theoretically study the structure
|
| 376 |
+
342 search issue for tensor networks. From the algorithmic aspect, the random-key trick in our coding
|
| 377 |
+
343 method is first proposed by [4], and popularly applied to solving difficult sequencing tasks such as
|
| 378 |
+
344 the “travelling salesman problem” and the “clique problem” [31] in computational graph theory. Our
|
| 379 |
+
345 method is also close to the subgraph search issue in the recent work [41], yet we focus on the different
|
| 380 |
+
346 tasks and issues.
|
| 381 |
+
|
| 382 |
+
References
|
| 383 |
+
[1] Pablo Arbelaez, Michael Maire, Charless Fowlkes, and Jitendra Malik. Contour detection and hierarchical image segmentation. IEEE transactions on pattern analysis and machine intelligence, 33(5):898–916, 2010.
|
| 384 |
+
[2] Jonas Ballani and Lars Grasedyck. Tree adaptive approximation in the hierarchical tensor format. SIAM journal on scientific computing, 36(4):A1415–A1431, 2014.
|
| 385 |
+
[3] Kim Batselier. The trouble with tensor ring decompositions. arXiv preprint arXiv:1811.03813, 2018.
|
| 386 |
+
[4] James C Bean. Genetic algorithms and random keys for sequencing and optimization. ORSA journal on computing, 6(2):154–160, 1994.
|
| 387 |
+
[5] Lowell W Beineke, Robin J Wilson, Peter J Cameron, et al. Topics in algebraic graph theory, volume 102. Cambridge University Press, 2004.
|
| 388 |
+
[6] Johann A Bengua, Ho N Phien, Hoang Duong Tuan, and Minh N Do. Efficient tensor completion for color image and video recovery: Low-rank tensor train. IEEE Transactions on Image Processing, 26(5):2466–2479, 2017.
|
| 389 |
+
[7] Yunfeng Cai and Ping Li. Tensor completion via tensor networks with a tucker wrapper. arXiv preprint arXiv:2010.15819, 2020.
|
| 390 |
+
[8] Yunfeng Cai and Ping Li. A blind block term decomposition of high order tensors. 2021.
|
| 391 |
+
[9] Zhiyu Cheng, Baopu Li, Yanwen Fan, and Yingze Bao. A novel rank selection scheme in tensor ring decomposition based on reinforcement learning for deep neural networks. In ICASSP 2020- 2020 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pages 3292–3296. IEEE, 2020.
|
| 392 |
+
[10] Andrzej Cichocki, Anh-Huy Phan, Qibin Zhao, Namgil Lee, Ivan Oseledets, Masashi Sugiyama, Danilo P Mandic, et al. Tensor networks for dimensionality reduction and large-scale optimization: Part 2 applications and future perspectives. Foundations and Trends® in Machine Learning, 9(6):431–673, 2017.
|
| 393 |
+
[11] Lukasz Cincio, Jacek Dziarmaga, and Marek M Rams. Multiscale entanglement renormalization ansatz in two dimensions: quantum ising model. Physical Review Letters, 100(24):240603, 2008.
|
| 394 |
+
[12] Dheeru Dua and Casey Graff. UCI machine learning repository, 2017.
|
| 395 |
+
[13] Antonio Falcó, Wolfgang Hackbusch Nouy, et al. Geometry of tree-based tensor formats in tensor banach spaces. arXiv preprint arXiv:2011.08466, 2020.
|
| 396 |
+
[14] Gary William Flake and Steve Lawrence. Efficient svm regression training with smo. Machine Learning, 46(1):271–290, 2002.
|
| 397 |
+
[15] Cécile Haberstich, Anthony Nouy, and Guillaume Perrin. Active learning of tree tensor networks using optimal least-squares. arXiv preprint arXiv:2104.13436, 2021.
|
| 398 |
+
[16] Wolfgang Hackbusch and Stefan Kühn. A new scheme for the tensor representation. Journal of Fourier analysis and applications, 15(5):706–722, 2009.
|
| 399 |
+
[17] Meraj Hashemizadeh, Michelle Liu, Jacob Miller, and Guillaume Rabusseau. Adaptive tensor learning with tensor networks. arXiv preprint arXiv:2008.05437, 2020.
|
| 400 |
+
[18] Cole Hawkins and Zheng Zhang. Bayesian tensorized neural networks with automatic rank selection. arXiv preprint arXiv:1905.10478, 2019.
|
| 401 |
+
[19] Kohei Hayashi, Taiki Yamaguchi, Yohei Sugawara, and Shin-ichi Maeda. Exploring unexplored tensor network decompositions for convolutional neural networks. In Advances in Neural Information Processing Systems, pages 5553–5563, 2019.
|
| 402 |
+
392 [20] Pavel Izmailov, Alexander Novikov, and Dmitry Kropotov. Scalable gaussian processes with billions of inducing inputs via tensor train decomposition. In International Conference on Artificial Intelligence and Statistics, pages 726–735. PMLR, 2018.
|
| 403 |
+
395 [21] Maxim Kodryan, Dmitry Kropotov, and Dmitry Vetrov. Mars: Masked automatic ranks selection in tensor decompositions. arXiv preprint arXiv:2006.10859, 2020. [22] I Krasikov, A Lev, and BD Thatte. Upper bounds on the automorphism group of a graph. Discrete Math., 256(math. CO/0609425):489–493, 2006. [23] Joseph M Landsberg, Yang Qi, and Ke Ye. On the geometry of tensor network states. arXiv preprint arXiv:1105.4449, 2011.
|
| 404 |
+
401 [24] Jose I Latorre. Image compression and entanglement. arXiv preprint quant-ph/0510031, 2005. [25] Chao Li and Zhun Sun. Evolutionary topology search for tensor network decomposition. In Proceedings of the 37th International Conference on Machine Learning (ICML), 2020. [26] Nannan Li, Yu Pan, Yaran Chen, Zixiang Ding, Dongbin Zhao, and Zenglin Xu. Heuristic rank selection with progressively searching tensor ring network. Complex & Intelligent Systems, pages 1–15, 2021.
|
| 405 |
+
407 [27] Zhen Long, Ce Zhu, Jiani Liu, and Yipeng Liu. Bayesian low rank tensor ring model for image completion. arXiv preprint arXiv:2007.01055, 2020.
|
| 406 |
+
409 [28] Oscar Mickelin and Sertac Karaman. On algorithms for and computing with the tensor ring decomposition. Numerical Linear Algebra with Applications, 27(3):e2289, 2020.
|
| 407 |
+
411 [29] Román Orús. A practical introduction to tensor networks: Matrix product states and projected entangled pair states. Annals of Physics, 349:117–158, 2014.
|
| 408 |
+
413 [30] Ivan V Oseledets. Tensor-train decomposition. SIAM Journal on Scientific Computing, 33(5):2295–2317, 2011.
|
| 409 |
+
415 [31] Panos M Pardalos and Jue Xue. The maximum clique problem. Journal of global Optimization, 4(3):301–328, 1994.
|
| 410 |
+
417 [32] Karl Pearson. Historical note on the origin of the normal curve of errors. Biometrika, pages 402–404, 1924.
|
| 411 |
+
419 [33] Justin Reyes and Miles Stoudenmire. A multi-scale tensor network architecture for classification and regression. arXiv preprint arXiv:2001.08286, 2020. [34] Farnaz Sedighin, Andrzej Cichocki, and Anh-Huy Phan. Adaptive rank selection for tensor ring decomposition. IEEE Journal of Selected Topics in Signal Processing, 15(3):454–463, 2021.
|
| 412 |
+
423 [35] Zerui Tao and Qibin Zhao. Bayesian tensor ring decomposition for low rank tensor completion. In International Workshop on Tensor Network Representations in Machine Learning, IJCAI, 2020.
|
| 413 |
+
426 [36] Ledyard R Tucker. Some mathematical notes on three-mode factor analysis. Psychometrika, 31(3):279–311, 1966.
|
| 414 |
+
428 [37] Pınar Tüfekci. Prediction of full load electrical power output of a base load operated combined cycle power plant using machine learning methods. International Journal of Electrical Power & Energy Systems, 60:126–140, 2014.
|
| 415 |
+
431 [38] Frank Verstraete and J Ignacio Cirac. Renormalization algorithms for quantum-many body systems in two and higher dimensions. arXiv preprint cond-mat/0407066, 2004.
|
| 416 |
+
433 [39] Wenqi Wang, Vaneet Aggarwal, and Shuchin Aeron. Efficient low rank tensor ring completion. In Proceedings of the IEEE International Conference on Computer Vision, pages 5697–5705, 2017.
|
| 417 |
+
436 [40] Allan G Weber. The usc-sipi image database version 5. USC-SIPI Report, 315(1), 1997.
|
| 418 |
+
[41] Hansi Yang, Quanming Yao, and James Kwok. Tensorizing subgraph search in the supernet. arXiv preprint arXiv:2101.01078, 2021.
|
| 419 |
+
[42] Ke Ye and Lek-Heng Lim. Tensor network ranks. arXiv preprint arXiv:1801.02662, 2019.
|
| 420 |
+
[43] Tatsuya Yokota, Qibin Zhao, and Andrzej Cichocki. Smooth parafac decomposition for tensor completion. IEEE Transactions on Signal Processing, 64(20):5423–5436, 2016.
|
| 421 |
+
[44] Longhao Yuan, Chao Li, Danilo Mandic, Jianting Cao, and Qibin Zhao. Tensor ring decomposition with rank minimization on latent space: An efficient approach for tensor completion. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 33, pages 9151–9158, 2019.
|
| 422 |
+
[45] Longhao Yuan, Qibin Zhao, Lihua Gui, and Jianting Cao. High-order tensor completion via gradient-based optimization under tensor train format. Signal Processing: Image Communication, 73:53–61, 2019.
|
| 423 |
+
[46] Qibin Zhao, Liqing Zhang, and Andrzej Cichocki. Bayesian cp factorization of incomplete tensors with automatic rank determination. IEEE transactions on pattern analysis and machine intelligence, 37(9):1751–1763, 2015.
|
| 424 |
+
[47] Qibin Zhao, Guoxu Zhou, Shengli Xie, Liqing Zhang, and Andrzej Cichocki. Tensor ring decomposition. arXiv preprint arXiv:1606.05535, 2016.
|
| 425 |
+
[48] Yu-Bang Zheng, Ting-Zhu Huang, Xi-Le Zhao, Qibin Zhao, and Tai-Xiang Jiang. Fullyconnected tensor network decomposition and its application to higher-order tensor completion. 2021.
|
| 426 |
+
|
| 427 |
+
1. For all authors...
|
| 428 |
+
|
| 429 |
+
(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes]
|
| 430 |
+
(b) Did you describe the limitations of your work? [Yes] See Section 5
|
| 431 |
+
(c) Did you discuss any potential negative societal impacts of your work? [N/A]
|
| 432 |
+
(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
|
| 433 |
+
|
| 434 |
+
2. If you are including theoretical results...
|
| 435 |
+
|
| 436 |
+
(a) Did you state the full set of assumptions of all theoretical results? [Yes] (b) Did you include complete proofs of all theoretical results? [Yes] All proofs are given in the supplementary material.
|
| 437 |
+
|
| 438 |
+
3. If you ran experiments...
|
| 439 |
+
|
| 440 |
+
(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] Codes with illustrative experiments is uploaded
|
| 441 |
+
(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] See the supplementary material.
|
| 442 |
+
(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [No] Yet we show the results for each sample such as images or synthetic data in the supplementary material. The error bars can be estimated from those results.
|
| 443 |
+
(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 the supplementary material.
|
| 444 |
+
|
| 445 |
+
4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
|
| 446 |
+
|
| 447 |
+
(a) If your work uses existing assets, did you cite the creators? [N/A]
|
| 448 |
+
(b) Did you mention the license of the assets? [N/A]
|
| 449 |
+
(c) Did you include any new assets either in the supplemental material or as a URL? [N/A]
|
| 450 |
+
(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [N/A]
|
| 451 |
+
(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A]
|
| 452 |
+
|
| 453 |
+
5. If you used crowdsourcing or conducted research with human subjects...
|
| 454 |
+
|
| 455 |
+
(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
|
| 456 |
+
(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A]
|
| 457 |
+
(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]
|
md/train/rJiaRbk0-/rJiaRbk0-.md
ADDED
|
@@ -0,0 +1,321 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# TOWARDS BINARY-VALUED GATES FOR ROBUST LSTM TRAINING
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Long Short-Term Memory (LSTM) is one of the most widely used recurrent structures in sequence modeling. Its goal is to use gates to control the information flow (e.g., whether to skip some information/transformation or not) in the recurrent computations, although its practical implementation based on soft gates only partially achieves this goal and is easy to overfit. In this paper, we propose a new way for LSTM training, which pushes the values of the gates towards 0 or 1. By doing so, we can (1) better control the information flow: the gates are mostly open or closed, instead of in a middle state; and (2) avoid overfitting to certain extent: the gates operate at their flat regions, which is shown to correspond to better generalization ability. However, learning towards discrete values of the gates is generally difficult. To tackle this challenge, we leverage the recently developed GumbelSoftmax trick from the field of variational methods, and make the model trainable with standard backpropagation. Experimental results on language modeling and machine translation show that (1) the values of the gates generated by our method are more reasonable and intuitively interpretable, and (2) our proposed method generalizes better and achieves better accuracy on test sets in all tasks. Moreover, the learnt models are not sensitive to low-precision approximation and low-rank approximation of the gate parameters due to the flat loss surface.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Recurrent neural networks (RNN) (Hochreiter, 1998) are widely used in sequence modeling tasks, such as language modeling (Kim et al., 2016; Jozefowicz et al., 2016), speech recognition (Zhang et al., 2016), time series prediction (Xingjian et al., 2015), machine translation (Wu et al., 2016; Britz et al., 2017), image captioning (Vinyals et al., 2015; Xu et al., 2015), and image generation (Villegas et al., 2017).
|
| 12 |
+
|
| 13 |
+
To address the long-term dependency and gradient vanishing problem of conventional RNN, long short-term memory (LSTM) (Gers et al., 1999; Hochreiter & Schmidhuber, 1997b) was proposed, which introduces gate functions to control the information in a recurrent unit: a forget gate function to determine how much previous information should be excluded for the current step, an input gate function to find relevant signals to be absorbed into the hidden context, and an output gate function for prediction and decision making. For ease of optimization, in practical implementation, one usually uses element-wise sigmoid function to mimic the gates, whose outputs are soft values between 0 and 1. By using such gates, LSTM usually performs much better than conventional RNN. However, the benefits come with the cost of introducing many more parameters in the gates, which makes the training of a LSTM model inefficient and easy to overfit (Krueger et al., 2016; Zaremba et al., 2014; Semeniuta et al., 2016).
|
| 14 |
+
|
| 15 |
+
In this paper, we explore a new way to train LSTM by pushing the values of the gates to the boundary of their ranges $( 0 , \bar { 1 } )$ 1. Pushing the values of the gates to 0/1 has certain advantages. First, it well aligns with the original purpose of the development of gates: to get the information in or skip by “opening” or “closing” the gates during the recurrent computation. Second, training LSTM towards binary-valued gates can make the learnt model generalize better. According to (Hochreiter & Schmidhuber, 1997a; Haussler et al., 1997; Keskar et al., 2016; Chaudhari et al., 2016), a model lying in a flat region of the loss surface is likely to generalize well, since any small perturbation to the model makes little fluctuation to the loss. Training LSTM towards binary-valued gates means seeking a set of parameters to make the values of the gates approaching zero or one, namely residing in the flat region of the sigmoid function. Simple deductions show that this also corresponds to the flat region of the overall loss surface.
|
| 16 |
+
|
| 17 |
+
Technically, pushing the outputs of the gates towards such discrete values is challenging. A straightforward approach is to sharpen the sigmoid function by a smaller temperature. However, this is equivalent to rescaling the input and cannot guarantee the values of the learnt gates to be close to 0 or 1. To tackle this challenge, in this paper, we leverage the Gumbel-Softmax trick that Jang et al. (2016) and Maddison et al. (2016) recently develop for variantional methods. The trick aims to generate approximated samples for categorical latent variables in a stochastic computational graph, e.g., variational autoencoder, brings convenience to using reparametrization tricks, and thus leads to efficient learning. Specifically, during training, we apply the Gumbel-Softmax trick to the gates to approximate the values sampled from the Bernoulli distribution given by the parameters, and train the LSTM model with standard backpropagation methods. We call this method Gumbel-Gate LSTM $G ^ { 2 }$ -LSTM). We conduct three experiments on two tasks (language modeling and machine translation) to verify our proposed method. We have the following observations from experimental results:
|
| 18 |
+
|
| 19 |
+
• Our model generalizes well: In all tasks, we achieve superior performance to baseline algorithms on the test sets, and the gap between training and test is effectively reduced. Our model is not sensitive due to its flat loss surface: We apply several model compression algorithms to the parameters in the gates, including low-precision approximation and lowrank approximation, and all results show that our learnt models are better. • The gates in our learnt model are meaningful and intuitively interpretable after visualization. Furthermore, our model can automatically learn the boundaries inside the sentences.
|
| 20 |
+
|
| 21 |
+
The organization of the paper is as follows. We introduce related work in Section 2 and propose our learning algorithm in Section 3. Experiments are reported in Section 4 and future work is discussed in the last section.
|
| 22 |
+
|
| 23 |
+
# 2 RELATED WORK
|
| 24 |
+
|
| 25 |
+
# 2.1 LOSS SURFACE AND GENERALIZATION
|
| 26 |
+
|
| 27 |
+
The concept of sharp and flat minima has been first discussed in (Hochreiter & Schmidhuber, 1997a; Haussler et al., 1997) . Intuitively, a flat minimum $x$ of a loss $f ( \cdot )$ corresponds to the point for which the function $f$ varies slowly in a relatively large neighborhood of $x$ . In contrast, a sharp minimum $x$ is such that the function $f$ increases rapidly in a small neighborhood of $x$ . The sensitivity of the loss function at sharp minima negatively impacts the generalization ability of a trained model on new data. Recently, several papers discuss how to modify the training process and to learn a model in a flat region so as to obtain better generalization ability. Keskar et al. (2016) show by using smallbatch training, the learnt model is more likely to converge to a flat region rather than a sharp one. Chaudhari et al. (2016) propose a new objective function considering the local entropy and push the model to be optimized towards a wide valley.
|
| 28 |
+
|
| 29 |
+
# 2.2 DROPOUT IN RECURRENT NEURAL NETWORK
|
| 30 |
+
|
| 31 |
+
Dropout is one of the most standard tricks used in deep learning to improve generalization ability. For recurrent neural networks, Zaremba et al. (2014) and Semeniuta et al. (2016) apply dropout to feed-forward connections and recurrent units of RNNs. In Zoneout (Krueger et al., 2016), the values of the hidden states and memory cells are randomly either maintained by their previous value or updated as usual, which introduces stochastic identity connections between subsequent time steps.
|
| 32 |
+
|
| 33 |
+
Different from dropout, which is to regularize the training of a deep neural network by randomly dropping nodes/edges to prevent co-adaptations, our method is to bias the optimization process and ensure to find a model in a flat region to avoid overfitting. Therefore, our method is complementary to dropout in RNNs, and actually in our experiments our method is well combined with dropout.
|
| 34 |
+
|
| 35 |
+
# 2.3 GUMBEL-SOFTMAX TRICK
|
| 36 |
+
|
| 37 |
+
Jang et al. (2016) and Maddison et al. (2016) develop a continuous relaxation of discrete random variables in stochastic computational graphs. The main idea of the method is that the multinomial distribution can be represented according to Gumbel-Max trick, thus can be approximated by Gumbel-Softmax distribution. In detail, given a probability distribution over $k$ categories with parameter $\pi _ { 1 } , \pi _ { 2 } , \ldots , \pi _ { k }$ , the Gumbel-Softmax trick approximately samples the categorical variable according to:
|
| 38 |
+
|
| 39 |
+
$$
|
| 40 |
+
y _ { i } = { \frac { \exp ( ( \log \pi _ { i } + q _ { i } ) / \tau ) } { \sum _ { j = 1 } ^ { k } \exp ( ( \log \pi _ { j } + q _ { j } ) / \tau ) } } \qquad { \mathrm { f o r ~ } } i = 1 , \dots , k ,
|
| 41 |
+
$$
|
| 42 |
+
|
| 43 |
+
where $\tau$ is the temperature and $q _ { i }$ is independently sampled from Gumbel distribution: $q _ { i } =$ $- \log ( - \log U _ { i } ) , U _ { i } \sim \mathrm { U n i f o r m } ( 0 , 1 )$ .
|
| 44 |
+
|
| 45 |
+
By using the Gumbel-Softmax trick, we can generate sample $y = ( y _ { 1 } , . . . , y _ { k } )$ to approximate the categorical distribution. Furthermore, as the randomness $q$ is independent of $\pi$ (which is usually defined by a set of parameters), we can use reparameterization trick to optimize the model parameters using standard backpropagation algorithms. Gumbel-Softmax trick has been adopted in several applications such as variation autoencoder (Jang et al., 2016), generative adversarial net (Kusner & Hernandez-Lobato, 2016), and language generation (Subramanian et al., 2017). To the best of our ´ knowledge, this is the first work to introduce the Gumbel-Softmax trick in LSTM for robust training purpose.
|
| 46 |
+
|
| 47 |
+
# 3 THE PROPOSED TRAINING ALGORITHM
|
| 48 |
+
|
| 49 |
+
In this section, we present a new and robust training algorithm for LSTM by learning towards binaryvalued gates.
|
| 50 |
+
|
| 51 |
+
# 3.1 BACKGROUND
|
| 52 |
+
|
| 53 |
+
Recurrent neural networks process an input sequence $\{ x _ { 1 } , x _ { 2 } , \dots , x _ { T } \}$ sequentially and construct a corresponding sequence of hidden states/representations $\{ h _ { 1 } , h _ { 2 } , \ldots , h _ { T } \}$ . In single-layer recurrent neural networks, the hidden states $\{ h _ { 1 } , h _ { 2 } , \ldots , h _ { T } \}$ are used for prediction or decision making. In deep (stacked) recurrent neural networks, the hidden states in layer $k$ are used as inputs to layer $k + 1$ .
|
| 54 |
+
|
| 55 |
+
In recurrent neural networks, each hidden state is trained (implicitly) to remember and emphasize task-relevant aspects of the preceding inputs, and to incorporate new inputs via a recurrent operator, $T$ , which converts the previous hidden state and presents input into a new hidden state, e.g.,
|
| 56 |
+
|
| 57 |
+
$$
|
| 58 |
+
h _ { t } = T ( h _ { t - 1 } , x _ { t } ) = \operatorname { t a n h } ( W _ { h } h _ { t - 1 } + W _ { x } x _ { t } + b ) ,
|
| 59 |
+
$$
|
| 60 |
+
|
| 61 |
+
where $W _ { h }$ , $W _ { x }$ and $b$ are parameters.
|
| 62 |
+
|
| 63 |
+
Long short-term memory RNN (LSTM) (Hochreiter & Schmidhuber, 1997b) is a carefully designed recurrent structure. In addition to the hidden state $h _ { t }$ used as a transient representation of state at timestep $t$ , LSTM introduces a memory cell $c _ { t }$ , intended for internal long-term storage. $c _ { t }$ and $h _ { t }$ are computed via three gate functions. The forget gate function $f _ { t }$ directly connects $c _ { t }$ to the memory cell $c _ { t - 1 }$ of the previous timestep via an element-wise multiplication. Large values of the forget gates cause the cell to remember most (if not all) of its previous values. The other gates control the flow of information in input $( i _ { t } )$ and output $\left( o _ { t } \right)$ of the cell. Each gate function has a weight matrix and a bias vector; we use subscripts $f$ , $i$ and $o$ to denote parameters for the forget gate function, the input gate function and the output gate function respectively, e.g., the parameters for the forget gate function are denoted by $W _ { x f } , W _ { h f }$ , and $b _ { f }$ .
|
| 64 |
+
|
| 65 |
+

|
| 66 |
+
Figure 1: The orange parts correspond to the saturation area of the sigmoid function.
|
| 67 |
+
|
| 68 |
+
With the above notations, an LSTM is formally defined as follows:
|
| 69 |
+
|
| 70 |
+
$$
|
| 71 |
+
\begin{array} { r c l } { \displaystyle i _ { t } } & { = } & { \sigma \big ( W _ { x i } x _ { t } + W _ { h i } h _ { t - 1 } + b _ { i } \big ) } \\ { \displaystyle f _ { t } } & { = } & { \sigma \big ( W _ { x f } x _ { t } + W _ { h f } h _ { t - 1 } + b _ { f } \big ) } \\ { \displaystyle o _ { t } } & { = } & { \sigma \big ( W _ { x o } x _ { t } + W _ { h o } h _ { t - 1 } + b _ { o } \big ) } \\ { \displaystyle g _ { t } } & { = } & { \operatorname { t a n h } \big ( W _ { x g } x _ { t } + W _ { h g } h _ { t - 1 } + b _ { g } \big ) } \\ { \displaystyle c _ { t } } & { = } & { f _ { t } \odot c _ { t - 1 } + i _ { t } \odot g _ { t } } \\ { \displaystyle h _ { t } } & { = } & { o _ { t } \odot \operatorname { t a n h } \big ( c _ { t } \big ) , } \end{array}
|
| 72 |
+
$$
|
| 73 |
+
|
| 74 |
+
where $\sigma ( \cdot )$ represents the sigmoid function and $\odot$ is the element-wise product.
|
| 75 |
+
|
| 76 |
+
# 3.2 TRAINING LSTM GATES TOWARDS BINARY VALUES
|
| 77 |
+
|
| 78 |
+
The LSTM unit requires much more parameters than the simple RNN unit, and makes it hard to generalize. As we can see from Eqn (2) - (7), a large percentage of the parameters are used to compute the gate (sigmoid) functions. If we can push the outputs of the gates to the saturation area of the sigmoid function (i.e., towards 0 or 1), the loss function with respect to the parameters in the gates will be flat: if the parameters in the gates perturb, the change to the output of the gates is small due to the sigmoid operator (see Figure 1), and then the change to the loss is little, which means the flat region of the loss. As discussed in (Chaudhari et al., 2016), minima in a flat region is more likely to generalize better, and thus toward binary-valued gates will lead to better generalization.
|
| 79 |
+
|
| 80 |
+
However, the task of training towards binary-valued gates is quite challenging. One straightforward idea is to sharpen sigmoid function by using a smaller temperature, i.e., $\bar { f _ { W , b } ( x ) } = \sigma ( ( \bar { W x } + b ) / \tau )$ , where $\tau < 1$ is the temperature. However, it is computationally equivalent to $f _ { W ^ { \prime } , b ^ { \prime } } ( x ) = \sigma ( W ^ { \prime } x +$ $b ^ { \prime }$ ) by setting $W ^ { \prime } = W \bar { / } \tau$ and $b ^ { \prime } = b / \tau$ . Then using a small temperature is equivalent to rescale the initial parameters as well as the gradients to a larger range. Usually, using an initial point in a large range with a large learning rate will harm the optimization process, and apparently cannot guarantee the outputs to be close to the boundary after training.
|
| 81 |
+
|
| 82 |
+
In this work, we leverage the recently developed Gumbel-Softmax trick. This trick is efficient in approximating discrete distributions, and is one of the widely used methods to learn discrete random variables in stochastic computational graphs. We first provide a proposition about the approximation ability of this trick for Bernoulli distribution, which will be used in our proposed algorithm.
|
| 83 |
+
|
| 84 |
+
Proposition 1. Assume $\sigma ( \cdot )$ is the sigmoid function. Given $\alpha \in \mathbb { R }$ and temperature $\tau > 0$ , we define random variable $D _ { \alpha } \sim B ( \sigma ( \alpha ) )$ where $B ( \sigma ( \alpha ) )$ is the Bernoulli distribution with parameter $\sigma ( \alpha )$ , and define $\begin{array} { r } { G ( \alpha , \tau ) = \sigma ( \frac { \alpha + \log U - \log ( 1 - U ) } { \tau } ) } \end{array}$ where $U \sim U n i f o r m ( 0 , 1 )$ . Then the following inequalities hold for arbitrary $\epsilon \in ( 0 , \frac { 1 } { 2 } )$ ,
|
| 85 |
+
|
| 86 |
+
$$
|
| 87 |
+
\begin{array} { r l } { P ( D _ { \alpha } = 1 ) - \displaystyle \frac { \tau } { 4 } \log ( \frac { 1 } { \epsilon } ) \leq } & { P ( G ( \alpha , \tau ) \geq 1 - \epsilon ) \leq P ( D _ { \alpha } = 1 ) , } \\ { P ( D _ { \alpha } = 0 ) - \displaystyle \frac { \tau } { 4 } \log ( \frac { 1 } { \epsilon } ) \leq } & { P ( G ( \alpha , \tau ) \leq \epsilon ) \leq P ( D _ { \alpha } = 0 ) . } \end{array}
|
| 88 |
+
$$
|
| 89 |
+
|
| 90 |
+
$\begin{array} { r } { \sigma ^ { - 1 } ( x ) = \log ( \frac { x } { 1 - x } ) } \end{array}$ $\begin{array} { r } { P ( G ( \alpha , \tau ) \geq 1 - \epsilon ) = P ( \frac { \alpha + \log U - \log ( 1 - U ) } { \tau } \geq \log ( \frac { 1 } { \epsilon } - } \end{array}$ $\begin{array} { r } { 1 ) ) = P ( e ^ { \alpha - \tau \log ( \frac { 1 } { \epsilon } - 1 ) } \geq \frac { 1 - U } { U } ) = P ( U \geq \frac { 1 } { 1 + e ^ { \alpha - \tau \log ( \frac { 1 } { \epsilon } - 1 ) } } ) = \sigma ( \alpha - \tau \log ( \frac { 1 } { \epsilon } - 1 ) ) } \end{array}$ 11+eα−τ log( 1 −1) ) = σ(α − τ log( 1 − 1)). Considering that sigmoid function is monotonically increasing and $\textstyle { \frac { 1 } { 4 } }$ -Lipschitz continuous, we have $P ( D _ { \alpha } =$ $\begin{array} { r } { \mathrm { 1 ) } - P ( G ( \alpha , \tau ) \geq 1 - \epsilon ) = \sigma ( \alpha ) - \sigma ( \alpha - \tau \log ( \frac { 1 } { \epsilon } - 1 ) ) \geq 0 } \end{array}$ and $P ( D _ { \alpha } = 1 ) - P ( G ( \alpha , \tau ) \geq$ $\begin{array} { r } { 1 ^ { ' } - \epsilon ) = \sigma ( \alpha ) - \sigma ( \alpha - \tau \log ( \frac { 1 } { \epsilon } - 1 ) ) \leq \frac { \tau } { 4 } \log ( \frac { 1 } { \epsilon } - 1 ) \leq \frac { \tau } { 4 } \log ( \frac { 1 } { \epsilon } } \end{array}$ ). We omit the proof for (9) as it is almost identical to the proof of (8). □
|
| 91 |
+
|
| 92 |
+
We can see from the above proposition, the distribution of $G ( \alpha , \tau )$ can be considered as an approximation of Bernoulli distribution $B ( \sigma ( \alpha ) )$ . The rate of convergence is characterized by (8) and (9). When the temperature $\tau$ approaches positive zero, we directly obtain the following property which is also proved by Maddison et al. (2016),
|
| 93 |
+
|
| 94 |
+
$$
|
| 95 |
+
P ( \operatorname* { l i m } _ { \tau \to 0 ^ { + } } G ( \alpha , \tau ) = 1 ) = P ( D _ { \alpha } = 1 ) , P ( \operatorname* { l i m } _ { \tau \to 0 ^ { + } } G ( \alpha , \tau ) ) = P ( D _ { \alpha } = 0 ) .
|
| 96 |
+
$$
|
| 97 |
+
|
| 98 |
+
We apply this method into the computation of the gates. Imagine an one-dimensional gate $\sigma ( \alpha ( \theta ) )$ where $\alpha$ is a scalar parameterized by $\theta$ , and assume the model will produce a larger loss if the output of the gate is close to one, and produce a smaller loss if the gate value is close to zero. If we can repeatedly sample the output of the gate using $\begin{array} { r } { G ( \alpha ( \theta ) , \tau ) = \sigma ( \frac { \alpha ( \theta ) + \log U - \log ( 1 - U ) } { \tau } ) } \end{array}$ and estimate the loss, any gradient-based algorithm will push the parameter $\theta$ such that the output value of the gate is close to zero in order to minimize the expected loss. By this way, we can optimize towards the binary-valued gates.
|
| 99 |
+
|
| 100 |
+
As the gate function is usually a vector-valued function, we extend the notations into a general form: Given $\boldsymbol { \alpha } \in \mathbb { R } ^ { d }$ and $\tau > 0$ , we define $\begin{array} { r } { G ( \alpha , \tau ) = \sigma ( \frac { \alpha + \log U - \log ( 1 - U ) } { \tau } ) } \end{array}$ , where $U$ is a vector and each element $u _ { i }$ in $U$ is independently sampled from Uniform(0, 1), $i = 1 , 2 , \dots , d$ . In particular, we only push the outputs of input gates and forget gates towards binary values as the output gates usually need fine-granularity information for decision making which makes binary values less desirable (to justify this, we conducted similar experiments and observed a performance drop when pushing the output gates to $_ { 0 / 1 }$ together with the input gates and the forget gates).
|
| 101 |
+
|
| 102 |
+
We call our proposed learning method Gumbel-Gate LSTM ( $G ^ { 2 }$ -LSTM), which works as follows during training:
|
| 103 |
+
|
| 104 |
+
$$
|
| 105 |
+
\begin{array} { r c l } { \boldsymbol { i } _ { t } } & { = } & { G \big ( { \boldsymbol { W } } _ { x i } { \boldsymbol { x } } _ { t } + { \boldsymbol { W } } _ { h i } { \boldsymbol { h } } _ { t - 1 } + { \boldsymbol { b } } _ { i } , \tau \big ) } \\ { \boldsymbol { f } _ { t } } & { = } & { G \big ( { \boldsymbol { W } } _ { x f } { \boldsymbol { x } } _ { t } + { \boldsymbol { W } } _ { h f } { \boldsymbol { h } } _ { t - 1 } + { \boldsymbol { b } } _ { f } , \tau \big ) } \\ { \boldsymbol { o } _ { t } } & { = } & { \sigma \big ( { \boldsymbol { W } } _ { x o } { \boldsymbol { x } } _ { t } + { \boldsymbol { W } } _ { h o } { \boldsymbol { h } } _ { t - 1 } + { \boldsymbol { b } } _ { o } \big ) } \\ { \boldsymbol { g } _ { t } } & { = } & { \operatorname { t a n h } \big ( { \boldsymbol { W } } _ { x g } { \boldsymbol { x } } _ { t } + { \boldsymbol { W } } _ { h g } { \boldsymbol { h } } _ { t - 1 } + { \boldsymbol { b } } _ { g } \big ) } \\ { \boldsymbol { c } _ { t } } & { = } & { { \boldsymbol { f } } _ { t } \odot { \boldsymbol { c } } _ { t - 1 } + i _ { t } \odot { \boldsymbol { g } } _ { t } } \\ { \boldsymbol { h } _ { t } } & { = } & { { \boldsymbol { o } } _ { t } \odot \operatorname { t a n h } \big ( { \boldsymbol { c } } _ { t } \big ) . } \end{array}
|
| 106 |
+
$$
|
| 107 |
+
|
| 108 |
+
In the forward pass, we first independently sample values for $U$ in each time step, then update LSTM units using Eqn (11) - (16) and calculate the loss, e.g., negative log likelihood loss. In the backward pass, as $G$ is continuous and differentiable with respect to the parameters and the loss is continuous and differentiable with respect to $G$ , we can use any standard gradient-based method to update the model parameters.
|
| 109 |
+
|
| 110 |
+
# 4 EXPERIMENTS
|
| 111 |
+
|
| 112 |
+
# 4.1 SETTINGS
|
| 113 |
+
|
| 114 |
+
We tested the proposed training algorithm on two tasks – language modeling and machine translation.
|
| 115 |
+
|
| 116 |
+
# 4.1.1 LANGUAGE MODELING
|
| 117 |
+
|
| 118 |
+
Language modeling is a very basic task for LSTM. We used the Penn Treebank corpus which contains about 1 million words. The task is to train an LSTM model to correctly predict the next word conditioned on previous words. A model is evaluated by the prediction perplexity: smaller the perplexity, better the prediction.
|
| 119 |
+
|
| 120 |
+
Table 1: Performance comparison on language model (perplexity)
|
| 121 |
+
|
| 122 |
+
<table><tr><td rowspan=1 colspan=1>Model</td><td rowspan=1 colspan=1>Size</td><td rowspan=1 colspan=2>Valid</td><td rowspan=1 colspan=1>Test</td></tr><tr><td rowspan=1 colspan=5>Existing results</td></tr><tr><td rowspan=8 colspan=1>Unregularzed LSTMNR-dropout (Zaremba et al., 2014)Zoneout (Krueger et al., 2016)Variational LSTM (Gal & Ghahramani,2016)CharCNN (Kim et al.,2016)Pointer Sentinel-LSTM (Merity et al.,2016)LSTM + continuous cache pointer (Grave et al., 2016)Variational LSTM+ augmented loss (Inan et al.,2016)Variational RHN (Zilly et al., 2016)NAS Cell (Zoph & Le,2016)4-layer skip connection LSTM (Melis et al., 2017)AWD-LSTM w/o finetune (Merity et al., 2017)AWD-LSTM (Baseline) (Merity et al.,2017)</td><td rowspan=1 colspan=1>7M</td><td rowspan=1 colspan=2>120.7</td><td rowspan=1 colspan=1>114.5</td></tr><tr><td rowspan=1 colspan=1>66M</td><td rowspan=2 colspan=2>82.2=</td><td rowspan=2 colspan=1>78.477.473.4</td></tr><tr><td rowspan=1 colspan=1>66M19M</td></tr><tr><td rowspan=1 colspan=1>21M</td><td rowspan=1 colspan=2>72.4</td><td rowspan=1 colspan=1>78.9</td></tr><tr><td rowspan=1 colspan=1>51M=51M</td><td rowspan=1 colspan=2>1171.1</td><td rowspan=2 colspan=1>70.972.168.565.4</td></tr><tr><td rowspan=1 colspan=1>23M</td><td rowspan=1 colspan=2>67.9</td><td rowspan=1 colspan=1>9</td></tr><tr><td rowspan=1 colspan=1>54M24M</td><td rowspan=1 colspan=2>160.9</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>62.458.3</td></tr><tr><td rowspan=1 colspan=1>24M24M</td><td rowspan=1 colspan=2>60.760.0</td><td rowspan=1 colspan=1>58.857.3</td></tr><tr><td rowspan=1 colspan=5>Our system</td></tr><tr><td rowspan=1 colspan=1>Sharpened Sigmoid AWD-LSTMw/o finetuneSharpened Sigmoid AWD-LSTMG²-LSTM w/o finetuneG²-LSTM</td><td rowspan=1 colspan=1>24M24M24M24M</td><td rowspan=1 colspan=2>61.659.960.458.5</td><td rowspan=1 colspan=1>59.457.558.256.1</td></tr><tr><td rowspan=1 colspan=5>+continuouscache pointerAWD-LSTM + continuous cache pointer (Merity et al.,2017) 24M 53.9 52.8Sharpened Sigmoid AWD-LSTM + continuous cache pointer 24M 53.9 53.2G2-LSTM + continuous cache pointer 24M 52.9 52.1</td></tr></table>
|
| 123 |
+
|
| 124 |
+
Table 2: Performance comparison on machine translation (BLEU)
|
| 125 |
+
|
| 126 |
+
<table><tr><td rowspan=1 colspan=1>English→German task</td><td rowspan=1 colspan=1>BLEU</td><td rowspan=1 colspan=1>German→English task</td><td rowspan=1 colspan=1>BLEU</td></tr><tr><td rowspan=1 colspan=4>Existing end-to-end system</td></tr><tr><td rowspan=1 colspan=1>RNNSearch-LV (Jean et al., 2015)MRT (Shen et al., 2015)Global-att (Luong et al., 2015)GNMT (Wu et al., 2016)</td><td rowspan=1 colspan=1>19.4020.4520.9024.61</td><td rowspan=1 colspan=1>BSO(Wiseman & Rush,2016b)NMPT (Huang et al.)NMPT+LM (Huang et al.)ActorCritic (Bahdanau et al., 2016)</td><td rowspan=1 colspan=1>26.3628.9629.1628.53</td></tr><tr><td rowspan=1 colspan=4>Our end-to-end system</td></tr><tr><td rowspan=1 colspan=1>BaselineSharpened SigmoidG²-LSTM</td><td rowspan=1 colspan=1>21.8921.6422.43</td><td rowspan=1 colspan=1>11</td><td rowspan=1 colspan=1>31.0029.7331.95</td></tr></table>
|
| 127 |
+
|
| 128 |
+
We followed the practice in (Merity et al., 2017) to set up the model architecture for LSTM: a stacked three-layer LSTM with drop-connect (Wan et al., 2013) on recurrent weights and a variant of averaged stochastic gradient descent (ASGD) (Polyak & Juditsky, 1992) for optimization. Our training code for $G ^ { 2 }$ -LSTM was also based on the code released by Merity et al. $( 2 0 1 7 ) ^ { 2 }$ . We found the temperature $\tau$ used in $G ^ { 2 }$ -LSTM is not very sensitive. We set the temperature to 0.9 and followed all configurations in Merity et al. (2017). We added neural cache model (Grave et al., 2016) on the top of our trained language model to further improve the perplexity.
|
| 129 |
+
|
| 130 |
+
# 4.1.2 MACHINE TRANSLATION
|
| 131 |
+
|
| 132 |
+
We used two datasets for experiments on neural machine translation (NMT): (1) IWSLT2014 German English translation dataset (Cettolo et al., 2014), widely adopted in machine learning community (Bahdanau et al., 2016; Wiseman & Rush, 2016a; Ranzato et al., 2015). The training/validation/test sets contains about $1 5 3 k / 7 k / 7 k$ sentence pairs respectively, with words preprocessed into sub-word units using byte pair encoding (BPE) (Sennrich et al., 2016). We chose $2 5 k$ most frequent sub-word units as vocabulary for both German and English. (2) English German translation dataset in WMT’14, which is also commonly used as a benchmark task to evaluate different NMT models (Bahdanau et al., 2014; Wu et al., 2016; Gehring et al., 2017). The training set contains 4.5M English German sentence pairs, Newstest 2014 is used as the test set, and the concatenation of Newstest 2012 and Newstest2013 is used as the validation set. Similarly, BPE was used to form a vocabulary of most frequent $3 0 k$ sub-word units for both language. In both datasets, we removed the sentences with more than 64 sub-word units in training.
|
| 133 |
+
|
| 134 |
+

|
| 135 |
+
Figure 2: Training/validation loss curves of language modeling and machine translation tasks.
|
| 136 |
+
|
| 137 |
+
For German English dataset, we adopted a stacked two-layer encoder-decoder framework. We set the size of word embedding and hidden state to 256. As amount of data in the English German dataset is much larger, we adopted a stacked three-layer encoder-decoder framework and set the size of word embedding and hidden state to 512 and 1024 respectively. The first layer of the encoder was bi-directional. We also used dropout in training stacked LSTM as in (Zaremba et al., 2014), with dropout value determined via validation set performance. For both experiments, we set the temperature $\tau$ for $G ^ { 2 }$ -LSTM to 0.9, which was the same as in the language model task. The minibatch size was 32/64 for German English/English German respectively. All models were trained with AdaDelta (Zeiler, 2012) on one M40 GPU. Both gradient clipping norms were set to 2.0. We used tokenized case-sensitive BLEU (Papineni et al., $2 \bar { 0 } 0 2 ) ^ { 3 }$ as evaluation measure. The beam size is set to 5 during the inference step.
|
| 138 |
+
|
| 139 |
+
# 4.2 EXPERIMENTAL RESULTS
|
| 140 |
+
|
| 141 |
+
The experimental results are shown in Table 1 and 2.
|
| 142 |
+
|
| 143 |
+
First, we compare our training method with two algorithms. For the first algorithm (we call it Baseline), we remove the Gumble-Softmax trick and train the model using standard optimization methods. For the second algorithm (we call it Sharpened Sigmoid), we use a sharpened sigmoid function as described in Section 3.2 by setting $\tau = 0 . 2$ and check whether such trick can bring better generalization. From the results, we can see that our learnt models are better than all baseline models. In language modeling task, we outperform the baseline algorithms for $0 . 7 / 1 . 1$ points (1.2/1.4 points without continuous cache pointer) in terms of test perplexity. For machine translation, we outperform the baselines for $0 . 9 5 / 2 . 2 2$ and $0 . 5 4 / 0 . 7 9$ points in terms of BLEU score for German English and English German dataset respectively. Note that the only difference between $G ^ { 2 }$ -LSTM and the baselines is the training algorithm, while they adopt the same model structure. Thus, better results of $G ^ { 2 }$ -LSTM demonstrate the effectiveness of our proposed training method.
|
| 144 |
+
|
| 145 |
+
Second, training and validation loss curves of the baseline and $G ^ { 2 }$ -LSTM are shown in Fig. 2 for the two small tasks. Both curves show that the gap between training and validation is effectively reduced using our algorithm. As shown in Fig. 2(b), the baseline LSTM achieves its lowest validation loss around the 18th epoch and begins to overfit after that, while the validation loss of $G ^ { 2 }$ -LSTM still drops even in the 30th epoch. This clearly shows that $G ^ { 2 }$ -LSTM generalizes better.
|
| 146 |
+
|
| 147 |
+
Third, we also list the performance of previous works in literature, which may adopt different model architectures or settings. For language modeling, we obtain the best performance as far as we know. For German English translation, the two-layer stacked encoder-decoder model we learnt outperforms all previous works and achieves state-of-the-art performance. For English German translation, our result is worse than GNMT (Wu et al., 2016) as they used a stacked eight-layer LSTM encoder-decoder model while we only used a three-layer one.
|
| 148 |
+
|
| 149 |
+
Table 3: Model compression results on Penn Tree Bank dataset
|
| 150 |
+
|
| 151 |
+
<table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>Original</td><td rowspan=1 colspan=1>Round</td><td rowspan=1 colspan=1>Round & clip</td><td rowspan=1 colspan=1>SVD (rank = 128)</td><td rowspan=1 colspan=1>SVD (rank = 64)</td></tr><tr><td rowspan=1 colspan=1>Baseline</td><td rowspan=1 colspan=1>52.8</td><td rowspan=1 colspan=1>53.2 (+0.4)</td><td rowspan=1 colspan=1>53.6 (+0.8)</td><td rowspan=1 colspan=1>56.6(+3.8)</td><td rowspan=1 colspan=1>65.5 (+12.7)</td></tr><tr><td rowspan=1 colspan=1>Sharpened Sigmoid</td><td rowspan=1 colspan=1>53.2</td><td rowspan=1 colspan=1>53.5 (+0.3)</td><td rowspan=1 colspan=1>53.6 (+0.4)</td><td rowspan=1 colspan=1>54.6 (+1.4)</td><td rowspan=1 colspan=1>60.0 (+6.8)</td></tr><tr><td rowspan=1 colspan=1>G²-LSTM</td><td rowspan=1 colspan=1>52.1</td><td rowspan=1 colspan=1>52.2 (+0.1)</td><td rowspan=1 colspan=1>52.8 (+0.7)</td><td rowspan=1 colspan=1>53.3 (+1.2)</td><td rowspan=1 colspan=1>56.0 (+3.9)</td></tr></table>
|
| 152 |
+
|
| 153 |
+
Table 4: Model compression results on IWSLT German English dataset
|
| 154 |
+
|
| 155 |
+
<table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>Original</td><td rowspan=1 colspan=1>Round</td><td rowspan=1 colspan=1>Round & clip</td><td rowspan=1 colspan=1>SVD (rank = 32)</td><td rowspan=1 colspan=1>SVD (rank = 16)</td></tr><tr><td rowspan=1 colspan=1>Baseline</td><td rowspan=1 colspan=1>31.00</td><td rowspan=1 colspan=1>28.65 (-2.35)</td><td rowspan=1 colspan=1>21.97 (-9.03)</td><td rowspan=1 colspan=1>30.52 (-0.48)</td><td rowspan=1 colspan=1>29.56 (-1.44)</td></tr><tr><td rowspan=1 colspan=1>Sharpened Sigmoid</td><td rowspan=1 colspan=1>29.73</td><td rowspan=1 colspan=1>27.08 (-2.65)</td><td rowspan=1 colspan=1>25.14 (-4.59)</td><td rowspan=1 colspan=1>29.17 (-0.53)</td><td rowspan=1 colspan=1>28.82 (-0.91)</td></tr><tr><td rowspan=1 colspan=1>G²-LSTM</td><td rowspan=1 colspan=1>31.95</td><td rowspan=1 colspan=1>31.44 (-0.51)</td><td rowspan=1 colspan=1>31.44 (-0.51)</td><td rowspan=1 colspan=1>31.62 (-0.33)</td><td rowspan=1 colspan=1>31.28 (-0.67)</td></tr></table>
|
| 156 |
+
|
| 157 |
+
Table 5: Model compression results on WMT English German dataset
|
| 158 |
+
|
| 159 |
+
<table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>Original</td><td rowspan=1 colspan=1>Round</td><td rowspan=1 colspan=1>Round & clip</td><td rowspan=1 colspan=1>SVD (rank = 32)</td><td rowspan=1 colspan=1>SVD (rank = 16)</td></tr><tr><td rowspan=1 colspan=1>Baseline</td><td rowspan=1 colspan=1>21.89</td><td rowspan=1 colspan=1>16.22 (-5.67)</td><td rowspan=1 colspan=1>16.03 (-5.86)</td><td rowspan=1 colspan=1>21.15 (-0.74)</td><td rowspan=1 colspan=1>19.99 (-1.90)</td></tr><tr><td rowspan=1 colspan=1>Sharpened Sigmoid</td><td rowspan=1 colspan=1>21.64</td><td rowspan=1 colspan=1>16.85 (-4.79)</td><td rowspan=1 colspan=1>16.72 (-4.92)</td><td rowspan=1 colspan=1>20.98 (-0.66)</td><td rowspan=1 colspan=1>19.87 (-1.77)</td></tr><tr><td rowspan=1 colspan=1>G²-LSTM</td><td rowspan=1 colspan=1>22.43</td><td rowspan=1 colspan=1>20.15 (-2.28)</td><td rowspan=1 colspan=1>20.29 (-2.14)</td><td rowspan=1 colspan=1>22.16 (-0.27)</td><td rowspan=1 colspan=1>21.84 (-0.51)</td></tr></table>
|
| 160 |
+
|
| 161 |
+
# 4.3 SENSITIVITY ANALYSIS
|
| 162 |
+
|
| 163 |
+
We conducted a set of experiments to test how sensitive our learnt models were if their gate parameters were compressed. We considered two ways of parameter compression.
|
| 164 |
+
|
| 165 |
+
Low-Precision Compression We compressed parameters in the input and forget gates to lower precision. Doing so the model can be compressed to a relatively small size. In particular, we applied round and clip operations to the parameters of the input and forget gates.
|
| 166 |
+
|
| 167 |
+
$$
|
| 168 |
+
\begin{array} { r c l } { { \mathrm { r o u n d } _ { r } ( x ) } } & { { = } } & { { \mathrm { r o u n d } ( x / r ) * r } } \\ { { \mathrm { c l i p } _ { c } ( x ) } } & { { = } } & { { \mathrm { c l i p } ( x , - c , c ) . } } \end{array}
|
| 169 |
+
$$
|
| 170 |
+
|
| 171 |
+
We tested two settings of low-precision compression. In the first setting (named as Round), we rounded the parameters using Eqn (17). In this way, we reduced the support set of the parameters in the gates. In the second setting (named as Round & Clip), we further clipped the rounded value to a fixed range using Eqn (18) and thus restricted the number of different values. As the two tasks are far different, we set the round parameter $r = 0 . 2$ and the clip parameter $c = 0 . 4$ for the task of language modeling, and set $c = 1 . 0$ and $r = 0 . 5$ for neural machine translation. As a result, parameters of input gates and forget gates in language modeling can only take values from $( 0 . 0 , \pm 0 . 2 , \pm 0 . 4 )$ , and $( 0 . 0 , \pm 0 . 5 , \pm 1 . 0 )$ for machine translation. More comprehensive results on different choices of hyperparameters can be found in Appendix A.
|
| 172 |
+
|
| 173 |
+
Low-Rank Compression We compressed parameter matrices of the input/forget gates to lowerrank matrices through single value decomposition. Doing so can reduce model size and lead to faster matrix multiplication. Given that the hidden states of the task of language modeling were of much larger dimension than that of neural machine translation, we set $r a n k = 6 4 / 1 2 8$ for language modeling and $r a n k = 1 6 / 3 2$ for neural machine translation.
|
| 174 |
+
|
| 175 |
+
We summarize the results in Table 3-5. From Table 3, we can see that for language modeling both the baseline and our learnt model are quite robust to low-precision compression, but our model is much more robust and significantly outperforms the baseline with low-rank approximation. Even setting $r a n k = 6 4$ (roughly $1 2 \mathbf { x }$ compression rate of the gates), we still get 56.0 perplexity, while the perplexity of the baseline model increases from 52.8 to 65.5, i.e., becoming $24 \%$ worse. For machine translation, our proposed method is always better than the baseline model, no matter for low-precision or low-rank compression. Even if setting $r a n k = 1 6$ (roughly $8 \mathrm { x } / 3 2 \mathrm { x }$ compression rate of the gates for German English and English German respectively), we still get roughly comparable translation accuracy to the baseline model with full parameters. All results show that the models trained with our proposed method are less sensitive to parameter compression.
|
| 176 |
+
|
| 177 |
+

|
| 178 |
+
Figure 3: Distributions of gate values in LSTM.
|
| 179 |
+
|
| 180 |
+

|
| 181 |
+
Figure 4: Distributions of gate values in $G ^ { 2 }$ -LSTM.
|
| 182 |
+
|
| 183 |
+
# 4.4 VISUALIZATION OF THE GATES
|
| 184 |
+
|
| 185 |
+
In addition to compare the final accuracy in previous two subsections, we further look inside the learnt models and check the values of the gates.
|
| 186 |
+
|
| 187 |
+
To well verify the effectiveness of our proposed $G ^ { 2 }$ -LSTM, we did a set of experiments to show the values of gates we have learnt are near the boundary and are reasonable, based on the model learnt from German English translation task. We show the value distribution of the gates trained using classic LSTM and $\bar { G } ^ { 2 }$ -LSTM. To achieve this, we sampled 10000 sentence pairs from the training set of German English and fed them into the learnt models. We got the output value vectors of the input/forget gates in both the encoder and decoder. We recorded the value of each element in the output vectors and plotted the value distributions in Figure 3 and Figure 4.
|
| 188 |
+
|
| 189 |
+

|
| 190 |
+
Figure 5: Visualization of gate values.
|
| 191 |
+
|
| 192 |
+
From the figures, we can see that although both LSTM and $G ^ { 2 }$ -LSTM work reasonably well in practice, the output values of the gates are very different. In LSTM, the distributions of the gate values are relatively uniform and have no clear concentration. In contrast, the values of the input gates of $G ^ { 2 }$ -LSTM are concentrated in the region close to 1, which suggests that our learnt model tries to keep most information from the input words; the values of the forget gates are concentrated in the boundary regions (i.e., either the region close to 0 or the region close to 1). This observation shows that our training algorithm meets our expectation and successfully pushes the gates to $_ { 0 / 1 }$ .
|
| 193 |
+
|
| 194 |
+
Besides the overall distribution of gate values over a sampled set of training data, here we provide a case study for a sampled sentence. As it is hard to go deep into individual dimensions of a hidden state, we just calculated the average value of the output vector of the input and forget gate functions for each word. In particular, for each word, we focused on the average value of input/forget gate functions in the first layer and check whether the average is reasonable. We plot the heatmap of the English sentence part in Figure 5. More visualizations can be found in Appendix B. First, we can see that our $G ^ { 2 }$ -LSTM does not drop information in the input gate function, since the average values are relatively large for all words. In contrast, the average values of the input gates of LSTM are sometimes small (less than 0.5), even for the meaningful word like “data”. As those words are not included into LSTM, they cannot be effectively encoded and decoded, thus lead to bad translation result. Second, for $G ^ { 2 }$ -LSTM, most of the words with small values for forget gates are function words (e.g., conjunctions and punctuations) or the boundaries in clauses. That is, our training algorithm indeed ensures the model to forget information on the boundaries inside the sentences, and reset the hidden states with new inputs.
|
| 195 |
+
|
| 196 |
+
# 5 CONCLUSION AND FUTURE WORK
|
| 197 |
+
|
| 198 |
+
In this paper, we have designed a new training algorithm for LSTM by leveraging the recently developed Gumbel-Softmax trick. Our training algorithm can push the values of the input and forget gates to 0 or 1, leading to robust LSTM models. Experiments on language modeling and machine translation have demonstrated the effectiveness of the proposed training algorithm.
|
| 199 |
+
|
| 200 |
+
We will explore following directions in the future. First, we have only tested with shallow LSTM models in this paper. We will apply our algorithm to deeper models (e.g., $^ { 8 + }$ layers) and test on larger datasets. Second, we have considered the tasks of language modeling and machine translation. We will study more applications such as question answering and text summarization. Third, we are cleaning and refactoring the code and will release the training code to public soon.
|
| 201 |
+
|
| 202 |
+
# REFERENCES
|
| 203 |
+
|
| 204 |
+
Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. arXiv preprint arXiv:1409.0473, 2014.
|
| 205 |
+
|
| 206 |
+
Dzmitry Bahdanau, Philemon Brakel, Kelvin Xu, Anirudh Goyal, Ryan Lowe, Joelle Pineau, Aaron Courville, and Yoshua Bengio. An actor-critic algorithm for sequence prediction. arXiv preprint arXiv:1607.07086, 2016.
|
| 207 |
+
|
| 208 |
+
Denny Britz, Anna Goldie, Thang Luong, and Quoc Le. Massive exploration of neural machine translation architectures. arXiv preprint arXiv:1703.03906, 2017.
|
| 209 |
+
|
| 210 |
+
Mauro Cettolo, Jan Niehues, Sebastian Stuker, Luisa Bentivogli, and Marcello Federico. Report on ¨ the 11th iwslt evaluation campaign, iwslt 2014. In Proceedings of the International Workshop on Spoken Language Translation, Hanoi, Vietnam, 2014.
|
| 211 |
+
|
| 212 |
+
Pratik Chaudhari, Anna Choromanska, Stefano Soatto, and Yann LeCun. Entropy-sgd: Biasing gradient descent into wide valleys. arXiv preprint arXiv:1611.01838, 2016.
|
| 213 |
+
|
| 214 |
+
Yarin Gal and Zoubin Ghahramani. A theoretically grounded application of dropout in recurrent neural networks. In Advances in neural information processing systems, pp. 1019–1027, 2016.
|
| 215 |
+
|
| 216 |
+
Jonas Gehring, Michael Auli, David Grangier, Denis Yarats, and Yann N Dauphin. Convolutional sequence to sequence learning. arXiv preprint arXiv:1705.03122, 2017.
|
| 217 |
+
|
| 218 |
+
Felix A Gers, Jurgen Schmidhuber, and Fred Cummins. Learning to forget: Continual prediction ¨ with lstm. 1999.
|
| 219 |
+
|
| 220 |
+
Edouard Grave, Armand Joulin, and Nicolas Usunier. Improving neural language models with a continuous cache. arXiv preprint arXiv:1612.04426, 2016.
|
| 221 |
+
|
| 222 |
+
David Haussler, Manfred Opper, et al. Mutual information, metric entropy and cumulative relative entropy risk. The Annals of Statistics, 25(6):2451–2492, 1997.
|
| 223 |
+
|
| 224 |
+
Sepp Hochreiter. The vanishing gradient problem during learning recurrent neural nets and problem solutions. International Journal of Uncertainty, Fuzziness and Knowledge-Based Systems, 6(02): 107–116, 1998.
|
| 225 |
+
|
| 226 |
+
Sepp Hochreiter and Jurgen Schmidhuber. Flat minima. ¨ Neural Computation, 9(1):1–42, 1997a.
|
| 227 |
+
|
| 228 |
+
Sepp Hochreiter and Jurgen Schmidhuber. Long short-term memory. ¨ Neural computation, 9(8): 1735–1780, 1997b.
|
| 229 |
+
|
| 230 |
+
Po-Sen Huang, Chong Wang, Dengyong Zhou, and Li Deng. Toward neural phrase-based machine translation.
|
| 231 |
+
|
| 232 |
+
Hakan Inan, Khashayar Khosravi, and Richard Socher. Tying word vectors and word classifiers: A loss framework for language modeling. arXiv preprint arXiv:1611.01462, 2016.
|
| 233 |
+
|
| 234 |
+
Eric Jang, Shixiang Gu, and Ben Poole. Categorical reparameterization with gumbel-softmax. arXiv preprint arXiv:1611.01144, 2016.
|
| 235 |
+
|
| 236 |
+
Sebastien Jean, Kyunghyun Cho, Roland Memisevic, and Yoshua Bengio. On using very large ´ target vocabulary for neural machine translation. In Proceedings of the 53rd Annual Meeting of the Association for Computational Linguistics and the 7th International Joint Conference on Natural Language Processing (Volume 1: Long Papers), pp. 1–10, Beijing, China, July 2015. Association for Computational Linguistics. URL http://www.aclweb.org/anthology/ P15-1001.
|
| 237 |
+
|
| 238 |
+
Rafal Jozefowicz, Oriol Vinyals, Mike Schuster, Noam Shazeer, and Yonghui Wu. Exploring the limits of language modeling. arXiv preprint arXiv:1602.02410, 2016.
|
| 239 |
+
|
| 240 |
+
Nitish Shirish Keskar, Dheevatsa Mudigere, Jorge Nocedal, Mikhail Smelyanskiy, and Ping Tak Peter Tang. On large-batch training for deep learning: Generalization gap and sharp minima. arXiv preprint arXiv:1609.04836, 2016.
|
| 241 |
+
|
| 242 |
+
Yoon Kim, Yacine Jernite, David Sontag, and Alexander M Rush. Character-aware neural language models. In AAAI, pp. 2741–2749, 2016.
|
| 243 |
+
|
| 244 |
+
David Krueger, Tegan Maharaj, Janos Kramar, Mohammad Pezeshki, Nicolas Ballas, Nan Rosemary Ke, Anirudh Goyal, Yoshua Bengio, Aaron Courville, and Christopher Pal. Zoneout: Regularizing rnns by randomly preserving hidden activations. 2016.
|
| 245 |
+
|
| 246 |
+
Matt J Kusner and Jose Miguel Hern ´ andez-Lobato. Gans for sequences of discrete elements with ´ the gumbel-softmax distribution. arXiv preprint arXiv:1611.04051, 2016.
|
| 247 |
+
|
| 248 |
+
Minh-Thang Luong, Hieu Pham, and Christopher D Manning. Effective approaches to attentionbased neural machine translation. arXiv preprint arXiv:1508.04025, 2015.
|
| 249 |
+
|
| 250 |
+
Chris J Maddison, Andriy Mnih, and Yee Whye Teh. The concrete distribution: A continuous relaxation of discrete random variables. arXiv preprint arXiv:1611.00712, 2016.
|
| 251 |
+
|
| 252 |
+
Gabor Melis, Chris Dyer, and Phil Blunsom. On the state of the art of evaluation in neural language ´ models. arXiv preprint arXiv:1707.05589, 2017.
|
| 253 |
+
|
| 254 |
+
Stephen Merity, Caiming Xiong, James Bradbury, and Richard Socher. Pointer sentinel mixture models. arXiv preprint arXiv:1609.07843, 2016.
|
| 255 |
+
|
| 256 |
+
Stephen Merity, Nitish Shirish Keskar, and Richard Socher. Regularizing and optimizing lstm language models. arXiv preprint arXiv:1708.02182, 2017.
|
| 257 |
+
|
| 258 |
+
Kishore Papineni, Salim Roukos, Todd Ward, and Wei-Jing Zhu. Bleu: a method for automatic evaluation of machine translation. In Proceedings of the 40th annual meeting on association for computational linguistics, pp. 311–318. Association for Computational Linguistics, 2002.
|
| 259 |
+
|
| 260 |
+
Boris T Polyak and Anatoli B Juditsky. Acceleration of stochastic approximation by averaging. SIAM Journal on Control and Optimization, 30(4):838–855, 1992.
|
| 261 |
+
|
| 262 |
+
Marc’Aurelio Ranzato, Sumit Chopra, Michael Auli, and Wojciech Zaremba. Sequence level training with recurrent neural networks. arXiv preprint arXiv:1511.06732, 2015.
|
| 263 |
+
|
| 264 |
+
Stanislau Semeniuta, Aliaksei Severyn, and Erhardt Barth. Recurrent dropout without memory loss. arXiv preprint arXiv:1603.05118, 2016.
|
| 265 |
+
|
| 266 |
+
Rico Sennrich, Barry Haddow, and Alexandra Birch. Neural machine translation of rare words with subword units. In ACL, 2016.
|
| 267 |
+
|
| 268 |
+
Shiqi Shen, Yong Cheng, Zhongjun He, Wei He, Hua Wu, Maosong Sun, and Yang Liu. Minimum risk training for neural machine translation. arXiv preprint arXiv:1512.02433, 2015.
|
| 269 |
+
|
| 270 |
+
Sandeep Subramanian, Sai Rajeswar, Francis Dutil, Christopher Pal, and Aaron Courville. Adversarial generation of natural language. ACL 2017, pp. 241, 2017.
|
| 271 |
+
|
| 272 |
+
Ruben Villegas, Jimei Yang, Yuliang Zou, Sungryull Sohn, Xunyu Lin, and Honglak Lee. Learning to generate long-term future via hierarchical prediction. arXiv preprint arXiv:1704.05831, 2017.
|
| 273 |
+
|
| 274 |
+
Oriol Vinyals, Alexander Toshev, Samy Bengio, and Dumitru Erhan. Show and tell: A neural image caption generator. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 3156–3164, 2015.
|
| 275 |
+
|
| 276 |
+
Li Wan, Matthew Zeiler, Sixin Zhang, Yann Le Cun, and Rob Fergus. Regularization of neural networks using dropconnect. In International Conference on Machine Learning, pp. 1058–1066, 2013.
|
| 277 |
+
|
| 278 |
+
Sam Wiseman and Alexander M. Rush. Sequence-to-sequence learning as beam-search optimization. In EMNLP, November 2016a.
|
| 279 |
+
|
| 280 |
+
Sam Wiseman and Alexander M Rush. Sequence-to-sequence learning as beam-search optimization. arXiv preprint arXiv:1606.02960, 2016b.
|
| 281 |
+
|
| 282 |
+
Yonghui Wu, Mike Schuster, Zhifeng Chen, Quoc V Le, Mohammad Norouzi, Wolfgang Macherey, Maxim Krikun, Yuan Cao, Qin Gao, Klaus Macherey, et al. Google’s neural machine translation system: Bridging the gap between human and machine translation. arXiv preprint arXiv:1609.08144, 2016.
|
| 283 |
+
|
| 284 |
+
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.
|
| 285 |
+
|
| 286 |
+
Kelvin Xu, Jimmy Ba, Ryan Kiros, Kyunghyun Cho, Aaron Courville, Ruslan Salakhudinov, Rich Zemel, and Yoshua Bengio. Show, attend and tell: Neural image caption generation with visual attention. In International Conference on Machine Learning, pp. 2048–2057, 2015.
|
| 287 |
+
|
| 288 |
+
Wojciech Zaremba, Ilya Sutskever, and Oriol Vinyals. Recurrent neural network regularization. arXiv preprint arXiv:1409.2329, 2014.
|
| 289 |
+
|
| 290 |
+
Matthew D Zeiler. Adadelta: an adaptive learning rate method. arXiv preprint arXiv:1212.5701, 2012.
|
| 291 |
+
|
| 292 |
+
Yu Zhang, Guoguo Chen, Dong Yu, Kaisheng Yaco, Sanjeev Khudanpur, and James Glass. Highway long short-term memory rnns for distant speech recognition. In Acoustics, Speech and Signal Processing (ICASSP), 2016 IEEE International Conference on, pp. 5755–5759. IEEE, 2016.
|
| 293 |
+
|
| 294 |
+
Julian Georg Zilly, Rupesh Kumar Srivastava, Jan Koutn´ık, and Jurgen Schmidhuber. Recurrent ¨ highway networks. arXiv preprint arXiv:1607.03474, 2016.
|
| 295 |
+
|
| 296 |
+
Barret Zoph and Quoc V Le. Neural architecture search with reinforcement learning. arXiv preprint arXiv:1611.01578, 2016.
|
| 297 |
+
|
| 298 |
+
# A EXTRA EXPERIMENTS ON SENSITIVITY
|
| 299 |
+
|
| 300 |
+
We did an extra set of experiments on language modeling to show our model is less sensitive than the baseline model, no matter what the hyperparameters $( c , r$ in low-precision compression, rank in low-rank compression) are. The results are shown in Table 6 and Table 7.
|
| 301 |
+
|
| 302 |
+
Table 6: Low precision compression results on Penn Tree Bank dataset
|
| 303 |
+
|
| 304 |
+
<table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>Original</td><td rowspan=1 colspan=1>c = 0.20,r =0.10</td><td rowspan=1 colspan=1>c = 0.40,r = 0.20</td><td rowspan=1 colspan=1>c = 0.60,r = 0.30</td><td rowspan=1 colspan=1>c = 0.80,r = 0.40</td></tr><tr><td rowspan=1 colspan=1>LSTM</td><td rowspan=1 colspan=1>52.8</td><td rowspan=1 colspan=1>58.5 (+5.7)</td><td rowspan=1 colspan=1>53.6 (+0.8)</td><td rowspan=1 colspan=1>54.2 (+1.4)</td><td rowspan=1 colspan=1>57.7 (+4.9)</td></tr><tr><td rowspan=1 colspan=1>Sharpened Sigmoid</td><td rowspan=1 colspan=1>53.2</td><td rowspan=1 colspan=1>54.6 (+1.4)</td><td rowspan=1 colspan=1>53.6 (+0.4)</td><td rowspan=1 colspan=1>54.1 (+0.9)</td><td rowspan=1 colspan=1>57.8 (+4.6)</td></tr><tr><td rowspan=1 colspan=1>G²-LSTM</td><td rowspan=1 colspan=1>52.1</td><td rowspan=1 colspan=1>54.5 (+2.4)</td><td rowspan=1 colspan=1>52.8 (+0.7)</td><td rowspan=1 colspan=1>53.2 (+1.1)</td><td rowspan=1 colspan=1>55.0 (+2.9)</td></tr></table>
|
| 305 |
+
|
| 306 |
+
Table 7: Low rank compression results on Penn Tree Bank dataset
|
| 307 |
+
|
| 308 |
+
<table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>Original</td><td rowspan=1 colspan=1>rank =128</td><td rowspan=1 colspan=1>rank =64</td><td rowspan=1 colspan=1>rank =32</td><td rowspan=1 colspan=1>rank=16</td></tr><tr><td rowspan=1 colspan=1>LSTM</td><td rowspan=1 colspan=1>52.8</td><td rowspan=1 colspan=1>56.6(+3.8)</td><td rowspan=1 colspan=1>65.5 (+12.7)</td><td rowspan=1 colspan=1>83.1 (+30.3)</td><td rowspan=1 colspan=1>111.6 (+58.8)</td></tr><tr><td rowspan=1 colspan=1>Sharpened Sigmoid</td><td rowspan=1 colspan=1>53.2</td><td rowspan=1 colspan=1>54.6 (+1.4)</td><td rowspan=1 colspan=1>60.0 (+6.8)</td><td rowspan=1 colspan=1>72.8 (+19.6)</td><td rowspan=1 colspan=1>100.9 (+47.7)</td></tr><tr><td rowspan=1 colspan=1>G²-LSTM</td><td rowspan=1 colspan=1>52.1</td><td rowspan=1 colspan=1>53.3 (+1.2)</td><td rowspan=1 colspan=1>56.0 (+3.9)</td><td rowspan=1 colspan=1>62.8 (+10.7)</td><td rowspan=1 colspan=1>75.9 (+23.8)</td></tr></table>
|
| 309 |
+
|
| 310 |
+
# B EXAMPLES
|
| 311 |
+
|
| 312 |
+

|
| 313 |
+
|
| 314 |
+

|
| 315 |
+
|
| 316 |
+

|
| 317 |
+
|
| 318 |
+

|
| 319 |
+
|
| 320 |
+

|
| 321 |
+
Figure 6: The gate value visualization in German English task.
|
md/train/rkxNh1Stvr/rkxNh1Stvr.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/train/ryGvcoA5YX/ryGvcoA5YX.md
ADDED
|
@@ -0,0 +1,353 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# OVERCOMING CATASTROPHIC FORGETTING FOR CONTINUAL LEARNING VIA MODEL ADAPTATION
|
| 2 |
+
|
| 3 |
+
Wenpeng $\mathrm { H u ^ { 1 , 2 , * } }$ , Zhou Lin1,∗ , Bing Liu3,∗, Chongyang $\mathrm { T a o } ^ { 2 }$ , Zhengwei Tao2, Dongyan Zhao2, Jinwen $\mathbf { M } \mathbf { a } ^ { 1 }$ , and Rui Yan2,†
|
| 4 |
+
|
| 5 |
+
1Department of Information Science, School of Mathematical Sciences, Peking University 2ICST, Peking University, Beijing, China 3Department of Computer Science, University of Illinois at Chicago {wenpeng.hu,jokerlin,chongyangtao,tttzw,zhaody,ruiyan}@pku.edu.cn liub@uic.edu jwma@math.pku.edu.cn
|
| 6 |
+
|
| 7 |
+
# ABSTRACT
|
| 8 |
+
|
| 9 |
+
Learning multiple tasks sequentially is important for the development of AI and lifelong learning systems. However, standard neural network architectures suffer from catastrophic forgetting which makes it difficult for them to learn a sequence of tasks. Several continual learning methods have been proposed to address the problem. In this paper, we propose a very different approach, called Parameter Generation and Model Adaptation (PGMA), to dealing with the problem. The proposed approach learns to build a model, called the solver, with two sets of parameters. The first set is shared by all tasks learned so far and the second set is dynamically generated to adapt the solver to suit each test example in order to classify it. Extensive experiments have been carried out to demonstrate the effectiveness of the proposed approach.
|
| 10 |
+
|
| 11 |
+
# 1 INTRODUCTION
|
| 12 |
+
|
| 13 |
+
It is well-known that neural networks (NNs) suffer from catastrophic forgetting (CF) (McCloskey & Cohen, 1989), which refers to the phenomenon that when learning a sequence of tasks, the learning of each new task may cause the NN to forget the models learned for the previous tasks. Without solving this problem, an NN is hard to adapt to lifelong or continual learning, which is important for AI.
|
| 14 |
+
|
| 15 |
+
Problem Statement: Given a sequence of supervised learning tasks $\mathbf { T } = \left( T _ { 1 } , T _ { 2 } , \ldots , T _ { N } \right)$ , we want to learn them one by one in the given sequence such that the learning of each new task will not forget the models learned for the previous tasks.
|
| 16 |
+
|
| 17 |
+
In recent years, many approaches (often called continual learning) have been proposed to lessen the effect of CF (Chen & Liu, 2018; Parisi et al., 2018), e.g., dynamically expandable network (DEN) (Yoon et al., 2018), learning without forgetting (LWF) (Li & Hoiem, 2016)), elastic weight consolidation (EWC) (Kirkpatrick et al., 2017), incremental moment matching (IMM) (Lee et al., 2017), gradient episodic memory (GEM) (Lopez-Paz et al., 2017), generative replay (GR) (Shin et al., 2017), etc. These existing studies except DEN and LWF focused on learning a model parameterized by a single joint set of parameters $\theta ^ { * }$ which is assumed to work well for all tasks. We call them joint parameterization (JP) methods. DEN and LWF require constantly increasing the number of parameters and thus can result in a huge and complex model.
|
| 18 |
+
|
| 19 |
+
JP methods, however, suffer from accuracy deterioration. Assume we have two tasks A and B that need to be learned sequentially. Let $\theta _ { A } ^ { * }$ and $\theta _ { B } ^ { * }$ be the optimal parameters for Task A and Task B respectively when each of them is learned individually. Let $\theta ^ { * }$ be the joint parameters learned by the existing approaches to perform Tasks A and $\mathbf { B }$ in sequence. Inevitably, $\theta ^ { * }$ is different from $\theta _ { A } ^ { * }$ and/or $\theta _ { B } ^ { * }$ and is highly likely to result in more errors for the two tasks than $\theta _ { A } ^ { * }$ and $\theta _ { B } ^ { * }$ individually.
|
| 20 |
+
|
| 21 |
+
In this paper, we propose a different approach, called Parameter Generation and Model Adaptation (PGMA), to dealing with CF and to significantly reducing accuracy deterioration. PGMA does not learn a joint parameter set $\theta ^ { * }$ . Instead, it learns a parameter generator $f ( \cdot )$ and a shared parameter set $\theta _ { 0 }$ . The key idea of PGMA is as follows: The overall classification network, called the solver $S$ , has two disjoint subsets/parts of parameters. The first subset is $\theta _ { 0 }$ , which is shared by all tasks learned so far. The second subset is just a place holder $H$ that will be filled by parameters generated by $f ( \cdot )$ for each test instance. That is, given a test instance, a set of parameters will be generated by the learned parameter generator $f ( \cdot )$ to replace $H$ . Solver $S$ then combines $\theta _ { 0 }$ and the generated parameters for the test instance to classify it. Clearly, unlike existing JP approaches, we do not have a network with a set of fixed parameters for $S$ . The idea is that $\theta _ { 0 }$ contains the common features of all tasks, and the generated parameters for each test instance adapt $S$ for each test instance in order to classify it.
|
| 22 |
+
|
| 23 |
+
Since $f ( \cdot )$ and the shared parameters $\theta _ { 0 }$ will change during training for each new task, forgetting can occur for previous tasks. To deal with it, in training $f ( \cdot )$ and $S$ for each task $T _ { i }$ , in addition to the training data of $T _ { i }$ , a small number of replayed samples will be generated by a data generation network for the previous tasks to ensure that the knowledge learned for previous tasks remain stable/unforgotten. Compared with the existing generative replay methods, our method does not need labels for the replayed data because we use the replayed data only to constrain the training of $S$ and $f ( \cdot )$ rather than to treat them as surrogates of labeled training data from previous tasks. Further, since in the existing replay methods, the labels are produced by the current learned network itself, the labels can be noisy and biased, which may result in errors being accumulated and propagated to subsequent tasks. Our method does not have this problem.
|
| 24 |
+
|
| 25 |
+
Apart from reducing the effect of accuracy deterioration of the existing approaches, the proposed approach also has some other advantages. First, no parameter increase or network expansion is needed to learn new tasks. Second, no previous data needs to be stored to enable the system to remember the previously learned models or knowledge.
|
| 26 |
+
|
| 27 |
+
Experiments conducted using two image datasets (MNIST and CIFAR-10) and two text datasets (DBPedia ontology (Lehmann et al., 2015) and THUCNews (Li et al., 2006)) show that the proposed approach PGMA works well for different scenarios and different types of datasets, and outperforms the existing strong baselines markedly.
|
| 28 |
+
|
| 29 |
+
# 2 PROPOSED PGMA FRAMEWORK
|
| 30 |
+
|
| 31 |
+
Let the sequence of supervised learning tasks be $\mathbf { T } = \left( T _ { 1 } , T _ { 2 } , \ldots , T _ { N } \right)$ . Each task $T _ { i }$ is represented by $T _ { i } = \{ x _ { i j } , y _ { i j } | j \in \left( 1 , \ldots , N _ { i } \right) \}$ , where $x _ { i j }$ is the $j$ -th example/sample of $T _ { i }$ , and $y _ { i j }$ is its label. We use $( x ^ { t } , y ^ { t } )$ to denote a test instance/example. To simplify the notation, we will just use $( x _ { i } , y _ { i } )$ to denote a training example from task $T _ { i }$ , omitting the second subscript $j$ . Note that in the paper, we use the terms example, sample, and instance interchangeably.
|
| 32 |
+
|
| 33 |
+
The proposed parameter generation and model adaptation (PGMA) architecture has three main components:
|
| 34 |
+
|
| 35 |
+
• Solver $S$ : It is the main classification model. As mentioned in Section 1, the parameter set of $S$ consists of two subsets, $\theta _ { 0 }$ that is shared by all tasks (and instances) and $H$ , a parameter place holder, which will be replaced by the generated parameters set $\mathbf { p } _ { i }$ (or $\mathbf { p } ^ { t } .$ ) for each training (or testing) example $x _ { i }$ (or $x ^ { t }$ ). $\mathbf { p } _ { i }$ (or $\mathbf { p } ^ { t }$ ) basically serves to adapt the solver $S$ to classify the example in training or testing. This is the key idea of our approach. We adopt this parameter split as several studies (Yoon et al., 2018; Li & Hoiem, 2016; Kirkpatrick et al., 2017) have shown that only part of parameters of a neural network needs to be adjusted when learning a new task. See Section 2.2
|
| 36 |
+
|
| 37 |
+
• Dynamic Parameter Generator (DPG) $f ( \cdot )$ : It takes the embedding $\mathbf { z } _ { i }$ (or $\mathbf { z } ^ { t }$ ) of each input training (or testing) example $x _ { i }$ (or $x ^ { t }$ ) to generate the parameters $\mathbf { p } _ { i }$ (or $\mathbf { p } ^ { t } .$ ) for solver $S$ . Note that we use $\mathbf { z } _ { i }$ (or $\mathbf { z } ^ { t }$ ) rather than the raw data $x _ { i }$ (or $x ^ { t }$ ) because the raw data’s dimension can be very high. The embedding $\mathbf { z } _ { i }$ (or $\mathbf { z } ^ { t }$ ) as a low dimensional dense representation reduces the mapping space for DPG and thus reduces the difficulty in its parameter generation. See Section 2.2.
|
| 38 |
+
|
| 39 |
+
• Data Generator (DG): It has two functions. The main function is to generate a set of replayed data or samples $\{ x _ { m } ^ { \prime } \} _ { m = 1 } ^ { M }$ using its decoder $D G _ { D }$ for previous tasks to deal with catastrophic forgetting. The other function is to generate the embedding $\mathbf { z } _ { i }$ (or $\mathbf { z } ^ { t }$ ) of each input training (or testing) example $x _ { i }$ (or $x ^ { t }$ ) using its encoder $D G _ { E }$ . See Section 2.3.
|
| 40 |
+
|
| 41 |
+
# 2.1 OVERALL APPROACH OF PGMA
|
| 42 |
+
|
| 43 |
+
We work backward by describing testing first before training. Given a test instance $x ^ { t }$ , $D G _ { E }$ first generates its embedding $\mathbf { z } ^ { t }$ , which is fed to $f ( \cdot )$ to generate a set of parameters $\mathrm { ~ \bf ~ p ~ } ^ { t }$ . Solver $S$ then takes $x ^ { t }$ as input and uses the trained/learned shared parameters $\theta _ { 0 }$ and $\mathbf { p } ^ { t }$ to classify $x ^ { t }$ . $\theta _ { 0 }$ contains the common features of all tasks learned so far. $\mathbf { p } ^ { t }$ simply adapts $S$ for $x ^ { t }$ in order to classify $x ^ { t }$ .
|
| 44 |
+
|
| 45 |
+
For training, the pipeline of the proposed PGMA framework is shown in Figure 1. Given a new task $T _ { i }$ with its data $( x _ { i } , y _ { i } )$ , solver $S$ and DPG $f ( \cdot )$ are jointly trained to learn $T _ { i }$ and also not to forget the previously learned tasks. In each iteration, a set of parameters $\mathbf { p } _ { i }$ is generated by the current DPG $f ( \mathbf { z } _ { i } , \mu )$ for each training instance $x _ { i }$ $\mathbf { z } _ { i }$ being its embedding), where $\mu$ is the set of parameters of the DPG network, which is trained.
|
| 46 |
+
|
| 47 |
+
In training the solver $S$ and DPG for the new task $T _ { i }$ , both $f ( \cdot )$ and the shared parameters $\theta _ { 0 }$ will change, which can cause forgetting in DPG for previous tasks. To keep DPG remembering the acquired knowledge for previous tasks, we minimize the variation of certain layers’ output caused by the changes of $\theta _ { 0 }$ and $f ( \cdot )$ using the set of replayed samples $\hat { \{ { x } _ { m } ^ { \prime } \} } _ { m = 1 } ^ { M }$ generated by DG.
|
| 48 |
+
|
| 49 |
+

|
| 50 |
+
Figure 1: Sequential training in the PGMA framework.
|
| 51 |
+
|
| 52 |
+
PGMA has two training components: (1) DPG and solver $S$ (DPG&S for short), i.e., DPG is optimized together with solver $S$ . (2) DG. The two components have their respective objective functions (see Sections 2.2 and 2.3), and are trained alternately. This is because DPG takes input $\mathbf { z } _ { i }$ (which is produced by DG) to generate parameters, and alternating training ensures consistent convergence rates of DG and DPG.
|
| 53 |
+
|
| 54 |
+
# 2.2 DYNAMIC PARAMETER GENERATOR (DPG) AND SOLVER $S$ IMPLEMENTATION
|
| 55 |
+
|
| 56 |
+
Several neural networks can be used to implement DPG for parameter generation, e.g., convolutional neural network (CNN), recurrent neural network (RNN) and multilayer perceptron (MLP). The objective of this paper is not to explore all possible implementations. We found that a straightforward implementation using MLP can already achieve good results. Formally, DPG can be written as:
|
| 57 |
+
|
| 58 |
+
$$
|
| 59 |
+
\mathbf { p } _ { i } = f ( \mathbf { z } _ { i } , \mu ) = \sigma ( \mathbf { w } _ { D } \mathbf { z } _ { i } + \mathbf { b } )
|
| 60 |
+
$$
|
| 61 |
+
|
| 62 |
+
where $\sigma$ is the activation function, and $\mathbf { w } _ { D }$ and $\mathbf { b }$ are the parameters of DPG and denoted by $\mu$
|
| 63 |
+
|
| 64 |
+
For the implementation of solver $S$ , several deep learning networks can be used as well. Again, a MLP is employed in this work. Each layer of the MLP is a perceptron and can be formalized by $o u t p u t = \sigma ( \mathbf { w x } _ { i n p u t } )$ , where $\mathbf { x } _ { i n p u t }$ denotes the input of the particular perceptron. We also call a perceptron a basic unit 1. In general, for each basic unit $k$ of the solver $S$ , we can have a shared portion of the parameters $\theta _ { 0 , k }$ and a generated portion of the parameters $\mathbf { p } _ { i , k }$ , i.e.,
|
| 65 |
+
|
| 66 |
+
$$
|
| 67 |
+
\theta _ { i } ^ { * } = \mathrm { c o m b i n e } ( \theta _ { 0 } , \mathbf { p } _ { i } ) = \{ [ \mathbf { w } _ { i , k } ^ { * } ] \} _ { k = 1 } ^ { K } = \{ [ \theta _ { 0 , k } ; \mathbf { p } _ { i , k } ] \} _ { k = 1 } ^ { K }
|
| 68 |
+
$$
|
| 69 |
+
|
| 70 |
+
where combine $( . )$ is concatenation and $K$ is the number of basic units that the solver has. In our case, $K$ is the number of hidden layers (basic units) of the solver MLP.
|
| 71 |
+
|
| 72 |
+
It is important to note that the above is the most general case. In practice, there is no need to adapt all the basic units in the solver, but only a subset of them. In our experiments (Section 3), we will see that adapting only the final layer of the solver MLP can already achieve good results.
|
| 73 |
+
|
| 74 |
+
However, one may still ask whether the proposed combination method has sufficient capacity to adjust the solver $S$ in general because only part of the parameters are generated. Actually, $\mathbf { p } _ { i k }$ can affect all dimensions of the output of its corresponding basic unit $k$ :
|
| 75 |
+
|
| 76 |
+
$$
|
| 77 |
+
\mathbf { w } _ { i , k } ^ { * } \mathbf { x } _ { i n p u t } = [ \theta _ { 0 , k } ; \mathbf { p } _ { i , k } ] \mathbf { x } _ { i n p u t } = \theta _ { 0 , k } \mathbf { x } _ { i n p u t } ^ { 1 } + \mathbf { p } _ { i , k } \mathbf { x } _ { i n p u t } ^ { 2 }
|
| 78 |
+
$$
|
| 79 |
+
|
| 80 |
+
where $\mathbf { x } _ { i n p u t } ^ { 1 }$ and $\mathbf { x } _ { i n p u t } ^ { 2 }$ are the block vectors of $\mathbf { x } _ { i n p u t }$ . $\mathbf { p } _ { i , k } \mathbf { x } _ { i n p u t } ^ { 2 }$ can be regarded as the bias and can adapt the output vector to any point in the vector space.
|
| 81 |
+
|
| 82 |
+
To train DPG&S, we use cross entropy loss $( \mathcal { L } _ { c e } )$ . The objective function of the solver $S$ including DPG $f ( \mathbf { z } _ { i } , \mu )$ and $\theta _ { 0 }$ for learning each new classification task $T _ { i }$ is defined as:
|
| 83 |
+
|
| 84 |
+
$$
|
| 85 |
+
\begin{array} { r l } { \underset { \mu , \theta _ { 0 } } { \mathrm { m i n i m i z e } } } & { \mathcal { L } _ { c e } ( S ( x _ { i } , \theta _ { i } ^ { * } ) , y _ { i } ) } \\ { \mathrm { s . t . } } & { \displaystyle \sum _ { m = 1 } ^ { M } | | \mathcal { R } ( x _ { m } ^ { \prime } , \theta _ { i } ^ { * } ) - \mathcal { R } ( x _ { m } ^ { \prime } , \theta _ { i - 1 } ^ { * } ) | | < \epsilon _ { r } } \end{array}
|
| 86 |
+
$$
|
| 87 |
+
|
| 88 |
+
where $\mathcal { L } _ { c e }$ is the cross entropy loss, $\mathcal { R } ( \cdot )$ denotes the output of all basic units (which can be any layer or a set of layers2) in solver $S$ , which we will introduce later, and $\theta _ { i } ^ { * }$ is the whole set of parameters of $S \left( \theta _ { i } ^ { * } = \mathrm { c o m b i n e } ( \mathbf { p } _ { \mathbf { i } } , \theta _ { 0 } ) \right)$ representing the adaptation of $S$ . We can see that the generated replayed samples $x _ { m } ^ { \prime }$ are used as constraints to alleviate DPG&S’s forgetting. Specially, we extend the knowledge distillation loss (Hinton et al., 2015) to the general situation. That is, to keep the past learned knowledge, the output of the basic units in the solver should not change much when learning a new task with the help of the generated data. If we do not consider the activation function, the constraints in Eq. 4 can also be written as:
|
| 89 |
+
|
| 90 |
+
$$
|
| 91 |
+
\operatorname* { m i n } \sum _ { m = 1 } ^ { M } \sum _ { k = 1 } ^ { K } | | \mathbf { w } _ { i , k } ^ { * } \mathbf { x } _ { m , k } ^ { \prime } - \mathbf { w } _ { i - 1 , k } ^ { * } \mathbf { x } _ { m , k } ^ { \prime } | |
|
| 92 |
+
$$
|
| 93 |
+
|
| 94 |
+
where $K$ again denotes the number of basic units and $M$ denotes the number of replayed samples. The basic unit with a smaller $k$ is at the relative lower layer of the solver network.3 $\mathbf { x } _ { m , k } ^ { \prime }$ is the input of the $k ^ { t h }$ basic unit and is calculated through forward propagation, except $\mathbf { x } _ { m , 1 } ^ { \prime } = D G _ { D } ( \mathbf { z } _ { m } ^ { s a m p l e } , \theta _ { d } ^ { \prime } )$ which is the initial replayed sample $x _ { m } ^ { \prime }$ generated by DG (before optimizing the current task $T _ { i }$ ). $\mathbf { w } _ { i , k } ^ { * }$ is the combined parameter introduced in Section 2.2.
|
| 95 |
+
|
| 96 |
+
Two questions may be asked about Eqs. 4 and 5. (1) Since the replayed data $x ^ { \prime }$ (denoting all $ { \boldsymbol { { x } } } _ { m } ^ { \prime }$ ) is used in Eqs. 4 and 5, does it play the same role as the original data $x$ from previous tasks? (2) What is the impact of the constraints on learning the new task? We answer the two questions now.
|
| 97 |
+
|
| 98 |
+
Question 1: The answer is positive. Since the purpose of the constraints is to maintain the learned effect of the old data, clearly, using the original old data $x$ in the constraints is better. However, we proved the positive answer to question 1, which is given in Appendix.
|
| 99 |
+
|
| 100 |
+
Question 2: In calculating Eq. 5, if we stack all $\{ \mathbf { x } _ { m , k } ^ { \prime } \} _ { m = 1 } ^ { M }$ (column vectors) into a matrix $\mathbf { X } _ { k } ^ { \prime }$ , Eq. 5 can be regarded as constraining $\mathbf { w } _ { i , k } ^ { * } \mathbf { X } _ { k } ^ { \prime }$ to remain unchanged. If $\mathbf { X } _ { k } ^ { \prime }$ is a row low rank matrix, $\mathbf { w } _ { i , k } ^ { * }$ can be trained to fit the new tasks. Otherwise, especially if $\mathbf { X } _ { k } ^ { \prime }$ is a row full rank matrix, $\mathbf { w } _ { i , k } ^ { * }$ cannot be trained and therefore cannot learn new tasks. However, benefiting from dynamic parameter generation, our approach will not suffer from this problem. That is because $\mathbf { w } _ { i , k } ^ { * }$ is specially generated through DPG to perform well with input $\mathbf { X } _ { k } ^ { \prime }$ . And the new parameters will be generated to fit new tasks while $\mathbf { w } _ { i , k } ^ { * }$ is able to remain unchanged.
|
| 101 |
+
|
| 102 |
+
# 2.3 DATA GENERATOR (DG)
|
| 103 |
+
|
| 104 |
+
As indicated earlier, DG has two functions. First, it compresses the original input data $x _ { i }$ to $\mathbf { z } _ { i }$ using its encoder to reduce the number of dimensions of $x _ { i }$ and consequently reduces the mapping space of DPG to make the generation of the parameters $\mathbf { p } _ { i }$ easier. The compression is formulated by:
|
| 105 |
+
|
| 106 |
+
$$
|
| 107 |
+
\mathbf { z } _ { i } = D G _ { E } ( x _ { i } , \theta _ { e } )
|
| 108 |
+
$$
|
| 109 |
+
|
| 110 |
+
where $D G _ { E }$ is the encoder of DG with parameters $\theta _ { e }$
|
| 111 |
+
|
| 112 |
+
Second, it generates the replayed data for previous tasks to deal with forgetting in solver $S$ and DPG. Note that DG differs from data generators in the existing generative replay (GR) methods (Shin et al., 2017) as GR needs to generate both the replay data $ { \boldsymbol { { x } } } _ { m } ^ { \prime }$ and their labels $y _ { m } ^ { \prime }$ (using the solver learned so far), which can be noisy. DG only generates the data $ { \boldsymbol { { x } } } _ { m } ^ { \prime }$ but not the labels (which are not needed by our approach), and then the labeling errors won’t affect our model PGMA, but will hurt GR.
|
| 113 |
+
|
| 114 |
+
Each replayed sample $ { \boldsymbol { { x } } } _ { m } ^ { \prime }$ is generated by the decoder of DG, called $D G _ { D }$ :
|
| 115 |
+
|
| 116 |
+
$$
|
| 117 |
+
x _ { m } ^ { \prime } = D G _ { D } ( \mathbf { z } _ { m } ^ { s a m p l e } , \theta _ { d } ^ { \prime } )
|
| 118 |
+
$$
|
| 119 |
+
|
| 120 |
+
where $\mathbf { z } _ { m } ^ { s a m p l e }$ is the $m ^ { t h }$ sample sampled from the multivariate normal distribution.4 $\theta _ { d } ^ { \prime }$ is the set of parameters of $D G _ { D }$ before optimizing the current task $T _ { i }$ .
|
| 121 |
+
|
| 122 |
+
DG can be implemented with an auto-encoder, e.g., VAE-like (Variational Auto-Encoder (Kingma & Welling, 2013)) and WAE-like (Wasserstein Auto-Encoder) auto-encoders. We use WAE in DG since it can let different examples get a chance to stay far away from each other, which promotes better reconstruction (Tolstikhin et al., 2017).5 Note that DG also suffers from forgetting, which is dealt with like DPG and also using specially designed losses (see below).
|
| 123 |
+
|
| 124 |
+
To train DG, we use mean square error as the reconstruction loss to enable its replay ability of the past data, and add to it the penalized form of the Wasserstein distance between the distribution of $\mathbf { z } _ { i }$ and multivariate normal distribution to help generate data (Tolstikhin et al., 2017) (together denoted as $\mathcal { L } _ { w a e . }$ ).
|
| 125 |
+
|
| 126 |
+
Note also since we only have one data generator DG, it has the forgetting problem caused by incremental training of new tasks too. To avoid forgetting in DG, we investigated using loss functions to constrain DG to overcome its forgetting as shown in Figure 2. We describe this approach here:
|
| 127 |
+
|
| 128 |
+

|
| 129 |
+
Figure 2: Data Generator training pipeline demonstration.
|
| 130 |
+
|
| 131 |
+
$$
|
| 132 |
+
\begin{array} { l } { \displaystyle \operatorname* { m i n } \sum _ { m = 1 } ^ { M } \big \vert \big \vert \mathbf { z } _ { m } ^ { s a m p l e } - D G _ { E } ( x _ { m } ^ { \prime } , \theta _ { e } ) \big \vert \big \vert } \\ { \displaystyle \operatorname* { m i n } \sum _ { m = 1 } ^ { M } \big \vert \big \vert D G _ { D } \big ( \mathbf { z } _ { m } ^ { s a m p l e } , \theta _ { d } \big ) - x _ { m } ^ { \prime } \big \vert \big \vert } \end{array}
|
| 133 |
+
$$
|
| 134 |
+
|
| 135 |
+
where $x _ { m } ^ { \prime }$ is the replayed data (see Eq. 7), $\theta _ { e }$ and $\theta _ { d }$ are the encoder’s and decoder’s parameters of DG in the process of learning the new task $T _ { i }$ , respectively, and $\mathbf { z } _ { m } ^ { s a m p l e }$ and $M$ have the same meanings as they are in DPG&S. Eq. 8 constrains the consistency of DG’s decoder and encoder over the randomly sampled $\mathbf { z } _ { m } ^ { s a m p l e }$ . Eq. 9 ensures that DG’s decoder can still remember the old data. Using Eqs. 8 and 9, we can maintain DG’s ability to reflect the old data. Overall, the final objective function for DG is composed by $\mathcal { L } _ { w a e }$ , Eq. 8 and 9.
|
| 136 |
+
|
| 137 |
+
# 2.4 THE COMPLETE TRAINING PROCEDURE
|
| 138 |
+
|
| 139 |
+
Finally, we summarize the whole training procedure of PGMA in Algorithm 1, which is selfexplanatory. “//” is followed by comments. The test procedure is straightforward, see Section 2.1.
|
| 140 |
+
|
| 141 |
+
# Algorithm 1 PGMA (Parameter Generation and Model Adaptation) training
|
| 142 |
+
|
| 143 |
+
Input: $\mathbf { T } = \{ T _ { i } \} _ { i = 1 } ^ { N }$ , where $T _ { i } = \{ x _ { i j } , y _ { i j } \}$ Initial: Randomly initialize $f ( \cdot ) , D G , S ;$ ; // Learning the first task for all $n = 0$ , . . . , until convergence do
|
| 144 |
+
5: Sample a mini-batch from $T _ { 1 }$ ; // Training DG Minimize $\mathcal { L } _ { w a e }$ and then update $_ { D G }$ ; // Training DPG and $S$ . $\mathbf { p } _ { n }$ and $S _ { n }$ below // denote a batch of generated parameters
|
| 145 |
+
10: // and adapted solvers, respectively Compute $\mathbf { p } _ { n }$ using Eqs. 1 & 6; // Section 2.2 Construct $S _ { n }$ using $\mathbf { p } _ { n }$ and $\theta _ { 0 }$ ; // Section 2.2 Minimize $\mathcal { L } _ { c e }$ then update $f ( \cdot )$ and $S$ ;
|
| 146 |
+
|
| 147 |
+
end for
|
| 148 |
+
|
| 149 |
+
15: // Learning the subsequent tasks for all $i \ = \ 2$ ; $\textit { i } \leq N$ ; $i + + \mathbf { d o }$ Generate replayed samples $\boldsymbol { x } _ { m } ^ { \prime }$ by $_ { D G }$ ; for all $n = 0$ , . . . , until convergence do Sample a mini-batch from $T _ { i }$ ;
|
| 150 |
+
20: Minimize $\mathcal { L } _ { w a e }$ , Eqs. 8 &9 and then update $_ { D G }$ ; // Section 2.3 Compute ${ \bf p } _ { n }$ using Eqs. 1 & 6; Construct $S _ { n }$ using $\mathbf { p } _ { n }$ and $\theta _ { 0 }$ ; Minimize $\mathcal { L } _ { c e }$ , Eq. 5, and then update $f ( \cdot )$ and $S$ ; // Section 2.2 end for
|
| 151 |
+
|
| 152 |
+
25: end for
|
| 153 |
+
|
| 154 |
+
# 3 EXPERIMENTS
|
| 155 |
+
|
| 156 |
+
We now evaluate the proposed approach PGMA6 and compare it with state-of-the-art baselines using two image datasets and two text datasets.
|
| 157 |
+
|
| 158 |
+
# Datasets
|
| 159 |
+
|
| 160 |
+
• Two image datasets: (1) MNIST: this dataset consists of 70,000 images of handwritten digits from 0 to 9. We use 60,000/3000/7000 images for training/validation/testing respectively. (2) CIFAR-10: this dataset consists of $6 0 , 0 0 0 \ 3 2 \mathrm { x } 3 2$ color images of 10 classes, with 6000 images per class. There are 50,000/3000/7000 images for training/validation/testing respectively.
|
| 161 |
+
|
| 162 |
+
• Two text datasets: (1) DBPedia ontology: this is a crowd-sourced dataset (Lehmann et al., 2015) with 560,000 training samples and 70,000 test samples. Out of the 70,000 test samples, we use 10,000 for validation and 60,000 for test. (2) THUCNews: this dataset consists of 65,000 sentences of 10 classes (Li et al., 2006). We randomly select 50,000/5000/10,000 sentences for training/validation/testing respectively.
|
| 163 |
+
|
| 164 |
+
# Experiment Settings
|
| 165 |
+
|
| 166 |
+
Data Preparation: To simulate sequential learning, we adopt the same two data processing methods as in (Lee et al., 2017), named disjoint and shuffled.
|
| 167 |
+
|
| 168 |
+
• Disjoint: This method divides each dataset into several subsets of classes. Each subset is a task. For example, we divide the MNIST dataset into two tasks (or subsets of classes). The first task consists of digits (classes) $\{ 0 , 1 , 2 , 3 , 4 \}$ and the second task consists of the remaining digits (classes) $\{ 5 , 6 , 7 , 8 , 9 \}$ . The systems learn the two subsets as two tasks in a sequential fashion and regard them together as 10-class classification. In order to consider more tasks in testing, for MNIST, CIFAR-10, and THUCNews, which all have 10 classes, we created two experiment settings of 2 tasks (5 classes per task) and 5 tasks (2 classes per task). For DBPedia, which has 14 classes, we created three experiment settings, 2 tasks (7 classes per task), 3 tasks (5, 5, and 4 classes for the three tasks respectively), and 5 tasks (3, 3, 3, 3, and 2 classes for the 5 tasks respectively).
|
| 169 |
+
|
| 170 |
+
• Shuffled: This method shuffles the input pixels of an image with a fixed random permutation. Two experiment settings were created: 3 tasks and 5 tasks. In both cases, the dataset for the first task is the original dataset. The datasets for the rest of the tasks are constructed through shuffling. Since shuffling of words in a sentence will change the sentence meaning and results in confusion, thus this experiment is not done on text datasets.
|
| 171 |
+
|
| 172 |
+
Baselines: We use three state-of-the-art baselines that are representative of the current approaches: 1) EWC (elastic weight consolidation) (Kirkpatrick et al., 2017); 2) IMM (incremental moment matching) (Lee et al., 2017); 3) GR (generative replay) (Shin et al., 2017). We use the open source code released by the authors or the third party for comparison. We use Adam algorithm to update the parameters and also use Adam as a baseline to show how serious the forgetting problem is.
|
| 173 |
+
|
| 174 |
+
Training Details: For fair comparison, our proposed approach uses the same solver (or classifier) as the baselines. That is, a multilayer perceptron is adopted as the solver/classifier (as the baselines all use this method), which is a 3-layer network (i.e., two basic units with each hidden layer as a unit) followed by a softmax layer. For our approach, the total number of parameters in the solver includes both the generated parameters p and the shared parameters $\theta _ { 0 }$ . Due to the differences among different datasets, we adopt different settings for them, see Table 5 in Appendix for details. All baselines and our approach use the same setting for the same dataset. We use a 3-layer perceptron (with 2 hidden layers) network (we also call it T-net) for DPG and set the size of each hidden layer to 1000. Each T-net can generate 100 parameters at a time. We can parallel several T-nets in the DPG to generate more parameters when needed. The network parameters are updated using the Adam algorithm with a learning rate of 0.001.
|
| 175 |
+
|
| 176 |
+
# Results and Analysis
|
| 177 |
+
|
| 178 |
+
Figure 3 shows the test accuracy plots per 40 training steps of each method for each task as the tasks are sequentially learned. IMM is not shown here because IMM works by combining well trained models of individual tasks to form one joint model for all tasks. Thus, we cannot draw an accuracy curve with increased training steps like others. However, its final results and those of the other systems are given in Tables 1 and 2. Shuffled CIFAR-10 is also not included in the figure because our experiments show that it cannot be learned by CNN. It is also not used in any existing paper. Note that due to space limitations, Figure 3 only plots the results of those settings with only 2 and 3 tasks.
|
| 179 |
+
|
| 180 |
+
From Figure 3, we can make the following observations:
|
| 181 |
+
|
| 182 |
+
(1). The proposed PGMA method consistently outperforms the baselines in overcoming forgetting, by a big margin in most cases.
|
| 183 |
+
|
| 184 |
+
(2). EWC does not perform well for the disjoint setting. GR is better but still poorer than our method.
|
| 185 |
+
Adam’s results show that forgetting is very serious for all datasets and settings.
|
| 186 |
+
|
| 187 |
+
Time efficiency: Due to DPG, our method uses slightly more time than baselines, under $2 5 \%$ for training and under $28 \%$ for testing compared to GR, which is efficient. This is a small price to pay for the major gain in accuracy in dealing with catastrophic forgetting.
|
| 188 |
+
|
| 189 |
+
Memory usage: There is no need for our method to save data, which results in a large memory saving. For more details about time efficiency and memory usage, please see Appendix (Section C).
|
| 190 |
+
|
| 191 |
+
Table 1: Average accuracy over all tasks in a sequence after the tasks have all been learned.
|
| 192 |
+
|
| 193 |
+
<table><tr><td rowspan="2">Model</td><td rowspan="2">shuffled MNIST (3 tasks)</td><td rowspan="2">disjoint MNIST (2 tasks)</td><td rowspan="2">disjoint CIFAR-10 (2 tasks)</td><td rowspan="2">THUCNews (2 tasks)</td><td rowspan="2">DBPedia (2 tasks)</td><td rowspan="2">DBPedia (3 tasks)</td></tr><tr><td></td></tr><tr><td>Adam</td><td>91.46</td><td>48.64</td><td>41.99</td><td>46.78</td><td>47.66</td><td>41.10</td></tr><tr><td>EWC</td><td>96.70</td><td>48.96</td><td>37.75</td><td>45.02</td><td>53.95</td><td>35.89</td></tr><tr><td>GR</td><td>97.57</td><td>89.96</td><td>65.11</td><td>81.55</td><td>88.41</td><td>82.14</td></tr><tr><td>IMM</td><td>97.92</td><td>94.12</td><td>62.98</td><td>80.32</td><td>92.65</td><td>85.31</td></tr><tr><td>OurPGMA</td><td>98.14</td><td>96.53</td><td>69.51</td><td>85.12</td><td>94.70</td><td>88.06</td></tr></table>
|
| 194 |
+
|
| 195 |
+
From Table 1, we can see that our PGMA method is consistently superior to EWC, GR, and IMM on different datasets with 2 or 3 tasks (5 tasks results are given in Table 2). We believe that is because our PGMA model can reduce the effect of the accuracy deterioration problem discussed in Section 1. Adam’s results show that forgetting is very serious as it does not deal with the forgetting problem. EWC’s performance is poor for the disjoint case (a more realistic setting in practice), which is also reported by other researchers (Lee et al., 2017). Appendix has the results for only the last task.
|
| 196 |
+
|
| 197 |
+
Table 2: Average accuracy over 5 tasks in a sequence after the tasks have all been learned.
|
| 198 |
+
|
| 199 |
+
<table><tr><td>Model</td><td>shuffled MNIST</td><td>disjoint MNIST</td><td>DBPedia</td><td>CIFAR-10</td><td>THUCNews</td></tr><tr><td>GR</td><td>94.54</td><td>75.47</td><td>63.71</td><td>31.09</td><td>47.35</td></tr><tr><td>IMM</td><td>96.09</td><td>67.25</td><td>64.04</td><td>32.36</td><td>46.61</td></tr><tr><td>Our PGMA</td><td>96.77</td><td>81.70</td><td>69.68</td><td>40.47</td><td>52.93</td></tr></table>
|
| 200 |
+
|
| 201 |
+
Table 2 shows the results for 5 tasks. EWC and Adam are not included as they performed poorly.
|
| 202 |
+
Again, we observe that our PGMA method is markedly better than the baselines.
|
| 203 |
+
|
| 204 |
+

|
| 205 |
+
Figure 3: Accuracy curves - we test the system’s accuracy per 40 training steps on the test set of each method. Y-axis shows the accuracy of different tasks as the training time (steps) increases. Note that Shuffled CIFAR-10 is not included as CNN cannot learn it directly.
|
| 206 |
+
|
| 207 |
+
# Ablation Study
|
| 208 |
+
|
| 209 |
+
Here we study how the system behaves with less and less parameters in $\theta _ { 0 }$ or more and more parameters replaced by the parameters generated by DPG. We selected the disjoint MNIST 2 tasks setting to conduct the experiment as it is more useful than the shuffled setting and also more difficult.
|
| 210 |
+
|
| 211 |
+
Table 3: Average accuracy with different $\%$ of parameters in solver’s last layer (one basic unit) being replaced by the parameters generated by DPG. Each score followed by a $9 5 \%$ confidence interval.
|
| 212 |
+
|
| 213 |
+
<table><tr><td rowspan="2">Model</td><td rowspan="2">GR</td><td colspan="6">Our PGMA</td></tr><tr><td>0%</td><td>20%</td><td>40%</td><td>60%</td><td>80%</td><td>100%</td></tr><tr><td>Accuracy</td><td>88.71 (±2.64)</td><td>90.96 (±0.69)</td><td>92.44(±1.31)</td><td>93.96(±0.63)</td><td>94.51(±0.87)</td><td>96.07(±0.62)</td><td>96.05(±0.64)</td></tr></table>
|
| 214 |
+
|
| 215 |
+
Table 3 shows the accuracy results (averaged in the same way as in Table 1) when a portion of the parameters in only the last layer of the solver is replaced by the parameters generated by DPG. We observe that the accuracy improves with increased percentages of parameters being replaced.
|
| 216 |
+
|
| 217 |
+
The best accuracy is obtained when $80 \%$ of the parameters in the last layer are replaced through DPG, and the accuracy won’t further improve with more replaced parameters. This observation indicates that replacing a part of parameters in solver to adapt new input tasks is sufficient. The same conclusion can also be made by replacing the parameters in the first hidden layer of the solver (which has 2 hidden layers). We fix the replacing percentage of the last layer to $20 \%$ , and then increase the replacing percentages of the first layer. The best accuracy reaches $9 4 . 3 1 \% ( \pm 0 . 8 4 \% )$ when replacing $40 \%$ parameters of the first layer, which gains only $1 . 8 7 \%$ in accuracy compared with no replacement. This result indicates that it suffices to replace the parameters in the last layer.
|
| 218 |
+
|
| 219 |
+
Table 4 shows the contribution of different components. We can see a significant drop if DPG is removed. The second row gives the performance of our model when only DG and constraints are used. The third row shows the result without using constraints (DG+label(like GR)) but replacing them with the replay method. We can see that constraints work better than predicting labels.
|
| 220 |
+
|
| 221 |
+
Table 4: Empirical evaluation of different components
|
| 222 |
+
|
| 223 |
+
<table><tr><td>Components</td><td>Acc (%)</td></tr><tr><td>DPG+DG+Constraints</td><td>96.07 ± 0.62</td></tr><tr><td>DG+ Constraints</td><td>90.96 ± 0.69</td></tr><tr><td>DG+label (likeGR)</td><td>88.21 ± 2.81</td></tr></table>
|
| 224 |
+
|
| 225 |
+
# 4 RELATED WORK
|
| 226 |
+
|
| 227 |
+
Many approaches have been proposed to deal with catastrophic forgetting (CF), which is one of the challenging problems of neural networks for lifelong learning (Chen & Liu, 2018). EWC (Kirkpatrick et al., 2017) quantifies the importance of weights to previous tasks, and selectively alters the learning rates of weights. Following EWC, Zenke et al. (2017) measured the synapse consolidation strength in an online fashion and used it as regularization. Learning without forgetting (LWF) (Li & Hoiem, 2016) feeds the old network with new training data in new tasks and regards the output as ”pseudolabels”. In Incremental Moment Matching (IMM) (Lee et al., 2017), each trained network on one task is preserved and all networks are merged into one at the end of the sequence of tasks.
|
| 228 |
+
|
| 229 |
+
Above approaches focus on adjusting the network weights. Another main approach is to add some data of past tasks to the new task training to prevent forgetting the past. Gradient Episodic Memory (GEM) (Lopez-Paz et al., 2017) stores a subset of training data for every finished task, and limits the loss function on these so-called ”memories”. Instead of keeping some real data from previous tasks, Generative Replay (GR) (Shin et al., 2017) keeps data generators for previous tasks and learns using a mix of real data of the new tasks and replayed data of previous tasks. Seff et al. (2017) proposed to solve continual generative modeling by combining the ideas of data generation and EWC.
|
| 230 |
+
|
| 231 |
+
Other existing approaches include iCaRL (Rebuffi et al., 2017), Pathnet (Fernando et al., 2017), memory aware synapses (Aljundi et al., 2017), phantom sampling (Venkatesan et al., 2017), active long term memory networks (Furlanello et al., 2016), conceptor-aided backprop (He & Jaeger, 2018), gating networks (Masse et al., 2018; Serra et al., 2018), dynamically expandable networks (DEN) \` (Yoon et al., 2018), progress & compress (Schwarz et al., 2018) (active column is distilled into the knowledge base, taking care to protect any previously acquired skills), and incremental regularized least squares (Camoriano et al., 2017). Most of those works suffer from accuracy deterioration as discussed in Section 1 while some dynamically expanding the network size (e.g., DEN and LWF), which results in a huge and complex model. Our method is different from these existing approaches.
|
| 232 |
+
|
| 233 |
+
Several existing works generate parameters, but they are for different purposes. Denil et al. (2013) trained several different architectures by learning only a small number of weights and predicting the rest. Ha et al. (2016) used a small network to generate the weights for a larger network. Brock et al. (2017) learned an auxiliary HyperNet to generate weights for the main model. Our method uses the generated parameters for model adaptation for continual learning.
|
| 234 |
+
|
| 235 |
+
# 5 CONCLUSION
|
| 236 |
+
|
| 237 |
+
This paper proposed a novel approach PGMA to dealing with catastrophic forgetting. The approach learns to build a model with two sets of parameters. The first set is shared by all tasks learned so far and the second set is dynamically generated to adapt the model (solver) to suit each individual test example. As we discussed in related work, this is different from all existing methods. Experimental results showed that the proposed approach outperformed the existing baseline methods markedly.
|
| 238 |
+
|
| 239 |
+
# ACKNOWLEDGMENTS
|
| 240 |
+
|
| 241 |
+
We thank Zhangming Chan and Shen Gao for helping check the code. This work was supported by the National Key Research and Development Program of China (No. 2017YFC0804001). Bing Liu’s work was partially supported by National Science Foundation (NSF) under grant no. IIS 1838770, by a research contract with Huawei Technologies Co. Ltd., and by a research gift from Tencent Holdings Limited. Rui Yan’s work was supported by the National Science Foundation of China (NSFC No. 61672058; NSFC No. 61876196), CCF-Tencent Open Research Fund and Microsoft Research Asia (MSRA) Collaborative Research Program.
|
| 242 |
+
|
| 243 |
+
# REFERENCES
|
| 244 |
+
|
| 245 |
+
Rahaf Aljundi, Francesca Babiloni, Mohamed Elhoseiny, Marcus Rohrbach, and Tinne Tuytelaars. Memory aware synapses: Learning what (not) to forget. arXiv preprint arXiv:1711.09601, 2017.
|
| 246 |
+
|
| 247 |
+
Andrew Brock, Theodore Lim, James M Ritchie, and Nick Weston. Smash: one-shot model architecture search through hypernetworks. arXiv preprint arXiv:1708.05344, 2017.
|
| 248 |
+
|
| 249 |
+
Raffaello Camoriano, Giulia Pasquale, Carlo Ciliberto, Lorenzo Natale, Lorenzo Rosasco, and Giorgio Metta. Incremental robot learning of new objects with fixed update time. In Robotics and Automation (ICRA), 2017 IEEE International Conference on, pp. 3207–3214. IEEE, 2017.
|
| 250 |
+
|
| 251 |
+
Zhiyuan Chen and Bing Liu. Lifelong machine learning. Morgan & Claypool Publishers, 2018.
|
| 252 |
+
|
| 253 |
+
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.
|
| 254 |
+
|
| 255 |
+
Chrisantha Fernando, Dylan Banarse, Charles Blundell, Yori Zwols, David Ha, Andrei A Rusu, Alexander Pritzel, and Daan Wierstra. Pathnet: Evolution channels gradient descent in super neural networks. arXiv preprint arXiv:1701.08734, 2017.
|
| 256 |
+
|
| 257 |
+
Tommaso Furlanello, Jiaping Zhao, Andrew M Saxe, Laurent Itti, and Bosco S Tjan. Active long term memory networks. arXiv preprint arXiv:1606.02355, 2016.
|
| 258 |
+
|
| 259 |
+
David Ha, Andrew Dai, and Quoc V Le. Hypernetworks. arXiv preprint arXiv:1609.09106, 2016.
|
| 260 |
+
|
| 261 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2016.
|
| 262 |
+
|
| 263 |
+
Xu He and Herbert Jaeger. Overcoming catastrophic interference using conceptor-aided backpropagation. 2018.
|
| 264 |
+
|
| 265 |
+
Geoffrey Hinton, Oriol Vinyals, and Jeff Dean. Distilling the knowledge in a neural network. arXiv preprint arXiv:1503.02531, 2015.
|
| 266 |
+
|
| 267 |
+
Gao Huang, Zhuang Liu, Laurens Van Der Maaten, and Kilian Q Weinberger. Densely connected convolutional networks. In CVPR, volume 1, pp. 3, 2017.
|
| 268 |
+
|
| 269 |
+
Diederik P Kingma and Max Welling. Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114, 2013.
|
| 270 |
+
|
| 271 |
+
James Kirkpatrick, Razvan Pascanu, Neil Rabinowitz, Joel Veness, Guillaume Desjardins, Andrei A Rusu, Kieran Milan, John Quan, Tiago Ramalho, Agnieszka Grabska-Barwinska, et al. Overcoming catastrophic forgetting in neural networks. Proceedings of the national academy of sciences, pp. 201611835, 2017.
|
| 272 |
+
|
| 273 |
+
Sang-Woo Lee, Jin-Hwa Kim, Jaehyun Jun, Jung-Woo Ha, and Byoung-Tak Zhang. Overcoming catastrophic forgetting by incremental moment matching. In Advances in Neural Information Processing Systems, pp. 4652–4662, 2017.
|
| 274 |
+
|
| 275 |
+
Jens Lehmann, Robert Isele, Max Jakob, Anja Jentzsch, Dimitris Kontokostas, Pablo N Mendes, Sebastian Hellmann, Mohamed Morsey, Patrick Van Kleef, Soren Auer, et al. Dbpedia–a large- ¨ scale, multilingual knowledge base extracted from wikipedia. Semantic Web, 6(2):167–195, 2015.
|
| 276 |
+
|
| 277 |
+
Jingyang Li, Maosong Sun, and Xian Zhang. A comparison and semi-quantitative analysis of words and character-bigrams as features in chinese text categorization. In ACL, 2006.
|
| 278 |
+
|
| 279 |
+
Shen Li, Zhe Zhao, Renfen Hu, Wensi Li, Tao Liu, and Xiaoyong Du. Analogical reasoning on chinese morphological and semantic relations. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers), pp. 138–143. Association for Computational Linguistics, 2018. URL http://aclweb.org/anthology/P18-2023.
|
| 280 |
+
|
| 281 |
+
Zhizhong Li and Derek Hoiem. Learning Without Forgetting. ECCV, 9908(1):614–629, 2016.
|
| 282 |
+
|
| 283 |
+
David Lopez-Paz et al. Gradient episodic memory for continual learning. In Advances in Neural Information Processing Systems, pp. 6467–6476, 2017.
|
| 284 |
+
|
| 285 |
+
Nicolas Y Masse, Gregory D Grant, and David J Freedman. Alleviating catastrophic forgetting using context-dependent gating and synaptic stabilization. arXiv preprint arXiv:1802.01569, 2018.
|
| 286 |
+
|
| 287 |
+
Michael McCloskey and Neal J Cohen. Catastrophic interference in connectionist networks: The sequential learning problem. In Psychology of learning and motivation, volume 24, pp. 109–165. Elsevier, 1989.
|
| 288 |
+
|
| 289 |
+
German I Parisi, Ronald Kemker, Jose L Part, Christopher Kanan, and Stefan Wermter. Continual lifelong learning with neural networks: A review. arXiv preprint arXiv:1802.07569, 2018.
|
| 290 |
+
|
| 291 |
+
Jeffrey Pennington, Richard Socher, and Christopher D. Manning. Glove: Global vectors for word representation. In Empirical Methods in Natural Language Processing (EMNLP), pp. 1532–1543, 2014. URL http://www.aclweb.org/anthology/D14-1162.
|
| 292 |
+
|
| 293 |
+
Sylvestre-Alvise Rebuffi, Alexander Kolesnikov, Georg Sperl, and Christoph H Lampert. icarl: Incremental classifier and representation learning. In Proc. CVPR, 2017.
|
| 294 |
+
|
| 295 |
+
Jonathan Schwarz, Jelena Luketina, Wojciech M Czarnecki, Agnieszka Grabska-Barwinska, Yee Whye Teh, Razvan Pascanu, and Raia Hadsell. Progress & compress: A scalable framework for continual learning. arXiv preprint arXiv:1805.06370, 2018.
|
| 296 |
+
|
| 297 |
+
Ari Seff, Alex Beatson, Daniel Suo, and Han Liu. Continual learning in generative adversarial nets. arXiv preprint arXiv:1705.08395, 2017.
|
| 298 |
+
|
| 299 |
+
Joan Serra, D \` ´ıdac Sur´ıs, Marius Miron, and Alexandros Karatzoglou. Overcoming catastrophic forgetting with hard attention to the task. arXiv preprint arXiv:1801.01423, 2018.
|
| 300 |
+
|
| 301 |
+
Hanul Shin, Jung Kwon Lee, Jaehong Kim, and Jiwon Kim. Continual learning with deep generative replay. In Advances in Neural Information Processing Systems, pp. 2990–2999, 2017.
|
| 302 |
+
|
| 303 |
+
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.
|
| 304 |
+
|
| 305 |
+
Ilya Tolstikhin, Olivier Bousquet, Sylvain Gelly, and Bernhard Schoelkopf. Wasserstein auto-encoders. arXiv preprint arXiv:1711.01558, 2017.
|
| 306 |
+
|
| 307 |
+
Ragav Venkatesan, Hemanth Venkateswara, Sethuraman Panchanathan, and Baoxin Li. A strategy for an uncompromising incremental learner. arXiv preprint arXiv:1705.00744, 2017.
|
| 308 |
+
|
| 309 |
+
Wenhui Wang, Nan Yang, Furu Wei, Baobao Chang, and Ming Zhou. Gated self-matching networks for reading comprehension and question answering. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), volume 1, pp. 189–198, 2017.
|
| 310 |
+
|
| 311 |
+
Jaehong Yoon, Eunho Yang, Jeongtae Lee, and Sung Ju Hwang. Lifelong learning with dynamically expandable networks. 2018.
|
| 312 |
+
|
| 313 |
+
Friedemann Zenke, Ben Poole, and Surya Ganguli. Continual learning through synaptic intelligence. arXiv preprint arXiv:1703.04200, 2017.
|
| 314 |
+
|
| 315 |
+
# APPENDIX
|
| 316 |
+
|
| 317 |
+
# A PROOF FOR QUESTION 1
|
| 318 |
+
|
| 319 |
+
Proof: Our objective is to minimize $| | \mathcal { R } ( x , \theta _ { i } ^ { * } ) - \mathcal { R } ( x , \theta _ { i - 1 } ^ { * } ) | |$ . Since $\mathcal { R } ( \cdot )$ is differentiable and its derivative function is bounded (as it uses 1-Lipschitz activation function, e.g., RELU or tanh), $R ( \cdot )$ thus satisfies the Lipschitz condition. After some manipulation, we obtain:
|
| 320 |
+
|
| 321 |
+
$$
|
| 322 |
+
\begin{array} { r l } & { \quad | | \mathcal { R } ( x , \theta _ { i } ^ { * } ) - \mathcal { R } ( x , \theta _ { i - 1 } ^ { * } ) | | } \\ & { = | | \mathcal { R } ( x , \theta _ { i } ^ { * } ) - \mathcal { R } ( x ^ { \prime } , \theta _ { i } ^ { * } ) + \mathcal { R } ( x ^ { \prime } , \theta _ { i } ^ { * } ) - \mathcal { R } ( x ^ { \prime } , \theta _ { i - 1 } ^ { * } ) + \mathcal { R } ( x ^ { \prime } , \theta _ { i - 1 } ^ { * } ) - \mathcal { R } ( x , \theta _ { i - 1 } ^ { * } ) | | } \\ & { \leq | | \mathcal { R } ( x , \theta _ { i } ^ { * } ) - \mathcal { R } ( x ^ { \prime } , \theta _ { i } ^ { * } ) | | + | | \mathcal { R } ( x ^ { \prime } , \theta _ { i } ^ { * } ) - \mathcal { R } ( x ^ { \prime } , \theta _ { i - 1 } ^ { * } ) | | + | | \mathcal { R } ( x ^ { \prime } , \theta _ { i - 1 } ^ { * } ) - \mathcal { R } ( x , \theta _ { i - 1 } ^ { * } ) | | } \\ & { \leq \mathcal { L } _ { 1 } | | ( x - x ^ { \prime } ) | | + | | \mathcal { R } ( x ^ { \prime } , \theta _ { i } ^ { * } ) - \mathcal { R } ( x ^ { \prime } , \theta _ { i - 1 } ^ { * } ) | | + \mathcal { L } _ { 2 } | | ( x - x ^ { \prime } ) | | } \\ & { = | | \mathcal { R } ( x ^ { \prime } , \theta _ { i } ^ { * } ) - \mathcal { R } ( x ^ { \prime } , \theta _ { i - 1 } ^ { * } ) | | + ( \mathcal { L } _ { 1 } + \mathcal { L } _ { 2 } ) | | ( x - x ^ { \prime } ) | | } \end{array}
|
| 323 |
+
$$
|
| 324 |
+
|
| 325 |
+
where the last inference is based on Lipschitz continuity, and $\mathcal { L } _ { 1 }$ and $\mathcal { L } _ { 2 }$ are Lipschitz constants. We can see that if the solver has a small Lipschitz constant or the DG’s reconstruction error is small, minimizing Eq. 4 is consistent with constraining using the original data.
|
| 326 |
+
|
| 327 |
+
# B PARAMETER SETTINGS
|
| 328 |
+
|
| 329 |
+
MNIST: We set the basic unit (hidden layer) size of the 3-layer classifier to 600 and the dropout rate to 0.3. A 3-layer convolutional network (CNN), with $2 ^ { \ast } 2$ convolutions and 64, 128, 256 filters for each layer, is used as DG’s encoder. A deconvolutional network with the symmetric setting as the encoder is used as the decoder in DG. For our model, we use the parameters generated by DPG to replace $33 \%$ of the parameters in the solver’s last hidden layer, and $10 \%$ of the first hidden layer. CIFAR-10: We set the basic unit (hidden layer) size of the 3-layer classifier to 1000 and the dropout rate to 0.5. For our model, we use the parameters generated by DPG to replace $2 5 \%$ parameters of the solver’s last hidden layer, and $10 \%$ of the first hidden layer. Since each image in this dataset contains a complex background and is thus more difficult to classify, we add a 3-layer CNN below the 3-layer MLP classifier to improve the performance. 3-layer CNN has the same setting as the encoder of DG. Due to the complexity of the images in CIFAR-10, the replayed images are usually noisy. Text datasets usually cannot be exactly replayed. To alleviate this problem, we propose to replay the features (e.g. using an additional CNN to extract features) of input data which performs well in the experiment. In that case, the 3-layer CNN added to the classifier plays an important role in feature extraction and it needs to be fixed; if not, the system won’t get a stable input and thus will cause forgetting. Note that the feature extractor can be pre-trained using a large dataset (e.g. ImageNet for images and wikipedia for text.) and thus can provide sufficient features. Text Datasets: We set the basic unit (hidden layer) size of the 2-layer classifier to 1000 and dropout rate to 0.5. For our model, we use the parameters generated by DPG to replace $2 5 \%$ parameters of the solver’s last hidden layer, and $10 \%$ of the first hidden layer. To get better results on text, we use pre-trained embeddings (Pennington et al., 2014; Li et al., 2018) for all experiments.
|
| 330 |
+
|
| 331 |
+
# C MORE EXPERIMENTAL RESULTS
|
| 332 |
+
|
| 333 |
+
# Memory
|
| 334 |
+
|
| 335 |
+
• The memory used by our model is around 151.49MB, by IMM is around 38.96MB \* task num (task num will be 3 if there are three tasks), and by GR is around 70.13MB. The memory required by all these systems are very small as compared to the total memory available in a modern computer.
|
| 336 |
+
|
| 337 |
+
• Our data generator DG has around 1,460,361 parameters (around 44.57MB, calculated by 32 Byte per parameter), which is fixed. Saving data would need much more memory. Taking the MNIST dataset as an example. It has 60,000 training samples and the size of each sample is $2 8 ^ { \ast } 2 8$ . The memory needed to store the data is $2 8 ^ { * } 2 8 ^ { * } 6 0 , 0 0 0 = 4 7 , 0 4 0 , 0 0 0$ (around 358.89MB, calculated by 8 Byte per unit). And this number multiplies when the number of tasks increases.
|
| 338 |
+
|
| 339 |
+
# Training and Test Time
|
| 340 |
+
|
| 341 |
+
Taking the CIFAR10 dataset as an example (others are similar), the total time used by our model and baselines are shown in Table 6. We can see that our method needs a bit more time than baselines but not too much (under $2 5 \%$ for training and under $28 \%$ for testing compared with GR). This is a small price to pay for the major gain in accuracy and in dealing with the catastrophic forgetting problem.
|
| 342 |
+
|
| 343 |
+
# Accuracy on the Last Task
|
| 344 |
+
|
| 345 |
+
Table 6: Empirical evaluation of different components
|
| 346 |
+
|
| 347 |
+
<table><tr><td>Time</td><td>EWC</td><td>IMM</td><td>GR</td><td>Our PGMA</td></tr><tr><td>Training Time/per epoch (s)</td><td>2.460</td><td>4.930</td><td>8.673</td><td>10.836</td></tr><tr><td>Test time(s)</td><td>0.703</td><td>0.707</td><td>0.728</td><td>0.930</td></tr></table>
|
| 348 |
+
|
| 349 |
+
ADAM gets the best accuracy on the last task as Adam optimizer learns the new task only and does not need to worry about the forgetting problem on the old tasks. For the last task, our PGMA system obtained comparable accuracy on average with the baselines designed for overcoming forgetting. However, we are much better at preventing forgetting of old tasks. The results for the last task are given in Table 7. Note that although EWC is quite good at the last task but it suffers seriously from forgetting as shown in Table 1 or Figure 3, which is consistent with results reported in other papers.
|
| 350 |
+
|
| 351 |
+
Table 7: Accuracy of the last task after all tasks have been learned.
|
| 352 |
+
|
| 353 |
+
<table><tr><td rowspan="2">Model</td><td>shuffled MNIST</td><td>shuffled MNIST</td><td>disjoint MNIST</td><td>disjoint MNIST</td><td>disjoint CIFAR-10</td><td>THUCNews</td><td>DBPedia</td><td>DBPedia</td><td>DBPedia</td></tr><tr><td>3 tasks</td><td>5 tasks</td><td>2 tasks</td><td>5 tasks</td><td>2 tasks</td><td>2 tasks</td><td>2 tasks</td><td>3 tasks</td><td>5 tasks</td></tr><tr><td>Adam</td><td>98.30</td><td>98.27</td><td>97.28</td><td>95.78</td><td>83.98</td><td>93.56</td><td>95.30</td><td>97.52</td><td>98.45</td></tr><tr><td>EWC</td><td>98.12</td><td>97.99</td><td>96.97</td><td>95.61</td><td>75.38</td><td>86.72</td><td>96.11</td><td>96.55</td><td>93.32</td></tr><tr><td>GR</td><td>98.10</td><td>97.18</td><td>96.34</td><td>92.31</td><td>77.82</td><td>87.20</td><td>93.18</td><td>89.40</td><td>98.76</td></tr><tr><td>IMM</td><td>97.06</td><td>95.36</td><td>95.07</td><td>86.94</td><td>48.74</td><td>65.08</td><td>93.84</td><td>85.72</td><td>70.19</td></tr><tr><td>Our PGMA</td><td>98.15</td><td>97.26</td><td>96.22</td><td>93.47</td><td>73.75</td><td>86.36</td><td>96.01</td><td>91.14</td><td>82.99</td></tr></table>
|
md/train/yWkP7JuHX1/yWkP7JuHX1.md
ADDED
|
@@ -0,0 +1,430 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# IMAGE GANS MEET DIFFERENTIABLE RENDERING FOR INVERSE GRAPHICS AND INTERPRETABLE 3D NEURAL RENDERING
|
| 2 |
+
|
| 3 |
+
Yuxuan Zhang1,4∗ Wenzheng Chen $^ { 1 , 2 , 3 * }$ Huan Ling1,2,3
|
| 4 |
+
|
| 5 |
+
Jun Gao1,2,3 Yinan Zhang5 Antonio Torralba6 Sanja Fidler1,2,3
|
| 6 |
+
|
| 7 |
+
NVIDIA1 University of Toronto2 Vector Institute3 University of Waterloo 4 Stanford University5 MIT CSAIL6
|
| 8 |
+
|
| 9 |
+
{alezhang, wenzchen, huling, jung, sfidler}@nvidia.com, yinanzy@stanford.edu, torralba@mit.edu
|
| 10 |
+
|
| 11 |
+
# ABSTRACT
|
| 12 |
+
|
| 13 |
+
Differentiable rendering has paved the way to training neural networks to perform “inverse graphics” tasks such as predicting 3D geometry from monocular photographs. To train high performing models, most of the current approaches rely on multi-view imagery which are not readily available in practice. Recent Generative Adversarial Networks (GANs) that synthesize images, in contrast, seem to acquire 3D knowledge implicitly during training: object viewpoints can be manipulated by simply manipulating the latent codes. However, these latent codes often lack further physical interpretation and thus GANs cannot easily be inverted to perform explicit 3D reasoning. In this paper, we aim to extract and disentangle 3D knowledge learned by generative models by utilizing differentiable renderers. Key to our approach is to exploit GANs as a multi-view data generator to train an inverse graphics network using an off-the-shelf differentiable renderer, and the trained inverse graphics network as a teacher to disentangle the GAN’s latent code into interpretable 3D properties. The entire architecture is trained iteratively using cycle consistency losses. We show that our approach significantly outperforms state-of-the-art inverse graphics networks trained on existing datasets, both quantitatively and via user studies. We further showcase the disentangled GAN as a controllable 3D “neural renderer”, complementing traditional graphics renderers.
|
| 14 |
+
|
| 15 |
+
# 1 INTRODUCTION
|
| 16 |
+
|
| 17 |
+
The ability to infer 3D properties such as geometry, texture, material, and light from photographs is key in many domains such as AR/VR, robotics, architecture, and computer vision. Interest in this problem has been explosive, particularly in the past few years, as evidenced by a large body of published works and several released 3D libraries (TensorflowGraphics by Valentin et al. (2019), Kaolin by J. et al. (2019), PyTorch3D by Ravi et al. (2020)).
|
| 18 |
+
|
| 19 |
+
The process of going from images to 3D is often called “inverse graphics”, since the problem is inverse to the process of rendering in graphics in which a 3D scene is projected onto an image by taking into account the geometry and material properties of objects, and light sources present in the scene. Most work on inverse graphics assumes that 3D labels are available during training (Wang et al., 2018; Mescheder et al., 2019; Groueix et al., 2018; Wang et al., 2019; Choy et al., 2016), and trains a neural network to predict these labels. To ensure high quality 3D ground-truth, synthetic datasets such as ShapeNet (Chang et al., 2015) are typically used. However, models trained on synthetic datasets often struggle on real photographs due to the domain gap with synthetic imagery.
|
| 20 |
+
|
| 21 |
+
To circumvent these issues, recent work has explored an alternative way to train inverse graphics networks that sidesteps the need for 3D ground-truth during training. The main idea is to make graphics renderers differentiable which allows one to infer 3D properties directly from images using gradient based optimization, Kato et al. (2018); Liu et al. (2019b); Li et al. (2018); Chen et al. (2019). These methods employ a neural network to predict geometry, texture and light from images, by minimizing the difference between the input image with the image rendered from these properties. While impressive results have been obtained in Liu et al. (2019b); Sitzmann et al. (2019); Liu et al. (2019a); Henderson & Ferrari (2018); Chen et al. (2019); Yao et al. (2018); Kanazawa et al. (2018), most of these works still require some form of implicit 3D supervision such as multi-view images of the same object with known cameras. Thus, most results have been reported on the synthetic ShapeNet dataset, or the large-scale CUB (Welinder et al., 2010) bird dataset annotated with keypoints from which cameras can be accurately computed using structure-from-motion techniques.
|
| 22 |
+
|
| 23 |
+

|
| 24 |
+
Figure 1: We employ two “renderers”: a GAN (StyleGAN in our work), and a differentiable graphics renderer (DIB-R in our work). We exploit StyleGAN as a synthetic data generator, and we label this data extremely efficiently. This “dataset” is used to train an inverse graphics network that predicts 3D properties from images. We use this network to disentangle StyleGAN’s latent code through a carefully designed mapping network.
|
| 25 |
+
|
| 26 |
+
On the other hand, generative models of images appear to learn 3D information implicitly, where several works have shown that manipulating the latent code can produce images of the same scene from a different viewpoint (Karras et al., 2019a). However, the learned latent space typically lacks physical interpretation and is usually not disentangled, where properties such as the 3D shape and color of the object often cannot be manipulated independently.
|
| 27 |
+
|
| 28 |
+
In this paper, we aim to extract and disentangle 3D knowledge learned by generative models by utilizing differentiable graphics renderers. We exploit a GAN, specifically StyleGAN (Karras et al., 2019a), as a generator of multi-view imagery to train an inverse graphics neural network using a differentiable renderer. In turn, we use the inverse graphics network to inform StyleGAN about the image formation process through the knowledge from graphics, effectively disentangling the GAN’s latent space. We connect StyleGAN and the inverse graphics network into a single architecture which we iteratively train using cycle-consistency losses. We demonstrate our approach to significantly outperform inverse graphics networks on existing datasets, and showcase controllable 3D generation and manipulation of imagery using the disentangled generative model.
|
| 29 |
+
|
| 30 |
+
# 2 RELATED WORK
|
| 31 |
+
|
| 32 |
+
3D from 2D: Reconstructing 3D objects from 2D images is one of the mainstream problems in 3D computer vision. We here focus our review to single-image 3D reconstruction which is the domain of our work. Most of the existing approaches train neural networks to predict 3D shapes from images by utilizing 3D labels during training, Wang et al. (2018); Mescheder et al. (2019); Choy et al. (2016); Park et al. (2019). However, the need for 3D training data limits these methods to the use of synthetic datasets. When tested on real imagery there is a noticeable performance gap.
|
| 33 |
+
|
| 34 |
+
Newer works propose to differentiate through the traditional rendering process in the training loop of neural networks, Loper & Black (2014); Kato et al. (2018); Liu et al. (2019b); Chen et al. (2019); Petersen et al. (2019); Gao et al. (2020). Differentiable renderers allow one to infer 3D from 2D images without requiring 3D ground-truth. However, in order to make these methods work in practice, several additional losses are utilized in learning, such as the multi-view consistency loss whereby the cameras are assumed known. Impressive reconstruction results have been obtained on the synthetic ShapeNet dataset. While CMR by Kanazawa et al. (2018) and DIB-R by Chen et al. (2019) show real-image 3D reconstructions on CUB and Pascal3D (Xiang et al., 2014) datasets, they rely on manually annotated keypoints, while still failing to produce accurate results.
|
| 35 |
+
|
| 36 |
+
A few recent works, Wu et al. (2020); Li et al. (2020); Goel et al. (2020); Kato & Harada (2019), explore 3D reconstruction from 2D images in a completely unsupervised fashion. They recover both 3D shapes and camera viewpoints from 2D images by minimizing the difference between original and re-projected images with additional unsupervised constraints, e.g., semantic information (Li et al. (2020)), symmetry (Wu et al. (2020)), GAN loss (Kato & Harada (2019)) or viewpoint distribution (Goel et al. (2020)). Their reconstruction is typically limited to 2.5D (Wu et al. (2020)), and produces lower quality results than when additional supervision is used (Goel et al. (2020); Li et al. (2020); Kato & Harada (2019)). In contrast, we utilize GANs to generate multi-view realistic datasets that can be annotated extremely efficiently, which leads to accurate 3D results. Furthermore, our model achieves disentanglement in GANs and turns them into interpretable 3D neural renderers.
|
| 37 |
+
|
| 38 |
+

|
| 39 |
+
Figure 2: We show examples of cars (first two rows) synthesized in chosen viewpoints (columns). To get these, we fix the latent code $\boldsymbol { w _ { v } ^ { * } }$ that controls the viewpoint (one code per column) and randomly sample the remaining dimensions of (Style)GAN’s latent code (to get rows). Notice how well aligned the two cars are in each column. In the third row we show the same approach applied to horse and bird StyleGAN.
|
| 40 |
+
|
| 41 |
+
Neural Rendering with GANs: GANs (Goodfellow et al., 2014; Karras et al., 2019a) can be regarded as neural renderers, as they take a latent code as input and “render” an image. However, the latent code is sampled from a predefined prior and lacks interpretability. Several works generate images with conditions: a semantic mask (Zhu et al., 2017), scene layout Karacan et al. (2016), or a caption (Reed et al., 2016), and manipulate the generated images by modifying the input condition. Despite tremendous progress in this direction, there is little work on generating images through an interpretable 3D physics process. Dosovitskiy et al. (2016) synthesizes images conditioned on object style, viewpoint, and color. Most relevant work to ours is Zhu et al. (2018), which utilizes a learnt 3D geometry prior and generates images with a given viewpoint and texture code. We differ in three important ways. First, we do not require a 3D dataset to train the 3D prior. Second, the texture in our model has 3D physical meaning, while Zhu et al. (2018) still samples from a prior. We further control background while Zhu et al. (2018) synthesizes objects onto white background.
|
| 42 |
+
|
| 43 |
+
Disentangling GANs: Learning disentangled representations has been widely explored, Lee et al. (2020); Lin et al. (2019); Perarnau et al. (2016). Representative work is InfoGAN Chen et al. (2016), which tries to maximize the mutual information between the prior and the generated image distribution. However, the disentangled code often still lacks physical interpretability. Tewari et al. (2020) transfers face rigging information from an existing model to control face attribute disentanglement in the StyleGAN latent space. Shen et al. (2020) aims to find the latent space vectors that correspond to meaningful edits, while Hark ¨ onen et al. (2020) exploits PCA to disentangle the ¨ latent space. Parallel to our work, Zhang et al. (2021); Li et al. (2021) attempt to interpret the semantic meaning of StyleGAN latent space. In our work, we disentangle the latent space with knowledge from graphics.
|
| 44 |
+
|
| 45 |
+
# 3 OUR APPROACH
|
| 46 |
+
|
| 47 |
+
We start by providing an overview of our approach (Fig. 1), and describe the individual components in more detail in the following sections. Our approach marries two types of renderers: a GANbased neural “renderer” and a differentiable graphics renderer. Specifically, we leverage the fact that the recent state-of-the-art GAN architecture StyleGAN by Karras et al. (2019a;b) learns to produce highly realistic images of objects, and allows for a reliable control over the camera. We manually select a few camera views with a rough viewpoint annotation, and use StyleGAN to generate a large number of examples per view, which we explain in Sec. 3.1. In Sec. 3.2, we exploit this dataset to train an inverse graphics network utilizing the state-of-the-art differentiable renderer, DIBR by Chen et al. (2019) in our work, with a small modification that allows it to deal with noisy cameras during training. In Sec. 3.3, we employ the trained inverse graphics network to disentangle StyleGAN’s latent code and turn StyleGAN into a 3D neural renderer, allowing for control over explicit 3D properties. We fine-tune the entire architecture, leading to significantly improved results.
|
| 48 |
+
|
| 49 |
+
# 3.1 STYLEGAN AS SYNTHETIC DATA GENERATOR
|
| 50 |
+
|
| 51 |
+
We first aim to utilize StyleGAN to generate multi-view imagery. StyleGAN is a 16 layers neural network that maps a latent code $z \in Z$ drawn from a normal distribution into a realistic image. The code $z$ is first mapped to an intermediate latent code $w \in W$ which is transformed to $w ^ { * } =$ $( w _ { 1 } ^ { * } , w _ { 2 } ^ { * } , . . . , w _ { 1 6 } ^ { * } ) \in W ^ { * }$ through 16 learned affine transformations. We call $W ^ { * }$ the transformed latent space to differentiate it from the intermediate latent space $W$ . Transformed latent codes $w ^ { * }$ are then injected as the style information to the StyleGAN Synthesis network.
|
| 52 |
+
|
| 53 |
+
Different layers control different image attributes. As observed in Karras et al. (2019a), styles in early layers adjust the camera viewpoint while styles in the intermediate and higher layers influence shape, texture and background. We provide a careful analysis of all layers in Appendix. We empirically find that the latent code $w _ { v } ^ { \ast } : = ( w _ { 1 } ^ { \ast } , w _ { 2 } ^ { \ast } , w _ { 3 } ^ { \ast } , w _ { 4 } ^ { \ast } )$ in the first 4 layers controls camera viewpoints. That is, if we sample a new code $w _ { v } ^ { * }$ but keep the remaining dimensions of $w ^ { * }$ fixed (which we call the conten code), we generate images of the same object depicted in a different viewpoint. Examples are shown in Fig. 2.
|
| 54 |
+
|
| 55 |
+
We further observe that a sampled code $w _ { v } ^ { * }$ in fact represents a fixed camera viewpoint. That is, if we keep $w _ { v } ^ { * }$ fixed but sample the remaining dimensions of $w ^ { * }$ , StyleGAN produces imagery of different objects in the same camera viewpoint. This is shown in columns in Fig. 2. Notice how aligned the objects are in each of the viewpoints. This makes StyleGAN a multi-view data generator!
|
| 56 |
+
|
| 57 |
+
“StyleGAN” multi-view dataset: We manually select several views, which cover all the common viewpoints of an object ranging from 0-360 in azimuth and roughly 0-30 in elevation. We pay attention to choosing viewpoints in which the objects look most consistent. Since inverse graphics works require camera pose information, we annotate the chosen viewpoint codes with a rough absolute camera pose. To be specific, we classify each viewpoint code into one of 12 azimuth angles, uniformly sampled along $3 6 0 \mathrm { d e g }$ . We assign each code a fixed elevation $( 0 ^ { \circ } )$ and camera distance. These camera poses provide a very coarse annotation of the actual pose – the annotation serves as the initialization of the camera which we will optimize during training. This allows us to annotate all views (and thus the entire dataset) in only 1 minute – making annotation effort neglible. For each viewpoint, we sample a large number of content codes to synthesize different objects in these views. Fig. 2 shows 2 cars, and a horse and a bird. Appendix provides more examples.
|
| 58 |
+
|
| 59 |
+
Since DIB-R also utilizes segmentation masks during training, we further apply MaskRCNN by He et al. (2017) to get instance segmentation in our generated dataset. As StyleGAN sometimes generates unrealistic images or images with multiple objects, we filter out “bad” images which have more than one instance, or small masks (less than $10 \%$ of the whole image area).
|
| 60 |
+
|
| 61 |
+
# 3.2 TRAINING AN INVERSE GRAPHICS NEURAL NETWORK
|
| 62 |
+
|
| 63 |
+
Following CMR by Kanazawa et al. (2018), and DIB-R by Chen et al. (2019), we aim to train a 3D prediction network $f$ , parameterized by $\theta$ , to infer 3D shapes (represented as meshes) along with textures from images. Let $I _ { V }$ denote an image in viewpoint $V$ from our StyleGAN dataset, and $M$ its corresponding object mask. The inverse graphics network makes a prediction as follows: $\{ S , T \} =$ $f _ { \theta } ( I _ { V } )$ , where $S$ denotes the predicted shape, and $T$ a texture map. Shape $S$ is deformed from a sphere as in Chen et al. (2019). While DIB-R also supports prediction of lighting, we empirically found its performance is weak for realistic imagery and we thus omit lighting estimation in our work.
|
| 64 |
+
|
| 65 |
+
To train the network, we adopt DIB-R as the differentiable graphics renderer that takes $\{ S , T \}$ and $V$ as input and produces a rendered image $I _ { V } ^ { \prime } = r ( S , T , V )$ along with a rendered mask $M ^ { \prime }$ . Following DIB-R, the loss function then takes the following form:
|
| 66 |
+
|
| 67 |
+
$$
|
| 68 |
+
\begin{array} { r l } & { L ( I , S , T , V ; \theta ) = \lambda _ { \mathrm { c o l } } L _ { \mathrm { c o l } } ( I , I ^ { \prime } ) + \lambda _ { \mathrm { p e r c p t } } L _ { \mathrm { p e c e p t } } ( I , I ^ { \prime } ) + L _ { \mathrm { I O U } } ( M , M ^ { \prime } ) } \\ & { \phantom { I I } + \lambda _ { \mathrm { s m } } L _ { \mathrm { s m } } ( S ) + \lambda _ { \mathrm { l a p } } L _ { \mathrm { l a p } } ( S ) + \lambda _ { \mathrm { m o v } } L _ { \mathrm { m o v } } ( S ) } \end{array}
|
| 69 |
+
$$
|
| 70 |
+
|
| 71 |
+
Here, $L _ { \mathrm { c o l } }$ is the standard $L _ { 1 }$ image reconstruction loss defined in the RGB color space while $L _ { \mathrm { p e r c p t } }$ is the perceptual loss that helps the predicted texture look more realistic. Note that rendered images do not have background, so $L _ { \mathrm { c o l } }$ and $L _ { \mathrm { p e r c e p t } }$ are calculated by utilizing the mask. $L _ { \mathrm { I O U } }$ computes the intersection-over-union between the ground-truth mask and the rendered mask. Regularization losses such as the Laplacian loss $L _ { \mathrm { l a p } }$ and flatten loss $L _ { \mathrm { s m } }$ are commonly used to ensure that the shape is well behaved. Finally, $L _ { \mathrm { m o v } }$ regularizes the shape deformation to be uniform and small.
|
| 72 |
+
|
| 73 |
+
Since we also have access to multi-view images for each object we also include a multi-view consistency loss. In particular, our loss per object $k$ is:
|
| 74 |
+
|
| 75 |
+
$$
|
| 76 |
+
\mathcal { L } _ { k } ( \boldsymbol { \theta } ) = \sum _ { i , j , i \neq j } \left( L ( I _ { V _ { i } ^ { k } } , S _ { k } , T _ { k } , V _ { i } ^ { k } ; \boldsymbol { \theta } ) + L ( I _ { V _ { j } ^ { k } } , S _ { k } , T _ { k } , V _ { j } ^ { k } ; \boldsymbol { \theta } ) \right)
|
| 77 |
+
$$
|
| 78 |
+
|
| 79 |
+

|
| 80 |
+
Figure 3: A mapping network maps camera, shape, texture and background into a disentangled code that is passed to StyleGAN for “rendering”. We refer to this network as StyleGAN-R.
|
| 81 |
+
|
| 82 |
+
While more views provide more constraints, empirically, two views have been proven sufficient. We randomly sample view pairs $( i , j )$ for efficiency.
|
| 83 |
+
|
| 84 |
+
We use the above loss functions to jointly train the neural network $f$ and optimize viewpoint cameras $V$ (which were fixed in Chen et al. (2019)). We assume that different images generated from the same $w _ { v } ^ { * }$ correspond to the same viewpoint $V$ . Optimizing the camera jointly with the weights of the network allows us to effectively deal with noisy initial camera annotations.
|
| 85 |
+
|
| 86 |
+
# 3.3 DISENTANGLING STYLEGAN WITH THE INVERSE GRAPHICS MODEL
|
| 87 |
+
|
| 88 |
+
The inverse graphics model allows us to infer a 3D mesh and texture from a given image. We now utilize these 3D properties to disentangle StyleGAN’s latent space, and turn StyleGAN into a fully controllable 3D neural renderer, which we refer to as StyleGAN-R. Note that StyleGAN in fact synthesizes more than just an object, it also produces the background, i.e., the entire scene. Ideally we want control over the background as well, allowing the neural renderer to render 3D objects into desired scenes. To get the background from a given image, we simply mask out the object.
|
| 89 |
+
|
| 90 |
+
We propose to learn a mapping network to map the viewpoint, shape (mesh), texture and background into the StyleGAN’s latent code. Since StyleGAN may not be completely disentangled, we further fine-tune the entire StyleGAN model while keeping the inverse graphics network fixed.
|
| 91 |
+
|
| 92 |
+
Mapping Network: Our mapping network, visualized in Figure 3, maps the viewpoints to first 4 layers and maps the shape, texture and background to the last 12 layers of $W ^ { * }$ . For simplicity, we denote the first 4 layers as $W _ { V } ^ { * }$ and the last 12 layers as $W _ { S T B } ^ { * }$ , where $W _ { V } ^ { * } \in \mathbb { R } ^ { 2 0 \dot { 4 } 8 }$ and $W _ { S T B } ^ { * } \in \mathbb { R } ^ { 3 0 0 8 }$ V. Specifically, the mapping network $g _ { v }$ ST Bfor viewpoint $V$ and $g _ { s }$ V for shape $S$ are separate MLPs while $g _ { t }$ for texture $T$ and $g _ { b }$ for background $B$ are CNN layers:
|
| 93 |
+
|
| 94 |
+
$$
|
| 95 |
+
\mathbf { z } ^ { \mathrm { v i e w } } = g _ { v } ( V ; \theta _ { v } ) , \ \mathbf { z } ^ { \mathrm { s h a p e } } = g _ { s } ( S ; \theta _ { s } ) , \mathbf { z } ^ { \mathrm { t x t } } = g _ { t } ( T ; \theta _ { t } ) , \ \mathbf { z } ^ { \mathrm { b c k } } = g _ { b } ( B ; \theta _ { b } ) ,
|
| 96 |
+
$$
|
| 97 |
+
|
| 98 |
+
where $\mathbf { z } ^ { \mathrm { v i e w } } \in \mathbb { R } ^ { 2 0 4 8 } , \mathbf { z } ^ { \mathrm { s h a p e } } , \mathbf { z } ^ { \mathrm { t x t } } , \mathbf { z } ^ { \mathrm { b c k } } \in \mathbb { R } ^ { 3 0 0 8 }$ and $\theta _ { v } , \theta _ { s } , \theta _ { t } , \theta _ { b }$ are network parameters. We softly combine the shape, texture and background codes into the final latent code as follows:
|
| 99 |
+
|
| 100 |
+
$$
|
| 101 |
+
\begin{array} { c c l } { \tilde { w } ^ { m t b } } & { = } & { { \bf s } ^ { \mathrm { m } } \odot { \bf z } ^ { \mathrm { s h a p e } } + { \bf s } ^ { \mathrm { t } } \odot { \bf z } ^ { \mathrm { t x t } } + { \bf s } ^ { \mathrm { b } } \odot { \bf z } ^ { \mathrm { b c k } } , } \end{array}
|
| 102 |
+
$$
|
| 103 |
+
|
| 104 |
+
where $\odot$ denotes element-wise product, and $\mathbf { s } ^ { \mathrm { m } } , \mathbf { s } ^ { \mathrm { t } } , \mathbf { s } ^ { \mathrm { b } } \in \mathbb { R } ^ { 3 0 0 8 }$ are shared across all the samples. To achieve disentanglement, we want each dimension of the final code to be explained by only one property (shape, texture or background). We thus normalize each dimension of s using softmax.
|
| 105 |
+
|
| 106 |
+
In practice, we found that mapping $V$ to a high dimensional code is challenging since our dataset only contains a limited number of views, and $V$ is limited to azimuth, elevation and scale. We thus map $V$ to the subset of $W _ { V } ^ { * }$ , where we empirically choose 144 of the 2048 dimensions with the highest correlation with the annotated viewpoints. Thus, $\mathbf { z } ^ { \mathrm { v i e w } } \in \mathbb { R } ^ { 1 4 4 }$ in our case.
|
| 107 |
+
|
| 108 |
+
Training Scheme: We train the mapping network and fine-tune StyleGAN in two separate stages. We first freeze StyleGAN’s weights and train the mapping network only. This warms up the mapping network to output reasonable latent codes for StyleGAN. We then fine-tune both StyleGAN and the mapping network to better disentangle different attributes. We provide details next.
|
| 109 |
+
|
| 110 |
+
In the warm up stage, we sample viewpoint codes $w _ { v } ^ { * }$ among the chosen viewpoints, and sample the remaining dimensions of $w ^ { * } \in W ^ { * }$ . We try to minimize the $L _ { 2 }$ difference between the mapped code $\tilde { w }$ and StyleGAN’s code $w ^ { * }$ . To encourage the disentanglement in the latent space, we penalize the entropy of each dimension $i$ of s. Our overall loss function for our mapping network is:
|
| 111 |
+
|
| 112 |
+
$$
|
| 113 |
+
L _ { \mathrm { m a p n e t } } ( \theta _ { v } , \theta _ { s } , \theta _ { t } , \theta _ { v } ) = | | \tilde { w } - w ^ { * } | | _ { 2 } - \sum _ { i } \sum _ { k \in \{ m , t , b \} } \mathbf { s } _ { i } ^ { k } \log ( \mathbf { s } _ { i } ^ { k } ) .
|
| 114 |
+
$$
|
| 115 |
+
|
| 116 |
+
By training the mapping network, we find that view, shape and texture can be disentangled in the original StyleGAN model but the background remains entangled. We thus fine-tune the model to get a better disentanglement. To fine-tune the StyleGAN network we incorporate a cycle consistency loss. In particular, by feeding a sampled shape, texture and background to StyleGAN we obtain a synthesized image. We encourage consistency between the original sampled properties and the shape, texture and background predicted from the StyleGAN-synthesized image via the inverse graphics network. We further feed the same background $B$ with two different $\{ S , T \}$ pairs to generate two images $I _ { 1 }$ and $I _ { 2 }$ . We then encourage the re-synthesized backgrounds $\bar { B _ { 1 } } ^ { \bar { } }$ and ${ \bar { B _ { 2 } } }$ to be similar. This loss tries to disentangle the background from the foreground object. During training, we find that imposing the consistency loss on $B$ in image space results in blurry images, thus we constrain it in the code space. Our fine-tuning loss takes the following form:
|
| 117 |
+
|
| 118 |
+

|
| 119 |
+
Figure 4: 3D Reconstruction Results: Given input images (1st column), we predict 3D shape, texture, and render them into the same viewpoint (2nd column). We also show renderings in 3 other views in remaining columns to showcase 3D quality. Our model is able to reconstruct cars with various shapes, textures and viewpoints. We also show the same approach on harder (articulated) objects, i.e., bird and horse.
|
| 120 |
+
|
| 121 |
+
$$
|
| 122 |
+
L _ { \mathrm { s t y l e g a n } } ( \theta _ { \mathrm { g a n } } ) = | | S - \bar { S } | | _ { 2 } + | | T - \bar { T } | | _ { 2 } + | | g _ { b } ( B ) - g _ { b } ( \bar { B } ) | | _ { 2 } + | | g _ { b } ( \bar { B } _ { 1 } ) - g _ { b } ( \bar { B } _ { 2 } ) | | _ { 2 }
|
| 123 |
+
$$
|
| 124 |
+
|
| 125 |
+
# 4 EXPERIMENTS
|
| 126 |
+
|
| 127 |
+
In this section, we showcase our approach on inverse graphics tasks (3D image reconstruction), as well as on the task of 3D neural rendering and 3D image manipulation.
|
| 128 |
+
|
| 129 |
+
Image Datasets for training StyleGAN: We use three category-specific StyleGAN models, one representing a rigid object class, and two representing articulated (and thus more challenging) classes. We use the official car and horse model from StyleGAN2 (Karras et al., 2019b) repo which are trained on LSUN Car and LSUN Horse with 5.7M and 2M images. We also train a bird model on NABirds (Van Horn et al., 2015) dataset, which contains 48k images.
|
| 130 |
+
|
| 131 |
+
Our “StyleGAN” Dataset: We first randomly sample 6000 cars, 1000 horse and 1000 birds with diverse shapes, textures, and backgrounds from StyleGAN. After filtering out images with bad masks as described in Sec. 3, 55429 cars, 16392 horses and 7948 birds images remain in our dataset which is significant larger than the Pascal3D car dataset (Xiang et al., 2014) (4175 car images). Note that nothing prevents us from synthesizing a significantly larger amount of data, but in practice, this amount turned out to be sufficient to train good models. We provide more examples in Appendix.
|
| 132 |
+
|
| 133 |
+
# 4.1 3D RECONSTRUCTION RESULTS
|
| 134 |
+
|
| 135 |
+
Training Details: Our DIB-R based inverse graphics model was trained with Adam (Kingma & Ba (2015)), with a learning rate of 1e-4. We set $\lambda _ { \mathrm { I O U } }$ , $\lambda _ { \mathrm { c o l } }$ , $\lambda _ { \mathrm { l a p } }$ , $\lambda _ { \mathrm { s m } }$ and $\lambda _ { \mathrm { m o v } }$ to 3, 20, 5, 5, and 2.5, respectively. We first train the model with $L _ { \mathrm { c o l } }$ loss for 3K iterations, and then fine-tune the model by adding $L _ { \mathrm { p e c e p t } }$ to make the texture more realistic. We set $\lambda _ { \mathrm { p e r c e p t } }$ to 0.5. The model converges in 200K iterations with batch size 16. Training takes around 120 hours on four V100 GPUs.
|
| 136 |
+
|
| 137 |
+
Results: We show 3D reconstruction results in Fig. 4. Notice the quality of the predicted shapes and textures, and the diversity of the 3D car shapes we obtain. Our method also works well on more challenging (articulated) classes, e.g. horse and bird. We provide additional examples in Appendix.
|
| 138 |
+
|
| 139 |
+

|
| 140 |
+
Figure 6: Ablation Study: We ablate the use of multi-view consistency loss. Both texture are shape are worse without this loss, especially in the invisible parts (rows 2, 5, denoted by “w.o M. V.” – no multi-view consistency used during training), showcasing the importance of our StyleGAN-multivew dataset.
|
| 141 |
+
|
| 142 |
+
Qualitative Comparison: To showcase our approach, we compare our inverse graphics network trained on our StyleGAN dataset with exactly the same model but which we train on the Pascal3D car dataset. Pascal3D dataset has annotated keypoints, which we utilize to train the baseline model, termed as as Pascal3D-model. We show qualitative comparison on Pascal3D test set in Fig. 5. Note that the images from Pascal3D dataset are different from those our StyleGAN-model was trained on. Although the Pascal3D-model’s prediction is visually good in the input image view, rendered predictions in other views are of noticeably lower quality than ours, which demonstrates that we recover 3D geometry and texture better than the baseline.
|
| 143 |
+
|
| 144 |
+
<table><tr><td>Model</td><td>Pascal3D test</td><td>StyleGAN test</td></tr><tr><td>Pascal3D</td><td>0.80</td><td>0.81</td></tr><tr><td>Ours</td><td>0.76</td><td>0.95</td></tr></table>
|
| 145 |
+
|
| 146 |
+
<table><tr><td></td><td>Overall</td><td>Shape</td><td>Texture</td></tr><tr><td>Ours</td><td>57.5%</td><td>61.6%</td><td>56.3%</td></tr><tr><td>Pascal3D-model</td><td>25.9%</td><td>26.4%</td><td>32.8%</td></tr><tr><td>No Preference</td><td>16.6%</td><td>11.9%</td><td>10.8%</td></tr></table>
|
| 147 |
+
|
| 148 |
+
(c) User Study
|
| 149 |
+
|
| 150 |
+
Table 1: (a): We compare dataset size and annotation time of Pascal3D with our StyleGAN dataset. (b): We evaluate re-projected 2D IOU score of our StyleGAN-model vs the baseline Pascal3D-model on the two datasets. (c): We conduct a user study to judge the quality of 3D estimation.
|
| 151 |
+
|
| 152 |
+
<table><tr><td>Dataset</td><td>Size</td><td>Annotation</td></tr><tr><td>Pascal3D</td><td>4K</td><td>200-350h</td></tr><tr><td>StyleGAN</td><td>50K</td><td>~1min</td></tr></table>
|
| 153 |
+
|
| 154 |
+
(a) Dataset Comparison (b) 2D IOU Evaluation
|
| 155 |
+
|
| 156 |
+
Quantitative Comparison: We evaluate the two networks in Table 1 for the car class. We report the estimated annotation time in Table. 1 (a) to showcase efficiency behind our StyleGAN dataset. It takes 3-5 minutes to annotate keypoints for one object, which we empirically verify. Thus, labeling Pascal3D required around 200-350 hours while ours takes only 1 minute to annotate a 10 times larger dataset. In Table 1 (b), we evaluate shape prediction quality by the re-projected 2D IOU score. Our model outperforms the Pascal3D-model on the SyleGAN test set while Pascal3D-model is better on the Pascal test set. This is not surprising since there is a domain gap between two datasets and thus each one performs best on their own test set. Note that this metric only evaluates quality of the prediction in input view and thus not reflect the actual quality of the predicted 3D shape/texture.
|
| 157 |
+
|
| 158 |
+
To analyze the quality of 3D prediction, we conduct an AMT user study on the Pascal3D test set which contains 220 images. We provide users with the input image and predictions rendered in 6 views (shown in Fig. 5, right) for both models. We ask them to choose the model with a more realistic shape and texture prediction that matches the input object. We provide details of the study in the Appendix. We report results in Table. 1 (c). Users show significant preference of our results versus the baseline, which confirms that the quality of our 3D estimation.
|
| 159 |
+
|
| 160 |
+
Ablation study: In Fig 6 we ablate the importance of using multiple views in our dataset, i.e., by encouraging multi-view consistency loss during training. We compare predictions from inverse graphics networks trained with and without this loss, with significant differences in quality.
|
| 161 |
+
|
| 162 |
+

|
| 163 |
+
Figure 7: Dual Renderer: Given input images (1st column), we first predict mesh and texture, and render them with the graphics renderer (2nd column), and our StyleGAN-R (3rd column).
|
| 164 |
+
|
| 165 |
+

|
| 166 |
+
Figure 8: Latent code manipulation: Given an input image (col 1), we predict 3D properties and synthesize a new image with StyleGAN-R, by manipulating the viewpoint (col 2, 3, 4). Alternatively, we directly optimize the (original) StyleGAN latent code w.r.t. image, however this leads to a blurry reconstruction (col 5). Moreover, when we try to adjust the style for the optimized code, we get low quality results $\left( \mathrm { c o l } 6 , 7 \right)$ ).
|
| 167 |
+
|
| 168 |
+

|
| 169 |
+
Figure 9: Camera Controller: We manipulate azimuth, scale, elevation parameters with StyleGAN-R to synthesize images in new viewpoints while keeping content code fixed.
|
| 170 |
+
Figure 10: 3D Manipulation: We sample 3 cars in column 1. We replace the shape of all cars with the shape of Car 1 (red box) in 2nd column. We transfer texture of Car 2 (green box) to other cars (3rd col). In last column, we paste background of Car 3 (cyan box) to the other cars. Examples indicated with boxes are unchanged. Zoom in to see details.
|
| 171 |
+
Figure 11: Real Image Manipulation: Given input images (1st col), we predict 3D properties and use our StyleGAN-R to render them back (2nd col). We swap out shape, texture & background in cols 3-5.
|
| 172 |
+
|
| 173 |
+
# 4.2 DUAL RENDERERS
|
| 174 |
+
|
| 175 |
+
Training Details: We train StyleGAN-R using Adam with learning rate of 1e-5 and batch size 16.
|
| 176 |
+
Warmup stage takes 700 iterations, and we perform joint fine-tuning for another 2500 iterations.
|
| 177 |
+
|
| 178 |
+
With the provided input image, we first predict mesh and texture using the trained inverse graphics model, and then feed these 3D properties into StyleGAN-R to generate a new image. For comparison, we feed the same 3D properties to the DIB-R graphics renderer (which is the OpenGL renderer). Results are provided in Fig. 7. Note that DIB-R can only render the predicted object, while StyleGAN-R also has the ability to render the object into a desired background. We find that StyleGAN-R produces relatively consistent images compared to the input image. Shape and texture are well preserved, while only the background has a slight content shift.
|
| 179 |
+
|
| 180 |
+
# 4.3 3D IMAGE MANIPULATION WITH STYLEGAN-R
|
| 181 |
+
|
| 182 |
+
We test our approach in manipulating StyleGAN-synthesized images from our test set and real images. Specifically, given an input image, we predict 3D properties using the inverse graphics network, and extract background by masking out the object with Mask-RCNN. We then manipulate and feed these properties to StyleGAN-R to synthesize new views.
|
| 183 |
+
|
| 184 |
+
Controlling Viewpoints: We first freeze shape, texture and background, and change the camera viewpoint. Example is shown in Fig. 9. We obtain meaningful results, particularly for shape and texture. For comparison, an alternative way that has been explored in literature is to directly optimize the GAN’s latent code (in our case the original StyleGAN’s code) via an L2 image reconstruction loss. Results are shown in the last three columns in Fig. 8. As also observed in Abdal et al. (2019), this approach fails to generate plausible images, showcasing the importance of the mapping network and fine-tuning the entire architecture with 3D inverse graphics network in the loop.
|
| 185 |
+
|
| 186 |
+
Controlling Shape, Texture and Background: We further aim to manipulate 3D properties, while keeping the camera viewpoint fixed. In the second column of Fig 10, we replace the shapes of all cars to one chosen shape (red box) and perform neural rendering using StyleGAN-R. We successfully swap the shape of the car while maintaining other properties. We are able to modify tiny parts of the car, such as trunk and headlights. We do the same experiment but swapping texture and background in the third and forth column of Fig 10. We notice that swapping textures also slightly modifies the background, pointing that further improvements are possible in disentangling the two.
|
| 187 |
+
|
| 188 |
+
Real Image Editing: As shown in Fig. 11, our framework also works well when provided with real images, since StyleGAN’s images, which we use in training, are quite realistic.
|
| 189 |
+
|
| 190 |
+
# 4.4 LIMITATIONS
|
| 191 |
+
|
| 192 |
+
While recovering faithful 3D gemetry and texture, our model fails to predict correct lighting. Real images and StyleGAN-generated images contain advanced lighting effects such as reflection, transparency and shadows, and our spherical harmonic lighting model is incapable in dealing with it successfully. We also only partly succeed at disentangling the background, which one can see by noticing slight changes in background in Fig. 7, Fig. 10 and Fig. 11. Predicting faithful shapes for out-of-distribution objects as discussed in Appendix is also a significant challenge. We leave improvements to future work.
|
| 193 |
+
|
| 194 |
+
# 5 CONCLUSION
|
| 195 |
+
|
| 196 |
+
In this paper, we introduced a new powerful architecture that links two renderers: a state-of-the-art image synthesis network and a differentiable graphics renderer. The image synthesis network generates training data for an inverse graphics network. In turn, the inverse graphics network teaches the synthesis network about the physical 3D controls. We showcased our approach to obtain significantly higher quality 3D reconstruction results while requiring $1 0 { , } 0 0 0 \times$ less annotation effort than standard datasets. We also provided 3D neural rendering and image manipulation results demonstrating the effectiveness of our approach.
|
| 197 |
+
|
| 198 |
+
# REFERENCES
|
| 199 |
+
|
| 200 |
+
Rameen Abdal, Yipeng Qin, and Peter Wonka. Image2stylegan: How to embed images into the stylegan latent space? CoRR, abs/1904.03189, 2019. URL http://arxiv.org/abs/1904.03189.
|
| 201 |
+
Angel X Chang, Thomas Funkhouser, Leonidas Guibas, Pat Hanrahan, Qixing Huang, Zimo Li, Silvio Savarese, Manolis Savva, Shuran Song, Hao Su, et al. Shapenet: An information-rich 3d model repository. arXiv preprint arXiv:1512.03012, 2015.
|
| 202 |
+
Wenzheng Chen, Jun Gao, Huan Ling, Edward Smith, Jaakko Lehtinen, Alec Jacobson, and Sanja Fidler. Learning to predict 3d objects with an interpolation-based differentiable renderer. In Advances In Neural Information Processing Systems, 2019.
|
| 203 |
+
Xi Chen, Yan Duan, Rein Houthooft, John Schulman, Ilya Sutskever, and Pieter Abbeel. Infogan: Interpretable representation learning by information maximizing generative adversarial nets. In Advances in neural information processing systems, pp. 2172–2180, 2016.
|
| 204 |
+
Christopher B Choy, Danfei Xu, JunYoung Gwak, Kevin Chen, and Silvio Savarese. 3d-r2n2: A unified approach for single and multi-view 3d object reconstruction. In ECCV, 2016.
|
| 205 |
+
|
| 206 |
+
Alexey Dosovitskiy, Jost Tobias Springenberg, Maxim Tatarchenko, and Thomas Brox. Learning to generate chairs, tables and cars with convolutional networks. IEEE transactions on pattern analysis and machine intelligence, 39(4):692–705, 2016.
|
| 207 |
+
|
| 208 |
+
Jun Gao, Wenzheng Chen, Tommy Xiang, Clement Fuji Tsang, Alec Jacobson, Morgan McGuire, and Sanja Fidler. Learning deformable tetrahedral meshes for 3d reconstruction. In Advances In Neural Information Processing Systems, 2020.
|
| 209 |
+
|
| 210 |
+
Shubham Goel, Angjoo Kanazawa, , and Jitendra Malik. Shape and viewpoints without keypoints. In ECCV, 2020.
|
| 211 |
+
|
| 212 |
+
Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. In Z. Ghahramani, M. Welling, C. Cortes, N. D. Lawrence, and K. Q. Weinberger (eds.), Advances in Neural Information Processing Systems 27, pp. 2672–2680. Curran Associates, Inc., 2014. URL http://papers.nips.cc/paper/ 5423-generative-adversarial-nets.pdf.
|
| 213 |
+
|
| 214 |
+
Thibault Groueix, Matthew Fisher, Vladimir G. Kim, Bryan Russell, and Mathieu Aubry. AtlasNet: A PapierMach ˆ e Approach to Learning 3D Surface Generation. In ´ Proceedings IEEE Conf. on Computer Vision and Pattern Recognition (CVPR), 2018.
|
| 215 |
+
|
| 216 |
+
Erik Hark ¨ onen, Aaron Hertzmann, Jaakko Lehtinen, and Sylvain Paris. Ganspace: Discovering interpretable¨ gan controls. arXiv preprint arXiv:2004.02546, 2020.
|
| 217 |
+
|
| 218 |
+
Kaiming He, Georgia Gkioxari, Piotr Dollar, and Ross B. Girshick. Mask R-CNN. ´ CoRR, abs/1703.06870, 2017. URL http://arxiv.org/abs/1703.06870.
|
| 219 |
+
|
| 220 |
+
Paul Henderson and Vittorio Ferrari. Learning to generate and reconstruct 3d meshes with only 2d supervision. arXiv preprint arXiv:1807.09259, 2018.
|
| 221 |
+
|
| 222 |
+
Krishna Murthy J., Edward Smith, Jean-Francois Lafleche, Clement Fuji Tsang, Artem Rozantsev, Wenzheng Chen, Tommy Xiang, Rev Lebaredian, and Sanja Fidler. Kaolin: A pytorch library for accelerating 3d deep learning research. arXiv:1911.05063, 2019.
|
| 223 |
+
|
| 224 |
+
Angjoo Kanazawa, Shubham Tulsiani, Alexei A Efros, and Jitendra Malik. Learning category-specific mesh reconstruction from image collections. In ECCV, pp. 371–386, 2018.
|
| 225 |
+
|
| 226 |
+
Levent Karacan, Zeynep Akata, Aykut Erdem, and Erkut Erdem. Learning to generate images of outdoor scenes from attributes and semantic layouts. arXiv preprint arXiv:1612.00215, 2016.
|
| 227 |
+
|
| 228 |
+
Tero Karras, Samuli Laine, and Timo Aila. A style-based generator architecture for generative adversarial networks. In CVPR, 2019a.
|
| 229 |
+
|
| 230 |
+
Tero Karras, Samuli Laine, Miika Aittala, Janne Hellsten, Jaakko Lehtinen, and Timo Aila. Analyzing and improving the image quality of StyleGAN. CoRR, abs/1912.04958, 2019b.
|
| 231 |
+
|
| 232 |
+
Hiroharu Kato and Tatsuya Harada. Self-supervised learning of 3d objects from natural images, 2019.
|
| 233 |
+
|
| 234 |
+
Hiroharu Kato, Yoshitaka Ushiku, and Tatsuya Harada. Neural 3d mesh renderer. In CVPR, 2018.
|
| 235 |
+
|
| 236 |
+
Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In Yoshua Bengio and Yann LeCun (eds.), 3rd International Conference on Learning Representations, ICLR 2015, San Diego, CA, USA, May 7-9, 2015, Conference Track Proceedings, 2015. URL http://arxiv.org/abs/1412.6980.
|
| 237 |
+
|
| 238 |
+
Wonkwang Lee, Donggyun Kim, Seunghoon Hong, and Honglak Lee. High-fidelity synthesis with disentangled representation. arXiv preprint arXiv:2001.04296, 2020.
|
| 239 |
+
|
| 240 |
+
Daiqing Li, Junlin Yang, Karsten Kreis, Antonio Torralba, and Sanja Fidler. Semantic segmentation with generative models: Semi-supervised learning and strong out-of-domain generalization. In CVPR, 2021.
|
| 241 |
+
|
| 242 |
+
Tzu-Mao Li, Miika Aittala, Fredo Durand, and Jaakko Lehtinen. Differentiable monte carlo ray tracing through´ edge sampling. In SIGGRAPH Asia 2018 Technical Papers, pp. 222. ACM, 2018.
|
| 243 |
+
|
| 244 |
+
Xueting Li, Sifei Liu, Kihwan Kim, Shalini De Mello, Varun Jampani, Ming-Hsuan Yang, and Jan Kautz. Self-supervised single-view 3d reconstruction via semantic consistency. In ECCV, 2020.
|
| 245 |
+
|
| 246 |
+
Zinan Lin, Kiran Koshy Thekumparampil, Giulia Fanti, and Sewoong Oh. Infogan-cr: Disentangling generative adversarial networks with contrastive regularizers. arXiv preprint arXiv:1906.06034, 2019.
|
| 247 |
+
|
| 248 |
+
Hsueh-Ti Derek Liu, Michael Tao, Chun-Liang Li, Derek Nowrouzezahrai, and Alec Jacobson. Beyond pixel norm-balls: Parametric adversaries using an analytically differentiable renderer. In ICLR, 2019a.
|
| 249 |
+
|
| 250 |
+
Shichen Liu, Tianye Li, Weikai Chen, and Hao Li. Soft rasterizer: A differentiable renderer for image-based 3d reasoning. ICCV, 2019b.
|
| 251 |
+
|
| 252 |
+
Matthew M. Loper and Michael J. Black. Opendr: An approximate differentiable renderer. In David J. Fleet, Tomas Pajdla, Bernt Schiele, and Tinne Tuytelaars (eds.), ´ Computer Vision - ECCV 2014 - 13th European Conference, Zurich, Switzerland, September 6-12, 2014, Proceedings, Part VII, volume 8695 of Lecture Notes in Computer Science, pp. 154–169. Springer, 2014. doi: 10.1007/978-3-319-10584-0\ 11. URL https://doi.org/10.1007/978-3-319-10584-0\_11.
|
| 253 |
+
|
| 254 |
+
Lars Mescheder, Michael Oechsle, Michael Niemeyer, Sebastian Nowozin, and Andreas Geiger. Occupancy networks: Learning 3d reconstruction in function space. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 4460–4470, 2019.
|
| 255 |
+
|
| 256 |
+
Jeong Joon Park, Peter Florence, Julian Straub, Richard Newcombe, and Steven Lovegrove. Deepsdf: Learning continuous signed distance functions for shape representation. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2019.
|
| 257 |
+
|
| 258 |
+
Guim Perarnau, Joost Van De Weijer, Bogdan Raducanu, and Jose M Alvarez. Invertible conditional gans for ´ image editing. arXiv preprint arXiv:1611.06355, 2016.
|
| 259 |
+
|
| 260 |
+
Felix Petersen, Amit H. Bermano, Oliver Deussen, and Daniel Cohen-Or. Pix2vex: Image-to-geometry reconstruction using a smooth differentiable renderer. CoRR, abs/1903.11149, 2019. URL http://arxiv. org/abs/1903.11149.
|
| 261 |
+
|
| 262 |
+
Nikhila Ravi, Jeremy Reizenstein, David Novotny, Taylor Gordon, Wan-Yen Lo, Justin Johnson, and Georgia Gkioxari. Pytorch3d. https://github.com/facebookresearch/pytorch3d, 2020.
|
| 263 |
+
|
| 264 |
+
Scott Reed, Zeynep Akata, Xinchen Yan, Lajanugen Logeswaran, Bernt Schiele, and Honglak Lee. Generative adversarial text to image synthesis. arXiv preprint arXiv:1605.05396, 2016.
|
| 265 |
+
|
| 266 |
+
Yujun Shen, Ceyuan Yang, Xiaoou Tang, and Bolei Zhou. Interfacegan: Interpreting the disentangled face representation learned by gans. arXiv preprint arXiv:2005.09635, 2020.
|
| 267 |
+
|
| 268 |
+
Vincent Sitzmann, Michael Zollhofer, and Gordon Wetzstein. Scene representation networks: Continuous ¨ 3d-structure-aware neural scene representations. In Advances in Neural Information Processing Systems, 2019.
|
| 269 |
+
|
| 270 |
+
Ayush Tewari, Mohamed Elgharib, Gaurav Bharaj, Florian Bernard, Hans-Peter Seidel, Patrick Perez, Michael´ Zollhofer, and Christian Theobalt. Stylerig: Rigging stylegan for 3d control over portrait images, cvpr 2020. ¨ In IEEE Conference on Computer Vision and Pattern Recognition (CVPR). IEEE, june 2020.
|
| 271 |
+
|
| 272 |
+
Antonio Torralba, Bryan C Russell, and Jenny Yuen. Labelme: Online image annotation and applications. Proceedings of the IEEE, 98(8):1467–1484, 2010. doi: 10.1109/jproc.2010.2050290.
|
| 273 |
+
|
| 274 |
+
Julien Valentin, Cem Keskin, Pavel Pidlypenskyi, Ameesh Makadia, Avneesh Sud, and Sofien Bouaziz. Tensorflow graphics: Computer graphics meets deep learning. 2019.
|
| 275 |
+
|
| 276 |
+
G. Van Horn, S. Branson, R. Farrell, S. Haber, J. Barry, P. Ipeirotis, P. Perona, and S. Belongie. Building a bird recognition app and large scale dataset with citizen scientists: The fine print in fine-grained dataset collection. In 2015 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 595–604, 2015.
|
| 277 |
+
|
| 278 |
+
Nanyang Wang, Yinda Zhang, Zhuwen Li, Yanwei Fu, Wei Liu, and Yu-Gang Jiang. Pixel2mesh: Generating 3d mesh models from single rgb images. In ECCV, 2018.
|
| 279 |
+
|
| 280 |
+
Weiyue Wang, Xu Qiangeng, Duygu Ceylan, Radomir Mech, and Ulrich Neumann. Disn: Deep implicit surface network for high-quality single-view 3d reconstruction. arXiv preprint arXiv:1905.10711, 2019.
|
| 281 |
+
|
| 282 |
+
P. Welinder, S. Branson, T. Mita, C. Wah, F. Schroff, S. Belongie, and P. Perona. Caltech-UCSD Birds 200. Technical Report CNS-TR-2010-001, California Institute of Technology, 2010.
|
| 283 |
+
|
| 284 |
+
Shangzhe Wu, Christian Rupprecht, and Andrea Vedaldi. Unsupervised learning of probably symmetric deformable 3d objects from images in the wild. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2020.
|
| 285 |
+
|
| 286 |
+
Yu Xiang, Roozbeh Mottaghi, and Silvio Savarese. Beyond pascal: A benchmark for 3d object detection in the wild. In IEEE Winter Conference on Applications of Computer Vision (WACV), 2014.
|
| 287 |
+
|
| 288 |
+
Shunyu Yao, Tzu Ming Hsu, Jun-Yan Zhu, Jiajun Wu, Antonio Torralba, Bill Freeman, and Josh Tenenbaum. 3d-aware scene manipulation via inverse graphics. In Advances in neural information processing systems, pp. 1887–1898, 2018.
|
| 289 |
+
|
| 290 |
+
Yuxuan Zhang, Huan Ling, Jun Gao, Kangxue Yin, Jean-Francois Lafleche, Adela Barriuso, Antonio Torralba, and Sanja Fidler. Datasetgan: Efficient labeled data factory with minimal human effort. In CVPR, 2021.
|
| 291 |
+
|
| 292 |
+
Jun-Yan Zhu, Taesung Park, Phillip Isola, and Alexei A Efros. Unpaired image-to-image translation using cycle-consistent adversarial networks. In Proceedings of the IEEE international conference on computer vision, pp. 2223–2232, 2017.
|
| 293 |
+
|
| 294 |
+
Jun-Yan Zhu, Zhoutong Zhang, Chengkai Zhang, Jiajun Wu, Antonio Torralba, Josh Tenenbaum, and Bill Freeman. Visual object networks: Image generation with disentangled 3d representations. In Advances in neural information processing systems, pp. 118–129, 2018.
|
| 295 |
+
|
| 296 |
+
# APPENDIX
|
| 297 |
+
|
| 298 |
+
# A OVERVIEW
|
| 299 |
+
|
| 300 |
+
In the Appendix, we first show feature visualization of StyleGAN layers in Sec. B. We then provide a detailed explanation of our StyleGAN dataset creation in Sec. C, including examples of the generated images and selected viewpoints. Next, we do a systematic analysis of our camera initialization method in Sec. D. Finally, we show additional results on the 3D inverse graphics task in Sec. E, additional details of the user study in Sec. F, futher examples of StyleGAN disentanglement in Sec. G, with ablation studies and a discussion of limitations in Sec. H and Sec. K, respectively.
|
| 301 |
+
|
| 302 |
+
# B STYLEGAN LAYERS VISUALIZATION
|
| 303 |
+
|
| 304 |
+
The official StyleGAN code repository provides models of different object categories at different resolutions. Here we take the $5 1 2 \times 3 8 4$ car model as the example. This model contains 16 layers, where every two consecutive layers form a block. Each block has a different number of channels. In the last block, the model produces a 32-channel feature map at a $5 1 2 \times 3 8 4$ resolution. Finally, a learned RGB transformation function is applied to convert the feature map into an RGB image.
|
| 305 |
+
|
| 306 |
+
We visualize the feature map for each block via the learned RGB transformation function. Specifically, for the feature map in each block with the size of $h \times w \times c$ , we first sum along the feature dimension, forming a $h \times w \times 1$ tensor. We then repeat the feature 32 times and generate a $h \times w \times 3 2$ new feature map. This allows us to keep the information of all the channels and directly apply the RGB transformation function in the last block to convert it to the RGB image.
|
| 307 |
+
|
| 308 |
+
As shown in Fig A, we find that blocks 1 and 2 do not exhibit interpretable structure while the car shape starts to appear in blocks 3-5. We observe that there is a rough car contour in block 4 which further becomes clear in block 5. From blocks 6 to 8, the car’s shape becomes increasingly finer and background scene also appears. This supports some of our findings, i.e., the viewpoint is controlled in block 1 and 2 (first 4 layers) while shape, texture, and background exist in the last 12 layers.
|
| 309 |
+
|
| 310 |
+

|
| 311 |
+
Figure A: Layer Visualization for Each Block: Notice that the car contour starts to appear in blocks 4 and higher. This supports some of our findings that the early blocks control viewpoint (and other global properties), while shape, texture and background are controlled in the higher layers.
|
| 312 |
+
|
| 313 |
+
# C OUR “STYLEGAN” DATASET
|
| 314 |
+
|
| 315 |
+
We visualize all of our selected viewpoints in our dataset in Fig. B. Our car training dataset contains 39 viewpoints. For the horse and bird datasets, we choose 22 and 8 views, respectively. We find that these views are sufficient to learn accurate 3D inverse graphics networks. We could not find views that would depict the object from a higher up camera, i.e., a viewpoint from which the roof of the car or the back of the horse would be more clearly visible. This is mainly due to the original dataset on which StyleGAN was trained on, which lacked such views. This leads to challenges in training inverse graphics networks to accurately predict the top of the objects.
|
| 316 |
+
|
| 317 |
+

|
| 318 |
+
Figure B: All Viewpoints: We show an example of a car, bird and a horse synthesized in all of our chosen viewpoints. While shape and texture are not perfectly consistent across views, they are sufficiently accurate to enable training accurate inverse graphics networks in our downstream tasks. Horses and birds are especially challenging due to articulation. One can notice small changes in articulation across viewpoints. Dealing with articulated objects is subject to future work.
|
| 319 |
+
|
| 320 |
+
Notice the high consistency of both the car shape and texture as well as the background scene across the different viewpoints. Note that for articulated objects such as the horse and bird classes, StyleGAN does not perfectly preserve object articulation in different viewpoints, which leads to challenges in training high accuracy models using multi-view consistency loss. We leave further investigation of articulated objects to future work.
|
| 321 |
+
|
| 322 |
+
We further show examples from our StyleGAN-generated dataset in Fig. C. Our dataset contains objects with various shapes, textures and viewpoints. In particular, in the first six rows, one can notice a diverse variants of car types (Standard Car, SUV, Sports car, Antique Car, etc) . We find that StyleGAN can also produce rare car shapes like trucks, but with a lower probability.
|
| 323 |
+
|
| 324 |
+

|
| 325 |
+
Figure C: Dataset Overview: We synthesize multi-view datasets for three classes: car, horse, and bird. Our datasets contain objects with various shapes, textures and viewpoints. Notice the consistency of pose of object in each column (for each class). Challenges include the fact that for all of these objects StyleGAN has not learned to synthesize views that overlook the object from above due to the photographer bias in the original dataset that StyleGAN was trained on.
|
| 326 |
+
|
| 327 |
+
# D CAMERA INITIALIZATION
|
| 328 |
+
|
| 329 |
+
Inverse graphics tasks require camera pose information during training, which is challenging to acquire for real imagery. Pose is generally obtained by annotating keypoints for each object and running structure-from-motion (SFM) techniques (Welinder et al., 2010; Xiang et al., 2014) to compute camera parameters. However, keypoint annotation is quite time consuming – requiring roughly 3- 5minutes per object which we verify in practice using the LabelMe interface (Torralba et al., 2010). In our work, we utilize StyleGAN to significantly reduce annotation effort since samples with the same $w _ { v } ^ { * }$ share the same viewpoint. Therefore, we only need to assign a few selected $w _ { v } ^ { * }$ into camera poses. In particular, we assign poses into several bins which we show is sufficient for training inverse graphics networks where, along with the network parameters, cameras get jointly optimized during training using these bins as initialization.
|
| 330 |
+
|
| 331 |
+
Specifically, we assign poses into 39, 22 and 8 bins for the car, horse and bird classes, respectively. This allows us to annotate all the views (and thus the entire dataset) in only $I$ minute. We do acknowledge additional time in selecting good views out of several candidates.
|
| 332 |
+
|
| 333 |
+
We annotate each view with a rough absolute camera pose (which we further optimize during training). To be specific, we first select 12 azimuth angles: $[ 0 ^ { \circ }$ , $3 0 ^ { \circ }$ , $6 0 ^ { \circ }$ , $9 0 ^ { \circ }$ , $1 2 0 ^ { \circ }$ , $1 5 0 ^ { \circ }$ , $1 8 0 ^ { \circ }$ , $2 1 0 ^ { \circ }$ , $2 4 0 ^ { \circ }$ , $2 7 0 ^ { \circ }$ , $3 0 0 ^ { \circ }$ , $3 3 0 ^ { \circ }$ ]. Given a StyleGAN viewpoint, we manually classify which azimuth angle it is close to and assign it to the corresponding label with fixed elevation $( 0 ^ { \circ } )$ and camera distance.
|
| 334 |
+
|
| 335 |
+
To demonstrate the effectiveness of our camera initialization, we make a comparison with another inverse graphics network trained with a more accurate camera initialization. Such an initialization is done by manually annotating object keypoints in each of the selected views $( w _ { v } ^ { * } )$ of a single car example, which takes about 3-4 hours (around 200 minutes, 39 views). Note that this is still a significantly lower annotation effort compared to 200-350 hours required to annotate keypoints for every single object in the Pascal3D dataset. We then compute the camera parameters using SfM. We refer to the two inverse graphics networks trained with different camera initializations as viewmodel and keypoint -model, respectively.
|
| 336 |
+
|
| 337 |
+
We visualize our two different annotation types in Fig D. We show annotated bins in the top. We annotated keypoints for the (synthesized) car example in the first image row based on which we compute the accurate viewpoint using SfM. To showcase how well aligned the objects are for the same viewpoint code, we visualize the annotated keypoints on all other synthesized car examples. Note that we do not assume that these keypoints are accurate for these cars (only the implied viewpoint).
|
| 338 |
+
|
| 339 |
+
We quantitatively evaluate two initialization methods in Table. D. We first compare the annotation and training times. While it takes the same amount of time to train, view-model saves on annotation time. The performance of view-model and keypoint -model are comparable with almost the same 2D IOU re-projection score on the StyleGAN test set. Moreover, during training the two camera systems converge to the same position. We evaluate this by converting all the views into quaternions and compare the difference between the rotation axes and rotation angles. Among all views, the average difference of the rotation axes is only $1 . 4 3 ^ { \circ }$ and the rotation angle is $0 . 4 2 ^ { \circ }$ . The maximum difference of the rotation axes is only $2 . 9 5 ^ { \circ }$ and the rotation angle is $1 . 1 1 ^ { \circ }$ .
|
| 340 |
+
|
| 341 |
+
We further qualitatively compare the two methods in Fig. E, showing that they perform very similarly. Both, qualitative and quantitative comparisons, demonstrated that view-camera initialization is sufficient for training accurate inverse graphics networks and no additional annotation is required. This demonstrates a scaleable way for creating multi-view datasets with StyleGAN, with roughy a minute of annotation time per class.
|
| 342 |
+
|
| 343 |
+
# E 3D INFERENCE
|
| 344 |
+
|
| 345 |
+
We here present additional 3D prediction results and compare our model, which is trained on our StyleGAN generated dataset (StyleGAN-model), with the one trained on the Pascal 3D dataset (Xiang et al., 2014) (PASCAL-model). We qualitatively compare two models on the Pascal3D test set in Fig. F and web imagery in Fig. G. Our StyleGAN-model produces better shape and texture predictions in all the testing datasets, which is particularly noticeable when looking at different rendered views of the prediction. We also present additional 3D prediction results on horses and birds in Fig. H.
|
| 346 |
+
|
| 347 |
+

|
| 348 |
+
|
| 349 |
+

|
| 350 |
+
Figure D: We show examples of cars synthesized in chosen viewpoints (columns) along with annotations. Top row shows the pose bin annotation, while the images show the annotated keypoints. We annotated keypoints for the car example in the first image-row based on which we compute the accurate camera parameters using SfM. To showcase how well aligned the objects are for the same viewpoint latent code, we visualize the annotated keypoints on all other synthesized car examples. Note that we do not assume that these keypoints are accurate for these cars (only the implied viewpoint). Annotating pose bins took 1 min for the car class, while keypoint annotation took 3-4 hours, both types of annotations thus being quite efficient. We empirically find that pose bin annotation is sufficient in training accurate inverse graphics networks (when optimizing camera parameters during training in addition to optimizing the network parameters).
|
| 351 |
+
Figure E: Comparison of Different Camera Initializations: The first row shows predictions from keypointInitialization (cameras computed by running SFM on annotated keypoints) and the second row show results obtained by training with view-Initialization (cameras are coarsely annotated into 12 view bins). Notice how close the two predictions are, indicating that coarse viewpoint annotation is sufficient for training accurate inverse graphics networks. Coarse viewpoint annotation can be done in 1 minute.
|
| 352 |
+
|
| 353 |
+
<table><tr><td>Annotation Type</td><td>Annotation Time</td><td>Training Time</td><td>2D IOU</td></tr><tr><td>keypoint</td><td>3-4h</td><td>60h</td><td>0.953</td></tr><tr><td>view</td><td>1min</td><td>60h</td><td>0.952</td></tr></table>
|
| 354 |
+
|
| 355 |
+
<table><tr><td>Quaternion</td><td>Mean</td><td>Max</td></tr><tr><td>qxyz</td><td>1.43°</td><td>2.95°</td></tr><tr><td>qw</td><td>0.42°</td><td>1.11°</td></tr></table>
|
| 356 |
+
|
| 357 |
+
(b) Camera Difference after Training
|
| 358 |
+
|
| 359 |
+
Table A: Comparison of Different Camera Initializations: First table shows annotation time required for the StyleGAN dataset, and training times of the view-model and keypoint-model on the dataset with respective annotations (binned viewpoints or cameras computed with SFM from annotated keypoints). The view-model requires significantly less annotation time, and its final performance is comparable to the keypoint-model. Second table shows the difference of the camera parameters after training both methods (which optimize cameras during training). They converge to very similar camera positions. This shows that coarse view annotation along with camera optimization during training is sufficient in training high accuracy inverse graphics networks.
|
| 360 |
+
|
| 361 |
+

|
| 362 |
+
Figure F: Comparison on PASCAL3D imagery: We compare PASCAL-model with StyleGAN-model on PASCAL3D test set. While the predictions from both models are visually good in the corresponding image view, the prediction from StyleGAN-model have much better shapes and textures as observed in other views.
|
| 363 |
+
|
| 364 |
+

|
| 365 |
+
Figure G: Comparison on Images from the Web: We compare the PASCAL-model with our StyleGANmodel on images downloaded from the web. While the predictions from both models are visually good in the corresponding image view, the prediction from StyleGAN-model have much better shapes and textures as observed in other views.
|
| 366 |
+
|
| 367 |
+

|
| 368 |
+
Multiple Views for the predicted shape and texture
|
| 369 |
+
Figure H: 3D Reconstruction Results for Car, Horse and Bird Classes: We show car, horse and bird examples tested on the images from the StyleGAN dataset test sets. Notice that the model struggles a little in reconstructing the top of the back of the horse, since such views are lacking in training.
|
| 370 |
+
|
| 371 |
+

|
| 372 |
+
Figure I: User Study Interface (AMT): Predictions are rendered in 6 views and we ask users to choose the result with a more realistic shape and texture that is relevant to the input object. We compare both the baseline (trained on Pascal3D dataset) and ours (trained on StyleGAN dataset). We randomize their order in each HIT.
|
| 373 |
+
Table B: User study results: (a): Quality of 3D estimation (shape, texture and overall). (b): Annotators agreement analysis. “No agreement” stands for the case where all three annotators choose different options.
|
| 374 |
+
|
| 375 |
+
# F USER STUDY
|
| 376 |
+
|
| 377 |
+
We provide user study details in this section. We implement our user interface, visualized in in Fig. I, on Amazon Mechanical Turk. We show the input image and predictions rendered in 6 views such that users can better judge the quality of 3D reconstruction. We show results for both, our inverse graphics network (trained on the StyleGAN dataset) and the one trained on the Pascal3D dataset. We show shape reconstruction and textured models separately, such that users can judge the quality of both, shape and texture, more easily. We randomize the order of ours vs baseline in each HIT to avoid any bias. We ask users to choose results that produce more realistic and representative shape, texture and overall quality with respect to the input image. We separate judgement of quality into these three categories to disentangle effects of 3D reconstruction from texture prediction. We also provide “no preference” options in case of ties. Our instructions emphasize that more “representative” results of the input should be selected, to avoid users being biased by good looking predictions that are not consistent with the input (e.g., such as in the case of overfit networks).
|
| 378 |
+
|
| 379 |
+
We evaluate the two networks on all 220 images from the Pascal3D test set (which are “in-domain” for the Pascal3D-trained network). For each image we ask three users to perform evaluation, which results in 660 votes in total. We report the average of all votes as our final metric. We further report annotator agreement analysis in Table B. For shape, texture, and overall evaluation, there are $8 8 . 2 \%$ , $8 9 . 2 \%$ , and $8 7 . 2 \%$ cases where at least two out of three users choose the same option.
|
| 380 |
+
|
| 381 |
+
<table><tr><td></td><td>Overall</td><td>Shape</td><td>Texture</td></tr><tr><td>Ours</td><td>57.5%</td><td>61.6%</td><td>56.3%</td></tr><tr><td>Pascal3D-model</td><td>25.9%</td><td>26.4%</td><td>32.8%</td></tr><tr><td>No Preference</td><td>16.6%</td><td>11.9%</td><td>10.8%</td></tr></table>
|
| 382 |
+
|
| 383 |
+
(a) 3D Quality Study
|
| 384 |
+
|
| 385 |
+
<table><tr><td></td><td>Overall</td><td>Shape</td><td>Texture</td></tr><tr><td>All Agree</td><td>26.1%</td><td>29.6%</td><td>27.1%</td></tr><tr><td>Two Agree</td><td>61.1%</td><td>58.6%</td><td>62.1%</td></tr><tr><td>No Agreement</td><td>12.8%</td><td>11.8%</td><td>10.8%</td></tr></table>
|
| 386 |
+
|
| 387 |
+
(b) Annotator Agreement
|
| 388 |
+
|
| 389 |
+
# G STYLEGAN-R DISENTANGLEMENT
|
| 390 |
+
|
| 391 |
+
Given an input image, we infer 3D properties of an object (shape, texture, background) using our inverse graphics network, but can also map these properties back to the latent code and use our StyleGAN-R to synthesize a new image. We show the results in Fig. J. Similar to Fig. 9 in the main paper, we show DIB-R-rendered predictions and neural rendering StyleGAN-R’s predictions, and manipulate their viewpoints in rows (1, 4) and (2, 5). We further show “neural rendering” results from the original StyleGAN in row (3, 6), where we only learn the mapping network but keep the StyleGAN’s weights fixed. We find that fine-tuning is necessary and StyleGAN-R produces more consistent shape, texture and background.
|
| 392 |
+
|
| 393 |
+

|
| 394 |
+
Figure J: Dual Rendering: Given the input image, we show the DIB-R-rendered predictions in rows (1, 4) and StyleGAN-R’s results in rows (2, 5). We further shows the neural rendering results from the original StyleGAN model, where we only learn the mapping network but keep the StyleGAN weights fixed. Clearly, after fine-tuning, StyleGAN-R produces more consistent results.
|
| 395 |
+
|
| 396 |
+

|
| 397 |
+
Figure K: Light Prediction: Given the input image, we show rendering (using the OpenGL renderer used in DIB-R) results with light (columns 2, 5) and results with just textures (columns 3, 6). We find that the two results are quite similar, which indicates that we did not learn a good predictor for lighting. Moreover, we find that higher order lighting, such as reflection, high-specular light are merged into texture, as shown in the second row. We aim to resolve this limitation in future work.
|
| 398 |
+
|
| 399 |
+
Real Image Editing: We show additional real-image editing examples in Fig. L. With our StyleGAN-R, we can easily change the car’s size, azimuth and elevation and synthesize a new image while preserving the shape and texture of the car with a consistent background.
|
| 400 |
+
|
| 401 |
+
# H ABLATION STUDIES
|
| 402 |
+
|
| 403 |
+
We find that the multi-view consistency and perceptual losses play an import role in training, as shown in Fig. P. Multi-view consistency loss helps in training a more accurate inverse graphics network in terms of shape, while the perceptual loss helps to keep texture more realistic.
|
| 404 |
+
|
| 405 |
+

|
| 406 |
+
Figure L: Real Image Editing. Given an input image (column 1), we use our inverse graphics network to predict the 3D properties and apply StyleGAN-R to re-render these (column 2, 3). We manipulate the car size/scale (row 1-3), azimuth (row 4-6) and elevation (Row 7-9).
|
| 407 |
+
|
| 408 |
+
# I STYLEGAN MANIPULATION
|
| 409 |
+
|
| 410 |
+
We show that our method for manipulating StyleGAN is generalizable and can be generalized to other class, as illustrated in the StyleGAN-R manipulation results for the bird in Fig M and Fig N.
|
| 411 |
+
|
| 412 |
+
# J FAILURE CASES
|
| 413 |
+
|
| 414 |
+
We find that our inverse graphics network fails on out-of-distribution images/shapes, as shown in Fig. O. For example, the reconstruction results for Batmobile and Flinstone cars are not representative of the input cars. We anticipate that this issue can be addressed by augmenting the dataset on which StyleGAN is trained with more diverse objects. Part of the issue is also caused by GANs not capturing the tails of the distribution well, which is an active area of research.
|
| 415 |
+
|
| 416 |
+

|
| 417 |
+
Figure M: Bird Camera Controller: We manipulate azimuth, scale, elevation parameters with StyleGAN-R to synthesize images in new viewpoints while keeping content code fixed.
|
| 418 |
+
|
| 419 |
+

|
| 420 |
+
Figure N: Bird 3D Manipulation: We sample 3 birds in column 1. We replace the shape of all birds with the shape of Bird 1 (red box) in 2nd column. We transfer texture of Bird 2 (green box) to other birds (3rd col). In last column, we paste background of Bird 3 (cyan box) to the other birds. Examples indicated with boxes are unchanged.
|
| 421 |
+
|
| 422 |
+
# K LIMITATIONS
|
| 423 |
+
|
| 424 |
+
Our simple spherical harmonics model fails to separate light from textures. We show several examples in Fig.K. We leave this issue for future work.
|
| 425 |
+
|
| 426 |
+

|
| 427 |
+
Figure O: 3D Reconstruction Failure Cases: We show examples of failure cases for car, bird and horse. Our method tends to fail to produce relevant shapes for objects with out-of-distribution shapes (or textures).
|
| 428 |
+
|
| 429 |
+

|
| 430 |
+
Figure P: Ablation Study: We ablate the use of multi-view consistency and perceptual losses by showing results of 3D predictions. Clearly, the texture becomes worse in the invisible part if we remove the multiview consistency loss (rows 2, 5, denoted by “w.o M. V.”, which denotes that no multi-view consistency was used during training), showcasing the importance of our StyleGAN-multivew dataset. Moreover, the textures become quite smooth and lose details if we do not use the perceptual loss (rows 3, 6, noted by “w.o P.”, which denotes that no perceptual loss was used during training).
|
md/train/ypJS_nyu-I/ypJS_nyu-I.md
ADDED
|
@@ -0,0 +1,518 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# A DEEPER LOOK AT DISCOUNTING MISMATCH IN ACTOR-CRITIC ALGORITHMS
|
| 2 |
+
|
| 3 |
+
# ABSTRACT
|
| 4 |
+
|
| 5 |
+
We investigate the discounting mismatch in actor-critic algorithm implementations from a representation learning perspective. Theoretically, actor-critic algorithms usually have discounting for both actor and critic, i.e., there is a $\gamma ^ { t }$ term in the actor update for the transition observed at time $t$ in a trajectory and the critic is a discounted value function. Practitioners, however, usually ignore the discounting $( \gamma ^ { t } )$ for the actor while using a discounted critic. We investigate this mismatch in two scenarios. In the first scenario, we consider optimizing an undiscounted objective $( \gamma = 1 )$ ) where $\gamma ^ { t }$ disappears naturally $\cdot ^ { 1 ^ { t } } = 1 ^ { \cdot }$ ). We then propose to interpret the discounting in critic in terms of a bias-variance-representation tradeoff and provide supporting empirical results. In the second scenario, we consider optimizing a discounted objective $( \gamma < 1 )$ ) and propose to interpret the omission of the discounting in the actor update from an auxiliary task perspective and provide supporting empirical results.
|
| 6 |
+
|
| 7 |
+
# 1 INTRODUCTION
|
| 8 |
+
|
| 9 |
+
Actor-critic algorithms have enjoyed great success both theoretically (Williams, 1992; Sutton et al., 2000; Konda, 2002; Schulman et al., 2015a) and empirically (Mnih et al., 2016; Silver et al., 2016; Schulman et al., 2017; OpenAI, 2018). There is, however, a longstanding gap between the theory behind actor-critic algorithms and how practitioners implement them. Let $\gamma , \gamma _ { \mathrm { A } }$ , and $\gamma _ { \mathrm { c } }$ be the discount factors for defining the objective, updating the actor, and updating the critic respectively. Theoretically, no matter whether $\gamma = 1$ or $\gamma < 1$ , we should always use $\gamma _ { \mathrm { { A } } } = \gamma _ { \mathrm { { C } } } = \gamma$ (Sutton et al., 2000; Schulman et al., 2015a) or at least keep $\gamma _ { \mathrm { A } } = \gamma _ { \mathrm { C } }$ if Blackwell optimality (Veinott, 1969; Weitzman, 2001) 1 is considered. Practitioners, however, usually use $\gamma _ { \mathrm { { A } } } = 1$ and $\gamma _ { \mathrm { c } } < 1$ in their implementations (Dhariwal et al., 2017; Caspi et al., 2017; Zhang, 2018; Kostrikov, 2018; Achiam, 2018; Liang et al., 2018; Stooke & Abbeel, 2019). Although this mismatch and its theoretical disadvantage have been recognized by Thomas (2014); Nota & Thomas (2020), whether and why it yields benefits in practice has not been systematically studied. In this paper, we empirically investigate this mismatch from a representation learning perspective. We consider two scenarios separately.
|
| 10 |
+
|
| 11 |
+
Scenario 1: The true objective is undiscounted $( \gamma = 1 ,$ ). The theory prescribes to use $\gamma _ { \mathrm { { A } } } = \gamma _ { \mathrm { { C } } } =$ $\gamma = 1$ . Practitioners, however, usually use $\gamma _ { \mathrm { { A } } } = \gamma = 1$ but $\gamma _ { \mathrm { c } } < 1$ , introducing bias. We explain this mismatch with the following hypothesis:
|
| 12 |
+
|
| 13 |
+
Hypothesis 1. $\gamma _ { \mathrm { c } } < 1$ optimizes a bias-variance-representation trade-off.
|
| 14 |
+
|
| 15 |
+
It is easy to see that $\gamma _ { \mathrm { c } } < 1$ reduces the variance in bootstrapping targets. Besides this, we further provide empirical evidence showing that when $\gamma _ { \mathrm { c } } < 1$ , it may become easier to find a good representation compared to $\gamma _ { \mathrm { c } } = 1$ . Consequently, although using $\gamma _ { \mathrm { c } } < 1$ introduces bias, it can facilitate representation learning. For our empirical study, we make use of recently introduced techniques, such fixed horizon temporal different learning (De Asis et al., 2019) and distributional reinforcement learning (Bellemare et al., 2017) to disentangle the various effects the discount factor has on the learning process.
|
| 16 |
+
|
| 17 |
+
Scenario 2: The true objective function is discounted $( \gamma < 1 ,$ ). Theoretically, there is a $\gamma ^ { t }$ term for the actor update on a transition observed at time $t$ in a trajectory (Sutton et al., 2000; Schulman et al., 2015a). Practitioners, however, usually ignore this term while using a discounted critic, i.e., $\gamma _ { \mathrm { { A } } } = 1$ and $\gamma _ { \mathrm { c } } = \gamma < 1$ are used. We explain this mismatch with the following hypothesis:
|
| 18 |
+
|
| 19 |
+
Hypothesis 2. Using $\gamma _ { \mathrm { c } } = \gamma < 1$ and $\gamma _ { \mathrm { { A } } } = 1$ is effectively similar to using $\gamma _ { \mathrm { c } } = \gamma _ { \mathrm { A } } = \gamma < 1 _ { \ / }$ plus an auxiliary loss that sometimes facilitates representation learning.
|
| 20 |
+
|
| 21 |
+
Our empirical study involves implementing the auxiliary task explicitly by using an additional policy for optimizing the difference term between the loss of $\gamma _ { \mathrm { { A } } } = 1$ and the loss of $\gamma _ { \mathrm { { A } } } < 1$ . We also design new benchmarking environments where the sign of the reward function is flipped after a certain time step such that later transitions differ from earlier ones. In that setting, $\gamma _ { \mathrm { { A } } } = 1$ becomes harmful.
|
| 22 |
+
|
| 23 |
+
# 2 BACKGROUND
|
| 24 |
+
|
| 25 |
+
Markov Decision Processes: We consider an infinite horizon MDP with a finite state space $s$ , a finite action space $\mathcal { A }$ , a bounded reward function $r : \mathcal { S } \mathbb { R }$ , a transition kernel $p : \mathcal { S } \times \mathcal { S } \times \mathcal { A } [ 0 , 1 ]$ , an initial state distribution $\mu _ { 0 }$ , and a discount factor $\gamma \in [ 0 , 1 ]$ .2 The initial state $S _ { 0 }$ is sampled from $\mu _ { 0 }$ . At time step $t .$ , an agent in state $S _ { t }$ takes action $A _ { t } \sim \bar { \pi } ( \cdot | S _ { t } )$ , where $\pi : \mathcal { A } \times \mathcal { S } [ 0 , 1 ]$ is the policy it follows. The agent then gets a reward $R _ { t + 1 } \doteq r ( S _ { t } )$ and proceeds to the next state $S _ { t + 1 } \sim p ( \cdot | S _ { t } , A _ { t } )$ . The return of the policy $\pi$ at time step $t$ is defined as $\begin{array} { r } { \bar { G } _ { t } \doteq \sum _ { i = 1 } ^ { \infty } \gamma ^ { i - 1 } R _ { t + i } } \end{array}$ , which allows us to define the state value function $v _ { \pi } ^ { \gamma } ( \bar { S } ) \dot { = } \mathbb { E } [ G _ { t } | S _ { t } = s ]$ and the state-action value function $q _ { \pi } ^ { \gamma } ( s , a ) \dot { = }$ $\mathbb { E } [ G _ { t } | S _ { t } = s , A _ { t } = a ]$ . We consider episodic tasks where we assume there is an absorbing state $s ^ { \infty } \in S$ such that $r ( s ^ { \infty } ) = 0$ and $p ( s ^ { \infty } | s ^ { \infty } , a ) = 1$ holds for any $a \in { \mathcal { A } }$ . When $\gamma < 1$ , $v _ { \pi } ^ { \gamma }$ and $q _ { \pi } ^ { \gamma }$ are always well defined. When $\gamma = 1$ , to ensure $v _ { \pi } ^ { \gamma }$ and $q _ { \pi } ^ { \gamma }$ are well defined, we further assume finite expected episode length. Let $T _ { s } ^ { \pi }$ be a random variable denoting the first time step that an agent hits $s ^ { \infty }$ when following $\pi$ given $S _ { 0 } = s$ . We assume $\begin{array} { r } { T _ { \operatorname* { m a x } } \doteq \operatorname* { s u p } _ { \pi \in \Pi } \operatorname* { m a x } _ { s } \mathbb { E } [ T _ { s } ^ { \pi } ] < \infty , } \end{array}$ , where $\pi$ is parameterized by $\theta$ and $\Pi$ is the corresponding function class. Similar assumptions are also used in stochastic shortest path problems (e.g., Section 2.2 of Bertsekas & Tsitsiklis (1996)). In our experiments, all the environments have a hard time limit of 1000, i.e., $T _ { \mathrm { m a x } } = 1 0 0 0$ . This is standard practice, classic RL environments also have an upper limit on their episode lengths (e.g. $2 7 \mathrm { k }$ in Bellemare et al. (2013, ALE)). Following Pardo et al. (2018), we add the (normalized) time step $t$ in the state to keep the environment Markovian. We measure the performance of a policy $\pi$ with $J _ { \gamma } ( \pi ) \doteq \mathbb { E } _ { S _ { 0 } \sim \mu _ { 0 } } [ \bar { v _ { \pi } ^ { \gamma } } ( S _ { 0 } ) ]$ .
|
| 26 |
+
|
| 27 |
+
Table 1: Roles of the different discount factors
|
| 28 |
+
|
| 29 |
+
<table><tr><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>define the objective</td></tr><tr><td rowspan=1 colspan=1>YA</td><td rowspan=1 colspan=1>update the actor</td></tr><tr><td rowspan=1 colspan=1>Yc</td><td rowspan=1 colspan=1>update the critic</td></tr></table>
|
| 30 |
+
|
| 31 |
+
Vanilla Policy Gradient: Sutton et al. (2000) compute $\nabla _ { \boldsymbol { \theta } } J _ { \gamma } ( \pi )$ as
|
| 32 |
+
|
| 33 |
+
$$
|
| 34 |
+
\begin{array} { r } { \nabla _ { \theta } J _ { \gamma } ( \pi ) \doteq \sum _ { s } d _ { \pi } ^ { \gamma } ( s ) \sum _ { a } q _ { \pi } ^ { \gamma } ( s , a ) \nabla _ { \theta } \pi ( a | s ) , } \end{array}
|
| 35 |
+
$$
|
| 36 |
+
|
| 37 |
+
where $\begin{array} { r } { d _ { \pi } ^ { \gamma } ( s ) \doteq \sum _ { t = 0 } ^ { \infty } \gamma ^ { t } \operatorname* { P r } ( S _ { t } = s | \mu _ { 0 } , p , \pi ) } \end{array}$ for $\gamma < 1$ and $\begin{array} { r } { d _ { \pi } ^ { \gamma } ( s ) \doteq \mathbb { E } [ \sum _ { t = 0 } ^ { T _ { S _ { 0 } } ^ { \pi } } \operatorname* { P r } ( S _ { t } = s | S _ { 0 } , p , \pi ) ] } \end{array}$ for $\gamma = 1$ .3 Note $d _ { \pi } ^ { \gamma }$ remains well-defined for $\gamma = 1$ when $T _ { \mathrm { m a x } } < \infty$ . In order to optimize the policy performance $J _ { \gamma } ( \pi )$ , one can follow (1) and, at time step $t$ , update $\theta _ { t }$ as
|
| 38 |
+
|
| 39 |
+
$$
|
| 40 |
+
\begin{array} { r } { \theta _ { t + 1 } \theta _ { t } + \alpha \gamma _ { \mathrm { A } } ^ { t } q _ { \pi } ^ { \gamma _ { \mathrm { c } } } ( S _ { t } , A _ { t } ) \nabla _ { \theta } \log \pi ( A _ { t } | S _ { t } ) , } \end{array}
|
| 41 |
+
$$
|
| 42 |
+
|
| 43 |
+
where $\alpha$ is a learning rate. If we replace $q _ { \pi } ^ { \gamma _ { \mathrm { c } } }$ with a learned value function, the update rule (2) becomes an actor-critic algorithm, where the actor refers to $\pi$ and the critic refers to the learned approximation of $q _ { \pi } ^ { \gamma _ { \mathrm { c } } }$ . In practice, an estimate for $v _ { \pi } ^ { \gamma _ { \mathrm { c } } }$ instead of $q _ { \pi } ^ { \gamma _ { \mathrm { c } } }$ is usually learned. Theoretically, we should have $\gamma _ { \mathrm { { A } } } = \gamma _ { \mathrm { { C } } } = \gamma$ . Practitioners, however, usually ignore the $\gamma _ { \mathrm { A } } ^ { t }$ term in (2), and use $\gamma _ { \mathrm { c } } < \gamma _ { \mathrm { A } } = 1$ . What this update truly optimizes remains an open problem (Nota & Thomas, 2020).
|
| 44 |
+
|
| 45 |
+
TRPO and PPO: To improve the stability of actor-critic algorithms, Schulman et al. (2015a) propose Trust Region Policy Optimization (TRPO), based on the performance improvement lemma:
|
| 46 |
+
|
| 47 |
+
Lemma 1. (Theorem $I$ in Schulman et al. (2015a)) For $\gamma < 1$ and any two policies $\pi$ and $\pi ^ { \prime }$ ,
|
| 48 |
+
|
| 49 |
+
$$
|
| 50 |
+
\begin{array} { r } { J _ { \gamma } ( \pi ^ { \prime } ) \geq J _ { \gamma } ( \pi ) + \Big ( \sum _ { s } d _ { \pi } ^ { \gamma } ( s ) \sum _ { a } \pi ^ { \prime } ( a | s ) A d \nu _ { \pi } ^ { \gamma } ( s , a ) \Big ) - \frac { 4 \operatorname* { m a x } _ { s , a } | A d \nu _ { \pi } ^ { \gamma } ( s , a ) | \gamma \epsilon ( \pi , \pi ^ { \prime } ) } { ( 1 - \gamma ) ^ { 2 } } , } \end{array}
|
| 51 |
+
$$
|
| 52 |
+
|
| 53 |
+
where $A d \nu _ { \pi } ^ { \gamma } ( s , a ) ~ \doteq ~ \mathbb { E } _ { s ^ { \prime } \sim p ( \cdot \vert s , a ) } [ r ( s ) ~ + ~ \gamma v _ { \pi } ^ { \gamma } ( s ^ { \prime } ) ~ - ~ v _ { \pi } ^ { \gamma } ( s ) ]$ is the advantage, $\begin{array} { r l } { \epsilon ( \pi , \pi ^ { \prime } ) } & { { } \dot { = } } \end{array}$ $\begin{array} { r } { \operatorname* { m a x } _ { s } D _ { K L } ( \pi ( \cdot | s ) | | \pi ^ { \prime } ( \cdot | s ) ) } \end{array}$ , and $D _ { K L }$ refers to the $K L$ divergence.
|
| 54 |
+
|
| 55 |
+
To facilitate our empirical study, we first make a theoretical contribution by extending Lemma 1 to the undiscounted setting. We have the following lemma:
|
| 56 |
+
|
| 57 |
+
Lemma 2. Assuming $T _ { \mathrm { m a x } } < \infty ,$ , for $\gamma = 1$ and any two policies $\pi$ and $\pi ^ { \prime }$ ,
|
| 58 |
+
|
| 59 |
+
$$
|
| 60 |
+
\begin{array} { r } { J _ { \gamma } ( \pi ^ { \prime } ) \geq J _ { \gamma } ( \pi ) + \Big ( \sum _ { s } d _ { \pi } ^ { \gamma } ( s ) \sum _ { a } \pi ^ { \prime } ( a | s ) A d \nu _ { \pi } ^ { \gamma } ( s , a ) \Big ) - 4 \operatorname* { m a x } _ { s , a } | A d \nu _ { \pi } ^ { \gamma } ( s , a ) | T _ { \operatorname* { m a x } } ^ { 2 } \epsilon ( \pi , \pi ^ { \prime } ) . } \end{array}
|
| 61 |
+
$$
|
| 62 |
+
|
| 63 |
+
The proof of Lemma 2 is provided in the appendix. A practical implementation of Lemmas 1 and 2 is to compute a new policy $\theta$ via gradient ascent on the clipped objective:
|
| 64 |
+
|
| 65 |
+
$$
|
| 66 |
+
\begin{array} { r } { L ( \theta ) \doteq \sum _ { t = 0 } ^ { \infty } \gamma _ { \mathrm { A } } ^ { t } \operatorname* { m i n } \Big \{ \frac { \pi _ { \theta } ( A _ { t } | S _ { t } ) } { \pi _ { \theta _ { \mathrm { o d } } } ( A _ { t } | S _ { t } ) } \mathrm { A d } \mathrm { v } _ { \pi _ { \theta _ { \mathrm { o d } } } } ^ { \gamma _ { \mathrm { c } } } ( S _ { t } , A _ { t } ) , \mathrm { c l i p } ( \frac { \pi _ { \theta } ( A _ { t } | S _ { t } ) } { \pi _ { \theta _ { \mathrm { o d } } } ( A _ { t } | S _ { t } ) } ) \mathrm { A d } \mathrm { v } _ { \pi _ { \theta _ { \mathrm { o d } } } } ^ { \gamma _ { \mathrm { c } } } ( S _ { t } , A _ { t } ) \Big \} , } \end{array}
|
| 67 |
+
$$
|
| 68 |
+
|
| 69 |
+
where $S _ { t }$ and $A _ { t }$ are sampled from $\pi _ { \theta _ { \mathrm { o l d } } }$ , and $\mathrm { c l i p } ( x ) \doteq \operatorname* { m a x } ( \operatorname* { m i n } ( x , 1 + \epsilon ) , 1 - \epsilon )$ with $\epsilon$ a hyperparameter. Theoretically, we should have $\gamma _ { \mathrm { { A } } } = \gamma _ { \mathrm { { C } } }$ , but practical algorithms like Proximal Policy Optimization (Schulman et al., 2017, PPO) usually use $\gamma _ { \mathrm { c } } < \gamma _ { \mathrm { A } } = 1$ .
|
| 70 |
+
|
| 71 |
+
Policy Evaluation: We now introduce several policy evaluation techniques we use in our empirical study. Let $\hat { v }$ be our estimate of $v _ { \pi } ^ { \gamma }$ . At time step $t$ , Temporal Difference learning (TD, Sutton (1988)) updates $\hat { v }$ as $\hat { v } ( S _ { t } ) \gets \hat { v } ( S _ { t } ) + \alpha ( R _ { t + 1 } + \gamma \hat { v } ( S _ { t + 1 } ) - \hat { v } ( S _ { t } ) )$ . Instead of the infinite horizon discounted return $G _ { t }$ , De Asis et al. (2019) propose to consider the $H$ -step return $\begin{array} { r } { G _ { t } ^ { H } \doteq \sum _ { i = 1 } ^ { H } R _ { t + i } } \end{array}$ . Correspondingly, the $H$ -step value function is defined as $v _ { \pi } ^ { H } ( s ) \doteq \mathbb { E } [ G _ { t } ^ { H } | S _ { t } = s ]$ . We let $\hat { v } ^ { H }$ be our estimate of $v _ { \pi } ^ { \widetilde { H } }$ . At time step $t$ , De Asis et al. (2019) use the following update rule to learn $\hat { v } ^ { H }$ :
|
| 72 |
+
|
| 73 |
+
$$
|
| 74 |
+
\hat { v } ^ { i } ( S _ { t } ) \gets \hat { v } ^ { i } ( S _ { t } ) + \alpha ( R _ { t + 1 } + \hat { v } ^ { i - 1 } ( S _ { t + 1 } ) - \hat { v } ^ { i } ( S _ { t } ) ) \quad ( i = 1 , \dots H ) ,
|
| 75 |
+
$$
|
| 76 |
+
|
| 77 |
+
where $\hat { v } ^ { 0 } ( s ) \\\\\\\\\\ \stackrel { . } { = } \ 0$ . In other words, to learn $\hat { v } ^ { H }$ , we need to learn $\{ \hat { v } ^ { i } \} _ { i = 1 , \dots , H }$ simultaneously.
|
| 78 |
+
De Asis et al. (2019) call (4) Fixed Horizon Temporal $D$ ifference learning (FHTD).
|
| 79 |
+
|
| 80 |
+
As $G _ { t }$ is a random variable, Bellemare et al. (2017) propose to learn its full distribution instead of its expectation only, yielding the Distributional Reinforcement Learning (RL) paradigm. They use a categorical distribution with 51 atoms uniformly distributed in $[ - V _ { \mathrm { m a x } } , V _ { \mathrm { m a x } } ]$ to approximate the distribution of $G _ { t }$ , where $V _ { \mathrm { m a x } }$ is a hyperparameter. In this paper, we refer to the corresponding policy evaluation algorithm as C51.
|
| 81 |
+
|
| 82 |
+
Methodology: We consider MuJoCo robot simulation tasks from OpenAI gym (Brockman et al., 2016) as our benchmark. Given its popularity in understanding deep RL algorithms (Henderson et al., 2017; Ilyas et al., 2018; Engstrom et al., 2019; Andrychowicz et al., 2020) and designing new deep RL algorithms (Fujimoto et al., 2018; Haarnoja et al., 2018), we believe our empirical results are relevant to most practitioners.
|
| 83 |
+
|
| 84 |
+
We choose PPO, a simple yet effective and widely used algorithm, as the representative actor-critic algorithm for our empirical study. PPO is usually equipped with generalized advantage estimation (Schulman et al., 2015b, GAE), which has a tunable hyperparameter $\hat { \gamma }$ . The roles of $\gamma$ and $\hat { \gamma }$ are similar. To reduce its confounding effect, we do not use GAE in our experiments, $i . e .$ , the advantage estimation for our actor is simply the TD error $R _ { t + 1 } + \gamma _ { \mathrm { c } } \hat { v } ( S _ { t + 1 } ) - \hat { v } ( \bar { S } _ { t } )$ . The PPO pseudocode we follow is provided in Alg. 1 in the appendix and we refer to it as the default PPO implementation.
|
| 85 |
+
|
| 86 |
+
We use the standard architecture and optimizer across all tasks, in particular, the actor and the critic do not share layers. We conduct a thorough learning rate search in $\mathrm { a n t }$ for each algorithmic configuration (i.e., a curve in a figure) and then use the same learning rate for all other tasks. When using FHTD and C51, we also include $H$ and $V _ { \mathrm { m a x } }$ in the grid search. All details are provided in the appendix. We report the average episode return of the ten most recent episodes against the number of interactions with the environment. Curves are averages over ten independent runs with shaded regions indicating standard errors.
|
| 87 |
+
|
| 88 |
+
# 3 OPTIMIZING THE UNDISCOUNTED OBJECTIVE (SCENARIO 1)
|
| 89 |
+
|
| 90 |
+
When our goal is to optimize the undiscounted objective $J _ { \gamma = 1 } ( \pi )$ , one theoretically grounded option is to use $\gamma _ { \mathrm { { A } } } = \gamma _ { \mathrm { { C } } } = \gamma = 1$ . By using $\gamma _ { \mathrm { { A } } } = 1$ and $\gamma _ { \mathrm { c } } < 1$ , practitioners introduce bias. We first empirically confirm that introducing bias in this way indeed has empirical advantages. A simple first hypothesis is that $\gamma _ { \mathrm { c } } < 1$ leads to lower variance in Monte Carlo return bootstrapping targets than $\gamma _ { \mathrm { c } } = 1$ , it thus optimizes a bias-variance trade-off. However, we further show that there are empirical advantages from $\gamma _ { \mathrm { c } } < 1$ that cannot uniquely be explained by this bias-variance trade-off, indicating that there are additional factors beyond variance. We then show empirical evidence identifying representation learning as an additional factor, leading to the bias-variance-representation trade-off from Hypothesis 1. All the experiments in this section use $\gamma _ { \mathrm { { A } } } = 1$ .
|
| 91 |
+
|
| 92 |
+

|
| 93 |
+
Figure 1: The default PPO implementation with different discount factors.
|
| 94 |
+
|
| 95 |
+

|
| 96 |
+
Figure 2: Comparison between PPO and PPO-TD when $\gamma _ { \mathrm { c } } = 1$
|
| 97 |
+
|
| 98 |
+

|
| 99 |
+
Figure 3: PPO-TD with different discount factors.
|
| 100 |
+
|
| 101 |
+
Bias-variance trade-off: To investigate the advantages of using $\gamma _ { \mathrm { c } } < 1$ , we first test default PPO with $\gamma _ { \mathrm { c } } \in \lbrace 0 . 9 5 , 0 . 9 7 , 0 . 9 9 , 0 . 9 9 5 , 1 \rbrace$ . We find that the best discount factor is always with $\gamma _ { \mathrm { c } } < 1$ and that $\gamma _ { \mathrm { c } } ~ = ~ 1$ usually leads to a performance drop (Figure 1). In default PPO, although the advantage is computed as the one-step TD error, the update target for updating the critic $\hat { v } ( S _ { t } )$ is almost always a Monte Carlo return. As there is no $\gamma _ { \mathrm { A } } ^ { t }$ term in the actor update, we should theoretically use $\gamma _ { \mathrm { c } } = \gamma _ { \mathrm { A } } = 1$ when computing the Monte Carlo return, which usually leads to high variance. Consequently, a simple hypothesis for the empirical advantages of using $\gamma _ { \mathrm { c } } < 1$ is a bias-variance trade-off. We find, however, that there is more at play.
|
| 102 |
+
|
| 103 |
+
Beyond bias-variance trade-off: To reduce the effect of $\gamma _ { \mathrm { c } }$ in controlling the variance, we benchmark PPO-TD (Algorithm 2 in the appendix). PPO-TD is the same as default PPO except that the critic is updated with one-step TD, i.e., the update target for $\hat { v } ( S _ { t } )$ is now $R _ { t + 1 } + \gamma _ { \mathrm { c } } \hat { v } ( \bar { S } _ { t + 1 } )$ . Although Figure 2 shows that PPO-TD $( \gamma _ { \mathrm { c } } = 1 )$ ) outperforms PPO ( $\gamma _ { \mathrm { c } } = 1 $ ) by a large margin, indicating bias-variance may be at play, Figure 3 suggests that for PPO-TD as well, $\gamma _ { \mathrm { c } } < 1$ is still preferable to $\gamma _ { \mathrm { c } } = 1$ . To further study this phenomenon, we benchmark PPO-TD-Ex (Algorithm 3 in the appendix), in which we provide $N$ extra transitions to the critic by sampling multiple actions at any single state and using an averaged bootstrapping target. The update target for $\hat { v } ( S _ { t } )$ in PPO-TD$\operatorname { E x }$ is $\begin{array} { r } { \frac { 1 } { N + 1 } \sum _ { i = 0 } ^ { N } R _ { t + 1 } ^ { i } + \gamma _ { \mathrm { c } } \hat { v } ( S _ { t + 1 } ^ { i } ) } \end{array}$ . Here $R _ { t + 1 } ^ { 0 }$ and $S _ { t + 1 } ^ { 0 }$ refer to the original reward and successor state. To get $R _ { t + 1 } ^ { i }$ and $S _ { t + 1 } ^ { i }$ for $i \in \{ 1 , \ldots , N \}$ , we first sample an action $A _ { t } ^ { i }$ from the sampling policy, then reset the environment to $S _ { t }$ , and finally execute $A _ { t } ^ { i }$ to get $R _ { t + 1 } ^ { i }$ and $S _ { t + 1 } ^ { i }$ . Importantly, we do not count those $N$ extra transitions in the $x$ -axis when plotting. The advantage for the actor update in PPO-TD- $\mathbf { \nabla } \cdot \mathbf { E x }$ is estimated with $R _ { t + 1 } ^ { 0 } + \hat { v } ( S _ { t + 1 } ^ { 0 } ) - \hat { v } ( S _ { t } )$ regardless of $\gamma _ { \mathrm { { C } } }$ to further control the influence of variance. The critic $\hat { v }$ is not trained on the extra successor states $\{ S _ { t + 1 } ^ { i } \} _ { i = 1 , \dots , N }$ .
|
| 104 |
+
|
| 105 |
+

|
| 106 |
+
Figure 4: PPO-TD-Ex $\langle \gamma _ { \mathrm { c } } = 0 . 9 9 ,$ ).
|
| 107 |
+
|
| 108 |
+

|
| 109 |
+
Figure 5: PPO-TD-Ex $( \gamma _ { \mathrm { { c } } } = 1 )$ ).
|
| 110 |
+
|
| 111 |
+
So the quality of the prediction $\hat { v } ( S _ { t + 1 } ^ { i } )$ depends mainly on the generalization of $\hat { v }$ . Intuitively, if $\hat { v }$ generalizes well, providing proper amount of transitions this way should improve or maintain the overall performance as they help reduce variance. As shown by Figure 4, PPO-TD- $\mathbf { \nabla } \cdot \mathbf { E x }$ $\langle \gamma _ { \mathrm { c } } = 0 . 9 9 \rangle$ ) roughly follows this intuition. However, surprisingly, providing extra data to PPO-TD-Ex $( \gamma _ { \mathrm { { C } } } = 1 $ ) leads to a significant performance drop (Figure 5). This drop suggests that the larger variance from the randomness of $S _ { t + 1 }$ is not the only issue when using $\gamma _ { \mathrm { c } } = 1$ to train the critic. The quality of the estimate $\hat { v }$ , at least in terms of making prediction on untrained states $\{ S _ { t + 1 } ^ { i } \} _ { 1 , \dots , N }$ , is lower when $\gamma _ { \mathrm { c } } = 1$ is used than $\gamma _ { \mathrm { c } } < 1$ . In other words, the generalization of $\hat { v }$ is poor when $\gamma _ { \mathrm { c } } = 1$ . The curves for PPO-TD-Ex $( \gamma _ { \mathrm { c } } = 0 . 9 9 5 )$ are a mixture of $\gamma _ { \mathrm { c } } = 0 . 9 9$ and $\gamma _ { \mathrm { c } } = 1$ and are provided in Figure 16 in the appendix.
|
| 112 |
+
|
| 113 |
+
In the undiscounted setting, we should theoretically have $R _ { t + 1 } + \hat { v } ( S _ { t + 1 } )$ as the update target for the critic. When $\gamma _ { \mathrm { c } } ~ < ~ 1$ is used instead, the update target becomes $R _ { t + 1 } + \gamma _ { \mathrm { c } } \hat { v } ( S _ { t + 1 } )$ and the variance resulting from the randomness of $S _ { t + 1 }$ becomes less pronounced. So here, $\gamma _ { \mathrm { { C } } }$ trades off bias with variance, similar to that in Monte Carlo return bootstrapping targets in default PPO. We refer to this effect of $\gamma _ { \mathrm { { C } } }$ as variance control. However, $\gamma _ { \mathrm { { C } } }$ can also affect the difficulty of learning a good estimate $\hat { v }$ for $v _ { \pi } ^ { \gamma _ { \mathrm { c } } }$ ; we refer to this effect of $\gamma _ { \mathrm { { C } } }$ as learnability control (Lehnert et al., 2018; Laroche $\&$ van Seijen, 2018; Romoff et al., 2019). Inspired by the poor generalization of $\hat { v }$ when $\gamma _ { \mathrm { c } } = 1$ , we investigate learnability control mainly from the representation learning perspective. By representation learning, we refer to learning the bottom layers (backbone) of a neural network. The last layer of the neural network is then interpreted as a linear function approximator whose features are the output of the backbone. This interpretation of representation learning is widely used in the RL community, see e.g. Jaderberg et al. (2016); Chung et al. (2018); Veeriah et al. (2019).
|
| 114 |
+
|
| 115 |
+
Bias-representation trade-off: To separate variance control and learnability control, ideally we should investigate the update target $R _ { t + 1 } + \gamma _ { \mathrm { c } , 1 } \hat { v } ( S _ { t + 1 } )$ , where $\hat { v }$ is trained to approximate $\dot { v } _ { \pi } ^ { \gamma _ { \mathrm { c } , 2 } }$ and $\gamma _ { \mathrm { c } , 2 } < \gamma _ { \mathrm { c } , 1 } = 1$ . Learning an estimate $\hat { v }$ for $v _ { \pi } ^ { \gamma _ { \mathrm { c } , 2 } }$ , however, implies to use the update target $R _ { t + 1 } + \gamma _ { \mathrm { c } , 2 } \hat { v } ( S _ { t + 1 } )$ : the two effects of $\gamma _ { \mathrm { C } , 2 }$ then get mixed again. To solve this dilemma, we consider the update target $R _ { t + 1 } + \hat { v } ^ { H - 1 } ( S _ { t + 1 } )$ , where $\hat { v } ^ { H - 1 } ( S _ { t + 1 } )$ is trained to approximate $v _ { \pi } ^ { H - 1 }$ , i.e., we use FHTD to train the critic in PPO, which we refer to as PPO-FHTD (Algorithm 4 in the appendix). PPO-FHTD implements $\gamma _ { \mathrm { c } , 1 } = 1$ directly, and manipulating $H$ changes the horizon of the policy evaluation problem, which is also one of the effects of manipulating $\gamma _ { \mathrm { C } , 2 }$ .
|
| 116 |
+
|
| 117 |
+
We test two parameterizations for PPO-FHTD to investigate representation learning. In the first parameterization, to learn $v _ { \pi } ^ { H }$ , we parameterize $\{ v _ { \pi } ^ { i } \} _ { i = 1 , \dots , H }$ as $H$ different heads over the same representation layer (backbone). In the second parameterization, we always learn $\{ v _ { \pi } ^ { i } \} _ { i = 1 , \ldots , 1 0 2 4 }$ as 1024 different heads over the same representation layer, whatever $H$ we are interested in. To approximate $v _ { \pi } ^ { H }$ , we then simply use the output of the $H$ -th head. A diagram (Figure 13) in the appendix further illustrates the difference between the two parameterizations.
|
| 118 |
+
|
| 119 |
+
Figure 6 shows that by tuning $H$ for FHTD, PPO-FHTD with the first parameterization matches or exceeds the performance of PPO-TD $\mathit { \Phi } _ { \mathrm { ( \gamma _ { c } } } < 1 \mathit { \check { ) } } _ { , }$ ) in most tasks, and that the best $H$ is always smaller than 1024. Theoretically, as long as we use an $H \ \geq \ T _ { \mathrm { m a x } } \ = \ 1 0 0 0$ , we always have $v _ { \pi } ^ { H } ( s ) \equiv v _ { \pi } ^ { \gamma = 1 } ( s )$ . Figure 6 shows that the performance of PPO-FHTD $H = 1 0 2 4 )$ ) is very close to PPO-TD $\gamma _ { \mathrm { c } } = 1 _ { . }$ ), indicating that learning $\{ v _ { \pi } ^ { i } \} _ { i = 1 , \ldots , 1 0 2 3 }$ is not an additional overhead for the network in terms of learning $v _ { \pi } ^ { H = 1 0 2 4 }$ , i.e., increasing $H$ does not pose additional challenges in terms of network capacity. However, Figure 7 suggests that for the second parameterization, $H = 1 0 2 4$ is almost always among the best choices of $H$ . Comparing Figures 6 and 7, we conclude that in the tested domains, learning $v _ { \pi } ^ { H }$ with different $H$ requires different representations. This suggests that we can interpret the results in Figure 6 as a bias-representation trade-off. Using a larger $H$ is less biased but representation learning may become harder due to the longer policy evaluation horizon. Consequently, an intermediate $H$ achieves the best performance in Figure 6. As reducing $H$ cannot bring in advantages in representation learning under the second parameterization, the less biased $H$ , i.e., the larger $H$ , usually performs better in Figure 7. Overall, $\gamma _ { \mathrm { { C } } }$ optimizes a bias-representation trade-off by changing the policy evaluation horizon $H$ .
|
| 120 |
+
|
| 121 |
+

|
| 122 |
+
Figure 6: PPO-FHTD with the first parameterization. The best $H$ and $\gamma _ { \mathrm { c } }$ are used for each game.
|
| 123 |
+
|
| 124 |
+

|
| 125 |
+
Figure 7: PPO-FHTD with the second parameterization.
|
| 126 |
+
|
| 127 |
+

|
| 128 |
+
Figure 8: A simple MRP.
|
| 129 |
+
|
| 130 |
+
We further conjecture that representation learning may be harder for a longer horizon because good representations can become rarer. We provide a simulated example to support this. Consider policy evaluation on the simple Markov Reward Process (MRP) from Figure 8. We assume the reward for each transition is fixed and is randomly generated in $[ 0 , 1 ]$ . Let $x _ { s } \in \mathbb { R } ^ { K }$ be the feature vector for a state $s$ ; we set its $i$ -th component as $x _ { s } [ i ] \doteq \operatorname { t a n h } ( \xi )$ , where $\xi$ is a random variable uniformly distributed in $[ - 2 , - 2 ]$ . We chose this feature setup as we use tanh as the activation function in our PPO. We use $\hat { \boldsymbol X } \in \mathbb { R } ^ { N \times K }$ to denote the feature matrix. To create state aliasing (McCallum, 1997), which is common under function approximation, we first randomly split the $N$ states into $S _ { 1 }$ and $S _ { 2 }$ such that $| S _ { 1 } | = \alpha N$ and $| S _ { 2 } | = ( 1 - \alpha ) N$ , where $\alpha$ is the proportion of states to be aliased. Then for every $s \in S _ { 1 }$ , we randomly select an $\hat { s } \in S _ { 2 }$ and set $x _ { s } \gets x _ { \hat { s } }$ . Finally, we add Gaussian noise $\mathcal { N } ( 0 , \dot { 0 } . 1 ^ { 2 } )$ to each element of $X$ . We use $N = 1 0 0$ and $K = 3 0$ in our simulation and report the normalized representation error (NRE) as a function of $\gamma$ . For a feature matrix $X$ , the NRE is computed analytically as $\begin{array} { r } { \mathrm { N R E } ( \gamma ) \doteq \frac { \operatorname* { m i n } _ { w } | | X w - v _ { \gamma } | | _ { 2 } } { | | v _ { \gamma } | | _ { 2 } } } \end{array}$ .= minw ||Xw−vγ ||2||v || , where vγ is the analytically computed true value function of the MRP. We report the results in Figure 9, where each data point is averaged over $1 0 ^ { 4 }$ randomly generated feature matrices $( X )$ and reward functions. In this MRP, the average representation error becomes larger as $\gamma$ increases, which suggests that learning a good representation under a large $\gamma$ and state aliasing may be harder than with a smaller $\gamma$ . We report the unnormalized representation error in Figure 17 in the appendix, where the trend is much clearer.
|
| 131 |
+
|
| 132 |
+
Overall, though we do not claim that there is a monotonic relationship between the discount factor and the difficulty of representation learning, our empirical study does suggest that representation learning is a key factor at play in the misuse of the discounting in actor-critic algorithms, beyond the widely recognized bias-variance trade-off. In the appendix, we provide additional experiments involving distributional RL to further support the bias-variance-representation trade-off hypothesis, under the assumption that the benefits of distributional RL comes mainly from the improved representation learning (Bellemare et al., 2017; Munos, 2018; Petroski Such et al., 2019).
|
| 133 |
+
|
| 134 |
+

|
| 135 |
+
Figure 9: Normalized representation error as a function of the discount factor. Shaded regions indicate one standard derivation. 4
|
| 136 |
+
|
| 137 |
+

|
| 138 |
+
4 OPTIMIZING THE DISCOUNTED OBJECTIVE (SCENARIO 2)
|
| 139 |
+
Figure 10: Comparison between PPO and DisPPO with $\gamma = 0 . 9 9 5$
|
| 140 |
+
|
| 141 |
+
When our goal is to optimize the discounted objective $J _ { \gamma < 1 } ( \pi )$ , theoretically we should have the $\gamma _ { \mathrm { A } } ^ { t }$ term in the actor update and use $\gamma _ { \mathrm { c } } ~ < ~ 1$ . Practitioners, however, usually ignore this $\gamma _ { \mathrm { A } } ^ { t }$ (i.e., set $\gamma _ { \mathrm { { A } } } = 1 $ ), introducing bias. Figure 10 shows that even if we use the discounted return as the performance metric, the biased implementation of PPO still outperforms the theoretically grounded implementation DisPPO in the domains we tested. Here PPO refers to the default PPO implementation where $\gamma _ { \mathrm { { A } } } = 1 , \gamma _ { \mathrm { { C } } } = \gamma < 1$ , and DisPPO (Alg. 6 in the appendix) adds the missing $\gamma _ { \mathrm { A } } ^ { t }$ term in PPO by using $\gamma _ { \mathrm { { A } } } = \gamma _ { \mathrm { { C } } } = \gamma < 1$ . We propose to interpret the empirical advantages of PPO over DisPPO with Hypothesis 2. For all experiments in this section, we use $\gamma _ { \mathrm { c } } = \gamma < 1$ .
|
| 142 |
+
|
| 143 |
+
An auxiliary task perspective: The biased policy update implementation of (2) ignoring $\gamma _ { \mathrm { A } } ^ { t }$ can be decomposed into two parts as $\Delta _ { t } = \gamma ^ { t } \Delta _ { t } + \mathsf { \bar { ( } 1 - } \mathsf { \bar { \gamma } } ^ { t } \mathsf { \bar { ) } } \Delta _ { t }$ , where $\Delta _ { t } \doteq q _ { \pi } ^ { \gamma _ { \mathrm { c } } } ( S _ { t } , A _ { t } ) \nabla _ { \theta } \log \pi ( \boldsymbol { A } _ { t } | S _ { t } )$ . We propose to interpret the difference term between the biased implementation $( \Delta _ { t } )$ and the theoretically grounded implementation $( \gamma ^ { t } \Delta _ { t } )$ , i.e., the $( 1 - \gamma ^ { t } ) q _ { \pi } ^ { \gamma _ { \mathrm { c } } } ( S _ { t } , \bar { A _ { t } } ) \nabla _ { \theta } \log \pi ( A _ { t } | S _ { t } )$ term, as the gradient of an auxiliary objective with a dynamic weighting $1 - \gamma ^ { t }$ . Let $\begin{array} { r } { J _ { s , \mu } ( \pi ) \doteq \sum _ { a } \pi ( a | s ) q _ { \mu } ^ { \gamma } ( s , a ) } \end{array}$ ; we have $\nabla _ { \boldsymbol { \theta } } J _ { s , \mu } ( \pi ) | _ { \mu = \pi } = \mathbb { E } _ { a \sim \pi ( \cdot | s ) } [ q _ { \pi } ^ { \gamma } ( s , a ) \nabla _ { \boldsymbol { \theta } } \log \pi ( a | s ) ]$ . This objective changes every time step (through $\mu _ { . }$ ). Inspired by the decomposition, we augment PPO with this auxiliary task, yielding AuxPPO (Algorithm 7 and Figure 13 in the appendix). In AuxPPO, we have two policies $\pi$ and $\pi ^ { \prime }$ parameterized by $\theta$ and $\theta ^ { \prime }$ respectively. The two policies are two heads over the same neural network backbone, where $\pi$ is used for interaction with the environment and $\pi ^ { \prime }$ is the policy for the auxiliary task. AuxPPO optimizes $\theta$ and $\theta ^ { \prime }$ simultaneously by considering the following joint loss
|
| 144 |
+
|
| 145 |
+
$$
|
| 146 |
+
\begin{array} { r l } & { L ( \theta , \theta ^ { \prime } ) \doteq \sum _ { t = 0 } ^ { \infty } \gamma ^ { t } \operatorname* { m i n } \Big \{ \frac { \pi _ { \theta } ( A _ { t } | S _ { t } ) } { \pi _ { \theta _ { \mathrm { o d d } } } ( A _ { t } | S _ { t } ) } \mathrm { A d } \mathrm { v } _ { \pi _ { \theta _ { \mathrm { o d d } } } } ^ { \gamma _ { c } } ( S _ { t } , A _ { t } ) , \mathrm { c l i p } ( \frac { \pi _ { \theta } ( A _ { t } | S _ { t } ) } { \pi _ { \theta _ { \mathrm { o d d } } } ( A _ { t } | S _ { t } ) } ) \mathrm { A d } \mathrm { v } _ { \pi _ { \theta _ { \mathrm { o d d } } } } ^ { \gamma _ { c } } ( S _ { t } , A _ { t } ) \Big \} + } \\ & { \qquad \sum _ { t = 0 } ^ { \infty } ( 1 - \gamma ^ { t } ) \operatorname* { m i n } \Big \{ \frac { \pi _ { \theta ^ { \prime } } ( A _ { t } | S _ { t } ) } { \pi _ { \theta _ { \mathrm { o d d } } } ( A _ { t } | S _ { t } ) } \mathrm { A d } \mathrm { v } _ { \pi _ { \theta _ { \mathrm { o d d } } } } ^ { \gamma _ { c } } ( S _ { t } , A _ { t } ) , \mathrm { c l i p } ( \frac { \pi _ { \theta ^ { \prime } } ( A _ { t } | S _ { t } ) } { \pi _ { \theta _ { \mathrm { o d d } } } ( A _ { t } | S _ { t } ) } ) \mathrm { A d } \mathrm { v } _ { \pi _ { \theta _ { \mathrm { o d d } } } } ^ { \gamma _ { c } } ( S _ { t } , A _ { t } ) \Big \} , } \end{array}
|
| 147 |
+
$$
|
| 148 |
+
|
| 149 |
+
where $S _ { t }$ and $A _ { t }$ are obtained by executing $\theta _ { \mathrm { o l d } }$ . We additionally synchronize $\theta ^ { \prime }$ with $\theta$ periodically to avoid an off-policy learning issue.
|
| 150 |
+
|
| 151 |
+
Flipped rewards: Besides AuxPPO, we also design novel environments with flipped rewards to investigate Hypothesis 2. Recall we include the time step in the state, this allows us to simply create a new environment by defining a new reward function $r ^ { \prime } ( s , t ) \doteq r ( s ) \mathbb { I } _ { t \le t _ { 0 } } - r ( s ) \mathbb { I } _ { t > t _ { 0 } }$ , where $\mathbb { I }$ is the indicator function. During an episode, within the first $t _ { 0 }$ steps, this new environment is the same as the original one. After $t _ { 0 }$ steps, the sign of the reward is flipped. We select $t _ { 0 }$ such that $\gamma ^ { t _ { 0 } }$ is sufficiently small, e.g., we define $t _ { 0 } \doteq \mathrm { m i n } _ { t } \{ \gamma ^ { t } < 0 . 0 5 \}$ . With this criterion for selecting $t _ { 0 }$ , the later transitions (i.e., transitions after $t _ { 0 }$ steps) have little influence on the evaluation objective, the discounted return. Consequently, the later transitions affect the overall learning process mainly through representation learning. DisPPO rarely makes use of the later transitions due to the $\gamma _ { \mathrm { A } } ^ { \dot { t } }$ term in the gradient update. AuxPPO makes use of the later transitions only through representation learning. PPO exploits the later transitions for representation learning and the later transitions also affect the control policy of PPO directly.
|
| 152 |
+
|
| 153 |
+

|
| 154 |
+
Figure 11: Curves without any marker are obtained in the original Ant $/$ HalfCheetah. Diamond-marked curves are obtained in Ant / HalfCheetah with $r ^ { \prime }$ . 5
|
| 155 |
+
|
| 156 |
+
Results: When we consider the original environments, Figure 11 shows that in 8 out 12 tasks, PPO outperforms DisPPO, even if the performance metric is the discounted episodic return. In all those 8 tasks, by using the difference term as an auxiliary task, AuxPPO is able to improve upon DisPPO. In 6 out of those 8 tasks, AuxPPO is able to roughly match the performance of PPO at the end of training. For $\gamma \in \{ 0 . 9 3 , 0 . 9 \}$ in Ant, the improvement of AuxPPO is not clear and we conjecture that this is because the learning of the $\pi$ -head (the control head) in AuxPPO is much slower than the learning of $\pi$ in PPO due to the $\gamma _ { \mathrm { c } } ^ { t }$ term. Overall, this suggests that the benefit of PPO over DisPPO comes mainly from representation learning.
|
| 157 |
+
|
| 158 |
+
When we consider the environments with flipped rewards, PPO is outperformed by DisPPO and AuxPPO by a large margin in 11 out of 12 tasks. The transitions after $t _ { 0 }$ steps are not directly relevant when the performance metric is the discounted return. However, learning on those transitions may still improve representation learning provided that those transitions are similar to the earlier transitions, which is the case in the original environments. PPO and AuxPPO, therefore, outperform DisPPO. However, when those transitions are much different from the earlier transitions, which is the case in the environments with flipped rewards, learning to control on them directly becomes distracting. PPO, therefore, is outperformed by DisPPO. Different from PPO, AuxPPO does not learn to control on later transitions. Provided that the network has enough capacity, the control head $\pi _ { \theta }$ in AuxPPO will not be affected much by the irrelevant transitions. The performance of AuxPPO is, therefore, similar to DisPPO.
|
| 159 |
+
|
| 160 |
+
To summarize, Figure 11 suggests that using $\gamma _ { \mathrm { { A } } } = 1$ is simply an inductive bias that all transitions are equally important. When this inductive bias is helpful for learning, $\gamma _ { \mathrm { { A } } } = 1$ implicitly implements auxiliary tasks thus improving representation learning and the overall performance. When this inductive bias is detrimental, however, $\gamma _ { \mathrm { { A } } } = 1$ can lead to significant performance drops. AuxPPO appears to be a safe choice that does not depend much on the correctness of this inductive bias.
|
| 161 |
+
|
| 162 |
+
# 5 RELATED WORK
|
| 163 |
+
|
| 164 |
+
The mismatch in actor-critic algorithm implementations has been previously studied. Thomas (2014) focuses on the natural policy gradient setting and shows that the biased implementation ignoring $\gamma _ { \mathrm { A } } ^ { t }$ can be interpreted as the gradient of the average reward objective under a strong assumption that the state distribution is independent of the policy. Nota & Thomas (2020) prove that without this strong assumption, the biased implementation is not the gradient of any stationary objective. This does not contradict our auxiliary task perspective as our objective $J _ { s , \mu } ( \pi )$ changes at every time step. Nota & Thomas (2020) further provide a counterexample showing that following the biased gradient can lead to a policy of poor performance w.r.t. both discounted and undiscounted objectives. Both Thomas (2014) and Nota & Thomas (2020), however, focus on theoretical disadvantages of the biased gradient and regard ignoring $\gamma _ { \mathrm { A } } ^ { t }$ as the source of the bias. We instead regard the introduction of $\gamma _ { \mathrm { c } } < 1$ in the critic as the source of the bias in the undiscounted setting and investigate its empirical advantages, which are more relevant to practitioners. Moreover, our representation learning perspective for investigating this mismatch is to our knowledge novel.
|
| 165 |
+
|
| 166 |
+
Although we propose the bias-variance-representation trade-off, we do not claim that is all that $\gamma$ affects. The discount factor also has many other effects (e.g., Sutton (1995); Jiang et al. (2016); Laroche et al. (2017); Laroche $\&$ van Seijen (2018); Lehnert et al. (2018); Fedus et al. (2019); Van Seijen et al. (2019); Amit et al. (2020)), which we leave for future work. In Scenario 1, using $\gamma _ { \mathrm { c } } < 1$ helps reduce the variance. Variance reduction in RL itself is an active research area (see, e.g., Papini et al. (2018); $\mathrm { X u }$ et al. (2019); Yuan et al. (2020)). Investigating those variance reduction techniques with $\gamma _ { \mathrm { c } } = 1$ is a possibility for future work. Recently, Bengio et al. (2020) study the effect of the bootstrapping parameter $\lambda$ in $\mathrm { T D } ( \lambda )$ in generalization. Our work studies the effect of the discount factor $\gamma$ in representation learning in the context of the misuse of the discounting in actor-critic algorithms, sharing a similar spirit of Bengio et al. (2020).
|
| 167 |
+
|
| 168 |
+
# 6 CONCLUSION
|
| 169 |
+
|
| 170 |
+
In this paper, we investigate the longstanding mismatch between theorists and practitioners in actorcritic algorithms from a representation learning perspective. Although the theoretical understanding of policy gradient algorithms have recently been significantly advanced (Agarwal et al., 2019; Wu et al., 2020), this mismatch has drawn little attention. We hope our empirical study can help practitioners understand actor-critic algorithms better and therefore design more efficient actor-critic algorithms in the setting of deep RL, where representation learning emerges as a major consideration. We hope our empirical study can draw more attention to the mismatch, which could enable the community to finally close this longstanding gap.
|
| 171 |
+
|
| 172 |
+
# REFERENCES
|
| 173 |
+
|
| 174 |
+
Joshua Achiam. Spinning up in deep reinforcement learning. 2018.
|
| 175 |
+
|
| 176 |
+
Alekh Agarwal, Sham M Kakade, Jason D Lee, and Gaurav Mahajan. Optimality and approximation with policy gradient methods in markov decision processes. arXiv preprint arXiv:1908.00261, 2019.
|
| 177 |
+
|
| 178 |
+
Ron Amit, Ron Meir, and Kamil Ciosek. Discount factor as a regularizer in reinforcement learning. arXiv preprint arXiv:2007.02040, 2020.
|
| 179 |
+
|
| 180 |
+
Marcin Andrychowicz, Anton Raichuk, Piotr Stanczyk, Manu Orsini, Sertan Girgin, Raphael ´ Marinier, Leonard Hussenot, Matthieu Geist, Olivier Pietquin, Marcin Michalski, et al. What ´ matters in on-policy reinforcement learning? a large-scale empirical study. arXiv preprint arXiv:2006.05990, 2020.
|
| 181 |
+
|
| 182 |
+
M. G. Bellemare, Y. Naddaf, J. Veness, and M. Bowling. The arcade learning environment: An evaluation platform for general agents. Journal of Artificial Intelligence Research, 47:253–279, jun 2013.
|
| 183 |
+
|
| 184 |
+
Marc G Bellemare, Will Dabney, and Remi Munos. A distributional perspective on reinforcement ´ learning. arXiv preprint arXiv:1707.06887, 2017.
|
| 185 |
+
|
| 186 |
+
Emmanuel Bengio, Joelle Pineau, and Doina Precup. Interference and generalization in temporal difference learning. arXiv preprint arXiv:2003.06350, 2020.
|
| 187 |
+
|
| 188 |
+
Dimitri P Bertsekas and John N Tsitsiklis. Neuro-Dynamic Programming. Athena Scientific Belmont, MA, 1996.
|
| 189 |
+
|
| 190 |
+
Greg Brockman, Vicki Cheung, Ludwig Pettersson, Jonas Schneider, John Schulman, Jie Tang, and Wojciech Zaremba. Openai gym. arXiv preprint arXiv:1606.01540, 2016.
|
| 191 |
+
|
| 192 |
+
Itai Caspi, Gal Leibovich, Gal Novik, and Shadi Endrawis. Reinforcement learning coach, December 2017. URL https://doi.org/10.5281/zenodo.1134899.
|
| 193 |
+
|
| 194 |
+
Wesley Chung, Somjit Nath, Ajin Joseph, and Martha White. Two-timescale networks for nonlinear value function approximation. In International Conference on Learning Representations, 2018.
|
| 195 |
+
|
| 196 |
+
Kristopher De Asis, Alan Chan, Silviu Pitis, Richard S Sutton, and Daniel Graves. Fixed-horizon temporal difference methods for stable reinforcement learning. arXiv preprint arXiv:1909.03906, 2019.
|
| 197 |
+
|
| 198 |
+
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.
|
| 199 |
+
|
| 200 |
+
Logan Engstrom, Andrew Ilyas, Shibani Santurkar, Dimitris Tsipras, Firdaus Janoos, Larry Rudolph, and Aleksander Madry. Implementation matters in deep rl: A case study on ppo and trpo. In International Conference on Learning Representations, 2019.
|
| 201 |
+
|
| 202 |
+
William Fedus, Carles Gelada, Yoshua Bengio, Marc G Bellemare, and Hugo Larochelle. Hyperbolic discounting and learning over multiple horizons. arXiv preprint arXiv:1902.06865, 2019.
|
| 203 |
+
|
| 204 |
+
Scott Fujimoto, Herke van Hoof, and David Meger. Addressing function approximation error in actor-critic methods. arXiv preprint arXiv:1802.09477, 2018.
|
| 205 |
+
|
| 206 |
+
Tuomas Haarnoja, Aurick Zhou, Pieter Abbeel, and Sergey Levine. Soft actor-critic: Offpolicy maximum entropy deep reinforcement learning with a stochastic actor. arXiv preprint arXiv:1801.01290, 2018.
|
| 207 |
+
|
| 208 |
+
Peter Henderson, Riashat Islam, Philip Bachman, Joelle Pineau, Doina Precup, and David Meger. Deep reinforcement learning that matters. arXiv preprint arXiv:1709.06560, 2017.
|
| 209 |
+
|
| 210 |
+
Andrew Ilyas, Logan Engstrom, Shibani Santurkar, Dimitris Tsipras, Firdaus Janoos, Larry Rudolph, and Aleksander Madry. A closer look at deep policy gradients. arXiv preprint arXiv:1811.02553, 2018.
|
| 211 |
+
|
| 212 |
+
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.
|
| 213 |
+
|
| 214 |
+
Nan Jiang, Satinder P Singh, and Ambuj Tewari. On structural properties of mdps that bound loss due to shallow planning. In IJCAI, 2016.
|
| 215 |
+
|
| 216 |
+
Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 217 |
+
|
| 218 |
+
Vijay R Konda. Actor-critic algorithms. PhD thesis, Massachusetts Institute of Technology, 2002.
|
| 219 |
+
|
| 220 |
+
Ilya Kostrikov. Pytorch implementations of reinforcement learning algorithms. https:// github.com/ikostrikov/pytorch-a2c-ppo-acktr-gail, 2018.
|
| 221 |
+
|
| 222 |
+
Romain Laroche and Harm van Seijen. In reinforcement learning, all objective functions are not equal. 2018.
|
| 223 |
+
|
| 224 |
+
Romain Laroche, Mehdi Fatemi, Joshua Romoff, and Harm van Seijen. Multi-advisor reinforcement learning. arXiv preprint arXiv:1704.00756, 2017.
|
| 225 |
+
|
| 226 |
+
Lucas Lehnert, Romain Laroche, and Harm van Seijen. On value function representation of long horizon problems. In AAAI Conference on Artificial Intelligence, 2018.
|
| 227 |
+
|
| 228 |
+
Eric Liang, Richard Liaw, Robert Nishihara, Philipp Moritz, Roy Fox, Ken Goldberg, Joseph Gonzalez, Michael Jordan, and Ion Stoica. Rllib: Abstractions for distributed reinforcement learning. In International Conference on Machine Learning, 2018.
|
| 229 |
+
|
| 230 |
+
R McCallum. Reinforcement learning with selective perception and hidden state. PhD thesis, 1997.
|
| 231 |
+
|
| 232 |
+
Volodymyr Mnih, Adria Puigdomenech Badia, Mehdi Mirza, Alex Graves, Timothy Lillicrap, Tim Harley, David Silver, and Koray Kavukcuoglu. Asynchronous methods for deep reinforcement learning. In Proceedings of the 33rd International Conference on Machine Learning, 2016.
|
| 233 |
+
|
| 234 |
+
Remi Munos.´ Distributional reinforcement learning. Invited talk at European Workshop on Reinforcement Learning https://ewrl.files.wordpress.com/2018/10/ distributional_rl.pdf, 2018.
|
| 235 |
+
|
| 236 |
+
Chris Nota and Philip S. Thomas. Is the policy gradient a gradient? In Proceedings of the 19th International Conference on Autonomous Agents and Multiagent Systems, 2020.
|
| 237 |
+
|
| 238 |
+
OpenAI. Openai five. https://openai.com/five/, 2018.
|
| 239 |
+
|
| 240 |
+
Matteo Papini, Damiano Binaghi, Giuseppe Canonaco, Matteo Pirotta, and Marcello Restelli. Stochastic variance-reduced policy gradient. arXiv preprint arXiv:1806.05618, 2018.
|
| 241 |
+
|
| 242 |
+
Fabio Pardo, Arash Tavakoli, Vitaly Levdik, and Petar Kormushev. Time limits in reinforcement learning. In International Conference on Machine Learning, 2018.
|
| 243 |
+
|
| 244 |
+
Felipe Petroski Such, Vashisht Madhavan, Rosanne Liu, Rui Wang, Pablo Samuel Castro, Yulun Li, Jiale Zhi, Ludwig Schubert, Marc G. Bellemare, Jeff Clune, and et al. An atari model zoo for analyzing, visualizing, and comparing deep reinforcement learning agents. Proceedings of the Twenty-Eighth International Joint Conference on Artificial Intelligence, Aug 2019. doi: 10. 24963/ijcai.2019/452. URL http://dx.doi.org/10.24963/ijcai.2019/452.
|
| 245 |
+
|
| 246 |
+
Joshua Romoff, Peter Henderson, Ahmed Touati, Emma Brunskill, Joelle Pineau, and Yann Ollivier. Separating value functions across time-scales. arXiv preprint arXiv:1902.01883, 2019.
|
| 247 |
+
|
| 248 |
+
John Schulman, Sergey Levine, Pieter Abbeel, Michael Jordan, and Philipp Moritz. Trust region policy optimization. In Proceedings of the 32nd International Conference on Machine Learning, 2015a.
|
| 249 |
+
|
| 250 |
+
John Schulman, Philipp Moritz, Sergey Levine, Michael Jordan, and Pieter Abbeel. Highdimensional continuous control using generalized advantage estimation. arXiv preprint arXiv:1506.02438, 2015b.
|
| 251 |
+
|
| 252 |
+
John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. Proximal policy optimization algorithms. arXiv preprint arXiv:1707.06347, 2017.
|
| 253 |
+
|
| 254 |
+
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, 2016.
|
| 255 |
+
|
| 256 |
+
Adam Stooke and Pieter Abbeel. rlpyt: A research code base for deep reinforcement learning in pytorch. arXiv preprint arXiv:1909.01500, 2019.
|
| 257 |
+
|
| 258 |
+
Richard S Sutton. Learning to predict by the methods of temporal differences. Machine Learning, 1988.
|
| 259 |
+
|
| 260 |
+
Richard S Sutton. Td models: Modeling the world at a mixture of time scales. In Machine Learning Proceedings 1995. Elsevier, 1995.
|
| 261 |
+
|
| 262 |
+
Richard S Sutton and Andrew G Barto. Reinforcement Learning: An Introduction (2nd Edition). MIT press, 2018.
|
| 263 |
+
|
| 264 |
+
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, 2000.
|
| 265 |
+
|
| 266 |
+
Philip Thomas. Bias in natural actor-critic algorithms. In Proceedings of the 31st International Conference on Machine Learning, 2014.
|
| 267 |
+
|
| 268 |
+
Harm Van Seijen, Mehdi Fatemi, and Arash Tavakoli. Using a logarithmic mapping to enable lower discount factors in reinforcement learning. In Advances in Neural Information Processing Systems, 2019.
|
| 269 |
+
|
| 270 |
+
Vivek Veeriah, Matteo Hessel, Zhongwen Xu, Janarthanan Rajendran, Richard L Lewis, Junhyuk Oh, Hado P van Hasselt, David Silver, and Satinder Singh. Discovery of useful questions as auxiliary tasks. In Advances in Neural Information Processing Systems, 2019.
|
| 271 |
+
|
| 272 |
+
Arthur F Veinott. Discrete dynamic programming with sensitive discount optimality criteria. The Annals of Mathematical Statistics, 1969.
|
| 273 |
+
|
| 274 |
+
Martin L Weitzman. Gamma discounting. American Economic Review, 2001.
|
| 275 |
+
|
| 276 |
+
Ronald J Williams. Simple statistical gradient-following algorithms for connectionist reinforcement learning. Machine learning, 1992.
|
| 277 |
+
|
| 278 |
+
Yue Wu, Weitong Zhang, Pan Xu, and Quanquan Gu. A finite time analysis of two time-scale actor critic methods. arXiv preprint arXiv:2005.01350, 2020.
|
| 279 |
+
|
| 280 |
+
Pan Xu, Felicia Gao, and Quanquan Gu. Sample efficient policy gradient methods with recursive variance reduction. arXiv preprint arXiv:1909.08610, 2019.
|
| 281 |
+
|
| 282 |
+
Huizhuo Yuan, Xiangru Lian, Ji Liu, and Yuren Zhou. Stochastic recursive momentum for policy gradient methods. arXiv preprint arXiv:2003.04302, 2020.
|
| 283 |
+
|
| 284 |
+
Shangtong Zhang. Modularized implementation of deep rl algorithms in pytorch. https:// github.com/ShangtongZhang/DeepRL, 2018.
|
| 285 |
+
|
| 286 |
+
# A PROOF OF LEMMA 2
|
| 287 |
+
|
| 288 |
+
Proof. The proof is based on Appendix B in Schulman et al. (2015a), where perturbation theory is used to prove the performance improvement bound (Lemma 1). To simplify notation, we use a vector and a function interchangeably, i.e., we also use $r$ and $\mu _ { 0 }$ to denote the reward vector and the initial distribution vector. $\bar { J ( \pi ) }$ and $d _ { \pi } ( s )$ are shorthand for $J _ { \gamma } ( \pi )$ and $d _ { \pi } ^ { \gamma } ( s )$ with $\gamma = 1$ . All vectors are column vectors.
|
| 289 |
+
|
| 290 |
+
Let that $S ^ { + }$ $s ^ { \infty }$ , iet ${ \cal S } ^ { + } \doteq { \cal S } / \{ s ^ { \infty } \}$ , we defineccording to $P _ { \pi } \in \mathbb { R } ^ { | S ^ { + } | \times | S ^ { + } | }$ $\begin{array} { r } { P _ { \pi } ( s , s ^ { \prime } ) \doteq \sum _ { a } \pi ( a | s ) p ( s ^ { \prime } | s , a ) } \end{array}$ $\textstyle G \doteq \sum _ { t = 0 } ^ { \infty } P _ { \pi } ^ { t }$ $G ( s , s ^ { \prime } )$ $s ^ { \prime }$ $s ^ { \infty }$ $S _ { 0 } = s$ $T _ { \mathrm { m a x } } < \infty$ implies that $G$ is well-defined and we have $G = ( I - P _ { \pi } ) ^ { - 1 }$ . Moreover, $T _ { \mathrm { m a x } } < \infty$ also implies $\begin{array} { r } { \forall s , \sum _ { s ^ { \prime } } G ( s , s ^ { \prime } ) \leq T _ { \mathrm { m a x } } } \end{array}$ , i.e., $\lvert \lvert G \rvert \rvert _ { \infty } \leq T _ { \mathrm { m a x } }$ . We have $J ( \pi ) = \mu _ { 0 } ^ { \top } G r$ .
|
| 291 |
+
|
| 292 |
+
Let $G ^ { \prime } \doteq ( I - P _ { \pi ^ { \prime } } ) ^ { - 1 }$ , we have
|
| 293 |
+
|
| 294 |
+
$$
|
| 295 |
+
J ( \pi ^ { \prime } ) - J ( \pi ) = \mu _ { 0 } ^ { \top } ( G ^ { \prime } - G ) r .
|
| 296 |
+
$$
|
| 297 |
+
|
| 298 |
+
Let $\Delta \doteq P _ { \pi ^ { \prime } } - P _ { \pi }$ , we have
|
| 299 |
+
|
| 300 |
+
$$
|
| 301 |
+
\begin{array} { r } { G ^ { \prime - 1 } - G ^ { - 1 } = - \Delta , } \end{array}
|
| 302 |
+
$$
|
| 303 |
+
|
| 304 |
+
Left multiply by $G ^ { \prime }$ and right multiply by $G$
|
| 305 |
+
|
| 306 |
+
$$
|
| 307 |
+
\begin{array} { r l } & { G - G ^ { \prime } = - G ^ { \prime } \Delta G , } \\ & { \qquad G ^ { \prime } = G + G ^ { \prime } \Delta G \quad ( \mathrm { E x p a n d i n g ~ } G ^ { \prime } \mathrm { ~ i n ~ R H S ~ r e c u r s i v e l y } } \\ & { \qquad = G + G \Delta G + G ^ { \prime } \Delta G \Delta G . } \end{array}
|
| 308 |
+
$$
|
| 309 |
+
|
| 310 |
+
So we have
|
| 311 |
+
|
| 312 |
+
$$
|
| 313 |
+
\begin{array} { r } { J ( \pi ^ { \prime } ) - J ( \pi ) = \mu _ { 0 } ^ { \top } G \Delta G r + \mu _ { 0 } ^ { \top } G ^ { \prime } \Delta G \Delta G r . } \end{array}
|
| 314 |
+
$$
|
| 315 |
+
|
| 316 |
+
It is easy to see $\mu _ { 0 } ^ { \top } G = d _ { \pi } ^ { \top }$ and $G r = v _ { \pi }$ . So
|
| 317 |
+
|
| 318 |
+
$$
|
| 319 |
+
\begin{array} { r l } & { \mu _ { 0 } ^ { \top } G \Delta G r = d _ { \pi } ^ { \top } \Delta v _ { \pi } } \\ & { \quad \quad \quad = \displaystyle \sum _ { s } d _ { \pi } ( s ) \sum _ { s ^ { \prime } } \Big ( \sum _ { a } \pi ^ { \prime } ( a | s ) p ( s ^ { \prime } | s , a ) - \sum _ { a } \pi ( a | s ) p ( s ^ { \prime } | s , a ) \Big ) v _ { \pi } ( s ^ { \prime } ) } \\ & { \quad \quad \quad = \displaystyle \sum _ { s } d _ { \pi } ( s ) \sum _ { a } a ^ { \top } ( \pi ^ { \prime } ( a | s ) - \pi ( a | s ) ) \sum _ { s ^ { \prime } } p ( s ^ { \prime } | s , a ) v _ { \pi } ( s ^ { \prime } ) } \\ & { \quad \quad \quad = \displaystyle \sum _ { s } d _ { \pi } ( s ) \sum _ { a } ( \pi ^ { \prime } ( a | s ) - \pi ( a | s ) ) \Big ( r ( s ) + \sum _ { s ^ { \prime } } p ( s ^ { \prime } | s , a ) v _ { \pi } ( s ^ { \prime } ) - v _ { \pi } ( s ) \Big ) } \end{array}
|
| 320 |
+
$$
|
| 321 |
+
|
| 322 |
+
$$
|
| 323 |
+
= \sum _ { s } d _ { \pi } ( s ) \sum _ { a } \pi ^ { \prime } ( a | s ) \mathrm { A d v } _ { \pi } ( s , a ) .
|
| 324 |
+
$$
|
| 325 |
+
|
| 326 |
+
$\begin{array} { r } { ( \sum _ { a } \pi ( a | s ) \mathrm { A d v } _ { \pi } ( s , a ) = 0 } \end{array}$ by Bellman equation)
|
| 327 |
+
|
| 328 |
+
We now bound $\mu _ { 0 } ^ { \top } G ^ { \prime } \Delta G \Delta G r$ . First,
|
| 329 |
+
|
| 330 |
+
$$
|
| 331 |
+
\begin{array} { l } { | ( \Delta G r ) ( s ) | = | \displaystyle \sum _ { s ^ { \prime } } \Big ( \displaystyle \sum _ { a } \pi ^ { \prime } ( a | s ) - \pi ( a | s ) \Big ) p ( s ^ { \prime } | s , a ) v _ { \pi } ( s ^ { \prime } ) | } \\ { = | \displaystyle \sum _ { a } \Big ( \pi ^ { \prime } ( a | s ) - \pi ( a | s ) \Big ) \Big ( r ( s ) + \displaystyle \sum _ { s ^ { \prime } } p ( s ^ { \prime } | s , a ) v _ { \pi } ( s ^ { \prime } ) - v _ { \pi } ( s ) \Big ) | } \\ { = | \displaystyle \sum _ { a } \Big ( \pi ^ { \prime } ( a | s ) - \pi ( a | s ) \Big ) \mathrm { A d v } _ { \pi } ( s , a ) | } \\ { \le 2 \operatorname* { m a x } _ { s } \mathbf { D } _ { T V } ( \pi ^ { \prime } ( \cdot | s ) , \pi ( \cdot | s ) ) \operatorname* { m a x } _ { s , a } | \mathrm { A d v } _ { \pi } ( s , a ) | , } \end{array}
|
| 332 |
+
$$
|
| 333 |
+
|
| 334 |
+
where $\mathbf { D } _ { T V }$ is the total variation distance. So
|
| 335 |
+
|
| 336 |
+
$$
|
| 337 |
+
| | \Delta G r | | _ { \infty } \leq 2 \operatorname* { m a x } _ { s } { \mathbf { D } } _ { T V } ( \pi ^ { \prime } ( \cdot | s ) , \pi ( \cdot | s ) ) \operatorname* { m a x } _ { s , a } | { \mathbf { A } } { \mathbf { d } } { \mathbf { v } } _ { \pi } ( s , a ) | .
|
| 338 |
+
$$
|
| 339 |
+
|
| 340 |
+
Moreover, for any vector $x$ ,
|
| 341 |
+
|
| 342 |
+
$$
|
| 343 |
+
\begin{array} { r } { | ( \Delta x ) ( s ) | \leq 2 \underset { s } { \operatorname* { m a x } } \mathbf { D } _ { T V } \big ( \pi ^ { \prime } ( \cdot | s ) , \pi ( \cdot | s ) \big ) | | x | | _ { \infty } , } \\ { | | \Delta x | | _ { \infty } \leq 2 \underset { s } { \operatorname* { m a x } } \mathbf { D } _ { T V } \big ( \pi ^ { \prime } ( \cdot | s ) , \pi ( \cdot | s ) \big ) | | x | | _ { \infty } . } \end{array}
|
| 344 |
+
$$
|
| 345 |
+
|
| 346 |
+
So
|
| 347 |
+
|
| 348 |
+
$$
|
| 349 |
+
\begin{array} { r l } & { \qquad | | \Delta | | _ { \infty } \leq 2 \operatorname* { m a x } _ { s } \mathrm { D } _ { T V } ( \pi ^ { \prime } ( \cdot | s ) , \pi ( \cdot | s ) ) , } \\ & { \qquad | \mu _ { 0 } ^ { \top } G ^ { \prime } \Delta G \Delta G r | \leq | | \mu _ { 0 } ^ { \top } | | _ { 1 } | | G ^ { \prime } | | _ { \infty } | | \Delta | | _ { \infty } | | G | | _ { \infty } | | \Delta G r | | _ { \infty } } \\ & { \qquad \leq 4 T _ { \operatorname* { m a x } } ^ { 2 } \operatorname* { m a x } _ { s } \mathrm { D } _ { T V } ^ { 2 } ( \pi ^ { \prime } ( \cdot | s ) , \pi ( \cdot | s ) ) \underset { s , a } { \operatorname* { m a x } } | \mathrm { A d v } _ { \pi } ( s , a ) | } \\ & { \qquad \leq 4 T _ { \operatorname* { m a x } } ^ { 2 } \underset { s } { \operatorname* { m a x } } \mathrm { D } _ { K L } ( \pi ( \cdot | s ) | | \pi ^ { \prime } ( \cdot | s ) ) \underset { s , a } { \operatorname* { m a x } } | \mathrm { A d v } _ { \pi } ( s , a ) | , } \end{array}
|
| 350 |
+
$$
|
| 351 |
+
|
| 352 |
+
which completes the proof.
|
| 353 |
+
|
| 354 |
+
Note this perturbation-based proof of Lemma 2 holds only for $r : { \mathcal { S } } \mathbb { R }$ . For $r : S \times \mathcal { A } \mathbb { R }$ , we can turn to the coupling-based proof as Schulman et al. (2015a), which, however, complicates the presentation and deviates from the main purpose of this paper. We, therefore, leave it for future work.
|
| 355 |
+
|
| 356 |
+
# B EXPERIMENT DETAILS
|
| 357 |
+
|
| 358 |
+
# B.1 METHODOLOGY
|
| 359 |
+
|
| 360 |
+
We use HalfCheetah, Walker, Hopper, Ant, Humanoid, and HumanoidStandup as our benchmarks. We exclude other tasks as we find PPO plateaus quickly there. The tasks we consider have a hard time limit of 1000. Following Pardo et al. (2018), we add time step information into the state, i.e., there is an additional scalar $t / 1 0 0 0$ in the observation vector. Following Achiam (2018), we estimate the KL divergence between the current policy $\theta$ and the sampling policy $\theta _ { \mathrm { o l d } }$ when optimizing the loss (3). When the estimated $\mathrm { K L }$ divergence is greater than a threshold, we stop updating the actor and update only the critic with current data. We use Adam (Kingma & Ba, 2014) as the optimizer and perform grid search for the initial learning rates of Adam optimizers. Let $\alpha _ { A }$ and $\alpha _ { C } \doteq \beta \alpha _ { A }$ be the learning rates for the actor and critic respectively. For each algorithmic configuration (i.e., a curve in a figure), we tune $\alpha _ { A } \in \{ 0 . 1 2 5 , 0 . 2 5 , 0 . 5 , 1 , 2 \} \times 3 \cdot 1 0 ^ { - 4 }$ and $\beta \in \{ 1 , 3 \}$ with grid search in Ant with 3 independent runs maximizing the average return of the last 100 training episodes. In particular, $\overline { { \alpha _ { A } } } ~ = ~ 3 \cdot 1 0 ^ { - 4 }$ and $\beta ~ = ~ 3$ is roughly the default learning rates for the PPO implementation in Achiam (2018). We then run this algorithmic configuration with the best $\alpha _ { A }$ and $\alpha _ { C }$ in all tasks. Overall, we find after removing GAE, smaller learning rates are preferred. When we use FHTD, we additionally consider $\bar { H ^ { - } } \in \{ 1 6 , 3 2 , 6 4 , 1 2 8 , 2 5 6 , 5 1 2 , 1 0 2 4 \}$ in the grid search. When we use C51, we additionally consider $\begin{array} { r l r } { \cdot { V _ { \mathrm { { m a x } } } } } & { { } \in } & { \left\{ { 2 0 , 4 0 , 8 0 , 1 6 0 , 3 2 0 , 6 4 0 , 1 2 8 0 , 2 5 6 0 , 5 1 2 0 , 1 0 2 4 0 , 8 1 9 2 0 , 1 6 3 8 4 0 , 3 2 7 6 8 0 } \right\} } \end{array}$ in the grid search. We use PPO-TD with $\gamma _ { \mathrm { c } } = 0 . 9 9$ as an example to study how the best hyperparameter configuration in Ant transfers to other games. As shown in Figure 12, the best learning rates of Ant $\overset { \prime } { \alpha _ { \mathrm { A } } } = 3 \cdot 1 0 ^ { - 4 }$ and $\beta = 3$ ) yields reasonably good performance in all the other games except Humanoid. In the paper, we do not draw a conclusion from a single task. So an outlier is unlikely to affect the overall conclusion.
|
| 361 |
+
|
| 362 |
+
In the discounted setting, we consider only Ant, HalfCheetah and their variants. For Walker2d, Hopper, and Humanoid, we find the average episode length of all algorithms are smaller than $t _ { 0 }$ , i.e., the flipped reward rarely takes effects. For HumanoidStandup, the scale of the reward is too large. To summarize, other four environments are not well-suited for the purpose of our empirical study. Moreover, in the discounted setting, we performed the grid search of the learning rates for both Ant and HalfCheetah.
|
| 363 |
+
|
| 364 |
+

|
| 365 |
+
Figure 12: PPO-TD $( \gamma _ { \mathrm { c } } = 0 . 9 9 )$ with different learning rates. A curve labeled with $( x , \beta )$ corresponds to an initial learning rate for the actor and critic of $\alpha _ { \mathrm { { A } } } = x \times 3 \cdot 1 0 ^ { - 4 }$ and $\alpha _ { \mathrm { { C } } } = \beta \alpha _ { \mathrm { { A } } }$ respectively. The best learning rates for Ant $( \alpha _ { \mathrm { A } } = 3 \cdot 1 0 ^ { - 4 }$ and $\beta = 3$ ) yields reasonably good performance in all the other games except Humanoid.
|
| 366 |
+
|
| 367 |
+
# B.2 ALGORITHM DETAILS
|
| 368 |
+
|
| 369 |
+
The pseudocode of all implemented algorithms are provide in Algorithms 1 - 7 with their architectures illustrated in Figure 13. For hyperparameters that are not included in the grid search, we use the same value as Dhariwal et al. (2017); Achiam (2018). In particular, for the rollout length, we set $K = 2 0 4 8$ . For the optimization epochs, we set $K _ { o p t } = 3 2 0$ . For the minibatch size, we set $B = 6 4$ . For the maximum KL divergence, we set $K L _ { t a r g e t } = 0 . 0 1$ . We clip $\frac { \pi _ { \theta } ( a | s ) } { \pi _ { \theta _ { o l d } } ( a | s ) }$ into $[ - 0 . 2 , 0 . 2 ]$ . We use $N _ { s } = 5 1$ supports for PPO-C51.
|
| 370 |
+
|
| 371 |
+
We use two-hidden-layer neural networks for function approximation. Each hidden layer has 64 hidden units and a tanh activation function. The output layer of the actor network has a tanh activation function and is interpreted as the mean of an isotropic Gaussian distribution, whose standard derivation is a global state-independent variable as suggested by Schulman et al. (2015a).
|
| 372 |
+
|
| 373 |
+
# Algorithm 1: PPO
|
| 374 |
+
|
| 375 |
+
#
|
| 376 |
+
|
| 377 |
+
Input:
|
| 378 |
+
$\theta , \psi$ : parameters of $\pi , \hat { v }$
|
| 379 |
+
$\alpha _ { A } , \alpha _ { C }$ : Initial learning rates of the Adam optimizers for $\theta , \psi$
|
| 380 |
+
$K , K _ { o p t } , B$ : rollout length, number of optimization epochs, and minibatch size
|
| 381 |
+
$K L _ { t a r g e t }$ : maximum KL divergence threshold
|
| 382 |
+
$S _ { 0 } \sim \mu _ { 0 }$
|
| 383 |
+
while True do Initialize a buffer $M$ $\theta _ { o l d } \theta$ for $i = 0 , \ldots , K - 1$ do $A _ { i } \sim \pi _ { \theta _ { o l d } } ( \cdot | S _ { i } )$ Execute $A _ { i }$ , get $R _ { i + 1 } , S _ { i + 1 }$ if $S _ { i + 1 }$ is a terminal state then $\dot { m } _ { i } \gets 0 , S _ { i + 1 } \sim \mu _ { 0 }$ else mi ← 1 end end $G _ { K } \gets \hat { v } ( S _ { K } )$ for $i = K - 1 , \ldots , 0$ do $G _ { i } \gets R _ { i + 1 } + \gamma _ { \mathrm { c } } m _ { i } G _ { i + 1 }$ $\mathtt { A d v } _ { i } \gets R _ { i + 1 } + \gamma _ { \mathrm { c } } m _ { i } \hat { v } _ { \psi } ( S _ { i + 1 } ) - \hat { v } _ { \psi } ( S _ { i } )$ Store $\left( { { S _ { i } } , { A _ { i } } , { G _ { i } } , \mathrm { { A d v } } _ { i } } \right)$ in $M$ end Normalize Advi in M as Advi ← Advi−mean({Advi}) for $o = 1 , \ldots , K _ { o p t }$ do Sample a minibatch $\{ ( S _ { i } , A _ { i } , G _ { i } , \mathrm { A d v } _ { i } ) \} _ { i = 1 , \ldots , B }$ from $M$ $\begin{array} { r } { L ( \psi ) \gets \frac { 1 } { 2 B } \sum _ { i = 1 } ^ { B } ( \hat { v } _ { \psi } ( S _ { i } ) - G _ { i } ) ^ { 2 } \ / \star } \end{array}$ No gradient through $G _ { i }$ \*/ $\begin{array} { r } { L ( \theta ) \gets \frac { 1 } { B } \sum _ { i = 1 } ^ { B } \operatorname* { m i n } \{ \frac { \pi _ { \theta } ( A _ { i } | S _ { i } ) } { \pi _ { \theta _ { o l d } } ( A _ { i } | S _ { i } ) } \mathrm { A d v } _ { i } , \mathrm { c l i p } ( \frac { \pi _ { \theta } ( A _ { i } | S _ { i } ) } { \pi _ { \theta _ { o l d } } ( A _ { i } | S _ { i } ) } ) \mathrm { A d v } _ { i } \} } \end{array}$ if Perform one gradient update to $\begin{array} { r } { \frac { 1 } { B } \sum _ { i = 1 } ^ { B } \log \pi _ { \theta _ { o l d } } ( A _ { i } | S _ { i } ) - \log \pi _ { \theta } ( A _ { i } | S _ { i } ) < K L _ { t a r g e t } } \end{array}$ $\psi$ minimizing $L ( \psi )$ with Adam then Perform one gradient update to $\theta$ maximizing $L ( \theta ) { \dot { } }$ end end
|
| 384 |
+
end
|
| 385 |
+
|
| 386 |
+
# Algorithm 2: PPO-TD
|
| 387 |
+
|
| 388 |
+
#
|
| 389 |
+
|
| 390 |
+
$\theta , \psi$ : parameters of $\pi , \hat { v }$
|
| 391 |
+
$\alpha _ { A } , \alpha _ { C }$ : Initial learning rates of the Adam optimizers for $\theta , \psi$
|
| 392 |
+
$K , K _ { o p t } , B$ : rollout length, number of optimization epochs, and minibatch size
|
| 393 |
+
$K L _ { t a r g e t }$ : maximum KL divergence threshold
|
| 394 |
+
$S _ { 0 } \sim \mu _ { 0 }$
|
| 395 |
+
while True do Initialize a buffer $M$ $\theta _ { o l d } \theta$ for $i = 0 , \ldots , K - 1$ do $A _ { i } \sim \pi _ { \theta _ { o l d } } ( \cdot | S _ { i } )$ Execute $A _ { i }$ , get $R _ { i + 1 } , S _ { i + 1 }$ if $S _ { i + 1 }$ is a terminal state then $\dot { m } _ { i } \gets 0 , S _ { i + 1 } \sim \mu _ { 0 }$ else mi ← 1 end end for $i = K - 1 , \ldots , 0$ do $\mathtt { A d v } _ { i } \gets R _ { i + 1 } + \gamma _ { \mathrm { c } } m _ { i } \hat { v } _ { \psi } ( S _ { i + 1 } ) - \hat { v } _ { \psi } ( S _ { i } )$ $S _ { i } ^ { \prime } \gets S _ { i + 1 } , r _ { i } \gets R _ { i + 1 }$ Store $\left( S _ { i } , A _ { i } , m _ { i } , r _ { i } , S _ { i } ^ { \prime } , \mathrm { { A d v } } _ { i } \right)$ in $M$ end Normalize $\mathbf { A d v } _ { i }$ in $M$ as $\begin{array} { r } { \mathrm { A d v } _ { i } \gets \frac { \mathrm { A d v } _ { i } - \mathrm { m e a n } ( \{ \mathrm { A d v } _ { i } \} ) } { \mathrm { s t d } ( \{ \mathrm { A d v } _ { i } \} ) } } \end{array}$ for $o = 1 , \ldots , K _ { o p t }$ do Sample a minibatch $\{ ( S _ { i } , A _ { i } , m _ { i } , r _ { i } , S _ { i } ^ { \prime } , \mathrm { A d v } _ { i } ) \} _ { i = 1 , \dots , B }$ from M $y _ { i } \gets r _ { i } + \gamma _ { \mathrm { c } } m _ { i } \hat { v } _ { \psi } ( S _ { i } ^ { \prime } )$ $\begin{array} { r } { L ( \psi ) \gets \frac { 1 } { 2 B } \sum _ { i = 1 } ^ { B } ( \hat { v } _ { \psi } ( S _ { i } ) - y _ { i } ) ^ { 2 } \mathrm { ~ / ~ } \star } \end{array}$ No gradient through $y _ { i }$ \*/ $\begin{array} { r } { L ( \theta ) \gets \frac { 1 } { B } \sum _ { i = 1 } ^ { B } \operatorname* { m i n } \{ \frac { \pi _ { \theta } ( A _ { i } | S _ { i } ) } { \pi _ { \theta _ { o l d } } ( A _ { i } | S _ { i } ) } \mathrm { A d v } _ { i } , \mathrm { c l i p } ( \frac { \pi _ { \theta } ( A _ { i } | S _ { i } ) } { \pi _ { \theta _ { o l d } } ( A _ { i } | S _ { i } ) } ) \mathrm { A d v } _ { i } \} } \end{array}$ Pif $\psi$ $L ( \psi )$ Adamthen $\begin{array} { r } { \frac { 1 } { B } \sum _ { i = 1 } ^ { B } \log \pi _ { \theta _ { o l d } } ( A _ { i } | S _ { i } ) - \log \pi _ { \theta } ( A _ { i } | S _ { i } ) < K L _ { t a r g e t } } \end{array}$ $\theta$ $L ( \theta ) { \dot { } }$ end end
|
| 396 |
+
end
|
| 397 |
+
|
| 398 |
+
# Algorithm 3: PPO-TD-Ex
|
| 399 |
+
|
| 400 |
+
#
|
| 401 |
+
|
| 402 |
+
$\theta , \psi$ : parameters of $\pi , \hat { v }$
|
| 403 |
+
$\alpha _ { A } , \alpha _ { C }$ : Initial learning rates of the Adam optimizers for $\theta , \psi$
|
| 404 |
+
$K , K _ { o p t } , B$ : rollout length, number of optimization epochs, and minibatch size
|
| 405 |
+
$K L _ { t a r g e t }$ : maximum KL divergence threshold
|
| 406 |
+
$N$ : number of extra transitions
|
| 407 |
+
$p , r$ : transition kernel and reward function of the oracle
|
| 408 |
+
$S _ { 0 } \sim \mu _ { 0 }$
|
| 409 |
+
while True do Initialize a buffer $M$ $\theta _ { o l d } \theta$ for $i = 0 , \ldots , K - 1$ do for $j = 0 , \ldots , N$ do $A _ { i } ^ { j } \sim \pi _ { \theta _ { o l d } } ( \cdot | S _ { i } ) , R _ { i + 1 } ^ { j } r ( S _ { i } , A _ { i } ^ { j } ) , S _ { i + 1 } ^ { j } \sim p ( \cdot | S _ { i } , A _ { i } ^ { j } )$ if $S _ { i + 1 } ^ { j }$ is a terminal state then $| \quad \stackrel { \cdot \right. } { m _ { i } ^ { j } } \left. 0 , S _ { i + 1 } ^ { j } \sim \mu _ { 0 }$ else mj i ← 1 end end $S _ { i + 1 } \gets S _ { i + 1 } ^ { 0 }$ end for $i = K - 1 , \ldots , 0$ do $\mathrm { A d v } _ { i } \gets R _ { i + 1 } ^ { 0 } + \gamma _ { \mathrm { c } } m _ { i } ^ { 0 } \hat { v } _ { \psi } ( S _ { i + 1 } ^ { 0 } ) - \hat { v } _ { \psi } ( S _ { i } ^ { 0 } )$ for $j = 0 , \ldots , N$ do $S _ { i } ^ { \prime j } \gets S _ { i + 1 } ^ { j }$ end Store $\left( \{ S _ { i } ^ { j } , A _ { i } ^ { j } , m _ { i } ^ { j } , r _ { i } ^ { j } , S _ { i } ^ { \prime j } \} _ { j = 0 , \dots , N } , \mathbf { A } \mathbf { d } \mathbf { v } _ { i } \right) .$ in M end Normalize Advi in M as Advi ← Advi−mean({Advi}) for $o = 1 , \ldots , K _ { o p t }$ do Sample a minibatch $\{ ( \{ S _ { i } ^ { j } , A _ { i } ^ { j } , m _ { i } ^ { j } , r _ { i } ^ { j } , S _ { i } ^ { \prime j } \} _ { j = 0 , \dots , N } , \mathrm { A d v } _ { i } ) \} _ { i = 1 , \dots , B }$ from M $\begin{array} { r } { y _ { i } \gets \frac { 1 } { N + 1 } \sum _ { j = 0 } ^ { N } r _ { i } ^ { j } + \gamma _ { \mathrm { c } } m _ { i } ^ { j } \hat { v } _ { \psi } ( S _ { i } ^ { \prime j } ) } \end{array}$ $\begin{array} { r } { L ( \psi ) \gets \frac { 1 } { 2 B } \sum _ { i = 1 } ^ { B } ( \hat { v } _ { \psi } ( S _ { i } ^ { 0 } ) - y _ { i } ) ^ { 2 } \ / \star } \end{array}$ No gradient through $y _ { i }$ \*/ $\begin{array} { r } { L ( \theta ) \frac { 1 } { B } \sum _ { i = 1 } ^ { B } \operatorname* { m i n } \{ \frac { \pi _ { \theta } ( A _ { i } ^ { 0 } | S _ { i } ^ { 0 } ) } { \pi _ { \theta _ { o l d } } ( A _ { i } ^ { 0 } | S _ { i } ^ { 0 } ) } \mathrm { A d v } _ { i } } \end{array}$ n{ πθ (A0i |S0i )πθ (A0i |S0i ) Advi, clip( πθ (A0i |S0i )πθ (A0i |S0i ) )Advi} Perform one gradient update to $\psi$ minimizing $L ( \psi )$ with Adam if $\begin{array} { r } { \frac { 1 } { B } \sum _ { i = 1 } ^ { B } \log \pi _ { \theta _ { o l d } } ( A _ { i } ^ { 0 } | S _ { i } ^ { 0 } ) - \log \pi _ { \theta } ( A _ { i } ^ { 0 } | S _ { i } ^ { 0 } ) < K L _ { t a r g e t } } \end{array}$ thenh Adam $\theta$ $L ( \theta )$ end end
|
| 410 |
+
end
|
| 411 |
+
|
| 412 |
+
# Algorithm 4: PPO-FHTD
|
| 413 |
+
|
| 414 |
+
#
|
| 415 |
+
|
| 416 |
+

|
| 417 |
+
|
| 418 |
+
# Algorithm 5: PPO-C51
|
| 419 |
+
|
| 420 |
+
#
|
| 421 |
+
|
| 422 |
+
$\theta , \psi$ : parameters of $\pi$ $\tau , \{ \hat { v } ^ { j } \} _ { j = 1 , \dots , N _ { s } }$ with $N _ { s }$ being the number of supports and $\hat { v } ^ { j }$ being the
|
| 423 |
+
probability of each support
|
| 424 |
+
$\alpha _ { A } , \alpha _ { C }$ : Initial learning rates of the Adam optimizers for $\theta , \psi$
|
| 425 |
+
$K , K _ { o p t } , B$ : rollout length, number of optimization epochs, and minibatch size
|
| 426 |
+
$K L _ { t a r g e t }$ : maximum KL divergence threshold
|
| 427 |
+
$\begin{array} { r l } & { \Delta _ { z } \doteq \frac { 2 V _ { \mathrm { m a x } } } { N _ { s } - 1 } , \left\{ z _ { j } \doteq - V _ { \mathrm { m a x } } + ( j - 1 ) \Delta _ { z } : j = 1 , \ldots , N _ { s } \right\} / / } \\ & { S _ { 0 } \sim \mu _ { 0 } } \end{array}$ Define the supports
|
| 428 |
+
while True do
|
| 429 |
+
Initialize a buffer $M$
|
| 430 |
+
$\theta _ { o l d } \theta$
|
| 431 |
+
for i = 0, . . . , K − 1 do $A _ { i } \sim \pi _ { \theta _ { o l d } } ( \cdot | S _ { i } )$ Execute $A _ { i }$ , get $R _ { i + 1 } , S _ { i + 1 }$ if $S _ { i + 1 }$ is a terminal state then $\mid \quad \dot { m } _ { i } 0 , S _ { i + 1 } \sim \mu _ { 0 }$ else mi ← 1 end
|
| 432 |
+
end
|
| 433 |
+
for $i = K - 1 , \ldots , 0$ do $\begin{array} { r l } & { \textup { \texttt { A } } ^ { i } \gets \textup { \texttt { A } } ^ { - 1 } - 1 , \cdot \cdot \cdot , \cup \textup { \texttt { u o } } } \\ & { \quad \mathrm { A d v } _ { i } \gets R _ { i + 1 } + m _ { i } \gamma _ { \mathrm { C } } \sum _ { j = 1 } ^ { N _ { s } } \hat { v } _ { \psi } ^ { j } ( S _ { i + 1 } ) z _ { j } - \sum _ { j = 1 } ^ { N _ { s } } \hat { v } _ { \psi } ^ { j } ( S _ { i } ) z _ { j } } \\ & { \quad S _ { i } ^ { \prime } \gets S _ { i + 1 } , r _ { i } \gets R _ { i + 1 } } \\ & { \quad \mathrm { S t o r e } \ ( S _ { i } , A _ { i } , m _ { i } , r _ { i } , S _ { i } ^ { \prime } , \mathrm { A d v } _ { i } ) \mathrm { ~ i n ~ } M } \end{array}$
|
| 434 |
+
end
|
| 435 |
+
Normalize $\mathbf { A d v } _ { i }$ in $M$ as $\begin{array} { r } { \mathrm { A d v } _ { i } \gets \frac { \mathrm { A d v } _ { i } - \mathrm { m e a n } ( \{ \mathrm { A d v } _ { i } \} ) } { \mathrm { s t d } ( \{ \mathrm { A d v } _ { i } \} ) } } \end{array}$
|
| 436 |
+
for $o = 1 , \ldots , K _ { o p t }$ do Sample a minibatch $\{ ( S _ { i } , A _ { i } , m _ { i } , r _ { i } , S _ { i } ^ { \prime } , \mathrm { A d v } _ { i } ) \} _ { i = 1 , \dots , B }$ from $M$ for $i = 1 , \ldots , B$ do for $j = 1 , \dots , N _ { s }$ do $\begin{array} { r l } { | } & { { } z _ { j } ^ { i } \gets r _ { i } + m _ { i } \gamma _ { \mathrm { C } } z _ { j } } \end{array}$ end end for $j = 1 , \dots , N _ { s }$ do $\begin{array} { r } { y _ { j } ^ { i } \sum _ { k = 1 } ^ { N _ { s } } [ 1 - \frac { \vert [ z _ { j } ^ { i } ] _ { - V _ { \mathrm { m a x } } } ^ { V _ { \mathrm { m a x } } } - z _ { j } \vert } { \Delta _ { z } } ] _ { 0 } ^ { 1 } \hat { \sigma } _ { \psi } ^ { k } ( S _ { i } ^ { \prime } ) ~ / \star ~ [ x ] _ { l } ^ { u } \doteq \operatorname* { m i n } ( \operatorname* { m a x } ( x , l ) , u ) } \end{array}$ \*/ end $\begin{array} { r } { L ( \psi ) \frac { 1 } { B } \sum _ { i = 1 } ^ { B } \sum _ { j = 1 } ^ { N _ { s } } - y _ { j } ^ { i } \log \hat { v } _ { \psi } ^ { j } ( S _ { i } ) / \star } \end{array}$ No gradient through $y _ { j } ^ { i }$ \*/ $\begin{array} { r } { L ( \theta ) \gets \frac { 1 } { B } \sum _ { i = 1 } ^ { B } \operatorname* { m i n } \{ \frac { \pi _ { \theta } ( A _ { i } | S _ { i } ) } { \pi _ { \theta _ { o l d } } ( A _ { i } | S _ { i } ) } \mathrm { A d v } _ { i } , \mathrm { c l i p } ( \frac { \pi _ { \theta } ( A _ { i } | S _ { i } ) } { \pi _ { \theta _ { o l d } } ( A _ { i } | S _ { i } ) } ) \mathrm { A d v } _ { i } \} } \end{array}$ Pif $\psi$ $L ( \psi )$ Adamthen $\begin{array} { r } { \frac { 1 } { B } \sum _ { i = 1 } ^ { B } \log \pi _ { \theta _ { o l d } } ( A _ { i } | S _ { i } ) - \log \pi _ { \theta } ( A _ { i } | S _ { i } ) < K L _ { t a r g e t } } \end{array}$ $\theta$ $L ( \theta )$ end
|
| 437 |
+
end
|
| 438 |
+
end
|
| 439 |
+
|
| 440 |
+
# Algorithm 6: DisPPO
|
| 441 |
+
|
| 442 |
+
Input:
|
| 443 |
+
$\theta , \psi$ : parameters of $\pi , \hat { v }$
|
| 444 |
+
$\alpha _ { A } , \alpha _ { C }$ : Initial learning rates of the Adam optimizers for $\theta , \psi$
|
| 445 |
+
$K , K _ { o p t } , B$ : rollout length, number of optimization epochs, and minibatch size
|
| 446 |
+
$K L _ { t a r g e t }$ : maximum KL divergence threshold
|
| 447 |
+
$S _ { 0 } \sim \mu _ { 0 } , t 0$
|
| 448 |
+
while True do Initialize a buffer $M$ $\theta _ { o l d } \theta$ for $i = 0 , \ldots , K - 1$ do $A _ { i } \sim \pi _ { \theta _ { o l d } } ( \cdot | S _ { i } ) , t _ { i } t$ Execute $A _ { i }$ , get $R _ { i + 1 } , S _ { i + 1 }$ if $S _ { i + 1 }$ is a terminal state then $\dot { m } _ { i } \gets 0 , S _ { i + 1 } \sim \mu _ { 0 } , t \gets 0$ else $\mid \quad m _ { i } 1 , t t + 1$ end end $G _ { K } \gets \hat { v } ( S _ { K } )$ for $i = K - 1 , \ldots , 0$ do $G _ { i } \gets R _ { i + 1 } + \gamma _ { \mathrm { c } } m _ { i } G _ { i + 1 }$ $\mathtt { A d v } _ { i } \gets R _ { i + 1 } + \gamma _ { \mathrm { c } } m _ { i } \hat { v } _ { \psi } ( S _ { i + 1 } ) - \hat { v } _ { \psi } ( S _ { i } )$ Store $\left( { { S _ { i } } , { A _ { i } } , { G _ { i } } , \mathrm { { A d v } } _ { i } , { t _ { i } } } \right)$ in M end Normalize Advi in M as Advi ← Advi−mean({Advi})std({Adv }) for $o = 1 , \ldots , K _ { o p t }$ do Sample a minibatch $\{ ( S _ { i } , A _ { i } , G _ { i } , \mathrm { A d v } _ { i } , t _ { i } ) \} _ { i = 1 , \ldots , B }$ from $M$ $\begin{array} { r } { L ( \psi ) \frac { 1 } { 2 B } \sum _ { i = 1 } ^ { B } ( \hat { v } _ { \psi } ( S _ { i } ) - G _ { i } ) ^ { 2 } \mathrm { ~ / ~ } \star } \end{array}$ No gradient through $G _ { i }$ \*/ $\begin{array} { r l } { L ( \theta ) \gets \frac { 1 } { B } \sum _ { i = 1 } ^ { B } } & { { } \operatorname* { m i n } \{ \frac { \pi _ { \theta } ( A _ { i } | S _ { i } ) } { \pi _ { \theta _ { o l d } } ( A _ { i } | S _ { i } ) } { \bf A } \bf d v _ { i } , \mathrm { c l i p } ( \frac { \pi _ { \theta } ( A _ { i } | S _ { i } ) } { \pi _ { \theta _ { o l d } } ( A _ { i } | S _ { i } ) } ) { \bf A } \bf d v _ { i } \} } \end{array}$ Pif $\psi$ $L ( \psi )$ Adamthen $\begin{array} { r } { \frac { 1 } { B } \sum _ { i = 1 } ^ { B } \log \pi _ { \theta _ { o l d } } ( A _ { i } | S _ { i } ) - \log \pi _ { \theta } ( A _ { i } | S _ { i } ) < K L _ { t a r g e t } } \end{array}$ Perform one gradient update to $\theta$ maximizing $L ( \theta ) { \dot { } }$ with Adam end end
|
| 449 |
+
end
|
| 450 |
+
|
| 451 |
+
# Algorithm 7: AuxPPO
|
| 452 |
+
|
| 453 |
+
Input:
|
| 454 |
+
$\theta , \theta ^ { \prime } , \psi$ : parameters of $\pi , \pi ^ { \prime } , \hat { v }$
|
| 455 |
+
$\alpha _ { A } , \alpha _ { C }$ : Initial learning rates of the Adam optimizers for $\theta , \psi$
|
| 456 |
+
$K , K _ { o p t } , B$ : rollout length, number of optimization epochs, and minibatch size
|
| 457 |
+
$K L _ { t a r g e t }$ : maximum KL divergence threshold
|
| 458 |
+
$S _ { 0 } \sim \mu _ { 0 } , t 0$
|
| 459 |
+
while True do Initialize a buffer $M$ $\theta _ { o l d } \theta , \theta ^ { \prime } \theta$ for $i = 0 , \ldots , K - 1$ do $A _ { i } \sim \pi _ { \theta _ { o l d } } ( \cdot | S _ { i } ) , t _ { i } t$ Execute $A _ { i }$ , get $R _ { i + 1 } , S _ { i + 1 }$ if $S _ { i + 1 }$ is a terminal state then $\Dot { m } _ { i } \gets 0 , S _ { i + 1 } \sim \mu _ { 0 } , t \gets 0$ else $\mid \quad m _ { i } 1 , t t + 1$ end end $G _ { K } \gets \hat { v } ( S _ { K } )$ for $i = K - 1 , \ldots , 0$ do $G _ { i } \gets R _ { i + 1 } + \gamma _ { \mathrm { c } } m _ { i } G _ { i + 1 }$ $\mathtt { A d v } _ { i } \gets R _ { i + 1 } + \gamma _ { \mathrm { c } } m _ { i } \hat { v } _ { \psi } ( S _ { i + 1 } ) - \hat { v } _ { \psi } ( S _ { i } )$ Store $\left( { { S _ { i } } , { A _ { i } } , { G _ { i } } , \mathrm { { A d v } } _ { i } , { t _ { i } } } \right)$ in M end Normalize Advi in M as Advi ← Advi−mean({Advi}) for $o = 1 , \ldots , K _ { o p t }$ do Sample a minibatch $\{ ( S _ { i } , A _ { i } , G _ { i } , \mathrm { A d v } _ { i } , t _ { i } ) \} _ { i = 1 , \ldots , B }$ from $M$ $\begin{array} { r } { L ( \psi ) \frac { 1 } { 2 B } \sum _ { i = 1 } ^ { B } ( \hat { v } _ { \psi } ( S _ { i } ) - G _ { i } ) ^ { 2 } \mathrm { ~ / ~ } \star } \end{array}$ No gradient through $G _ { i }$ \*/ $\begin{array} { r l } & { L ( \theta , \theta ^ { \prime } ) \gets \frac { 1 } { B } \sum _ { i = 1 } ^ { B } \gamma _ { C } ^ { t _ { i } } \operatorname* { m i n } \{ \frac { \pi _ { \theta } ( A _ { i } | S _ { i } ) } { \pi _ { \theta _ { o l d } } ( A _ { i } | S _ { i } ) } \mathrm { A d v } _ { i } , \mathrm { c l i p } ( \frac { \pi _ { \theta } ( A _ { i } | S _ { i } ) } { \pi _ { \theta _ { o l d } } ( A _ { i } | S _ { i } ) } ) \mathrm { A d v } _ { i } \} + } \\ & { \quad \quad \quad \quad ( 1 - \gamma _ { \mathrm { C } } ^ { t _ { i } } ) \operatorname* { m i n } \{ \frac { \pi _ { \theta ^ { \prime } } ( A _ { i } | S _ { i } ) } { \pi _ { \theta _ { o l d } } ( A _ { i } | S _ { i } ) } \mathrm { A d v } _ { i } , \mathrm { c l i p } ( \frac { \pi _ { \theta ^ { \prime } } ( A _ { i } | S _ { i } ) } { \pi _ { \theta _ { o l d } } ( A _ { i } | S _ { i } ) } ) \mathrm { A d v } _ { i } \} } \end{array}$ if Perform one gradient update to $\begin{array} { r } { \frac { 1 } { B } \sum _ { i = 1 } ^ { B } \log \pi _ { \theta _ { o l d } } ( A _ { i } | S _ { i } ) - \log \pi _ { \theta } ( A _ { i } | S _ { i } ) < K L _ { t a r g e t } } \end{array}$ $\psi$ minimizing $L ( \psi )$ with Adam enwith Adam $\theta , \theta ^ { \prime }$ $\bar { L ( \theta , \theta ^ { \prime } ) }$ end end
|
| 460 |
+
end
|
| 461 |
+
|
| 462 |
+

|
| 463 |
+
(a) Architecture of PPO, PPO- (b) The first parameterization of PPO-FHTD TD, PPO-TD-Ex, DisPPO
|
| 464 |
+
|
| 465 |
+

|
| 466 |
+
Figure 13: Architectures of the algorithms
|
| 467 |
+
|
| 468 |
+
# C ADDITIONAL EXPERIMENTAL RESULTS
|
| 469 |
+
|
| 470 |
+
# C.1 DISTRIBUTIONAL RL
|
| 471 |
+
|
| 472 |
+
Hypothesis 1 and the previous empirical study suggest that representation learning may be the main bottleneck of PPO-TD $( \gamma _ { \mathrm { { c } } } = 1 )$ ). To further support this, we benchmark PPO-C51 $\gamma _ { \mathrm { c } } = 1 $ ) (Algorithm 5 in the appendix), where the critic of PPO is trained with C51. C51 is usually considered to improve representation learning by implicitly providing auxiliary tasks (Bellemare et al., 2017; Munos, 2018; Petroski Such et al., 2019). Figure 14 shows that training the critic with C51 indeed leads to a performance improvement and PPO-C51 $( \gamma _ { \mathrm { c } } = 1 )$ ) sometimes outperforms PPO-TD $( \gamma _ { \mathrm { c } } < 1 )$ by a large margin. Figure 15 further shows that when $V _ { \mathrm { m a x } }$ is optimized for PPO-C51, the benefit for using $\gamma _ { \mathrm { c } } < 1$ in PPO-C51 is less pronounced than that in PPO-TD, indicating the role of $\gamma _ { \mathrm { c } } < 1$ and distributional learning may overlap. Figures 6, 7, & 9, suggest that the overlapping is representation learning.
|
| 473 |
+
|
| 474 |
+
# C.2 OTHER COMPLEMENTARY RESULTS
|
| 475 |
+
|
| 476 |
+
Figure 16 shows how PPO-TD-Ex $\gamma _ { \mathrm { c } } = 0 . 9 9 5$ ) reacts to the increase of $N$ . Figure 17 shows the unnormalized representation error in the MRP experiment. Figure 18 shows the average episode length for the Ant environment in the discounted setting. For HalfCheetah, it is always 1000.
|
| 477 |
+
|
| 478 |
+

|
| 479 |
+
Figure 14: For PPO-C51, we set $\gamma _ { \mathrm { c } } = 1$ .
|
| 480 |
+
|
| 481 |
+

|
| 482 |
+
Figure 15: For each game, $V _ { \mathrm { m a x } }$ is the same as the $V _ { \mathrm { m a x } }$ in Figure 14.
|
| 483 |
+
|
| 484 |
+

|
| 485 |
+
Figure 16: PPO-TD-Ex $\langle \gamma _ { \mathrm { c } } = 0 . 9 9 5 \rangle$ .
|
| 486 |
+
|
| 487 |
+

|
| 488 |
+
Figure 17: Unnormalized representation error (RE) as a function of the discount factor. Shaded regions indicate one standard derivation. RE is computed analytically as $\mathrm { R E } ( X , \gamma ) \doteq \operatorname* { m i n } _ { w } | | X w -$ $v _ { \gamma } | | _ { 2 }$
|
| 489 |
+
|
| 490 |
+

|
| 491 |
+
Figure 18: Curves without any marker are obtained in the original $\mathtt { A n t }$ . Diamond-marked curves are obtained in Ant with $r ^ { \prime }$ .
|
| 492 |
+
|
| 493 |
+

|
| 494 |
+
Figure 19: The default PPO implementation with different discount factors. The larger version of Figure 1.
|
| 495 |
+
|
| 496 |
+

|
| 497 |
+
Figure 20: Comparison between PPO and PPO-TD when $\gamma _ { \mathrm { c } } = 1$ . The larger version of Figure 2.
|
| 498 |
+
|
| 499 |
+

|
| 500 |
+
Figure 21: PPO-TD with different discount factors. The larger version of Figure 3.
|
| 501 |
+
|
| 502 |
+

|
| 503 |
+
Figure 22: PPO-TD-Ex $\langle \gamma _ { \mathrm { c } } = 0 . 9 9 ,$ ). The larger version of Figure 4.
|
| 504 |
+
|
| 505 |
+

|
| 506 |
+
Figure 23: PPO-TD-Ex $( \gamma _ { \mathrm { c } } = 1$ ). The larger version of Figure 5.
|
| 507 |
+
|
| 508 |
+

|
| 509 |
+
Figure 24: PPO-FHTD with the first parameterization. The best $H$ and $\gamma _ { \mathrm { { C } } }$ are used for each game. The larger version of Figure 6.
|
| 510 |
+
|
| 511 |
+

|
| 512 |
+
Figure 25: PPO-FHTD with the second parameterization. The larger version of Figure 7.
|
| 513 |
+
|
| 514 |
+

|
| 515 |
+
Figure 26: Comparison between PPO and DisPPO with $\gamma = 0 . 9 9 5$ . The larger version of Figure 10.
|
| 516 |
+
|
| 517 |
+

|
| 518 |
+
Figure 27: Curves without any marker are obtained in the original Ant environment. Diamondmarked curves are obtained in Ant with $r ^ { \prime }$ . The larger version of Figure 11.
|