ZHANGYUXUAN-zR commited on
Commit
d319f5f
·
verified ·
1 Parent(s): 74950a4

Add files using upload-large-folder tool

Browse files
parse/train/B1e0X3C9tQ/B1e0X3C9tQ.md ADDED
@@ -0,0 +1,270 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # DIAGNOSING AND ENHANCING VAE MODELS
2
+
3
+ # Bin Dai
4
+
5
+ David Wipf
6
+ Microsoft Research
7
+ Beijing, China
8
+ davidwipf@gmail.com
9
+ Institute for Advanced Study
10
+ Tsinghua University
11
+ Beijing, China
12
+ daib13@mails.tsinghua.edu.cn
13
+
14
+ # ABSTRACT
15
+
16
+ Although variational autoencoders (VAEs) represent a widely influential deep generative model, many aspects of the underlying energy function remain poorly understood. In particular, it is commonly believed that Gaussian encoder/decoder assumptions reduce the effectiveness of VAEs in generating realistic samples. In this regard, we rigorously analyze the VAE objective, differentiating situations where this belief is and is not actually true. We then leverage the corresponding insights to develop a simple VAE enhancement that requires no additional hyperparameters or sensitive tuning. Quantitatively, this proposal produces crisp samples and stable FID scores that are actually competitive with a variety of GAN models, all while retaining desirable attributes of the original VAE architecture. The code for our model is available at https://github.com/daib13/TwoStageVAE.
17
+
18
+ # 1 INTRODUCTION
19
+
20
+ Our starting point is the desire to learn a probabilistic generative model of observable variables ${ \pmb x } \in$ $x$ , where $x$ is a $r$ -dimensional manifold embedded in $\mathbf { \mathbb { R } } ^ { d }$ . Note that if $r = d$ , then this assumption places no restriction on the distribution of $\pmb { x } \in \mathbb { R } ^ { d }$ whatsoever; however, the added formalism is introduced to handle the frequently encountered case where $_ { \textbf { \em x } }$ possesses low-dimensional structure relative to a high-dimensional ambient space, i.e., $r \ll d$ . In fact, the very utility of generative models of continuous data, and their attendant low-dimensional representations, often hinges on this assumption (Bengio et al., 2013). It therefore behooves us to explicitly account for this situation.
21
+
22
+ Beyond this, we assume that $x$ is a simple Riemannian manifold, which means there exists a diffeomorphism $\varphi$ between $x$ and $\mathbb { R } ^ { r }$ , or more explicitly, the mapping $\varphi : x \mapsto \mathbb { R } ^ { r }$ is invertible and differentiable. Denote a ground-truth probability measure on $x$ as $\mu _ { g t }$ such that the probability mass of an infinitesimal $d \mathbf { x }$ on the manifold is $\mu _ { g t } ( d \pmb { x } )$ and $\textstyle \int _ { \mathcal { X } } \mu _ { g t } ( d \pmb { x } ) \doteq 1$ .
23
+
24
+ The variational autoencoder (VAE) (Kingma & Welling, 2014; Rezende et al., 2014) attempts to approximate this ground-truth measure using a parameterized density $p _ { \theta } ( { \pmb x } )$ defined across all of $\mathbb { R } ^ { d }$ since any underlying generative manifold is unknown in advance. This density is further assumed to admit the latent decomposition $\begin{array} { r } { p _ { \theta } ( \pmb { x } ) = \int p _ { \theta } ( \pmb { x } | \pmb { z } ) p ( \pmb { z } ) d \pmb { z } } \end{array}$ , where $z \in \mathbb { R } ^ { \kappa }$ serves as a lowdimensional representation, with $\kappa \approx r$ and prior $p ( z ) = \mathcal { N } ( z | \mathbf { 0 } , I )$ .
25
+
26
+ Ideally we might like to minimize the negative log-likelihood $- \log p _ { \theta } ( { \pmb x } )$ averaged across the ground-truth measure $\mu _ { g t }$ , i.e., solve $\begin{array} { r } { \operatorname* { m i n } _ { \theta } \int _ { \mathcal { X } } - \log p _ { \theta } ( \pmb { x } ) \mu _ { g t } ( d \pmb { x } ) } \end{array}$ . Unfortunately though, the required marginalization over $_ z$ is generally infeasible. Instead the VAE model relies on tractable encoder $q _ { \phi } \bar { ( } z | \mathbf { x } )$ and decoder $p _ { \boldsymbol { \theta } } ( \boldsymbol { \mathbf { \hat { x } } } | \boldsymbol { \mathbf { \tilde { z } } } )$ distributions, where $\phi$ represents additional trainable parameters. The canonical VAE cost is a bound on the average negative log-likelihood given by
27
+
28
+ $$
29
+ \begin{array} { r } { \mathcal { L } ( \theta , \phi ) \triangleq \int _ { \mathcal { X } } \left\{ - \log p _ { \theta } ( \pmb { x } ) \ + \ \mathbb { K L } \left[ q _ { \phi } ( z | \pmb { x } ) | | p _ { \theta } ( z | \pmb { x } ) \right] \right\} \mu _ { g t } ( d \pmb { x } ) \geq \int _ { \mathcal { X } } - \log p _ { \theta } ( \pmb { x } ) \mu _ { g t } ( d \pmb { x } ) , } \end{array}
30
+ $$
31
+
32
+ where the inequality follows directly from the non-negativity of the KL-divergence. Here $\phi$ can be viewed as tuning the tightness of bound, while $\theta$ dictates the actual estimation of $\mu _ { g t }$ . Using a few standard manipulations, this bound can also be expressed as
33
+
34
+ $$
35
+ \begin{array} { r } { \mathcal { L } ( \theta , \phi ) = \int _ { \mathcal { X } } \left\{ - \mathbb { E } _ { q _ { \phi } ( z | \mathbf { x } ) } \left[ \log p _ { \theta } \left( { \pmb x } | { \pmb z } \right) \right] + \mathbb { K L } \left[ q _ { \phi } ( z | \mathbf { x } ) | | p ( z ) \right] \right\} \mu _ { g t } ( d \pmb { x } ) , } \end{array}
36
+ $$
37
+
38
+ which explicitly involves the encoder/decoder distributions and is conveniently amenable to SGD optimization of $\{ \theta , \phi \}$ via a reparameterization trick (Kingma & Welling, 2014; Rezende et al.,
39
+
40
+ 2014). The first term in (2) can be viewed as a reconstruction cost (or a stochastic analog of a traditional autoencoder), while the second penalizes posterior deviations from the prior $p ( z )$ . Additionally, for any realizable implementation via SGD, the integration over $x$ must be approximated via a finite sum across training samples $\{ \pmb { x } ^ { ( i ) } \} _ { i = 1 } ^ { n }$ drawn from $\mu _ { g t }$ . Nonetheless, examining the true objective ${ \mathcal { L } } ( \theta , \phi )$ can lead to important, practically-relevant insights.
41
+
42
+ At least in principle, $q _ { \phi } ( \pmb { z } | \pmb { x } )$ and $p _ { \theta } ( { \pmb x } | { \pmb z } )$ can be arbitrary distributions, in which case we could simply enforce $q _ { \phi } ( z | \mathbf { x } ) = p _ { \theta } ( z | \mathbf { x } ) \propto p _ { \theta } ( \mathbf { x } | z ) p ( z )$ such that the bound from (1) is tight. Unfortunately though, this is essentially always an intractable undertaking. Consequently, largely to facilitate practical implementation, a commonly adopted distributional assumption for continuous data is that both $q _ { \phi } ( \pmb { z } | \pmb { x } )$ and $p _ { \theta } ( { \pmb x } | { \pmb z } )$ are Gaussian. This design choice has previously been cited as a key limitation of VAEs (Burda et al., 2015; Kingma et al., 2016), and existing quantitative tests of generative modeling quality thus far dramatically favor contemporary alternatives such as generative adversarial networks (GAN) (Goodfellow et al., 2014). Regardless, because the VAE possesses certain desirable properties relative to GAN models (e.g., stable training (Tolstikhin et al., 2018), interpretable encoder/inference network (Brock et al., 2016), outlier-robustness (Dai et al., 2018), etc.), it remains a highly influential paradigm worthy of examination and enhancement.
43
+
44
+ In Section 2 we closely investigate the implications of VAE Gaussian assumptions leading to a number of interesting diagnostic conclusions. In particular, we differentiate the situation where $r = d$ , in which case we prove that recovering the ground-truth distribution is actually possible iff the VAE global optimum is reached, and $r < d$ , in which case the VAE global optimum can be reached by solutions that reflect the ground-truth distribution almost everywhere, but not necessarily uniquely so. In other words, there could exist alternative solutions that both reach the global optimum and yet do not assign the same probability measure as $\mu _ { g t }$ .
45
+
46
+ Section 3 then further probes this non-uniqueness issue by inspecting necessary conditions of global optima when $r \ < \ d$ . This analysis reveals that an optimal VAE parameterization will provide an encoder/decoder pair capable of perfectly reconstructing all ${ \pmb x } \in { \pmb x }$ using any $_ z$ drawn from $q _ { \phi } ( z | \pmb { x } )$ . Moreover, we demonstrate that the VAE accomplishes this using a degenerate latent code whereby only $r$ dimensions are effectively active. Collectively, these results indicate that the VAE global optimum can in fact uniquely learn a mapping to the correct ground-truth manifold when $r < d$ , but not necessarily the correct probability measure within this manifold, a critical distinction.
47
+
48
+ Next we leverage these analytical results in Section 4 to motivate an almost trivially-simple, twostage VAE enhancement for addressing typical regimes when $r \ < \ d$ . In brief, the first stage just learns the manifold per the allowances from Section 3, and in doing so, provides a mapping to a lower dimensional intermediate representation with no degenerate dimensions that mirrors the $r = d$ regime. The second (much smaller) stage then only needs to learn the correct probability measure on this intermediate representation, which is possible per the analysis from Section 2. Experiments from Sections 5 and 6 empirically corroborate motivational theory and reveal that the proposed two-stage procedure can generate high-quality samples, reducing the blurriness often attributed to VAE models in the past (Dosovitskiy & Brox, 2016; Larsen et al., 2015). And to the best of our knowledge, this is the first demonstration of a VAE pipeline that can produce stable FID scores, an influential recent metric for evaluating generated sample quality (Heusel et al., 2017), that are comparable to GAN models under neutral testing conditions. Moreover, this is accomplished without additional penalties, cost function modifications, or sensitive tuning parameters. Finally, an extended version of this work can be found in (Dai & Wipf, 2019). There we include additional results, consideration of disentangled representations, as well as a comparative discussion of broader VAE modeling paradigms such as those involving normalizing flows or parameterized families for $p ( z )$ .
49
+
50
+ # 2 HIGH-LEVEL IMPACT OF VAE GAUSSIAN ASSUMPTIONS
51
+
52
+ Conventional wisdom suggests that VAE Gaussian assumptions will introduce a gap between ${ \mathcal { L } } ( \theta , \phi )$ and the ideal negative log-likelihood $\begin{array} { r } { \int _ { \mathcal { X } } - \log p _ { \theta } ( \pmb { x } ) \bar { \mu } _ { g t } ( d \pmb { x } ) } \end{array}$ , compromising efforts to learn the ground-truth measure. However, we will now argue that this pessimism is in some sense premature. In fact, we will demonstrate that, even with the stated Gaussian distributions, there exist parameters $\phi$ and $\theta$ that can simultaneously: $( i )$ Globally optimize the VAE objective and, $( i i )$ Recover the ground-truth probability measure in a certain sense described below. This is possible because, at least for some coordinated values of $\phi$ and $\theta$ , $q _ { \phi } ( \pmb { z } | \pmb { x } )$ and $p _ { \theta } ( \pmb { z } | \pmb { x } )$ can indeed become arbitrarily close. Before presenting the details, we first formalize a $\kappa$ -simple VAE, which is merely a VAE model with explicit Gaussian assumptions and parameterizations:
53
+
54
+ Definition 1 A $\kappa$ -simple VAE is defined as a VAE model with $d i m [ z ] = \kappa$ latent dimensions, the Gaussian encoder $q _ { \phi } \bar { ( } z | \mathbf { x } ) = \mathcal { N } ( z | \mu _ { z } , \Sigma _ { z } )$ , and the Gaussian decoder $p _ { \theta } ( { \pmb x } | z ) = \mathcal { N } ( { \pmb x } | { \pmb \mu } _ { x } , { \pmb \Sigma } _ { x } )$ . Moreover, the encoder moments are defined as $\mu _ { z } = f _ { \mu _ { z } } ( { \pmb x } ; \phi )$ and $\pmb { \Sigma } _ { z } = \pmb { S } _ { z } \pmb { S } _ { z } ^ { \top }$ with $S _ { z } ~ =$ $f _ { S _ { z } } ( { \pmb x } ; \phi )$ . Likewise, the decoder moments are $\begin{array} { r } { \pmb { \mu } _ { x } = f _ { \mu _ { x } } ( z ; \theta ) } \end{array}$ and $\Sigma _ { x } = \gamma I$ . Here $\gamma > 0$ is $a$ tunable scalar, while $f _ { \mu _ { z } }$ , $f _ { S _ { z } }$ and $f _ { \mu _ { x } }$ specify parameterized differentiable functional forms that can be arbitrarily complex, e.g., a deep neural network.
55
+
56
+ Equipped with these definitions, we will now demonstrate that a $\kappa$ -simple VAE, with $\kappa \geq r$ , can achieve the optimality criteria $( i )$ and $( i i )$ from above. In doing so, we first consider the simpler case where $r = d$ , followed by the extended scenario with $r \textless d$ . The distinction between these two cases turns out to be significant, with practical implications to be explored in Section 4.
57
+
58
+ # 2.1 MANIFOLD DIMENSION EQUAL TO AMBIENT SPACE DIMENSION $( r = d$
59
+
60
+ We first analyze the specialized situation where $r \ = \ d$ . Assuming $p _ { g t } ( { \pmb x } ) \triangleq \mu _ { g t } ( d { \pmb x } ) / d { \pmb x }$ exists everywhere in $\mathbb { R } ^ { d }$ , then $p _ { g t } ( \pmb { x } )$ represents the ground-truth probability density with respect to the standard Lebesgue measure in Euclidean space. Given these considerations, the minimal possible value of (1) will necessarily occur if
61
+
62
+ $$
63
+ \mathbb { K L } \left[ q _ { \phi } ( \boldsymbol { z } | \boldsymbol { x } ) | | p _ { \theta } ( \boldsymbol { z } | \boldsymbol { x } ) \right] = 0 \quad \mathrm { a n d } \quad p _ { \theta } ( \boldsymbol { x } ) = p _ { g t } ( \boldsymbol { x } ) \mathrm { a }
64
+ $$
65
+
66
+ This follows because by VAE design it must be that $\begin{array} { r } { \mathcal { L } ( \theta , \phi ) \geq - \int p _ { g t } ( \pmb { x } ) \log p _ { g t } ( \pmb { x } ) d \pmb { x } , } \end{array}$ , and in the present context, this lower bound is achievable iff the conditions from (3) hold. Collectively, this implies that the approximate posterior produced by the encoder $q _ { \phi } ( \pmb { z } | \pmb { x } )$ is in fact perfectly matched to the actual posterior $p _ { \theta } ( z | \mathbf { \bar { x } } )$ , while the corresponding marginalized data distribution $p _ { \theta } ( { \pmb x } )$ is perfectly matched the ground-truth density $p _ { g t } ( \pmb { x } )$ as desired. Perhaps surprisingly, a $\kappa$ -simple VAE can actually achieve such a solution:
67
+
68
+ Theorem 1 Suppose that $r = d$ and there exists a density $p _ { g t } ( \pmb { x } )$ associated with the ground-truth measure $\mu _ { g t }$ that is nonzero everywhere on $\mathbb { R } ^ { d } . ^ { 1 }$ . Then for any $\kappa \geq r$ , there is a sequence of $\dot { } _ { \kappa }$ -simple VAE model parameters $\{ \theta _ { t } ^ { * } , \phi _ { t } ^ { * } \}$ such that
69
+
70
+ $$
71
+ \operatorname* { l i m } _ { t \to \infty } \mathbb { K } \mathbb { L } \left[ q _ { \phi _ { t } ^ { * } } ( z | x ) | | p _ { \theta _ { t } ^ { * } } ( z | x ) \right] = 0 \quad a n d \quad \operatorname* { l i m } _ { t \to \infty } p _ { \theta _ { t } ^ { * } } ( x ) = p _ { g t } ( x ) \ : a
72
+ $$
73
+
74
+ All the proofs can be found in (Dai & Wipf, 2019). So at least when $r = d$ , the VAE Gaussian assumptions need not actually prevent the optimal ground-truth probability measure from being recovered, as long as the latent dimension is sufficiently large (i.e., $\kappa \geq r$ ). And contrary to popular notions, a richer class of distributions is not required to achieve this. Of course Theorem 1 only applies to a restricted case that excludes $d > r$ ; however, later we will demonstrate that a key consequence of this result can nonetheless be leveraged to dramatically enhance VAE performance.
75
+
76
+ # 2.2 MANIFOLD DIMENSION LESS THAN AMBIENT SPACE DIMENSION $( r < d )$
77
+
78
+ When $r < d$ , additional subtleties are introduced that will be unpacked both here and in the sequel. To begin, if both $q _ { \phi } ( \pmb { z } | \pmb { x } )$ and $p _ { \theta } ( { \pmb x } | { \pmb z } )$ are arbitrary/unconstrained (i.e., not necessarily Gaussian), then $\begin{array} { r } { \operatorname* { i n f } _ { \phi , \theta } \mathcal { L } ( \theta , \phi ) = - \infty } \end{array}$ . To achieve this global optimum, we need only choose $\phi$ such that $q _ { \phi } ( z | \pmb { x } ) = p _ { \theta } ( z | \pmb { x } )$ (minimizing the KL term from (1)) while selecting $\theta$ such that all probability mass collapses to the correct manifold $x$ . In this scenario the density $p _ { \theta } ( { \pmb x } )$ will become unbounded on $x$ and zero elsewhere, such that $\begin{array} { r } { \int _ { \mathcal { X } } - \log p _ { \theta } ( \pmb { x } ) \mu _ { g t } ( d \pmb { x } ) } \end{array}$ will approach negative infinity.
79
+
80
+ But of course the stated Gaussian assumptions from the $\kappa$ -simple VAE model could ostensibly prevent this from occurring by causing the KL term to blow up, counteracting the negative loglikelihood factor. We will now analyze this case to demonstrate that this need not happen. Before proceeding to this result, we first define a manifold density $\tilde { p } _ { g t } ( \pmb { x } )$ as the probability density (assuming it exists) of $\mu _ { g t }$ with respect to the volume measure of the manifold $x$ . If $d = r$ then this volume measure reduces to the standard Lebesgue measure in $\mathbb { R } ^ { d }$ and $\tilde { p } _ { g t } ( { \pmb x } ) = p _ { g t } ( { \pmb x } )$ ; however, when $d > r$ a density $p _ { g t } ( \pmb { x } )$ defined in $\mathbb { R } ^ { d }$ will not technically exist, while $\tilde { p } _ { g t } ( \pmb { x } )$ is still perfectly well-defined. We then have the following:
81
+
82
+ Theorem 2 Assume $r \ < \ d$ and that there exists a manifold density $\tilde { p } _ { g t } ( \pmb { x } )$ associated with the ground-truth measure $\mu _ { g t }$ that is nonzero everywhere on $x$ . Then for any $\kappa \geq r$ , there is a sequence of $\kappa$ -simple VAE model parameters $\{ \theta _ { t } ^ { * } , \phi _ { t } ^ { * } \}$ such that
83
+
84
+ $$
85
+ ( i ) \operatorname* { l i m } _ { t \infty } \mathbb { K L } [ q _ { \phi _ { t } ^ { \star } } ( z | x ) | | p _ { \theta _ { t } ^ { \star } } ( z | x ) ] = 0 \quad a n d \quad \operatorname* { l i m } _ { t \infty } \int _ { \mathcal { X } } - \log p _ { \theta _ { t } ^ { \star } } ( x ) \mu _ { g t } ( d x ) = - \infty ,
86
+ $$
87
+
88
+ $$
89
+ \begin{array} { r } { \underset { t \infty } { \operatorname* { l i m } } \int _ { \pmb { x } \in A } p _ { \theta _ { t } ^ { * } } ( \pmb { x } ) d \pmb { x } = \mu _ { g t } ( A \cap \pmb { x } ) } \end{array}
90
+ $$
91
+
92
+ Technical details notwithstanding, Theorem 2 admits a very intuitive interpretation. First, (5) directly implies that the VAE Gaussian assumptions do not prevent minimization of ${ \mathcal { L } } ( \theta , \phi )$ from converging to minus infinity, which can be trivially viewed as a globally optimum solution. Furthermore, based on (6), this solution can be achieved with a limiting density estimate that will assign a probability mass to most all measurable subsets of $\mathbb { R } ^ { d }$ that is indistinguishable from the groundtruth measure (which confines all mass to $x$ ). Hence this solution is more-or-less an arbitrarily-good approximation to $\mu _ { g t }$ for all practical purposes.2
93
+
94
+ Regardless, there is an absolutely crucial distinction between Theorem 2 and the simpler case quantified by Theorem 1. Although both describe conditions whereby the $\kappa$ -simple VAE can achieve the minimal possible objective, in the $r = d$ case achieving the lower bound (whether the specific parameterization for doing so is unique or not) necessitates that the ground-truth probability measure has been recovered almost everywhere. But the $r < d$ situation is quite different because we have not ruled out the possibility that a different set of parameters $\{ \theta , \phi \}$ could push ${ \mathcal { L } } ( \theta , \phi )$ to $- \infty$ and yet not achieve (6). In other words, the VAE could reach the lower bound but fail to closely approximate $\mu _ { g t }$ . And we stress that this uniqueness issue is not a consequence of the VAE Gaussian assumptions per se; even if $q _ { \phi } ( \pmb { z } | \pmb { x } )$ were unconstrained the same lack of uniqueness can persist.
95
+
96
+ Rather, the intrinsic difficulty is that, because the VAE model does not have access to the groundtruth low-dimensional manifold, it must implicitly rely on a density $p _ { \theta } ( { \pmb x } )$ defined across all of $\mathbb { R } ^ { d }$ as mentioned previously. Moreover, if this density converges towards infinity on the manifold during training without increasing the KL term at the same rate, the VAE cost can be unbounded from below, even in cases where (6) is not satisfied, meaning incorrect assignment of probability mass.
97
+
98
+ To conclude, the key take-home message from this section is that, at least in principle, VAE Gaussian assumptions need not actually be the root cause of any failure to recover ground-truth distributions. Instead we expose a structural deficiency that lies elsewhere, namely, the non-uniqueness of solutions that can optimize the VAE objective without necessarily learning a close approximation to $\mu _ { g t }$ . But to probe this issue further and motivate possible workarounds, it is critical to further disambiguate these optimal solutions and their relationship with ground-truth manifolds. This will be the task of Section 3, where we will explicitly differentiate the problem of locating the correct groundtruth manifold, from the task of learning the correct probability measure within the manifold.
99
+
100
+ Note that the only comparable prior work we are aware of related to the results in this section comes from Doersch (2016), where the implications of adopting Gaussian encoder/decoder pairs in the specialized case of $r = d = 1$ are briefly considered. Moreover, the analysis there requires additional much stronger assumptions than ours, namely, that $p _ { g t } ( \pmb { x } )$ should be nonzero and infinitely differentiable everywhere in the requisite 1D ambient space. These requirements of course exclude essentially all practical usage regimes where $d = r > 1$ or $d > r$ , or when ground-truth densities are not sufficiently smooth.
101
+
102
+ # 3 OPTIMAL SOLUTIONS AND THE GROUND TRUTH MANIFOLD
103
+
104
+ We will now more closely examine the properties of optimal $\kappa$ -simple VAE solutions, and in particular, the degree to which we might expect them to at least reflect the true $x$ , even if perhaps not the correct probability measure $\mu _ { g t }$ defined within $x$ . To do so, we must first consider some necessary conditions for VAE optima:
105
+
106
+ Theorem 3 Let $\{ \theta _ { \gamma } ^ { * } , \phi _ { \gamma } ^ { * } \}$ denote an optimal $\kappa$ -simple VAE solution (with $\kappa \geq r$ ) where the decoder variance $\gamma$ is fixed (i.e., it is the sole unoptimized parameter). Moreover, we assume that $\mu _ { g t }$ is not a Gaussian distribution when $d = r$ .3 Then for any $\gamma > 0$ , there exists a $\gamma ^ { \prime } < \gamma$ such that $\mathcal { L } ( \theta _ { \gamma ^ { \prime } } ^ { * } , \phi _ { \gamma ^ { \prime } } ^ { * } ) < \mathcal { L } ( \theta _ { \gamma } ^ { * } , \phi _ { \gamma } ^ { * } )$ .
107
+
108
+ This result implies that we can always reduce the VAE cost by choosing a smaller value of $\gamma$ , and hence, if $\gamma$ is not constrained, it must be that $\gamma 0$ if we wish to minimize (2). Despite this necessary optimality condition, in existing practical VAE applications, it is standard to fix $\gamma \approx 1$ during training. This is equivalent to simply adopting a non-adaptive squared-error loss for the decoder and, at least in part, likely contributes to unrealistic/blurry VAE-generated samples (Bousquet et al., 2017). Regardless, there are more significant consequences of this intrinsic favoritism for $\gamma 0$ , in particular as related to reconstructing data drawn from the ground-truth manifold $x$ :
109
+
110
+ Theorem 4 Applying the same conditions and definitions as in Theorem $^ 3$ , then for all $_ { \textbf { \em x } }$ drawn from $\mu _ { g t }$ , we also have that
111
+
112
+ $$
113
+ \operatorname* { l i m } _ { \gamma \to 0 } f _ { \mu _ { x } } \left[ f _ { \mu _ { z } } ( \mathbf { x } ; \boldsymbol { \phi } _ { \gamma } ^ { * } ) + f _ { S _ { z } } ( \mathbf { x } ; \boldsymbol { \phi } _ { \gamma } ^ { * } ) \boldsymbol { \varepsilon } ; \boldsymbol { \theta } _ { \gamma } ^ { * } \right] = \operatorname* { l i m } _ { \gamma \to 0 } f _ { \mu _ { x } } \left[ f _ { \mu _ { z } } ( \mathbf { x } ; \boldsymbol { \phi } _ { \gamma } ^ { * } ) ; \boldsymbol { \theta } _ { \gamma } ^ { * } \right] = \mathbf { x } , \quad \forall \boldsymbol { \varepsilon } \in \mathbb { R } ^ { \kappa } .
114
+ $$
115
+
116
+ By design any random draw $z \sim q _ { \phi _ { \gamma } ^ { * } } \left( z | \boldsymbol { x } \right)$ can be expressed as $f _ { \mu _ { z } } ( { \pmb x } ; \phi _ { \gamma } ^ { * } ) + f _ { S _ { z } } ( { \pmb x } ; \phi _ { \gamma } ^ { * } ) \varepsilon$ for some $\varepsilon \sim \mathcal { N } ( \varepsilon | \mathbf { 0 } , I )$ . From this vantage point then, (7) effectively indicates that any ${ \textbf { \em x } } \in { \boldsymbol { x } }$ will be perfectly reconstructed by the VAE encoder/decoder pair at globally optimal solutions, achieving this necessary condition despite any possible stochastic corrupting factor $f _ { S _ { z } } ( \pmb { x } ; \phi _ { \gamma } ^ { * } ) \varepsilon$ .
117
+
118
+ But still further insights can be obtained when we more closely inspect the VAE objective function behavior at arbitrarily small but explicitly nonzero values of $\gamma$ . In particular, when $\kappa ~ = ~ r$ (meaning $_ z$ has no superfluous capacity), Theorem 4 and attendant analyses in (Dai & Wipf, 2019) ultimately imply that the squared eigenvalues of $f _ { S _ { z } } ( \pmb { x } ; \phi _ { \gamma } ^ { * } )$ will become arbitrarily small at a rate proportional to $\gamma$ , meaning $\begin{array} { r } { \frac { 1 } { \sqrt { \gamma } } f _ { S _ { z } } ( \pmb { x } ; \phi _ { \gamma } ^ { * } ) \approx \cal { O } ( 1 ) } \end{array}$ under mild conditions. It then follows that the VAE data term integrand from (2), in the neighborhood around optimal solutions, behaves as $- 2 \mathbb { E } _ { q _ { \phi _ { \gamma } ^ { * } } ( z | x ) } \left[ \log p _ { \theta _ { \gamma } ^ { * } } \left( \mathbf { { \bar { x } } } | z \right) \right] ~ =$
119
+
120
+ $$
121
+ \begin{array} { r } { \mathbb { E } _ { q _ { \phi _ { \gamma } ^ { * } } ( z | x ) } \left[ \frac { 1 } { \gamma } \left\| x - f _ { \mu _ { x } } \left[ z ; \theta _ { \gamma } ^ { * } \right] \right\| _ { 2 } ^ { 2 } \right] + d \log 2 \pi \gamma \approx \mathbb { E } _ { q _ { \phi _ { \gamma } ^ { * } } ( z | x ) } \left[ O ( 1 ) \right] + d \log 2 \pi \gamma = d \log \gamma + O ( 1 ) . } \end{array}
122
+ $$
123
+
124
+ This expression can be derived by excluding the higher-order terms of a Taylor series approximation of $\dot { f } _ { \mu _ { x } } \left[ f _ { \mu _ { z } } ( { \pmb x } ; \phi _ { \gamma } ^ { * } ) + f _ { S _ { z } } ( \bar { \pmb x } ; \phi _ { \gamma } ^ { * } ) \varepsilon ; \theta _ { \gamma } ^ { * } \right]$ around the point $f _ { \mu _ { z } } ( \pmb { x } ; \phi _ { \gamma } ^ { * } )$ , which will be relatively tight under the stated conditions. But because $\begin{array} { r } { 2 \mathbb { E } _ { q _ { \phi _ { \gamma } ^ { * } } ( z | x ) } \left[ \frac { 1 } { \gamma } \left\| x - f _ { \mu _ { x } } \left[ z ; \theta _ { \gamma } ^ { * } \right] \right\| _ { 2 } ^ { 2 } \right] \geq 0 . } \end{array}$ , a theoretical lower bound on (8) is given by $d \log 2 \pi \gamma \equiv d \log \gamma + O ( 1 )$ . So in this sense (8) cannot be significantly lowered further.
125
+
126
+ This observation is significant when we consider the inclusion of addition latent dimensions by allowing $\kappa > r$ . Clearly based on the analysis above, adding dimensions to $_ z$ cannot improve the value of the VAE data term in any meaningful way. However, it can have a detrimental impact on the the KL regularization factor in the $\gamma 0$ regime, where
127
+
128
+ $$
129
+ 2 \mathbb { K L } \left[ q _ { \phi } ( z | \boldsymbol { x } ) | | p ( z ) \right] \equiv \operatorname { t r a c e } \left[ \boldsymbol { \Sigma } _ { z } \right] + \| \boldsymbol { \mu } _ { z } \| _ { 2 } ^ { 2 } - \log \left| \boldsymbol { \Sigma } _ { z } \right| \approx - \hat { r } \log \gamma + O ( 1 ) .
130
+ $$
131
+
132
+ Here $\hat { r }$ denotes the number of eigenvalues $\{ \lambda _ { j } ( \gamma ) \} _ { j = 1 } ^ { \kappa }$ of $f _ { S _ { z } } ( \pmb { x } ; \boldsymbol { \phi } _ { \gamma } ^ { * } )$ (or equivalently $\Sigma _ { z }$ ) that satisfy $\lambda _ { j } ( \gamma ) \to 0$ if $\gamma 0$ . $\hat { r }$ can be viewed as an estimate of how many low-noise latent dimensions the VAE model is preserving to reconstruct $_ { \textbf { \em x } }$ . Based on (9), there is obvious pressure to make $\hat { r }$ as small as possible, at least without disrupting the data fit. The smallest possible value is $\hat { r } = r$ , since it is not difficult to show that any value below this will contribute consequential reconstruction errors, causing $2 \mathbb { E } _ { q _ { \phi _ { \gamma } ^ { * } } ( z | x ) } \left[ \frac { 1 } { \gamma } \left\| x - f _ { \mu _ { x } } \left[ z ; \theta _ { \gamma } ^ { * } \right] \right\| _ { 2 } ^ { 2 } \right]$ to grow at a rate of $\Omega \left( \begin{array} { l } { \overline { { 1 } } } \\ { \overline { { \gamma } } } \end{array} \right)$ , pushing the entire cost function towards infinity.4
133
+
134
+ Therefore, in the neighborhood of optimal solutions the VAE will naturally seek to produce perfect reconstructions using the fewest number of clean, low-noise latent dimensions, meaning dimensions whereby $q _ { \phi } \left( z | \pmb { x } \right)$ has negligible variance. For superfluous dimensions that are unnecessary for representing $_ { \textbf { \em x } }$ , the associated encoder variance in these directions can be pushed to one. This will optimize ${ \mathbb K } { \mathbb L } \left[ q _ { \phi } ( { \pmb z } | { \pmb x } ) | | p ( { \pmb z } ) \right]$ along these directions, and the decoder can selectively block the residual randomness to avoid influencing the reconstructions per Theorem 4. So in this sense the VAE is capable of learning a minimal representation of the ground-truth manifold $x$ when $r < \kappa$ .
135
+
136
+ But we must emphasize that the VAE can learn $x$ independently of the actual distribution $\mu _ { g t }$ within $x$ . Addressing the latter is a completely separate issue from achieving the perfect reconstruction error defined by Theorem 4. This fact can be understood within the context of a traditional PCAlike model, which is perfectly capable of learning a low-dimensional subspace containing some training data without actually learning the distribution of the data within this subspace. The central issue is that there exists an intrinsic bias associated with the VAE objective such that fitting the distribution within the manifold will be completely neglected whenever there exists the chance for even an infinitesimally better approximation of the manifold itself.
137
+
138
+ Stated differently, if VAE model parameters have learned a near optimal, parsimonious latent mapping onto $x$ using $\gamma \approx 0$ , then the VAE cost will scale as $\left( d - r \right) \log { \gamma }$ regardless of $\mu _ { g t }$ . Hence there remains a huge incentive to reduce the reconstruction error still further, allowing $\gamma$ to push even closer to zero and the cost closer to $- \infty$ . And if we constrain $\gamma$ to be sufficiently large so as to prevent this from happening, then we risk degrading/blurring the reconstructions and widening the gap between $q _ { \phi } ( z | \pmb { x } )$ and $p _ { \theta } ( \pmb { z } | \pmb { x } )$ , which can also compromise estimation of $\mu _ { g t }$ . Fortunately though, as will be discussed next there is a convenient way around this dilemma by exploiting the fact that this dominanting $\left( d - r \right) \log { \gamma }$ factor goes away when $d = r$ .
139
+
140
+ # 4 FROM THEORY TO PRACTICAL VAE ENHANCEMENTS
141
+
142
+ Sections 2 and 3 have exposed a collection of VAE properties with useful diagnostic value in and of themselves. But the practical utility of these results, beyond the underappreciated benefit of learning $\gamma$ , warrant further exploration. In this regard, suppose we wish to develop a generative model of high-dimensional data ${ \textbf { \em x } } \in { \boldsymbol { x } }$ where unknown low-dimensional structure is significant (i.e., the $r < d$ case with $r$ unknown). The results from Section 3 indicate that the VAE can partially handle this situation by learning a parsimonious representation of low-dimensional manifolds, but not necessarily the correct probability measure $\mu _ { g t }$ within such a manifold. In quantitative terms, this means that a decoder $\bar { p } _ { \boldsymbol { \theta } } ( \pmb { x } | \pmb { z } )$ will map all samples from an encoder $q _ { \phi } ( z | \boldsymbol { x } )$ to the correct manifold such that the reconstruction error is negligible for any ${ \pmb x } \in { \pmb x }$ . But if the measure $\mu _ { g t }$ on $x$ has not been accurately estimated, then
143
+
144
+ $$
145
+ \begin{array} { r } { q _ { \phi } ( z ) \triangleq \int _ { \mathbb { X } ^ { d _ { \phi } } } ( z | x ) \mu _ { g t } ( d x ) \neq \int _ { \mathbb { R } ^ { d } } p _ { \theta } ( z | x ) p _ { \theta } ( x ) d x = \int _ { \mathbb { R } ^ { d } } p _ { \theta } ( x | z ) p ( z ) d x = \mathcal { N } ( z | 0 , I ) , } \end{array}
146
+ $$
147
+
148
+ where $q _ { \phi } ( z )$ is sometimes referred to as the aggregated posterior (Makhzani et al., 2016). In other words, the distribution of the latent samples drawn from the encoder distribution, when averaged across the training data, will have lingering latent structure that is errantly incongruous with the original isotropic Gaussian prior. This then disrupts the pivotal ancestral sampling capability of the VAE, implying that samples drawn from $\mathcal { N } ( z | 0 , I )$ and then passed through the decoder $p _ { \theta } ( { \pmb x } | { \pmb z } )$ will not closely approximate $\mu _ { g t }$ . Fortunately, our analysis suggests the following two-stage remedy:
149
+
150
+ 1. Given $n$ observed samples $\{ \pmb { x } ^ { ( i ) } \} _ { i = 1 } ^ { n }$ , train a $\kappa$ -simple VAE, with $\kappa \geq r$ , to estimate the unknown $r$ -dimensional ground-truth manifold $x$ embedded in $\mathbb { R } ^ { d }$ using a minimal number of active latent dimensions. Generate latent samples $\{ z ^ { ( i ) } \} _ { i = 1 } ^ { n }$ via $\pmb { z } ^ { ( i ) } \sim q _ { \phi } ( \pmb { z } | \pmb { x } ^ { ( i ) } )$ . By design, these samples will be distributed as $q _ { \phi } ( z )$ , but likely not $\mathcal { N } ( z | \mathbf { 0 } , I )$ .
151
+
152
+ 2. Train a second $\kappa$ -simple VAE, with independent parameters $\{ \theta ^ { \prime } , \phi ^ { \prime } \}$ and latent representation $\textbf { \em u }$ , to learn the unknown distribution $q _ { \phi } ( z )$ , i.e., treat $q _ { \phi } ( z )$ as a new ground-truth distribution and use samples $\{ z ^ { ( i ) } \} _ { i = 1 } ^ { n }$ to learn it.
153
+
154
+ 3. Samples approximating the original ground-truth $\mu _ { g t }$ can then be formed via the extended ancestral process $\mathbf { \Omega } \mathbf { \tilde { u } } \sim \mathbf { \tilde { \mathcal { N } } } ( \mathbf { \Omega } \mathbf { u } | \mathbf { 0 } , \mathbf { \tilde { I } } )$ , $z \sim p \theta ^ { \prime } ( z | u )$ , and finally $\pmb { x } \sim p _ { \theta } ( \pmb { x } | z )$ .
155
+
156
+ The efficacy of the second-stage VAE from above is based on the following. If the first stage was successful, then even though they will not generally resemble $\mathcal { N } ( z | \mathbf { 0 } , I )$ , samples from $q _ { \phi } ( z )$ will nonetheless have nonzero measure across the full ambient space $\mathbb { R } ^ { \kappa }$ . I f $\kappa = r$ , this occurs because the entire latent space is needed to represent an $r$ -dimensional manifold, and if $\kappa > r$ , then the extra latent dimensions will be naturally filled in via randomness introduced along dimensions associated with nonzero eigenvalues of the decoder covariance $\Sigma _ { z }$ per the analysis in Section 3.
157
+
158
+ Consequently, as long as we set $\kappa \geq r$ , the operational regime of the second-stage VAE is effectively equivalent to the situation described in Section 2.1 where the manifold dimension is equal to the ambient dimension.5 And as we have already shown there via Theorem 1, the VAE can readily handle this situation, since in the narrow context of the second-stage VAE, $d = r = \kappa$ , the troublesome $\left( d - r \right) \log { \gamma }$ factor becomes zero, and any globally minimizing solution is uniquely matched to the new ground-truth distribution $q _ { \phi } ( z )$ . Consequently, the revised aggregated posterior $q _ { \phi ^ { \prime } } ( { \pmb u } )$ produced by the second-stage VAE should now closely resemble $\mathcal { N } ( u | { \bf 0 } , I )$ . And importantly, because we generally assume that $d \gg \kappa \geq r$ , we have found that the second-stage VAE can be quite small.
159
+
160
+ It should also be emphasized that concatenating the two VAE stages and jointly training does not generally improve the performance. If trained jointly the few extra second-stage parameters can simply be hijacked by the dominant influence of the first stage reconstruction term and forced to work on an incrementally better fit of the manifold rather than addressing the critical mismatch between $q _ { \phi } ( z )$ and $\mathcal { N } ( u | { \bf 0 } , I )$ . This observation can be empirically tested, which we have done in multiple ways. For example, we have tried fusing the respective encoders and decoders from the first and second stages to train what amounts to a slightly more complex single VAE model. We have also tried merging the two stages including the associated penalty terms. In both cases, joint training does not help at all as expected, with average performance no better than the first stage VAE (which contains the vast majority of parameters). Consequently, although perhaps counterintuitive, separate training of these two VAE stages is actually critical to achieving high quality results as will be demonstrated next.
161
+
162
+ # 5 QUANTITATIVE COMPARISONS OF GENERATED SAMPLE QUALITY
163
+
164
+ We first present quantitative evaluation of novel generated samples using the large-scale testing protocol of GAN models from (Lucic et al., 2018). In this regard, GANs are well-known to dramatically outperform existing VAE approaches in terms of the Frechet Inception Distance (FID) score (Heusel ´ et al., 2017) and related quantitative metrics. For fair comparison, (Lucic et al., 2018) adopted a common neutral architecture for all models, with generator and discriminator networks based on InfoGAN (Chen et al., 2016a); the point here is standardized comparisons, not tuning arbitrarily-large networks to achieve the lowest possible absolute FID values. We applied the same architecture to our first-stage VAE decoder and encoder networks respectively for direct comparison. For the lowdimensional second-stage VAE we used small, 3-layer networks contributing negligible additional parameters beyond the first stage (see (Dai & Wipf, 2019) for further design details).
165
+
166
+ We evaluated our proposed VAE pipeline, henceforth denoted as 2-Stage VAE, against three baseline VAE models differing only in the decoder output layer: a Gaussian layer with fixed $\gamma$ , a Gaussian layer with a learned $\gamma$ , and a cross-entropy layer as has been adopted in several previous applications involving images (Chen et al., 2016b). We also tested the Gaussian decoder VAE model (with learned $\gamma$ ) combined with an encoder augmented with normalizing flows (Rezende & Mohamed, 2015), as well as the recently proposed Wasserstein autoencoder (WAE) (Tolstikhin et al., 2018) which maintains a VAE-like structure. All of these models were adapted to use the same neutral architecture from (Lucic et al., 2018). Note also that the WAE includes two variants, referred to as WAE-MMD and WAE-GAN because different Maximum Mean Discrepancy (MMD) and GAN regularization factors are involved. We conduct experiments using the former because it does not involve potentially-unstable adversarial training, consistent with the other VAE baselines.6 Additionally, we present results from (Lucic et al., 2018) involving numerous competing GAN models, including MM GAN (Goodfellow et al., 2014), WGAN (Arjovsky et al., 2017), WGAN-GP (Gulrajani et al., 2017), NS GAN (Fedus et al., 2017), DRAGAN (Kodali et al., 2017), LS GAN (Mao et al., 2017) and BEGAN (Berthelot et al., 2017). Testing is conducted across four significantly different datasets: MNIST (LeCun et al., 1998), Fashion MNIST (Xiao et al., 2017), CIFAR-10 (Krizhevsky & Hinton, 2009) and CelebA (Liu et al., 2015).
167
+
168
+ For each dataset we executed 10 independent trials and report the mean and standard deviation of the FID scores in Table 1.7 No effort was made to tune VAE training hyperparameters (e.g., learning rates, etc.); rather a single generic setting was first agnostically selected and then applied to all VAE-like models (including the WAE-MMD). As an analogous baseline, we also report the value of the best GAN model for each dataset when trained using suggested settings from the authors; no single model was optimal across all datasets, so these values represent the best performance from different, dataset-dependent GANs. Even so, our single 2-Stage VAE is still better on two of four datasets, and in aggregate, better than any individual GAN model. For example, when averaged across datasets, the mean FID score for any individual GAN trained with suggested settings was always approximately 45 or higher (see (Lucic et al., 2018)[Figure 4]), while our analogous 2-Stage VAE maintained a mean below 40. The other VAE baselines were not competitive. Note also that the relatively poor performance of the WAE-MMD on MNIST and Fashion MNIST data can be attributed to the sensitivity of this approach to the value of $\kappa$ , which for consistency with other models was fixed at $\kappa ~ = ~ 6 4$ for all experiments. This value is likely much larger than actually needed for these simpler data types (meaning $r \ll 6 4$ ), and the WAE-MMD model can potentially be more reliant on having some $\kappa \approx r$ . For head-to-head empirical tests of robustness to $\kappa$ , please see (Dai & Wipf, 2019).
169
+
170
+ Table 1 also displays FID scores from GAN models evaluated using hyperparameters obtained from a large-scale search executed independently across each dataset to achieve the best results; 100 settings per model per dataset, plus an optimal, data-dependent stopping criteria as described in (Lucic et al., 2018). Within this broader paradigm, cases of severe mode collapse were omitted when computing final GAN FID averages. Despite these considerable GAN-specific advantages, the FID performance of the default 2-Stage VAE is well within the range of the heavily-optimized GAN models for each dataset unlike the other VAE baselines. Overall then, these results represent the first demonstration of a VAE pipeline capable of competing with GANs in the arena of generated sample quality. Additionally, representative samples produced using our 2-Stage VAE model can be found in (Dai & Wipf, 2019).
171
+
172
+ Beyond the neutral testing platform from (Lucic et al., 2018), we also consider additional comparisons using the architecture and experimental setup from (Tolstikhin et al., 2018) explicitly designed for applying WAE models to CelebA data. In particular, we adopt the exact same encoder-decoder networks as the WAE models, and train using the same number of epochs. We do not tune any hyperparameters whatsoever, and apply the same small second-stage VAE as used in previous experiments. As before, the second-stage size is a small fraction of the first stage, so any benefit is not simply the consequence of a larger network structure. Results are reported in Table 2, where the 2-Stage VAE even outperforms the WAE-GAN model, which has the advantage of adversarial training tuned for this combination of data and network architecture.
173
+
174
+ # 6 EXPERIMENTAL CORROBORATION OF THEORETICAL RESULTS
175
+
176
+ The true test of any theoretical contribution is the degree to which it leads to useful, empiricallytestable predictions about behavior in real-world settings. In the present context, although our theory from Sections 2 and 3 involves some unavoidable simplifying assumptions, it nonetheless makes predictions that can be tested under practically-relevant conditions where these assumptions may
177
+
178
+ <table><tr><td></td><td></td><td>MNIST</td><td>Fashion</td><td>CIFAR-10</td><td>CelebA</td></tr><tr><td rowspan="3">optimized, data-dependent settings</td><td rowspan="3">MM GAN NS GAN LSGAN WGAN WGAN GP</td><td>9.8±0.9</td><td>29.6 ±1.6 26.5 ± 1.6</td><td>72.7 ± 3.6 58.5 ± 1.9</td><td>65.6± 4.2</td></tr><tr><td>6.8 ± 0.5</td><td></td><td></td><td>55.0 ± 3.3</td></tr><tr><td>7.8± 0.6 6.7±0.4</td><td>30.7 ± 2.2 21.5 ± 1.6</td><td>87.1 ± 47.5 55.2 ± 2.3</td><td>53.9 ± 2.8 41.3 ± 2.0</td></tr><tr><td></td><td>DRAGAN BEGAN Best GAN</td><td>20.3 ± 5.0 7.6 ± 0.4 13.1 ± 1.0 ~10</td><td>24.5 ± 2.1 27.7 ±1.2 22.9 ± 0.9</td><td>55.8 ± 0.9 69.8 ± 2.0 71.4 ± 1.6</td><td>30.3 ± 1.0 42.3 ± 3.0 38.9 ± 0.9</td></tr><tr><td>default settings</td><td>VAE (cross-entr.) VAE (fixed γ) VAE (learned ~) VAE + Flow WAE-MMD 2-Stage VAE (ours)</td><td>16.6 ± 0.4 52.0 ± 0.6 54.5 ± 1.0 54.8± 2.8 115.0 ± 1.1 12.6 ± 1.5</td><td>~32 43.6 ± 0.7 84.6 ± 0.9 60.0 ±1.1 62.1 ± 1.6 101.7 ± 0.8 29.3±1.0</td><td>~70 106.0 ± 1.0 160.5 ± 1.1 76.7 ± 0.8 81.2 ± 2.0 80.9 ± 0.4</td><td>~49 53.3 ± 0.6 55.9 ± 0.6 60.5 ± 0.6 65.7 ± 2.8 62.9 ± 0.8</td></tr></table>
179
+
180
+ Table 1: FID score comparisons using neutral architecture. For all GAN-based models listed in the top section of the table, reported values represent the optimal FID obtained across a large-scale hyperparameter search conducted separately for each dataset (Lucic et al., 2018). Outlier cases (e.g., severe mode collapse) were omitted, which would have otherwise increased these GAN FID scores. In the lower section of the table, the label Best GAN indicates the lowest FID produced across all GAN approaches for each dataset when trained using settings suggested by original authors; these approximate values were extracted from (Lucic et al., 2018)[Figure 4]. For the VAE results (including WAE), only a single default setting was adopted across all datasets and models (no tuning whatsoever), and no cases of mode collapse were removed. Note that specialized architectures and/or random seed optimization can potentially improve the FID for all models reported here.
181
+
182
+ Table 2: FID scores on CelebA data obtained using the network structure and training protocol from (Tolstikhin et al., 2018). For the 2-Stage VAE, we apply the exact same architecture and training epochs without any tuning of hyperparameters.
183
+
184
+ <table><tr><td></td><td>VAE</td><td>WAE-MMD</td><td>WAE-GAN</td><td>2-Stage VAE (ours)</td></tr><tr><td>CelebAFID</td><td>63</td><td>55</td><td>42</td><td>34</td></tr></table>
185
+
186
+ not strictly hold. We now present the results of such tests, which provide strong confirmation of our previous analysis. In particular, after providing validation of Theorems 3 and 4, we explicitly demonstrate that the second stage of our 2-Stage VAE model can reduce the gap between $q ( z )$ and $p ( z )$ .
187
+
188
+ Validation of Theorem 3: This theorem implies that $\gamma$ will converge to zero at any global minimum of the stated VAE objective under consideration. Figure 1a presents empirical support for this result, where indeed the decoder variance $\gamma$ does tend towards zero during training (red line). This then allows for tighter image reconstructions (dark blue curve) with lower average squared error, i.e., a better manifold fit as expected.
189
+
190
+ Validation of Theorem 4: Figure 1b bolsters this theorem, and the attendant analysis which follows in Section 3, by showcasing the dissimilar impact of noise factors applied to different directions in the latent space before passage through the decoder mean network $f _ { \mu _ { x } }$ . In a direction where an eigenvalue $\lambda _ { j }$ of $\Sigma _ { z }$ is large (i.e., a superfluous dimension), a random perturbation is completely muted by the decoder as predicted. In contrast, in directions where such eigenvalues are small (i.e., needed for representing the manifold), varying the input causes large changes in the image space reflecting reasonable movement along the correct manifold.
191
+
192
+ Reduced Mismatch between $q _ { \phi } ( z )$ and $p ( z )$ : Although the VAE with a learnable $\gamma$ can achieve high-quality reconstructions, the associated aggregated posterior is still likely not close to a standard Gaussian distribution as implied by (10). This mismatch then disrupts the critical ancestral sampling process. As we have previously argued, the proposed 2-Stage VAE has the ability to overcome this issue and achieve a standard Gaussian aggregated posterior, or at least nearly so. As empirical evidence for this claim, Figure 2 displays the singular value spectrum of latent sample matrices $z =$ $\{ z ^ { ( i ) } \} _ { i = 1 } ^ { n }$ drawn from $q _ { \phi } ( z )$ (first stage), and $\bar { U = } \{ \pmb { u } ^ { ( i ) } \} _ { i = 1 } ^ { n }$ drawn from $q _ { \phi ^ { \prime } } ( { \pmb u } )$ (enhanced second stage). As expected, the latter is much closer to the spectrum from an analogous i.i.d. $\mathcal { N } ( 0 , \pmb { I } )$ matrix. We also used these same sample matrices to estimate the MMD metric (Gretton et al., 2007) between $\mathcal { N } ( 0 , \pmb { I } )$ and the aggregated posterior distributions from the first and second stages in Table 3. Clearly the second stage has dramatically reduced the difference from $\mathcal { N } ( 0 , \pmb { I } )$ as quantified by the MMD. Overall, these results indicate a superior latent representation, providing high-level support for our 2-Stage VAE proposal.
193
+
194
+ ![](images/f6a60319c69b65db228bcad47b601c72982e73c96e49dc29e02463ff11002c50.jpg)
195
+ Figure 1: $( a )$ The red line shows the evolution of $\log \gamma$ , converging close to 0 during training as expected. The two blue curves compare the associated pixel-wise reconstruction errors with $\gamma$ fixed at 1 and with a learnable $\gamma$ respectively. $( b )$ The $j$ -th eigenvalue of $\Sigma _ { z }$ , denoted $\lambda _ { j }$ , should be very close to either 0 or 1 as argued in Section 3. When $\lambda _ { j }$ is close to 0, injecting noise along the corresponding direction will cause a large variance in the reconstructed image, meaning this direction is an informative one needed for representing the manifold. In contrast, if $\lambda _ { j }$ is close to 1, the addition of noise does not make any appreciable difference in the reconstructed image, indicating that the corresponding dimension is a superfluous one that has been ignored/blocked by the decoder.
196
+
197
+ ![](images/7f4b731de3bb38e49071ff6fb80175ad207b47f255f156d62f1007cd52e3dfee.jpg)
198
+ Figure 2: Singular value spectrums of latent sample matrices drawn from $q _ { \phi } ( z )$ (first stage) and $q _ { \phi ^ { \prime } } ( { \pmb u } )$ (enhanced second stage).
199
+
200
+ Table 3: Maximum mean discrepancy between $\mathcal { N } ( 0 , \pmb { I } )$ and $q _ { \phi } ( z )$ (first stage); likewise for $q _ { \phi ^ { \prime } } ( { \pmb u } )$ (second stage).
201
+
202
+ <table><tr><td></td><td>First Stage</td><td>Second Stage</td></tr><tr><td>MNIST</td><td>2.85</td><td>0.43</td></tr><tr><td>Fashion</td><td>1.37</td><td>0.40</td></tr><tr><td>Cifar10</td><td>1.08</td><td>0.00</td></tr><tr><td>CelabA</td><td>7.42</td><td>0.29</td></tr></table>
203
+
204
+ # 7 DISCUSSION
205
+
206
+ It is often assumed that there exists an unavoidable trade-off between the stable training, valuable attendant encoder network, and resistance to mode collapse of VAEs, versus the impressive visual quality of images produced by GANs. While we certainly are not claiming that our two-stage VAE model is superior to the latest and greatest GAN-based architecture in terms of the realism of generated samples, we do strongly believe that this work at least narrows that gap substantially such that VAEs are worth considering in a broader range of applications. For further results and discussion, including consideration of broader VAE modeling paradigms and the identifiability of disentangled representations, please see (Dai & Wipf, 2019).
207
+
208
+ # REFERENCES
209
+
210
+ Martin Arjovsky, Soumith Chintala, and Leon Bottou. Wasserstein generative adversarial networks. ´ In International Conference on Machine Learning, pp. 214–223, 2017.
211
+
212
+ Yoshua Bengio, Aaron Courville, and Pascal Vincent. Representation learning: A review and new perspectives. IEEE Transactions on Pattern Analysis and Machine Intelligence, 35(8):1798–1828, 2013.
213
+
214
+ David Berthelot, Thomas Schumm, and Luke Metz. BEGAN: Boundary equilibrium generative adversarial networks. arXiv:1703.10717, 2017.
215
+
216
+ Olivier Bousquet, Sylvain Gelly, Ilya Tolstikhin, Carl Johann Simon-Gabriel, and Bernhard Scholkopf. From optimal transport to generative modeling: the VEGAN cookbook. ¨ arXiv:1611.02731, 2017.
217
+
218
+ Andrew Brock, Theodore Lim, James M Ritchie, and Nick Weston. Neural photo editing with introspective adversarial networks. arXiv:1609.07093, 2016.
219
+
220
+ Yuri Burda, Roger Grosse, and Ruslan Salakhutdinov. Importance weighted autoencoders. arXiv:1509.00519, 2015.
221
+
222
+ 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, 2016a.
223
+
224
+ Xi Chen, Diederik Kingma, Tim Salimans, Yan Duan, Prafulla Dhariwal, John Schulman, Ilya Sutskever, and Pieter Abbeel. Variational lossy autoencoder. arXiv:1611.02731, 2016b.
225
+
226
+ Bin Dai and David Wipf. Diagnosing and enhancing VAE models. arXiv:1903.05789, 2019.
227
+
228
+ Bin Dai, Yu Wang, John Aston, Gang Hua, and David Wipf. Connections with robust PCA and the role of emergent sparsity in variational autoencoder models. Journal of Machine Learning Research, 19(41):1–42, 2018.
229
+
230
+ Carl Doersch. Tutorial on variational autoencoders. arXiv:1606.05908, 2016.
231
+
232
+ Alexey Dosovitskiy and Thomas Brox. Generating images with perceptual similarity metrics based on deep networks. In Advances in Neural Information Processing Systems, pp. 658–666, 2016.
233
+
234
+ William Fedus, Mihaela Rosca, Balaji Lakshminarayanan, Andrew M Dai, Shakir Mohamed, and Ian Goodfellow. Many paths to equilibrium: GANs do not need to decrease a divergence at every step. arXiv:1710.08446, 2017.
235
+
236
+ 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.
237
+
238
+ Arthur Gretton, Karsten Borgwardt, Malte Rasch, Bernhard Scholkopf, and Alex Smola. A kernel ¨ method for the two-sample-problem. In Advances in Neural Information Processing Systems, pp. 513–520, 2007.
239
+
240
+ Ishaan Gulrajani, Faruk Ahmed, Martin Arjovsky, Vincent Dumoulin, and Aaron Courville. Improved training of Wasserstein GANs. In Advances in Neural Information Processing Systems, pp. 5767–5777, 2017.
241
+
242
+ Martin Heusel, Hubert Ramsauer, Thomas Unterthiner, Bernhard Nessler, and Sepp Hochreiter. GANs trained by a two time-scale update rule converge to a local Nash equilibrium. In Advances in Neural Information Processing Systems, pp. 6626–6637, 2017.
243
+
244
+ Diederik Kingma and Max Welling. Auto-encoding variational Bayes. In International Conference on Learning Representations, 2014.
245
+
246
+ Diederik Kingma, Tim Salimans, Rafal Jozefowicz, Xi Chen, Ilya Sutskever, and Max Welling. Improved variational inference with inverse autoregressive flow. In Advances in Neural Information Processing Systems, pp. 4743–4751, 2016.
247
+
248
+ Naveen Kodali, Jacob Abernethy, James Hays, and Zsolt Kira. On convergence and stability of GANs. arXiv:1705.07215, 2017.
249
+
250
+ Alex Krizhevsky and Geoffrey Hinton. Learning multiple layers of features from tiny images. Technical report, Citeseer, 2009.
251
+
252
+ Anders Boesen Lindbo Larsen, Søren Kaae Sønderby, Hugo Larochelle, and Ole Winther. Autoencoding beyond pixels using a learned similarity metric. arXiv:1512.09300, 2015.
253
+
254
+ 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.
255
+
256
+ Ziwei Liu, Ping Luo, Xiaogang Wang, and Xiaoou Tang. Deep learning face attributes in the wild. In IEEE International Conference on Computer Vision, pp. 3730–3738, 2015.
257
+
258
+ Mario Lucic, Karol Kurach, Marcin Michalski, Sylvain Gelly, and Olivier Bousquet. Are GANs created equal? A large-scale study. Advances in Neural Information Processing Systems, 2018.
259
+
260
+ Alireza Makhzani, Jonathon Shlens, Navdeep Jaitly, Ian Goodfellow, and Brendan Frey. Adversarial autoencoders. arXiv:1511.05644, 2016.
261
+
262
+ Xudong Mao, Qing Li, Haoran Xie, Raymond YK Lau, Zhen Wang, and Stephen Paul Smolley. Least squares generative adversarial networks. In IEEE International Conference on Computer Vision, pp. 2813–2821, 2017.
263
+
264
+ Danilo Jimenez Rezende and Shakir Mohamed. Variational inference with normalizing flows. arXiv:1505.05770, 2015.
265
+
266
+ D.J. Rezende, S. Mohamed, and D. Wierstra. Stochastic backpropagation and approximate inference in deep generative models. In International Conference on Machine Learning, 2014.
267
+
268
+ Ilya Tolstikhin, Olivier Bousquet, Sylvain Gelly, and Bernhard Schoelkopf. Wasserstein autoencoders. International Conference on Learning Representations, 2018.
269
+
270
+ Han Xiao, Kashif Rasul, and Roland Vollgraf. Fashion-MNIST: A novel image dataset for benchmarking machine learning algorithms. arXiv:1708.07747, 2017.
parse/train/B1e0X3C9tQ/B1e0X3C9tQ_content_list.json ADDED
@@ -0,0 +1,1431 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "type": "text",
4
+ "text": "DIAGNOSING AND ENHANCING VAE MODELS ",
5
+ "text_level": 1,
6
+ "bbox": [
7
+ 176,
8
+ 98,
9
+ 728,
10
+ 121
11
+ ],
12
+ "page_idx": 0
13
+ },
14
+ {
15
+ "type": "text",
16
+ "text": "Bin Dai ",
17
+ "text_level": 1,
18
+ "bbox": [
19
+ 184,
20
+ 145,
21
+ 238,
22
+ 159
23
+ ],
24
+ "page_idx": 0
25
+ },
26
+ {
27
+ "type": "text",
28
+ "text": "David Wipf \nMicrosoft Research \nBeijing, China \ndavidwipf@gmail.com \nInstitute for Advanced Study \nTsinghua University \nBeijing, China \ndaib13@mails.tsinghua.edu.cn ",
29
+ "bbox": [
30
+ 550,
31
+ 145,
32
+ 740,
33
+ 202
34
+ ],
35
+ "page_idx": 0
36
+ },
37
+ {
38
+ "type": "text",
39
+ "text": "",
40
+ "bbox": [
41
+ 184,
42
+ 160,
43
+ 459,
44
+ 214
45
+ ],
46
+ "page_idx": 0
47
+ },
48
+ {
49
+ "type": "text",
50
+ "text": "ABSTRACT ",
51
+ "text_level": 1,
52
+ "bbox": [
53
+ 452,
54
+ 233,
55
+ 544,
56
+ 248
57
+ ],
58
+ "page_idx": 0
59
+ },
60
+ {
61
+ "type": "text",
62
+ "text": "Although variational autoencoders (VAEs) represent a widely influential deep generative model, many aspects of the underlying energy function remain poorly understood. In particular, it is commonly believed that Gaussian encoder/decoder assumptions reduce the effectiveness of VAEs in generating realistic samples. In this regard, we rigorously analyze the VAE objective, differentiating situations where this belief is and is not actually true. We then leverage the corresponding insights to develop a simple VAE enhancement that requires no additional hyperparameters or sensitive tuning. Quantitatively, this proposal produces crisp samples and stable FID scores that are actually competitive with a variety of GAN models, all while retaining desirable attributes of the original VAE architecture. The code for our model is available at https://github.com/daib13/TwoStageVAE. ",
63
+ "bbox": [
64
+ 233,
65
+ 257,
66
+ 764,
67
+ 410
68
+ ],
69
+ "page_idx": 0
70
+ },
71
+ {
72
+ "type": "text",
73
+ "text": "1 INTRODUCTION ",
74
+ "text_level": 1,
75
+ "bbox": [
76
+ 176,
77
+ 436,
78
+ 336,
79
+ 452
80
+ ],
81
+ "page_idx": 0
82
+ },
83
+ {
84
+ "type": "text",
85
+ "text": "Our starting point is the desire to learn a probabilistic generative model of observable variables ${ \\pmb x } \\in$ $x$ , where $x$ is a $r$ -dimensional manifold embedded in $\\mathbf { \\mathbb { R } } ^ { d }$ . Note that if $r = d$ , then this assumption places no restriction on the distribution of $\\pmb { x } \\in \\mathbb { R } ^ { d }$ whatsoever; however, the added formalism is introduced to handle the frequently encountered case where $_ { \\textbf { \\em x } }$ possesses low-dimensional structure relative to a high-dimensional ambient space, i.e., $r \\ll d$ . In fact, the very utility of generative models of continuous data, and their attendant low-dimensional representations, often hinges on this assumption (Bengio et al., 2013). It therefore behooves us to explicitly account for this situation. ",
86
+ "bbox": [
87
+ 174,
88
+ 467,
89
+ 825,
90
+ 565
91
+ ],
92
+ "page_idx": 0
93
+ },
94
+ {
95
+ "type": "text",
96
+ "text": "Beyond this, we assume that $x$ is a simple Riemannian manifold, which means there exists a diffeomorphism $\\varphi$ between $x$ and $\\mathbb { R } ^ { r }$ , or more explicitly, the mapping $\\varphi : x \\mapsto \\mathbb { R } ^ { r }$ is invertible and differentiable. Denote a ground-truth probability measure on $x$ as $\\mu _ { g t }$ such that the probability mass of an infinitesimal $d \\mathbf { x }$ on the manifold is $\\mu _ { g t } ( d \\pmb { x } )$ and $\\textstyle \\int _ { \\mathcal { X } } \\mu _ { g t } ( d \\pmb { x } ) \\doteq 1$ . ",
97
+ "bbox": [
98
+ 174,
99
+ 571,
100
+ 825,
101
+ 631
102
+ ],
103
+ "page_idx": 0
104
+ },
105
+ {
106
+ "type": "text",
107
+ "text": "The variational autoencoder (VAE) (Kingma & Welling, 2014; Rezende et al., 2014) attempts to approximate this ground-truth measure using a parameterized density $p _ { \\theta } ( { \\pmb x } )$ defined across all of $\\mathbb { R } ^ { d }$ since any underlying generative manifold is unknown in advance. This density is further assumed to admit the latent decomposition $\\begin{array} { r } { p _ { \\theta } ( \\pmb { x } ) = \\int p _ { \\theta } ( \\pmb { x } | \\pmb { z } ) p ( \\pmb { z } ) d \\pmb { z } } \\end{array}$ , where $z \\in \\mathbb { R } ^ { \\kappa }$ serves as a lowdimensional representation, with $\\kappa \\approx r$ and prior $p ( z ) = \\mathcal { N } ( z | \\mathbf { 0 } , I )$ . ",
108
+ "bbox": [
109
+ 174,
110
+ 637,
111
+ 825,
112
+ 708
113
+ ],
114
+ "page_idx": 0
115
+ },
116
+ {
117
+ "type": "text",
118
+ "text": "Ideally we might like to minimize the negative log-likelihood $- \\log p _ { \\theta } ( { \\pmb x } )$ averaged across the ground-truth measure $\\mu _ { g t }$ , i.e., solve $\\begin{array} { r } { \\operatorname* { m i n } _ { \\theta } \\int _ { \\mathcal { X } } - \\log p _ { \\theta } ( \\pmb { x } ) \\mu _ { g t } ( d \\pmb { x } ) } \\end{array}$ . Unfortunately though, the required marginalization over $_ z$ is generally infeasible. Instead the VAE model relies on tractable encoder $q _ { \\phi } \\bar { ( } z | \\mathbf { x } )$ and decoder $p _ { \\boldsymbol { \\theta } } ( \\boldsymbol { \\mathbf { \\hat { x } } } | \\boldsymbol { \\mathbf { \\tilde { z } } } )$ distributions, where $\\phi$ represents additional trainable parameters. The canonical VAE cost is a bound on the average negative log-likelihood given by ",
119
+ "bbox": [
120
+ 174,
121
+ 714,
122
+ 825,
123
+ 787
124
+ ],
125
+ "page_idx": 0
126
+ },
127
+ {
128
+ "type": "equation",
129
+ "img_path": "images/3a8272a19ee84eb9e3bc47c507b40fb0d5865bc621a2430f2b3a982c17792715.jpg",
130
+ "text": "$$\n\\begin{array} { r } { \\mathcal { L } ( \\theta , \\phi ) \\triangleq \\int _ { \\mathcal { X } } \\left\\{ - \\log p _ { \\theta } ( \\pmb { x } ) \\ + \\ \\mathbb { K L } \\left[ q _ { \\phi } ( z | \\pmb { x } ) | | p _ { \\theta } ( z | \\pmb { x } ) \\right] \\right\\} \\mu _ { g t } ( d \\pmb { x } ) \\geq \\int _ { \\mathcal { X } } - \\log p _ { \\theta } ( \\pmb { x } ) \\mu _ { g t } ( d \\pmb { x } ) , } \\end{array}\n$$",
131
+ "text_format": "latex",
132
+ "bbox": [
133
+ 184,
134
+ 794,
135
+ 792,
136
+ 816
137
+ ],
138
+ "page_idx": 0
139
+ },
140
+ {
141
+ "type": "text",
142
+ "text": "where the inequality follows directly from the non-negativity of the KL-divergence. Here $\\phi$ can be viewed as tuning the tightness of bound, while $\\theta$ dictates the actual estimation of $\\mu _ { g t }$ . Using a few standard manipulations, this bound can also be expressed as ",
143
+ "bbox": [
144
+ 176,
145
+ 820,
146
+ 825,
147
+ 863
148
+ ],
149
+ "page_idx": 0
150
+ },
151
+ {
152
+ "type": "equation",
153
+ "img_path": "images/9de2f0877ca3db349fe7420af8dc01c8a08a33662e72fbd523d1a84266c37e26.jpg",
154
+ "text": "$$\n\\begin{array} { r } { \\mathcal { L } ( \\theta , \\phi ) = \\int _ { \\mathcal { X } } \\left\\{ - \\mathbb { E } _ { q _ { \\phi } ( z | \\mathbf { x } ) } \\left[ \\log p _ { \\theta } \\left( { \\pmb x } | { \\pmb z } \\right) \\right] + \\mathbb { K L } \\left[ q _ { \\phi } ( z | \\mathbf { x } ) | | p ( z ) \\right] \\right\\} \\mu _ { g t } ( d \\pmb { x } ) , } \\end{array}\n$$",
155
+ "text_format": "latex",
156
+ "bbox": [
157
+ 253,
158
+ 868,
159
+ 740,
160
+ 890
161
+ ],
162
+ "page_idx": 0
163
+ },
164
+ {
165
+ "type": "text",
166
+ "text": "which explicitly involves the encoder/decoder distributions and is conveniently amenable to SGD optimization of $\\{ \\theta , \\phi \\}$ via a reparameterization trick (Kingma & Welling, 2014; Rezende et al., ",
167
+ "bbox": [
168
+ 173,
169
+ 895,
170
+ 825,
171
+ 924
172
+ ],
173
+ "page_idx": 0
174
+ },
175
+ {
176
+ "type": "text",
177
+ "text": "2014). The first term in (2) can be viewed as a reconstruction cost (or a stochastic analog of a traditional autoencoder), while the second penalizes posterior deviations from the prior $p ( z )$ . Additionally, for any realizable implementation via SGD, the integration over $x$ must be approximated via a finite sum across training samples $\\{ \\pmb { x } ^ { ( i ) } \\} _ { i = 1 } ^ { n }$ drawn from $\\mu _ { g t }$ . Nonetheless, examining the true objective ${ \\mathcal { L } } ( \\theta , \\phi )$ can lead to important, practically-relevant insights. ",
178
+ "bbox": [
179
+ 174,
180
+ 103,
181
+ 823,
182
+ 175
183
+ ],
184
+ "page_idx": 1
185
+ },
186
+ {
187
+ "type": "text",
188
+ "text": "At least in principle, $q _ { \\phi } ( \\pmb { z } | \\pmb { x } )$ and $p _ { \\theta } ( { \\pmb x } | { \\pmb z } )$ can be arbitrary distributions, in which case we could simply enforce $q _ { \\phi } ( z | \\mathbf { x } ) = p _ { \\theta } ( z | \\mathbf { x } ) \\propto p _ { \\theta } ( \\mathbf { x } | z ) p ( z )$ such that the bound from (1) is tight. Unfortunately though, this is essentially always an intractable undertaking. Consequently, largely to facilitate practical implementation, a commonly adopted distributional assumption for continuous data is that both $q _ { \\phi } ( \\pmb { z } | \\pmb { x } )$ and $p _ { \\theta } ( { \\pmb x } | { \\pmb z } )$ are Gaussian. This design choice has previously been cited as a key limitation of VAEs (Burda et al., 2015; Kingma et al., 2016), and existing quantitative tests of generative modeling quality thus far dramatically favor contemporary alternatives such as generative adversarial networks (GAN) (Goodfellow et al., 2014). Regardless, because the VAE possesses certain desirable properties relative to GAN models (e.g., stable training (Tolstikhin et al., 2018), interpretable encoder/inference network (Brock et al., 2016), outlier-robustness (Dai et al., 2018), etc.), it remains a highly influential paradigm worthy of examination and enhancement. ",
189
+ "bbox": [
190
+ 174,
191
+ 181,
192
+ 825,
193
+ 334
194
+ ],
195
+ "page_idx": 1
196
+ },
197
+ {
198
+ "type": "text",
199
+ "text": "In Section 2 we closely investigate the implications of VAE Gaussian assumptions leading to a number of interesting diagnostic conclusions. In particular, we differentiate the situation where $r = d$ , in which case we prove that recovering the ground-truth distribution is actually possible iff the VAE global optimum is reached, and $r < d$ , in which case the VAE global optimum can be reached by solutions that reflect the ground-truth distribution almost everywhere, but not necessarily uniquely so. In other words, there could exist alternative solutions that both reach the global optimum and yet do not assign the same probability measure as $\\mu _ { g t }$ . ",
200
+ "bbox": [
201
+ 173,
202
+ 342,
203
+ 825,
204
+ 439
205
+ ],
206
+ "page_idx": 1
207
+ },
208
+ {
209
+ "type": "text",
210
+ "text": "Section 3 then further probes this non-uniqueness issue by inspecting necessary conditions of global optima when $r \\ < \\ d$ . This analysis reveals that an optimal VAE parameterization will provide an encoder/decoder pair capable of perfectly reconstructing all ${ \\pmb x } \\in { \\pmb x }$ using any $_ z$ drawn from $q _ { \\phi } ( z | \\pmb { x } )$ . Moreover, we demonstrate that the VAE accomplishes this using a degenerate latent code whereby only $r$ dimensions are effectively active. Collectively, these results indicate that the VAE global optimum can in fact uniquely learn a mapping to the correct ground-truth manifold when $r < d$ , but not necessarily the correct probability measure within this manifold, a critical distinction. ",
211
+ "bbox": [
212
+ 174,
213
+ 445,
214
+ 825,
215
+ 544
216
+ ],
217
+ "page_idx": 1
218
+ },
219
+ {
220
+ "type": "text",
221
+ "text": "Next we leverage these analytical results in Section 4 to motivate an almost trivially-simple, twostage VAE enhancement for addressing typical regimes when $r \\ < \\ d$ . In brief, the first stage just learns the manifold per the allowances from Section 3, and in doing so, provides a mapping to a lower dimensional intermediate representation with no degenerate dimensions that mirrors the $r = d$ regime. The second (much smaller) stage then only needs to learn the correct probability measure on this intermediate representation, which is possible per the analysis from Section 2. Experiments from Sections 5 and 6 empirically corroborate motivational theory and reveal that the proposed two-stage procedure can generate high-quality samples, reducing the blurriness often attributed to VAE models in the past (Dosovitskiy & Brox, 2016; Larsen et al., 2015). And to the best of our knowledge, this is the first demonstration of a VAE pipeline that can produce stable FID scores, an influential recent metric for evaluating generated sample quality (Heusel et al., 2017), that are comparable to GAN models under neutral testing conditions. Moreover, this is accomplished without additional penalties, cost function modifications, or sensitive tuning parameters. Finally, an extended version of this work can be found in (Dai & Wipf, 2019). There we include additional results, consideration of disentangled representations, as well as a comparative discussion of broader VAE modeling paradigms such as those involving normalizing flows or parameterized families for $p ( z )$ . ",
222
+ "bbox": [
223
+ 173,
224
+ 550,
225
+ 825,
226
+ 772
227
+ ],
228
+ "page_idx": 1
229
+ },
230
+ {
231
+ "type": "text",
232
+ "text": "2 HIGH-LEVEL IMPACT OF VAE GAUSSIAN ASSUMPTIONS ",
233
+ "text_level": 1,
234
+ "bbox": [
235
+ 176,
236
+ 791,
237
+ 678,
238
+ 808
239
+ ],
240
+ "page_idx": 1
241
+ },
242
+ {
243
+ "type": "text",
244
+ "text": "Conventional wisdom suggests that VAE Gaussian assumptions will introduce a gap between ${ \\mathcal { L } } ( \\theta , \\phi )$ and the ideal negative log-likelihood $\\begin{array} { r } { \\int _ { \\mathcal { X } } - \\log p _ { \\theta } ( \\pmb { x } ) \\bar { \\mu } _ { g t } ( d \\pmb { x } ) } \\end{array}$ , compromising efforts to learn the ground-truth measure. However, we will now argue that this pessimism is in some sense premature. In fact, we will demonstrate that, even with the stated Gaussian distributions, there exist parameters $\\phi$ and $\\theta$ that can simultaneously: $( i )$ Globally optimize the VAE objective and, $( i i )$ Recover the ground-truth probability measure in a certain sense described below. This is possible because, at least for some coordinated values of $\\phi$ and $\\theta$ , $q _ { \\phi } ( \\pmb { z } | \\pmb { x } )$ and $p _ { \\theta } ( \\pmb { z } | \\pmb { x } )$ can indeed become arbitrarily close. Before presenting the details, we first formalize a $\\kappa$ -simple VAE, which is merely a VAE model with explicit Gaussian assumptions and parameterizations: ",
245
+ "bbox": [
246
+ 174,
247
+ 823,
248
+ 823,
249
+ 924
250
+ ],
251
+ "page_idx": 1
252
+ },
253
+ {
254
+ "type": "text",
255
+ "text": "",
256
+ "bbox": [
257
+ 171,
258
+ 103,
259
+ 823,
260
+ 132
261
+ ],
262
+ "page_idx": 2
263
+ },
264
+ {
265
+ "type": "text",
266
+ "text": "Definition 1 A $\\kappa$ -simple VAE is defined as a VAE model with $d i m [ z ] = \\kappa$ latent dimensions, the Gaussian encoder $q _ { \\phi } \\bar { ( } z | \\mathbf { x } ) = \\mathcal { N } ( z | \\mu _ { z } , \\Sigma _ { z } )$ , and the Gaussian decoder $p _ { \\theta } ( { \\pmb x } | z ) = \\mathcal { N } ( { \\pmb x } | { \\pmb \\mu } _ { x } , { \\pmb \\Sigma } _ { x } )$ . Moreover, the encoder moments are defined as $\\mu _ { z } = f _ { \\mu _ { z } } ( { \\pmb x } ; \\phi )$ and $\\pmb { \\Sigma } _ { z } = \\pmb { S } _ { z } \\pmb { S } _ { z } ^ { \\top }$ with $S _ { z } ~ =$ $f _ { S _ { z } } ( { \\pmb x } ; \\phi )$ . Likewise, the decoder moments are $\\begin{array} { r } { \\pmb { \\mu } _ { x } = f _ { \\mu _ { x } } ( z ; \\theta ) } \\end{array}$ and $\\Sigma _ { x } = \\gamma I$ . Here $\\gamma > 0$ is $a$ tunable scalar, while $f _ { \\mu _ { z } }$ , $f _ { S _ { z } }$ and $f _ { \\mu _ { x } }$ specify parameterized differentiable functional forms that can be arbitrarily complex, e.g., a deep neural network. ",
267
+ "bbox": [
268
+ 173,
269
+ 142,
270
+ 825,
271
+ 231
272
+ ],
273
+ "page_idx": 2
274
+ },
275
+ {
276
+ "type": "text",
277
+ "text": "Equipped with these definitions, we will now demonstrate that a $\\kappa$ -simple VAE, with $\\kappa \\geq r$ , can achieve the optimality criteria $( i )$ and $( i i )$ from above. In doing so, we first consider the simpler case where $r = d$ , followed by the extended scenario with $r \\textless d$ . The distinction between these two cases turns out to be significant, with practical implications to be explored in Section 4. ",
278
+ "bbox": [
279
+ 173,
280
+ 241,
281
+ 825,
282
+ 297
283
+ ],
284
+ "page_idx": 2
285
+ },
286
+ {
287
+ "type": "text",
288
+ "text": "2.1 MANIFOLD DIMENSION EQUAL TO AMBIENT SPACE DIMENSION $( r = d$ ",
289
+ "text_level": 1,
290
+ "bbox": [
291
+ 176,
292
+ 314,
293
+ 717,
294
+ 329
295
+ ],
296
+ "page_idx": 2
297
+ },
298
+ {
299
+ "type": "text",
300
+ "text": "We first analyze the specialized situation where $r \\ = \\ d$ . Assuming $p _ { g t } ( { \\pmb x } ) \\triangleq \\mu _ { g t } ( d { \\pmb x } ) / d { \\pmb x }$ exists everywhere in $\\mathbb { R } ^ { d }$ , then $p _ { g t } ( \\pmb { x } )$ represents the ground-truth probability density with respect to the standard Lebesgue measure in Euclidean space. Given these considerations, the minimal possible value of (1) will necessarily occur if ",
301
+ "bbox": [
302
+ 173,
303
+ 339,
304
+ 825,
305
+ 398
306
+ ],
307
+ "page_idx": 2
308
+ },
309
+ {
310
+ "type": "equation",
311
+ "img_path": "images/5a1787114996dc44c1170f61d4b66532ed89f3e3f348cee6b141772632664448.jpg",
312
+ "text": "$$\n\\mathbb { K L } \\left[ q _ { \\phi } ( \\boldsymbol { z } | \\boldsymbol { x } ) | | p _ { \\theta } ( \\boldsymbol { z } | \\boldsymbol { x } ) \\right] = 0 \\quad \\mathrm { a n d } \\quad p _ { \\theta } ( \\boldsymbol { x } ) = p _ { g t } ( \\boldsymbol { x } ) \\mathrm { a }\n$$",
313
+ "text_format": "latex",
314
+ "bbox": [
315
+ 259,
316
+ 404,
317
+ 614,
318
+ 422
319
+ ],
320
+ "page_idx": 2
321
+ },
322
+ {
323
+ "type": "text",
324
+ "text": "This follows because by VAE design it must be that $\\begin{array} { r } { \\mathcal { L } ( \\theta , \\phi ) \\geq - \\int p _ { g t } ( \\pmb { x } ) \\log p _ { g t } ( \\pmb { x } ) d \\pmb { x } , } \\end{array}$ , and in the present context, this lower bound is achievable iff the conditions from (3) hold. Collectively, this implies that the approximate posterior produced by the encoder $q _ { \\phi } ( \\pmb { z } | \\pmb { x } )$ is in fact perfectly matched to the actual posterior $p _ { \\theta } ( z | \\mathbf { \\bar { x } } )$ , while the corresponding marginalized data distribution $p _ { \\theta } ( { \\pmb x } )$ is perfectly matched the ground-truth density $p _ { g t } ( \\pmb { x } )$ as desired. Perhaps surprisingly, a $\\kappa$ -simple VAE can actually achieve such a solution: ",
325
+ "bbox": [
326
+ 174,
327
+ 426,
328
+ 825,
329
+ 512
330
+ ],
331
+ "page_idx": 2
332
+ },
333
+ {
334
+ "type": "text",
335
+ "text": "Theorem 1 Suppose that $r = d$ and there exists a density $p _ { g t } ( \\pmb { x } )$ associated with the ground-truth measure $\\mu _ { g t }$ that is nonzero everywhere on $\\mathbb { R } ^ { d } . ^ { 1 }$ . Then for any $\\kappa \\geq r$ , there is a sequence of $\\dot { } _ { \\kappa }$ -simple VAE model parameters $\\{ \\theta _ { t } ^ { * } , \\phi _ { t } ^ { * } \\}$ such that ",
336
+ "bbox": [
337
+ 173,
338
+ 523,
339
+ 825,
340
+ 569
341
+ ],
342
+ "page_idx": 2
343
+ },
344
+ {
345
+ "type": "equation",
346
+ "img_path": "images/8719693f3ceb17ab287a063b54231e56db59a367e579c3c4212c12fac99878b4.jpg",
347
+ "text": "$$\n\\operatorname* { l i m } _ { t \\to \\infty } \\mathbb { K } \\mathbb { L } \\left[ q _ { \\phi _ { t } ^ { * } } ( z | x ) | | p _ { \\theta _ { t } ^ { * } } ( z | x ) \\right] = 0 \\quad a n d \\quad \\operatorname* { l i m } _ { t \\to \\infty } p _ { \\theta _ { t } ^ { * } } ( x ) = p _ { g t } ( x ) \\ : a\n$$",
348
+ "text_format": "latex",
349
+ "bbox": [
350
+ 212,
351
+ 574,
352
+ 661,
353
+ 598
354
+ ],
355
+ "page_idx": 2
356
+ },
357
+ {
358
+ "type": "text",
359
+ "text": "All the proofs can be found in (Dai & Wipf, 2019). So at least when $r = d$ , the VAE Gaussian assumptions need not actually prevent the optimal ground-truth probability measure from being recovered, as long as the latent dimension is sufficiently large (i.e., $\\kappa \\geq r$ ). And contrary to popular notions, a richer class of distributions is not required to achieve this. Of course Theorem 1 only applies to a restricted case that excludes $d > r$ ; however, later we will demonstrate that a key consequence of this result can nonetheless be leveraged to dramatically enhance VAE performance. ",
360
+ "bbox": [
361
+ 173,
362
+ 609,
363
+ 825,
364
+ 695
365
+ ],
366
+ "page_idx": 2
367
+ },
368
+ {
369
+ "type": "text",
370
+ "text": "2.2 MANIFOLD DIMENSION LESS THAN AMBIENT SPACE DIMENSION $( r < d )$ ",
371
+ "text_level": 1,
372
+ "bbox": [
373
+ 176,
374
+ 710,
375
+ 727,
376
+ 727
377
+ ],
378
+ "page_idx": 2
379
+ },
380
+ {
381
+ "type": "text",
382
+ "text": "When $r < d$ , additional subtleties are introduced that will be unpacked both here and in the sequel. To begin, if both $q _ { \\phi } ( \\pmb { z } | \\pmb { x } )$ and $p _ { \\theta } ( { \\pmb x } | { \\pmb z } )$ are arbitrary/unconstrained (i.e., not necessarily Gaussian), then $\\begin{array} { r } { \\operatorname* { i n f } _ { \\phi , \\theta } \\mathcal { L } ( \\theta , \\phi ) = - \\infty } \\end{array}$ . To achieve this global optimum, we need only choose $\\phi$ such that $q _ { \\phi } ( z | \\pmb { x } ) = p _ { \\theta } ( z | \\pmb { x } )$ (minimizing the KL term from (1)) while selecting $\\theta$ such that all probability mass collapses to the correct manifold $x$ . In this scenario the density $p _ { \\theta } ( { \\pmb x } )$ will become unbounded on $x$ and zero elsewhere, such that $\\begin{array} { r } { \\int _ { \\mathcal { X } } - \\log p _ { \\theta } ( \\pmb { x } ) \\mu _ { g t } ( d \\pmb { x } ) } \\end{array}$ will approach negative infinity. ",
383
+ "bbox": [
384
+ 173,
385
+ 737,
386
+ 825,
387
+ 824
388
+ ],
389
+ "page_idx": 2
390
+ },
391
+ {
392
+ "type": "text",
393
+ "text": "But of course the stated Gaussian assumptions from the $\\kappa$ -simple VAE model could ostensibly prevent this from occurring by causing the KL term to blow up, counteracting the negative loglikelihood factor. We will now analyze this case to demonstrate that this need not happen. Before proceeding to this result, we first define a manifold density $\\tilde { p } _ { g t } ( \\pmb { x } )$ as the probability density (assuming it exists) of $\\mu _ { g t }$ with respect to the volume measure of the manifold $x$ . If $d = r$ then this volume measure reduces to the standard Lebesgue measure in $\\mathbb { R } ^ { d }$ and $\\tilde { p } _ { g t } ( { \\pmb x } ) = p _ { g t } ( { \\pmb x } )$ ; however, when $d > r$ a density $p _ { g t } ( \\pmb { x } )$ defined in $\\mathbb { R } ^ { d }$ will not technically exist, while $\\tilde { p } _ { g t } ( \\pmb { x } )$ is still perfectly well-defined. We then have the following: ",
394
+ "bbox": [
395
+ 174,
396
+ 830,
397
+ 823,
398
+ 873
399
+ ],
400
+ "page_idx": 2
401
+ },
402
+ {
403
+ "type": "text",
404
+ "text": "",
405
+ "bbox": [
406
+ 174,
407
+ 103,
408
+ 825,
409
+ 178
410
+ ],
411
+ "page_idx": 3
412
+ },
413
+ {
414
+ "type": "text",
415
+ "text": "Theorem 2 Assume $r \\ < \\ d$ and that there exists a manifold density $\\tilde { p } _ { g t } ( \\pmb { x } )$ associated with the ground-truth measure $\\mu _ { g t }$ that is nonzero everywhere on $x$ . Then for any $\\kappa \\geq r$ , there is a sequence of $\\kappa$ -simple VAE model parameters $\\{ \\theta _ { t } ^ { * } , \\phi _ { t } ^ { * } \\}$ such that ",
416
+ "bbox": [
417
+ 174,
418
+ 194,
419
+ 825,
420
+ 238
421
+ ],
422
+ "page_idx": 3
423
+ },
424
+ {
425
+ "type": "equation",
426
+ "img_path": "images/0971873f057fd82fee7ab40034e459490e86c633636519ff779f3570317d35ac.jpg",
427
+ "text": "$$\n( i ) \\operatorname* { l i m } _ { t \\infty } \\mathbb { K L } [ q _ { \\phi _ { t } ^ { \\star } } ( z | x ) | | p _ { \\theta _ { t } ^ { \\star } } ( z | x ) ] = 0 \\quad a n d \\quad \\operatorname* { l i m } _ { t \\infty } \\int _ { \\mathcal { X } } - \\log p _ { \\theta _ { t } ^ { \\star } } ( x ) \\mu _ { g t } ( d x ) = - \\infty ,\n$$",
428
+ "text_format": "latex",
429
+ "bbox": [
430
+ 202,
431
+ 255,
432
+ 779,
433
+ 280
434
+ ],
435
+ "page_idx": 3
436
+ },
437
+ {
438
+ "type": "equation",
439
+ "img_path": "images/1615f3304bc6a91077c7effc2b9c72bcd3af6fd5de5f7393fd55db438b65c872.jpg",
440
+ "text": "$$\n\\begin{array} { r } { \\underset { t \\infty } { \\operatorname* { l i m } } \\int _ { \\pmb { x } \\in A } p _ { \\theta _ { t } ^ { * } } ( \\pmb { x } ) d \\pmb { x } = \\mu _ { g t } ( A \\cap \\pmb { x } ) } \\end{array}\n$$",
441
+ "text_format": "latex",
442
+ "bbox": [
443
+ 232,
444
+ 292,
445
+ 472,
446
+ 315
447
+ ],
448
+ "page_idx": 3
449
+ },
450
+ {
451
+ "type": "text",
452
+ "text": "Technical details notwithstanding, Theorem 2 admits a very intuitive interpretation. First, (5) directly implies that the VAE Gaussian assumptions do not prevent minimization of ${ \\mathcal { L } } ( \\theta , \\phi )$ from converging to minus infinity, which can be trivially viewed as a globally optimum solution. Furthermore, based on (6), this solution can be achieved with a limiting density estimate that will assign a probability mass to most all measurable subsets of $\\mathbb { R } ^ { d }$ that is indistinguishable from the groundtruth measure (which confines all mass to $x$ ). Hence this solution is more-or-less an arbitrarily-good approximation to $\\mu _ { g t }$ for all practical purposes.2 ",
453
+ "bbox": [
454
+ 173,
455
+ 347,
456
+ 825,
457
+ 445
458
+ ],
459
+ "page_idx": 3
460
+ },
461
+ {
462
+ "type": "text",
463
+ "text": "Regardless, there is an absolutely crucial distinction between Theorem 2 and the simpler case quantified by Theorem 1. Although both describe conditions whereby the $\\kappa$ -simple VAE can achieve the minimal possible objective, in the $r = d$ case achieving the lower bound (whether the specific parameterization for doing so is unique or not) necessitates that the ground-truth probability measure has been recovered almost everywhere. But the $r < d$ situation is quite different because we have not ruled out the possibility that a different set of parameters $\\{ \\theta , \\phi \\}$ could push ${ \\mathcal { L } } ( \\theta , \\phi )$ to $- \\infty$ and yet not achieve (6). In other words, the VAE could reach the lower bound but fail to closely approximate $\\mu _ { g t }$ . And we stress that this uniqueness issue is not a consequence of the VAE Gaussian assumptions per se; even if $q _ { \\phi } ( \\pmb { z } | \\pmb { x } )$ were unconstrained the same lack of uniqueness can persist. ",
464
+ "bbox": [
465
+ 174,
466
+ 452,
467
+ 825,
468
+ 577
469
+ ],
470
+ "page_idx": 3
471
+ },
472
+ {
473
+ "type": "text",
474
+ "text": "Rather, the intrinsic difficulty is that, because the VAE model does not have access to the groundtruth low-dimensional manifold, it must implicitly rely on a density $p _ { \\theta } ( { \\pmb x } )$ defined across all of $\\mathbb { R } ^ { d }$ as mentioned previously. Moreover, if this density converges towards infinity on the manifold during training without increasing the KL term at the same rate, the VAE cost can be unbounded from below, even in cases where (6) is not satisfied, meaning incorrect assignment of probability mass. ",
475
+ "bbox": [
476
+ 174,
477
+ 583,
478
+ 825,
479
+ 654
480
+ ],
481
+ "page_idx": 3
482
+ },
483
+ {
484
+ "type": "text",
485
+ "text": "To conclude, the key take-home message from this section is that, at least in principle, VAE Gaussian assumptions need not actually be the root cause of any failure to recover ground-truth distributions. Instead we expose a structural deficiency that lies elsewhere, namely, the non-uniqueness of solutions that can optimize the VAE objective without necessarily learning a close approximation to $\\mu _ { g t }$ . But to probe this issue further and motivate possible workarounds, it is critical to further disambiguate these optimal solutions and their relationship with ground-truth manifolds. This will be the task of Section 3, where we will explicitly differentiate the problem of locating the correct groundtruth manifold, from the task of learning the correct probability measure within the manifold. ",
486
+ "bbox": [
487
+ 174,
488
+ 660,
489
+ 825,
490
+ 772
491
+ ],
492
+ "page_idx": 3
493
+ },
494
+ {
495
+ "type": "text",
496
+ "text": "Note that the only comparable prior work we are aware of related to the results in this section comes from Doersch (2016), where the implications of adopting Gaussian encoder/decoder pairs in the specialized case of $r = d = 1$ are briefly considered. Moreover, the analysis there requires additional much stronger assumptions than ours, namely, that $p _ { g t } ( \\pmb { x } )$ should be nonzero and infinitely differentiable everywhere in the requisite 1D ambient space. These requirements of course exclude essentially all practical usage regimes where $d = r > 1$ or $d > r$ , or when ground-truth densities are not sufficiently smooth. ",
497
+ "bbox": [
498
+ 174,
499
+ 779,
500
+ 825,
501
+ 876
502
+ ],
503
+ "page_idx": 3
504
+ },
505
+ {
506
+ "type": "text",
507
+ "text": "3 OPTIMAL SOLUTIONS AND THE GROUND TRUTH MANIFOLD ",
508
+ "text_level": 1,
509
+ "bbox": [
510
+ 173,
511
+ 102,
512
+ 709,
513
+ 118
514
+ ],
515
+ "page_idx": 4
516
+ },
517
+ {
518
+ "type": "text",
519
+ "text": "We will now more closely examine the properties of optimal $\\kappa$ -simple VAE solutions, and in particular, the degree to which we might expect them to at least reflect the true $x$ , even if perhaps not the correct probability measure $\\mu _ { g t }$ defined within $x$ . To do so, we must first consider some necessary conditions for VAE optima: ",
520
+ "bbox": [
521
+ 174,
522
+ 132,
523
+ 823,
524
+ 189
525
+ ],
526
+ "page_idx": 4
527
+ },
528
+ {
529
+ "type": "text",
530
+ "text": "Theorem 3 Let $\\{ \\theta _ { \\gamma } ^ { * } , \\phi _ { \\gamma } ^ { * } \\}$ denote an optimal $\\kappa$ -simple VAE solution (with $\\kappa \\geq r$ ) where the decoder variance $\\gamma$ is fixed (i.e., it is the sole unoptimized parameter). Moreover, we assume that $\\mu _ { g t }$ is not a Gaussian distribution when $d = r$ .3 Then for any $\\gamma > 0$ , there exists a $\\gamma ^ { \\prime } < \\gamma$ such that $\\mathcal { L } ( \\theta _ { \\gamma ^ { \\prime } } ^ { * } , \\phi _ { \\gamma ^ { \\prime } } ^ { * } ) < \\mathcal { L } ( \\theta _ { \\gamma } ^ { * } , \\phi _ { \\gamma } ^ { * } )$ . ",
531
+ "bbox": [
532
+ 173,
533
+ 200,
534
+ 825,
535
+ 261
536
+ ],
537
+ "page_idx": 4
538
+ },
539
+ {
540
+ "type": "text",
541
+ "text": "This result implies that we can always reduce the VAE cost by choosing a smaller value of $\\gamma$ , and hence, if $\\gamma$ is not constrained, it must be that $\\gamma 0$ if we wish to minimize (2). Despite this necessary optimality condition, in existing practical VAE applications, it is standard to fix $\\gamma \\approx 1$ during training. This is equivalent to simply adopting a non-adaptive squared-error loss for the decoder and, at least in part, likely contributes to unrealistic/blurry VAE-generated samples (Bousquet et al., 2017). Regardless, there are more significant consequences of this intrinsic favoritism for $\\gamma 0$ , in particular as related to reconstructing data drawn from the ground-truth manifold $x$ : ",
542
+ "bbox": [
543
+ 173,
544
+ 270,
545
+ 825,
546
+ 369
547
+ ],
548
+ "page_idx": 4
549
+ },
550
+ {
551
+ "type": "text",
552
+ "text": "Theorem 4 Applying the same conditions and definitions as in Theorem $^ 3$ , then for all $_ { \\textbf { \\em x } }$ drawn from $\\mu _ { g t }$ , we also have that ",
553
+ "bbox": [
554
+ 171,
555
+ 380,
556
+ 823,
557
+ 409
558
+ ],
559
+ "page_idx": 4
560
+ },
561
+ {
562
+ "type": "equation",
563
+ "img_path": "images/5649cc7a5c9a0d2716f66dab5850650e6548a1878f6bc66d69a9887cbb2881f3.jpg",
564
+ "text": "$$\n\\operatorname* { l i m } _ { \\gamma \\to 0 } f _ { \\mu _ { x } } \\left[ f _ { \\mu _ { z } } ( \\mathbf { x } ; \\boldsymbol { \\phi } _ { \\gamma } ^ { * } ) + f _ { S _ { z } } ( \\mathbf { x } ; \\boldsymbol { \\phi } _ { \\gamma } ^ { * } ) \\boldsymbol { \\varepsilon } ; \\boldsymbol { \\theta } _ { \\gamma } ^ { * } \\right] = \\operatorname* { l i m } _ { \\gamma \\to 0 } f _ { \\mu _ { x } } \\left[ f _ { \\mu _ { z } } ( \\mathbf { x } ; \\boldsymbol { \\phi } _ { \\gamma } ^ { * } ) ; \\boldsymbol { \\theta } _ { \\gamma } ^ { * } \\right] = \\mathbf { x } , \\quad \\forall \\boldsymbol { \\varepsilon } \\in \\mathbb { R } ^ { \\kappa } .\n$$",
565
+ "text_format": "latex",
566
+ "bbox": [
567
+ 197,
568
+ 412,
569
+ 782,
570
+ 439
571
+ ],
572
+ "page_idx": 4
573
+ },
574
+ {
575
+ "type": "text",
576
+ "text": "By design any random draw $z \\sim q _ { \\phi _ { \\gamma } ^ { * } } \\left( z | \\boldsymbol { x } \\right)$ can be expressed as $f _ { \\mu _ { z } } ( { \\pmb x } ; \\phi _ { \\gamma } ^ { * } ) + f _ { S _ { z } } ( { \\pmb x } ; \\phi _ { \\gamma } ^ { * } ) \\varepsilon$ for some $\\varepsilon \\sim \\mathcal { N } ( \\varepsilon | \\mathbf { 0 } , I )$ . From this vantage point then, (7) effectively indicates that any ${ \\textbf { \\em x } } \\in { \\boldsymbol { x } }$ will be perfectly reconstructed by the VAE encoder/decoder pair at globally optimal solutions, achieving this necessary condition despite any possible stochastic corrupting factor $f _ { S _ { z } } ( \\pmb { x } ; \\phi _ { \\gamma } ^ { * } ) \\varepsilon$ . ",
577
+ "bbox": [
578
+ 173,
579
+ 450,
580
+ 825,
581
+ 511
582
+ ],
583
+ "page_idx": 4
584
+ },
585
+ {
586
+ "type": "text",
587
+ "text": "But still further insights can be obtained when we more closely inspect the VAE objective function behavior at arbitrarily small but explicitly nonzero values of $\\gamma$ . In particular, when $\\kappa ~ = ~ r$ (meaning $_ z$ has no superfluous capacity), Theorem 4 and attendant analyses in (Dai & Wipf, 2019) ultimately imply that the squared eigenvalues of $f _ { S _ { z } } ( \\pmb { x } ; \\phi _ { \\gamma } ^ { * } )$ will become arbitrarily small at a rate proportional to $\\gamma$ , meaning $\\begin{array} { r } { \\frac { 1 } { \\sqrt { \\gamma } } f _ { S _ { z } } ( \\pmb { x } ; \\phi _ { \\gamma } ^ { * } ) \\approx \\cal { O } ( 1 ) } \\end{array}$ under mild conditions. It then follows that the VAE data term integrand from (2), in the neighborhood around optimal solutions, behaves as $- 2 \\mathbb { E } _ { q _ { \\phi _ { \\gamma } ^ { * } } ( z | x ) } \\left[ \\log p _ { \\theta _ { \\gamma } ^ { * } } \\left( \\mathbf { { \\bar { x } } } | z \\right) \\right] ~ =$ ",
588
+ "bbox": [
589
+ 173,
590
+ 517,
591
+ 825,
592
+ 631
593
+ ],
594
+ "page_idx": 4
595
+ },
596
+ {
597
+ "type": "equation",
598
+ "img_path": "images/bd412bd26b22513136407ceec64c72fbb948113da9e2fff6d5fdda8ce7169dad.jpg",
599
+ "text": "$$\n\\begin{array} { r } { \\mathbb { E } _ { q _ { \\phi _ { \\gamma } ^ { * } } ( z | x ) } \\left[ \\frac { 1 } { \\gamma } \\left\\| x - f _ { \\mu _ { x } } \\left[ z ; \\theta _ { \\gamma } ^ { * } \\right] \\right\\| _ { 2 } ^ { 2 } \\right] + d \\log 2 \\pi \\gamma \\approx \\mathbb { E } _ { q _ { \\phi _ { \\gamma } ^ { * } } ( z | x ) } \\left[ O ( 1 ) \\right] + d \\log 2 \\pi \\gamma = d \\log \\gamma + O ( 1 ) . } \\end{array}\n$$",
600
+ "text_format": "latex",
601
+ "bbox": [
602
+ 181,
603
+ 647,
604
+ 825,
605
+ 675
606
+ ],
607
+ "page_idx": 4
608
+ },
609
+ {
610
+ "type": "text",
611
+ "text": "This expression can be derived by excluding the higher-order terms of a Taylor series approximation of $\\dot { f } _ { \\mu _ { x } } \\left[ f _ { \\mu _ { z } } ( { \\pmb x } ; \\phi _ { \\gamma } ^ { * } ) + f _ { S _ { z } } ( \\bar { \\pmb x } ; \\phi _ { \\gamma } ^ { * } ) \\varepsilon ; \\theta _ { \\gamma } ^ { * } \\right]$ around the point $f _ { \\mu _ { z } } ( \\pmb { x } ; \\phi _ { \\gamma } ^ { * } )$ , which will be relatively tight under the stated conditions. But because $\\begin{array} { r } { 2 \\mathbb { E } _ { q _ { \\phi _ { \\gamma } ^ { * } } ( z | x ) } \\left[ \\frac { 1 } { \\gamma } \\left\\| x - f _ { \\mu _ { x } } \\left[ z ; \\theta _ { \\gamma } ^ { * } \\right] \\right\\| _ { 2 } ^ { 2 } \\right] \\geq 0 . } \\end{array}$ , a theoretical lower bound on (8) is given by $d \\log 2 \\pi \\gamma \\equiv d \\log \\gamma + O ( 1 )$ . So in this sense (8) cannot be significantly lowered further. ",
612
+ "bbox": [
613
+ 173,
614
+ 685,
615
+ 825,
616
+ 768
617
+ ],
618
+ "page_idx": 4
619
+ },
620
+ {
621
+ "type": "text",
622
+ "text": "This observation is significant when we consider the inclusion of addition latent dimensions by allowing $\\kappa > r$ . Clearly based on the analysis above, adding dimensions to $_ z$ cannot improve the value of the VAE data term in any meaningful way. However, it can have a detrimental impact on the the KL regularization factor in the $\\gamma 0$ regime, where ",
623
+ "bbox": [
624
+ 173,
625
+ 775,
626
+ 825,
627
+ 832
628
+ ],
629
+ "page_idx": 4
630
+ },
631
+ {
632
+ "type": "equation",
633
+ "img_path": "images/791f330fc6907b1714961a9e4f3c295e6fb8f2efcd0150b25fcdcdb4055554e3.jpg",
634
+ "text": "$$\n2 \\mathbb { K L } \\left[ q _ { \\phi } ( z | \\boldsymbol { x } ) | | p ( z ) \\right] \\equiv \\operatorname { t r a c e } \\left[ \\boldsymbol { \\Sigma } _ { z } \\right] + \\| \\boldsymbol { \\mu } _ { z } \\| _ { 2 } ^ { 2 } - \\log \\left| \\boldsymbol { \\Sigma } _ { z } \\right| \\approx - \\hat { r } \\log \\gamma + O ( 1 ) .\n$$",
635
+ "text_format": "latex",
636
+ "bbox": [
637
+ 248,
638
+ 834,
639
+ 748,
640
+ 853
641
+ ],
642
+ "page_idx": 4
643
+ },
644
+ {
645
+ "type": "text",
646
+ "text": "Here $\\hat { r }$ denotes the number of eigenvalues $\\{ \\lambda _ { j } ( \\gamma ) \\} _ { j = 1 } ^ { \\kappa }$ of $f _ { S _ { z } } ( \\pmb { x } ; \\boldsymbol { \\phi } _ { \\gamma } ^ { * } )$ (or equivalently $\\Sigma _ { z }$ ) that satisfy $\\lambda _ { j } ( \\gamma ) \\to 0$ if $\\gamma 0$ . $\\hat { r }$ can be viewed as an estimate of how many low-noise latent dimensions the VAE model is preserving to reconstruct $_ { \\textbf { \\em x } }$ . Based on (9), there is obvious pressure to make $\\hat { r }$ as small as possible, at least without disrupting the data fit. The smallest possible value is $\\hat { r } = r$ , since it is not difficult to show that any value below this will contribute consequential reconstruction errors, causing $2 \\mathbb { E } _ { q _ { \\phi _ { \\gamma } ^ { * } } ( z | x ) } \\left[ \\frac { 1 } { \\gamma } \\left\\| x - f _ { \\mu _ { x } } \\left[ z ; \\theta _ { \\gamma } ^ { * } \\right] \\right\\| _ { 2 } ^ { 2 } \\right]$ to grow at a rate of $\\Omega \\left( \\begin{array} { l } { \\overline { { 1 } } } \\\\ { \\overline { { \\gamma } } } \\end{array} \\right)$ , pushing the entire cost function towards infinity.4 ",
647
+ "bbox": [
648
+ 174,
649
+ 857,
650
+ 825,
651
+ 888
652
+ ],
653
+ "page_idx": 4
654
+ },
655
+ {
656
+ "type": "text",
657
+ "text": "",
658
+ "bbox": [
659
+ 174,
660
+ 103,
661
+ 825,
662
+ 185
663
+ ],
664
+ "page_idx": 5
665
+ },
666
+ {
667
+ "type": "text",
668
+ "text": "Therefore, in the neighborhood of optimal solutions the VAE will naturally seek to produce perfect reconstructions using the fewest number of clean, low-noise latent dimensions, meaning dimensions whereby $q _ { \\phi } \\left( z | \\pmb { x } \\right)$ has negligible variance. For superfluous dimensions that are unnecessary for representing $_ { \\textbf { \\em x } }$ , the associated encoder variance in these directions can be pushed to one. This will optimize ${ \\mathbb K } { \\mathbb L } \\left[ q _ { \\phi } ( { \\pmb z } | { \\pmb x } ) | | p ( { \\pmb z } ) \\right]$ along these directions, and the decoder can selectively block the residual randomness to avoid influencing the reconstructions per Theorem 4. So in this sense the VAE is capable of learning a minimal representation of the ground-truth manifold $x$ when $r < \\kappa$ . ",
669
+ "bbox": [
670
+ 174,
671
+ 190,
672
+ 825,
673
+ 289
674
+ ],
675
+ "page_idx": 5
676
+ },
677
+ {
678
+ "type": "text",
679
+ "text": "But we must emphasize that the VAE can learn $x$ independently of the actual distribution $\\mu _ { g t }$ within $x$ . Addressing the latter is a completely separate issue from achieving the perfect reconstruction error defined by Theorem 4. This fact can be understood within the context of a traditional PCAlike model, which is perfectly capable of learning a low-dimensional subspace containing some training data without actually learning the distribution of the data within this subspace. The central issue is that there exists an intrinsic bias associated with the VAE objective such that fitting the distribution within the manifold will be completely neglected whenever there exists the chance for even an infinitesimally better approximation of the manifold itself. ",
680
+ "bbox": [
681
+ 173,
682
+ 295,
683
+ 825,
684
+ 407
685
+ ],
686
+ "page_idx": 5
687
+ },
688
+ {
689
+ "type": "text",
690
+ "text": "Stated differently, if VAE model parameters have learned a near optimal, parsimonious latent mapping onto $x$ using $\\gamma \\approx 0$ , then the VAE cost will scale as $\\left( d - r \\right) \\log { \\gamma }$ regardless of $\\mu _ { g t }$ . Hence there remains a huge incentive to reduce the reconstruction error still further, allowing $\\gamma$ to push even closer to zero and the cost closer to $- \\infty$ . And if we constrain $\\gamma$ to be sufficiently large so as to prevent this from happening, then we risk degrading/blurring the reconstructions and widening the gap between $q _ { \\phi } ( z | \\pmb { x } )$ and $p _ { \\theta } ( \\pmb { z } | \\pmb { x } )$ , which can also compromise estimation of $\\mu _ { g t }$ . Fortunately though, as will be discussed next there is a convenient way around this dilemma by exploiting the fact that this dominanting $\\left( d - r \\right) \\log { \\gamma }$ factor goes away when $d = r$ . ",
691
+ "bbox": [
692
+ 173,
693
+ 412,
694
+ 825,
695
+ 526
696
+ ],
697
+ "page_idx": 5
698
+ },
699
+ {
700
+ "type": "text",
701
+ "text": "4 FROM THEORY TO PRACTICAL VAE ENHANCEMENTS ",
702
+ "text_level": 1,
703
+ "bbox": [
704
+ 176,
705
+ 545,
706
+ 651,
707
+ 561
708
+ ],
709
+ "page_idx": 5
710
+ },
711
+ {
712
+ "type": "text",
713
+ "text": "Sections 2 and 3 have exposed a collection of VAE properties with useful diagnostic value in and of themselves. But the practical utility of these results, beyond the underappreciated benefit of learning $\\gamma$ , warrant further exploration. In this regard, suppose we wish to develop a generative model of high-dimensional data ${ \\textbf { \\em x } } \\in { \\boldsymbol { x } }$ where unknown low-dimensional structure is significant (i.e., the $r < d$ case with $r$ unknown). The results from Section 3 indicate that the VAE can partially handle this situation by learning a parsimonious representation of low-dimensional manifolds, but not necessarily the correct probability measure $\\mu _ { g t }$ within such a manifold. In quantitative terms, this means that a decoder $\\bar { p } _ { \\boldsymbol { \\theta } } ( \\pmb { x } | \\pmb { z } )$ will map all samples from an encoder $q _ { \\phi } ( z | \\boldsymbol { x } )$ to the correct manifold such that the reconstruction error is negligible for any ${ \\pmb x } \\in { \\pmb x }$ . But if the measure $\\mu _ { g t }$ on $x$ has not been accurately estimated, then ",
714
+ "bbox": [
715
+ 173,
716
+ 575,
717
+ 825,
718
+ 715
719
+ ],
720
+ "page_idx": 5
721
+ },
722
+ {
723
+ "type": "equation",
724
+ "img_path": "images/5b38c8c53ff5faa9a0a30948a61e994d2c9ff258422593d791df7888c1746ff8.jpg",
725
+ "text": "$$\n\\begin{array} { r } { q _ { \\phi } ( z ) \\triangleq \\int _ { \\mathbb { X } ^ { d _ { \\phi } } } ( z | x ) \\mu _ { g t } ( d x ) \\neq \\int _ { \\mathbb { R } ^ { d } } p _ { \\theta } ( z | x ) p _ { \\theta } ( x ) d x = \\int _ { \\mathbb { R } ^ { d } } p _ { \\theta } ( x | z ) p ( z ) d x = \\mathcal { N } ( z | 0 , I ) , } \\end{array}\n$$",
726
+ "text_format": "latex",
727
+ "bbox": [
728
+ 184,
729
+ 719,
730
+ 784,
731
+ 741
732
+ ],
733
+ "page_idx": 5
734
+ },
735
+ {
736
+ "type": "text",
737
+ "text": "where $q _ { \\phi } ( z )$ is sometimes referred to as the aggregated posterior (Makhzani et al., 2016). In other words, the distribution of the latent samples drawn from the encoder distribution, when averaged across the training data, will have lingering latent structure that is errantly incongruous with the original isotropic Gaussian prior. This then disrupts the pivotal ancestral sampling capability of the VAE, implying that samples drawn from $\\mathcal { N } ( z | 0 , I )$ and then passed through the decoder $p _ { \\theta } ( { \\pmb x } | { \\pmb z } )$ will not closely approximate $\\mu _ { g t }$ . Fortunately, our analysis suggests the following two-stage remedy: ",
738
+ "bbox": [
739
+ 173,
740
+ 744,
741
+ 825,
742
+ 829
743
+ ],
744
+ "page_idx": 5
745
+ },
746
+ {
747
+ "type": "text",
748
+ "text": "1. Given $n$ observed samples $\\{ \\pmb { x } ^ { ( i ) } \\} _ { i = 1 } ^ { n }$ , train a $\\kappa$ -simple VAE, with $\\kappa \\geq r$ , to estimate the unknown $r$ -dimensional ground-truth manifold $x$ embedded in $\\mathbb { R } ^ { d }$ using a minimal number of active latent dimensions. Generate latent samples $\\{ z ^ { ( i ) } \\} _ { i = 1 } ^ { n }$ via $\\pmb { z } ^ { ( i ) } \\sim q _ { \\phi } ( \\pmb { z } | \\pmb { x } ^ { ( i ) } )$ . By design, these samples will be distributed as $q _ { \\phi } ( z )$ , but likely not $\\mathcal { N } ( z | \\mathbf { 0 } , I )$ . ",
749
+ "bbox": [
750
+ 214,
751
+ 840,
752
+ 823,
753
+ 901
754
+ ],
755
+ "page_idx": 5
756
+ },
757
+ {
758
+ "type": "text",
759
+ "text": "2. Train a second $\\kappa$ -simple VAE, with independent parameters $\\{ \\theta ^ { \\prime } , \\phi ^ { \\prime } \\}$ and latent representation $\\textbf { \\em u }$ , to learn the unknown distribution $q _ { \\phi } ( z )$ , i.e., treat $q _ { \\phi } ( z )$ as a new ground-truth distribution and use samples $\\{ z ^ { ( i ) } \\} _ { i = 1 } ^ { n }$ to learn it. ",
760
+ "bbox": [
761
+ 212,
762
+ 103,
763
+ 821,
764
+ 148
765
+ ],
766
+ "page_idx": 6
767
+ },
768
+ {
769
+ "type": "text",
770
+ "text": "3. Samples approximating the original ground-truth $\\mu _ { g t }$ can then be formed via the extended ancestral process $\\mathbf { \\Omega } \\mathbf { \\tilde { u } } \\sim \\mathbf { \\tilde { \\mathcal { N } } } ( \\mathbf { \\Omega } \\mathbf { u } | \\mathbf { 0 } , \\mathbf { \\tilde { I } } )$ , $z \\sim p \\theta ^ { \\prime } ( z | u )$ , and finally $\\pmb { x } \\sim p _ { \\theta } ( \\pmb { x } | z )$ . ",
771
+ "bbox": [
772
+ 204,
773
+ 152,
774
+ 821,
775
+ 181
776
+ ],
777
+ "page_idx": 6
778
+ },
779
+ {
780
+ "type": "text",
781
+ "text": "The efficacy of the second-stage VAE from above is based on the following. If the first stage was successful, then even though they will not generally resemble $\\mathcal { N } ( z | \\mathbf { 0 } , I )$ , samples from $q _ { \\phi } ( z )$ will nonetheless have nonzero measure across the full ambient space $\\mathbb { R } ^ { \\kappa }$ . I f $\\kappa = r$ , this occurs because the entire latent space is needed to represent an $r$ -dimensional manifold, and if $\\kappa > r$ , then the extra latent dimensions will be naturally filled in via randomness introduced along dimensions associated with nonzero eigenvalues of the decoder covariance $\\Sigma _ { z }$ per the analysis in Section 3. ",
782
+ "bbox": [
783
+ 174,
784
+ 191,
785
+ 825,
786
+ 275
787
+ ],
788
+ "page_idx": 6
789
+ },
790
+ {
791
+ "type": "text",
792
+ "text": "Consequently, as long as we set $\\kappa \\geq r$ , the operational regime of the second-stage VAE is effectively equivalent to the situation described in Section 2.1 where the manifold dimension is equal to the ambient dimension.5 And as we have already shown there via Theorem 1, the VAE can readily handle this situation, since in the narrow context of the second-stage VAE, $d = r = \\kappa$ , the troublesome $\\left( d - r \\right) \\log { \\gamma }$ factor becomes zero, and any globally minimizing solution is uniquely matched to the new ground-truth distribution $q _ { \\phi } ( z )$ . Consequently, the revised aggregated posterior $q _ { \\phi ^ { \\prime } } ( { \\pmb u } )$ produced by the second-stage VAE should now closely resemble $\\mathcal { N } ( u | { \\bf 0 } , I )$ . And importantly, because we generally assume that $d \\gg \\kappa \\geq r$ , we have found that the second-stage VAE can be quite small. ",
793
+ "bbox": [
794
+ 174,
795
+ 282,
796
+ 823,
797
+ 393
798
+ ],
799
+ "page_idx": 6
800
+ },
801
+ {
802
+ "type": "text",
803
+ "text": "It should also be emphasized that concatenating the two VAE stages and jointly training does not generally improve the performance. If trained jointly the few extra second-stage parameters can simply be hijacked by the dominant influence of the first stage reconstruction term and forced to work on an incrementally better fit of the manifold rather than addressing the critical mismatch between $q _ { \\phi } ( z )$ and $\\mathcal { N } ( u | { \\bf 0 } , I )$ . This observation can be empirically tested, which we have done in multiple ways. For example, we have tried fusing the respective encoders and decoders from the first and second stages to train what amounts to a slightly more complex single VAE model. We have also tried merging the two stages including the associated penalty terms. In both cases, joint training does not help at all as expected, with average performance no better than the first stage VAE (which contains the vast majority of parameters). Consequently, although perhaps counterintuitive, separate training of these two VAE stages is actually critical to achieving high quality results as will be demonstrated next. ",
804
+ "bbox": [
805
+ 174,
806
+ 400,
807
+ 825,
808
+ 566
809
+ ],
810
+ "page_idx": 6
811
+ },
812
+ {
813
+ "type": "text",
814
+ "text": "5 QUANTITATIVE COMPARISONS OF GENERATED SAMPLE QUALITY",
815
+ "text_level": 1,
816
+ "bbox": [
817
+ 173,
818
+ 587,
819
+ 753,
820
+ 603
821
+ ],
822
+ "page_idx": 6
823
+ },
824
+ {
825
+ "type": "text",
826
+ "text": "We first present quantitative evaluation of novel generated samples using the large-scale testing protocol of GAN models from (Lucic et al., 2018). In this regard, GANs are well-known to dramatically outperform existing VAE approaches in terms of the Frechet Inception Distance (FID) score (Heusel ´ et al., 2017) and related quantitative metrics. For fair comparison, (Lucic et al., 2018) adopted a common neutral architecture for all models, with generator and discriminator networks based on InfoGAN (Chen et al., 2016a); the point here is standardized comparisons, not tuning arbitrarily-large networks to achieve the lowest possible absolute FID values. We applied the same architecture to our first-stage VAE decoder and encoder networks respectively for direct comparison. For the lowdimensional second-stage VAE we used small, 3-layer networks contributing negligible additional parameters beyond the first stage (see (Dai & Wipf, 2019) for further design details). ",
827
+ "bbox": [
828
+ 174,
829
+ 618,
830
+ 825,
831
+ 757
832
+ ],
833
+ "page_idx": 6
834
+ },
835
+ {
836
+ "type": "text",
837
+ "text": "We evaluated our proposed VAE pipeline, henceforth denoted as 2-Stage VAE, against three baseline VAE models differing only in the decoder output layer: a Gaussian layer with fixed $\\gamma$ , a Gaussian layer with a learned $\\gamma$ , and a cross-entropy layer as has been adopted in several previous applications involving images (Chen et al., 2016b). We also tested the Gaussian decoder VAE model (with learned $\\gamma$ ) combined with an encoder augmented with normalizing flows (Rezende & Mohamed, 2015), as well as the recently proposed Wasserstein autoencoder (WAE) (Tolstikhin et al., 2018) which maintains a VAE-like structure. All of these models were adapted to use the same neutral architecture from (Lucic et al., 2018). Note also that the WAE includes two variants, referred to as WAE-MMD and WAE-GAN because different Maximum Mean Discrepancy (MMD) and GAN regularization factors are involved. We conduct experiments using the former because it does not involve potentially-unstable adversarial training, consistent with the other VAE baselines.6 Additionally, we present results from (Lucic et al., 2018) involving numerous competing GAN models, including MM GAN (Goodfellow et al., 2014), WGAN (Arjovsky et al., 2017), WGAN-GP (Gulrajani et al., 2017), NS GAN (Fedus et al., 2017), DRAGAN (Kodali et al., 2017), LS GAN (Mao et al., 2017) and BEGAN (Berthelot et al., 2017). Testing is conducted across four significantly different datasets: MNIST (LeCun et al., 1998), Fashion MNIST (Xiao et al., 2017), CIFAR-10 (Krizhevsky & Hinton, 2009) and CelebA (Liu et al., 2015). ",
838
+ "bbox": [
839
+ 174,
840
+ 763,
841
+ 825,
842
+ 876
843
+ ],
844
+ "page_idx": 6
845
+ },
846
+ {
847
+ "type": "text",
848
+ "text": "",
849
+ "bbox": [
850
+ 174,
851
+ 103,
852
+ 825,
853
+ 229
854
+ ],
855
+ "page_idx": 7
856
+ },
857
+ {
858
+ "type": "text",
859
+ "text": "For each dataset we executed 10 independent trials and report the mean and standard deviation of the FID scores in Table 1.7 No effort was made to tune VAE training hyperparameters (e.g., learning rates, etc.); rather a single generic setting was first agnostically selected and then applied to all VAE-like models (including the WAE-MMD). As an analogous baseline, we also report the value of the best GAN model for each dataset when trained using suggested settings from the authors; no single model was optimal across all datasets, so these values represent the best performance from different, dataset-dependent GANs. Even so, our single 2-Stage VAE is still better on two of four datasets, and in aggregate, better than any individual GAN model. For example, when averaged across datasets, the mean FID score for any individual GAN trained with suggested settings was always approximately 45 or higher (see (Lucic et al., 2018)[Figure 4]), while our analogous 2-Stage VAE maintained a mean below 40. The other VAE baselines were not competitive. Note also that the relatively poor performance of the WAE-MMD on MNIST and Fashion MNIST data can be attributed to the sensitivity of this approach to the value of $\\kappa$ , which for consistency with other models was fixed at $\\kappa ~ = ~ 6 4$ for all experiments. This value is likely much larger than actually needed for these simpler data types (meaning $r \\ll 6 4$ ), and the WAE-MMD model can potentially be more reliant on having some $\\kappa \\approx r$ . For head-to-head empirical tests of robustness to $\\kappa$ , please see (Dai & Wipf, 2019). ",
860
+ "bbox": [
861
+ 174,
862
+ 236,
863
+ 825,
864
+ 472
865
+ ],
866
+ "page_idx": 7
867
+ },
868
+ {
869
+ "type": "text",
870
+ "text": "Table 1 also displays FID scores from GAN models evaluated using hyperparameters obtained from a large-scale search executed independently across each dataset to achieve the best results; 100 settings per model per dataset, plus an optimal, data-dependent stopping criteria as described in (Lucic et al., 2018). Within this broader paradigm, cases of severe mode collapse were omitted when computing final GAN FID averages. Despite these considerable GAN-specific advantages, the FID performance of the default 2-Stage VAE is well within the range of the heavily-optimized GAN models for each dataset unlike the other VAE baselines. Overall then, these results represent the first demonstration of a VAE pipeline capable of competing with GANs in the arena of generated sample quality. Additionally, representative samples produced using our 2-Stage VAE model can be found in (Dai & Wipf, 2019). ",
871
+ "bbox": [
872
+ 174,
873
+ 478,
874
+ 825,
875
+ 617
876
+ ],
877
+ "page_idx": 7
878
+ },
879
+ {
880
+ "type": "text",
881
+ "text": "Beyond the neutral testing platform from (Lucic et al., 2018), we also consider additional comparisons using the architecture and experimental setup from (Tolstikhin et al., 2018) explicitly designed for applying WAE models to CelebA data. In particular, we adopt the exact same encoder-decoder networks as the WAE models, and train using the same number of epochs. We do not tune any hyperparameters whatsoever, and apply the same small second-stage VAE as used in previous experiments. As before, the second-stage size is a small fraction of the first stage, so any benefit is not simply the consequence of a larger network structure. Results are reported in Table 2, where the 2-Stage VAE even outperforms the WAE-GAN model, which has the advantage of adversarial training tuned for this combination of data and network architecture. ",
882
+ "bbox": [
883
+ 173,
884
+ 625,
885
+ 825,
886
+ 750
887
+ ],
888
+ "page_idx": 7
889
+ },
890
+ {
891
+ "type": "text",
892
+ "text": "6 EXPERIMENTAL CORROBORATION OF THEORETICAL RESULTS ",
893
+ "text_level": 1,
894
+ "bbox": [
895
+ 176,
896
+ 771,
897
+ 722,
898
+ 787
899
+ ],
900
+ "page_idx": 7
901
+ },
902
+ {
903
+ "type": "text",
904
+ "text": "The true test of any theoretical contribution is the degree to which it leads to useful, empiricallytestable predictions about behavior in real-world settings. In the present context, although our theory from Sections 2 and 3 involves some unavoidable simplifying assumptions, it nonetheless makes predictions that can be tested under practically-relevant conditions where these assumptions may ",
905
+ "bbox": [
906
+ 174,
907
+ 803,
908
+ 823,
909
+ 858
910
+ ],
911
+ "page_idx": 7
912
+ },
913
+ {
914
+ "type": "table",
915
+ "img_path": "images/347a3aa578feac1310d2d37e87e9ed0871d044cb4619b9a00305d790f6a25cc2.jpg",
916
+ "table_caption": [],
917
+ "table_footnote": [],
918
+ "table_body": "<table><tr><td></td><td></td><td>MNIST</td><td>Fashion</td><td>CIFAR-10</td><td>CelebA</td></tr><tr><td rowspan=\"3\">optimized, data-dependent settings</td><td rowspan=\"3\">MM GAN NS GAN LSGAN WGAN WGAN GP</td><td>9.8±0.9</td><td>29.6 ±1.6 26.5 ± 1.6</td><td>72.7 ± 3.6 58.5 ± 1.9</td><td>65.6± 4.2</td></tr><tr><td>6.8 ± 0.5</td><td></td><td></td><td>55.0 ± 3.3</td></tr><tr><td>7.8± 0.6 6.7±0.4</td><td>30.7 ± 2.2 21.5 ± 1.6</td><td>87.1 ± 47.5 55.2 ± 2.3</td><td>53.9 ± 2.8 41.3 ± 2.0</td></tr><tr><td></td><td>DRAGAN BEGAN Best GAN</td><td>20.3 ± 5.0 7.6 ± 0.4 13.1 ± 1.0 ~10</td><td>24.5 ± 2.1 27.7 ±1.2 22.9 ± 0.9</td><td>55.8 ± 0.9 69.8 ± 2.0 71.4 ± 1.6</td><td>30.3 ± 1.0 42.3 ± 3.0 38.9 ± 0.9</td></tr><tr><td>default settings</td><td>VAE (cross-entr.) VAE (fixed γ) VAE (learned ~) VAE + Flow WAE-MMD 2-Stage VAE (ours)</td><td>16.6 ± 0.4 52.0 ± 0.6 54.5 ± 1.0 54.8± 2.8 115.0 ± 1.1 12.6 ± 1.5</td><td>~32 43.6 ± 0.7 84.6 ± 0.9 60.0 ±1.1 62.1 ± 1.6 101.7 ± 0.8 29.3±1.0</td><td>~70 106.0 ± 1.0 160.5 ± 1.1 76.7 ± 0.8 81.2 ± 2.0 80.9 ± 0.4</td><td>~49 53.3 ± 0.6 55.9 ± 0.6 60.5 ± 0.6 65.7 ± 2.8 62.9 ± 0.8</td></tr></table>",
919
+ "bbox": [
920
+ 173,
921
+ 101,
922
+ 825,
923
+ 319
924
+ ],
925
+ "page_idx": 8
926
+ },
927
+ {
928
+ "type": "text",
929
+ "text": "Table 1: FID score comparisons using neutral architecture. For all GAN-based models listed in the top section of the table, reported values represent the optimal FID obtained across a large-scale hyperparameter search conducted separately for each dataset (Lucic et al., 2018). Outlier cases (e.g., severe mode collapse) were omitted, which would have otherwise increased these GAN FID scores. In the lower section of the table, the label Best GAN indicates the lowest FID produced across all GAN approaches for each dataset when trained using settings suggested by original authors; these approximate values were extracted from (Lucic et al., 2018)[Figure 4]. For the VAE results (including WAE), only a single default setting was adopted across all datasets and models (no tuning whatsoever), and no cases of mode collapse were removed. Note that specialized architectures and/or random seed optimization can potentially improve the FID for all models reported here. ",
930
+ "bbox": [
931
+ 173,
932
+ 342,
933
+ 825,
934
+ 482
935
+ ],
936
+ "page_idx": 8
937
+ },
938
+ {
939
+ "type": "table",
940
+ "img_path": "images/cd90e75ccd9e70ef902f0031664f1963630e52cc9f4ca70cd643999892c08f7f.jpg",
941
+ "table_caption": [
942
+ "Table 2: FID scores on CelebA data obtained using the network structure and training protocol from (Tolstikhin et al., 2018). For the 2-Stage VAE, we apply the exact same architecture and training epochs without any tuning of hyperparameters. "
943
+ ],
944
+ "table_footnote": [],
945
+ "table_body": "<table><tr><td></td><td>VAE</td><td>WAE-MMD</td><td>WAE-GAN</td><td>2-Stage VAE (ours)</td></tr><tr><td>CelebAFID</td><td>63</td><td>55</td><td>42</td><td>34</td></tr></table>",
946
+ "bbox": [
947
+ 248,
948
+ 500,
949
+ 746,
950
+ 532
951
+ ],
952
+ "page_idx": 8
953
+ },
954
+ {
955
+ "type": "text",
956
+ "text": "not strictly hold. We now present the results of such tests, which provide strong confirmation of our previous analysis. In particular, after providing validation of Theorems 3 and 4, we explicitly demonstrate that the second stage of our 2-Stage VAE model can reduce the gap between $q ( z )$ and $p ( z )$ . ",
957
+ "bbox": [
958
+ 174,
959
+ 616,
960
+ 825,
961
+ 672
962
+ ],
963
+ "page_idx": 8
964
+ },
965
+ {
966
+ "type": "text",
967
+ "text": "Validation of Theorem 3: This theorem implies that $\\gamma$ will converge to zero at any global minimum of the stated VAE objective under consideration. Figure 1a presents empirical support for this result, where indeed the decoder variance $\\gamma$ does tend towards zero during training (red line). This then allows for tighter image reconstructions (dark blue curve) with lower average squared error, i.e., a better manifold fit as expected. ",
968
+ "bbox": [
969
+ 174,
970
+ 685,
971
+ 825,
972
+ 756
973
+ ],
974
+ "page_idx": 8
975
+ },
976
+ {
977
+ "type": "text",
978
+ "text": "Validation of Theorem 4: Figure 1b bolsters this theorem, and the attendant analysis which follows in Section 3, by showcasing the dissimilar impact of noise factors applied to different directions in the latent space before passage through the decoder mean network $f _ { \\mu _ { x } }$ . In a direction where an eigenvalue $\\lambda _ { j }$ of $\\Sigma _ { z }$ is large (i.e., a superfluous dimension), a random perturbation is completely muted by the decoder as predicted. In contrast, in directions where such eigenvalues are small (i.e., needed for representing the manifold), varying the input causes large changes in the image space reflecting reasonable movement along the correct manifold. ",
979
+ "bbox": [
980
+ 173,
981
+ 770,
982
+ 825,
983
+ 867
984
+ ],
985
+ "page_idx": 8
986
+ },
987
+ {
988
+ "type": "text",
989
+ "text": "Reduced Mismatch between $q _ { \\phi } ( z )$ and $p ( z )$ : Although the VAE with a learnable $\\gamma$ can achieve high-quality reconstructions, the associated aggregated posterior is still likely not close to a standard Gaussian distribution as implied by (10). This mismatch then disrupts the critical ancestral sampling process. As we have previously argued, the proposed 2-Stage VAE has the ability to overcome this issue and achieve a standard Gaussian aggregated posterior, or at least nearly so. As empirical evidence for this claim, Figure 2 displays the singular value spectrum of latent sample matrices $z =$ $\\{ z ^ { ( i ) } \\} _ { i = 1 } ^ { n }$ drawn from $q _ { \\phi } ( z )$ (first stage), and $\\bar { U = } \\{ \\pmb { u } ^ { ( i ) } \\} _ { i = 1 } ^ { n }$ drawn from $q _ { \\phi ^ { \\prime } } ( { \\pmb u } )$ (enhanced second stage). As expected, the latter is much closer to the spectrum from an analogous i.i.d. $\\mathcal { N } ( 0 , \\pmb { I } )$ matrix. We also used these same sample matrices to estimate the MMD metric (Gretton et al., 2007) between $\\mathcal { N } ( 0 , \\pmb { I } )$ and the aggregated posterior distributions from the first and second stages in Table 3. Clearly the second stage has dramatically reduced the difference from $\\mathcal { N } ( 0 , \\pmb { I } )$ as quantified by the MMD. Overall, these results indicate a superior latent representation, providing high-level support for our 2-Stage VAE proposal. ",
990
+ "bbox": [
991
+ 176,
992
+ 881,
993
+ 823,
994
+ 924
995
+ ],
996
+ "page_idx": 8
997
+ },
998
+ {
999
+ "type": "image",
1000
+ "img_path": "images/f6a60319c69b65db228bcad47b601c72982e73c96e49dc29e02463ff11002c50.jpg",
1001
+ "image_caption": [
1002
+ "Figure 1: $( a )$ The red line shows the evolution of $\\log \\gamma$ , converging close to 0 during training as expected. The two blue curves compare the associated pixel-wise reconstruction errors with $\\gamma$ fixed at 1 and with a learnable $\\gamma$ respectively. $( b )$ The $j$ -th eigenvalue of $\\Sigma _ { z }$ , denoted $\\lambda _ { j }$ , should be very close to either 0 or 1 as argued in Section 3. When $\\lambda _ { j }$ is close to 0, injecting noise along the corresponding direction will cause a large variance in the reconstructed image, meaning this direction is an informative one needed for representing the manifold. In contrast, if $\\lambda _ { j }$ is close to 1, the addition of noise does not make any appreciable difference in the reconstructed image, indicating that the corresponding dimension is a superfluous one that has been ignored/blocked by the decoder. "
1003
+ ],
1004
+ "image_footnote": [],
1005
+ "bbox": [
1006
+ 197,
1007
+ 101,
1008
+ 802,
1009
+ 281
1010
+ ],
1011
+ "page_idx": 9
1012
+ },
1013
+ {
1014
+ "type": "image",
1015
+ "img_path": "images/7f4b731de3bb38e49071ff6fb80175ad207b47f255f156d62f1007cd52e3dfee.jpg",
1016
+ "image_caption": [
1017
+ "Figure 2: Singular value spectrums of latent sample matrices drawn from $q _ { \\phi } ( z )$ (first stage) and $q _ { \\phi ^ { \\prime } } ( { \\pmb u } )$ (enhanced second stage). "
1018
+ ],
1019
+ "image_footnote": [],
1020
+ "bbox": [
1021
+ 230,
1022
+ 426,
1023
+ 444,
1024
+ 517
1025
+ ],
1026
+ "page_idx": 9
1027
+ },
1028
+ {
1029
+ "type": "table",
1030
+ "img_path": "images/2859c857dbe20bc567350bbda4439f4e19e5b75a3559302ed799ee2baf35132c.jpg",
1031
+ "table_caption": [
1032
+ "Table 3: Maximum mean discrepancy between $\\mathcal { N } ( 0 , \\pmb { I } )$ and $q _ { \\phi } ( z )$ (first stage); likewise for $q _ { \\phi ^ { \\prime } } ( { \\pmb u } )$ (second stage). "
1033
+ ],
1034
+ "table_footnote": [],
1035
+ "table_body": "<table><tr><td></td><td>First Stage</td><td>Second Stage</td></tr><tr><td>MNIST</td><td>2.85</td><td>0.43</td></tr><tr><td>Fashion</td><td>1.37</td><td>0.40</td></tr><tr><td>Cifar10</td><td>1.08</td><td>0.00</td></tr><tr><td>CelabA</td><td>7.42</td><td>0.29</td></tr></table>",
1036
+ "bbox": [
1037
+ 539,
1038
+ 444,
1039
+ 812,
1040
+ 518
1041
+ ],
1042
+ "page_idx": 9
1043
+ },
1044
+ {
1045
+ "type": "text",
1046
+ "text": "",
1047
+ "bbox": [
1048
+ 173,
1049
+ 606,
1050
+ 825,
1051
+ 747
1052
+ ],
1053
+ "page_idx": 9
1054
+ },
1055
+ {
1056
+ "type": "text",
1057
+ "text": "7 DISCUSSION ",
1058
+ "text_level": 1,
1059
+ "bbox": [
1060
+ 176,
1061
+ 775,
1062
+ 310,
1063
+ 791
1064
+ ],
1065
+ "page_idx": 9
1066
+ },
1067
+ {
1068
+ "type": "text",
1069
+ "text": "It is often assumed that there exists an unavoidable trade-off between the stable training, valuable attendant encoder network, and resistance to mode collapse of VAEs, versus the impressive visual quality of images produced by GANs. While we certainly are not claiming that our two-stage VAE model is superior to the latest and greatest GAN-based architecture in terms of the realism of generated samples, we do strongly believe that this work at least narrows that gap substantially such that VAEs are worth considering in a broader range of applications. For further results and discussion, including consideration of broader VAE modeling paradigms and the identifiability of disentangled representations, please see (Dai & Wipf, 2019). ",
1070
+ "bbox": [
1071
+ 174,
1072
+ 811,
1073
+ 825,
1074
+ 924
1075
+ ],
1076
+ "page_idx": 9
1077
+ },
1078
+ {
1079
+ "type": "text",
1080
+ "text": "REFERENCES ",
1081
+ "text_level": 1,
1082
+ "bbox": [
1083
+ 174,
1084
+ 102,
1085
+ 287,
1086
+ 118
1087
+ ],
1088
+ "page_idx": 10
1089
+ },
1090
+ {
1091
+ "type": "text",
1092
+ "text": "Martin Arjovsky, Soumith Chintala, and Leon Bottou. Wasserstein generative adversarial networks. ´ In International Conference on Machine Learning, pp. 214–223, 2017. ",
1093
+ "bbox": [
1094
+ 171,
1095
+ 126,
1096
+ 823,
1097
+ 156
1098
+ ],
1099
+ "page_idx": 10
1100
+ },
1101
+ {
1102
+ "type": "text",
1103
+ "text": "Yoshua Bengio, Aaron Courville, and Pascal Vincent. Representation learning: A review and new perspectives. IEEE Transactions on Pattern Analysis and Machine Intelligence, 35(8):1798–1828, 2013. ",
1104
+ "bbox": [
1105
+ 176,
1106
+ 165,
1107
+ 823,
1108
+ 208
1109
+ ],
1110
+ "page_idx": 10
1111
+ },
1112
+ {
1113
+ "type": "text",
1114
+ "text": "David Berthelot, Thomas Schumm, and Luke Metz. BEGAN: Boundary equilibrium generative adversarial networks. arXiv:1703.10717, 2017. ",
1115
+ "bbox": [
1116
+ 173,
1117
+ 218,
1118
+ 821,
1119
+ 247
1120
+ ],
1121
+ "page_idx": 10
1122
+ },
1123
+ {
1124
+ "type": "text",
1125
+ "text": "Olivier Bousquet, Sylvain Gelly, Ilya Tolstikhin, Carl Johann Simon-Gabriel, and Bernhard Scholkopf. From optimal transport to generative modeling: the VEGAN cookbook. ¨ arXiv:1611.02731, 2017. ",
1126
+ "bbox": [
1127
+ 173,
1128
+ 258,
1129
+ 825,
1130
+ 301
1131
+ ],
1132
+ "page_idx": 10
1133
+ },
1134
+ {
1135
+ "type": "text",
1136
+ "text": "Andrew Brock, Theodore Lim, James M Ritchie, and Nick Weston. Neural photo editing with introspective adversarial networks. arXiv:1609.07093, 2016. ",
1137
+ "bbox": [
1138
+ 173,
1139
+ 311,
1140
+ 825,
1141
+ 342
1142
+ ],
1143
+ "page_idx": 10
1144
+ },
1145
+ {
1146
+ "type": "text",
1147
+ "text": "Yuri Burda, Roger Grosse, and Ruslan Salakhutdinov. Importance weighted autoencoders. arXiv:1509.00519, 2015. ",
1148
+ "bbox": [
1149
+ 171,
1150
+ 352,
1151
+ 823,
1152
+ 381
1153
+ ],
1154
+ "page_idx": 10
1155
+ },
1156
+ {
1157
+ "type": "text",
1158
+ "text": "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, 2016a. ",
1159
+ "bbox": [
1160
+ 176,
1161
+ 390,
1162
+ 825,
1163
+ 434
1164
+ ],
1165
+ "page_idx": 10
1166
+ },
1167
+ {
1168
+ "type": "text",
1169
+ "text": "Xi Chen, Diederik Kingma, Tim Salimans, Yan Duan, Prafulla Dhariwal, John Schulman, Ilya Sutskever, and Pieter Abbeel. Variational lossy autoencoder. arXiv:1611.02731, 2016b. ",
1170
+ "bbox": [
1171
+ 176,
1172
+ 444,
1173
+ 826,
1174
+ 473
1175
+ ],
1176
+ "page_idx": 10
1177
+ },
1178
+ {
1179
+ "type": "text",
1180
+ "text": "Bin Dai and David Wipf. Diagnosing and enhancing VAE models. arXiv:1903.05789, 2019. ",
1181
+ "bbox": [
1182
+ 174,
1183
+ 483,
1184
+ 779,
1185
+ 500
1186
+ ],
1187
+ "page_idx": 10
1188
+ },
1189
+ {
1190
+ "type": "text",
1191
+ "text": "Bin Dai, Yu Wang, John Aston, Gang Hua, and David Wipf. Connections with robust PCA and the role of emergent sparsity in variational autoencoder models. Journal of Machine Learning Research, 19(41):1–42, 2018. ",
1192
+ "bbox": [
1193
+ 174,
1194
+ 508,
1195
+ 825,
1196
+ 553
1197
+ ],
1198
+ "page_idx": 10
1199
+ },
1200
+ {
1201
+ "type": "text",
1202
+ "text": "Carl Doersch. Tutorial on variational autoencoders. arXiv:1606.05908, 2016. ",
1203
+ "bbox": [
1204
+ 173,
1205
+ 563,
1206
+ 681,
1207
+ 578
1208
+ ],
1209
+ "page_idx": 10
1210
+ },
1211
+ {
1212
+ "type": "text",
1213
+ "text": "Alexey Dosovitskiy and Thomas Brox. Generating images with perceptual similarity metrics based on deep networks. In Advances in Neural Information Processing Systems, pp. 658–666, 2016. ",
1214
+ "bbox": [
1215
+ 171,
1216
+ 588,
1217
+ 825,
1218
+ 618
1219
+ ],
1220
+ "page_idx": 10
1221
+ },
1222
+ {
1223
+ "type": "text",
1224
+ "text": "William Fedus, Mihaela Rosca, Balaji Lakshminarayanan, Andrew M Dai, Shakir Mohamed, and Ian Goodfellow. Many paths to equilibrium: GANs do not need to decrease a divergence at every step. arXiv:1710.08446, 2017. ",
1225
+ "bbox": [
1226
+ 174,
1227
+ 627,
1228
+ 823,
1229
+ 671
1230
+ ],
1231
+ "page_idx": 10
1232
+ },
1233
+ {
1234
+ "type": "text",
1235
+ "text": "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. ",
1236
+ "bbox": [
1237
+ 173,
1238
+ 681,
1239
+ 825,
1240
+ 724
1241
+ ],
1242
+ "page_idx": 10
1243
+ },
1244
+ {
1245
+ "type": "text",
1246
+ "text": "Arthur Gretton, Karsten Borgwardt, Malte Rasch, Bernhard Scholkopf, and Alex Smola. A kernel ¨ method for the two-sample-problem. In Advances in Neural Information Processing Systems, pp. 513–520, 2007. ",
1247
+ "bbox": [
1248
+ 173,
1249
+ 734,
1250
+ 825,
1251
+ 777
1252
+ ],
1253
+ "page_idx": 10
1254
+ },
1255
+ {
1256
+ "type": "text",
1257
+ "text": "Ishaan Gulrajani, Faruk Ahmed, Martin Arjovsky, Vincent Dumoulin, and Aaron Courville. Improved training of Wasserstein GANs. In Advances in Neural Information Processing Systems, pp. 5767–5777, 2017. ",
1258
+ "bbox": [
1259
+ 171,
1260
+ 787,
1261
+ 825,
1262
+ 830
1263
+ ],
1264
+ "page_idx": 10
1265
+ },
1266
+ {
1267
+ "type": "text",
1268
+ "text": "Martin Heusel, Hubert Ramsauer, Thomas Unterthiner, Bernhard Nessler, and Sepp Hochreiter. GANs trained by a two time-scale update rule converge to a local Nash equilibrium. In Advances in Neural Information Processing Systems, pp. 6626–6637, 2017. ",
1269
+ "bbox": [
1270
+ 173,
1271
+ 842,
1272
+ 823,
1273
+ 885
1274
+ ],
1275
+ "page_idx": 10
1276
+ },
1277
+ {
1278
+ "type": "text",
1279
+ "text": "Diederik Kingma and Max Welling. Auto-encoding variational Bayes. In International Conference on Learning Representations, 2014. ",
1280
+ "bbox": [
1281
+ 173,
1282
+ 895,
1283
+ 821,
1284
+ 924
1285
+ ],
1286
+ "page_idx": 10
1287
+ },
1288
+ {
1289
+ "type": "text",
1290
+ "text": "Diederik Kingma, Tim Salimans, Rafal Jozefowicz, Xi Chen, Ilya Sutskever, and Max Welling. Improved variational inference with inverse autoregressive flow. In Advances in Neural Information Processing Systems, pp. 4743–4751, 2016. ",
1291
+ "bbox": [
1292
+ 176,
1293
+ 103,
1294
+ 823,
1295
+ 146
1296
+ ],
1297
+ "page_idx": 11
1298
+ },
1299
+ {
1300
+ "type": "text",
1301
+ "text": "Naveen Kodali, Jacob Abernethy, James Hays, and Zsolt Kira. On convergence and stability of GANs. arXiv:1705.07215, 2017. ",
1302
+ "bbox": [
1303
+ 171,
1304
+ 155,
1305
+ 823,
1306
+ 184
1307
+ ],
1308
+ "page_idx": 11
1309
+ },
1310
+ {
1311
+ "type": "text",
1312
+ "text": "Alex Krizhevsky and Geoffrey Hinton. Learning multiple layers of features from tiny images. Technical report, Citeseer, 2009. ",
1313
+ "bbox": [
1314
+ 173,
1315
+ 193,
1316
+ 823,
1317
+ 222
1318
+ ],
1319
+ "page_idx": 11
1320
+ },
1321
+ {
1322
+ "type": "text",
1323
+ "text": "Anders Boesen Lindbo Larsen, Søren Kaae Sønderby, Hugo Larochelle, and Ole Winther. Autoencoding beyond pixels using a learned similarity metric. arXiv:1512.09300, 2015. ",
1324
+ "bbox": [
1325
+ 173,
1326
+ 229,
1327
+ 821,
1328
+ 260
1329
+ ],
1330
+ "page_idx": 11
1331
+ },
1332
+ {
1333
+ "type": "text",
1334
+ "text": "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. ",
1335
+ "bbox": [
1336
+ 173,
1337
+ 267,
1338
+ 823,
1339
+ 297
1340
+ ],
1341
+ "page_idx": 11
1342
+ },
1343
+ {
1344
+ "type": "text",
1345
+ "text": "Ziwei Liu, Ping Luo, Xiaogang Wang, and Xiaoou Tang. Deep learning face attributes in the wild. In IEEE International Conference on Computer Vision, pp. 3730–3738, 2015. ",
1346
+ "bbox": [
1347
+ 173,
1348
+ 305,
1349
+ 821,
1350
+ 335
1351
+ ],
1352
+ "page_idx": 11
1353
+ },
1354
+ {
1355
+ "type": "text",
1356
+ "text": "Mario Lucic, Karol Kurach, Marcin Michalski, Sylvain Gelly, and Olivier Bousquet. Are GANs created equal? A large-scale study. Advances in Neural Information Processing Systems, 2018. ",
1357
+ "bbox": [
1358
+ 171,
1359
+ 343,
1360
+ 823,
1361
+ 372
1362
+ ],
1363
+ "page_idx": 11
1364
+ },
1365
+ {
1366
+ "type": "text",
1367
+ "text": "Alireza Makhzani, Jonathon Shlens, Navdeep Jaitly, Ian Goodfellow, and Brendan Frey. Adversarial autoencoders. arXiv:1511.05644, 2016. ",
1368
+ "bbox": [
1369
+ 173,
1370
+ 381,
1371
+ 823,
1372
+ 410
1373
+ ],
1374
+ "page_idx": 11
1375
+ },
1376
+ {
1377
+ "type": "text",
1378
+ "text": "Xudong Mao, Qing Li, Haoran Xie, Raymond YK Lau, Zhen Wang, and Stephen Paul Smolley. Least squares generative adversarial networks. In IEEE International Conference on Computer Vision, pp. 2813–2821, 2017. ",
1379
+ "bbox": [
1380
+ 174,
1381
+ 419,
1382
+ 821,
1383
+ 462
1384
+ ],
1385
+ "page_idx": 11
1386
+ },
1387
+ {
1388
+ "type": "text",
1389
+ "text": "Danilo Jimenez Rezende and Shakir Mohamed. Variational inference with normalizing flows. arXiv:1505.05770, 2015. ",
1390
+ "bbox": [
1391
+ 173,
1392
+ 469,
1393
+ 820,
1394
+ 500
1395
+ ],
1396
+ "page_idx": 11
1397
+ },
1398
+ {
1399
+ "type": "text",
1400
+ "text": "D.J. Rezende, S. Mohamed, and D. Wierstra. Stochastic backpropagation and approximate inference in deep generative models. In International Conference on Machine Learning, 2014. ",
1401
+ "bbox": [
1402
+ 174,
1403
+ 507,
1404
+ 821,
1405
+ 537
1406
+ ],
1407
+ "page_idx": 11
1408
+ },
1409
+ {
1410
+ "type": "text",
1411
+ "text": "Ilya Tolstikhin, Olivier Bousquet, Sylvain Gelly, and Bernhard Schoelkopf. Wasserstein autoencoders. International Conference on Learning Representations, 2018. ",
1412
+ "bbox": [
1413
+ 173,
1414
+ 545,
1415
+ 823,
1416
+ 575
1417
+ ],
1418
+ "page_idx": 11
1419
+ },
1420
+ {
1421
+ "type": "text",
1422
+ "text": "Han Xiao, Kashif Rasul, and Roland Vollgraf. Fashion-MNIST: A novel image dataset for benchmarking machine learning algorithms. arXiv:1708.07747, 2017. ",
1423
+ "bbox": [
1424
+ 174,
1425
+ 583,
1426
+ 823,
1427
+ 613
1428
+ ],
1429
+ "page_idx": 11
1430
+ }
1431
+ ]
parse/train/B1e0X3C9tQ/B1e0X3C9tQ_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/B1e0X3C9tQ/B1e0X3C9tQ_model.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/H1gza2NtwH/H1gza2NtwH.md ADDED
@@ -0,0 +1,559 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # TOWARDS UNDERSTANDING THE TRUE LOSS SURFACE OF DEEP NEURAL NETWORKS USING RANDOM MATRIX THEORY AND ITERATIVE SPECTRAL METHODS
2
+
3
+ Anonymous authors Paper under double-blind review
4
+
5
+ # ABSTRACT
6
+
7
+ The geometric properties of loss surfaces, such as the local flatness of a solution, are associated with generalization in deep learning. The Hessian is often used to understand these geometric properties. We investigate the differences between the eigenvalues of the neural network Hessian evaluated over the empirical dataset, the Empirical Hessian, and the eigenvalues of the Hessian under the data generating distribution, which we term the True Hessian. Under mild assumptions, we use random matrix theory to show that the True Hessian has eigenvalues of smaller absolute value than the Empirical Hessian. We support these results for different SGD schedules on both a 110-Layer ResNet and VGG-16. To perform these experiments we propose a framework for spectral visualization, based on GPU accelerated stochastic Lanczos quadrature. This approach is an order of magnitude faster than state-of-the-art methods for spectral visualization, and can be generically used to investigate the spectral properties of matrices in deep learning.
8
+
9
+ # 1 INTRODUCTION
10
+
11
+ The extraordinary success of deep learning in computer vision and natural language processing has been accompanied by an explosion of theoretical (Choromanska et al., 2015a;b; Pennington & Bahri, 2017) and empirical interest in their loss surfaces, typically through the study of the Hessian and its eigenspectrum (Ghorbani et al., 2019; Li et al., 2017; Sagun et al., 2016; 2017; Wu et al., 2017).
12
+
13
+ Exploratory work on the Hessian, and its evolution during training (e.g., Jastrz˛ebski et al., 2018), attempts to understand why optimization procedures such as SGD can discover good solutions for training neural networks, given complex non-convex loss surfaces. For example, the ratio of the largest to smallest eigenvalues, known as the condition number, determines the convergence rate for first-order optimization methods on convex objectives (Nesterov, 2013). The presence of negative eigenvalues indicates non-convexity even at a local scale. Hessian analysis has also been a primary tool in further explaining the difference in generalization of solutions obtained, where under Bayesian complexity frameworks, flatter minima, which require less information to store, generalize better than sharp minima (Hochreiter & Schmidhuber, 1997). Further work has considered how large batch vs small batch stochastic gradient descent (SGD) alters the sharpness of solutions (Keskar et al., 2016), with smaller batches leading to convergence to flatter solutions, leading to better generalization. These geometrical insights have led to generalization procedures, such as taking the Cesàro mean of the weights along the SGD trajectory (Garipov et al., 2018; Izmailov et al., 2018), and algorithms that optimize the model to select for local flatness (Chaudhari et al., 2016). Flat regions of weight space are more robust under adversarial attack (Yao et al., 2018). Moreover, the Hessian defines the curvature of the posterior over weights in the Laplace approximation for Bayesian neural networks (MacKay, 1992; 2003), and thus crucially determines its performance.
14
+
15
+ In this paper we use random matrix theory to analyze the spectral differences between the Empirical Hessian, evaluated via a finite data sample (hence related to the empirical risk) and what we term the True Hessian, given under the expectation of the true data generating distribution.1
16
+
17
+ In particular, we show that the differences in extremal eigenvalues between the True Hessian and the Empirical Hessian depend on the ratio of model parameters to dataset size and the variance per element of the Hessian. Moreover, we show that that the Empirical Hessian spectrum, relative to that of the True Hessian, is broadened; i.e. the largest eigenvalues are larger and the smallest smaller. We support this theory with experiments on the CIFAR-10 and CIFAR-100 datasets for different learning rate schedules using a large modern neural network, the 110 Layer PreResNet.
18
+
19
+ It is not currently known if key results, such as (1) the flatness or sharpness of good and bad optima, (2) local non-convexity at the end of training, or (3) rank degeneracy hold for the True Hessian in the same way as for the Empirical Hessian. We hence provide an investigation of these foundational questions.
20
+
21
+ # 2 RELATED WORK, CONTRIBUTIONS AND PAPER STRUCTURE
22
+
23
+ Previous work has used random matrix theory to study the spectra of neural network Hessians under assumptions such as normality of inputs and weights, to show results such as the decreasing difference in loss value between the local and global minima (Choromanska et al., 2015a) and the fraction of negative eigenvalues at final points in training (Pennington & Bahri, 2017). To the authors knowledge no theoretical work has been done on the nature of the difference in spectra between the True Hessian and Empirical Hessian in machine learning. Previous empirical work on neural network loss surfaces (Ghorbani et al., 2019; Papyan, 2018; Sagun et al., 2017; 2016; Jastrz˛ebski et al., 2018) has also exclusively focused on the Empirical Hessian or a sub-sample thereof.
24
+
25
+ The work closest in spirit to our work is the spiked covariance literature, which studies the problem of learning the true covariance matrix given by the generating distribution, from the noisy sample covariance matrix. This problem is studied in mathematics and physics (Baik & Silverstein, 2004; Bloemendal et al., 2016b;a) with applications leading to extensively improved results in both sparse Principal Component Analysis (Johnstone & Lu, 2004), portfolio theory (Laloux et al., 1999) and Bayesian covariance matrix spectrum estimation (Everson & Roberts, 2000). A key concept from this literature, is the ratio of parameters to data samples and its effect on the observed spectrum; this ratio is mentioned in (Pennington & Bahri, 2017), but it is not used to determine the perturbation between the Empirical Hessian and True Hessian. (Kunstner et al., 2019) consider circumstances under which the Empirical Fisher information matrix is a bad proxy to the True Fisher matrix, but do not use a random matrix theory to characterise the spectral perturbations between the two. We list our main contributions below.
26
+
27
+ • We introduce the concept of the True Hessian, discuss its importance and investigate it both theoretically and empirically.
28
+ • We use random matrix theory to analytically derive the eigenvalue perturbations between the True Hessian and the Empirical Hessian, showing the spectrum of the Empirical Hessian to be broadened.
29
+ • We visualize the True Hessian spectrum by combining a GPU accelerated stochastic Lanczos quadrature (Gardner et al., 2018) with data-augmentation. Our spectral visualization technique is an order of magnitude faster than recent iterative methods (Ghorbani et al., 2019; Papyan, 2018), requires one less hand-tuned hyper-parameter, and is consistent with the observed moment information. This procedure can be generically used to compute the spectra of large matrices (e.g., Hessians, Fisher information matrices) in deep learning.
30
+
31
+ # 3 PROBLEM FORMULATION
32
+
33
+ For an input $\pmb { x } \in \mathbb { R } ^ { d _ { x } }$ and output $\boldsymbol { y } \in \mathbb { R } ^ { d _ { y } }$ we have a given prediction function $h ( \cdot ; \cdot ) : \mathbb { R } ^ { d _ { x } } \times \mathbb { R } ^ { P } $ $\mathbb { R } ^ { d _ { y } }$ , we consider the family of prediction functions parameterised by a weight vector $\pmb { w }$ , i.e., $\mathcal { H } : = \{ h ( \cdot ; w ) : w \in \mathbb { R } ^ { P } \}$ with a given loss $\ell ( h ( \pmb { x } ; \pmb { w } ) , \pmb { y } ) : \mathbb { R } ^ { d _ { x } } \times \mathbb { R } ^ { \tilde { d _ { y } } } \mathbb { R }$ . Ideally we would vary $\pmb { w }$ such that we minimize the loss over our data generating distribution $\psi ( { \pmb x } , { \pmb y } )$ , known as the true risk.
34
+
35
+ $$
36
+ R _ { t r u e } ( { \pmb w } ) = \int _ { { \mathbb R } ^ { d _ { x } } \times { \mathbb R } ^ { d _ { y } } } \ell ( h ( { \pmb x } ; { \pmb w } ) , { \pmb y } ) d \psi ( { \pmb x } , { \pmb y } ) = { \mathbb E } [ \ell ( h ( { \pmb x } ; { \pmb w } ) , { \pmb y } ) ]
37
+ $$
38
+
39
+ with corresponding gradient $\mathbf { \sigma } \mathbf { g } _ { t r u e } ( \mathbf { w } ) = \nabla R _ { t r u e } ( \mathbf { w } )$ and Hessian $\pmb { H } _ { t r u e } ( \pmb { w } ) = \nabla \nabla R _ { t r u e } ( \pmb { w } )$ . If the loss is a negative log likelihood, then the true risk is the expected negative log likelihood per data point under the data generating distribution. However, given a dataset of size $N$ , we only have access to the empirical or full risk
40
+
41
+ $$
42
+ R _ { e m p } ( { \pmb w } ) = \frac { 1 } { N } \sum _ { i = 1 } ^ { N } \ell ( h ( \pmb x _ { i } ; { \pmb w } ) , \pmb y _ { i } )
43
+ $$
44
+
45
+ and the gradients $\mathbf { \mathit { g } } _ { e m p } ( \mathbf { \boldsymbol { w } } )$ and Hessians ${ \pmb { H } } _ { e m p } ( { \pmb { w } } )$ thereof. The Hessian describes the curvature at that point in weight space $\pmb { w }$ and hence the risk surface can be studied through the Hessian. Weight vectors which achieve low values of equation 2 do not necessarily achieve low values of equation 1. Their difference is known as the generalization gap. We rewrite our Empirical Hessian as
46
+
47
+ $$
48
+ { { H } _ { e m p } } ( { \pmb w } ) = { { H } _ { t r u e } } ( { \pmb w } ) + \varepsilon ( { \pmb w } )
49
+ $$
50
+
51
+ where2 $\pmb { \varepsilon } ( \pmb { w } ) \equiv \pmb { H } _ { e m p } ( \pmb { w } ) - \pmb { H } _ { t r u e } ( \pmb { w } )$ . A symmetric matrix with independent normally distributed elements of equal variance is known as the Gaussian Orthogonal Ensemble (GOE) and a matrix with independent non-Gaussian elements of equal variance is known as the Wigner ensemble.
52
+
53
+ # 3.1 FLATNESS AND GENERALIZATION WITH THE EMPIRICAL HESSIAN
54
+
55
+ By the spectral theorem, we can rewrite $H _ { e m p }$ in terms of its eigenvalue, eigenvector pairs, $[ \lambda _ { i } , \phi _ { i } ]$
56
+
57
+ $$
58
+ { \cal H } _ { e m p } = \sum _ { i = 1 } ^ { P } \lambda _ { i } \phi _ { i } \phi _ { i } ^ { T } .
59
+ $$
60
+
61
+ The magnitude of the eigenvalues represent the magnitude of the curvature in the direction of the corresponding eigenvectors. Often the magnitude of the largest eige(given by the square root of the sum of all the eigenvalues squared $\lambda _ { 1 }$ e Frobenius norm, is used to define $( \textstyle \sum _ { i = 1 } ^ { P } \lambda _ { i } ^ { 2 } ) ^ { 1 / 2 } )$ spectrum, also known as the trace $P ^ { - 1 } \textstyle \sum _ { i } ^ { P } \lambda _ { i } ^ { 2 }$ , has also been used (Dinh et al., 2017). In all of these cases a larger value indicates greater sharpness. Other definitions of flatness have looked at counting the number of 0 (Sagun et al., 2016), or close to 0 (Chaudhari et al., 2016), eigenvalues.
62
+
63
+ It is often argued that flat solutions provide better generalization because they are more robust to shifts between the train and test loss surfaces (e.g., Keskar et al., 2016) that exist because of statistical differences between the training and test samples. It is then compelling to understand whether flat solutions associated with the True Hessian would also provide better generalization, since the True Hessian is formed from the full data generating distribution. If so, there may be other important reasons why flat solutions provide better generalization.
64
+
65
+ Reparametrization can give the appearance of flatness or sharpness from the perspective of the Hessian. However, it is common practice to hold the parametrization of the model fixed when comparing the Hessian at different parameter settings, or evaluated over different datasets.
66
+
67
+ # 4 ANALYZING THE TRUE RISK SURFACE USING RANDOM MATRIX THEORY
68
+
69
+ We show that the elementwise difference between the True and Empirical Hessian converges to a zero mean normal random variable, assuming a Lipshitz bounded gradient. Moreover, we derive a precise analytic relationship between the values of the extremal values for both the Empirical and True Hessians, showing the eigenvalues for the Empirical Hessian to be larger in magnitude. This result indicates that the true risk surface is flatter than its empirical counterpart.
70
+
71
+ # 4.1 REGULARITY CONDITIONS
72
+
73
+ We establish some weak regularity conditions on the loss function and data, under which the elements of $\varepsilon ( w )$ converge to zero mean normal random variables.
74
+
75
+ Lemma 1. For an $L$ -Lipshitz-continuous-gradient and almost everywhere twice differentiable loss√ function $\ell ( h ( { \boldsymbol { \mathbf { \mathit { x } } } } ; { \boldsymbol { \mathbf { \mathit { w } } } } ) , { \boldsymbol { \mathbf { \mathit { y } } } } )$ , the True Hessian elements are strictly bounded in the range $- \sqrt { P } L \leq$ $H _ { j , k } \leq \sqrt { P } L$ .
76
+
77
+ Proof. By the fundamental theorem of calculus and the definition of Lipshitz continuity $\lambda _ { m a x } \le L$
78
+
79
+ $$
80
+ \begin{array} { l } { { \displaystyle \mathrm { T r } ( { \pmb H } ^ { 2 } ) = \sum _ { i = 1 } ^ { P } \lambda _ { i } ^ { 2 } = \sum _ { j , k = 1 } ^ { P } H _ { j , k } ^ { 2 } = H _ { j = j ^ { \prime } , k = k ^ { \prime } } ^ { 2 } + \sum _ { j \neq j ^ { \prime } , k \neq k ^ { \prime } } ^ { P } H _ { j , k } ^ { 2 } } } \\ { { \displaystyle \pmb H _ { j = j ^ { \prime } , k = k ^ { \prime } } ^ { 2 } \leq \sum _ { i = 1 } ^ { P } \lambda _ { i } ^ { 2 } \leq P L ^ { 2 } } } \\ { { \displaystyle - \sqrt { P } L \leq H _ { j = j ^ { \prime } , k = k ^ { \prime } } \leq \sqrt { P } L } } \end{array}
81
+ $$
82
+
83
+ Lemma 2. For unbiased independent samples drawn from the data generating distribution and an $L$ -Lipshitz loss $\ell$ the difference between the True Hessian and Empirical Hessian converges element-wise to a zero mean, normal random variable with variance $\propto 1 / N$ .
84
+
85
+ Proof. The difference between the Empirical and True Hessian $\varepsilon ( w )$ is given as
86
+
87
+ $$
88
+ \nabla \nabla R _ { t r u e } ( w ) - \nabla \nabla R _ { e m p } ( w ) ] _ { j k } = \mathbb { E } \frac { \partial ^ { 2 } } { \partial w _ { j } \partial w _ { k } } \ell ( h ( x ; w ) , y ) - \frac { 1 } { N } \sum _ { i = 1 } ^ { N } \frac { \partial ^ { 2 } } { \partial w _ { j } \partial w _ { k } } \ell ( h ( x _ { i } ; w ) , y _ { i } )
89
+ $$
90
+
91
+ By Lemma 1, the Hessian elements are bounded, hence the moments are bounded and using independence and the central limit theorem, equation 6 converges almost surely to a normal random variable $\mathbb { P } ( \mu _ { j k } , \sigma _ { j k } ^ { 2 } / N )$ . □
92
+
93
+ Remark. For finite $P$ and $N \to \infty$ , i.e. $q = P / N \to 0$ , $\lvert \varepsilon ( \pmb { w } ) \rvert 0$ we recover the True Hessian. Similarly in this limit our empirical risk converges almost surely to our true risk, i.e. we eliminate the generalization gap. However, in deep learning typically the network size eclipses the dataset size by orders of magnitude.3
94
+
95
+ # 4.2 A RANDOM MATRIX THEORY APPROACH
96
+
97
+ In order to derive analytic results, we move to the large Dimension limit, where $P , N \to \infty$ but $P / N = q > 0$ and employ the machinery of random matrix theory to derive results for the perturbations on the eigenspectrum between the True Hessian and Empirical Hessian. This differs from the classical statistical regime where $q \to 0$ . We primarily focus on the regime when $q \gg 1$ . In order to make the analysis tractable, we introduce two further assumptions on the nature of the elements $\varepsilon ( w )$ .
98
+
99
+ Assumption 1. The elements of $\varepsilon ( w )$ are identically and independently Gaussian distributed $\mathcal { N } ( 0 , \sigma _ { \epsilon } ^ { \bar { 2 } } )$ up to the Hermitian condition.
100
+
101
+ Assumption 2. ${ \mathbf { } } H _ { t r u e }$ is of low rank $r \ll P$ .
102
+
103
+ Under assumption 1, $\varepsilon ( w )$ becomes a Gaussian Orthogonal Ensemble (GOE) and for the GOE we can prove the following Lemma 3. We discuss the necessity of the assumptions in Section 4.3.
104
+
105
+ Lemma 3. The extremal eigenvalues $[ \lambda _ { 1 } ^ { \prime } , \lambda _ { P } ^ { \prime } ]$ of the matrix sum $A + B / \sqrt { P }$ , where $\pmb { A } \in \mathbb { R } ^ { P \times P }$ is a matrix of finite rank $r$ with extremal eigenvalues $[ \lambda _ { 1 } , \lambda _ { P } ]$ and $\boldsymbol { B } \in \mathbb { R } ^ { P \times P }$ is a GOE matrix with element variance $\sigma _ { \epsilon } ^ { 2 }$ are given by
106
+
107
+ $$
108
+ \lambda _ { 1 } ^ { \prime } = \left\{ \begin{array} { l l } { { \lambda _ { 1 } + \frac { \sigma _ { \epsilon } ^ { 2 } } { \lambda _ { 1 } } , } } & { { i f \lambda _ { 1 } > \sigma _ { \epsilon } } } \\ { { 2 \sigma _ { \epsilon } , } } & { { o t h e r w i s e } } \end{array} \right\} \mathrm { , ~ } { \lambda _ { P } ^ { \prime } } = \left\{ \begin{array} { l l } { { \lambda _ { P } + \frac { \sigma _ { \epsilon } ^ { 2 } } { \lambda _ { n } } , } } & { { i f \lambda _ { n } < - \sigma _ { \epsilon } } } \\ { { - 2 \sigma _ { \epsilon } , } } & { { o t h e r w i s e } } \end{array} \right\}
109
+ $$
110
+
111
+ Proof. See Appendix.
112
+
113
+ Theorem 1. The extremal eigenvalues $[ \lambda _ { 1 } ^ { \prime } , \lambda _ { P } ^ { \prime } ]$ of the matrix sum $H _ { e m p }$ , where $\lambda _ { 1 } ^ { \prime } \ge \lambda _ { 2 } ^ { \prime } . . . \ge \lambda _ { P } ^ { \prime }$ (such that assumptions $^ { l }$ and 2 are satisfied), where $H _ { t r u e }$ has extremal eigenvalues $[ \lambda _ { 1 } , \lambda _ { P } ]$ , are given by
114
+
115
+ $$
116
+ \lambda _ { 1 } ^ { \prime } = \left\{ \begin{array} { l l } { \lambda _ { 1 } + \frac { P } { N } \frac { \sigma _ { \epsilon } ^ { 2 } } { \lambda _ { 1 } } , } & { i f \lambda _ { 1 } > \sqrt { \frac { P } { N } } \sigma _ { \epsilon } } \\ { 2 \sqrt { \frac { P } { N } } \sigma _ { \epsilon } , } & { o t h e r w i s e } \end{array} \right\} \mathrm { , ~ } \lambda _ { P } ^ { \prime } = \left\{ \begin{array} { l l } { \lambda _ { P } + \frac { P } { N } \frac { \sigma _ { \epsilon } ^ { 2 } } { \lambda _ { P } } , } & { i f \lambda _ { P } < - \sqrt { \frac { P } { N } } \sigma _ { \epsilon } } \\ { - 2 \sqrt { \frac { P } { N } } \sigma _ { \epsilon } , } & { o t h e r w i s e } \end{array} \right\} \mathrm { . }
117
+ $$
118
+
119
+ Proof. The result follows directly from Lemmas 2 and 3.
120
+
121
+ Remark. This result shows that the extremal eigenvalues of the Empirical Hessian are larger in magnitude than those of the True Hessian: Although we only state this result for the extremal eigenvalues, it holds for any number of well separated outlier eigenvalues. This spectral broadening effect has already been observed empirically when moving from (larger) training to the (smaller) test set (Papyan, 2018). Intuitively variance of the Empirical Hessian eigenvalues can be seen as the variance of the True Hessian eigenvalues plus the variance of the Hessian, as we show in Appendix F. We also note that if the condition $| \lambda _ { i } | > \sqrt { P / N } \sigma _ { \epsilon }$ is not met, the value of the positive and negative extremal eigenvalues are completely determined by the noise matrix.
122
+
123
+ # 4.3 NOTE ON GENERALIZING ASSUMPTIONS
124
+
125
+ For Assumption 1, we note that the results for the Wigner ensemble (of which the GOE is a special case) can be extended to non-identical element variances (Tao, 2012) and element dependence (Götze et al., 2012; Schenker & Schulz-Baldes, 2005). Hence, similarly to Pennington & Bahri (2017), under extended technical conditions we expect our results to hold more generally. Assumption 2 can be relaxed if the number of extremal eigenvalues is much smaller than $P$ , and the bulk of $\pmb { H } _ { t r u e } ( \pmb { w } )$ ’s eigenspectra also follows a Wigner ensemble which is mutually free with that of $\varepsilon ( w )$ . Furthermore, corrections to our results for finite $P$ scale as $P ^ { - 1 / 4 }$ for matrices with finite 4’th moments and $P ^ { - 2 / 5 }$ for all finite moments (Bai, 2008).
126
+
127
+ # 5 EFFICIENT COMPUTATION OF HESSIAN EIGENVALUES
128
+
129
+ In order to perform spectral analysis on the Hessian of typical neural networks, with tens of millions of parameters, we avoid the infeasible $\mathcal { O } ( P ^ { 3 } )$ eigen-decomposition and use the stochastic Lanczos quadrature (SLQ) algorithm, in conjunction with GPU acceleration. Our procedure in this section is a general-purpose approach for efficiently computing the spectra of large matrices in deep learning.
130
+
131
+ # 5.1 STOCHASTIC LANCZOS QUADRATURE
132
+
133
+ The Lanczos algorithm (Meurant & Strakoš, 2006) is a power iteration algorithm variant which by enforcing orthogonality and storing the Krylov subspace, ${ \ K } _ { m + 1 } ( H , v ) \stackrel { - } { = } \{ v , H v , . . , H ^ { m } v \}$ , optimally approximates the extremal and interior eigenvalues (known as Ritz values). It requires Hessian vector products, for which we use the Pearlmutter trick (Pearlmutter, 1994) with computational cost $\mathcal { O } ( N P )$ , where $N$ is the dataset size and $P$ is the number of parameters. Hence for $m$ steps the total computational complexity including re-orthogonalisation is $\mathcal { O } ( N P m )$ and memory cost of $\mathcal { O } ( P m )$ . In order to obtain accurate spectral density estimates we re-orthogonalise at every step (Meurant & Strakoš, 2006). We exploit the relationship between the Lanczos method and Gaussian quadrature, using random vectors to allow us to learn a discrete approximation of the spectral density. A quadrature rule is a relation of the form,
134
+
135
+ $$
136
+ \int _ { a } ^ { b } f ( \lambda ) d \mu ( \lambda ) = \sum _ { j = 1 } ^ { M } \rho _ { j } f ( t _ { j } ) + R [ f ]
137
+ $$
138
+
139
+ for a function $f$ , such that its Riemann-Stieltjes integral and all the moments exist on the measure $d \mu ( \lambda )$ , on the interval $[ a , b ]$ and where $R [ f ]$ denotes the unknown remainder. The nodes $t _ { j }$ of the Gauss quadrature rule are given by the Ritz values and the weights (or mass) $\rho _ { j }$ by the squares of the
140
+
141
+ first elements of the normalized eigenvectors of the Lanczos tri-diagonal matrix (Golub & Meurant, 1994). For zero mean, unit variance random vectors, using the linearity of trace and expectation
142
+
143
+ $$
144
+ \mathbb { E } _ { v } \mathrm { T r } ( v ^ { T } H ^ { m } v ) = \mathrm { T r } \mathbb { E } _ { v } ( v v ^ { N } H ^ { m } ) = \mathrm { T r } ( H ^ { m } ) = \sum _ { i = 1 } ^ { P } \lambda _ { i } ^ { m } = P \int _ { \lambda \in \mathcal { D } } \lambda ^ { m } d \mu ( \lambda )
145
+ $$
146
+
147
+ hence the measure on the LHS of equation 9 corresponds to that of the underlying spectral density. The error between the expectation over the set of all zero mean, unit variance vectors $v$ and the Monte Carlo sum used in practice can be bounded (Hutchinson, 1990; Roosta-Khorasani & Ascher, 2015), but the bounds are too loose to be of any practical value (Granziol $\&$ Roberts, 2017). However, in the high dimensional regime $N \to \infty$ , we expect the squared overlap of each random vector with an eigenvector of $\pmb { H }$ , $\begin{array} { r } { | \pmb { v } ^ { T } \pmb { \phi } _ { i } | ^ { 2 } \approx \frac { 1 } { P } \forall i } \end{array}$ , with high probability (Cai et al., 2013). This result can be seen intuitively by looking at the normalized overlap squared between two random Rademacher vectors, where each element is drawn from the distribution $\pm 1$ with equal probability, which gives $1 / P$ . The Lanczos algorithm can also be easily parallelized, since it largely involves matrix multiplications — a major advantage for computing eigenvalues of large matrices in deep learning. We exploit GPU parallelization in performing Lanczos (Gardner et al., 2018), for significant acceleration.
148
+
149
+ # 5.2 WHY TO AVOID MULTIPLE RANDOM VECTORS AND KERNEL SMOOTHING
150
+
151
+ In recent work using SLQ for evaluating neural network spectra (Papyan, 2018; Ghorbani et al., 2019), the Hessian vector product is averaged over a set of random vectors, typically $\approx 1 0$ . The resulting discrete moment matched approximation to the spectra in equation 9 is smoothed using a Gaussian kernel $\mathcal { N } ( \lambda _ { i } , \sigma ^ { 2 } )$ . The use of multiple random vectors can be seen as reducing the variance of the vector overlap in a geometric equivalent of the central limit theorem. Whilst this may be desirable for general spectra, if we believe the spectra to be composed of outliers and a bulk as is empirically observed (Sagun et al., 2016; 2017), then the same self-averaging procedure happens with the bulk. We converge to the spectral outliers quickly using the Lanczos algorithm, as shown in the Appendix by the known convergence theorem 3. Hence all the spectral information we need can be gleaned from a single random vector. Furthermore, it has been proven that kernel smoothing biases the moment information obtained by the Lanczos method (Granziol et al., 2018). We hence avoid smoothing (and the problem of choosing $\sigma$ ), along with the $\approx 1 0 \times$ increased computational cost, by plotting the discrete spectral density implied by equation 9 for a single random vector, in the form of a stem plot.
152
+
153
+ # 5.3 WEAKNESSES OF STOCHASTIC LANCZOS QUADRATURE
154
+
155
+ It is possible to determine what fraction of eigenvalues is near the origin by evaluating the weight of the Ritz value(s) closest to the origin. But due to the discrete nature of the Ritz values, which give the nodes of the associated moment-matched spectral density in equation 9, it is not possible to see exactly whether the Hessian of neural networks is rank degenerate. It is also not possible to exactly determine what fraction of eigenvalues are negative. Furthermore, smoothing the density and using quadrature has the problems discussed in Section 5.2. Instead, we determine the fraction of negative eigenvalues as the weight of negative Ritz values which are well separated from the smallest magnitude Ritz value(s), to avoid counting a split of the degenerate mass.
156
+
157
+ # 6 EXPERIMENTS
158
+
159
+ In order to test the validity of our theoretical results in Section 4.2, we control the parameter $q = P / N$ by applying data-augmentation and then running GPU powered Lanczos method (Gardner et al., 2018) on the augmented dataset at the final set of weights ${ \pmb w } _ { f i n a l }$ at the end of the training procedure. We use random horizontal flips, $4 \times 4$ padding with zeros and random $3 2 \times 3 2$ crops. We neglect the dependence of the augmented dataset on the input dataset in our analysis, but we would expect the effective number of data points $N _ { e f f } < N$ due to degeneracy in the samples. For the Emprical Hessian, we use the full training and test dataset $N = 5 0 , 0 0 0$ with no augmentation. We use PyTorch (Paszke et al., 2017). We train a 110 layer pre-activated ResNet (He et al., 2016) neural network architecture on CIFAR-10 and CIFAR-100 using SGD with momentum set at $\rho = 0 . 9$ and data-augmentation. We include further plots and detail the training procedure for the VGG-16 (Simonyan & Zisserman, 2014) in Appendix I.
160
+
161
+ ![](images/5bb2e84f2242668bc9ed01c6fc518bbb060346cd6decbebc2d6f69f937be60cd.jpg)
162
+ Figure 1: Empirical Hessian spectrum for CIFAR-100 SGD.
163
+
164
+ ![](images/5d0f168d0374da5af04f1a721e45476a1a38b8fc9e2bb239dc1bfe085af1a60c.jpg)
165
+ Figure 2: Empirical Hessian spectrum for CIFAR-10 SGD.
166
+
167
+ In order to investigate whether empirically observed phenomena for the Empirical Hessian such as sharp minima generalizing more poorly than their flatter counterparts also hold for the True Hessian, we run two slightly different SGD decayed learning rate schedules (equation 11) on a 110-Layer ResNet (Izmailov et al., 2018).
168
+
169
+ $$
170
+ \alpha _ { t } = \left\{ \begin{array} { l l } { \alpha _ { 0 } , } & { \mathrm { i f ~ } \frac { t } { T } \leq 0 . 5 } \\ { \alpha _ { 0 } [ 1 - \frac { ( 1 - r ) ( \frac { t } { T } - 0 . 5 ) } { 0 . 4 } ] } & { \mathrm { i f ~ } 0 . 5 < \frac { t } { T } \leq 0 . 9 } \\ { \alpha _ { 0 } r , } & { \mathrm { o t h e r w i s e } } \end{array} \right.
171
+ $$
172
+
173
+ For both schedules we use $r = 0 . 0 1$ . For the Normal schedule we use $\alpha _ { 0 } = 0 . 1$ and $T = 2 2 5$ whereas for the Overfit schedule we use $\alpha _ { 0 } = 0 . 0 0 1$ and $T = 1 0 0 0$ .
174
+
175
+ We plot the training curves in the Appendices B, C and include the best training and test accuracies and losses, along with the extremal eigenvalues of the Empirical Hessian and Augmented Hessian in Table 1 for CIFAR-100 and Table 2 for CIFAR-10. The Normal schedule achieves a best test accuracy of [77.24/95.32] on CIFAR-100/CIFAR-10 respectively and best training accuracy of [99.85/99.98]. The Overfit schedule achieves a best test accuracy of [56.85/86.46] on CIFAR-100/CIFAR-10 respectively and best training accuracy of [99.62/99.91].
176
+
177
+ We then run SLQ with $m = 1 0 0$ on the final set of training weights to compute an approximation to the spectrum for both schedules on the full 50, 000 training set (i.e the Empirical Hessian) and with $m = 8 0$ on an augmented 1, 500, 000 data-set as a proxy for the True Hessian, which we denote the Augmented Hessian. The 110-Layer ResNet has $1 , \dot { 1 6 9 } , 9 7 2 / 1$ , 146, 842 parameters for CIFAR-100/CIFAR-10 respectively, hence for both we have $q < 1$ . We primarily comment on the extremal eigenvalues of the Augmented Hessian and their deviation from those of the Empirical Hessian. We also investigate the spectral density at the origin and the change in negative spectral mass. A sharp drop in negative spectral mass, indicates due to Theorem 1 that most of the negative spectral mass is due to the perturbing GOE.
178
+
179
+ # 6.1 NORMAL SGD SCHEDULE - EMPIRICAL AND AUGMENTED HESSIAN ANALYSIS
180
+
181
+ ![](images/b4265b9d860fbe25264ec6a3341bb18cdae72b5a53fd5eb4c0b32c5ec51536cc.jpg)
182
+ Figure 3: Augmented 1, 500, 000 data Hessian spectrum for CIFAR-10 SGD.
183
+
184
+ ![](images/9231310ea16fcbb99c3049d27d644ed8ed86d70af631e82d11591db288522317.jpg)
185
+ Figure 4: Augmented 1, 500, 000 data Hessian spectrum for CIFAR-100 SGD.
186
+
187
+ We plot the Empirical Hessian spectrum for the end of training for CIFAR-100 in Figure 1 and the Augmented Hessian in Figure 4. We plot the same discrete spectral density plots for the Empirical Hessian for CIFAR-10 in Figure 2 and the Augmented Hessian in Figure 3. We note that the effects predicted by Theorem 1 are empirically supported by the differences between the Empirical and Augmented Hessian. For CIFAR-100 the extremal eigenvalues shrink from $[ - 6 . 5 4 , 2 0 . 5 6 ]$ (Figure 1) for the full dataset to $[ - 0 . 0 1 4 , 3 . 0 2 6 ]$ (Figure 4) for the Augmented dataset. The Empirical Hessian has $4 3 / 1 0 0$ negative Ritz values with a negative spectral mass total of 0.05. The Augmented Hessian has $5 / 8 0$ negative Ritz values with total negative spectral mass of 0.00016. For CIFAR-10 the extremal eigenvalues shrink from $[ - 1 . 3 7 4 , 6 . 8 2 1 ]$ (Figure 2) to $\left[ - 0 . 0 0 6 1 , 0 . 5 8 2 5 \right]$ (Figure 3). The fraction of negative Ritz values shrinks from 35/100 with total weight 0.09 to $3 / 8 { \bar { 0 } }$ with total mass 0.03.
188
+
189
+ ![](images/b96a135e987912969494a7dd84d70b5efd52b4cef74561b4b3b256f6ff69fcfa.jpg)
190
+ 6.2 OVERFITTING SGD SCHEDULE - EMPIRICAL AND AUGMENTED HESSIAN ANALYSIS
191
+ Figure 5: Empirical Hessian Spectrum C100 OverFit SGD.
192
+
193
+ ![](images/0cda033932dd635ed68276280a826d2056e7ebb69a5bcf6fac626488b2fa8349.jpg)
194
+ Figure 6: Empirical Hessian Spectrum C10 OverFit SGD.
195
+
196
+ As can be seen from the spectral plots of the full Hessians for both CIFAR-100 and CIFAR-10 in Figures 6 & 5, and their respective Augmented Hessian 7 & 8, we also observe extreme spectral shrinkage, with the largest eigenvalue decreasing from [281.32, 184.4] to [45.68, 15.6] and the smallest increasing from $[ - 7 . 3 3 , - 2 . 9 ]$ to $[ 2 \times 1 0 ^ { - 5 } , - 9 \times 1 0 ^ { - 4 } ]$ respectively for CIFAR-100/CIFAR10. We note that despite reasonably extreme spectral shrinkage, the sharpest values of the Overfit schedule augmented Hessians are still significantly larger than those of the Normal schedule, hence the intuition of sharp minima generalizing poorly still holds for the True Hessian. The fraction of negative Ritz values for the Empirical Hessian is $4 3 / 1 0 0$ , with relative negative spectral mass of 0.032. For the Augmented Hessian, the number of negative Ritz values is 0. For the CIFAR10 Overfit Augmented Hessian, there is one negative Ritz value very close to the origin with a large relative spectral mass 0.086, hence it could also be part of the spectral peak at the origin.
197
+
198
+ ![](images/08901dee5460feb25bc9c4c37aa4380eb6bde782b323ee8b37b9563e7dec8aca.jpg)
199
+
200
+ ![](images/08b06bcc0e48e5b5e0fdf3af60ed9d4b5704fb2e5a490da50d34e47d33686cfc.jpg)
201
+ Figure 7: Augmented Data 1, 500, 000 Hessian Spectrum C100 OverFit SGD.
202
+ Figure 8: Augmented Data 1, 500, 000 Hessian Spectrum C10 OverFit SGD.
203
+
204
+ # 6.3 RANK DEGENERACY AND RIGHT SKEW
205
+
206
+ The vast majority of eigen-directions of the Augmented Hessian are, like those of the Empirical Hessian, locally extremely close to flat. We show this by looking at the 3 Ritz values of largest weight for all learning rate schedules and datasets, shown in Table 3. The majority of the spectral bulk is carried by the 3 closest weights $( \approx 0 . 9 9 )$ to the origin for all learning rate schedules and datasets. In instances (CIFAR-100 SGD OverFit) where it looks like the largest weight has been reduced, the second largest weight (which is close in spectral distance) is amplified massively.
207
+
208
+ We further note that, as we move from the $q \gg 1$ regime to $q < 1$ , we move from having a symmetric to right skew bulk. Both have a significant spike near the origin. This experimentally corroborates the result derived in (Pennington & Bahri, 2017), where under normality of weights, inputs and further assumptions the symmetric bulk is given by the Wigner semi-circle law and the right skew bulk is given by the Marcenko-Pastur. The huge spectral peak near the origin, indicates that the result lies in a low effective dimension.
209
+
210
+ For all Augmented spectra, the negative spectral mass shrinks drastically and we see for the Overfit Schedule for CIFAR-100 that there is no spectral mass below 0 and for CIFAR-10 there is one negative Ritz value (and 79 positive). This Ritz value $\lambda _ { n } = - 0 . 0 0 0 9 3$ has a weight of $\rho = 0 . 0 8 5$ compared to the largest spike at $\lambda = 0 . 0 0 0 1$ with weight 0.889, hence we cannot rule out that both values belong to a true spectral peak at the origin.
211
+
212
+ # 7 DISCUSSION
213
+
214
+ The geometric properties of loss landscapes in deep learning have a profound effect on generalization performance. We introduced the True Hessian to investigate the difference between the landscapes for the true and empirical loss surfaces. We derived analytic forms for the perturbation between the extremal eigenvalues of the True and Empirical Hessians, modelling the difference between the two as a Gaussian Orthogonal Ensemble. Moreover, we developed a method for fast eigenvalue computation and visualization, which we used in conjunction with data augmentation to approximate the True Hessian spectrum.
215
+
216
+ We show both theoretically and empirically that the True Hessian has smaller variation in eigenvalues and that its extremal eigenvalues are smaller in magnitude than the Empirical Hessian. We also show under our framework that we expect the Empirical Hessian to have a greater negative spectral density than the True Hessian and our experiments support this conclusion. This result may provide some insight as to why first order (curvature blind) methods perform so well on neural networks. Reported non-convexity and pathological curvature is far worse for the empirical risk than the true risk, which is what we wish to descend.
217
+
218
+ The shape of the true risk is particularly crucial for understanding how to develop effective procedures for Bayesian deep learning. With a Bayesian approach, we not only want to find a single point that optimizes a risk, but rather to integrate over a loss surface to form a Bayesian model average. The geometric properties of the loss surface, rather than the specific location of optima, therefore greatly influences the predictive distribution in a Bayesian procedure. Furthermore, the posterior representation for neural network weights with popular approaches such as the Laplace approximation has curvature directly defined by the Hessian.
219
+
220
+ In future work, one could also replace the GOE noise matrix $\varepsilon ( w )$ with a positive semi-definite white Wishart kernel in order to derive results for the empirical Gauss-Newton and Fisher information matrices, which are by definition positive semi-definite and are commonly employed in second order deep learning (Martens & Grosse, 2015). Our approach to efficient eigenvalue computation and visualization can be used as a general-purpose tool to empirically investigate spectral properties of large matrices in deep learning, such as the Fisher information matrix.
221
+
222
+ # REFERENCES
223
+
224
+ Zhi Dong Bai. Convergence rate of expected spectral distributions of large random matrices part i: Wigner matrices. In Advances In Statistics, pp. 60–83. World Scientific, 2008.
225
+
226
+ Jinho Baik and Jack W Silverstein. Eigenvalues of large sample covariance matrices of spiked population models. arXiv preprint math/0408165, 2004.
227
+
228
+ Alex Bloemendal, Antti Knowles, Horng-Tzer Yau, and Jun Yin. On the principal components of sample covariance matrices. Probability theory and related fields, 164(1-2):459–552, 2016a.
229
+
230
+ Alex Bloemendal, Bálint Virág, et al. Limits of spiked random matrices ii. The Annals of Probability, 44(4):2726–2769, 2016b.
231
+
232
+ Joël Bun, Jean-Philippe Bouchaud, and Marc Potters. Cleaning large correlation matrices: tools from random matrix theory. Physics Reports, 666:1–109, 2017.
233
+
234
+ Tony Cai, Jianqing Fan, and Tiefeng Jiang. Distributions of angles in random packing on spheres. The Journal of Machine Learning Research, 14(1):1837–1864, 2013.
235
+
236
+ Pratik Chaudhari, Anna Choromanska, Stefano Soatto, Yann LeCun, Carlo Baldassi, Christian Borgs, Jennifer Chayes, Levent Sagun, and Riccardo Zecchina. Entropy-SGD: Biasing gradient descent into wide valleys. arXiv preprint arXiv:1611.01838, 2016.
237
+
238
+ Anna Choromanska, Mikael Henaff, Michael Mathieu, Gérard Ben Arous, and Yann LeCun. The loss surfaces of multilayer networks. In Artificial Intelligence and Statistics, pp. 192–204, 2015a.
239
+
240
+ Anna Choromanska, Yann LeCun, and Gérard Ben Arous. Open problem: The landscape of the loss surfaces of multilayer networks. In Conference on Learning Theory, pp. 1756–1760, 2015b.
241
+
242
+ Laurent Dinh, Razvan Pascanu, Samy Bengio, and Yoshua Bengio. Sharp minima can generalize for deep nets. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pp. 1019–1028. JMLR. org, 2017.
243
+
244
+ Richard Everson and Stephen Roberts. Inferring the eigenvalues of covariance matrices from limited, noisy data. IEEE transactions on signal processing, 48(7):2083–2091, 2000.
245
+
246
+ Jacob Gardner, Geoff Pleiss, Kilian Q Weinberger, David Bindel, and Andrew G Wilson. Gpytorch: Blackbox matrix-matrix Gaussian process inference with GPU acceleration. In Advances in Neural Information Processing Systems, pp. 7576–7586, 2018.
247
+
248
+ Timur Garipov, Pavel Izmailov, Dmitrii Podoprikhin, Dmitry P Vetrov, and Andrew G Wilson. Loss surfaces, mode connectivity, and fast ensembling of DNNs. In Advances in Neural Information Processing Systems, pp. 8789–8798, 2018.
249
+
250
+ Behrooz Ghorbani, Shankar Krishnan, and Ying Xiao. An investigation into neural net optimization via Hessian eigenvalue density. arXiv preprint arXiv:1901.10159, 2019.
251
+
252
+ Gene H Golub and Gérard Meurant. Matrices, moments and quadrature. Pitman Research Notes in Mathematics Series, pp. 105–105, 1994.
253
+
254
+ Gene H Golub and Charles F Van Loan. Matrix computations, volume 3. JHU press, 2012.
255
+
256
+ Friedrich Götze, A Naumov, and A Tikhomirov. Semicircle law for a class of random matrices with dependent entries. arXiv preprint arXiv:1211.0389, 2012.
257
+
258
+ Diego Granziol and Stephen J. Roberts. Entropic determinants of massive matrices. In 2017 IEEE International Conference on Big Data, BigData 2017, Boston, MA, USA, December 11-14, 2017, pp. 88–93, 2017.
259
+
260
+ Diego Granziol, Binxin Ru, Stefan Zohren, Xiaowen Dong, Michael Osborne, and Stephen Roberts. Entropic spectral learning for large-scale graphs. arXiv preprint arXiv:1804.06802, 2018.
261
+
262
+ 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.
263
+
264
+ Sepp Hochreiter and Jürgen Schmidhuber. Flat minima. Neural Computation, 9(1):1–42, 1997.
265
+
266
+ Michael F Hutchinson. A stochastic estimator of the trace of the influence matrix for Laplacian smoothing splines. Communications in Statistics-Simulation and Computation, 19(2):433–450, 1990.
267
+
268
+ Pavel Izmailov, Dmitrii Podoprikhin, Timur Garipov, Dmitry Vetrov, and Andrew Gordon Wilson. Averaging weights leads to wider optima and better generalization. arXiv preprint arXiv:1803.05407, 2018.
269
+
270
+ Stanisław Jastrz˛ebski, Zachary Kenton, Devansh Arpit, Nicolas Ballas, Asja Fischer, Yoshua Bengio, and Amos Storkey. Three factors influencing minima in SGD. arXiv preprint arXiv:1711.04623, 2017.
271
+
272
+ Stanisław Jastrz˛ebski, Zachary Kenton, Nicolas Ballas, Asja Fischer, Yoshua Bengio, and Amos Storkey. On the relation between the sharpest directions of DNN loss and the SGD step length. 2018.
273
+
274
+ Iain M Johnstone and Arthur Yu Lu. Sparse Principal Components Analysis. Unpublished manuscript, 7, 2004.
275
+
276
+ 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.
277
+
278
+ Frederik Kunstner, Lukas Balles, and Philipp Hennig. Limitations of the empirical Fisher approximation. arXiv preprint arXiv:1905.12558, 2019.
279
+
280
+ Laurent Laloux, Pierre Cizeau, Jean-Philippe Bouchaud, and Marc Potters. Noise dressing of financial correlation matrices. Physical review letters, 83(7):1467, 1999.
281
+
282
+ Olivier Ledoit and Michael Wolf. A well-conditioned estimator for large-dimensional covariance matrices. Journal of multivariate analysis, 88(2):365–411, 2004.
283
+
284
+ Hao Li, Zheng Xu, Gavin Taylor, and Tom Goldstein. Visualizing the loss landscape of neural nets. arXiv preprint arXiv:1712.09913, 2017.
285
+
286
+ David JC MacKay. Bayesian methods for adaptive models. PhD thesis, California Institute of Technology, 1992.
287
+
288
+ David JC MacKay. Information theory, inference and learning algorithms. Cambridge university press, 2003.
289
+
290
+ James Martens and Roger Grosse. Optimizing neural networks with Kronecker-factored approximate curvature. In International conference on machine learning, pp. 2408–2417, 2015.
291
+
292
+ Gérard Meurant and Zdenek Strakoš. The Lanczos and conjugate gradient algorithms in finite ˇ precision arithmetic. Acta Numerica, 15:471–542, 2006.
293
+
294
+ Yurii Nesterov. Introductory lectures on convex optimization: A basic course, volume 87. Springer Science & Business Media, 2013.
295
+
296
+ Vardan Papyan. The full spectrum of deep net Hessians at scale: Dynamics with sample size. arXiv preprint arXiv:1811.07062, 2018.
297
+
298
+ 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.
299
+
300
+ Barak A Pearlmutter. Fast exact multiplication by the Hessian. Neural computation, 6(1):147–160, 1994.
301
+
302
+ Jeffrey Pennington and Yasaman Bahri. Geometry of neural network loss surfaces via random matrix theory. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pp. 2798–2806. JMLR. org, 2017.
303
+
304
+ Farbod Roosta-Khorasani and Uri Ascher. Improved bounds on sample size for implicit matrix trace estimators. Foundations of Computational Mathematics, 15(5):1187–1212, 2015.
305
+
306
+ Levent Sagun, Léon Bottou, and Yann LeCun. Eigenvalues of the Hessian in deep learning: Singularity and beyond. arXiv preprint arXiv:1611.07476, 2016.
307
+
308
+ Levent Sagun, Utku Evci, V Ugur Guney, Yann Dauphin, and Leon Bottou. Empirical analysis of the Hessian of over-parametrized neural networks. arXiv preprint arXiv:1706.04454, 2017.
309
+
310
+ Jeffrey H Schenker and Hermann Schulz-Baldes. Semicircle law and freeness for random matrices with symmetries or correlations. arXiv preprint math-ph/0505003, 2005.
311
+
312
+ Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014.
313
+
314
+ Terence Tao. Topics in random matrix theory, volume 132. American Mathematical Soc., 2012.
315
+
316
+ Lei Wu, Zhanxing Zhu, et al. Towards understanding generalization of deep learning: Perspective of loss landscapes. arXiv preprint arXiv:1706.10239, 2017.
317
+
318
+ Zhewei Yao, Amir Gholami, Qi Lei, Kurt Keutzer, and Michael W Mahoney. Hessian-based analysis of large batch training and robustness to adversaries. In Advances in Neural Information Processing Systems, pp. 4949–4959, 2018.
319
+
320
+ A TABLE SUMMARIES
321
+
322
+ <table><tr><td>Schedule</td><td>X</td><td></td><td>1XnIX1|n</td><td></td><td>Test Acc</td><td>Train Acc |Test Loss</td><td></td><td>|Train Loss</td></tr><tr><td>Normal</td><td>20.56</td><td>-6.54</td><td>3.025</td><td>-0.014</td><td>77.24</td><td>99.85</td><td>0.99</td><td>0.021</td></tr><tr><td>Overfit</td><td>281.32</td><td>-7.33</td><td>45.68</td><td>2×10-5</td><td>56.85</td><td>99.62</td><td>1.85</td><td>0.026</td></tr></table>
323
+
324
+ Table 1: CIFAR-100 statistics table including extremal eigenvalues of the Empirical Hessian $[ \lambda _ { 1 } ^ { \prime } , \lambda _ { n } ^ { \prime } ]$ , the True Hessian $[ \lambda _ { 1 } , \lambda _ { n } ]$ and test/train accuracies and losses.
325
+
326
+ Table 2: CIFAR-10 statistics table including extremal eigenvalues of the Empirical Hessian $[ \lambda _ { 1 } ^ { \prime } , \lambda _ { n } ^ { \prime } ]$ , the True Hessian $[ \lambda _ { 1 } , \lambda _ { n } ]$ and test/train accuracies and losses
327
+
328
+ <table><tr><td>Schedule</td><td>x</td><td></td><td>IXn|X1Iλn</td><td></td><td>Test Acc</td><td>Train Acc</td><td>Test Loss</td><td>Train Loss</td></tr><tr><td>Normal</td><td>6.82</td><td>-1.37</td><td>3.025</td><td>-0.014</td><td>95.32</td><td>99.98</td><td>0.18</td><td>0.0034</td></tr><tr><td>Overfit</td><td>184.4</td><td>-2.9</td><td>15.6</td><td>-9×10-4</td><td>86.46</td><td>99.91</td><td>1.85</td><td>0.026</td></tr></table>
329
+
330
+ <table><tr><td>LearningSchedule&amp;DataSet</td><td>[po,入o]</td><td>[p1,入1]</td><td>[p2,入2]</td></tr><tr><td>CIFAR-100 SGD Normal</td><td>[0.92,0.0014]</td><td>[0.05,-0.03]</td><td>[0.018,0.06]</td></tr><tr><td>CIFAR-100 SGD Normal (Augmented)</td><td>[0.84,0.0017]</td><td>[0.1,-0.0007]</td><td>[0.045,0.003]</td></tr><tr><td>CIFAR-1O SGD Normal</td><td>[0.88,0.007]</td><td>[0.085,-0.01]</td><td>[0.023,0.02]]</td></tr><tr><td>CIFAR-10 SGD Normal (Augmented)</td><td>[0.88,-3.87e-6]</td><td>[0.073,0.0006]</td><td>[0.03,-0.0007]</td></tr><tr><td>CIFAR-100 SGD Overfit</td><td>[0.65,-0.026]</td><td>[0.34,0.05]</td><td>[0.006,0.58]</td></tr><tr><td>CIFAR-100 SGD Overfit (Augmented)</td><td>[0.86,1.67e-5]</td><td>[0.1,0.0039]</td><td>[0.019,0.018]</td></tr><tr><td>CIFAR-10 SGD Overfit</td><td>[0.77,0.01]</td><td>[0.22,-0.04]</td><td>[0.005,0.32]</td></tr><tr><td>CIFAR-10 SGD Overfit (Augmented)</td><td>[0.89,0.00013]</td><td>[0.086,-0.00094]</td><td>[0.016,0.0058]</td></tr></table>
331
+
332
+ Table 3: Largest 3 weight Ritz values for different learning schedules and datasets. $[ \rho _ { i } , \lambda _ { i } ]$ denotes the weight and corresponding eigenvalue $\rho _ { 0 } \geq \rho _ { 1 } . . . . \geq \rho _ { P }$ .
333
+
334
+ # B SGD TRAINING CURVES
335
+
336
+ ![](images/fb6c5293d851837d8df903bb7827379f619c32c8767ffb0d411bcacba849d02a.jpg)
337
+ Figure 9: SGD CIFAR-100 training and test curves
338
+
339
+ ![](images/410045f6d0313a74b5b28ad21894926f7d21dd220041a9e871361eee6b96c17c.jpg)
340
+ Figure 10: SGD CIFAR-10 training and test curves
341
+
342
+ # C OVERFIT TRAINING CURVES
343
+
344
+ ![](images/ec9dc619449359a5b3bb5528fffce0504cd07f00ca2050cbf5696fc46e266c96.jpg)
345
+ Figure 11: OverFitSGD CIFAR-100 training and test curves
346
+
347
+ ![](images/8c04f110fbce5b62ea96d6d1f38e07d6004e720df3406623d98e539d5545c8f6.jpg)
348
+ Figure 12: OverFitSGD CIFAR-10 training and test curves
349
+
350
+ # D RANDOM MATRIX THEORY
351
+
352
+ Following the notation of (Bun et al., 2017) the resolvent of a matrix $H$ is defined as
353
+
354
+ $$
355
+ G _ { H } ( z ) = ( z I _ { N } - H ) ^ { - 1 }
356
+ $$
357
+
358
+ with $z = x + i \eta \in \mathbb { C }$ . The normalised trace operator of the resolvent, in the $N \to \infty$ limit
359
+
360
+ $$
361
+ { \cal S } _ { N } ( z ) = \frac { 1 } { N } \mathrm { T r } [ G _ { H } ( z ) ] \xrightarrow { N \infty } { \cal S } ( z ) = \int \frac { \rho ( u ) } { z - u } d u
362
+ $$
363
+
364
+ is known as the Stieltjes transform of $\rho$ . The functional inverse of the Siteltjes transform, is denoted the blue function $\boldsymbol { B } ( \boldsymbol { S } ( z ) ) = \boldsymbol { z }$ . The $\mathbf { R }$ transform is defined as
365
+
366
+ $$
367
+ \mathcal { R } ( w ) = B ( w ) - \frac { 1 } { w }
368
+ $$
369
+
370
+ crucially for our calculations, it is known that the $\mathcal { R }$ transform of the Wigner ensemble is
371
+
372
+ $$
373
+ \mathcal { R } _ { W } ( z ) = \sigma ^ { 2 } z
374
+ $$
375
+
376
+ Definition D.1. Let $\{ Y _ { i } \}$ and $\{ Z _ { i j } \} _ { 1 \leq i \leq j }$ be two real-valued families of zero mean, i.i.d random variables, Furthermore suppose that $\mathbb { E } Z _ { 1 2 } ^ { 2 } = 1$ and for each $k \in \mathbb N$
377
+
378
+ $$
379
+ m a x ( E | Z _ { 1 2 } ^ { k } , E | Y _ { 1 } | ^ { k } ) < \infty
380
+ $$
381
+
382
+ Consider an $n \times n$ symettric matrix $M _ { n }$ , whose entries are given by
383
+
384
+ $$
385
+ \begin{array} { r } { \left\{ \begin{array} { l l } { M _ { n } ( i , i ) = Y _ { i } } \\ { M _ { n } ( i , j ) = Z _ { i j } = M _ { n } ( j , i ) , } & { i f x \geq 1 } \end{array} \right. } \end{array}
386
+ $$
387
+
388
+ The Matrix $M _ { n }$ is known as a real symmetric Wigner matrix.
389
+
390
+ Theorem 2. Let $\{ M _ { n } \} _ { n = 1 } ^ { \infty }$ be a sequence of Wigner matrices, and for each $n$ denote $X _ { n } = M _ { n } / \sqrt { n }$ Then $\mu _ { X _ { n } }$ , converges weakly, almost surely to the semi circle distribution,
391
+
392
+ $$
393
+ \sigma ( x ) d x = \frac { 1 } { 2 \pi } \sqrt { 4 - x ^ { 2 } } { \bf 1 } _ { | x | \leq 2 }
394
+ $$
395
+
396
+ the property of freeness for non commutative random matrices can be considered analogously to the moment factorisation property of independent random variables. The normalized trace operator, which is equal to the first moment of the spectral density
397
+
398
+ $$
399
+ \psi ( H ) = \frac { 1 } { N } \mathrm { T r } H = \frac { 1 } { N } \sum _ { i = 1 } ^ { N } \lambda _ { i } = \int _ { \lambda \in \mathcal { D } } d \mu ( \lambda ) \lambda
400
+ $$
401
+
402
+ We say matrices $A \& B$ for which $\psi ( A ) = \psi ( B ) = 0 ^ { 4 }$ are free if they satisfy for any integers $n _ { 1 } . . n _ { k }$ with $\dot { k } \in \mathbb { N } ^ { + }$
403
+
404
+ $$
405
+ \psi ( A ^ { n _ { 1 } } B ^ { n _ { 2 } } A ^ { n _ { 3 } } B ^ { n _ { 4 } } ) = \psi ( A ^ { n _ { 1 } } ) \psi ( B ^ { n _ { 2 } } ) \psi ( A ^ { n _ { 3 } } ) \psi ( A ^ { n _ { 4 } } )
406
+ $$
407
+
408
+ # E DERIVATION
409
+
410
+ The Stijeles transform of Wigners semi circle law, can be written as (Tao, 2012)
411
+
412
+ $$
413
+ \mathcal { S } _ { W } ( z ) = \frac { z \pm \sqrt { z ^ { 2 } - 4 \sigma ^ { 2 } } } { 2 \sigma ^ { 2 } }
414
+ $$
415
+
416
+ from the definition of the Blue transform, we hence have
417
+
418
+ $$
419
+ \begin{array} { l } { \displaystyle z = \frac { | \mathcal { B } _ { W } ( z ) \pm \sqrt { | \mathcal { B } _ { W } ^ { 2 } ( z ) - 4 \sigma ^ { 2 } } } { 2 \sigma ^ { 2 } } } \\ { \displaystyle ( 2 \sigma ^ { 2 } z - \mathcal { B } _ { W } ( z ) ) ^ { 2 } = \mathcal { B } _ { W } ^ { 2 } ( z ) - 4 \sigma ^ { 2 } } \\ { \displaystyle . . \mathcal { B } _ { W } ( z ) = \frac { 1 } { z } + \sigma ^ { 2 } z } \\ { \displaystyle . . . \mathcal { R } _ { W } ( z ) = \sigma ^ { 2 } z } \end{array}
420
+ $$
421
+
422
+ 4We can always consider the transform $A - \psi ( A ) I$
423
+
424
+ Computing the $\mathcal { R }$ transform of the rank 1 matrix $H _ { t r u e }$ , with largest non-trivial eigenvalue $\beta$ , on the effect of the spectrum of a matrix $A$ , using the Stieltjes transform we easily find following (Bun et al., 2017) that
425
+
426
+ $$
427
+ \mathcal { S } _ { H _ { t r u e } } ( u ) = \frac { 1 } { N } \frac { 1 } { u - \beta } + \bigg ( 1 - \frac { 1 } { N } \bigg ) \frac { 1 } { u } = \frac { 1 } { u } \bigg [ 1 + \frac { 1 } { N } \frac { \beta } { 1 - u ^ { - 1 } \beta } \bigg ]
428
+ $$
429
+
430
+ We can use perturbation theory similar to in equation equation 22 to find the blue transform which to leading order gives
431
+
432
+ $$
433
+ \begin{array} { l } { \displaystyle B _ { H _ { t r u e } } ( \omega ) = \frac { 1 } { w } + \frac { \beta } { N ( 1 - \omega \beta ) } + \mathcal { O } ( N ^ { - 2 } ) } \\ { \displaystyle \mathcal { R } _ { H _ { t r u e } } ( \omega ) = \frac { \beta } { N ( 1 - \omega \beta ) } + \mathcal { O } ( N ^ { - 2 } ) } \end{array}
434
+ $$
435
+
436
+ setting $\omega = S _ { M } ( z )$
437
+
438
+ $$
439
+ z = \mathcal { B } _ { H _ { t r u e } } ( \mathcal { S } _ { M } ( z ) ) + \frac { \beta } { N ( 1 - \beta \mathcal { S } _ { M } ( z ) ) } + \mathcal { O } ( N ^ { - 2 } )
440
+ $$
441
+
442
+ using the ansatz of $\begin{array} { r } { S _ { M } ( z ) = S _ { 0 } ( z ) + \frac { S _ { 1 } ( z ) } { N } + \mathcal { O } ( N ^ { - 2 } ) } \end{array}$ we find that $S _ { 0 } ( z ) = S _ { \epsilon ( w ) } ( z )$ and using that $B _ { M } ^ { \prime } ( z ) = 1 / g ^ { \prime } ( z )$ , we conclude that
443
+
444
+ $$
445
+ S _ { 1 } ( z ) = - \frac { \beta { S ^ { \prime } } _ { \epsilon ( w ) } ( z ) } { 1 - { S _ { \epsilon ( w ) } } ( z ) \beta }
446
+ $$
447
+
448
+ and hence
449
+
450
+ $$
451
+ \mathcal { S } _ { M } ( z ) \approx { \cal S } _ { \epsilon ( w ) } ( z ) - \frac { 1 } { N } \frac { \beta { \cal S } ^ { \prime } { } _ { \epsilon ( w ) } ( z ) } { 1 - { \cal S } _ { \epsilon ( w ) } ( z ) \beta }
452
+ $$
453
+
454
+ and hence in the large $N$ limit the correction only survives if $S _ { \epsilon ( w ) } ( z ) = 1 / \beta$
455
+
456
+ $$
457
+ \begin{array} { l } { \displaystyle \mathcal { S } _ { \epsilon ( w ) } ( z ) = \frac 1 \beta } \\ { \displaystyle \frac { 2 \sigma ^ { 2 } } \beta = z \pm \sqrt { z ^ { 2 } - 4 \sigma ^ { 2 } } } \\ { \displaystyle \cdot \cdot z = \beta + \frac { \sigma ^ { 2 } } \beta } \end{array}
458
+ $$
459
+
460
+ clearly for $\beta - \beta$ we have
461
+
462
+ $$
463
+ z = - \beta - \frac { \sigma ^ { 2 } } { \beta }
464
+ $$
465
+
466
+ # F AN INTUITIVE EXPLANATION OF THE KEY RESULT
467
+
468
+ An extensive linear algebraic and geometric discussion about spectral broadening for sample covariance matrices can be found in (Ledoit & Wolf, 2004) and whilst the Hessian is not a covariance matrix (the generalized Gauss-Newton or Fisher matrices can be seen as a co-variance of gradients), identical arguments will hold here 5. The dispersion of the Empirical Hessian eigenvalues around their mean will equal the dispersion of the True Hessian eigenvalues around their mean plus the variance of the Empirical Hessian (from its true value), which is in general $> 0$ . Our theoretical assumptions in sections 4.1 and 4.2 allow us to derive analytic results for this broadening. Our assumptions are significantly stricter than those in (Ledoit & Wolf, 2004) and hence automatically fulfil their requirements.
469
+
470
+ # G LANCZOS ALGORITHM
471
+
472
+ In order to empirically analyse properties of modern neural network spectra with tens of millions of parameters $N { \dot { = } } O ( { \dot { 1 } } 0 ^ { 7 } )$ , we use the Lanczos algorithm (Meurant & Strakoš, 2006) with Hessian vector products using the Pearlmutter trick (Pearlmutter, 1994) with computational cost $\mathcal { O } ( N T m )$ , where $N$ is the dataset size and $m$ is the number of Lanczos steps. The main properties of the Lanczos algorithm are summarized in the theorems 3,4
473
+
474
+ Theorem 3. Let $H ^ { N \times N }$ be a symmetric matrix with eigenvalues $\lambda _ { 1 } \geq . . \geq \lambda _ { n }$ and corresponding orthonormal eigenvectors $z _ { 1 } , . . . z _ { n }$ . If $\theta _ { 1 } \ge . . \ge \theta _ { m }$ are the eigenvalues of the matrix $T _ { m }$ obtained after m Lanczos steps and $q _ { 1 } , . . . q _ { k }$ the corresponding Ritz eigenvectors then
475
+
476
+ $$
477
+ \begin{array} { r l } & { \lambda _ { 1 } \geq \theta _ { 1 } \geq \lambda _ { 1 } - \frac { \left( \lambda _ { 1 } - \lambda _ { n } \right) \tan ^ { 2 } ( \theta _ { 1 } ) } { \left( c _ { k - 1 } ( 1 + 2 \rho _ { 1 } ) \right) ^ { 2 } } } \\ & { \lambda _ { n } \leq \theta _ { k } \leq \lambda _ { m } + \frac { \left( \lambda _ { 1 } - \lambda _ { n } \right) \tan ^ { 2 } ( \theta _ { 1 } ) } { \left( c _ { k - 1 } ( 1 + 2 \rho _ { 1 } ) \right) ^ { 2 } } } \end{array}
478
+ $$
479
+
480
+ where $c _ { k }$ is the chebyshev polyomial of order $k$
481
+
482
+ Proof: see (Golub & Van Loan, 2012).
483
+
484
+ Theorem 4. The eigenvalues of $T _ { k }$ are the nodes $t _ { j }$ of the Gauss quadrature rule, the weights $w _ { j }$ are the squares of the first elements of the normalized eigenvectors of $T _ { k }$
485
+
486
+ Proof: See (Golub & Meurant, 1994). The first term on the RHS of equation 9 using Theorem 4 can be seen as a discrete approximation to the spectral density matching the first $m$ moments $v ^ { T } H ^ { m } v$ (Golub & Meurant, 1994; Golub & Van Loan, 2012), where $v$ is the initial seed vector. Using the expectation of quadratic forms, for zero mean, unit variance random vectors, using the linearity of trace and expectation
487
+
488
+ $$
489
+ \mathbb { E } _ { v } \mathrm { T r } ( v ^ { T } H ^ { m } v ) = \mathrm { T r } \mathbb { E } _ { v } ( v v ^ { T } H ^ { m } ) = \mathrm { T r } ( H ^ { m } ) = \sum _ { i = 1 } ^ { N } \lambda _ { i } = N \int _ { \lambda \in \mathcal { D } } \lambda d \mu ( \lambda )
490
+ $$
491
+
492
+ The error between the expectation over the set of all zero mean, unit variance vectors $v$ and the monte carlo sum used in practice can be bounded (Hutchinson, 1990; Roosta-Khorasani $\&$ Ascher, 2015). However in the high dimensional regime $N \infty$ , we expect the squared overlap of each random vector with an eigenvector of $H$ , $\begin{array} { r } { | v ^ { \tilde { T } } \phi _ { i } | ^ { 2 } \approx \frac { 1 } { N } \forall i } \end{array}$ , with high probability. This result can be seen by computing the moments of the overlap between Rademacher vectors, containing elements $P ( v _ { j } = \pm 1 ) \bar { = } 0 . \bar { 5 }$ . Further analytical results for Gaussian vectors have been obtained (Cai et al., 2013).
493
+
494
+ ![](images/6026c0c0c3b946d2427662f48b7c1a225f836d17e9df935ea7c4398131c42f3d.jpg)
495
+ Figure 13: Augmented CIFAR-100 PreResNet 110 Eigenspectrum Epoch 300, 5 million samples and $m = 1 0$ Lanczos steps
496
+
497
+ ![](images/bdc207d10bd48fe7db7b34bf2c72b5834f5a17e4b6f1814d8ec78ff27a5a780d.jpg)
498
+ Figure 14: CIFAR-100 PreResNet110 0’th epoch full dataspectrum
499
+
500
+ ![](images/fde7d0055e212fd75408cbe6ab51c3563ab9151d49a2917c684dfa607f9baf0a.jpg)
501
+ Figure 15: CIFAR-100 PreResNet110 25’th epoch full dataspectrum
502
+
503
+ ![](images/e6c15f9e5691fb4dd1f1ed60949481fe9ea976e86be3684f68c6eb77a7671729.jpg)
504
+ Figure 16: CIFAR-100 PreResNet110 50’th epoch full dataspectrum
505
+
506
+ ![](images/b9b08eea21e983b017d117076d9c6af00e3e7dcbde585e96f5ff53a590b5077a.jpg)
507
+ Figure 17: CIFAR-100 PreResNet110 75’th epoch full dataspectrum
508
+
509
+ ![](images/11f1479091a690986327cfaf366c5efb309e057aac6861e70bae1fd77a9b9db8.jpg)
510
+ Figure 18: CIFAR-100 PreResNet110 125’th epoch full dataspectrum
511
+
512
+ ![](images/57fe1223d6f278dc3796a7a14611b009713fbc34a78f176f91c83b683d8ed22d.jpg)
513
+ Figure 19: CIFAR-100 PreResNet110 150’th epoch full dataspectrum
514
+
515
+ ![](images/afe2925918b15a9e333f048a6b91673e9910afc7fabeea5e69009713ad671d9f.jpg)
516
+ Figure 20: CIFAR-100 PreResNet110 150’th epoch full dataspectrum
517
+
518
+ # I SPECTRAL PLOTS - CIFAR-100 VGG16BN
519
+
520
+ The number of Parameters in the $V G G - 1 6$ network is $P = 1 5 2 9 1 3 0 0$ so our augmentation procedure is unable to probe the limit $q < 1$ . The training procedure is identical to the PreResNet except for an initial learning rate of 0.05 and $T = 3 0 0$ epochs. Here we also see a reduction in both extremal eigenvalues.
521
+
522
+ ![](images/d60db58dabb7e1c87975bb9c50932f8c684b454c8459aa1291df8eb72d7c064a.jpg)
523
+ Figure 21: CIFAR-100 VGG16BN 300’th epoch full dataspectrum
524
+
525
+ ![](images/575d8598373589b5e2d197bf114df49264ce6c06e02bf449a7d1d3899c4527bb.jpg)
526
+ Figure 22: Augmented CIFAR-100 VGG16BN Eigenspectrum Epoch 300, 5 million samples and $m = 1 0$ Lanczos steps
527
+
528
+ ![](images/2239d4658efa3dc08c678c07376b2210a02d1c4f366d831c710aa19a8ca2e9a5.jpg)
529
+ Figure 23: CIFAR-100 VGG16BN 0’th epoch full dataspectrum
530
+
531
+ ![](images/d73602c1e0d5ccd28a8c6681124a23dfbe06f241ef626059083494045e9a6470.jpg)
532
+ Figure 24: CIFAR-100 VGG16BN 25’th epoch full dataspectrum
533
+
534
+ ![](images/672e2743049c1977bc55c86dd5c670c54561f456e9b2dafd43e62b8f7b78591c.jpg)
535
+ Figure 25: CIFAR-100 VGG16BN 50’th epoch full dataspectrum
536
+
537
+ ![](images/3014b202c6a64ebf6ca0b4619d21b10412ba5b9fdb1a7e4011b830237cf83fc6.jpg)
538
+ Figure 26: CIFAR-100 VGG16BN 75’th epoch full dataspectrum
539
+
540
+ ![](images/004a431561754a11f7c5e03049009972a421dfbcaaa0520c860090e89d888034.jpg)
541
+ Figure 27: CIFAR-100 VGG16BN 125’th epoch full dataspectrum
542
+
543
+ ![](images/a2a03664e44334ebf13b41b3c3632c69de85d1d65384f50476081257bb966ebe.jpg)
544
+ Figure 28: CIFAR-100 VGG16BN 150’th epoch full dataspectrum
545
+
546
+ ![](images/5b39611c3e922c127fcdca23dc2e251a6409ccdc155dee82950d2dbf7ef13e8d.jpg)
547
+ Figure 29: CIFAR-100 VGG16BN 150’th epoch full dataspectrum
548
+
549
+ ![](images/d3399e2569b99997ee9c7e154a2ec1e6a520a7920cfc7e38bcea1bad01982e82.jpg)
550
+ Figure 30: CIFAR-10 PreResNet110 50’th epoch full dataspectrum
551
+
552
+ ![](images/72175fc64c6ce09231e905b6cdc34e6a117f970a069b531d3197e36e1707d1b2.jpg)
553
+ Figure 31: CIFAR-10 PreResNet110 300’th epoch full dataspectrum
554
+
555
+ ![](images/4712ff343ea1673972b701d6aeeb6a0e4ed32a8b09dfcabfd5458c14b94891df.jpg)
556
+ Figure 32: CIFAR-10 VGG16BN 0’th epoch full dataspectrum
557
+
558
+ ![](images/9347f7b51f3c5670b74fdd45d9b7e999e461609abe1acc78bf7bc99fcd2aa1a4.jpg)
559
+ Figure 33: CIFAR-10 VGG16BN 300’th epoch full dataspectrum
parse/train/H1gza2NtwH/H1gza2NtwH_content_list.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/H1gza2NtwH/H1gza2NtwH_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/H1gza2NtwH/H1gza2NtwH_model.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/HyxAfnA5tm/HyxAfnA5tm.md ADDED
@@ -0,0 +1,333 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # DEEP ONLINE LEARNING VIA META-LEARNING:CONTINUAL ADAPTATION FOR MODEL-BASED RL
2
+
3
+ Anusha Nagabandi, Chelsea Finn & Sergey Levine University of California, Berkeley {nagaban2,cbfinn,svlevine}@berkeley.edu
4
+
5
+ # ABSTRACT
6
+
7
+ Humans and animals can learn complex predictive models that allow them to accurately and reliably reason about real-world phenomena, and they can adapt such models extremely quickly in the face of unexpected changes. Deep neural network models allow us to represent very complex functions, but lack this capacity for rapid online adaptation. The goal in this paper is to develop a method for continual online learning from an incoming stream of data, using deep neural network models. We formulate an online learning procedure that uses stochastic gradient descent to update model parameters, and an expectation maximization algorithm with a Chinese restaurant process prior to develop and maintain a mixture of models to handle non-stationary task distributions. This allows for all models to be adapted as necessary, with new models instantiated for task changes and old models recalled when previously seen tasks are encountered again. Furthermore, we observe that meta-learning can be used to meta-train a model such that this direct online adaptation with SGD is effective, which is otherwise not the case for large function approximators. In this work, we apply our meta-learning for online learning (MOLe) approach to model-based reinforcement learning, where adapting the predictive model is critical for control; we demonstrate that MOLe outperforms alternative prior methods, and enables effective continuous adaptation in non-stationary task distributions such as varying terrains, motor failures, and unexpected disturbances. Videos available at: https://sites.google.com/berkeley.edu/onlineviameta
8
+
9
+ # 1 INTRODUCTION
10
+
11
+ Human and animal learning is characterized not just by a capacity to acquire complex skills, but also the ability to adapt rapidly when those skills must be carried out under new or changing conditions. For example, animals can quickly adapt to walking and running on different surfaces (Herman, 2017) and humans can easily modulate force during reaching movements in the presence of unexpected perturbations (Flanagan & Wing, 1993). Furthermore, these experiences are remembered, and can be recalled to adapt more quickly when similar disturbances occur in the future (Doyon & Benali, 2005). Since learning entirely new models on such short time-scales is impractical, we can devise algorithms that explicitly train models to adapt quickly from small amounts of data. Such online adaptation is crucial for intelligent systems operating in the real world, where changing factors and unexpected perturbations are the norm. In this paper, we propose an algorithm for fast and continuous online learning that utilizes deep neural network models to build and maintain a task distribution, allowing for the natural development of both generalization as well as task specialization.
12
+
13
+ Our working example is continuous adaptation in the model-based reinforcement learning setting, though our approach generally addresses any online learning scenario with streaming data. We assume that each “trial” consists of multiple tasks, and that the delineation between the tasks is not provided explicitly to the learner – instead, the method must adaptively decide what “tasks” even represent, when to instantiate new tasks, and when to continue updating old ones. For example, a robot running over changing terrain might need to handle uphill and downhill slopes, and might choose to maintain separate models that become specialized to each slope, adapting to each one in turn based on the currently inferred surface.
14
+
15
+ We perform adaptation simply by using online stochastic gradient descent (SGD) on the model parameters, while maintaining a mixture model over model parameters for different tasks. The mixture is updated via the Chinese restaurant process (Stimberg et al., 2012), which enables new tasks to be instantiated as needed over the course of a trial. Although online learning is perhaps one of the oldest applications of SGD (Bottou, 1998), modern parametric models such as deep neural networks are exceedingly difficult to train online with this method. They typically require mediumsized minibatches and multiple epochs to arrive at sensible solutions, which is not suitable when receiving data in an online streaming setting. One of our key observations is that meta-learning can be used to learn a prior initialization for the parameters that makes such direct online adaptation feasible, with only a handful of gradient steps. The meta-training procedure we use is based on model-agnostic meta-learning (MAML) (Finn et al., 2017), where a prior weight initialization is learned for a model so as to optimize improvement on any task from a meta-training task distribution after a small number of gradient steps.
16
+
17
+ Meta-learning with MAML has previously been extended to model-based RL (Nagabandi et al., 2018), but only for the $k$ -shot adaptation setting: The meta-learned prior model is adapted to the $k$ most recent time steps, but the adaptation is not carried forward in time (i.e., adaptation is always performed from the prior itself). This rigid batch-mode setting is restrictive in an online learning setup and is insufficient for tasks that are further outside of the training distribution. A more natural formulation is one where the model receives a continuous stream of data and must adapt online to a potentially non-stationary task distribution. This requires both fast adaptation and the ability to recall prior tasks, as well as an effective adaptation strategy to interpolate as needed between the two.
18
+
19
+ The primary contribution of this paper is a meta-learning for online learning (MOLe) algorithm that uses expectation maximization, in conjunction with a Chinese restaurant process prior on the task distribution, to learn mixtures of neural network models that are each updated with online SGD. In contrast to prior multi-task and meta-learning methods, our method’s online assignment of soft task probabilities allows for task specialization to emerge naturally, without requiring task delineations to be specified in advance. We evaluate MOLe in the context of model-based RL on a suite of challenging simulated robotic tasks including disturbances, environmental changes, and simulated motor failures. Our simulated experiments show a half-cheetah agent and a hexapedal crawler robot performing continuous model adaptation in an online setting. Our results show online instantiation of new tasks, the ability to adapt to out-of-distribution tasks, and the ability to recognize and revert back to prior tasks. Additionally, we demonstrate that MOLe outperforms a state-of-the-art prior method that does $k$ -shot model-based meta-RL, as well as natural baselines such as continuous gradient updates for adaptation and online learning without meta-training.
20
+
21
+ # 2 RELATED WORK
22
+
23
+ Online learning is one of the oldest subfields of machine learning (Bottou, 1998; Jafari et al., 2001). Prior algorithms have used online gradient updates (Duchi et al., 2011) and probabilistic filtering formulations (Murphy, 2002; Hoffman et al., 2010; Broderick et al., 2013). In principle, commonly used gradient-based learning methods, such as SGD, can easily be used as online learning algorithms (Bottou, 1998). In practice, their performance with deep neural network function approximators is limited (Sahoo et al., 2017): such high-dimensional models must be trained with batch-mode methods, minibatches, and multiple passes over the data. We aim to lift this restriction by using model-agnostic meta-learning (MAML) to explicitly pretrain a model that enables fast adaptation, which we then use for continuous online adaptation via an expectation maximization algorithm with a Chinese restaurant process (Blei et al., 2003) prior for dynamic allocation of new tasks in a non-stationary task distribution.
24
+
25
+ Online learning is related to that of continual or lifelong learning (Thrun, 1998), where the agent faces a non-stationary distribution of tasks over time. However, unlike works that focus on avoiding negative transfer, i.e. catastrophic forgetting (Kirkpatrick et al., 2017; Rebuffi et al., 2017; Zenke et al., 2017; Lopez-Paz et al., 2017; Nguyen et al., 2017), online learning focuses on the ability to rapidly learn and adapt in the presence of non-stationarity. While some continual learning works consider the problem of forward transfer, e.g. Rusu et al. (2016); Aljundi et al. (2017); Wang et al. (2017), these works and others in continual learning generally focus on small sets of tasks where fast, online learning is not realistically possible, since there are simply not enough tasks to recover structure that enables fast, few-shot learning in new tasks or environments.
26
+
27
+ Our approach builds on techniques for meta-learning or learning-to-learn (Thrun & Pratt, 1998; Schmidhuber, 1987; Bengio et al., 1992; Naik & Mammone, 1992). However, most recent metalearning work considers a setting where one task is learned at a time, often from a single batch of data (Santoro et al., 2016; Ravi & Larochelle, 2017; Munkhdalai & Yu, 2017; Wang et al., 2016; Duan et al., 2016). In our work, we specifically address non-stationary task distributions and do not assume that task boundaries are known. Concurrent work (Anonymous, 2019) has used a mixture model at the level of the prior parameters, considering non-stationarity at the meta-level, whereas we use a mixture model to model the task-specific parameters to perform online learning only during run-time. Other meta-learning works have considered non-stationarity within a task (Al-Shedivat et al., 2017) and episodes involving multiple tasks at meta-test time (Ritter et al., 2018), but they do not consider continual online adaptation with unknown task separation. Prior work has also studied meta-learning for model-based RL (Nagabandi et al., 2018). This prior method updates the model every time step, but each update is a batch-mode $k$ -shot update, using exactly $k$ prior transitions and resetting the model at each step. This allows for adaptive control, but does not enable continual online adaptation, since updates from previous steps are always discarded. In our comparisons, we find that our approach substantially outperforms this prior method. To our knowledge, our work is the first to apply meta-learning to learn streaming online updates.
28
+
29
+ # 3 PROBLEM STATEMENT
30
+
31
+ We formalize our online learning problem setting as follows: at each time step, the model receives an input $\mathbf { x } _ { t }$ and produces a prediction $\hat { \mathbf { y } } _ { t }$ . It then receives a ground truth label $\mathbf { y } _ { t }$ , which must be used to adapt the model to increase its prediction accuracy on the next input $\mathbf { x } _ { t + 1 }$ . The true labels are assumed to come from some task distribution $P ( Y _ { t } | X _ { t } , T _ { t } )$ , where $T _ { t }$ is the task at time $t$ . The tasks themselves change over time, resulting in a non-stationary task distribution, and the identity of the task $T _ { t }$ is unknown to the learner. In real-world settings, tasks might correspond to unknown parameters of the system (e.g., motor malfunction on a robot), user preferences, or other unexpected events. This problem statement covers a range of online learning problems that all require continual adaptation to streaming data and trading off between generalization and specialization.
32
+
33
+ In our experiments, we use model-based RL as our working example, where the input $\mathbf { x } _ { t }$ is a stateaction pair, and the output $\mathbf { y } _ { t }$ is the next state. We discuss this application to model-based RL in Section 6, but we keep the following derivation of our method general for the case of arbitrary online prediction problems.
34
+
35
+ # 4 ONLINE LEARNING WITH MIXTURE OF META-TRAINED NETWORKS
36
+
37
+ We discuss our meta-learning for online learning (MOLe) algorithm in two parts: online learning in this section, and meta-learning in the next. In this section, we explain our online learning method that enables effective online learning using a continuous stream of incoming data from a non-stationary task distribution. We aim to retain generalization so as to not lose past knowledge, as well as gain specialization, which is particularly important for learning new tasks that are further out-ofdistribution and require more learning. We discuss the process of obtaining a meta-learned prior in Sec. 5, but we first formulate in this section an online adaptation algorithm using SGD with expectation maximization to maintain and adapt a mixture model over task model parameters (i.e., a probabilistic task distribution).
38
+
39
+ # 4.1 METHOD OVERVIEW
40
+
41
+ Let $p _ { \theta ( T _ { t } ) } ( \mathbf { y } _ { t } | \mathbf { x } _ { t } )$ represent the predictive distribution of our model on input $\mathbf { x } _ { t }$ , for an unknown task $T _ { t }$ . Our goal is to estimate model parameters $\theta _ { t } ( T )$ for each task $T$ in the non-stationary task distribution: This requires inferring the distribution over tasks at each step $P ( T _ { t } | \mathbf x _ { t } , \mathbf y _ { t } )$ , using that distribution to make predictions $\hat { \mathbf y } _ { t } = p _ { \theta ( T _ { t } ) } ( \mathbf y _ { t } | \mathbf x _ { t } )$ , and also using it to update each model from $\theta _ { t } ( T )$ to $\theta _ { t + 1 } ( T )$ . In practice, the parameters $\theta ( T )$ of each model will correspond to the weights of a neural network $f _ { \theta ( T ) }$ .
42
+
43
+ Each model begins with some prior parameter vector $\theta ^ { * }$ , which we will discuss in more detail in Section 5. Since the number of tasks is also unknown, we begin with one task at time step 0, where $\theta _ { 0 } ( T ) = \{ \theta _ { 0 } ( T _ { 0 } ) \} = \{ \theta ^ { * } \}$ . From here, we continuously update all parameters in $\theta _ { t } ( T )$ and add new tasks as needed, in the attempt to model the true underlying process $P ( Y _ { t } | X _ { t } , T _ { t } )$ . Since task identities are unknown, we must also estimate $P ( T _ { t } )$ at each time step. Thus, the online learning problem consists of adapting each $\theta _ { t } ( T _ { i } )$ at each time step $t$ according to the inferred task probabilities $P ( T _ { t } = T _ { i } | \mathbf x _ { t } , \mathbf y _ { t } )$ . To do this, we adapt the expectation maximization (EM) algorithm and optimize the expected log-likelihood, given by
44
+
45
+ $$
46
+ \mathcal { L } = E _ { T _ { t } \sim P ( T _ { t } | \mathbf { x } _ { t } , \mathbf { y } _ { t } ) } [ \log p _ { \theta _ { t } ( T _ { t } ) } ( \mathbf { y } _ { t } | \mathbf { x } _ { t } , T _ { t } ) ] ,
47
+ $$
48
+
49
+ where we use $\theta _ { t } ( T _ { t } )$ to denote the model parameters corresponding to task $T _ { t }$ . Finally, to handle the unknown number of tasks, we employ the Chinese restaurant process to instantiate new tasks as needed.
50
+
51
+ # 4.2 APPROXIMATE ONLINE INFERENCE
52
+
53
+ We use expectation maximization (EM) to update the model parameters. In our case, the $\mathrm { E }$ step in EM involves estimating the task distribution $P ( T _ { t } = T _ { i } | \mathbf { x } _ { t } , \mathbf { \bar { y } } _ { t } )$ at the current time step, while the M step involves updating all model parameters from $\theta _ { t } ( T )$ to obtain the new model parameters $\theta _ { t + 1 } ( T )$ . The parameters are always updated by one gradient step per time step, according to the inferred task responsibilities.
54
+
55
+ We first estimate the expectations over all task parameters $T _ { i }$ in the task distribution, where the posterior of each task probability can be written as follows:
56
+
57
+ $$
58
+ P ( T _ { t } = T _ { i } | \mathbf { x } _ { t } , \mathbf { y } _ { t } ) \propto p _ { \theta _ { t } ( T _ { i } ) } ( \mathbf { y } _ { t } | \mathbf { x } _ { t } , T _ { t } = T _ { i } ) P ( T _ { t } = T _ { i } ) .
59
+ $$
60
+
61
+ We then formulate the task prior $P ( T _ { t } = T _ { i } )$ using a Chinese restaurant process (CRP) to enable new tasks to be instantiated during a trial. The CRP is an instantiation of a Dirichlet process. In the CRP, at time $t$ , the probability of each task $T _ { i }$ should be given by
62
+
63
+ $$
64
+ P ( T _ { t } = T _ { i } ) = \frac { n _ { T _ { i } } } { t - 1 + \alpha }
65
+ $$
66
+
67
+ where $n _ { T _ { i } }$ is the expected number of datapoints in task $T _ { i }$ for all steps $1 , \ldots , t - 1$ , and $\alpha$ is a hyperparameter that controls the instantiation of new tasks. The prior therefore becomes
68
+
69
+ $$
70
+ P ( T _ { t } = T _ { i } ) = \frac { \sum _ { t ^ { \prime } = 1 } ^ { t - 1 } P ( T _ { t ^ { \prime } } = T _ { i } ) } { t - 1 + \alpha } \quad \mathrm { a n d } \quad P ( T _ { t } = T _ { \mathrm { n e w } } ) = \frac { \alpha } { t - 1 + \alpha }
71
+ $$
72
+
73
+ Combining the prior and likelihood, we derive the following posterior task probability distribution:
74
+
75
+ $$
76
+ P ( T _ { t } = T _ { i } | \mathbf { x } _ { t } , \mathbf { y } _ { t } ) \propto p _ { \theta _ { t } ( T _ { i } ) } ( \mathbf { y } _ { t } | \mathbf { x } _ { t } , T _ { t } = T _ { i } ) \left[ \sum _ { t ^ { \prime } = 1 } ^ { t - 1 } P ( T _ { t ^ { \prime } } = T _ { i } ) + \delta ( T _ { t ^ { \prime } } = T _ { \mathrm { n e w } } ) \alpha \right]
77
+ $$
78
+
79
+ Having estimated the latent task probabilities, we next perform the $\mathbf { M }$ step, which improves the expected log-likelihood in Equation 1 based on the inferred task distribution. Since each task starts from the prior $\theta ^ { * }$ , the values of all parameters in $\theta _ { t } ( T )$ after one gradient update are given by
80
+
81
+ $$
82
+ \theta _ { t + 1 } ( T _ { i } ) = \theta ^ { * } - \beta \sum _ { t ^ { \prime } = 0 } ^ { t } P _ { t } ( T _ { t ^ { \prime } } = T _ { i } | \mathbf { x } _ { t ^ { \prime } } , \mathbf { y } _ { t ^ { \prime } } ) \nabla _ { \theta _ { t ^ { \prime } } ( T _ { i } ) } \log p _ { \theta _ { t ^ { \prime } } ( T _ { i } ) } ( \mathbf { y } _ { t ^ { \prime } } | \mathbf { x } _ { t ^ { \prime } } ) \quad \forall T _ { i }
83
+ $$
84
+
85
+ If we assume that all parameters of $\theta _ { t } ( T )$ have already been updated for the previous time steps $0 , \ldots , t$ , we can approximate this update by simply updating all parameters $\theta _ { t } ( T )$ on the newest data:
86
+
87
+ $$
88
+ \begin{array} { r l } { \theta _ { t + 1 } ( T _ { i } ) = \theta _ { t } ( T _ { i } ) - \beta P _ { t } ( T _ { t } = T _ { i } | \mathbf { x } _ { t } , \mathbf { y } _ { t } ) \nabla _ { \theta _ { t } ( T _ { i } ) } \log p _ { \theta _ { t } ( T _ { i } ) } ( \mathbf { y } _ { t } | \mathbf { x } _ { t } ) } & { \forall T _ { i } } \end{array}
89
+ $$
90
+
91
+ This procedure is an approximation, since updates to task parameters $\theta _ { t } ( T )$ will in reality also change the corresponding task probabilities at previous time steps. However, this approximation removes the need to store previously seen data points and yields a fully online, streaming algorithm. Finally, to fully implement the EM algorithm, we must alternate the $\mathrm { E }$ and $\mathbf { M }$ steps to convergence at each time step, rolling back the previous gradient update to $\theta _ { t } ( T )$ at each iteration. In practice, we found it sufficient to perform the E and $\mathbf { M }$ steps only once per time step. While this is a crude simplification, successive time steps in the online learning scenario are likely to be correlated, making this procedure reasonable. However, it is also straightforward to perform multiple steps of EM while still remaining fully online.
92
+
93
+ We now summarize this full online learning portion of MOLe, and we also outline it in Alg. 1. At the first time step $t = 0$ , the task distribution is initialized to contain one entry: $\theta _ { 0 } ( T ) = \{ \theta _ { 0 } ( T _ { 0 } ) \} = \{ \theta ^ { * } \}$ . At every time step after that, an E step is performed to estimate the task distribution and an $\mathbf { M }$ step is performed to update the model parameters. The CRP prior also assigns, at each time step, the probability of adding a new task $T _ { \mathrm { n e w } }$ at the given time step. The parameters $\theta _ { t + 1 } \big ( T _ { \mathrm { n e w } } \big )$ of this new task are adapted from $\theta ^ { * }$ on the latest data. The prediction on the next datapoint is then made using the model parameters $\theta _ { t + 1 } ( T ^ { * } )$ corresponding to the most likely task $T ^ { * }$ .
94
+
95
+ Algorithm 1 Online Learning with Mixture of Meta
96
+ Trained Networks
97
+ Require: $\theta ^ { * }$ from meta-training Initialize $t = 0$ , $\theta _ { 0 } ( T ) = \{ \bar { \theta _ { 0 } ( T _ { 0 } ) } \} = \{ \theta ^ { * } \}$ for each time step $t$ do Calculate $p _ { \theta _ { t } ( T _ { i } ) } ( \mathbf { y } _ { t } | \mathbf { x } _ { t } , T _ { t } = T _ { i } ) \ \forall T _ { i }$ Calculate $P _ { t } ( T _ { i } ) = P _ { t } ( T _ { t } = T _ { i } | \mathbf { x } _ { t } , \mathbf { y } _ { t } ) \ \forall T _ { i }$ Calculate $\theta _ { t + 1 } ( T _ { i } )$ by adapting from $\theta _ { t } ( T _ { i } ) \ \forall T _ { i }$ Calculate $\theta _ { t + 1 } \big ( T _ { \mathrm { n e w } } \big )$ by adapting from $\theta ^ { * }$ if $P _ { t } ( T _ { \mathrm { n e w } } ) > P _ { t } ( T _ { i } ) \ \forall T _ { : }$ then Add $\theta _ { t + 1 } \big ( T _ { \mathrm { n e w } } \big )$ to $\theta _ { t + 1 } ( T )$ Recalculate $P _ { t } ( T _ { i } )$ using $\theta _ { t + 1 } ( T _ { i } ) \ \forall T _ { i }$ Recalculate $\theta _ { t + 1 } ( T _ { i } )$ using updated $P _ { t } ( T _ { i } ) \ \forall T _ { i }$ end if $\begin{array} { r } { T ^ { * } = \mathrm { a r g m a x } _ { T _ { i } } \ p _ { \theta _ { t + 1 } ( T _ { i } ) } ( \mathbf { y } _ { t } | \mathbf { x } _ { t } , T _ { t } = T _ { i } ) } \end{array}$ iReceive next data point $\mathbf { x } _ { t + 1 }$ end for
98
+
99
+ # 5 META-LEARNING THE PRIOR
100
+
101
+ We formulated an algorithm above for performing online adaptation using continually incoming data. For this method, we choose to meta-train the prior using the model-agnostic meta-learning (MAML) algorithm. This meta-training algorithm is an appropriate choice, because it results in a prior that is specifically intended for gradient-based fine-tuning. Before we further discuss our choice in meta-training procedure, we first give an overview of MAML and meta-learning in general.
102
+
103
+ Given a distribution of tasks, a meta-learning algorithm produces a learning procedure, which can, in some cases, quickly adapt to a new task. MAML optimizes for an initialization of a deep network that achieves good few-shot task generalization when fine-tuned using a few datapoints from that task. At train time, MAML sees small amounts of data from large numbers of tasks, where data $\mathcal { D } _ { T }$ from each task $T$ can be split into training and validation subsets ( ${ \mathcal { D } } _ { T } ^ { \mathrm { t r } }$ and $\mathcal { D } _ { T } ^ { \mathrm { v a l } }$ ), where ${ \mathcal { D } } _ { T } ^ { \mathrm { t r } }$ is of size $k$ . MAML optimizes for model parameters $\theta$ such that one or more gradients steps on ${ \mathcal { D } } _ { T } ^ { \mathrm { t r } }$ results in a minimaand the loss oss wil $L$ on orr $\mathcal { D } _ { T } ^ { \mathrm { v a l } }$ . In our case, we will set nd to negative log likelihoo ${ \mathcal D } _ { T _ { t } } ^ { \mathrm { t r } } = ( { \bf x } _ { t } , { \bf y } _ { t } )$ and t allo $\mathcal { D } _ { T _ { t } } ^ { \mathrm { v a l } } = ( \mathbf { x } _ { t + 1 } , \mathbf { y } _ { t + 1 } )$ , $L$ $\theta$
104
+ be successful across various meta-training tasks is thus a good network initialization from which adaptation can solve various new tasks that are related to the previously seen tasks. The MAML objective is defined as follows:
105
+
106
+ $$
107
+ \operatorname* { m i n } _ { \theta } \sum _ { T } L ( \theta - \eta \nabla _ { \theta } L ( \theta , \mathcal { D } _ { T } ^ { \mathrm { t r } } ) , \mathcal { D } _ { T } ^ { \mathrm { v a l } } ) = \operatorname* { m i n } _ { \theta } \sum _ { T } L ( \phi _ { T } , \mathcal { D } _ { T } ^ { \mathrm { v a l } } ) .
108
+ $$
109
+
110
+ Here, $\eta$ is the inner learning rate. Once this meta-objective is optimized, the resulting $\theta ^ { * }$ acts as a prior from which fine-tuning can occur at test-time, using recent experience from ${ \mathcal { D } } _ { T _ { \mathrm { t e s t } } } ^ { \mathrm { t r } }$ as follows:
111
+
112
+ $$
113
+ \phi _ { T _ { \mathrm { t e s t } } } = \theta ^ { * } - \eta \nabla _ { \theta ^ { * } } L ( \theta ^ { * } , { \mathcal { D } } _ { T _ { \mathrm { t e s t } } } ^ { \mathrm { t r } } ) .
114
+ $$
115
+
116
+ Here, $\phi _ { T _ { \mathrm { t e s t } } }$ is adapted from the meta-learned prior $\theta ^ { * }$ to be more representative for the current time.
117
+
118
+ Although Finn et al. (2017) demonstrated this fast adaptation of deep neural networks and Nagabandi et al. (2018) extended this framework to model-based meta RL, these methods address adaptation in the $k$ -shot setting, always adapting directly from the meta-learned prior and not allowing further adaptation or specialization. In this work, we have extended these capabilities by enabling more evolution of knowledge through a temporally-extended online adaptation procedure.
119
+
120
+ While our procedure for continual online learning is still initialized with this meta-training for $k$ - shot adaptation (i.e., MAML), we found that this prior was sufficient to enable effective continual online adaptation at test time. The intuitive rationale for this is that MAML trains the model to be able to change significantly using only a small number of datapoints and gradient steps. Note that this meta-trained prior can be used at test time in (a) a $k$ -shot setting, similar to how it was trained, or it can be used at test time by (b) taking substantially more gradient steps away from this prior. We show in Sec. 7 that our method outperforms both of these methods, but the mere ability to use this meta-learned prior in these ways makes the use of MAML enticing.
121
+
122
+ We note that it is quite possible to modify the MAML algorithm to optimize the model directly with respect to the weighted updates discussed in Section 4.2. This simply requires computing the task weights (the E step) on each batch during meta-training, and then constructing a computation graph where all gradient updates are multiplied by their respective weights. Standard automatic differentiation software can then compute the corresponding meta-gradient. For short trial lengths, this is not substantially more complex than standard MAML; for longer trial lengths, truncated backpropagation is an option. Although such a meta-training procedure better matches the way that the model is used during online adaptation, we found that it did not substantially improve our results. While it’s possible that the difference might be more significant if meta-training for longerterm adaptation, this observation does suggest that simply meta-training with MAML is sufficient for enabling effective continuous online adaptation in non-stationary multi-task settings. To clarify, although this modified training procedure of incorporating the EM weight updates (during metatraining) did not explicitly improve our results, we see that test-time performance did indeed improve with using more data for the standard MAML meta-training procedure (see Appendix).
123
+
124
+ # 6 APPLICATION TO MODEL-BASED RL
125
+
126
+ In our experiments, we apply MOLe to model-based reinforcement learning. RL in general aims to act in a way that maximizes the sum of future rewards. At each time step $t$ , the agent executes action $\mathbf { a } _ { t } \in A$ from state $\mathbf { s } _ { t } \in S$ , transitions to the next state $\mathbf { s } _ { t + 1 }$ according the transition probabilities (i.e., dynamics) $p ( \mathbf { s } _ { t + 1 } | \mathbf { s } _ { t } , \mathbf { a } _ { t } )$ and receives rewards $r _ { t } = r ( \mathbf { s } _ { t } , \mathbf { a } _ { t } )$ . The goal at each step is to execute the action $\mathbf { a } _ { t }$ that maximizes the discounted sum of future rewards $\sum _ { t ^ { \prime } = t } ^ { \infty } \gamma ^ { t ^ { \prime } - t } r ( \mathbf { s } _ { t ^ { \prime } } , \mathbf { a } _ { t ^ { \prime } } )$ , where discount factor $\gamma \in [ 0 , 1 ]$ prioritizes near-term rewards. In model-based RL, in particular, the predictions from a known or learned dynamics model are used to either learn a policy, or are used directly inside a planning algorithm to select actions that maximize reward.
127
+
128
+ In our work, the underlying distribution that we aim to model is the dynamics distribution $p ( \mathbf { s } _ { t + 1 } | \mathbf { s } _ { t } , \mathbf { a } _ { t } , T _ { t } )$ , where the unknown $T _ { t }$ represents the underlying settings (e.g., state of the system, external details, environmental perturbations, etc.). The goal for MOLe is to estimate this distribution with a predictive model $p _ { \theta }$ . To instantiate MOLe in this context of model-based RL, we follow Algorithm 1 with the following specifications:
129
+
130
+ (1) We set the input $\mathbf { x } _ { t }$ to be the concatenation of $K$ previous states and actions, given by $\mathbf { x } _ { t } ~ =$ $\left[ \mathbf { s } _ { t - K } , \mathbf { a } _ { t - K } , \ldots , \mathbf { s } _ { t - 2 } , \mathbf { a } _ { t - 2 } , \mathbf { s } _ { t - 1 } , \mathbf { a } _ { t - 1 } \right]$ , and the output to be the corresponding next states $\mathbf { y } _ { t } =$ $\left[ \mathbf { s } _ { t - K + 1 } , \ldots , \mathbf { s } _ { t - 1 } , \mathbf { s } _ { t } \right]$ . This provides us with a slightly larger batch of data for each online update, as compared to using only the data from the given time step. Since individual time steps at high frequency can be very noisy, using the past $K$ transitions helps to damp out the updates.
131
+
132
+ (2) The predictive model $p _ { \theta }$ represents each of these underlying transitions as an independent Gaussian such that $\begin{array} { r } { p _ { \theta } ( \mathbf { y } _ { t } \vert \mathbf { x } _ { t } ) = \prod _ { t ^ { \prime } = t - K } ^ { t - 1 } p ( \mathbf { s } _ { t ^ { \prime } + 1 } \vert \mathbf { s } _ { t ^ { \prime } } , \mathbf { a } _ { t ^ { \prime } } ) } \end{array}$ , where each $p ( \mathbf { s } _ { t + 1 } | \mathbf { s } _ { t } , \mathbf { a } _ { t } )$ is parameterized with a Gaussian given by mean $f _ { \theta } ( \mathbf { s } _ { t } , \mathbf { a } _ { t } )$ and constant variance $\sigma ^ { 2 }$ . We implement this mean dynamics function $f _ { \theta } ( s _ { t } , a _ { t } )$ as a neural network model with three hidden layers each of dimension 500, and ReLU nonlinearities.
133
+
134
+ (3) To calculate the new task parameter $\theta _ { t + 1 } \big ( T _ { \mathrm { n e w } } \big )$ , which may or may not be added to the task distribution $\theta _ { t + 1 } ( T )$ , we use a set of $K$ nearby datapoints that is separate from the set $\mathbf { x } _ { t }$ . This is done to avoid calculating the parameter using the same dataset on which it is evaluated, since $P _ { t } ( T _ { \mathrm { n e w } } )$ comes from evaluating the parameter on the data $\mathbf { x } _ { t }$ .
135
+
136
+ (4) Unlike standard online streaming tasks where the next data point $\mathbf { x } _ { t + 1 }$ is just given, the incoming data point (i.e., the next visited state) in this case is influenced by the predictive model itself. This is because, after the most likely task $T ^ { * }$ is selected from the possible tasks, the predictions from the model $p _ { \theta _ { t + 1 } ( T ^ { * } ) }$ are used by the controller to plan over a sequence of future actions $\mathbf { a } _ { 0 } , \ldots , \mathbf { a } _ { H }$ and select the actions that maximize future reward. Note that the planning procedure is based on stochastic optimization, following prior work (Nagabandi et al., 2018), and we provide more details in the appendix. Since the controller’s action choice determines the next data point, and since the controller’s choice is dependent on the estimated model parameters, it is even more crucial in this setting to appropriately adapt the model.
137
+
138
+ 5) Finally, note that we attain $\theta ^ { * }$ from meta-training using model-agnostic meta-learning (MAML), as mentioned in the method above. However, in this case, MAML is performed in the loop of modelbased RL. In other words, the model parameters at a given iteration of meta-training are used by the controller to generate on-policy rollouts, the data from these rollouts is then added to the dataset for MAML, and this process repeats until the end of meta-training.
139
+
140
+ # 7 EXPERIMENTS
141
+
142
+ The questions that we aimed to study from our experiments include: Can MOLe 1) autonomously discover some task structure amid a stream of non-stationary data? 2) adapt to tasks that are further outside of the task distribution than can be handled by a $k$ -shot learning approach? 3) recognize and revert to tasks it has seen before? 4) avoid overfitting to a recent task to prevent deterioration of performance upon the next task switch? 5) outperform other methods?
143
+
144
+ To study these questions, we conduct experiments on agents in the MuJoCo physics engine (Todorov et al., 2012). The agents we used are a half-cheetah (S R21, A R6) and a hexapedal crawler (S R50, A R12). Using these agents, we design a number of challenging online learning problems that involve multiple sudden and gradual changes in the underlying task distribution, including tasks that are extrapolated from those seen previously, where online learning is criticial. Through these experiments, we aim to build problem settings that are representative of the types of disturbances and shifts that a real RL agent might encounter.
145
+
146
+ We present results and analysis of our findings in the following three sections, and videos can be found at https://sites.google.com/berkeley.edu/onlineviameta. In our experiments, we compare to several alternative methods, including two approaches that leverage metatraining and two approaches that do not:
147
+
148
+ (a) $\mathbf { k }$ -shot adaptation with meta-learning: Always adapt from the meta-trained prior $\theta ^ { * }$ , as typically done with meta-learning methods (Nagabandi et al., 2018). This method is often insufficient for adapting to tasks that are further out of distribution, and the adaptation is also not carried forward in time for future use.
149
+
150
+ (b) continued adaptation with meta-learning: Always take gradient steps from the previous time step’s parameters. This method oftens overfits to recently observed tasks, so it should indicate the importance of our method effectively identifying task structure to avoid overfitting and enable recall.
151
+
152
+ (c) model-based RL: Train a model on the same data as the methods above, using standard supervised learning, and keep this model fixed throughout the trials (i.e., no meta-learning and no adaptation).
153
+
154
+ (d) model-based RL with online gradient updates: Use the same model from model-based RL (i.e., no meta-learning), but adapt it online using gradient-descent at run time. This is representative of commonly used dynamic evaluation methods (Rei, 2015; Krause et al., 2017; 2016; Fortunato et al., 2017).
155
+
156
+ # 7.1 TERRAIN SLOPES ON HALF-CHEETAH
157
+
158
+ We start with the task of a half-cheetah (Fig. 1) agent, traversing terrains of differing slopes. The prior model is meta-trained on data from terrains with random slopes of low magnitudes, and the test trials are executed on difficult out-of-distribution tasks such as basins, steep hills, etc. As shown in Fig. 2, neither model-based RL nor model-based RL with online gradient updates perform well on these out-of-distribution tasks, even though those models were trained on the same data that the metatrained model received. The bad performance of the model-based RL approach indicates the need for model adaptation (as opposed to assuming a single model can encompass everything), while the bad performance of model-based RL with online gradient updates indicates the need for a meta-learned initialization to enable online learning with neural networks.
159
+
160
+ ![](images/7b5e09f6a56c60f5f20540bd0729eb16ef04bcfe7d8e0dbe38b81396c384d24d.jpg)
161
+ Figure 1: Half-cheetah agent, shown traversing a landscape with ‘basins’
162
+
163
+ For the three meta-learning and adaptation methods, we expect continued adaptation with metalearning to perform poorly due to continuous gradient steps causing it to overfit to recent data; that is, we expect that experience on the upward slopes to lead to deterioration of performance on downward slopes, or something similar. However, based on both our qualitative and quantitative results, we see that the meta-learning procedure seems to have initialized the agent with a parameter space in which these various “tasks” are not seen as substantially different, where online learning by SGD performs well. This suggests that the meta-learning process finds a task space where there is an easy skill transfer between slopes; thus, even when MOLe is faced with the option of switching tasks or adding new tasks to its dynamic latent task distribution, it chooses not to do so (Fig. 3). Unlike findings that we will see later, it is interesting that the discovered task space here does not correspond to human-distinguishable categorical labels. Finally, note that these tasks of changing slopes are not particularly similar to each other (and that the discovered task space is indeed useful), because the two non-meta-learning baselines do indeed fail on these test tasks despite having similar training performance on the shallow training slopes.
164
+
165
+ ![](images/d8be539aea62c0d5fa43e989d29aeea8f2f18b86b1c86b5e2cc05bfdd5a9624f.jpg)
166
+ Figure 2: Results on half-cheetah terrain traversal. The poorly performing model-based RL shows that a single model is not sufficient, and model-based RL with online gradient updates shows that a meta-learned initialization is critical. The three meta-learning approaches perform similarly; however, the performance of $\mathbf { k }$ -shot adaptation deteriorates when the task calls for taking multiple gradient steps away from the prior.
167
+
168
+ ![](images/deedbe04c1ee0a3b5065a3ea880aba53ef1d2792321b1870d44639ef923f1619.jpg)
169
+ Figure 3: Latent task distribution over time for two half-cheetah landscape traversal tasks, where encountered terrain slopes vary within each run. Interestingly, we find that MOLe chooses to only use a single latent task variable to describe varying terrain.
170
+
171
+ # 7.2 HALF-CHEETAH MOTOR MALFUNCTIONS
172
+
173
+ While the findings from the half-cheetah on sloped terrains illustrate that separate task parameters aren’t always necessary for what might externally seem like separate tasks, we also want to study agents that experience more drastically-changing non-stationary task distributions during their experience in the world. For this set of experiments, we train all models on data where a single actuator is selected at random to experience a malfunction during the rollout. In this case, malfunction means that the polarity or magnitude of actions applied to that actuator are altered. Fig. 4 shows the results of various methods on drastically out-of-distribution test tasks, such as altering all actuators at once. The left of Fig. 4 shows that when the task distribution during the test trials contains only a single task, such as ‘sign negative’ where all actuators are prescribed to be the opposite polarity, then continued adaptation performs well by repeatedly performing gradient updates on incoming data. However, as shown in the other tasks of Fig. 4, the performance of this continue adaptation substantially deteriorates when the agent experiences a non-stationary task distribution. Due to overspecialization on recent incoming data, such methods that continuously adapt tend to forget and lose previously existing skills. This overfitting and forgetting of past skills is also illustrated in the consistent performance deterioration shown in Fig. 4. MOLe, on the other hand, dynamically builds a probabilistic task distribution and allows adaptation to these difficult tasks, without forgetting past skills. We show a sample task setup in Fig. 5, where the agent experiences alternating periods of normal and crippled-leg operation. This plot shows the successful recognition of new tasks as well as old tasks; note that both the recognition and adaptation are all done online, without using a bank of past data to perform the adaptation, and without a human-specified set of task categories.
174
+
175
+ ![](images/a595fdaa9d514075cf426bff0a322269763b5a5705e1550b8aa738bfdc8b83e8.jpg)
176
+ Figure 4: Results on the motor malfunction trials, where different trials are shown task distributions that modulate at different frequencies (or stay constant, for the first category). Here, online learning is critical for good performance, k-shot adaptation is insufficient for such different tasks, and continued gradient steps leads to overfitting to recently seen data.
177
+
178
+ ![](images/89357b55a78c189008d7a6ae8c1c01f5bd34fb150c71a8e0075ec26418f9f77a.jpg)
179
+ Figure 5: Latent task variable distribution over the course of an online learning trial where the underlying motor malfunction changes every 500 timesteps. We find that MOLe is able to successfully recover the task structure, recognize when the underlying task has changed, and recall previously seen tasks.
180
+
181
+ # 7.3 CRIPPLING OF END EFFECTORS ON SIX-LEGGED CRAWLER
182
+
183
+ To further examine the effects of our continual online adaptation algorithm, we study another, more complex agent: a 6-legged crawler (Fig. 6). In these experiments, models are trained on random joints being crippled (i.e., unable to apply actuator commands). In Fig. 7, we present two illustrative test tasks: (1) the agent sees a set configuration of crippling for the duration of its testtime experience, and (2) the agent receives alternating periods of experience, between regions of normal operation and regions of having crippled legs.
184
+
185
+ ![](images/59b6e060525589935fe9ec62b8cf7fab970ef977170960b22e0bbd4a6b329428.jpg)
186
+ Figure 6: Six-legged crawler robot, shown with crippled legs.
187
+
188
+ The first setting is similar to data seen during training, and thus, we see that even the model-based RL and model based-RL with online gradient updates baselines do not fail. The methods that include both meta-learning and adaptation, however, do have higher performance. Furthermore, we see again that continued gradient steps in this case of a single-task setting is not detrimental. The second setting’s non-stationary task distribution (when the leg crippling is dynamic) illustrates the need for online adaptation (modelbased RL fails), the need for a good prior to adapt from (failure of model-based RL with online gradient updates), the harm of overfitting to recent experience and thus forgetting older skills (low performance of continued gradient steps), and the need for further adaptation away from the prior (limited performance of k-shot adaptation). With MOLe, this agent is able to build its own representation of “task” switches, and we see that this switch does indeed correspond to recognizing regions of leg crippling (left of Fig. 7.3). The plot of the cumulative sum of rewards (right of Fig. 7.3) of each of the three meta-learning plus adaptation methods includes this same task switch pattern every 500 steps: Here, we can clearly see that steps 500-1000 and 1500-2000 were the crippled regions. Continued gradient steps actually performs worse on the second and third times it sees normal operation, whereas MOLe is noticeably better as it sees the task more often. Note that this improvement of both skills is possible with MOLe, where development of one skill actually does not hinder the other.
189
+
190
+ Finally, we examine experiments where the crawler experiences (during each trial) walking straight, making turns, and sometimes having a crippled leg. The performance during the first 500 time steps of ”walking forward in a normal configuration” for continued gradient steps was comparable to MOLe $( + / - 1 0 \%$ difference), but its performance during the last 500 time steps of ”walking forward in a normal configuration” was $200 \%$ lower. Note this detrimental effect of performing updates without allowing for separate task specialization/adaptation.
191
+
192
+ ![](images/f155efcc69da7cb54a1558ff4c0f61c8c77c66633c81bcf6269aad8c85b9e956.jpg)
193
+ Figure 7: Quantitative results on crawler. For a fixed task, adaptation is not necessary and all methods perform well. In contrast, when tasks change dynamically within the trial, only MOLe effectively learns online.
194
+
195
+ ![](images/df59312fc1ca548e169daec05d0aa2626faece93eb6c11981eac424d0d044ef3.jpg)
196
+ Figure 8: Results on crawler experiments. Left: Online recognition of latent task probabilities for alternating periods of normal/crippled experience. Right: MOLe improves from seeing the same tasks multiple times.
197
+
198
+ # 8 DISCUSSION
199
+
200
+ We presented an online learning method for neural network models that can handle non-stationary, multi-task settings within each trial. Our method adapts the model directly with SGD, where an EM algorithm uses a Chinese restaurant process prior to maintain a distribution over tasks and handle non-stationarity. Although SGD generally makes for a poor online learning algorithm in the streaming setting for large parametric models such as deep neural networks, we observe that, by (1) meta-training the model for fast adaptation with MAML and (2) employing our online algorithm for probabilistic updates at test time, we can enable effective online learning with neural networks. In our experiments, we applied this approach to model-based RL, and we demonstrated that it could be used to adapt the behavior of simulated robots faced with various new and unexpected tasks. Our results showed that our method can develop its own notion of task, continuously adapt away from the prior as necessary (to learn even tasks that require more adaptation), and recall tasks it has seen before. While we use model-based RL as our evaluation domain, our method is general and could be applied to other streaming and online learning settings. An exciting direction for future work would be to apply our method to domains such as time series modeling and active online learning.
201
+
202
+ # REFERENCES
203
+
204
+ Maruan Al-Shedivat, Trapit Bansal, Yuri Burda, Ilya Sutskever, Igor Mordatch, and Pieter Abbeel. Continuous adaptation via meta-learning in nonstationary and competitive environments. arXiv preprint arXiv:1710.03641, 2017.
205
+
206
+ Rahaf Aljundi, Punarjay Chakravarty, and Tinne Tuytelaars. Expert gate: Lifelong learning with a network of experts. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2017.
207
+
208
+ Anonymous. Modulating transfer between tasks in gradient-based meta-learning. 2019. URL https://openreview.net/forum?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ rkxLDyBuFX. under review.
209
+
210
+ Samy Bengio, Yoshua Bengio, Jocelyn Cloutier, and Jan Gecsei. On the optimization of a synaptic learning rule. In Optimality in Artificial and Biological Neural Networks, 1992.
211
+
212
+ David M Blei, Andrew Y Ng, and Michael I Jordan. Latent dirichlet allocation. Journal of machine Learning research, 3(Jan):993–1022, 2003.
213
+
214
+ Zdravko I Botev, Dirk P Kroese, Reuven Y Rubinstein, and Pierre LEcuyer. The cross-entropy method for optimization. In Handbook of statistics, volume 31, pp. 35–59. Elsevier, 2013.
215
+
216
+ Leon Bottou. Online learning and stochastic approximations. ´ On-line learning in neural networks, 17(9):142, 1998.
217
+
218
+ Tamara Broderick, Nicholas Boyd, Andre Wibisono, Ashia C Wilson, and Michael I Jordan. Streaming variational bayes. In Advances in Neural Information Processing Systems, pp. 1727–1735, 2013.
219
+
220
+ Julien Doyon and Habib Benali. Reorganization and plasticity in the adult brain during learning of motor skills. Current opinion in neurobiology, 15(2):161–167, 2005.
221
+
222
+ Yan Duan, John Schulman, Xi Chen, Peter L Bartlett, Ilya Sutskever, and Pieter Abbeel. Rl2: Fast reinforcement learning via slow reinforcement learning. arXiv:1611.02779, 2016.
223
+
224
+ John Duchi, Elad Hazan, and Yoram Singer. Adaptive subgradient methods for online learning and stochastic optimization. Journal of Machine Learning Research, 2011.
225
+
226
+ Chelsea Finn, Pieter Abbeel, and Sergey Levine. Model-agnostic meta-learning for fast adaptation of deep networks. International Conference on Machine Learning (ICML), 2017.
227
+
228
+ J Randall Flanagan and Alan M Wing. Modulation of grip force with load force during point-to-point arm movements. Experimental Brain Research, 95(1):131–143, 1993.
229
+
230
+ Meire Fortunato, Charles Blundell, and Oriol Vinyals. Bayesian recurrent neural networks. arXiv preprint arXiv:1704.02798, 2017.
231
+
232
+ Robert Herman. Neural control of locomotion, volume 18. Springer, 2017.
233
+
234
+ Matthew Hoffman, Francis R Bach, and David M Blei. Online learning for latent dirichlet allocation. In advances in neural information processing systems, pp. 856–864, 2010.
235
+
236
+ Amir Jafari, Amy Greenwald, David Gondek, and Gunes Ercal. On no-regret learning, fictitious play, and nash equilibrium. In ICML, volume 1, pp. 226–233, 2001.
237
+
238
+ 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, 2017.
239
+
240
+ Ben Krause, Liang Lu, Iain Murray, and Steve Renals. Multiplicative lstm for sequence modelling. arXiv preprint arXiv:1609.07959, 2016.
241
+
242
+ Ben Krause, Emmanuel Kahembwe, Iain Murray, and Steve Renals. Dynamic evaluation of neural sequence models. CoRR, abs/1709.07432, 2017.
243
+
244
+ David Lopez-Paz et al. Gradient episodic memory for continual learning. In Advances in Neural Information Processing Systems, 2017.
245
+
246
+ Tsendsuren Munkhdalai and Hong Yu. Meta networks. International Conference on Machine Learning (ICML), 2017.
247
+
248
+ K. Murphy. Dynamic Bayesian Networks: Representation, Inference and Learning. PhD thesis, Dept. Computer Science, UC Berkeley, 2002. URL https://www.cs.ubc.ca/ ˜murphyk/Thesis/thesis.html.
249
+
250
+ Anusha Nagabandi, Ignasi Clavera, Simin Liu, Ronald S Fearing, Pieter Abbeel, Sergey Levine, and Chelsea Finn. Learning to adapt: Meta-learning for model-based control. arXiv preprint arXiv:1803.11347, 2018.
251
+
252
+ Devang K Naik and RJ Mammone. Meta-neural networks that learn by learning. In International Joint Conference on Neural Netowrks (IJCNN), 1992.
253
+
254
+ Cuong V Nguyen, Yingzhen Li, Thang D Bui, and Richard E Turner. Variational continual learning. arXiv:1710.10628, 2017.
255
+
256
+ A. Rao. A survey of numerical methods for optimal control. In Advances in the Astronautical Sciences, 2009.
257
+
258
+ Sachin Ravi and Hugo Larochelle. Optimization as a model for few-shot learning. In International Conference on Learning Representations (ICLR), 2017.
259
+
260
+ Sylvestre-Alvise Rebuffi, Alexander Kolesnikov, and Christoph H Lampert. icarl: Incremental classifier and representation learning. In Proc. CVPR, 2017.
261
+
262
+ Marek Rei. Online representation learning in recurrent neural language models. CoRR, abs/1508.03854, 2015.
263
+
264
+ Samuel Ritter, Jane X Wang, Zeb Kurth-Nelson, Siddhant M Jayakumar, Charles Blundell, Razvan Pascanu, and Matthew Botvinick. Been there, done that: Meta-learning with episodic recall. arXiv preprint arXiv:1805.09692, 2018.
265
+
266
+ Andrei A Rusu, Neil C Rabinowitz, Guillaume Desjardins, Hubert Soyer, James Kirkpatrick, Koray Kavukcuoglu, Razvan Pascanu, and Raia Hadsell. Progressive neural networks. arXiv:1606.04671, 2016.
267
+
268
+ Doyen Sahoo, Quang Pham, Jing Lu, and Steven CH Hoi. Online deep learning: Learning deep neural networks on the fly. arXiv preprint arXiv:1711.03705, 2017.
269
+
270
+ Adam Santoro, Sergey Bartunov, Matthew Botvinick, Daan Wierstra, and Timothy Lillicrap. Metalearning with memory-augmented neural networks. In International Conference on Machine Learning (ICML), 2016.
271
+
272
+ Jurgen Schmidhuber. Evolutionary principles in self-referential learning. Diploma thesis, Institut f. Informatik, Tech. Univ. Munich, 1987.
273
+
274
+ Florian Stimberg, Andreas Ruttor, and Manfred Opper. Bayesian inference for change points in dynamical systems with reusable states-a chinese restaurant process approach. In Artificial Intelligence and Statistics, pp. 1117–1124, 2012.
275
+
276
+ Sebastian Thrun. Lifelong learning algorithms. In Learning to learn. Springer, 1998.
277
+
278
+ Sebastian Thrun and Lorien Pratt. Learning to learn. Springer Science & Business Media, 1998.
279
+
280
+ 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.
281
+
282
+ Jane X Wang, Zeb Kurth-Nelson, Dhruva Tirumala, Hubert Soyer, Joel Z Leibo, Remi Munos, Charles Blundell, Dharshan Kumaran, and Matt Botvinick. Learning to reinforcement learn. arXiv:1611.05763, 2016.
283
+
284
+ Yu-Xiong Wang, Deva Ramanan, and Martial Hebert. Growing a brain: Fine-tuning by increasing model capacity. In IEEE Computer Society Conference on Computer Vision and Pattern Recognition (CVPR), 2017.
285
+
286
+ Grady Williams, Andrew Aldrich, and Evangelos Theodorou. Model predictive path integral control using covariance variable importance sampling. CoRR, abs/1509.01149, 2015.
287
+
288
+ Friedemann Zenke, Ben Poole, and Surya Ganguli. Continual learning through synaptic intelligence. In International Conference on Machine Learning, 2017.
289
+
290
+ # A TEST-TIME PERFORMANCE VS TRAINING DATA
291
+
292
+ We verify below that as the meta-trained models are trained with more data, their performance on test tasks does improve.
293
+
294
+ ![](images/8fb33be7d0262c1dcdcebfe50bf3a6a0ac10d4f8f0a219f648284a241a788ddf.jpg)
295
+ Figure 9: Performance on test tasks (i.e., unseen during training) of models that are meta-trained with differing amounts of data. Performance numbers here are normalized per agent, between 0 and 1.
296
+
297
+ # B HYPERPARAMETERS
298
+
299
+ In all experiments, we use a dynamics model consisting of three hidden layers, each of dimension 500, with ReLU nonlinearities. The control method that we use is random-shooting model predictive control (MPC) where 1000 candidate action sequences each of horizon length $_ { \mathrm { H = 1 0 } }$ are sampled at each time step, fed through the predictive model, and ranked by their expected reward. The first action step from the highest-scoring candidate action sequence is then executed before the entire planning process repeats again at the next time step.
300
+
301
+ Below, we list relevant training and testing parameters for the various methods used in our experiments. # Task/itr corresponds to the number of tasks sampled during each iteration of collecting data to train the model, and # TS/itr is the total number of times steps collected during that iteration (sum over all tasks).
302
+
303
+ Table 1: Hyperparameters for train-time
304
+
305
+ <table><tr><td>Iters</td><td>Epochs</td><td># Tasks/itr</td><td>#TS/itr</td><td>K</td><td>outer LR</td><td>inner LR (n)</td></tr><tr><td>12</td><td>50</td><td>16</td><td>2000-3000</td><td>16</td><td>0.001</td><td>0.01</td></tr><tr><td>12</td><td>50</td><td>16</td><td>2000-3000</td><td>16</td><td>0.001</td><td>N/A</td></tr></table>
306
+
307
+ Table 2: Hyperparameters for run-time
308
+
309
+ <table><tr><td></td><td>α(CRP)</td><td>LR (model update)</td><td>K (previous data)</td></tr><tr><td>MOLe (ours)</td><td>1</td><td>0.01</td><td>16</td></tr><tr><td>continued adaptation with meta-learning</td><td>N/A</td><td>0.01</td><td>16</td></tr><tr><td>k-shot adaptation with meta-learning</td><td>N/A</td><td>0.01</td><td>16</td></tr><tr><td>model-based RL</td><td>N/A</td><td>N/A</td><td>N/A</td></tr><tr><td>model-based RL with online gradient updates</td><td>N/A</td><td>0.01</td><td>16</td></tr></table>
310
+
311
+ # C CONTROLLER
312
+
313
+ As mentioned in Section 6, we use the learned dynamics model in conjunction with a controller to select the next action to execute. The controller uses the learned model $f _ { \theta }$ together with a reward function $r ( \mathbf { s } _ { t } , \mathbf { a } _ { t } )$ that encodes the desired task. Many methods could be used to perform this action selection, including cross entropy method (CEM) (Botev et al., 2013) or model predictive path integral control (MPPI) (Williams et al., 2015), but in our experiments, we use a random-sampling shooting method Rao (2009).
314
+
315
+ At each time step $t$ , we randomly generate $N$ candidate action sequences with $H$ actions in each sequence.
316
+
317
+ $$
318
+ A _ { t } ^ { i } = \{ \mathbf { a } _ { t } ^ { i } , \dots , \mathbf { a } _ { t + H } ^ { i } \}
319
+ $$
320
+
321
+ We then use the learned dynamics model to predict the resulting states of executing these candidate action sequences.
322
+
323
+ $$
324
+ S ^ { i } = \{ \hat { \mathbf { s } } _ { t + 1 } ^ { i } , \dotsc , \hat { \mathbf { s } } _ { t + H + 1 } ^ { i } \} \mathrm { ~ w h e r e ~ } \hat { \mathbf { s } } _ { p + 1 } ^ { i } = f _ { \theta } ( \hat { \mathbf { s } } _ { p } ^ { i } , \mathbf { a } _ { p } ^ { i } )
325
+ $$
326
+
327
+ Next, we use the reward function to select the action sequence with the highest associated predicted reward.
328
+
329
+ $$
330
+ i ^ { * } = \operatorname * { a r g m a x } _ { i } \sum _ { t ^ { \prime } = t } ^ { t ^ { \prime } = t + H } r ( \hat { \mathbf { s } } _ { t ^ { \prime } } ^ { i } , \mathbf { a } _ { t ^ { \prime } } ^ { i } )
331
+ $$
332
+
333
+ Next, rather than executing the entire sequence $A _ { t } ^ { i ^ { * } }$ of selected optimal actions, we use a model predictive control (MPC) framework to execute only the first action $\mathbf { a } _ { t } ^ { i ^ { * } }$ from the current state $\mathbf { s } _ { t }$ . We then replan at the next time step; This use of MPC can compensate for model inaccuracies by preventing accumulating errors, since we replan at each time step using updated state information.
parse/train/HyxAfnA5tm/HyxAfnA5tm_content_list.json ADDED
@@ -0,0 +1,1763 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "type": "text",
4
+ "text": "DEEP ONLINE LEARNING VIA META-LEARNING:CONTINUAL ADAPTATION FOR MODEL-BASED RL",
5
+ "text_level": 1,
6
+ "bbox": [
7
+ 176,
8
+ 98,
9
+ 777,
10
+ 146
11
+ ],
12
+ "page_idx": 0
13
+ },
14
+ {
15
+ "type": "text",
16
+ "text": "Anusha Nagabandi, Chelsea Finn & Sergey Levine University of California, Berkeley {nagaban2,cbfinn,svlevine}@berkeley.edu ",
17
+ "bbox": [
18
+ 183,
19
+ 170,
20
+ 563,
21
+ 212
22
+ ],
23
+ "page_idx": 0
24
+ },
25
+ {
26
+ "type": "text",
27
+ "text": "ABSTRACT ",
28
+ "text_level": 1,
29
+ "bbox": [
30
+ 454,
31
+ 250,
32
+ 544,
33
+ 263
34
+ ],
35
+ "page_idx": 0
36
+ },
37
+ {
38
+ "type": "text",
39
+ "text": "Humans and animals can learn complex predictive models that allow them to accurately and reliably reason about real-world phenomena, and they can adapt such models extremely quickly in the face of unexpected changes. Deep neural network models allow us to represent very complex functions, but lack this capacity for rapid online adaptation. The goal in this paper is to develop a method for continual online learning from an incoming stream of data, using deep neural network models. We formulate an online learning procedure that uses stochastic gradient descent to update model parameters, and an expectation maximization algorithm with a Chinese restaurant process prior to develop and maintain a mixture of models to handle non-stationary task distributions. This allows for all models to be adapted as necessary, with new models instantiated for task changes and old models recalled when previously seen tasks are encountered again. Furthermore, we observe that meta-learning can be used to meta-train a model such that this direct online adaptation with SGD is effective, which is otherwise not the case for large function approximators. In this work, we apply our meta-learning for online learning (MOLe) approach to model-based reinforcement learning, where adapting the predictive model is critical for control; we demonstrate that MOLe outperforms alternative prior methods, and enables effective continuous adaptation in non-stationary task distributions such as varying terrains, motor failures, and unexpected disturbances. Videos available at: https://sites.google.com/berkeley.edu/onlineviameta ",
40
+ "bbox": [
41
+ 233,
42
+ 282,
43
+ 764,
44
+ 574
45
+ ],
46
+ "page_idx": 0
47
+ },
48
+ {
49
+ "type": "text",
50
+ "text": "1 INTRODUCTION ",
51
+ "text_level": 1,
52
+ "bbox": [
53
+ 176,
54
+ 606,
55
+ 336,
56
+ 621
57
+ ],
58
+ "page_idx": 0
59
+ },
60
+ {
61
+ "type": "text",
62
+ "text": "Human and animal learning is characterized not just by a capacity to acquire complex skills, but also the ability to adapt rapidly when those skills must be carried out under new or changing conditions. For example, animals can quickly adapt to walking and running on different surfaces (Herman, 2017) and humans can easily modulate force during reaching movements in the presence of unexpected perturbations (Flanagan & Wing, 1993). Furthermore, these experiences are remembered, and can be recalled to adapt more quickly when similar disturbances occur in the future (Doyon & Benali, 2005). Since learning entirely new models on such short time-scales is impractical, we can devise algorithms that explicitly train models to adapt quickly from small amounts of data. Such online adaptation is crucial for intelligent systems operating in the real world, where changing factors and unexpected perturbations are the norm. In this paper, we propose an algorithm for fast and continuous online learning that utilizes deep neural network models to build and maintain a task distribution, allowing for the natural development of both generalization as well as task specialization. ",
63
+ "bbox": [
64
+ 174,
65
+ 638,
66
+ 825,
67
+ 805
68
+ ],
69
+ "page_idx": 0
70
+ },
71
+ {
72
+ "type": "text",
73
+ "text": "Our working example is continuous adaptation in the model-based reinforcement learning setting, though our approach generally addresses any online learning scenario with streaming data. We assume that each “trial” consists of multiple tasks, and that the delineation between the tasks is not provided explicitly to the learner – instead, the method must adaptively decide what “tasks” even represent, when to instantiate new tasks, and when to continue updating old ones. For example, a robot running over changing terrain might need to handle uphill and downhill slopes, and might choose to maintain separate models that become specialized to each slope, adapting to each one in turn based on the currently inferred surface. ",
74
+ "bbox": [
75
+ 174,
76
+ 813,
77
+ 823,
78
+ 922
79
+ ],
80
+ "page_idx": 0
81
+ },
82
+ {
83
+ "type": "text",
84
+ "text": "We perform adaptation simply by using online stochastic gradient descent (SGD) on the model parameters, while maintaining a mixture model over model parameters for different tasks. The mixture is updated via the Chinese restaurant process (Stimberg et al., 2012), which enables new tasks to be instantiated as needed over the course of a trial. Although online learning is perhaps one of the oldest applications of SGD (Bottou, 1998), modern parametric models such as deep neural networks are exceedingly difficult to train online with this method. They typically require mediumsized minibatches and multiple epochs to arrive at sensible solutions, which is not suitable when receiving data in an online streaming setting. One of our key observations is that meta-learning can be used to learn a prior initialization for the parameters that makes such direct online adaptation feasible, with only a handful of gradient steps. The meta-training procedure we use is based on model-agnostic meta-learning (MAML) (Finn et al., 2017), where a prior weight initialization is learned for a model so as to optimize improvement on any task from a meta-training task distribution after a small number of gradient steps. ",
85
+ "bbox": [
86
+ 174,
87
+ 103,
88
+ 825,
89
+ 284
90
+ ],
91
+ "page_idx": 1
92
+ },
93
+ {
94
+ "type": "text",
95
+ "text": "Meta-learning with MAML has previously been extended to model-based RL (Nagabandi et al., 2018), but only for the $k$ -shot adaptation setting: The meta-learned prior model is adapted to the $k$ most recent time steps, but the adaptation is not carried forward in time (i.e., adaptation is always performed from the prior itself). This rigid batch-mode setting is restrictive in an online learning setup and is insufficient for tasks that are further outside of the training distribution. A more natural formulation is one where the model receives a continuous stream of data and must adapt online to a potentially non-stationary task distribution. This requires both fast adaptation and the ability to recall prior tasks, as well as an effective adaptation strategy to interpolate as needed between the two. ",
96
+ "bbox": [
97
+ 174,
98
+ 291,
99
+ 825,
100
+ 416
101
+ ],
102
+ "page_idx": 1
103
+ },
104
+ {
105
+ "type": "text",
106
+ "text": "The primary contribution of this paper is a meta-learning for online learning (MOLe) algorithm that uses expectation maximization, in conjunction with a Chinese restaurant process prior on the task distribution, to learn mixtures of neural network models that are each updated with online SGD. In contrast to prior multi-task and meta-learning methods, our method’s online assignment of soft task probabilities allows for task specialization to emerge naturally, without requiring task delineations to be specified in advance. We evaluate MOLe in the context of model-based RL on a suite of challenging simulated robotic tasks including disturbances, environmental changes, and simulated motor failures. Our simulated experiments show a half-cheetah agent and a hexapedal crawler robot performing continuous model adaptation in an online setting. Our results show online instantiation of new tasks, the ability to adapt to out-of-distribution tasks, and the ability to recognize and revert back to prior tasks. Additionally, we demonstrate that MOLe outperforms a state-of-the-art prior method that does $k$ -shot model-based meta-RL, as well as natural baselines such as continuous gradient updates for adaptation and online learning without meta-training. ",
107
+ "bbox": [
108
+ 174,
109
+ 422,
110
+ 825,
111
+ 603
112
+ ],
113
+ "page_idx": 1
114
+ },
115
+ {
116
+ "type": "text",
117
+ "text": "2 RELATED WORK ",
118
+ "text_level": 1,
119
+ "bbox": [
120
+ 176,
121
+ 631,
122
+ 344,
123
+ 647
124
+ ],
125
+ "page_idx": 1
126
+ },
127
+ {
128
+ "type": "text",
129
+ "text": "Online learning is one of the oldest subfields of machine learning (Bottou, 1998; Jafari et al., 2001). Prior algorithms have used online gradient updates (Duchi et al., 2011) and probabilistic filtering formulations (Murphy, 2002; Hoffman et al., 2010; Broderick et al., 2013). In principle, commonly used gradient-based learning methods, such as SGD, can easily be used as online learning algorithms (Bottou, 1998). In practice, their performance with deep neural network function approximators is limited (Sahoo et al., 2017): such high-dimensional models must be trained with batch-mode methods, minibatches, and multiple passes over the data. We aim to lift this restriction by using model-agnostic meta-learning (MAML) to explicitly pretrain a model that enables fast adaptation, which we then use for continuous online adaptation via an expectation maximization algorithm with a Chinese restaurant process (Blei et al., 2003) prior for dynamic allocation of new tasks in a non-stationary task distribution. ",
130
+ "bbox": [
131
+ 174,
132
+ 666,
133
+ 825,
134
+ 819
135
+ ],
136
+ "page_idx": 1
137
+ },
138
+ {
139
+ "type": "text",
140
+ "text": "Online learning is related to that of continual or lifelong learning (Thrun, 1998), where the agent faces a non-stationary distribution of tasks over time. However, unlike works that focus on avoiding negative transfer, i.e. catastrophic forgetting (Kirkpatrick et al., 2017; Rebuffi et al., 2017; Zenke et al., 2017; Lopez-Paz et al., 2017; Nguyen et al., 2017), online learning focuses on the ability to rapidly learn and adapt in the presence of non-stationarity. While some continual learning works consider the problem of forward transfer, e.g. Rusu et al. (2016); Aljundi et al. (2017); Wang et al. (2017), these works and others in continual learning generally focus on small sets of tasks where fast, online learning is not realistically possible, since there are simply not enough tasks to recover structure that enables fast, few-shot learning in new tasks or environments. ",
141
+ "bbox": [
142
+ 174,
143
+ 827,
144
+ 823,
145
+ 924
146
+ ],
147
+ "page_idx": 1
148
+ },
149
+ {
150
+ "type": "text",
151
+ "text": "",
152
+ "bbox": [
153
+ 173,
154
+ 103,
155
+ 823,
156
+ 132
157
+ ],
158
+ "page_idx": 2
159
+ },
160
+ {
161
+ "type": "text",
162
+ "text": "Our approach builds on techniques for meta-learning or learning-to-learn (Thrun & Pratt, 1998; Schmidhuber, 1987; Bengio et al., 1992; Naik & Mammone, 1992). However, most recent metalearning work considers a setting where one task is learned at a time, often from a single batch of data (Santoro et al., 2016; Ravi & Larochelle, 2017; Munkhdalai & Yu, 2017; Wang et al., 2016; Duan et al., 2016). In our work, we specifically address non-stationary task distributions and do not assume that task boundaries are known. Concurrent work (Anonymous, 2019) has used a mixture model at the level of the prior parameters, considering non-stationarity at the meta-level, whereas we use a mixture model to model the task-specific parameters to perform online learning only during run-time. Other meta-learning works have considered non-stationarity within a task (Al-Shedivat et al., 2017) and episodes involving multiple tasks at meta-test time (Ritter et al., 2018), but they do not consider continual online adaptation with unknown task separation. Prior work has also studied meta-learning for model-based RL (Nagabandi et al., 2018). This prior method updates the model every time step, but each update is a batch-mode $k$ -shot update, using exactly $k$ prior transitions and resetting the model at each step. This allows for adaptive control, but does not enable continual online adaptation, since updates from previous steps are always discarded. In our comparisons, we find that our approach substantially outperforms this prior method. To our knowledge, our work is the first to apply meta-learning to learn streaming online updates. ",
163
+ "bbox": [
164
+ 174,
165
+ 138,
166
+ 825,
167
+ 376
168
+ ],
169
+ "page_idx": 2
170
+ },
171
+ {
172
+ "type": "text",
173
+ "text": "3 PROBLEM STATEMENT ",
174
+ "text_level": 1,
175
+ "bbox": [
176
+ 176,
177
+ 395,
178
+ 393,
179
+ 411
180
+ ],
181
+ "page_idx": 2
182
+ },
183
+ {
184
+ "type": "text",
185
+ "text": "We formalize our online learning problem setting as follows: at each time step, the model receives an input $\\mathbf { x } _ { t }$ and produces a prediction $\\hat { \\mathbf { y } } _ { t }$ . It then receives a ground truth label $\\mathbf { y } _ { t }$ , which must be used to adapt the model to increase its prediction accuracy on the next input $\\mathbf { x } _ { t + 1 }$ . The true labels are assumed to come from some task distribution $P ( Y _ { t } | X _ { t } , T _ { t } )$ , where $T _ { t }$ is the task at time $t$ . The tasks themselves change over time, resulting in a non-stationary task distribution, and the identity of the task $T _ { t }$ is unknown to the learner. In real-world settings, tasks might correspond to unknown parameters of the system (e.g., motor malfunction on a robot), user preferences, or other unexpected events. This problem statement covers a range of online learning problems that all require continual adaptation to streaming data and trading off between generalization and specialization. ",
186
+ "bbox": [
187
+ 174,
188
+ 425,
189
+ 825,
190
+ 550
191
+ ],
192
+ "page_idx": 2
193
+ },
194
+ {
195
+ "type": "text",
196
+ "text": "In our experiments, we use model-based RL as our working example, where the input $\\mathbf { x } _ { t }$ is a stateaction pair, and the output $\\mathbf { y } _ { t }$ is the next state. We discuss this application to model-based RL in Section 6, but we keep the following derivation of our method general for the case of arbitrary online prediction problems. ",
197
+ "bbox": [
198
+ 174,
199
+ 558,
200
+ 825,
201
+ 613
202
+ ],
203
+ "page_idx": 2
204
+ },
205
+ {
206
+ "type": "text",
207
+ "text": "4 ONLINE LEARNING WITH MIXTURE OF META-TRAINED NETWORKS ",
208
+ "text_level": 1,
209
+ "bbox": [
210
+ 171,
211
+ 633,
212
+ 772,
213
+ 650
214
+ ],
215
+ "page_idx": 2
216
+ },
217
+ {
218
+ "type": "text",
219
+ "text": "We discuss our meta-learning for online learning (MOLe) algorithm in two parts: online learning in this section, and meta-learning in the next. In this section, we explain our online learning method that enables effective online learning using a continuous stream of incoming data from a non-stationary task distribution. We aim to retain generalization so as to not lose past knowledge, as well as gain specialization, which is particularly important for learning new tasks that are further out-ofdistribution and require more learning. We discuss the process of obtaining a meta-learned prior in Sec. 5, but we first formulate in this section an online adaptation algorithm using SGD with expectation maximization to maintain and adapt a mixture model over task model parameters (i.e., a probabilistic task distribution). ",
220
+ "bbox": [
221
+ 174,
222
+ 664,
223
+ 825,
224
+ 789
225
+ ],
226
+ "page_idx": 2
227
+ },
228
+ {
229
+ "type": "text",
230
+ "text": "4.1 METHOD OVERVIEW ",
231
+ "text_level": 1,
232
+ "bbox": [
233
+ 174,
234
+ 809,
235
+ 357,
236
+ 824
237
+ ],
238
+ "page_idx": 2
239
+ },
240
+ {
241
+ "type": "text",
242
+ "text": "Let $p _ { \\theta ( T _ { t } ) } ( \\mathbf { y } _ { t } | \\mathbf { x } _ { t } )$ represent the predictive distribution of our model on input $\\mathbf { x } _ { t }$ , for an unknown task $T _ { t }$ . Our goal is to estimate model parameters $\\theta _ { t } ( T )$ for each task $T$ in the non-stationary task distribution: This requires inferring the distribution over tasks at each step $P ( T _ { t } | \\mathbf x _ { t } , \\mathbf y _ { t } )$ , using that distribution to make predictions $\\hat { \\mathbf y } _ { t } = p _ { \\theta ( T _ { t } ) } ( \\mathbf y _ { t } | \\mathbf x _ { t } )$ , and also using it to update each model from $\\theta _ { t } ( T )$ to $\\theta _ { t + 1 } ( T )$ . In practice, the parameters $\\theta ( T )$ of each model will correspond to the weights of a neural network $f _ { \\theta ( T ) }$ . ",
243
+ "bbox": [
244
+ 173,
245
+ 837,
246
+ 825,
247
+ 925
248
+ ],
249
+ "page_idx": 2
250
+ },
251
+ {
252
+ "type": "text",
253
+ "text": "Each model begins with some prior parameter vector $\\theta ^ { * }$ , which we will discuss in more detail in Section 5. Since the number of tasks is also unknown, we begin with one task at time step 0, where $\\theta _ { 0 } ( T ) = \\{ \\theta _ { 0 } ( T _ { 0 } ) \\} = \\{ \\theta ^ { * } \\}$ . From here, we continuously update all parameters in $\\theta _ { t } ( T )$ and add new tasks as needed, in the attempt to model the true underlying process $P ( Y _ { t } | X _ { t } , T _ { t } )$ . Since task identities are unknown, we must also estimate $P ( T _ { t } )$ at each time step. Thus, the online learning problem consists of adapting each $\\theta _ { t } ( T _ { i } )$ at each time step $t$ according to the inferred task probabilities $P ( T _ { t } = T _ { i } | \\mathbf x _ { t } , \\mathbf y _ { t } )$ . To do this, we adapt the expectation maximization (EM) algorithm and optimize the expected log-likelihood, given by ",
254
+ "bbox": [
255
+ 173,
256
+ 103,
257
+ 825,
258
+ 215
259
+ ],
260
+ "page_idx": 3
261
+ },
262
+ {
263
+ "type": "equation",
264
+ "img_path": "images/0100106b19be316d79826d67b8ecffb1918af0d0d46bce20c9bf09250d56dd52.jpg",
265
+ "text": "$$\n\\mathcal { L } = E _ { T _ { t } \\sim P ( T _ { t } | \\mathbf { x } _ { t } , \\mathbf { y } _ { t } ) } [ \\log p _ { \\theta _ { t } ( T _ { t } ) } ( \\mathbf { y } _ { t } | \\mathbf { x } _ { t } , T _ { t } ) ] ,\n$$",
266
+ "text_format": "latex",
267
+ "bbox": [
268
+ 352,
269
+ 217,
270
+ 643,
271
+ 234
272
+ ],
273
+ "page_idx": 3
274
+ },
275
+ {
276
+ "type": "text",
277
+ "text": "where we use $\\theta _ { t } ( T _ { t } )$ to denote the model parameters corresponding to task $T _ { t }$ . Finally, to handle the unknown number of tasks, we employ the Chinese restaurant process to instantiate new tasks as needed. ",
278
+ "bbox": [
279
+ 174,
280
+ 236,
281
+ 825,
282
+ 277
283
+ ],
284
+ "page_idx": 3
285
+ },
286
+ {
287
+ "type": "text",
288
+ "text": "4.2 APPROXIMATE ONLINE INFERENCE",
289
+ "text_level": 1,
290
+ "bbox": [
291
+ 176,
292
+ 292,
293
+ 460,
294
+ 308
295
+ ],
296
+ "page_idx": 3
297
+ },
298
+ {
299
+ "type": "text",
300
+ "text": "We use expectation maximization (EM) to update the model parameters. In our case, the $\\mathrm { E }$ step in EM involves estimating the task distribution $P ( T _ { t } = T _ { i } | \\mathbf { x } _ { t } , \\mathbf { \\bar { y } } _ { t } )$ at the current time step, while the M step involves updating all model parameters from $\\theta _ { t } ( T )$ to obtain the new model parameters $\\theta _ { t + 1 } ( T )$ . The parameters are always updated by one gradient step per time step, according to the inferred task responsibilities. ",
301
+ "bbox": [
302
+ 173,
303
+ 319,
304
+ 825,
305
+ 388
306
+ ],
307
+ "page_idx": 3
308
+ },
309
+ {
310
+ "type": "text",
311
+ "text": "We first estimate the expectations over all task parameters $T _ { i }$ in the task distribution, where the posterior of each task probability can be written as follows: ",
312
+ "bbox": [
313
+ 173,
314
+ 395,
315
+ 823,
316
+ 422
317
+ ],
318
+ "page_idx": 3
319
+ },
320
+ {
321
+ "type": "equation",
322
+ "img_path": "images/136353d1bbe7cc6d7c718eb6d9e06a0cff5be40a40b93c4aac6ede30537e6950.jpg",
323
+ "text": "$$\nP ( T _ { t } = T _ { i } | \\mathbf { x } _ { t } , \\mathbf { y } _ { t } ) \\propto p _ { \\theta _ { t } ( T _ { i } ) } ( \\mathbf { y } _ { t } | \\mathbf { x } _ { t } , T _ { t } = T _ { i } ) P ( T _ { t } = T _ { i } ) .\n$$",
324
+ "text_format": "latex",
325
+ "bbox": [
326
+ 308,
327
+ 424,
328
+ 689,
329
+ 443
330
+ ],
331
+ "page_idx": 3
332
+ },
333
+ {
334
+ "type": "text",
335
+ "text": "We then formulate the task prior $P ( T _ { t } = T _ { i } )$ using a Chinese restaurant process (CRP) to enable new tasks to be instantiated during a trial. The CRP is an instantiation of a Dirichlet process. In the CRP, at time $t$ , the probability of each task $T _ { i }$ should be given by ",
336
+ "bbox": [
337
+ 173,
338
+ 450,
339
+ 826,
340
+ 493
341
+ ],
342
+ "page_idx": 3
343
+ },
344
+ {
345
+ "type": "equation",
346
+ "img_path": "images/1369ce11b72e02980436f57866802a55b42f16b151529363b0551027ebbc0730.jpg",
347
+ "text": "$$\nP ( T _ { t } = T _ { i } ) = \\frac { n _ { T _ { i } } } { t - 1 + \\alpha }\n$$",
348
+ "text_format": "latex",
349
+ "bbox": [
350
+ 413,
351
+ 494,
352
+ 584,
353
+ 522
354
+ ],
355
+ "page_idx": 3
356
+ },
357
+ {
358
+ "type": "text",
359
+ "text": "where $n _ { T _ { i } }$ is the expected number of datapoints in task $T _ { i }$ for all steps $1 , \\ldots , t - 1$ , and $\\alpha$ is a hyperparameter that controls the instantiation of new tasks. The prior therefore becomes ",
360
+ "bbox": [
361
+ 174,
362
+ 522,
363
+ 830,
364
+ 550
365
+ ],
366
+ "page_idx": 3
367
+ },
368
+ {
369
+ "type": "equation",
370
+ "img_path": "images/52f0b73e2786bbffe906b690fac43d214da032a84474f88c854604503f31a92e.jpg",
371
+ "text": "$$\nP ( T _ { t } = T _ { i } ) = \\frac { \\sum _ { t ^ { \\prime } = 1 } ^ { t - 1 } P ( T _ { t ^ { \\prime } } = T _ { i } ) } { t - 1 + \\alpha } \\quad \\mathrm { a n d } \\quad P ( T _ { t } = T _ { \\mathrm { n e w } } ) = \\frac { \\alpha } { t - 1 + \\alpha }\n$$",
372
+ "text_format": "latex",
373
+ "bbox": [
374
+ 261,
375
+ 550,
376
+ 736,
377
+ 585
378
+ ],
379
+ "page_idx": 3
380
+ },
381
+ {
382
+ "type": "text",
383
+ "text": "Combining the prior and likelihood, we derive the following posterior task probability distribution: ",
384
+ "bbox": [
385
+ 181,
386
+ 585,
387
+ 818,
388
+ 601
389
+ ],
390
+ "page_idx": 3
391
+ },
392
+ {
393
+ "type": "equation",
394
+ "img_path": "images/e88fcd9614a61387cc459281968134e86492408a40140cea0172d72bb348bb69.jpg",
395
+ "text": "$$\nP ( T _ { t } = T _ { i } | \\mathbf { x } _ { t } , \\mathbf { y } _ { t } ) \\propto p _ { \\theta _ { t } ( T _ { i } ) } ( \\mathbf { y } _ { t } | \\mathbf { x } _ { t } , T _ { t } = T _ { i } ) \\left[ \\sum _ { t ^ { \\prime } = 1 } ^ { t - 1 } P ( T _ { t ^ { \\prime } } = T _ { i } ) + \\delta ( T _ { t ^ { \\prime } } = T _ { \\mathrm { n e w } } ) \\alpha \\right]\n$$",
396
+ "text_format": "latex",
397
+ "bbox": [
398
+ 223,
399
+ 599,
400
+ 774,
401
+ 643
402
+ ],
403
+ "page_idx": 3
404
+ },
405
+ {
406
+ "type": "text",
407
+ "text": "Having estimated the latent task probabilities, we next perform the $\\mathbf { M }$ step, which improves the expected log-likelihood in Equation 1 based on the inferred task distribution. Since each task starts from the prior $\\theta ^ { * }$ , the values of all parameters in $\\theta _ { t } ( T )$ after one gradient update are given by ",
408
+ "bbox": [
409
+ 173,
410
+ 643,
411
+ 825,
412
+ 685
413
+ ],
414
+ "page_idx": 3
415
+ },
416
+ {
417
+ "type": "equation",
418
+ "img_path": "images/5d664ce5630e319d0085d8f3e6be0d3a0e7f6d0c18c153472decb64f8a20c6f9.jpg",
419
+ "text": "$$\n\\theta _ { t + 1 } ( T _ { i } ) = \\theta ^ { * } - \\beta \\sum _ { t ^ { \\prime } = 0 } ^ { t } P _ { t } ( T _ { t ^ { \\prime } } = T _ { i } | \\mathbf { x } _ { t ^ { \\prime } } , \\mathbf { y } _ { t ^ { \\prime } } ) \\nabla _ { \\theta _ { t ^ { \\prime } } ( T _ { i } ) } \\log p _ { \\theta _ { t ^ { \\prime } } ( T _ { i } ) } ( \\mathbf { y } _ { t ^ { \\prime } } | \\mathbf { x } _ { t ^ { \\prime } } ) \\quad \\forall T _ { i }\n$$",
420
+ "text_format": "latex",
421
+ "bbox": [
422
+ 236,
423
+ 686,
424
+ 761,
425
+ 729
426
+ ],
427
+ "page_idx": 3
428
+ },
429
+ {
430
+ "type": "text",
431
+ "text": "If we assume that all parameters of $\\theta _ { t } ( T )$ have already been updated for the previous time steps $0 , \\ldots , t$ , we can approximate this update by simply updating all parameters $\\theta _ { t } ( T )$ on the newest data: ",
432
+ "bbox": [
433
+ 173,
434
+ 731,
435
+ 826,
436
+ 771
437
+ ],
438
+ "page_idx": 3
439
+ },
440
+ {
441
+ "type": "equation",
442
+ "img_path": "images/2b90d498abc071e38c38a95e73a6f17f6c90a0563298363141671c9381100ae5.jpg",
443
+ "text": "$$\n\\begin{array} { r l } { \\theta _ { t + 1 } ( T _ { i } ) = \\theta _ { t } ( T _ { i } ) - \\beta P _ { t } ( T _ { t } = T _ { i } | \\mathbf { x } _ { t } , \\mathbf { y } _ { t } ) \\nabla _ { \\theta _ { t } ( T _ { i } ) } \\log p _ { \\theta _ { t } ( T _ { i } ) } ( \\mathbf { y } _ { t } | \\mathbf { x } _ { t } ) } & { \\forall T _ { i } } \\end{array}\n$$",
444
+ "text_format": "latex",
445
+ "bbox": [
446
+ 254,
447
+ 770,
448
+ 743,
449
+ 789
450
+ ],
451
+ "page_idx": 3
452
+ },
453
+ {
454
+ "type": "text",
455
+ "text": "This procedure is an approximation, since updates to task parameters $\\theta _ { t } ( T )$ will in reality also change the corresponding task probabilities at previous time steps. However, this approximation removes the need to store previously seen data points and yields a fully online, streaming algorithm. Finally, to fully implement the EM algorithm, we must alternate the $\\mathrm { E }$ and $\\mathbf { M }$ steps to convergence at each time step, rolling back the previous gradient update to $\\theta _ { t } ( T )$ at each iteration. In practice, we found it sufficient to perform the E and $\\mathbf { M }$ steps only once per time step. While this is a crude simplification, successive time steps in the online learning scenario are likely to be correlated, making this procedure reasonable. However, it is also straightforward to perform multiple steps of EM while still remaining fully online. ",
456
+ "bbox": [
457
+ 173,
458
+ 795,
459
+ 825,
460
+ 921
461
+ ],
462
+ "page_idx": 3
463
+ },
464
+ {
465
+ "type": "text",
466
+ "text": "We now summarize this full online learning portion of MOLe, and we also outline it in Alg. 1. At the first time step $t = 0$ , the task distribution is initialized to contain one entry: $\\theta _ { 0 } ( T ) = \\{ \\theta _ { 0 } ( T _ { 0 } ) \\} = \\{ \\theta ^ { * } \\}$ . At every time step after that, an E step is performed to estimate the task distribution and an $\\mathbf { M }$ step is performed to update the model parameters. The CRP prior also assigns, at each time step, the probability of adding a new task $T _ { \\mathrm { n e w } }$ at the given time step. The parameters $\\theta _ { t + 1 } \\big ( T _ { \\mathrm { n e w } } \\big )$ of this new task are adapted from $\\theta ^ { * }$ on the latest data. The prediction on the next datapoint is then made using the model parameters $\\theta _ { t + 1 } ( T ^ { * } )$ corresponding to the most likely task $T ^ { * }$ . ",
467
+ "bbox": [
468
+ 174,
469
+ 104,
470
+ 483,
471
+ 310
472
+ ],
473
+ "page_idx": 4
474
+ },
475
+ {
476
+ "type": "text",
477
+ "text": "Algorithm 1 Online Learning with Mixture of Meta \nTrained Networks \nRequire: $\\theta ^ { * }$ from meta-training Initialize $t = 0$ , $\\theta _ { 0 } ( T ) = \\{ \\bar { \\theta _ { 0 } ( T _ { 0 } ) } \\} = \\{ \\theta ^ { * } \\}$ for each time step $t$ do Calculate $p _ { \\theta _ { t } ( T _ { i } ) } ( \\mathbf { y } _ { t } | \\mathbf { x } _ { t } , T _ { t } = T _ { i } ) \\ \\forall T _ { i }$ Calculate $P _ { t } ( T _ { i } ) = P _ { t } ( T _ { t } = T _ { i } | \\mathbf { x } _ { t } , \\mathbf { y } _ { t } ) \\ \\forall T _ { i }$ Calculate $\\theta _ { t + 1 } ( T _ { i } )$ by adapting from $\\theta _ { t } ( T _ { i } ) \\ \\forall T _ { i }$ Calculate $\\theta _ { t + 1 } \\big ( T _ { \\mathrm { n e w } } \\big )$ by adapting from $\\theta ^ { * }$ if $P _ { t } ( T _ { \\mathrm { n e w } } ) > P _ { t } ( T _ { i } ) \\ \\forall T _ { : }$ then Add $\\theta _ { t + 1 } \\big ( T _ { \\mathrm { n e w } } \\big )$ to $\\theta _ { t + 1 } ( T )$ Recalculate $P _ { t } ( T _ { i } )$ using $\\theta _ { t + 1 } ( T _ { i } ) \\ \\forall T _ { i }$ Recalculate $\\theta _ { t + 1 } ( T _ { i } )$ using updated $P _ { t } ( T _ { i } ) \\ \\forall T _ { i }$ end if $\\begin{array} { r } { T ^ { * } = \\mathrm { a r g m a x } _ { T _ { i } } \\ p _ { \\theta _ { t + 1 } ( T _ { i } ) } ( \\mathbf { y } _ { t } | \\mathbf { x } _ { t } , T _ { t } = T _ { i } ) } \\end{array}$ iReceive next data point $\\mathbf { x } _ { t + 1 }$ end for ",
478
+ "bbox": [
479
+ 498,
480
+ 108,
481
+ 843,
482
+ 327
483
+ ],
484
+ "page_idx": 4
485
+ },
486
+ {
487
+ "type": "text",
488
+ "text": "5 META-LEARNING THE PRIOR ",
489
+ "text_level": 1,
490
+ "bbox": [
491
+ 176,
492
+ 334,
493
+ 447,
494
+ 351
495
+ ],
496
+ "page_idx": 4
497
+ },
498
+ {
499
+ "type": "text",
500
+ "text": "We formulated an algorithm above for performing online adaptation using continually incoming data. For this method, we choose to meta-train the prior using the model-agnostic meta-learning (MAML) algorithm. This meta-training algorithm is an appropriate choice, because it results in a prior that is specifically intended for gradient-based fine-tuning. Before we further discuss our choice in meta-training procedure, we first give an overview of MAML and meta-learning in general. ",
501
+ "bbox": [
502
+ 173,
503
+ 367,
504
+ 825,
505
+ 438
506
+ ],
507
+ "page_idx": 4
508
+ },
509
+ {
510
+ "type": "text",
511
+ "text": "Given a distribution of tasks, a meta-learning algorithm produces a learning procedure, which can, in some cases, quickly adapt to a new task. MAML optimizes for an initialization of a deep network that achieves good few-shot task generalization when fine-tuned using a few datapoints from that task. At train time, MAML sees small amounts of data from large numbers of tasks, where data $\\mathcal { D } _ { T }$ from each task $T$ can be split into training and validation subsets ( ${ \\mathcal { D } } _ { T } ^ { \\mathrm { t r } }$ and $\\mathcal { D } _ { T } ^ { \\mathrm { v a l } }$ ), where ${ \\mathcal { D } } _ { T } ^ { \\mathrm { t r } }$ is of size $k$ . MAML optimizes for model parameters $\\theta$ such that one or more gradients steps on ${ \\mathcal { D } } _ { T } ^ { \\mathrm { t r } }$ results in a minimaand the loss oss wil $L$ on orr $\\mathcal { D } _ { T } ^ { \\mathrm { v a l } }$ . In our case, we will set nd to negative log likelihoo ${ \\mathcal D } _ { T _ { t } } ^ { \\mathrm { t r } } = ( { \\bf x } _ { t } , { \\bf y } _ { t } )$ and t allo $\\mathcal { D } _ { T _ { t } } ^ { \\mathrm { v a l } } = ( \\mathbf { x } _ { t + 1 } , \\mathbf { y } _ { t + 1 } )$ , $L$ $\\theta$ \nbe successful across various meta-training tasks is thus a good network initialization from which adaptation can solve various new tasks that are related to the previously seen tasks. The MAML objective is defined as follows: ",
512
+ "bbox": [
513
+ 173,
514
+ 443,
515
+ 825,
516
+ 598
517
+ ],
518
+ "page_idx": 4
519
+ },
520
+ {
521
+ "type": "equation",
522
+ "img_path": "images/501d6d28751abf809c6aa823f3610b2b323f7dfb2b799843636793df233f3980.jpg",
523
+ "text": "$$\n\\operatorname* { m i n } _ { \\theta } \\sum _ { T } L ( \\theta - \\eta \\nabla _ { \\theta } L ( \\theta , \\mathcal { D } _ { T } ^ { \\mathrm { t r } } ) , \\mathcal { D } _ { T } ^ { \\mathrm { v a l } } ) = \\operatorname* { m i n } _ { \\theta } \\sum _ { T } L ( \\phi _ { T } , \\mathcal { D } _ { T } ^ { \\mathrm { v a l } } ) .\n$$",
524
+ "text_format": "latex",
525
+ "bbox": [
526
+ 299,
527
+ 607,
528
+ 699,
529
+ 641
530
+ ],
531
+ "page_idx": 4
532
+ },
533
+ {
534
+ "type": "text",
535
+ "text": "Here, $\\eta$ is the inner learning rate. Once this meta-objective is optimized, the resulting $\\theta ^ { * }$ acts as a prior from which fine-tuning can occur at test-time, using recent experience from ${ \\mathcal { D } } _ { T _ { \\mathrm { t e s t } } } ^ { \\mathrm { t r } }$ as follows: ",
536
+ "bbox": [
537
+ 173,
538
+ 648,
539
+ 828,
540
+ 678
541
+ ],
542
+ "page_idx": 4
543
+ },
544
+ {
545
+ "type": "equation",
546
+ "img_path": "images/20ae6d75d19f61f4ce776628d1ae181b206552450fe11c948169ba8f98225a06.jpg",
547
+ "text": "$$\n\\phi _ { T _ { \\mathrm { t e s t } } } = \\theta ^ { * } - \\eta \\nabla _ { \\theta ^ { * } } L ( \\theta ^ { * } , { \\mathcal { D } } _ { T _ { \\mathrm { t e s t } } } ^ { \\mathrm { t r } } ) .\n$$",
548
+ "text_format": "latex",
549
+ "bbox": [
550
+ 392,
551
+ 688,
552
+ 606,
553
+ 707
554
+ ],
555
+ "page_idx": 4
556
+ },
557
+ {
558
+ "type": "text",
559
+ "text": "Here, $\\phi _ { T _ { \\mathrm { t e s t } } }$ is adapted from the meta-learned prior $\\theta ^ { * }$ to be more representative for the current time. ",
560
+ "bbox": [
561
+ 178,
562
+ 713,
563
+ 820,
564
+ 729
565
+ ],
566
+ "page_idx": 4
567
+ },
568
+ {
569
+ "type": "text",
570
+ "text": "Although Finn et al. (2017) demonstrated this fast adaptation of deep neural networks and Nagabandi et al. (2018) extended this framework to model-based meta RL, these methods address adaptation in the $k$ -shot setting, always adapting directly from the meta-learned prior and not allowing further adaptation or specialization. In this work, we have extended these capabilities by enabling more evolution of knowledge through a temporally-extended online adaptation procedure. ",
571
+ "bbox": [
572
+ 174,
573
+ 734,
574
+ 823,
575
+ 806
576
+ ],
577
+ "page_idx": 4
578
+ },
579
+ {
580
+ "type": "text",
581
+ "text": "While our procedure for continual online learning is still initialized with this meta-training for $k$ - shot adaptation (i.e., MAML), we found that this prior was sufficient to enable effective continual online adaptation at test time. The intuitive rationale for this is that MAML trains the model to be able to change significantly using only a small number of datapoints and gradient steps. Note that this meta-trained prior can be used at test time in (a) a $k$ -shot setting, similar to how it was trained, or it can be used at test time by (b) taking substantially more gradient steps away from this prior. We show in Sec. 7 that our method outperforms both of these methods, but the mere ability to use this meta-learned prior in these ways makes the use of MAML enticing. ",
582
+ "bbox": [
583
+ 174,
584
+ 811,
585
+ 825,
586
+ 924
587
+ ],
588
+ "page_idx": 4
589
+ },
590
+ {
591
+ "type": "text",
592
+ "text": "We note that it is quite possible to modify the MAML algorithm to optimize the model directly with respect to the weighted updates discussed in Section 4.2. This simply requires computing the task weights (the E step) on each batch during meta-training, and then constructing a computation graph where all gradient updates are multiplied by their respective weights. Standard automatic differentiation software can then compute the corresponding meta-gradient. For short trial lengths, this is not substantially more complex than standard MAML; for longer trial lengths, truncated backpropagation is an option. Although such a meta-training procedure better matches the way that the model is used during online adaptation, we found that it did not substantially improve our results. While it’s possible that the difference might be more significant if meta-training for longerterm adaptation, this observation does suggest that simply meta-training with MAML is sufficient for enabling effective continuous online adaptation in non-stationary multi-task settings. To clarify, although this modified training procedure of incorporating the EM weight updates (during metatraining) did not explicitly improve our results, we see that test-time performance did indeed improve with using more data for the standard MAML meta-training procedure (see Appendix). ",
593
+ "bbox": [
594
+ 174,
595
+ 103,
596
+ 825,
597
+ 299
598
+ ],
599
+ "page_idx": 5
600
+ },
601
+ {
602
+ "type": "text",
603
+ "text": "6 APPLICATION TO MODEL-BASED RL ",
604
+ "text_level": 1,
605
+ "bbox": [
606
+ 174,
607
+ 327,
608
+ 513,
609
+ 344
610
+ ],
611
+ "page_idx": 5
612
+ },
613
+ {
614
+ "type": "text",
615
+ "text": "In our experiments, we apply MOLe to model-based reinforcement learning. RL in general aims to act in a way that maximizes the sum of future rewards. At each time step $t$ , the agent executes action $\\mathbf { a } _ { t } \\in A$ from state $\\mathbf { s } _ { t } \\in S$ , transitions to the next state $\\mathbf { s } _ { t + 1 }$ according the transition probabilities (i.e., dynamics) $p ( \\mathbf { s } _ { t + 1 } | \\mathbf { s } _ { t } , \\mathbf { a } _ { t } )$ and receives rewards $r _ { t } = r ( \\mathbf { s } _ { t } , \\mathbf { a } _ { t } )$ . The goal at each step is to execute the action $\\mathbf { a } _ { t }$ that maximizes the discounted sum of future rewards $\\sum _ { t ^ { \\prime } = t } ^ { \\infty } \\gamma ^ { t ^ { \\prime } - t } r ( \\mathbf { s } _ { t ^ { \\prime } } , \\mathbf { a } _ { t ^ { \\prime } } )$ , where discount factor $\\gamma \\in [ 0 , 1 ]$ prioritizes near-term rewards. In model-based RL, in particular, the predictions from a known or learned dynamics model are used to either learn a policy, or are used directly inside a planning algorithm to select actions that maximize reward. ",
616
+ "bbox": [
617
+ 173,
618
+ 364,
619
+ 825,
620
+ 493
621
+ ],
622
+ "page_idx": 5
623
+ },
624
+ {
625
+ "type": "text",
626
+ "text": "In our work, the underlying distribution that we aim to model is the dynamics distribution $p ( \\mathbf { s } _ { t + 1 } | \\mathbf { s } _ { t } , \\mathbf { a } _ { t } , T _ { t } )$ , where the unknown $T _ { t }$ represents the underlying settings (e.g., state of the system, external details, environmental perturbations, etc.). The goal for MOLe is to estimate this distribution with a predictive model $p _ { \\theta }$ . To instantiate MOLe in this context of model-based RL, we follow Algorithm 1 with the following specifications: ",
627
+ "bbox": [
628
+ 173,
629
+ 500,
630
+ 825,
631
+ 570
632
+ ],
633
+ "page_idx": 5
634
+ },
635
+ {
636
+ "type": "text",
637
+ "text": "(1) We set the input $\\mathbf { x } _ { t }$ to be the concatenation of $K$ previous states and actions, given by $\\mathbf { x } _ { t } ~ =$ $\\left[ \\mathbf { s } _ { t - K } , \\mathbf { a } _ { t - K } , \\ldots , \\mathbf { s } _ { t - 2 } , \\mathbf { a } _ { t - 2 } , \\mathbf { s } _ { t - 1 } , \\mathbf { a } _ { t - 1 } \\right]$ , and the output to be the corresponding next states $\\mathbf { y } _ { t } =$ $\\left[ \\mathbf { s } _ { t - K + 1 } , \\ldots , \\mathbf { s } _ { t - 1 } , \\mathbf { s } _ { t } \\right]$ . This provides us with a slightly larger batch of data for each online update, as compared to using only the data from the given time step. Since individual time steps at high frequency can be very noisy, using the past $K$ transitions helps to damp out the updates. ",
638
+ "bbox": [
639
+ 173,
640
+ 577,
641
+ 825,
642
+ 647
643
+ ],
644
+ "page_idx": 5
645
+ },
646
+ {
647
+ "type": "text",
648
+ "text": "(2) The predictive model $p _ { \\theta }$ represents each of these underlying transitions as an independent Gaussian such that $\\begin{array} { r } { p _ { \\theta } ( \\mathbf { y } _ { t } \\vert \\mathbf { x } _ { t } ) = \\prod _ { t ^ { \\prime } = t - K } ^ { t - 1 } p ( \\mathbf { s } _ { t ^ { \\prime } + 1 } \\vert \\mathbf { s } _ { t ^ { \\prime } } , \\mathbf { a } _ { t ^ { \\prime } } ) } \\end{array}$ , where each $p ( \\mathbf { s } _ { t + 1 } | \\mathbf { s } _ { t } , \\mathbf { a } _ { t } )$ is parameterized with a Gaussian given by mean $f _ { \\theta } ( \\mathbf { s } _ { t } , \\mathbf { a } _ { t } )$ and constant variance $\\sigma ^ { 2 }$ . We implement this mean dynamics function $f _ { \\theta } ( s _ { t } , a _ { t } )$ as a neural network model with three hidden layers each of dimension 500, and ReLU nonlinearities. ",
649
+ "bbox": [
650
+ 174,
651
+ 654,
652
+ 825,
653
+ 729
654
+ ],
655
+ "page_idx": 5
656
+ },
657
+ {
658
+ "type": "text",
659
+ "text": "(3) To calculate the new task parameter $\\theta _ { t + 1 } \\big ( T _ { \\mathrm { n e w } } \\big )$ , which may or may not be added to the task distribution $\\theta _ { t + 1 } ( T )$ , we use a set of $K$ nearby datapoints that is separate from the set $\\mathbf { x } _ { t }$ . This is done to avoid calculating the parameter using the same dataset on which it is evaluated, since $P _ { t } ( T _ { \\mathrm { n e w } } )$ comes from evaluating the parameter on the data $\\mathbf { x } _ { t }$ . ",
660
+ "bbox": [
661
+ 174,
662
+ 734,
663
+ 825,
664
+ 791
665
+ ],
666
+ "page_idx": 5
667
+ },
668
+ {
669
+ "type": "text",
670
+ "text": "(4) Unlike standard online streaming tasks where the next data point $\\mathbf { x } _ { t + 1 }$ is just given, the incoming data point (i.e., the next visited state) in this case is influenced by the predictive model itself. This is because, after the most likely task $T ^ { * }$ is selected from the possible tasks, the predictions from the model $p _ { \\theta _ { t + 1 } ( T ^ { * } ) }$ are used by the controller to plan over a sequence of future actions $\\mathbf { a } _ { 0 } , \\ldots , \\mathbf { a } _ { H }$ and select the actions that maximize future reward. Note that the planning procedure is based on stochastic optimization, following prior work (Nagabandi et al., 2018), and we provide more details in the appendix. Since the controller’s action choice determines the next data point, and since the controller’s choice is dependent on the estimated model parameters, it is even more crucial in this setting to appropriately adapt the model. ",
671
+ "bbox": [
672
+ 173,
673
+ 797,
674
+ 825,
675
+ 924
676
+ ],
677
+ "page_idx": 5
678
+ },
679
+ {
680
+ "type": "text",
681
+ "text": "5) Finally, note that we attain $\\theta ^ { * }$ from meta-training using model-agnostic meta-learning (MAML), as mentioned in the method above. However, in this case, MAML is performed in the loop of modelbased RL. In other words, the model parameters at a given iteration of meta-training are used by the controller to generate on-policy rollouts, the data from these rollouts is then added to the dataset for MAML, and this process repeats until the end of meta-training. ",
682
+ "bbox": [
683
+ 174,
684
+ 103,
685
+ 825,
686
+ 174
687
+ ],
688
+ "page_idx": 6
689
+ },
690
+ {
691
+ "type": "text",
692
+ "text": "7 EXPERIMENTS ",
693
+ "text_level": 1,
694
+ "bbox": [
695
+ 176,
696
+ 199,
697
+ 326,
698
+ 215
699
+ ],
700
+ "page_idx": 6
701
+ },
702
+ {
703
+ "type": "text",
704
+ "text": "The questions that we aimed to study from our experiments include: Can MOLe 1) autonomously discover some task structure amid a stream of non-stationary data? 2) adapt to tasks that are further outside of the task distribution than can be handled by a $k$ -shot learning approach? 3) recognize and revert to tasks it has seen before? 4) avoid overfitting to a recent task to prevent deterioration of performance upon the next task switch? 5) outperform other methods? ",
705
+ "bbox": [
706
+ 174,
707
+ 233,
708
+ 825,
709
+ 304
710
+ ],
711
+ "page_idx": 6
712
+ },
713
+ {
714
+ "type": "text",
715
+ "text": "To study these questions, we conduct experiments on agents in the MuJoCo physics engine (Todorov et al., 2012). The agents we used are a half-cheetah (S R21, A R6) and a hexapedal crawler (S R50, A R12). Using these agents, we design a number of challenging online learning problems that involve multiple sudden and gradual changes in the underlying task distribution, including tasks that are extrapolated from those seen previously, where online learning is criticial. Through these experiments, we aim to build problem settings that are representative of the types of disturbances and shifts that a real RL agent might encounter. ",
716
+ "bbox": [
717
+ 174,
718
+ 310,
719
+ 825,
720
+ 409
721
+ ],
722
+ "page_idx": 6
723
+ },
724
+ {
725
+ "type": "text",
726
+ "text": "We present results and analysis of our findings in the following three sections, and videos can be found at https://sites.google.com/berkeley.edu/onlineviameta. In our experiments, we compare to several alternative methods, including two approaches that leverage metatraining and two approaches that do not: ",
727
+ "bbox": [
728
+ 174,
729
+ 415,
730
+ 825,
731
+ 470
732
+ ],
733
+ "page_idx": 6
734
+ },
735
+ {
736
+ "type": "text",
737
+ "text": "(a) $\\mathbf { k }$ -shot adaptation with meta-learning: Always adapt from the meta-trained prior $\\theta ^ { * }$ , as typically done with meta-learning methods (Nagabandi et al., 2018). This method is often insufficient for adapting to tasks that are further out of distribution, and the adaptation is also not carried forward in time for future use. ",
738
+ "bbox": [
739
+ 174,
740
+ 472,
741
+ 825,
742
+ 525
743
+ ],
744
+ "page_idx": 6
745
+ },
746
+ {
747
+ "type": "text",
748
+ "text": "(b) continued adaptation with meta-learning: Always take gradient steps from the previous time step’s parameters. This method oftens overfits to recently observed tasks, so it should indicate the importance of our method effectively identifying task structure to avoid overfitting and enable recall. ",
749
+ "bbox": [
750
+ 174,
751
+ 526,
752
+ 823,
753
+ 580
754
+ ],
755
+ "page_idx": 6
756
+ },
757
+ {
758
+ "type": "text",
759
+ "text": "(c) model-based RL: Train a model on the same data as the methods above, using standard supervised learning, and keep this model fixed throughout the trials (i.e., no meta-learning and no adaptation). ",
760
+ "bbox": [
761
+ 174,
762
+ 582,
763
+ 821,
764
+ 622
765
+ ],
766
+ "page_idx": 6
767
+ },
768
+ {
769
+ "type": "text",
770
+ "text": "(d) model-based RL with online gradient updates: Use the same model from model-based RL (i.e., no meta-learning), but adapt it online using gradient-descent at run time. This is representative of commonly used dynamic evaluation methods (Rei, 2015; Krause et al., 2017; 2016; Fortunato et al., 2017). ",
771
+ "bbox": [
772
+ 174,
773
+ 623,
774
+ 825,
775
+ 679
776
+ ],
777
+ "page_idx": 6
778
+ },
779
+ {
780
+ "type": "text",
781
+ "text": "7.1 TERRAIN SLOPES ON HALF-CHEETAH ",
782
+ "text_level": 1,
783
+ "bbox": [
784
+ 176,
785
+ 702,
786
+ 478,
787
+ 715
788
+ ],
789
+ "page_idx": 6
790
+ },
791
+ {
792
+ "type": "text",
793
+ "text": "We start with the task of a half-cheetah (Fig. 1) agent, traversing terrains of differing slopes. The prior model is meta-trained on data from terrains with random slopes of low magnitudes, and the test trials are executed on difficult out-of-distribution tasks such as basins, steep hills, etc. As shown in Fig. 2, neither model-based RL nor model-based RL with online gradient updates perform well on these out-of-distribution tasks, even though those models were trained on the same data that the metatrained model received. The bad performance of the model-based RL approach indicates the need for model adaptation (as opposed to assuming a single model can encompass everything), while the bad performance of model-based RL with online gradient updates indicates the need for a meta-learned initialization to enable online learning with neural networks. ",
794
+ "bbox": [
795
+ 174,
796
+ 729,
797
+ 547,
798
+ 882
799
+ ],
800
+ "page_idx": 6
801
+ },
802
+ {
803
+ "type": "image",
804
+ "img_path": "images/7b5e09f6a56c60f5f20540bd0729eb16ef04bcfe7d8e0dbe38b81396c384d24d.jpg",
805
+ "image_caption": [
806
+ "Figure 1: Half-cheetah agent, shown traversing a landscape with ‘basins’ "
807
+ ],
808
+ "image_footnote": [],
809
+ "bbox": [
810
+ 563,
811
+ 752,
812
+ 821,
813
+ 825
814
+ ],
815
+ "page_idx": 6
816
+ },
817
+ {
818
+ "type": "text",
819
+ "text": "",
820
+ "bbox": [
821
+ 176,
822
+ 882,
823
+ 823,
824
+ 924
825
+ ],
826
+ "page_idx": 6
827
+ },
828
+ {
829
+ "type": "text",
830
+ "text": "For the three meta-learning and adaptation methods, we expect continued adaptation with metalearning to perform poorly due to continuous gradient steps causing it to overfit to recent data; that is, we expect that experience on the upward slopes to lead to deterioration of performance on downward slopes, or something similar. However, based on both our qualitative and quantitative results, we see that the meta-learning procedure seems to have initialized the agent with a parameter space in which these various “tasks” are not seen as substantially different, where online learning by SGD performs well. This suggests that the meta-learning process finds a task space where there is an easy skill transfer between slopes; thus, even when MOLe is faced with the option of switching tasks or adding new tasks to its dynamic latent task distribution, it chooses not to do so (Fig. 3). Unlike findings that we will see later, it is interesting that the discovered task space here does not correspond to human-distinguishable categorical labels. Finally, note that these tasks of changing slopes are not particularly similar to each other (and that the discovered task space is indeed useful), because the two non-meta-learning baselines do indeed fail on these test tasks despite having similar training performance on the shallow training slopes. ",
831
+ "bbox": [
832
+ 174,
833
+ 103,
834
+ 825,
835
+ 299
836
+ ],
837
+ "page_idx": 7
838
+ },
839
+ {
840
+ "type": "image",
841
+ "img_path": "images/d8be539aea62c0d5fa43e989d29aeea8f2f18b86b1c86b5e2cc05bfdd5a9624f.jpg",
842
+ "image_caption": [
843
+ "Figure 2: Results on half-cheetah terrain traversal. The poorly performing model-based RL shows that a single model is not sufficient, and model-based RL with online gradient updates shows that a meta-learned initialization is critical. The three meta-learning approaches perform similarly; however, the performance of $\\mathbf { k }$ -shot adaptation deteriorates when the task calls for taking multiple gradient steps away from the prior. "
844
+ ],
845
+ "image_footnote": [],
846
+ "bbox": [
847
+ 176,
848
+ 306,
849
+ 821,
850
+ 430
851
+ ],
852
+ "page_idx": 7
853
+ },
854
+ {
855
+ "type": "image",
856
+ "img_path": "images/deedbe04c1ee0a3b5065a3ea880aba53ef1d2792321b1870d44639ef923f1619.jpg",
857
+ "image_caption": [
858
+ "Figure 3: Latent task distribution over time for two half-cheetah landscape traversal tasks, where encountered terrain slopes vary within each run. Interestingly, we find that MOLe chooses to only use a single latent task variable to describe varying terrain. "
859
+ ],
860
+ "image_footnote": [],
861
+ "bbox": [
862
+ 191,
863
+ 498,
864
+ 800,
865
+ 597
866
+ ],
867
+ "page_idx": 7
868
+ },
869
+ {
870
+ "type": "text",
871
+ "text": "7.2 HALF-CHEETAH MOTOR MALFUNCTIONS ",
872
+ "text_level": 1,
873
+ "bbox": [
874
+ 174,
875
+ 661,
876
+ 504,
877
+ 676
878
+ ],
879
+ "page_idx": 7
880
+ },
881
+ {
882
+ "type": "text",
883
+ "text": "While the findings from the half-cheetah on sloped terrains illustrate that separate task parameters aren’t always necessary for what might externally seem like separate tasks, we also want to study agents that experience more drastically-changing non-stationary task distributions during their experience in the world. For this set of experiments, we train all models on data where a single actuator is selected at random to experience a malfunction during the rollout. In this case, malfunction means that the polarity or magnitude of actions applied to that actuator are altered. Fig. 4 shows the results of various methods on drastically out-of-distribution test tasks, such as altering all actuators at once. The left of Fig. 4 shows that when the task distribution during the test trials contains only a single task, such as ‘sign negative’ where all actuators are prescribed to be the opposite polarity, then continued adaptation performs well by repeatedly performing gradient updates on incoming data. However, as shown in the other tasks of Fig. 4, the performance of this continue adaptation substantially deteriorates when the agent experiences a non-stationary task distribution. Due to overspecialization on recent incoming data, such methods that continuously adapt tend to forget and lose previously existing skills. This overfitting and forgetting of past skills is also illustrated in the consistent performance deterioration shown in Fig. 4. MOLe, on the other hand, dynamically builds a probabilistic task distribution and allows adaptation to these difficult tasks, without forgetting past skills. We show a sample task setup in Fig. 5, where the agent experiences alternating periods of normal and crippled-leg operation. This plot shows the successful recognition of new tasks as well as old tasks; note that both the recognition and adaptation are all done online, without using a bank of past data to perform the adaptation, and without a human-specified set of task categories. ",
884
+ "bbox": [
885
+ 174,
886
+ 688,
887
+ 825,
888
+ 924
889
+ ],
890
+ "page_idx": 7
891
+ },
892
+ {
893
+ "type": "text",
894
+ "text": "",
895
+ "bbox": [
896
+ 174,
897
+ 103,
898
+ 826,
899
+ 146
900
+ ],
901
+ "page_idx": 8
902
+ },
903
+ {
904
+ "type": "image",
905
+ "img_path": "images/a595fdaa9d514075cf426bff0a322269763b5a5705e1550b8aa738bfdc8b83e8.jpg",
906
+ "image_caption": [
907
+ "Figure 4: Results on the motor malfunction trials, where different trials are shown task distributions that modulate at different frequencies (or stay constant, for the first category). Here, online learning is critical for good performance, k-shot adaptation is insufficient for such different tasks, and continued gradient steps leads to overfitting to recently seen data. "
908
+ ],
909
+ "image_footnote": [],
910
+ "bbox": [
911
+ 181,
912
+ 154,
913
+ 812,
914
+ 368
915
+ ],
916
+ "page_idx": 8
917
+ },
918
+ {
919
+ "type": "image",
920
+ "img_path": "images/89357b55a78c189008d7a6ae8c1c01f5bd34fb150c71a8e0075ec26418f9f77a.jpg",
921
+ "image_caption": [
922
+ "Figure 5: Latent task variable distribution over the course of an online learning trial where the underlying motor malfunction changes every 500 timesteps. We find that MOLe is able to successfully recover the task structure, recognize when the underlying task has changed, and recall previously seen tasks. "
923
+ ],
924
+ "image_footnote": [],
925
+ "bbox": [
926
+ 238,
927
+ 438,
928
+ 750,
929
+ 574
930
+ ],
931
+ "page_idx": 8
932
+ },
933
+ {
934
+ "type": "text",
935
+ "text": "7.3 CRIPPLING OF END EFFECTORS ON SIX-LEGGED CRAWLER ",
936
+ "text_level": 1,
937
+ "bbox": [
938
+ 176,
939
+ 640,
940
+ 627,
941
+ 655
942
+ ],
943
+ "page_idx": 8
944
+ },
945
+ {
946
+ "type": "text",
947
+ "text": "To further examine the effects of our continual online adaptation algorithm, we study another, more complex agent: a 6-legged crawler (Fig. 6). In these experiments, models are trained on random joints being crippled (i.e., unable to apply actuator commands). In Fig. 7, we present two illustrative test tasks: (1) the agent sees a set configuration of crippling for the duration of its testtime experience, and (2) the agent receives alternating periods of experience, between regions of normal operation and regions of having crippled legs. ",
948
+ "bbox": [
949
+ 174,
950
+ 666,
951
+ 678,
952
+ 765
953
+ ],
954
+ "page_idx": 8
955
+ },
956
+ {
957
+ "type": "image",
958
+ "img_path": "images/59b6e060525589935fe9ec62b8cf7fab970ef977170960b22e0bbd4a6b329428.jpg",
959
+ "image_caption": [
960
+ "Figure 6: Six-legged crawler robot, shown with crippled legs. "
961
+ ],
962
+ "image_footnote": [],
963
+ "bbox": [
964
+ 692,
965
+ 661,
966
+ 823,
967
+ 746
968
+ ],
969
+ "page_idx": 8
970
+ },
971
+ {
972
+ "type": "text",
973
+ "text": "The first setting is similar to data seen during training, and thus, we see that even the model-based RL and model based-RL with online gradient updates baselines do not fail. The methods that include both meta-learning and adaptation, however, do have higher performance. Furthermore, we see again that continued gradient steps in this case of a single-task setting is not detrimental. The second setting’s non-stationary task distribution (when the leg crippling is dynamic) illustrates the need for online adaptation (modelbased RL fails), the need for a good prior to adapt from (failure of model-based RL with online gradient updates), the harm of overfitting to recent experience and thus forgetting older skills (low performance of continued gradient steps), and the need for further adaptation away from the prior (limited performance of k-shot adaptation). With MOLe, this agent is able to build its own representation of “task” switches, and we see that this switch does indeed correspond to recognizing regions of leg crippling (left of Fig. 7.3). The plot of the cumulative sum of rewards (right of Fig. 7.3) of each of the three meta-learning plus adaptation methods includes this same task switch pattern every 500 steps: Here, we can clearly see that steps 500-1000 and 1500-2000 were the crippled regions. Continued gradient steps actually performs worse on the second and third times it sees normal operation, whereas MOLe is noticeably better as it sees the task more often. Note that this improvement of both skills is possible with MOLe, where development of one skill actually does not hinder the other. ",
974
+ "bbox": [
975
+ 173,
976
+ 771,
977
+ 678,
978
+ 813
979
+ ],
980
+ "page_idx": 8
981
+ },
982
+ {
983
+ "type": "text",
984
+ "text": "",
985
+ "bbox": [
986
+ 173,
987
+ 813,
988
+ 823,
989
+ 924
990
+ ],
991
+ "page_idx": 8
992
+ },
993
+ {
994
+ "type": "text",
995
+ "text": "",
996
+ "bbox": [
997
+ 173,
998
+ 103,
999
+ 825,
1000
+ 200
1001
+ ],
1002
+ "page_idx": 9
1003
+ },
1004
+ {
1005
+ "type": "text",
1006
+ "text": "Finally, we examine experiments where the crawler experiences (during each trial) walking straight, making turns, and sometimes having a crippled leg. The performance during the first 500 time steps of ”walking forward in a normal configuration” for continued gradient steps was comparable to MOLe $( + / - 1 0 \\%$ difference), but its performance during the last 500 time steps of ”walking forward in a normal configuration” was $200 \\%$ lower. Note this detrimental effect of performing updates without allowing for separate task specialization/adaptation. ",
1007
+ "bbox": [
1008
+ 174,
1009
+ 208,
1010
+ 825,
1011
+ 291
1012
+ ],
1013
+ "page_idx": 9
1014
+ },
1015
+ {
1016
+ "type": "image",
1017
+ "img_path": "images/f155efcc69da7cb54a1558ff4c0f61c8c77c66633c81bcf6269aad8c85b9e956.jpg",
1018
+ "image_caption": [
1019
+ "Figure 7: Quantitative results on crawler. For a fixed task, adaptation is not necessary and all methods perform well. In contrast, when tasks change dynamically within the trial, only MOLe effectively learns online. "
1020
+ ],
1021
+ "image_footnote": [],
1022
+ "bbox": [
1023
+ 238,
1024
+ 296,
1025
+ 753,
1026
+ 476
1027
+ ],
1028
+ "page_idx": 9
1029
+ },
1030
+ {
1031
+ "type": "image",
1032
+ "img_path": "images/df59312fc1ca548e169daec05d0aa2626faece93eb6c11981eac424d0d044ef3.jpg",
1033
+ "image_caption": [
1034
+ "Figure 8: Results on crawler experiments. Left: Online recognition of latent task probabilities for alternating periods of normal/crippled experience. Right: MOLe improves from seeing the same tasks multiple times. "
1035
+ ],
1036
+ "image_footnote": [],
1037
+ "bbox": [
1038
+ 187,
1039
+ 518,
1040
+ 808,
1041
+ 654
1042
+ ],
1043
+ "page_idx": 9
1044
+ },
1045
+ {
1046
+ "type": "text",
1047
+ "text": "8 DISCUSSION ",
1048
+ "text_level": 1,
1049
+ "bbox": [
1050
+ 174,
1051
+ 696,
1052
+ 310,
1053
+ 713
1054
+ ],
1055
+ "page_idx": 9
1056
+ },
1057
+ {
1058
+ "type": "text",
1059
+ "text": "We presented an online learning method for neural network models that can handle non-stationary, multi-task settings within each trial. Our method adapts the model directly with SGD, where an EM algorithm uses a Chinese restaurant process prior to maintain a distribution over tasks and handle non-stationarity. Although SGD generally makes for a poor online learning algorithm in the streaming setting for large parametric models such as deep neural networks, we observe that, by (1) meta-training the model for fast adaptation with MAML and (2) employing our online algorithm for probabilistic updates at test time, we can enable effective online learning with neural networks. In our experiments, we applied this approach to model-based RL, and we demonstrated that it could be used to adapt the behavior of simulated robots faced with various new and unexpected tasks. Our results showed that our method can develop its own notion of task, continuously adapt away from the prior as necessary (to learn even tasks that require more adaptation), and recall tasks it has seen before. While we use model-based RL as our evaluation domain, our method is general and could be applied to other streaming and online learning settings. An exciting direction for future work would be to apply our method to domains such as time series modeling and active online learning. ",
1060
+ "bbox": [
1061
+ 174,
1062
+ 729,
1063
+ 825,
1064
+ 924
1065
+ ],
1066
+ "page_idx": 9
1067
+ },
1068
+ {
1069
+ "type": "text",
1070
+ "text": "REFERENCES ",
1071
+ "text_level": 1,
1072
+ "bbox": [
1073
+ 176,
1074
+ 103,
1075
+ 285,
1076
+ 117
1077
+ ],
1078
+ "page_idx": 10
1079
+ },
1080
+ {
1081
+ "type": "text",
1082
+ "text": "Maruan Al-Shedivat, Trapit Bansal, Yuri Burda, Ilya Sutskever, Igor Mordatch, and Pieter Abbeel. Continuous adaptation via meta-learning in nonstationary and competitive environments. arXiv preprint arXiv:1710.03641, 2017. ",
1083
+ "bbox": [
1084
+ 176,
1085
+ 126,
1086
+ 823,
1087
+ 167
1088
+ ],
1089
+ "page_idx": 10
1090
+ },
1091
+ {
1092
+ "type": "text",
1093
+ "text": "Rahaf Aljundi, Punarjay Chakravarty, and Tinne Tuytelaars. Expert gate: Lifelong learning with a network of experts. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2017. ",
1094
+ "bbox": [
1095
+ 174,
1096
+ 176,
1097
+ 823,
1098
+ 219
1099
+ ],
1100
+ "page_idx": 10
1101
+ },
1102
+ {
1103
+ "type": "text",
1104
+ "text": "Anonymous. Modulating transfer between tasks in gradient-based meta-learning. 2019. URL https://openreview.net/forum?id $\\underline { { \\underline { { \\mathbf { \\Pi } } } } } =$ rkxLDyBuFX. under review. ",
1105
+ "bbox": [
1106
+ 171,
1107
+ 228,
1108
+ 823,
1109
+ 258
1110
+ ],
1111
+ "page_idx": 10
1112
+ },
1113
+ {
1114
+ "type": "text",
1115
+ "text": "Samy Bengio, Yoshua Bengio, Jocelyn Cloutier, and Jan Gecsei. On the optimization of a synaptic learning rule. In Optimality in Artificial and Biological Neural Networks, 1992. ",
1116
+ "bbox": [
1117
+ 173,
1118
+ 265,
1119
+ 823,
1120
+ 295
1121
+ ],
1122
+ "page_idx": 10
1123
+ },
1124
+ {
1125
+ "type": "text",
1126
+ "text": "David M Blei, Andrew Y Ng, and Michael I Jordan. Latent dirichlet allocation. Journal of machine Learning research, 3(Jan):993–1022, 2003. ",
1127
+ "bbox": [
1128
+ 174,
1129
+ 304,
1130
+ 823,
1131
+ 333
1132
+ ],
1133
+ "page_idx": 10
1134
+ },
1135
+ {
1136
+ "type": "text",
1137
+ "text": "Zdravko I Botev, Dirk P Kroese, Reuven Y Rubinstein, and Pierre LEcuyer. The cross-entropy method for optimization. In Handbook of statistics, volume 31, pp. 35–59. Elsevier, 2013. ",
1138
+ "bbox": [
1139
+ 173,
1140
+ 340,
1141
+ 823,
1142
+ 371
1143
+ ],
1144
+ "page_idx": 10
1145
+ },
1146
+ {
1147
+ "type": "text",
1148
+ "text": "Leon Bottou. Online learning and stochastic approximations. ´ On-line learning in neural networks, 17(9):142, 1998. ",
1149
+ "bbox": [
1150
+ 171,
1151
+ 378,
1152
+ 823,
1153
+ 407
1154
+ ],
1155
+ "page_idx": 10
1156
+ },
1157
+ {
1158
+ "type": "text",
1159
+ "text": "Tamara Broderick, Nicholas Boyd, Andre Wibisono, Ashia C Wilson, and Michael I Jordan. Streaming variational bayes. In Advances in Neural Information Processing Systems, pp. 1727–1735, 2013. ",
1160
+ "bbox": [
1161
+ 176,
1162
+ 416,
1163
+ 823,
1164
+ 459
1165
+ ],
1166
+ "page_idx": 10
1167
+ },
1168
+ {
1169
+ "type": "text",
1170
+ "text": "Julien Doyon and Habib Benali. Reorganization and plasticity in the adult brain during learning of motor skills. Current opinion in neurobiology, 15(2):161–167, 2005. ",
1171
+ "bbox": [
1172
+ 171,
1173
+ 468,
1174
+ 825,
1175
+ 497
1176
+ ],
1177
+ "page_idx": 10
1178
+ },
1179
+ {
1180
+ "type": "text",
1181
+ "text": "Yan Duan, John Schulman, Xi Chen, Peter L Bartlett, Ilya Sutskever, and Pieter Abbeel. Rl2: Fast reinforcement learning via slow reinforcement learning. arXiv:1611.02779, 2016. ",
1182
+ "bbox": [
1183
+ 176,
1184
+ 505,
1185
+ 823,
1186
+ 535
1187
+ ],
1188
+ "page_idx": 10
1189
+ },
1190
+ {
1191
+ "type": "text",
1192
+ "text": "John Duchi, Elad Hazan, and Yoram Singer. Adaptive subgradient methods for online learning and stochastic optimization. Journal of Machine Learning Research, 2011. ",
1193
+ "bbox": [
1194
+ 173,
1195
+ 542,
1196
+ 823,
1197
+ 571
1198
+ ],
1199
+ "page_idx": 10
1200
+ },
1201
+ {
1202
+ "type": "text",
1203
+ "text": "Chelsea Finn, Pieter Abbeel, and Sergey Levine. Model-agnostic meta-learning for fast adaptation of deep networks. International Conference on Machine Learning (ICML), 2017. ",
1204
+ "bbox": [
1205
+ 174,
1206
+ 580,
1207
+ 821,
1208
+ 609
1209
+ ],
1210
+ "page_idx": 10
1211
+ },
1212
+ {
1213
+ "type": "text",
1214
+ "text": "J Randall Flanagan and Alan M Wing. Modulation of grip force with load force during point-to-point arm movements. Experimental Brain Research, 95(1):131–143, 1993. ",
1215
+ "bbox": [
1216
+ 171,
1217
+ 617,
1218
+ 823,
1219
+ 647
1220
+ ],
1221
+ "page_idx": 10
1222
+ },
1223
+ {
1224
+ "type": "text",
1225
+ "text": "Meire Fortunato, Charles Blundell, and Oriol Vinyals. Bayesian recurrent neural networks. arXiv preprint arXiv:1704.02798, 2017. ",
1226
+ "bbox": [
1227
+ 174,
1228
+ 655,
1229
+ 823,
1230
+ 684
1231
+ ],
1232
+ "page_idx": 10
1233
+ },
1234
+ {
1235
+ "type": "text",
1236
+ "text": "Robert Herman. Neural control of locomotion, volume 18. Springer, 2017. ",
1237
+ "bbox": [
1238
+ 174,
1239
+ 693,
1240
+ 665,
1241
+ 709
1242
+ ],
1243
+ "page_idx": 10
1244
+ },
1245
+ {
1246
+ "type": "text",
1247
+ "text": "Matthew Hoffman, Francis R Bach, and David M Blei. Online learning for latent dirichlet allocation. In advances in neural information processing systems, pp. 856–864, 2010. ",
1248
+ "bbox": [
1249
+ 173,
1250
+ 717,
1251
+ 821,
1252
+ 747
1253
+ ],
1254
+ "page_idx": 10
1255
+ },
1256
+ {
1257
+ "type": "text",
1258
+ "text": "Amir Jafari, Amy Greenwald, David Gondek, and Gunes Ercal. On no-regret learning, fictitious play, and nash equilibrium. In ICML, volume 1, pp. 226–233, 2001. ",
1259
+ "bbox": [
1260
+ 171,
1261
+ 753,
1262
+ 823,
1263
+ 784
1264
+ ],
1265
+ "page_idx": 10
1266
+ },
1267
+ {
1268
+ "type": "text",
1269
+ "text": "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, 2017. ",
1270
+ "bbox": [
1271
+ 173,
1272
+ 791,
1273
+ 825,
1274
+ 848
1275
+ ],
1276
+ "page_idx": 10
1277
+ },
1278
+ {
1279
+ "type": "text",
1280
+ "text": "Ben Krause, Liang Lu, Iain Murray, and Steve Renals. Multiplicative lstm for sequence modelling. arXiv preprint arXiv:1609.07959, 2016. ",
1281
+ "bbox": [
1282
+ 173,
1283
+ 857,
1284
+ 820,
1285
+ 886
1286
+ ],
1287
+ "page_idx": 10
1288
+ },
1289
+ {
1290
+ "type": "text",
1291
+ "text": "Ben Krause, Emmanuel Kahembwe, Iain Murray, and Steve Renals. Dynamic evaluation of neural sequence models. CoRR, abs/1709.07432, 2017. ",
1292
+ "bbox": [
1293
+ 174,
1294
+ 895,
1295
+ 820,
1296
+ 924
1297
+ ],
1298
+ "page_idx": 10
1299
+ },
1300
+ {
1301
+ "type": "text",
1302
+ "text": "David Lopez-Paz et al. Gradient episodic memory for continual learning. In Advances in Neural Information Processing Systems, 2017. ",
1303
+ "bbox": [
1304
+ 171,
1305
+ 103,
1306
+ 825,
1307
+ 132
1308
+ ],
1309
+ "page_idx": 11
1310
+ },
1311
+ {
1312
+ "type": "text",
1313
+ "text": "Tsendsuren Munkhdalai and Hong Yu. Meta networks. International Conference on Machine Learning (ICML), 2017. ",
1314
+ "bbox": [
1315
+ 173,
1316
+ 140,
1317
+ 823,
1318
+ 170
1319
+ ],
1320
+ "page_idx": 11
1321
+ },
1322
+ {
1323
+ "type": "text",
1324
+ "text": "K. Murphy. Dynamic Bayesian Networks: Representation, Inference and Learning. PhD thesis, Dept. Computer Science, UC Berkeley, 2002. URL https://www.cs.ubc.ca/ ˜murphyk/Thesis/thesis.html. ",
1325
+ "bbox": [
1326
+ 176,
1327
+ 178,
1328
+ 823,
1329
+ 220
1330
+ ],
1331
+ "page_idx": 11
1332
+ },
1333
+ {
1334
+ "type": "text",
1335
+ "text": "Anusha Nagabandi, Ignasi Clavera, Simin Liu, Ronald S Fearing, Pieter Abbeel, Sergey Levine, and Chelsea Finn. Learning to adapt: Meta-learning for model-based control. arXiv preprint arXiv:1803.11347, 2018. ",
1336
+ "bbox": [
1337
+ 174,
1338
+ 228,
1339
+ 823,
1340
+ 272
1341
+ ],
1342
+ "page_idx": 11
1343
+ },
1344
+ {
1345
+ "type": "text",
1346
+ "text": "Devang K Naik and RJ Mammone. Meta-neural networks that learn by learning. In International Joint Conference on Neural Netowrks (IJCNN), 1992. ",
1347
+ "bbox": [
1348
+ 171,
1349
+ 280,
1350
+ 823,
1351
+ 309
1352
+ ],
1353
+ "page_idx": 11
1354
+ },
1355
+ {
1356
+ "type": "text",
1357
+ "text": "Cuong V Nguyen, Yingzhen Li, Thang D Bui, and Richard E Turner. Variational continual learning. arXiv:1710.10628, 2017. ",
1358
+ "bbox": [
1359
+ 171,
1360
+ 316,
1361
+ 823,
1362
+ 347
1363
+ ],
1364
+ "page_idx": 11
1365
+ },
1366
+ {
1367
+ "type": "text",
1368
+ "text": "A. Rao. A survey of numerical methods for optimal control. In Advances in the Astronautical Sciences, 2009. ",
1369
+ "bbox": [
1370
+ 171,
1371
+ 354,
1372
+ 823,
1373
+ 383
1374
+ ],
1375
+ "page_idx": 11
1376
+ },
1377
+ {
1378
+ "type": "text",
1379
+ "text": "Sachin Ravi and Hugo Larochelle. Optimization as a model for few-shot learning. In International Conference on Learning Representations (ICLR), 2017. ",
1380
+ "bbox": [
1381
+ 173,
1382
+ 392,
1383
+ 825,
1384
+ 421
1385
+ ],
1386
+ "page_idx": 11
1387
+ },
1388
+ {
1389
+ "type": "text",
1390
+ "text": "Sylvestre-Alvise Rebuffi, Alexander Kolesnikov, and Christoph H Lampert. icarl: Incremental classifier and representation learning. In Proc. CVPR, 2017. ",
1391
+ "bbox": [
1392
+ 173,
1393
+ 429,
1394
+ 823,
1395
+ 459
1396
+ ],
1397
+ "page_idx": 11
1398
+ },
1399
+ {
1400
+ "type": "text",
1401
+ "text": "Marek Rei. Online representation learning in recurrent neural language models. CoRR, abs/1508.03854, 2015. ",
1402
+ "bbox": [
1403
+ 171,
1404
+ 467,
1405
+ 825,
1406
+ 496
1407
+ ],
1408
+ "page_idx": 11
1409
+ },
1410
+ {
1411
+ "type": "text",
1412
+ "text": "Samuel Ritter, Jane X Wang, Zeb Kurth-Nelson, Siddhant M Jayakumar, Charles Blundell, Razvan Pascanu, and Matthew Botvinick. Been there, done that: Meta-learning with episodic recall. arXiv preprint arXiv:1805.09692, 2018. ",
1413
+ "bbox": [
1414
+ 174,
1415
+ 503,
1416
+ 823,
1417
+ 546
1418
+ ],
1419
+ "page_idx": 11
1420
+ },
1421
+ {
1422
+ "type": "text",
1423
+ "text": "Andrei A Rusu, Neil C Rabinowitz, Guillaume Desjardins, Hubert Soyer, James Kirkpatrick, Koray Kavukcuoglu, Razvan Pascanu, and Raia Hadsell. Progressive neural networks. arXiv:1606.04671, 2016. ",
1424
+ "bbox": [
1425
+ 173,
1426
+ 554,
1427
+ 823,
1428
+ 598
1429
+ ],
1430
+ "page_idx": 11
1431
+ },
1432
+ {
1433
+ "type": "text",
1434
+ "text": "Doyen Sahoo, Quang Pham, Jing Lu, and Steven CH Hoi. Online deep learning: Learning deep neural networks on the fly. arXiv preprint arXiv:1711.03705, 2017. ",
1435
+ "bbox": [
1436
+ 173,
1437
+ 606,
1438
+ 823,
1439
+ 636
1440
+ ],
1441
+ "page_idx": 11
1442
+ },
1443
+ {
1444
+ "type": "text",
1445
+ "text": "Adam Santoro, Sergey Bartunov, Matthew Botvinick, Daan Wierstra, and Timothy Lillicrap. Metalearning with memory-augmented neural networks. In International Conference on Machine Learning (ICML), 2016. ",
1446
+ "bbox": [
1447
+ 174,
1448
+ 643,
1449
+ 825,
1450
+ 686
1451
+ ],
1452
+ "page_idx": 11
1453
+ },
1454
+ {
1455
+ "type": "text",
1456
+ "text": "Jurgen Schmidhuber. Evolutionary principles in self-referential learning. Diploma thesis, Institut f. Informatik, Tech. Univ. Munich, 1987. ",
1457
+ "bbox": [
1458
+ 171,
1459
+ 694,
1460
+ 821,
1461
+ 724
1462
+ ],
1463
+ "page_idx": 11
1464
+ },
1465
+ {
1466
+ "type": "text",
1467
+ "text": "Florian Stimberg, Andreas Ruttor, and Manfred Opper. Bayesian inference for change points in dynamical systems with reusable states-a chinese restaurant process approach. In Artificial Intelligence and Statistics, pp. 1117–1124, 2012. ",
1468
+ "bbox": [
1469
+ 173,
1470
+ 732,
1471
+ 825,
1472
+ 775
1473
+ ],
1474
+ "page_idx": 11
1475
+ },
1476
+ {
1477
+ "type": "text",
1478
+ "text": "Sebastian Thrun. Lifelong learning algorithms. In Learning to learn. Springer, 1998. ",
1479
+ "bbox": [
1480
+ 173,
1481
+ 784,
1482
+ 732,
1483
+ 799
1484
+ ],
1485
+ "page_idx": 11
1486
+ },
1487
+ {
1488
+ "type": "text",
1489
+ "text": "Sebastian Thrun and Lorien Pratt. Learning to learn. Springer Science & Business Media, 1998. ",
1490
+ "bbox": [
1491
+ 173,
1492
+ 806,
1493
+ 803,
1494
+ 821
1495
+ ],
1496
+ "page_idx": 11
1497
+ },
1498
+ {
1499
+ "type": "text",
1500
+ "text": "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. ",
1501
+ "bbox": [
1502
+ 173,
1503
+ 830,
1504
+ 821,
1505
+ 872
1506
+ ],
1507
+ "page_idx": 11
1508
+ },
1509
+ {
1510
+ "type": "text",
1511
+ "text": "Jane X Wang, Zeb Kurth-Nelson, Dhruva Tirumala, Hubert Soyer, Joel Z Leibo, Remi Munos, Charles Blundell, Dharshan Kumaran, and Matt Botvinick. Learning to reinforcement learn. arXiv:1611.05763, 2016. ",
1512
+ "bbox": [
1513
+ 173,
1514
+ 881,
1515
+ 825,
1516
+ 924
1517
+ ],
1518
+ "page_idx": 11
1519
+ },
1520
+ {
1521
+ "type": "text",
1522
+ "text": "Yu-Xiong Wang, Deva Ramanan, and Martial Hebert. Growing a brain: Fine-tuning by increasing model capacity. In IEEE Computer Society Conference on Computer Vision and Pattern Recognition (CVPR), 2017. ",
1523
+ "bbox": [
1524
+ 174,
1525
+ 103,
1526
+ 823,
1527
+ 145
1528
+ ],
1529
+ "page_idx": 12
1530
+ },
1531
+ {
1532
+ "type": "text",
1533
+ "text": "Grady Williams, Andrew Aldrich, and Evangelos Theodorou. Model predictive path integral control using covariance variable importance sampling. CoRR, abs/1509.01149, 2015. ",
1534
+ "bbox": [
1535
+ 173,
1536
+ 155,
1537
+ 823,
1538
+ 184
1539
+ ],
1540
+ "page_idx": 12
1541
+ },
1542
+ {
1543
+ "type": "text",
1544
+ "text": "Friedemann Zenke, Ben Poole, and Surya Ganguli. Continual learning through synaptic intelligence. In International Conference on Machine Learning, 2017. ",
1545
+ "bbox": [
1546
+ 171,
1547
+ 193,
1548
+ 823,
1549
+ 222
1550
+ ],
1551
+ "page_idx": 12
1552
+ },
1553
+ {
1554
+ "type": "text",
1555
+ "text": "A TEST-TIME PERFORMANCE VS TRAINING DATA ",
1556
+ "text_level": 1,
1557
+ "bbox": [
1558
+ 174,
1559
+ 102,
1560
+ 604,
1561
+ 118
1562
+ ],
1563
+ "page_idx": 13
1564
+ },
1565
+ {
1566
+ "type": "text",
1567
+ "text": "We verify below that as the meta-trained models are trained with more data, their performance on test tasks does improve. ",
1568
+ "bbox": [
1569
+ 173,
1570
+ 133,
1571
+ 825,
1572
+ 161
1573
+ ],
1574
+ "page_idx": 13
1575
+ },
1576
+ {
1577
+ "type": "image",
1578
+ "img_path": "images/8fb33be7d0262c1dcdcebfe50bf3a6a0ac10d4f8f0a219f648284a241a788ddf.jpg",
1579
+ "image_caption": [
1580
+ "Figure 9: Performance on test tasks (i.e., unseen during training) of models that are meta-trained with differing amounts of data. Performance numbers here are normalized per agent, between 0 and 1. "
1581
+ ],
1582
+ "image_footnote": [],
1583
+ "bbox": [
1584
+ 282,
1585
+ 179,
1586
+ 717,
1587
+ 359
1588
+ ],
1589
+ "page_idx": 13
1590
+ },
1591
+ {
1592
+ "type": "text",
1593
+ "text": "B HYPERPARAMETERS ",
1594
+ "text_level": 1,
1595
+ "bbox": [
1596
+ 176,
1597
+ 416,
1598
+ 379,
1599
+ 431
1600
+ ],
1601
+ "page_idx": 13
1602
+ },
1603
+ {
1604
+ "type": "text",
1605
+ "text": "In all experiments, we use a dynamics model consisting of three hidden layers, each of dimension 500, with ReLU nonlinearities. The control method that we use is random-shooting model predictive control (MPC) where 1000 candidate action sequences each of horizon length $_ { \\mathrm { H = 1 0 } }$ are sampled at each time step, fed through the predictive model, and ranked by their expected reward. The first action step from the highest-scoring candidate action sequence is then executed before the entire planning process repeats again at the next time step. ",
1606
+ "bbox": [
1607
+ 173,
1608
+ 446,
1609
+ 825,
1610
+ 531
1611
+ ],
1612
+ "page_idx": 13
1613
+ },
1614
+ {
1615
+ "type": "text",
1616
+ "text": "Below, we list relevant training and testing parameters for the various methods used in our experiments. # Task/itr corresponds to the number of tasks sampled during each iteration of collecting data to train the model, and # TS/itr is the total number of times steps collected during that iteration (sum over all tasks). ",
1617
+ "bbox": [
1618
+ 174,
1619
+ 537,
1620
+ 825,
1621
+ 594
1622
+ ],
1623
+ "page_idx": 13
1624
+ },
1625
+ {
1626
+ "type": "table",
1627
+ "img_path": "images/34a39255716ec335c04314f32c96f9c2723e7317f1fc568befcb909e591c9c86.jpg",
1628
+ "table_caption": [
1629
+ "Table 1: Hyperparameters for train-time "
1630
+ ],
1631
+ "table_footnote": [],
1632
+ "table_body": "<table><tr><td>Iters</td><td>Epochs</td><td># Tasks/itr</td><td>#TS/itr</td><td>K</td><td>outer LR</td><td>inner LR (n)</td></tr><tr><td>12</td><td>50</td><td>16</td><td>2000-3000</td><td>16</td><td>0.001</td><td>0.01</td></tr><tr><td>12</td><td>50</td><td>16</td><td>2000-3000</td><td>16</td><td>0.001</td><td>N/A</td></tr></table>",
1633
+ "bbox": [
1634
+ 387,
1635
+ 643,
1636
+ 812,
1637
+ 683
1638
+ ],
1639
+ "page_idx": 13
1640
+ },
1641
+ {
1642
+ "type": "table",
1643
+ "img_path": "images/426f75c7be6c17510f24eee3ceba91c4a3dd1f1579c69047e6a271c7c8a1b0a8.jpg",
1644
+ "table_caption": [
1645
+ "Table 2: Hyperparameters for run-time "
1646
+ ],
1647
+ "table_footnote": [],
1648
+ "table_body": "<table><tr><td></td><td>α(CRP)</td><td>LR (model update)</td><td>K (previous data)</td></tr><tr><td>MOLe (ours)</td><td>1</td><td>0.01</td><td>16</td></tr><tr><td>continued adaptation with meta-learning</td><td>N/A</td><td>0.01</td><td>16</td></tr><tr><td>k-shot adaptation with meta-learning</td><td>N/A</td><td>0.01</td><td>16</td></tr><tr><td>model-based RL</td><td>N/A</td><td>N/A</td><td>N/A</td></tr><tr><td>model-based RL with online gradient updates</td><td>N/A</td><td>0.01</td><td>16</td></tr></table>",
1649
+ "bbox": [
1650
+ 300,
1651
+ 744,
1652
+ 691,
1653
+ 795
1654
+ ],
1655
+ "page_idx": 13
1656
+ },
1657
+ {
1658
+ "type": "text",
1659
+ "text": "C CONTROLLER ",
1660
+ "text_level": 1,
1661
+ "bbox": [
1662
+ 174,
1663
+ 102,
1664
+ 323,
1665
+ 118
1666
+ ],
1667
+ "page_idx": 14
1668
+ },
1669
+ {
1670
+ "type": "text",
1671
+ "text": "As mentioned in Section 6, we use the learned dynamics model in conjunction with a controller to select the next action to execute. The controller uses the learned model $f _ { \\theta }$ together with a reward function $r ( \\mathbf { s } _ { t } , \\mathbf { a } _ { t } )$ that encodes the desired task. Many methods could be used to perform this action selection, including cross entropy method (CEM) (Botev et al., 2013) or model predictive path integral control (MPPI) (Williams et al., 2015), but in our experiments, we use a random-sampling shooting method Rao (2009). ",
1672
+ "bbox": [
1673
+ 174,
1674
+ 132,
1675
+ 825,
1676
+ 218
1677
+ ],
1678
+ "page_idx": 14
1679
+ },
1680
+ {
1681
+ "type": "text",
1682
+ "text": "At each time step $t$ , we randomly generate $N$ candidate action sequences with $H$ actions in each sequence. ",
1683
+ "bbox": [
1684
+ 173,
1685
+ 223,
1686
+ 825,
1687
+ 251
1688
+ ],
1689
+ "page_idx": 14
1690
+ },
1691
+ {
1692
+ "type": "equation",
1693
+ "img_path": "images/e97bc8bea946288ab79a5af972b5692326184e2bc06668b3062d64549f1638ed.jpg",
1694
+ "text": "$$\nA _ { t } ^ { i } = \\{ \\mathbf { a } _ { t } ^ { i } , \\dots , \\mathbf { a } _ { t + H } ^ { i } \\}\n$$",
1695
+ "text_format": "latex",
1696
+ "bbox": [
1697
+ 424,
1698
+ 250,
1699
+ 573,
1700
+ 268
1701
+ ],
1702
+ "page_idx": 14
1703
+ },
1704
+ {
1705
+ "type": "text",
1706
+ "text": "We then use the learned dynamics model to predict the resulting states of executing these candidate action sequences. ",
1707
+ "bbox": [
1708
+ 176,
1709
+ 270,
1710
+ 821,
1711
+ 297
1712
+ ],
1713
+ "page_idx": 14
1714
+ },
1715
+ {
1716
+ "type": "equation",
1717
+ "img_path": "images/bfb483e96be78dc2e44921c83a86f743f8be964b9f7ba46008470351d06f1317.jpg",
1718
+ "text": "$$\nS ^ { i } = \\{ \\hat { \\mathbf { s } } _ { t + 1 } ^ { i } , \\dotsc , \\hat { \\mathbf { s } } _ { t + H + 1 } ^ { i } \\} \\mathrm { ~ w h e r e ~ } \\hat { \\mathbf { s } } _ { p + 1 } ^ { i } = f _ { \\theta } ( \\hat { \\mathbf { s } } _ { p } ^ { i } , \\mathbf { a } _ { p } ^ { i } )\n$$",
1719
+ "text_format": "latex",
1720
+ "bbox": [
1721
+ 323,
1722
+ 295,
1723
+ 674,
1724
+ 315
1725
+ ],
1726
+ "page_idx": 14
1727
+ },
1728
+ {
1729
+ "type": "text",
1730
+ "text": "Next, we use the reward function to select the action sequence with the highest associated predicted reward. ",
1731
+ "bbox": [
1732
+ 179,
1733
+ 318,
1734
+ 823,
1735
+ 343
1736
+ ],
1737
+ "page_idx": 14
1738
+ },
1739
+ {
1740
+ "type": "equation",
1741
+ "img_path": "images/5d81321822e6ecb443c80b37f3cad1442d758fea815d4db4b4a64c660871c796.jpg",
1742
+ "text": "$$\ni ^ { * } = \\operatorname * { a r g m a x } _ { i } \\sum _ { t ^ { \\prime } = t } ^ { t ^ { \\prime } = t + H } r ( \\hat { \\mathbf { s } } _ { t ^ { \\prime } } ^ { i } , \\mathbf { a } _ { t ^ { \\prime } } ^ { i } )\n$$",
1743
+ "text_format": "latex",
1744
+ "bbox": [
1745
+ 395,
1746
+ 340,
1747
+ 602,
1748
+ 386
1749
+ ],
1750
+ "page_idx": 14
1751
+ },
1752
+ {
1753
+ "type": "text",
1754
+ "text": "Next, rather than executing the entire sequence $A _ { t } ^ { i ^ { * } }$ of selected optimal actions, we use a model predictive control (MPC) framework to execute only the first action $\\mathbf { a } _ { t } ^ { i ^ { * } }$ from the current state $\\mathbf { s } _ { t }$ . We then replan at the next time step; This use of MPC can compensate for model inaccuracies by preventing accumulating errors, since we replan at each time step using updated state information. ",
1755
+ "bbox": [
1756
+ 174,
1757
+ 390,
1758
+ 825,
1759
+ 449
1760
+ ],
1761
+ "page_idx": 14
1762
+ }
1763
+ ]
parse/train/HyxAfnA5tm/HyxAfnA5tm_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/HyxAfnA5tm/HyxAfnA5tm_model.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/SkPoRg10b/SkPoRg10b.md ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/SkPoRg10b/SkPoRg10b_content_list.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/SkPoRg10b/SkPoRg10b_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/SkPoRg10b/SkPoRg10b_model.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/fLnsj7fpbPI/fLnsj7fpbPI.md ADDED
@@ -0,0 +1,300 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # PettingZoo: A Standard API for Multi-Agent Reinforcement Learning
2
+
3
+ J. K. Terry∗ † j.k.terry@swarmlabs.com
4
+
5
+ Benjamin Black∗ † benjamin.black@swarmlabs.com
6
+
7
+ Nathaniel Grammel† ngrammel@umd.edu
8
+
9
+ Mario Jayakumar† mariojay@umd.edu
10
+
11
+ Ananth Hari‡ ahari1@umd.edu
12
+
13
+ Ryan Sullivan∗ † ryan.sullivan@swarmlabs.com
14
+
15
+ Luis Santos§ lss@umd.edu
16
+
17
+ Rodrigo Perez ¶ rlazcano@umd.edu
18
+
19
+ Caroline Horsch∗ † caroline.horsch@swarmlabs.com
20
+
21
+ Clemens Dieffendahl k dieffendahl@campus.tu-berlin.de
22
+
23
+ Niall L. Williams† niallw@umd.edu
24
+
25
+ Yashas Lokesh† yashloke@umd.edu
26
+
27
+ Praveen Ravi† pravi@umd.edu
28
+
29
+ # Abstract
30
+
31
+ This paper introduces the PettingZoo library and the accompanying Agent Environment Cycle (“AEC”) games model. PettingZoo is a library of diverse sets of multi-agent environments with a universal, elegant Python API. PettingZoo was developed with the goal of accelerating research in Multi-Agent Reinforcement Learning (“MARL”), by making work more interchangeable, accessible and reproducible akin to what OpenAI’s Gym library did for single-agent reinforcement learning. PettingZoo’s API, while inheriting many features of Gym, is unique amongst MARL APIs in that it’s based around the novel AEC games model. We argue, in part through case studies on major problems in popular MARL environments, that the popular game models are poor conceptual models of games commonly used in MARL and accordingly can promote confusing bugs that are hard to detect, and that the AEC games model addresses these problems.
32
+
33
+ # 1 Introduction
34
+
35
+ Multi-Agent Reinforcement Learning (MARL) has been behind many of the most publicized achievements of modern machine learning — AlphaGo Zero [Silver et al., 2017], OpenAI Five [OpenAI, 2018], AlphaStar [Vinyals et al., 2019]. These achievements motivated a boom in MARL research, with Google Scholar indexing 9,480 new papers discussing multi-agent reinforcement learning in 2020 alone. Despite this boom, conducting research in MARL remains a significant engineering challenge. A large part of this is because, unlike single agent reinforcement learning which has OpenAI’s Gym, no de facto standard API exists in MARL for how agents interface with environments. This makes the reuse of existing learning code for new purposes require substantial effort, consuming researchers’ time and preventing more thorough comparisons in research. This lack of a standardized API has also prevented the proliferation of learning libraries in MARL. While a massive number of Gym-based single-agent reinforcement learning libraries or code bases exist (as a rough measure 669 pip-installable packages depend on it at the time of writing GitHub [2021]), only 5 MARL libraries with large user bases exist [Lanctot et al., 2019, Weng et al., 2020, Liang et al., 2018, Samvelyan et al., 2019, Nota, 2020]. The proliferation of these Gym based learning libraries has proved essential to the adoption of applied RL in fields like robotics or finance and without them the growth of applied MARL is a significantly greater challenge. Motivated by this, this paper introduces the PettingZoo library and API, which was created with the goal of making research in MARL more accessible and serving as a multi-agent version of Gym.
36
+
37
+ Prior to PettingZoo, the numerous single-use MARL APIs almost exclusively inherited their design from the two most prominent mathematical models of games in the MARL literature—Partially Observable Stochastic Games (“POSGs”) and Extensive Form Games (“EFGs”). During our development, we discovered that these common models of games are not conceptually clear for multi-agent games implemented in code and cannot form the basis of APIs that cleanly handle all types of multi-agent environments.
38
+
39
+ To solve this, we introduce a new formal model of games, Agent Environment Cycle (“AEC”) games that serves as the basis of the PettingZoo API. We argue that this model is a better conceptual fit for games implemented in code. and is uniquely suitable for general MARL APIs. We then prove that any AEC game can be represented by the standard POSG model, and that any POSG can be represented by an AEC game. To illustrate the importance of the AEC games model, this paper further covers two case studies of meaningful bugs in popular MARL implementations. In both cases, these bugs went unnoticed for a long time. Both stemmed from using confusing models of games, and would have been made impossible by using an AEC games based API.
40
+
41
+ The PettingZoo library can be installed via pip install pettingzoo, the documentation is available at https://www.pettingzoo.ml, and the repository is available at https://github.com/ Farama-Foundation/PettingZoo.
42
+
43
+ # 2 Background and Related Works
44
+
45
+ Here we briefly survey the state of modeling and APIs in MARL, beginning by briefly looking at Gym’s API (Figure 1). This API is the de facto standard in single agent reinforcement learning, has largely served as the basis for subsequent multi-agent APIs, and will be compared to later.
46
+
47
+ import gym
48
+ env $=$ gym.make(’CartPole-v0’)
49
+ observation $=$ env.reset()
50
+ for _ in range(1000): action $=$ policy(observation) observation, reward, done, info $=$ env.step(action)
51
+ from ray.rllib.examples.env.multi_agent import MultiAgentCartPole
52
+ env $=$ MultiAgentCartPole()
53
+ observation $=$ env.reset()
54
+ for _ in range(1000): actions $=$ policies(agents, observation) observation, rewards, dones, infos $=$ env.step(actions)
55
+
56
+ The Gym API is a fairly straightforward Python API that borrows from the POMDP conceptualization of RL. The API’s simplicity and conceptual clarity has made it highly influential, and it naturally accompanying the pervasive POMDP model that’s used as the pervasive mental and mathematical model of reinforcement learning [Brockman et al., 2016]. This makes it easier for anyone with an understanding of the RL framework to understand Gym’s API in full.
57
+
58
+ # 2.1 Partially Observable Stochastic Games and RLlib
59
+
60
+ Multi-agent reinforcement learning does not have a universal mental and mathematical model like the POMDP model in single-agent reinforcement learning. One of the most popular models is the partially observable stochastic game (“POSG”). This model is very similar to, and strictly more general than, multi-agent MDPs [Boutilier, 1996], Dec-POMDPs [Bernstein et al., 2002], and Stochastic (“Markov”) games [Shapley, 1953]). In a POSG, all agents step together, observe together, and are rewarded together. The full formal definition is presented in Appendix C.1
61
+
62
+ This model of simultaneous stepping naturally translates into Gym-like APIs, where the actions, observations, rewards, and so on are lists or dictionaries of individual values for agents. This design choice has become the standard for MARL outside of strictly turn-based games like poker, where simultaneous stepping would be a poor conceptual fit [Lowe et al., 2017, Zheng et al., 2017, Gupta et al., 2017, Liu et al., 2019, Liang et al., 2018, Weng et al., 2020]. One example of this is shown in Figure 2 with the multi-agent API in RLlib [Liang et al., 2018], where agent-keyed dictionaries of actions, observations and rewards are passed in a simple extension of the Gym API.
63
+
64
+ This model has made it much easier to apply single agent RL methods to multi-agent settings. However, there are two immediate problems with this model:
65
+
66
+ 1. Supporting strictly turn-based games like chess requires constantly passing dummy actions for non-acting agents (or using similar tricks).
67
+ 2. Changing the number of agents for agent death or creation is very awkward, as learning code has to cope with lists suddenly changing sizes.
68
+
69
+ # 2.2 OpenSpiel and Extensive Form Games
70
+
71
+ In the cases of strictly turn based games where POSG models are poorly suited (e.g. Chess), MARL researchers generally mathematically model the games as Extensive Form Games (“EFG”). The EFG represents games as a tree, explicitly representing every possible sequence of actions as a root to leaf path in the tree. Stochastic aspects of a game (or MARL environment) are captured by adding a “Nature” player (sometimes also called “Chance”) which takes actions according to some given probability distribution. For a full definition of EFGs, we refer the reader to Osborne and Rubinstein [1994] or Appendix C.2. OpenSpiel [Lanctot et al., 2019], a major library with a large collection of classical board and card games for MARL bases their API off of the EFG paradigm, the API of which is shown in Figure 3.
72
+
73
+ ![](images/70c25986840df1eba65364b1c6386afbae1233f7f89c061680b964fe28cb9212.jpg)
74
+ Figure 3: An example of the basic usage of OpenSpiel
75
+
76
+ The EFG model has been successfully used for solving problems involving theory of mind with methods like game theoretic analysis and tree search. However, for application in general MARL problems, three immediate concerns arise with the EFG model:
77
+
78
+ 1. The model, and the corresponding API, is very complex compared to that of POSGs, and isn’t suitable for beginners the way Gym is—this environment API is much more complicated than Gym’s API or RLLib’s POSG API for example. Furthermore, due to the complexity of the EFG model, reinforcement learning researchers don’t ubiquitously use it as a mental model of games in the same way that they use the POSG or POMDP model. 2. The formal definition only includes rewards at the end of games, while reinforcement learning often requires frequent rewards. While this is possible to work around in the API implementation, it is not ideal.
79
+
80
+ 3. The OpenSpiel API does not handle continuous actions (a common and important case in RL), though this was a choice that is not inherent to the EFG model.
81
+
82
+ It’s also worth briefly noting that some simple strictly turn based games are modeled with the single-agent Gym API, with the environment alternating which agent is controlled, [Ha, 2020]. This approach is unable to reasonably scale beyond two agents due to the difficulties of handling changes in agent order (e.g. Uno), agent death, and agent creation.
83
+
84
+ # 3 PettingZoo Design Goals
85
+
86
+ Our development of PettingZoo both as a general library and an API centered around the following goals.
87
+
88
+ # 3.1 Be like Gym
89
+
90
+ In PettingZoo, we wanted to leverage Gym’s ubiquity, simplicity and universality. This created two concrete goals for us:
91
+
92
+ • Make the API look and feel like Gym, and relatedly make the API pythonic and simple • Include numerous reference implementations of games with the main package
93
+
94
+ Reusing as many design metaphors from Gym as possible will help its massive existing user base to almost instantly understand PettingZoo’s API. Similarly, for an API to become standardized, it must support a large collection of useful environments to attract users and for adoption to begin, similar to what Gym did.
95
+
96
+ # 3.2 Be a Universal API
97
+
98
+ If there is to be a Gym-like API for MARL, it has to be able to support all use cases and types of environments. Accordingly, several technically difficult cases exist that have to be carefully considered:
99
+
100
+ • Environments with large numbers of agents
101
+ • Environments with agent death and creation
102
+ • Environments where different agents can be chosen to participate in each episode
103
+ • Learning methods that require access to specialty low level features
104
+
105
+ Two related softer design goals for universal design are ensuring the API is simple enough for beginners to easily use, and making the API easily changeable if the direction of research in the field dramatically changes.
106
+
107
+ # 4 Case Studies of Problems With The POSG Model in MARL
108
+
109
+ To supplement the description of the problems with the POSG models described in Section 2.1, we overview problems with basing APIs around these models that could theoretically occur in software games, and then examine real cases of those problems occurring in popular MARL environments. We specifically focus on POSGs here because EFG based APIs are extraordinarily rare (OpenSpiel is the only major one), while POSG based ones are almost universal.
110
+
111
+ # 4.1 POSGs Don’t Allow Access To Information You Should Have
112
+
113
+ Another problem with modeling environments using simultaneous actions in the POSG model is that all of an agent’s rewards (from all sources) are summed and returned all at once. In a multi-agent game though, this combined reward is often the composite reward from the actions of other agentss and the environment. Similarly, you might want to be able to attribute the source of this reward for various learning reasons, or for debugging purposes to find out the origin of your rewards. However, in thinking about reward origins, having all rewards emitted at once proves to be very confusing because rewards from different sources are all combined. Accessing this information via an API modeled after a POSG requires deviating from the model. This would come in the form of returning a 2D array of rewards instead of a list, which would be difficult to standardize and inconvenient for learning code to parse.
114
+
115
+ A notable case where this caused an issue in practice is in the popular pursuit gridworld environment from Gupta et al. [2017], shown in Figure 4. In it, 8 red controllable pursuer must work together to surround and capture 30 randomly moving blue evaders. The action space of each pursuer is discrete (cardinal directions or do nothing), and the observation space is a $7 \times 7$ box centered around a pursuer (depicted by the orange box). When an evader is surrounded on all sides by pursuers or the game boundaries, each contributing pursuer gets a reward of 5.
116
+
117
+ ![](images/52693d0491b6e3da93aaa3b5a608d0c8ee2b400ac0f4db5965d70fc260f5c10f.jpg)
118
+ Figure 4: The pursuit environment from Gupta et al. [2017].
119
+
120
+ In pursuit, pursuers move first, and then evaders move randomly, before it’s determined if an evader is captured and rewards are emitted. Thus an evader that “should have” been captured is not actually captured. Having the evaders move second isn’t a bug, it’s just way of adding complexity to the classic genre of pursuer/evader multi-agent environments [Vidal et al., 2002], and is representative of real problems. When pursuit is viewed as an AEC game, we’re forced to attribute rewards to individual steps, and the breakdown becomes pursuers receiving deterministic rewards from surrounding the evader, and then random reward due to the evader moving after. Removing this random component of the reward (the part caused by the evaders action after the pursuers had already moved), should then lead to superior performance. In this case the problem was so innocuous that fixing it required switching two lines of code where their order made no obvious difference. We experimentally validate this performance improvement in Appendix A.1, showing that on average this change resulted in up to a $22 \%$ performance in the expected reward of a learned policy.
121
+
122
+ Bugs of this family could easily happen in almost any MARL environment, and analyzing and preventing them is made much easier when using the POSG model. Because every agent’s rewards are summed together in the POSG model, this specific problem when looking at the code was extraordinarily non-obvious, whereas when forced to attribute the reward of individual agents this becomes clear. Moreover if an existing environment had this problem, by exposing the actual sources of rewards to learning code researchers are able to remove differing sources of reward to more easily find and remove bugs like this, and in principle learning algorithms could be developed that automatically differently weighted different sources of reward.
123
+
124
+ # 4.2 POSGs Based APIs Are Not Conceptually Clear For Games Implemented In Code
125
+
126
+ Introducing race conditions is a very easy mistake to make in MARL code in practice, and this occurs because simultaneous models of multi-agent games are not representative of how game code normally executes. This stems from a very common scenario in multi-agent environments where two agents are able to take conflicting actions (i.e. moving into the same space). This discrepancy has to be resolved by the environment (i.e. collision handling); which we call “tie-breaking.”
127
+
128
+ Consider an environment with two agents, Alice and Bob, in which Alice steps first and tie-breaking is biased in Alice’s favor. If such an environment were assumed to have simultaneous actions, then observations for both agents would be taken before either acted, causing the observation Bob acts on to no longer be an accurate representation of the environment if a conflict with biased tie-breaking occurs. For example, if both agents tried to step into the same square and Alice got the square because she was first in the list, Bob’s observation before acting was effectively inaccurate and the environment was not truly parallel. This behavior is a true race condition—the result of stepping through the environment can inadvertently differ depending on the internal resolution order of agent actions.
129
+
130
+ In any environment that’s even slightly complex, a tremendous number of instances where tie-breaking must be handled will typically occur. In any cases where a single one is missed, the environment will have race conditions that your code will attempt to learn. While finding these will always be important, a valuable tool to mitigate these possibilities is to use an API that treats each agent as acting sequentially, returning new observations afterwards. This entirely prevents the opportunity for introducing race conditions. Moreover, this entire problem stems from the fact that using APIs that model agents as updating sequentially for software MARL environments generally makes more conceptual sense than modeling the updates as simultaneous—unless the authors of environments use very complex parallelization, the environments will actually be updated one agent at a time. It is worth mentioning that this race condition cannot occur in an environment simulated in the physical world with continuous time or a simulated environment with a sufficient amount of observation delay (though most actively researched environment in MARL do not currently have any observation delay).
131
+
132
+ In Appendix A.1 we go through a case study of a race condition like this happening in the open source implementation of the social sequential dilemma game environments [Vinitsky et al., 2019]. These are popular multi-agent grid world environments intended to study emergent behaviors for various forms of resource management, and has imperfect tie-breaking in a case where two agents try to act on resources in the same grid while using a simultaneous API. This bug in particular illustrates how extraordinarily difficult making all tie-breaking truly unbiased is in practice even for fairly simple environments. We defer this to the appendix as explaining the specific origin requires a large amount of exposition and diagrams about the rules of the environment.
133
+
134
+ # 5 The Agent Environment Cycle Games Model
135
+
136
+ Motivated by the problems with applying the POSG and EFG models to MARL APIs, we developed the Agent Environment Cycle (“AEC”) Game. In this model, agents sequentially see their observation, agents take actions, rewards are emitted from the other agents, and the next agent to act is chosen. This is effectively a sequentially stepping form of the POSG model.
137
+
138
+ Modeling multi-agent environments sequentially for APIs has numerous benefits:
139
+
140
+ • It allows for clearer attribution of rewards to different origins, allowing for various learning improvements, as described in Section 4.1.
141
+ • It prevents developers adding confusing and easy-to-introduce race conditions, as described in Section 4.2.
142
+ • It more closely models how computer games are executed in code, as described in Section 4.2.
143
+ • It formally allows for rewards after every step as is required in RL, but is not generally a part of the EFG model, as discussed in Section 2.2.
144
+ • It is simple enough to serve as a mental model, especially for beginners, unlike the EFG model as discussed in Section 2.2 and illustrated in the definition in Appendix C.2.
145
+ • Changing the number of agents for agent death or creation is less awkward, as learning code does not have to account for lists constantly changing sizes, as discussed in Section 2.1.
146
+ • It is the least bad option for a universal API, compared to simultaneous stepping, as alluded to in Section 2.1. Simultaneous stepping requires the use of no-op actions if not all agents can act which are very difficult to deal with, whereas sequentially stepping agents that could all act simultaneously and queuing up their actions is not especially inconvenient.
147
+
148
+ In Appendix C.3 we mathematically formalize the AEC games model, however understanding the formalism in full is not essential to understanding the paper. In Appendix D we further prove that for every AEC game an equivalent POSG exists and that for every POSG an equivalent AEC game exists. This shows that the AEC games model is as powerful a model as the most common current model of multi-agent environments.
149
+
150
+ One additional conceptual feature of the AEC games model exists that we have not previously discussed because it does not usually play a role in APIs (see Section 6.4). In the AEC games model, we deviate from the POSG model by introducing the “environment” agent, which is analogous to the Nature agent from EFGs. When this agent acts in the model it indicates the updating of the environment itself, realizing and reacting to submitting agent actions. This allows for a more comprehensive attribution of rewards, causes of agent death, and discussion of games with strange updating rules and race conditions. An example of the transitions for Chess is shown in Figure 5, which serves as the inspiration for the name “agent environment cycle”.
151
+
152
+ ![](images/3b6aeeae2e236df4f04d92bf9603ef601088fc4b38a4228c5fca08dfda53be97.jpg)
153
+ Figure 5: The AEC diagram of Chess
154
+
155
+ # 6 API Design
156
+
157
+ # 6.1 Basic API
158
+
159
+ The PettingZoo API is shown in Figure 6, and the strong similarities to the Gym API (Figure 1) should be obvious — each agent provides an action to a step function and receives observation, reward, done, info as the return values. The observation and state spaces also use the the exact same space objects as Gym. The render and close methods also function identically to Gym’s, showing a current visual frame representing the environment to the screen whenever called. The reset method similarly has identical function to Gym — it resets the environment to a starting configuration after being played through. PettingZoo really only has two deviations from the regular Gym API — the last and agent_iter methods and the corresponding iteration logic.
160
+
161
+ ![](images/3015aeb365f3962b6c458342098e437e911a511eb441a12e04a525bb5741219f.jpg)
162
+ Figure 6: An example of the basic usage of Pettingzoo
163
+
164
+ # 6.2 The agent_iter Method
165
+
166
+ The agent_iter method is a generator method of an environment that returns the next agent that the environment will be acting upon. Because the environment is providing the next agent to act, this cleanly abstracts away any issues surrounding changing agent orders, agent generation, and agent death. This generation also parallels the functionality of the next agent function from the AEC games model. This method, combined with one agent acting at once, allows for the support of every conceivable variation of the set of agents changing.
167
+
168
+ # 6.3 The last Method
169
+
170
+ An odd aspect of multi-agent environments is that from the perspective of one agent, the other agents are part of the environment. Whereas in the single agent case the observation and rewards can be given immediately, in the multi-agent case an agent has to wait for all other agents to act before it’s observation, reward, done and info can be fully determined. For this reason, these values are given by the last method, and they can then be passed into a policy to choose an action. Less robust implementations would not allow for features like changing agent orders (like the reverse card in Uno).
171
+
172
+ # 6.4 Additional API Features
173
+
174
+ The agents attribute is a list of all agents in the environment, as strings. The rewards, dones, infos attributes are agent-keyed dictionaries for each attribute (note that the rewards are the instantaneous ones resulting from the most recent action). These allow access to agent properties at all points on a trajectory, regardless of which is selected. The action_space(agent) and observation_space(agent) functions return the static action and observation spaces respectively for the agent given as an argument. The observe(agent) method provides the observation for a single agent by passing its name as an argument, which can be useful if you need to observe an agent in an unusual context. The state method is an optional method returns the global state of an environment, as is required for centralized critic methods. The agent_selection method returns the agent that can currently be acted upon per agent_iter.
175
+
176
+ The motivation for allowing access to all these lower level pieces of information is to let researchers to attempt novel, unusual experiments. The space of multi-agent RL has not yet been comprehensively explored, and there are many perfectly plausible reasons you might want access to other agents rewards, observations, and so on. For an API to be universal in an emerging field, it inherently has to allow access to all the information researchers could plausibly want. For this reason we allow access to a fairly straightforward set of lower level attributes and methods in addition to the standard higher level API. As we outline in Section 6.5, we’ve structured PettingZoo in a way such that including these low-level features doesn’t introduce engineering overhead in creating environments, as discussed further in the documentation website.
177
+
178
+ To handle environments where different agents can be present on each reset of an environment, PettingZoo has an optional possible_agents attribute which lists all the agents that might exist in an environment at any point. Environments which generate arbitrary numbers or types of agents will not define a possible_agents list, requiring the user to check for new agents being instantiated as the environment runs. After resetting the environment, the agents attribute becomes accessible and lists all agents that are currently active. For similar reasons, num_agents, rewards, dones, infos, and agent_selection are not available until after a reset.
179
+
180
+ To handle cases where environments need to have environment agents as per the formal AEC Games model, the standard is to put it into the agents with the name env and have it take None as it’s action. We do not require this for all environments by default as it’s rarely used and makes the API more cumbersome, but this is an important feature for certain edge cases in research. This connects to the formal model in that, when this feature is not used, the environment actor from the formal model and the agent actor that acted before it are merged together.
181
+
182
+ # 6.5 Environment Creation and the Parallel API
183
+
184
+ PettingZoo environments actually only expose the reset, seed, step, observe, render, and close base methods and the agents, rewards, dones, infos, state and agent_iter base attributes. These are then wrapped to add the last method. Only having environments implement primitive methods makes creating new environments simpler, and reduces code duplication. This has the useful side effect of allowing all PettingZoo environments to be easily changed to an alternative API by simply writing a new wrapper. We’ve actually already done this for the default environments and added an additional “parallel API” to them that’s almost identical to the RLlib POSG-based API via a wrapper. We added this secondary API because in environments with very large numbers of agents, this can improve runtime by reducing the number of Python function calls.
185
+
186
+ # 7 Default Environments
187
+
188
+ Similar to Gym’s default environments, PettingZoo includes 63 environments. Half of the included environment classes (MPE, MAgent, and SISL), despite their popularity, existed as unmaintained “research grade” code, have not been available for installation via pip, and have required large amounts of maintenance to run at all before our cleanup and maintainership. We additionally included multiplayer Atari games from Terry and Black [2020], Butterfly environments which are original and of our own creation, and popular classic board and card game environments. All default environments included are surveyed in depth in Appendix B.
189
+
190
+ # 8 Adoption
191
+
192
+ In it’s relatively short lifespan, PettingZoo has already achieved a meaningful amount of adoption. It is supported by the following learning libraries: The Autonomous Learning Library [Nota, 2020], AI-Traineree [Laszuk, 2020], PyMARL (ongoing) [Samvelyan et al., 2019], RLlib [Liang et al., 2018], Stable Baselines 2 [Hill et al., 2018] and Stable Baselines 3 [Raffin et al., 2019], similar libraries such as CleanRL [Huang et al., 2020] (through SuperSuit [Terry et al., 2020b]), and Tianshou (ongoing) [Weng et al., 2020]. Perhaps more significantly than any of this, PettingZoo is already being used to teach in both graduate and undergraduate reinforcement learning classes all over the world.
193
+
194
+ # 9 Conclusion
195
+
196
+ This paper introduces PettingZoo, a Python library of many diverse multi-agent reinforcement learning environments under one simple API, akin to a multi-agent version of OpenAI’s Gym library, and introduces the agent environment cycle game model of multi-agent games.
197
+
198
+ Given the importance of multi-agent reinforcement learning, we believe that PettingZoo is capable of democratizing the field similar to what Gym previously did for single agent reinforcement learning, making it accessible to university scale research and to non-experts. As evidenced by it’s early adoption into numerous MARL libraries and courses, PettingZoo is moving in the direction of accomplishing this goal.
199
+
200
+ We’re aware of one notable limitation of the PettingZoo API. Games with significantly more than 10,000 agents (or potential agents) will have meaningful performance issues because you have to step each agent at once. Efficiently updating environments like this, and inferencing with the associated policies, requires true parallel support which almost certainly should be done in a language other than Python. Because of this, we view this as a practically acceptable limitation.
201
+
202
+ We see three directions for future work. The first is additions of more interesting environments under our API (possibly from the community, as has happened with Gym). The second direction we envision is a service to allow different researchers’ agents to play against each other in competitive games, leveraging the standardized API and environment set. Finally, we envision the development of procedurally generated multi-agent environments to test how well methods generalize, akin to the Gym procgen environments [Cobbe et al., 2019].
203
+
204
+ # Acknowledgements
205
+
206
+ Justin Terry was supported during part of this work by the QinetiQ Fundamental Machine Learning Fellowship. Thank you to Kyle Sang for their contributions to the documentation website. Thank you Rohan Potdar and Sang Hyun Son for their contributions to the Butterfly benchmarks. Thank you to Deepthi Raghunandan and Christian Clauss for their contributions to testing and continuous integration. Thank you to the PettingZoo community for the numerous bug reports and contributions to the package, especially Ross Allen and their group.
207
+
208
+ # References
209
+
210
+ Nolan Bard, Jakob N. Foerster, Sarath Chandar, Neil Burch, Marc Lanctot, H. Francis Song, Emilio Parisotto, Vincent Dumoulin, Subhodeep Moitra, Edward Hughes, Iain Dunning, Shibl Mourad, Hugo Larochelle, Marc G. Bellemare, and Michael Bowling. The hanabi challenge: A new frontier for AI research. CoRR, abs/1902.00506, 2019. URL http://arxiv.org/abs/1902.00506. Daniel S. Bernstein, Robert Givan, Neil Immerman, and Shlomo Zilberstein. The complexity of decentralized control of markov decision processes. Mathematics of Operations Research, 27(4): 819–840, 2002. doi: 10.1287/moor.27.4.819.297. URL https://doi.org/10.1287/moor.27. 4.819.297.
211
+
212
+ Craig Boutilier. Planning, learning and coordination in multiagent decision processes. In Proceedings of the 6th conference on Theoretical aspects of rationality and knowledge, pages 195–210. Morgan Kaufmann Publishers Inc., 1996.
213
+
214
+ Greg Brockman, Vicki Cheung, Ludwig Pettersson, Jonas Schneider, John Schulman, Jie Tang, and Wojciech Zaremba. Openai gym. arXiv preprint arXiv:1606.01540, 2016.
215
+
216
+ Y. Chen, M. Zhou, Ying Wen, Y. Yang, Y. Su, W. Zhang, Dell Zhang, J. Wang, and Han Liu. Factorized q-learning for large-scale multi-agent systems. In DAI ’19, 2019.
217
+
218
+ Karl Cobbe, Christopher Hesse, Jacob Hilton, and John Schulman. Leveraging procedural generation to benchmark reinforcement learning. arXiv preprint arXiv:1912.01588, 2019.
219
+
220
+ GitHub. openai/gym dependents, 2021. URL https://web.archive.org/web/ 20210527224052/https://github.com/openai/gym/network/dependents? dependent_type $=$ PACKAGE.
221
+
222
+ Jayesh K Gupta, Maxim Egorov, and Mykel Kochenderfer. Cooperative multi-agent control using deep reinforcement learning. In International Conference on Autonomous Agents and Multiagent Systems, pages 66–83. Springer, 2017.
223
+
224
+ David Ha. Slime volleyball gym environment. https://github.com/hardmaru/ slimevolleygym, 2020.
225
+
226
+ Ashley Hill, Antonin Raffin, Maximilian Ernestus, Adam Gleave, Anssi Kanervisto, Rene Traore, Prafulla Dhariwal, Christopher Hesse, Oleg Klimov, Alex Nichol, Matthias Plappert, Alec Radford, John Schulman, Szymon Sidor, and Yuhuai Wu. Stable baselines. https://github.com/ hill-a/stable-baselines, 2018.
227
+
228
+ Dan Horgan, John Quan, David Budden, Gabriel Barth-Maron, Matteo Hessel, Hado Van Hasselt, and David Silver. Distributed prioritized experience replay. arXiv preprint arXiv:1803.00933, 2018.
229
+
230
+ Shengyi Huang, Rousslan Dossa, and Chang Ye. Cleanrl: High-quality single-file implementation of deep reinforcement learning algorithms. https://github.com/vwxyzjn/cleanrl/, 2020.
231
+
232
+ Edward Hughes, Joel Z Leibo, Matthew Phillips, Karl Tuyls, Edgar Dueñez-Guzman, Antonio García Castañeda, Iain Dunning, Tina Zhu, Kevin McKee, Raphael Koster, et al. Inequity aversion improves cooperation in intertemporal social dilemmas. In Advances in neural information processing systems, pages 3326–3336, 2018.
233
+
234
+ Marc Lanctot, Edward Lockhart, Jean-Baptiste Lespiau, Vinícius Flores Zambaldi, Satyaki Upadhyay, Julien Pérolat, Sriram Srinivasan, Finbarr Timbers, Karl Tuyls, Shayegan Omidshafiei, Daniel Hennes, Dustin Morrill, Paul Muller, Timo Ewalds, Ryan Faulkner, János Kramár, Bart De Vylder, Brennan Saeta, James Bradbury, David Ding, Sebastian Borgeaud, Matthew Lai, Julian Schrittwieser, Thomas W. Anthony, Edward Hughes, Ivo Danihelka, and Jonah Ryan-Davis. Openspiel: A framework for reinforcement learning in games. CoRR, abs/1908.09453, 2019. URL http://arxiv.org/abs/1908.09453.
235
+
236
+ Dawid Laszuk. Ai-traineree. https://github.com/laszukdawid/ai-traineree, 2020.
237
+
238
+ Joel Z Leibo, Vinicius Zambaldi, Marc Lanctot, Janusz Marecki, and Thore Graepel. Multi-agent reinforcement learning in sequential social dilemmas. arXiv preprint arXiv:1702.03037, 2017.
239
+
240
+ Eric Liang, Richard Liaw, Philipp Moritz, Robert Nishihara, Roy Fox, Ken Goldberg, Joseph E Gonzalez, Michael I Jordan, and Ion Stoica. Rllib: Abstractions for distributed reinforcement learning. arXiv preprint arXiv:1712.09381, 2017.
241
+
242
+ Eric Liang, Richard Liaw, Robert Nishihara, Philipp Moritz, Roy Fox, Ken Goldberg, Joseph E. Gonzalez, Michael I. Jordan, and Ion Stoica. RLlib: Abstractions for distributed reinforcement learning. In International Conference on Machine Learning (ICML), 2018.
243
+
244
+ Siqi Liu, Guy Lever, Josh Merel, Saran Tunyasuvunakool, Nicolas Heess, and Thore Graepel. Emergent coordination through competition. CoRR, abs/1902.07151, 2019. URL http://arxiv. org/abs/1902.07151.
245
+
246
+ Ryan Lowe, Yi Wu, Aviv Tamar, Jean Harb, Pieter Abbeel, and Igor Mordatch. Multi-agent actorcritic for mixed cooperative-competitive environments. Neural Information Processing Systems (NIPS), 2017.
247
+
248
+ Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Andrei A Rusu, Joel Veness, Marc G Bellemare, Alex Graves, Martin Riedmiller, Andreas K Fidjeland, Georg Ostrovski, et al. Human-level control through deep reinforcement learning. nature, 518(7540):529–533, 2015.
249
+
250
+ Igor Mordatch and Pieter Abbeel. Emergence of grounded compositional language in multi-agent populations. arXiv preprint arXiv:1703.04908, 2017.
251
+
252
+ Chris Nota. The autonomous learning library. https://github.com/cpnota/ autonomous-learning-library, 2020.
253
+
254
+ OpenAI. Openai five. https://blog.openai.com/openai-five/, 2018.
255
+
256
+ Martin J Osborne and Ariel Rubinstein. A course in game theory. MIT press, 1994.
257
+
258
+ G. Palmer. Independent learning approaches: Overcoming multi-agent learning pathologies in team-games. 2020.
259
+
260
+ Stefanie Anna Baby Ling Li Ashwini Pokle. Analysis of emergent behavior in multi agent environments using deep reinforcement learning. 2018.
261
+
262
+ Antonin Raffin. Rl baselines3 zoo. https://github.com/DLR-RM/rl-baselines3-zoo, 2020.
263
+
264
+ Antonin Raffin, Ashley Hill, Maximilian Ernestus, Adam Gleave, Anssi Kanervisto, and Noah Dormann. Stable baselines3. https://github.com/DLR-RM/stable-baselines3, 2019.
265
+
266
+ Mikayel Samvelyan, Tabish Rashid, Christian Schröder de Witt, Gregory Farquhar, Nantas Nardelli, Tim G. J. Rudner, Chia-Man Hung, Philip H. S. Torr, Jakob N. Foerster, and Shimon Whiteson. The starcraft multi-agent challenge. CoRR, abs/1902.04043, 2019. URL http://arxiv.org/ abs/1902.04043.
267
+
268
+ John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. Proximal policy optimization algorithms. arXiv preprint arXiv:1707.06347, 2017.
269
+
270
+ L. S. Shapley. Stochastic games. Proceedings of the National Academy of Sciences, 39(10):1095– 1100, 1953. ISSN 0027-8424. doi: 10.1073/pnas.39.10.1095.
271
+
272
+ 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.
273
+
274
+ David Silver, Julian Schrittwieser, Karen Simonyan, Ioannis Antonoglou, Aja Huang, Arthur Guez, Thomas Hubert, Lucas Baker, Matthew Lai, Adrian Bolton, et al. Mastering the game of go without human knowledge. nature, 550(7676):354–359, 2017.
275
+
276
+ Sriram Ganapathi Subramanian, P. Poupart, Matthew E. Taylor, and N. Hegde. Multi type mean field reinforcement learning. In AAMAS, 2020.
277
+
278
+ J K Terry, Nathaniel Grammel, Ananth Hari, Luis Santos, and Benjamin Black. Revisiting parameter sharing in multi-agent deep reinforcement learning. arXiv preprint arXiv:2005.13625, 2020a.
279
+
280
+ Justin K Terry and Benjamin Black. Multiplayer support for the arcade learning environment. arXiv preprint arXiv:2009.09341, 2020.
281
+
282
+ Justin K Terry, Benjamin Black, and Ananth Hari. Supersuit: Simple microwrappers for reinforcement learning environments. arXiv preprint arXiv:2008.08932, 2020b.
283
+
284
+ Justin K Terry, Benjamin Black, and Ananth Hari. Supersuit: Simple microwrappers for reinforcement learning environments. arXiv preprint arXiv:2008.08932, 2020c.
285
+
286
+ Justin K Terry, Nathaniel Grammel, Ananth Hari, Luis Santos, and Benjamin Black. Revisiting parameter sharing in multi-agent deep reinforcement learning. arXiv preprint arXiv:2005.13625, 2020d.
287
+
288
+ Gerald Tesauro. Temporal difference learning and td-gammon. Commun. ACM, 38(3):58–68, March 1995. ISSN 0001-0782. doi: 10.1145/203330.203343. URL https://doi.org/10.1145/ 203330.203343.
289
+
290
+ Rene Vidal, Omid Shakernia, H Jin Kim, David Hyunchul Shim, and Shankar Sastry. Probabilistic pursuit-evasion games: theory, implementation, and experimental evaluation. IEEE transactions on robotics and automation, 18(5):662–669, 2002.
291
+
292
+ Eugene Vinitsky, Natasha Jaques, Joel Leibo, Antonio Castenada, and Edward Hughes. An open source implementation of sequential social dilemma games. https://github.com/ eugenevinitsky/sequential_social_dilemma_games/, 2019. GitHub repository.
293
+
294
+ Oriol Vinyals, Igor Babuschkin, Wojciech M Czarnecki, Michaël Mathieu, Andrew Dudzik, Junyoung Chung, David H Choi, Richard Powell, Timo Ewalds, Petko Georgiev, et al. Grandmaster level in starcraft ii using multi-agent reinforcement learning. Nature, 575(7782):350–354, 2019.
295
+
296
+ Jiayi Weng, Minghao Zhang, Alexis Duburcq, Kaichao You, Dong Yan, Hang Su, and Jun Zhu. Tianshou. https://github.com/thu-ml/tianshou, 2020.
297
+
298
+ Daochen Zha, Kwei-Herng Lai, Yuanpu Cao, Songyi Huang, Ruzhe Wei, Junyu Guo, and Xia Hu. Rlcard: A toolkit for reinforcement learning in card games. arXiv preprint arXiv:1910.04376, 2019.
299
+
300
+ Lianmin Zheng, Jiacheng Yang, Han Cai, Weinan Zhang, Jun Wang, and Yong Yu. Magent: A many-agent reinforcement learning platform for artificial collective intelligence. arXiv preprint arXiv:1712.00600, 2017.
parse/train/fLnsj7fpbPI/fLnsj7fpbPI_content_list.json ADDED
@@ -0,0 +1,1659 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "type": "text",
4
+ "text": "PettingZoo: A Standard API for Multi-Agent Reinforcement Learning ",
5
+ "text_level": 1,
6
+ "bbox": [
7
+ 225,
8
+ 122,
9
+ 772,
10
+ 172
11
+ ],
12
+ "page_idx": 0
13
+ },
14
+ {
15
+ "type": "text",
16
+ "text": "J. K. Terry∗ † j.k.terry@swarmlabs.com ",
17
+ "bbox": [
18
+ 187,
19
+ 224,
20
+ 387,
21
+ 255
22
+ ],
23
+ "page_idx": 0
24
+ },
25
+ {
26
+ "type": "text",
27
+ "text": "Benjamin Black∗ † benjamin.black@swarmlabs.com ",
28
+ "bbox": [
29
+ 406,
30
+ 224,
31
+ 648,
32
+ 253
33
+ ],
34
+ "page_idx": 0
35
+ },
36
+ {
37
+ "type": "text",
38
+ "text": "Nathaniel Grammel† ngrammel@umd.edu ",
39
+ "bbox": [
40
+ 668,
41
+ 226,
42
+ 815,
43
+ 255
44
+ ],
45
+ "page_idx": 0
46
+ },
47
+ {
48
+ "type": "text",
49
+ "text": "Mario Jayakumar† mariojay@umd.edu ",
50
+ "bbox": [
51
+ 209,
52
+ 275,
53
+ 349,
54
+ 304
55
+ ],
56
+ "page_idx": 0
57
+ },
58
+ {
59
+ "type": "text",
60
+ "text": "Ananth Hari‡ ahari1@umd.edu ",
61
+ "bbox": [
62
+ 390,
63
+ 275,
64
+ 513,
65
+ 303
66
+ ],
67
+ "page_idx": 0
68
+ },
69
+ {
70
+ "type": "text",
71
+ "text": "Ryan Sullivan∗ † ryan.sullivan@swarmlabs.com ",
72
+ "bbox": [
73
+ 553,
74
+ 275,
75
+ 789,
76
+ 304
77
+ ],
78
+ "page_idx": 0
79
+ },
80
+ {
81
+ "type": "text",
82
+ "text": "Luis Santos§ lss@umd.edu ",
83
+ "bbox": [
84
+ 214,
85
+ 324,
86
+ 308,
87
+ 352
88
+ ],
89
+ "page_idx": 0
90
+ },
91
+ {
92
+ "type": "text",
93
+ "text": "Rodrigo Perez ¶ rlazcano@umd.edu ",
94
+ "bbox": [
95
+ 351,
96
+ 324,
97
+ 490,
98
+ 352
99
+ ],
100
+ "page_idx": 0
101
+ },
102
+ {
103
+ "type": "text",
104
+ "text": "Caroline Horsch∗ † caroline.horsch@swarmlabs.com ",
105
+ "bbox": [
106
+ 535,
107
+ 324,
108
+ 787,
109
+ 352
110
+ ],
111
+ "page_idx": 0
112
+ },
113
+ {
114
+ "type": "text",
115
+ "text": "Clemens Dieffendahl k dieffendahl@campus.tu-berlin.de ",
116
+ "bbox": [
117
+ 200,
118
+ 373,
119
+ 467,
120
+ 402
121
+ ],
122
+ "page_idx": 0
123
+ },
124
+ {
125
+ "type": "text",
126
+ "text": "Niall L. Williams† niallw@umd.edu ",
127
+ "bbox": [
128
+ 501,
129
+ 373,
130
+ 627,
131
+ 401
132
+ ],
133
+ "page_idx": 0
134
+ },
135
+ {
136
+ "type": "text",
137
+ "text": "Yashas Lokesh† yashloke@umd.edu ",
138
+ "bbox": [
139
+ 656,
140
+ 375,
141
+ 797,
142
+ 401
143
+ ],
144
+ "page_idx": 0
145
+ },
146
+ {
147
+ "type": "text",
148
+ "text": "Praveen Ravi† pravi@umd.edu ",
149
+ "bbox": [
150
+ 442,
151
+ 422,
152
+ 553,
153
+ 452
154
+ ],
155
+ "page_idx": 0
156
+ },
157
+ {
158
+ "type": "text",
159
+ "text": "Abstract ",
160
+ "text_level": 1,
161
+ "bbox": [
162
+ 462,
163
+ 487,
164
+ 535,
165
+ 503
166
+ ],
167
+ "page_idx": 0
168
+ },
169
+ {
170
+ "type": "text",
171
+ "text": "This paper introduces the PettingZoo library and the accompanying Agent Environment Cycle (“AEC”) games model. PettingZoo is a library of diverse sets of multi-agent environments with a universal, elegant Python API. PettingZoo was developed with the goal of accelerating research in Multi-Agent Reinforcement Learning (“MARL”), by making work more interchangeable, accessible and reproducible akin to what OpenAI’s Gym library did for single-agent reinforcement learning. PettingZoo’s API, while inheriting many features of Gym, is unique amongst MARL APIs in that it’s based around the novel AEC games model. We argue, in part through case studies on major problems in popular MARL environments, that the popular game models are poor conceptual models of games commonly used in MARL and accordingly can promote confusing bugs that are hard to detect, and that the AEC games model addresses these problems. ",
172
+ "bbox": [
173
+ 233,
174
+ 518,
175
+ 766,
176
+ 684
177
+ ],
178
+ "page_idx": 0
179
+ },
180
+ {
181
+ "type": "text",
182
+ "text": "1 Introduction ",
183
+ "text_level": 1,
184
+ "bbox": [
185
+ 174,
186
+ 708,
187
+ 310,
188
+ 726
189
+ ],
190
+ "page_idx": 0
191
+ },
192
+ {
193
+ "type": "text",
194
+ "text": "Multi-Agent Reinforcement Learning (MARL) has been behind many of the most publicized achievements of modern machine learning — AlphaGo Zero [Silver et al., 2017], OpenAI Five [OpenAI, 2018], AlphaStar [Vinyals et al., 2019]. These achievements motivated a boom in MARL research, with Google Scholar indexing 9,480 new papers discussing multi-agent reinforcement learning in 2020 alone. Despite this boom, conducting research in MARL remains a significant engineering challenge. A large part of this is because, unlike single agent reinforcement learning which has OpenAI’s Gym, no de facto standard API exists in MARL for how agents interface with environments. This makes the reuse of existing learning code for new purposes require substantial effort, consuming researchers’ time and preventing more thorough comparisons in research. This lack of a standardized API has also prevented the proliferation of learning libraries in MARL. While a massive number of Gym-based single-agent reinforcement learning libraries or code bases exist (as a rough measure 669 pip-installable packages depend on it at the time of writing GitHub [2021]), only 5 MARL libraries with large user bases exist [Lanctot et al., 2019, Weng et al., 2020, Liang et al., 2018, Samvelyan et al., 2019, Nota, 2020]. The proliferation of these Gym based learning libraries has proved essential to the adoption of applied RL in fields like robotics or finance and without them the growth of applied MARL is a significantly greater challenge. Motivated by this, this paper introduces the PettingZoo library and API, which was created with the goal of making research in MARL more accessible and serving as a multi-agent version of Gym. ",
195
+ "bbox": [
196
+ 174,
197
+ 739,
198
+ 825,
199
+ 809
200
+ ],
201
+ "page_idx": 0
202
+ },
203
+ {
204
+ "type": "text",
205
+ "text": "",
206
+ "bbox": [
207
+ 173,
208
+ 92,
209
+ 825,
210
+ 270
211
+ ],
212
+ "page_idx": 1
213
+ },
214
+ {
215
+ "type": "text",
216
+ "text": "Prior to PettingZoo, the numerous single-use MARL APIs almost exclusively inherited their design from the two most prominent mathematical models of games in the MARL literature—Partially Observable Stochastic Games (“POSGs”) and Extensive Form Games (“EFGs”). During our development, we discovered that these common models of games are not conceptually clear for multi-agent games implemented in code and cannot form the basis of APIs that cleanly handle all types of multi-agent environments. ",
217
+ "bbox": [
218
+ 174,
219
+ 277,
220
+ 825,
221
+ 359
222
+ ],
223
+ "page_idx": 1
224
+ },
225
+ {
226
+ "type": "text",
227
+ "text": "To solve this, we introduce a new formal model of games, Agent Environment Cycle (“AEC”) games that serves as the basis of the PettingZoo API. We argue that this model is a better conceptual fit for games implemented in code. and is uniquely suitable for general MARL APIs. We then prove that any AEC game can be represented by the standard POSG model, and that any POSG can be represented by an AEC game. To illustrate the importance of the AEC games model, this paper further covers two case studies of meaningful bugs in popular MARL implementations. In both cases, these bugs went unnoticed for a long time. Both stemmed from using confusing models of games, and would have been made impossible by using an AEC games based API. ",
228
+ "bbox": [
229
+ 174,
230
+ 367,
231
+ 825,
232
+ 478
233
+ ],
234
+ "page_idx": 1
235
+ },
236
+ {
237
+ "type": "text",
238
+ "text": "The PettingZoo library can be installed via pip install pettingzoo, the documentation is available at https://www.pettingzoo.ml, and the repository is available at https://github.com/ Farama-Foundation/PettingZoo. ",
239
+ "bbox": [
240
+ 174,
241
+ 484,
242
+ 826,
243
+ 526
244
+ ],
245
+ "page_idx": 1
246
+ },
247
+ {
248
+ "type": "text",
249
+ "text": "2 Background and Related Works ",
250
+ "text_level": 1,
251
+ "bbox": [
252
+ 174,
253
+ 545,
254
+ 473,
255
+ 561
256
+ ],
257
+ "page_idx": 1
258
+ },
259
+ {
260
+ "type": "text",
261
+ "text": "Here we briefly survey the state of modeling and APIs in MARL, beginning by briefly looking at Gym’s API (Figure 1). This API is the de facto standard in single agent reinforcement learning, has largely served as the basis for subsequent multi-agent APIs, and will be compared to later. ",
262
+ "bbox": [
263
+ 176,
264
+ 575,
265
+ 825,
266
+ 617
267
+ ],
268
+ "page_idx": 1
269
+ },
270
+ {
271
+ "type": "text",
272
+ "text": "import gym \nenv $=$ gym.make(’CartPole-v0’) \nobservation $=$ env.reset() \nfor _ in range(1000): action $=$ policy(observation) observation, reward, done, info $=$ env.step(action) \nfrom ray.rllib.examples.env.multi_agent import MultiAgentCartPole \nenv $=$ MultiAgentCartPole() \nobservation $=$ env.reset() \nfor _ in range(1000): actions $=$ policies(agents, observation) observation, rewards, dones, infos $=$ env.step(actions) ",
273
+ "bbox": [
274
+ 179,
275
+ 646,
276
+ 508,
277
+ 707
278
+ ],
279
+ "page_idx": 1
280
+ },
281
+ {
282
+ "type": "text",
283
+ "text": "",
284
+ "bbox": [
285
+ 544,
286
+ 628,
287
+ 805,
288
+ 709
289
+ ],
290
+ "page_idx": 1
291
+ },
292
+ {
293
+ "type": "text",
294
+ "text": "The Gym API is a fairly straightforward Python API that borrows from the POMDP conceptualization of RL. The API’s simplicity and conceptual clarity has made it highly influential, and it naturally accompanying the pervasive POMDP model that’s used as the pervasive mental and mathematical model of reinforcement learning [Brockman et al., 2016]. This makes it easier for anyone with an understanding of the RL framework to understand Gym’s API in full. ",
295
+ "bbox": [
296
+ 174,
297
+ 758,
298
+ 823,
299
+ 828
300
+ ],
301
+ "page_idx": 1
302
+ },
303
+ {
304
+ "type": "text",
305
+ "text": "2.1 Partially Observable Stochastic Games and RLlib ",
306
+ "text_level": 1,
307
+ "bbox": [
308
+ 173,
309
+ 843,
310
+ 558,
311
+ 858
312
+ ],
313
+ "page_idx": 1
314
+ },
315
+ {
316
+ "type": "text",
317
+ "text": "Multi-agent reinforcement learning does not have a universal mental and mathematical model like the POMDP model in single-agent reinforcement learning. One of the most popular models is the partially observable stochastic game (“POSG”). This model is very similar to, and strictly more general than, multi-agent MDPs [Boutilier, 1996], Dec-POMDPs [Bernstein et al., 2002], and Stochastic (“Markov”) games [Shapley, 1953]). In a POSG, all agents step together, observe together, and are rewarded together. The full formal definition is presented in Appendix C.1 ",
318
+ "bbox": [
319
+ 174,
320
+ 869,
321
+ 823,
322
+ 911
323
+ ],
324
+ "page_idx": 1
325
+ },
326
+ {
327
+ "type": "text",
328
+ "text": "",
329
+ "bbox": [
330
+ 176,
331
+ 90,
332
+ 823,
333
+ 133
334
+ ],
335
+ "page_idx": 2
336
+ },
337
+ {
338
+ "type": "text",
339
+ "text": "This model of simultaneous stepping naturally translates into Gym-like APIs, where the actions, observations, rewards, and so on are lists or dictionaries of individual values for agents. This design choice has become the standard for MARL outside of strictly turn-based games like poker, where simultaneous stepping would be a poor conceptual fit [Lowe et al., 2017, Zheng et al., 2017, Gupta et al., 2017, Liu et al., 2019, Liang et al., 2018, Weng et al., 2020]. One example of this is shown in Figure 2 with the multi-agent API in RLlib [Liang et al., 2018], where agent-keyed dictionaries of actions, observations and rewards are passed in a simple extension of the Gym API. ",
340
+ "bbox": [
341
+ 174,
342
+ 140,
343
+ 825,
344
+ 237
345
+ ],
346
+ "page_idx": 2
347
+ },
348
+ {
349
+ "type": "text",
350
+ "text": "This model has made it much easier to apply single agent RL methods to multi-agent settings. However, there are two immediate problems with this model: ",
351
+ "bbox": [
352
+ 173,
353
+ 242,
354
+ 823,
355
+ 271
356
+ ],
357
+ "page_idx": 2
358
+ },
359
+ {
360
+ "type": "text",
361
+ "text": "1. Supporting strictly turn-based games like chess requires constantly passing dummy actions for non-acting agents (or using similar tricks). \n2. Changing the number of agents for agent death or creation is very awkward, as learning code has to cope with lists suddenly changing sizes. ",
362
+ "bbox": [
363
+ 210,
364
+ 281,
365
+ 825,
366
+ 342
367
+ ],
368
+ "page_idx": 2
369
+ },
370
+ {
371
+ "type": "text",
372
+ "text": "2.2 OpenSpiel and Extensive Form Games ",
373
+ "text_level": 1,
374
+ "bbox": [
375
+ 176,
376
+ 357,
377
+ 480,
378
+ 372
379
+ ],
380
+ "page_idx": 2
381
+ },
382
+ {
383
+ "type": "text",
384
+ "text": "In the cases of strictly turn based games where POSG models are poorly suited (e.g. Chess), MARL researchers generally mathematically model the games as Extensive Form Games (“EFG”). The EFG represents games as a tree, explicitly representing every possible sequence of actions as a root to leaf path in the tree. Stochastic aspects of a game (or MARL environment) are captured by adding a “Nature” player (sometimes also called “Chance”) which takes actions according to some given probability distribution. For a full definition of EFGs, we refer the reader to Osborne and Rubinstein [1994] or Appendix C.2. OpenSpiel [Lanctot et al., 2019], a major library with a large collection of classical board and card games for MARL bases their API off of the EFG paradigm, the API of which is shown in Figure 3. ",
385
+ "bbox": [
386
+ 173,
387
+ 382,
388
+ 825,
389
+ 507
390
+ ],
391
+ "page_idx": 2
392
+ },
393
+ {
394
+ "type": "image",
395
+ "img_path": "images/70c25986840df1eba65364b1c6386afbae1233f7f89c061680b964fe28cb9212.jpg",
396
+ "image_caption": [
397
+ "Figure 3: An example of the basic usage of OpenSpiel "
398
+ ],
399
+ "image_footnote": [],
400
+ "bbox": [
401
+ 276,
402
+ 522,
403
+ 722,
404
+ 694
405
+ ],
406
+ "page_idx": 2
407
+ },
408
+ {
409
+ "type": "text",
410
+ "text": "The EFG model has been successfully used for solving problems involving theory of mind with methods like game theoretic analysis and tree search. However, for application in general MARL problems, three immediate concerns arise with the EFG model: ",
411
+ "bbox": [
412
+ 176,
413
+ 743,
414
+ 825,
415
+ 785
416
+ ],
417
+ "page_idx": 2
418
+ },
419
+ {
420
+ "type": "text",
421
+ "text": "1. The model, and the corresponding API, is very complex compared to that of POSGs, and isn’t suitable for beginners the way Gym is—this environment API is much more complicated than Gym’s API or RLLib’s POSG API for example. Furthermore, due to the complexity of the EFG model, reinforcement learning researchers don’t ubiquitously use it as a mental model of games in the same way that they use the POSG or POMDP model. 2. The formal definition only includes rewards at the end of games, while reinforcement learning often requires frequent rewards. While this is possible to work around in the API implementation, it is not ideal. ",
422
+ "bbox": [
423
+ 212,
424
+ 796,
425
+ 825,
426
+ 911
427
+ ],
428
+ "page_idx": 2
429
+ },
430
+ {
431
+ "type": "text",
432
+ "text": "3. The OpenSpiel API does not handle continuous actions (a common and important case in RL), though this was a choice that is not inherent to the EFG model. ",
433
+ "bbox": [
434
+ 207,
435
+ 92,
436
+ 823,
437
+ 119
438
+ ],
439
+ "page_idx": 3
440
+ },
441
+ {
442
+ "type": "text",
443
+ "text": "It’s also worth briefly noting that some simple strictly turn based games are modeled with the single-agent Gym API, with the environment alternating which agent is controlled, [Ha, 2020]. This approach is unable to reasonably scale beyond two agents due to the difficulties of handling changes in agent order (e.g. Uno), agent death, and agent creation. ",
444
+ "bbox": [
445
+ 174,
446
+ 131,
447
+ 825,
448
+ 188
449
+ ],
450
+ "page_idx": 3
451
+ },
452
+ {
453
+ "type": "text",
454
+ "text": "3 PettingZoo Design Goals ",
455
+ "text_level": 1,
456
+ "bbox": [
457
+ 174,
458
+ 205,
459
+ 413,
460
+ 223
461
+ ],
462
+ "page_idx": 3
463
+ },
464
+ {
465
+ "type": "text",
466
+ "text": "Our development of PettingZoo both as a general library and an API centered around the following goals. ",
467
+ "bbox": [
468
+ 176,
469
+ 237,
470
+ 825,
471
+ 265
472
+ ],
473
+ "page_idx": 3
474
+ },
475
+ {
476
+ "type": "text",
477
+ "text": "3.1 Be like Gym ",
478
+ "text_level": 1,
479
+ "bbox": [
480
+ 174,
481
+ 281,
482
+ 299,
483
+ 296
484
+ ],
485
+ "page_idx": 3
486
+ },
487
+ {
488
+ "type": "text",
489
+ "text": "In PettingZoo, we wanted to leverage Gym’s ubiquity, simplicity and universality. This created two concrete goals for us: ",
490
+ "bbox": [
491
+ 171,
492
+ 306,
493
+ 823,
494
+ 335
495
+ ],
496
+ "page_idx": 3
497
+ },
498
+ {
499
+ "type": "text",
500
+ "text": "• Make the API look and feel like Gym, and relatedly make the API pythonic and simple • Include numerous reference implementations of games with the main package ",
501
+ "bbox": [
502
+ 215,
503
+ 345,
504
+ 805,
505
+ 381
506
+ ],
507
+ "page_idx": 3
508
+ },
509
+ {
510
+ "type": "text",
511
+ "text": "Reusing as many design metaphors from Gym as possible will help its massive existing user base to almost instantly understand PettingZoo’s API. Similarly, for an API to become standardized, it must support a large collection of useful environments to attract users and for adoption to begin, similar to what Gym did. ",
512
+ "bbox": [
513
+ 174,
514
+ 391,
515
+ 825,
516
+ 448
517
+ ],
518
+ "page_idx": 3
519
+ },
520
+ {
521
+ "type": "text",
522
+ "text": "3.2 Be a Universal API ",
523
+ "text_level": 1,
524
+ "bbox": [
525
+ 174,
526
+ 463,
527
+ 346,
528
+ 478
529
+ ],
530
+ "page_idx": 3
531
+ },
532
+ {
533
+ "type": "text",
534
+ "text": "If there is to be a Gym-like API for MARL, it has to be able to support all use cases and types of environments. Accordingly, several technically difficult cases exist that have to be carefully considered: ",
535
+ "bbox": [
536
+ 174,
537
+ 488,
538
+ 823,
539
+ 530
540
+ ],
541
+ "page_idx": 3
542
+ },
543
+ {
544
+ "type": "text",
545
+ "text": "• Environments with large numbers of agents \n• Environments with agent death and creation \n• Environments where different agents can be chosen to participate in each episode \n• Learning methods that require access to specialty low level features ",
546
+ "bbox": [
547
+ 217,
548
+ 542,
549
+ 766,
550
+ 613
551
+ ],
552
+ "page_idx": 3
553
+ },
554
+ {
555
+ "type": "text",
556
+ "text": "Two related softer design goals for universal design are ensuring the API is simple enough for beginners to easily use, and making the API easily changeable if the direction of research in the field dramatically changes. ",
557
+ "bbox": [
558
+ 178,
559
+ 625,
560
+ 821,
561
+ 667
562
+ ],
563
+ "page_idx": 3
564
+ },
565
+ {
566
+ "type": "text",
567
+ "text": "4 Case Studies of Problems With The POSG Model in MARL ",
568
+ "text_level": 1,
569
+ "bbox": [
570
+ 173,
571
+ 685,
572
+ 700,
573
+ 704
574
+ ],
575
+ "page_idx": 3
576
+ },
577
+ {
578
+ "type": "text",
579
+ "text": "To supplement the description of the problems with the POSG models described in Section 2.1, we overview problems with basing APIs around these models that could theoretically occur in software games, and then examine real cases of those problems occurring in popular MARL environments. We specifically focus on POSGs here because EFG based APIs are extraordinarily rare (OpenSpiel is the only major one), while POSG based ones are almost universal. ",
580
+ "bbox": [
581
+ 174,
582
+ 717,
583
+ 826,
584
+ 786
585
+ ],
586
+ "page_idx": 3
587
+ },
588
+ {
589
+ "type": "text",
590
+ "text": "4.1 POSGs Don’t Allow Access To Information You Should Have ",
591
+ "text_level": 1,
592
+ "bbox": [
593
+ 174,
594
+ 801,
595
+ 637,
596
+ 818
597
+ ],
598
+ "page_idx": 3
599
+ },
600
+ {
601
+ "type": "text",
602
+ "text": "Another problem with modeling environments using simultaneous actions in the POSG model is that all of an agent’s rewards (from all sources) are summed and returned all at once. In a multi-agent game though, this combined reward is often the composite reward from the actions of other agentss and the environment. Similarly, you might want to be able to attribute the source of this reward for various learning reasons, or for debugging purposes to find out the origin of your rewards. However, in thinking about reward origins, having all rewards emitted at once proves to be very confusing because rewards from different sources are all combined. Accessing this information via an API modeled after a POSG requires deviating from the model. This would come in the form of returning a 2D array of rewards instead of a list, which would be difficult to standardize and inconvenient for learning code to parse. ",
603
+ "bbox": [
604
+ 174,
605
+ 827,
606
+ 825,
607
+ 911
608
+ ],
609
+ "page_idx": 3
610
+ },
611
+ {
612
+ "type": "text",
613
+ "text": "",
614
+ "bbox": [
615
+ 174,
616
+ 90,
617
+ 825,
618
+ 147
619
+ ],
620
+ "page_idx": 4
621
+ },
622
+ {
623
+ "type": "text",
624
+ "text": "A notable case where this caused an issue in practice is in the popular pursuit gridworld environment from Gupta et al. [2017], shown in Figure 4. In it, 8 red controllable pursuer must work together to surround and capture 30 randomly moving blue evaders. The action space of each pursuer is discrete (cardinal directions or do nothing), and the observation space is a $7 \\times 7$ box centered around a pursuer (depicted by the orange box). When an evader is surrounded on all sides by pursuers or the game boundaries, each contributing pursuer gets a reward of 5. ",
625
+ "bbox": [
626
+ 173,
627
+ 154,
628
+ 825,
629
+ 237
630
+ ],
631
+ "page_idx": 4
632
+ },
633
+ {
634
+ "type": "image",
635
+ "img_path": "images/52693d0491b6e3da93aaa3b5a608d0c8ee2b400ac0f4db5965d70fc260f5c10f.jpg",
636
+ "image_caption": [
637
+ "Figure 4: The pursuit environment from Gupta et al. [2017]. "
638
+ ],
639
+ "image_footnote": [],
640
+ "bbox": [
641
+ 433,
642
+ 252,
643
+ 565,
644
+ 349
645
+ ],
646
+ "page_idx": 4
647
+ },
648
+ {
649
+ "type": "text",
650
+ "text": "In pursuit, pursuers move first, and then evaders move randomly, before it’s determined if an evader is captured and rewards are emitted. Thus an evader that “should have” been captured is not actually captured. Having the evaders move second isn’t a bug, it’s just way of adding complexity to the classic genre of pursuer/evader multi-agent environments [Vidal et al., 2002], and is representative of real problems. When pursuit is viewed as an AEC game, we’re forced to attribute rewards to individual steps, and the breakdown becomes pursuers receiving deterministic rewards from surrounding the evader, and then random reward due to the evader moving after. Removing this random component of the reward (the part caused by the evaders action after the pursuers had already moved), should then lead to superior performance. In this case the problem was so innocuous that fixing it required switching two lines of code where their order made no obvious difference. We experimentally validate this performance improvement in Appendix A.1, showing that on average this change resulted in up to a $22 \\%$ performance in the expected reward of a learned policy. ",
651
+ "bbox": [
652
+ 174,
653
+ 386,
654
+ 825,
655
+ 553
656
+ ],
657
+ "page_idx": 4
658
+ },
659
+ {
660
+ "type": "text",
661
+ "text": "Bugs of this family could easily happen in almost any MARL environment, and analyzing and preventing them is made much easier when using the POSG model. Because every agent’s rewards are summed together in the POSG model, this specific problem when looking at the code was extraordinarily non-obvious, whereas when forced to attribute the reward of individual agents this becomes clear. Moreover if an existing environment had this problem, by exposing the actual sources of rewards to learning code researchers are able to remove differing sources of reward to more easily find and remove bugs like this, and in principle learning algorithms could be developed that automatically differently weighted different sources of reward. ",
662
+ "bbox": [
663
+ 174,
664
+ 559,
665
+ 825,
666
+ 670
667
+ ],
668
+ "page_idx": 4
669
+ },
670
+ {
671
+ "type": "text",
672
+ "text": "4.2 POSGs Based APIs Are Not Conceptually Clear For Games Implemented In Code ",
673
+ "text_level": 1,
674
+ "bbox": [
675
+ 174,
676
+ 684,
677
+ 782,
678
+ 700
679
+ ],
680
+ "page_idx": 4
681
+ },
682
+ {
683
+ "type": "text",
684
+ "text": "Introducing race conditions is a very easy mistake to make in MARL code in practice, and this occurs because simultaneous models of multi-agent games are not representative of how game code normally executes. This stems from a very common scenario in multi-agent environments where two agents are able to take conflicting actions (i.e. moving into the same space). This discrepancy has to be resolved by the environment (i.e. collision handling); which we call “tie-breaking.” ",
685
+ "bbox": [
686
+ 174,
687
+ 710,
688
+ 825,
689
+ 780
690
+ ],
691
+ "page_idx": 4
692
+ },
693
+ {
694
+ "type": "text",
695
+ "text": "Consider an environment with two agents, Alice and Bob, in which Alice steps first and tie-breaking is biased in Alice’s favor. If such an environment were assumed to have simultaneous actions, then observations for both agents would be taken before either acted, causing the observation Bob acts on to no longer be an accurate representation of the environment if a conflict with biased tie-breaking occurs. For example, if both agents tried to step into the same square and Alice got the square because she was first in the list, Bob’s observation before acting was effectively inaccurate and the environment was not truly parallel. This behavior is a true race condition—the result of stepping through the environment can inadvertently differ depending on the internal resolution order of agent actions. ",
696
+ "bbox": [
697
+ 174,
698
+ 786,
699
+ 825,
700
+ 911
701
+ ],
702
+ "page_idx": 4
703
+ },
704
+ {
705
+ "type": "text",
706
+ "text": "In any environment that’s even slightly complex, a tremendous number of instances where tie-breaking must be handled will typically occur. In any cases where a single one is missed, the environment will have race conditions that your code will attempt to learn. While finding these will always be important, a valuable tool to mitigate these possibilities is to use an API that treats each agent as acting sequentially, returning new observations afterwards. This entirely prevents the opportunity for introducing race conditions. Moreover, this entire problem stems from the fact that using APIs that model agents as updating sequentially for software MARL environments generally makes more conceptual sense than modeling the updates as simultaneous—unless the authors of environments use very complex parallelization, the environments will actually be updated one agent at a time. It is worth mentioning that this race condition cannot occur in an environment simulated in the physical world with continuous time or a simulated environment with a sufficient amount of observation delay (though most actively researched environment in MARL do not currently have any observation delay). ",
707
+ "bbox": [
708
+ 174,
709
+ 92,
710
+ 825,
711
+ 257
712
+ ],
713
+ "page_idx": 5
714
+ },
715
+ {
716
+ "type": "text",
717
+ "text": "In Appendix A.1 we go through a case study of a race condition like this happening in the open source implementation of the social sequential dilemma game environments [Vinitsky et al., 2019]. These are popular multi-agent grid world environments intended to study emergent behaviors for various forms of resource management, and has imperfect tie-breaking in a case where two agents try to act on resources in the same grid while using a simultaneous API. This bug in particular illustrates how extraordinarily difficult making all tie-breaking truly unbiased is in practice even for fairly simple environments. We defer this to the appendix as explaining the specific origin requires a large amount of exposition and diagrams about the rules of the environment. ",
718
+ "bbox": [
719
+ 174,
720
+ 263,
721
+ 825,
722
+ 375
723
+ ],
724
+ "page_idx": 5
725
+ },
726
+ {
727
+ "type": "text",
728
+ "text": "5 The Agent Environment Cycle Games Model ",
729
+ "text_level": 1,
730
+ "bbox": [
731
+ 173,
732
+ 393,
733
+ 580,
734
+ 411
735
+ ],
736
+ "page_idx": 5
737
+ },
738
+ {
739
+ "type": "text",
740
+ "text": "Motivated by the problems with applying the POSG and EFG models to MARL APIs, we developed the Agent Environment Cycle (“AEC”) Game. In this model, agents sequentially see their observation, agents take actions, rewards are emitted from the other agents, and the next agent to act is chosen. This is effectively a sequentially stepping form of the POSG model. ",
741
+ "bbox": [
742
+ 174,
743
+ 425,
744
+ 826,
745
+ 482
746
+ ],
747
+ "page_idx": 5
748
+ },
749
+ {
750
+ "type": "text",
751
+ "text": "Modeling multi-agent environments sequentially for APIs has numerous benefits: ",
752
+ "bbox": [
753
+ 173,
754
+ 487,
755
+ 705,
756
+ 502
757
+ ],
758
+ "page_idx": 5
759
+ },
760
+ {
761
+ "type": "text",
762
+ "text": "• It allows for clearer attribution of rewards to different origins, allowing for various learning improvements, as described in Section 4.1. \n• It prevents developers adding confusing and easy-to-introduce race conditions, as described in Section 4.2. \n• It more closely models how computer games are executed in code, as described in Section 4.2. \n• It formally allows for rewards after every step as is required in RL, but is not generally a part of the EFG model, as discussed in Section 2.2. \n• It is simple enough to serve as a mental model, especially for beginners, unlike the EFG model as discussed in Section 2.2 and illustrated in the definition in Appendix C.2. \n• Changing the number of agents for agent death or creation is less awkward, as learning code does not have to account for lists constantly changing sizes, as discussed in Section 2.1. \n• It is the least bad option for a universal API, compared to simultaneous stepping, as alluded to in Section 2.1. Simultaneous stepping requires the use of no-op actions if not all agents can act which are very difficult to deal with, whereas sequentially stepping agents that could all act simultaneously and queuing up their actions is not especially inconvenient. ",
763
+ "bbox": [
764
+ 217,
765
+ 513,
766
+ 825,
767
+ 768
768
+ ],
769
+ "page_idx": 5
770
+ },
771
+ {
772
+ "type": "text",
773
+ "text": "In Appendix C.3 we mathematically formalize the AEC games model, however understanding the formalism in full is not essential to understanding the paper. In Appendix D we further prove that for every AEC game an equivalent POSG exists and that for every POSG an equivalent AEC game exists. This shows that the AEC games model is as powerful a model as the most common current model of multi-agent environments. ",
774
+ "bbox": [
775
+ 174,
776
+ 780,
777
+ 825,
778
+ 849
779
+ ],
780
+ "page_idx": 5
781
+ },
782
+ {
783
+ "type": "text",
784
+ "text": "One additional conceptual feature of the AEC games model exists that we have not previously discussed because it does not usually play a role in APIs (see Section 6.4). In the AEC games model, we deviate from the POSG model by introducing the “environment” agent, which is analogous to the Nature agent from EFGs. When this agent acts in the model it indicates the updating of the environment itself, realizing and reacting to submitting agent actions. This allows for a more comprehensive attribution of rewards, causes of agent death, and discussion of games with strange updating rules and race conditions. An example of the transitions for Chess is shown in Figure 5, which serves as the inspiration for the name “agent environment cycle”. ",
785
+ "bbox": [
786
+ 176,
787
+ 856,
788
+ 823,
789
+ 911
790
+ ],
791
+ "page_idx": 5
792
+ },
793
+ {
794
+ "type": "text",
795
+ "text": "",
796
+ "bbox": [
797
+ 174,
798
+ 90,
799
+ 825,
800
+ 147
801
+ ],
802
+ "page_idx": 6
803
+ },
804
+ {
805
+ "type": "image",
806
+ "img_path": "images/3b6aeeae2e236df4f04d92bf9603ef601088fc4b38a4228c5fca08dfda53be97.jpg",
807
+ "image_caption": [
808
+ "Figure 5: The AEC diagram of Chess "
809
+ ],
810
+ "image_footnote": [],
811
+ "bbox": [
812
+ 346,
813
+ 160,
814
+ 651,
815
+ 310
816
+ ],
817
+ "page_idx": 6
818
+ },
819
+ {
820
+ "type": "text",
821
+ "text": "6 API Design ",
822
+ "text_level": 1,
823
+ "bbox": [
824
+ 174,
825
+ 361,
826
+ 300,
827
+ 378
828
+ ],
829
+ "page_idx": 6
830
+ },
831
+ {
832
+ "type": "text",
833
+ "text": "6.1 Basic API ",
834
+ "text_level": 1,
835
+ "bbox": [
836
+ 174,
837
+ 393,
838
+ 282,
839
+ 407
840
+ ],
841
+ "page_idx": 6
842
+ },
843
+ {
844
+ "type": "text",
845
+ "text": "The PettingZoo API is shown in Figure 6, and the strong similarities to the Gym API (Figure 1) should be obvious — each agent provides an action to a step function and receives observation, reward, done, info as the return values. The observation and state spaces also use the the exact same space objects as Gym. The render and close methods also function identically to Gym’s, showing a current visual frame representing the environment to the screen whenever called. The reset method similarly has identical function to Gym — it resets the environment to a starting configuration after being played through. PettingZoo really only has two deviations from the regular Gym API — the last and agent_iter methods and the corresponding iteration logic. ",
846
+ "bbox": [
847
+ 173,
848
+ 419,
849
+ 826,
850
+ 530
851
+ ],
852
+ "page_idx": 6
853
+ },
854
+ {
855
+ "type": "image",
856
+ "img_path": "images/3015aeb365f3962b6c458342098e437e911a511eb441a12e04a525bb5741219f.jpg",
857
+ "image_caption": [
858
+ "Figure 6: An example of the basic usage of Pettingzoo "
859
+ ],
860
+ "image_footnote": [],
861
+ "bbox": [
862
+ 351,
863
+ 542,
864
+ 645,
865
+ 635
866
+ ],
867
+ "page_idx": 6
868
+ },
869
+ {
870
+ "type": "text",
871
+ "text": "6.2 The agent_iter Method ",
872
+ "text_level": 1,
873
+ "bbox": [
874
+ 174,
875
+ 689,
876
+ 388,
877
+ 704
878
+ ],
879
+ "page_idx": 6
880
+ },
881
+ {
882
+ "type": "text",
883
+ "text": "The agent_iter method is a generator method of an environment that returns the next agent that the environment will be acting upon. Because the environment is providing the next agent to act, this cleanly abstracts away any issues surrounding changing agent orders, agent generation, and agent death. This generation also parallels the functionality of the next agent function from the AEC games model. This method, combined with one agent acting at once, allows for the support of every conceivable variation of the set of agents changing. ",
884
+ "bbox": [
885
+ 173,
886
+ 715,
887
+ 825,
888
+ 799
889
+ ],
890
+ "page_idx": 6
891
+ },
892
+ {
893
+ "type": "text",
894
+ "text": "6.3 The last Method ",
895
+ "text_level": 1,
896
+ "bbox": [
897
+ 174,
898
+ 815,
899
+ 336,
900
+ 830
901
+ ],
902
+ "page_idx": 6
903
+ },
904
+ {
905
+ "type": "text",
906
+ "text": "An odd aspect of multi-agent environments is that from the perspective of one agent, the other agents are part of the environment. Whereas in the single agent case the observation and rewards can be given immediately, in the multi-agent case an agent has to wait for all other agents to act before it’s observation, reward, done and info can be fully determined. For this reason, these values are given by the last method, and they can then be passed into a policy to choose an action. Less robust implementations would not allow for features like changing agent orders (like the reverse card in Uno). ",
907
+ "bbox": [
908
+ 174,
909
+ 842,
910
+ 825,
911
+ 911
912
+ ],
913
+ "page_idx": 6
914
+ },
915
+ {
916
+ "type": "text",
917
+ "text": "",
918
+ "bbox": [
919
+ 176,
920
+ 92,
921
+ 823,
922
+ 119
923
+ ],
924
+ "page_idx": 7
925
+ },
926
+ {
927
+ "type": "text",
928
+ "text": "6.4 Additional API Features ",
929
+ "text_level": 1,
930
+ "bbox": [
931
+ 174,
932
+ 136,
933
+ 383,
934
+ 151
935
+ ],
936
+ "page_idx": 7
937
+ },
938
+ {
939
+ "type": "text",
940
+ "text": "The agents attribute is a list of all agents in the environment, as strings. The rewards, dones, infos attributes are agent-keyed dictionaries for each attribute (note that the rewards are the instantaneous ones resulting from the most recent action). These allow access to agent properties at all points on a trajectory, regardless of which is selected. The action_space(agent) and observation_space(agent) functions return the static action and observation spaces respectively for the agent given as an argument. The observe(agent) method provides the observation for a single agent by passing its name as an argument, which can be useful if you need to observe an agent in an unusual context. The state method is an optional method returns the global state of an environment, as is required for centralized critic methods. The agent_selection method returns the agent that can currently be acted upon per agent_iter. ",
941
+ "bbox": [
942
+ 174,
943
+ 161,
944
+ 825,
945
+ 300
946
+ ],
947
+ "page_idx": 7
948
+ },
949
+ {
950
+ "type": "text",
951
+ "text": "The motivation for allowing access to all these lower level pieces of information is to let researchers to attempt novel, unusual experiments. The space of multi-agent RL has not yet been comprehensively explored, and there are many perfectly plausible reasons you might want access to other agents rewards, observations, and so on. For an API to be universal in an emerging field, it inherently has to allow access to all the information researchers could plausibly want. For this reason we allow access to a fairly straightforward set of lower level attributes and methods in addition to the standard higher level API. As we outline in Section 6.5, we’ve structured PettingZoo in a way such that including these low-level features doesn’t introduce engineering overhead in creating environments, as discussed further in the documentation website. ",
952
+ "bbox": [
953
+ 174,
954
+ 306,
955
+ 825,
956
+ 431
957
+ ],
958
+ "page_idx": 7
959
+ },
960
+ {
961
+ "type": "text",
962
+ "text": "To handle environments where different agents can be present on each reset of an environment, PettingZoo has an optional possible_agents attribute which lists all the agents that might exist in an environment at any point. Environments which generate arbitrary numbers or types of agents will not define a possible_agents list, requiring the user to check for new agents being instantiated as the environment runs. After resetting the environment, the agents attribute becomes accessible and lists all agents that are currently active. For similar reasons, num_agents, rewards, dones, infos, and agent_selection are not available until after a reset. ",
963
+ "bbox": [
964
+ 174,
965
+ 438,
966
+ 825,
967
+ 534
968
+ ],
969
+ "page_idx": 7
970
+ },
971
+ {
972
+ "type": "text",
973
+ "text": "To handle cases where environments need to have environment agents as per the formal AEC Games model, the standard is to put it into the agents with the name env and have it take None as it’s action. We do not require this for all environments by default as it’s rarely used and makes the API more cumbersome, but this is an important feature for certain edge cases in research. This connects to the formal model in that, when this feature is not used, the environment actor from the formal model and the agent actor that acted before it are merged together. ",
974
+ "bbox": [
975
+ 174,
976
+ 540,
977
+ 825,
978
+ 625
979
+ ],
980
+ "page_idx": 7
981
+ },
982
+ {
983
+ "type": "text",
984
+ "text": "6.5 Environment Creation and the Parallel API ",
985
+ "text_level": 1,
986
+ "bbox": [
987
+ 174,
988
+ 640,
989
+ 516,
990
+ 655
991
+ ],
992
+ "page_idx": 7
993
+ },
994
+ {
995
+ "type": "text",
996
+ "text": "PettingZoo environments actually only expose the reset, seed, step, observe, render, and close base methods and the agents, rewards, dones, infos, state and agent_iter base attributes. These are then wrapped to add the last method. Only having environments implement primitive methods makes creating new environments simpler, and reduces code duplication. This has the useful side effect of allowing all PettingZoo environments to be easily changed to an alternative API by simply writing a new wrapper. We’ve actually already done this for the default environments and added an additional “parallel API” to them that’s almost identical to the RLlib POSG-based API via a wrapper. We added this secondary API because in environments with very large numbers of agents, this can improve runtime by reducing the number of Python function calls. ",
997
+ "bbox": [
998
+ 173,
999
+ 666,
1000
+ 825,
1001
+ 791
1002
+ ],
1003
+ "page_idx": 7
1004
+ },
1005
+ {
1006
+ "type": "text",
1007
+ "text": "7 Default Environments ",
1008
+ "text_level": 1,
1009
+ "bbox": [
1010
+ 174,
1011
+ 810,
1012
+ 390,
1013
+ 827
1014
+ ],
1015
+ "page_idx": 7
1016
+ },
1017
+ {
1018
+ "type": "text",
1019
+ "text": "Similar to Gym’s default environments, PettingZoo includes 63 environments. Half of the included environment classes (MPE, MAgent, and SISL), despite their popularity, existed as unmaintained “research grade” code, have not been available for installation via pip, and have required large amounts of maintenance to run at all before our cleanup and maintainership. We additionally included multiplayer Atari games from Terry and Black [2020], Butterfly environments which are original and of our own creation, and popular classic board and card game environments. All default environments included are surveyed in depth in Appendix B. ",
1020
+ "bbox": [
1021
+ 173,
1022
+ 842,
1023
+ 825,
1024
+ 911
1025
+ ],
1026
+ "page_idx": 7
1027
+ },
1028
+ {
1029
+ "type": "text",
1030
+ "text": "",
1031
+ "bbox": [
1032
+ 173,
1033
+ 92,
1034
+ 823,
1035
+ 119
1036
+ ],
1037
+ "page_idx": 8
1038
+ },
1039
+ {
1040
+ "type": "text",
1041
+ "text": "8 Adoption ",
1042
+ "text_level": 1,
1043
+ "bbox": [
1044
+ 174,
1045
+ 138,
1046
+ 282,
1047
+ 155
1048
+ ],
1049
+ "page_idx": 8
1050
+ },
1051
+ {
1052
+ "type": "text",
1053
+ "text": "In it’s relatively short lifespan, PettingZoo has already achieved a meaningful amount of adoption. It is supported by the following learning libraries: The Autonomous Learning Library [Nota, 2020], AI-Traineree [Laszuk, 2020], PyMARL (ongoing) [Samvelyan et al., 2019], RLlib [Liang et al., 2018], Stable Baselines 2 [Hill et al., 2018] and Stable Baselines 3 [Raffin et al., 2019], similar libraries such as CleanRL [Huang et al., 2020] (through SuperSuit [Terry et al., 2020b]), and Tianshou (ongoing) [Weng et al., 2020]. Perhaps more significantly than any of this, PettingZoo is already being used to teach in both graduate and undergraduate reinforcement learning classes all over the world. ",
1054
+ "bbox": [
1055
+ 173,
1056
+ 170,
1057
+ 825,
1058
+ 280
1059
+ ],
1060
+ "page_idx": 8
1061
+ },
1062
+ {
1063
+ "type": "text",
1064
+ "text": "9 Conclusion ",
1065
+ "text_level": 1,
1066
+ "bbox": [
1067
+ 174,
1068
+ 299,
1069
+ 299,
1070
+ 316
1071
+ ],
1072
+ "page_idx": 8
1073
+ },
1074
+ {
1075
+ "type": "text",
1076
+ "text": "This paper introduces PettingZoo, a Python library of many diverse multi-agent reinforcement learning environments under one simple API, akin to a multi-agent version of OpenAI’s Gym library, and introduces the agent environment cycle game model of multi-agent games. ",
1077
+ "bbox": [
1078
+ 176,
1079
+ 330,
1080
+ 823,
1081
+ 372
1082
+ ],
1083
+ "page_idx": 8
1084
+ },
1085
+ {
1086
+ "type": "text",
1087
+ "text": "Given the importance of multi-agent reinforcement learning, we believe that PettingZoo is capable of democratizing the field similar to what Gym previously did for single agent reinforcement learning, making it accessible to university scale research and to non-experts. As evidenced by it’s early adoption into numerous MARL libraries and courses, PettingZoo is moving in the direction of accomplishing this goal. ",
1088
+ "bbox": [
1089
+ 174,
1090
+ 378,
1091
+ 825,
1092
+ 449
1093
+ ],
1094
+ "page_idx": 8
1095
+ },
1096
+ {
1097
+ "type": "text",
1098
+ "text": "We’re aware of one notable limitation of the PettingZoo API. Games with significantly more than 10,000 agents (or potential agents) will have meaningful performance issues because you have to step each agent at once. Efficiently updating environments like this, and inferencing with the associated policies, requires true parallel support which almost certainly should be done in a language other than Python. Because of this, we view this as a practically acceptable limitation. ",
1099
+ "bbox": [
1100
+ 174,
1101
+ 455,
1102
+ 825,
1103
+ 525
1104
+ ],
1105
+ "page_idx": 8
1106
+ },
1107
+ {
1108
+ "type": "text",
1109
+ "text": "We see three directions for future work. The first is additions of more interesting environments under our API (possibly from the community, as has happened with Gym). The second direction we envision is a service to allow different researchers’ agents to play against each other in competitive games, leveraging the standardized API and environment set. Finally, we envision the development of procedurally generated multi-agent environments to test how well methods generalize, akin to the Gym procgen environments [Cobbe et al., 2019]. ",
1110
+ "bbox": [
1111
+ 174,
1112
+ 530,
1113
+ 825,
1114
+ 614
1115
+ ],
1116
+ "page_idx": 8
1117
+ },
1118
+ {
1119
+ "type": "text",
1120
+ "text": "Acknowledgements ",
1121
+ "text_level": 1,
1122
+ "bbox": [
1123
+ 176,
1124
+ 632,
1125
+ 338,
1126
+ 650
1127
+ ],
1128
+ "page_idx": 8
1129
+ },
1130
+ {
1131
+ "type": "text",
1132
+ "text": "Justin Terry was supported during part of this work by the QinetiQ Fundamental Machine Learning Fellowship. Thank you to Kyle Sang for their contributions to the documentation website. Thank you Rohan Potdar and Sang Hyun Son for their contributions to the Butterfly benchmarks. Thank you to Deepthi Raghunandan and Christian Clauss for their contributions to testing and continuous integration. Thank you to the PettingZoo community for the numerous bug reports and contributions to the package, especially Ross Allen and their group. ",
1133
+ "bbox": [
1134
+ 174,
1135
+ 664,
1136
+ 825,
1137
+ 747
1138
+ ],
1139
+ "page_idx": 8
1140
+ },
1141
+ {
1142
+ "type": "text",
1143
+ "text": "References ",
1144
+ "text_level": 1,
1145
+ "bbox": [
1146
+ 174,
1147
+ 767,
1148
+ 266,
1149
+ 782
1150
+ ],
1151
+ "page_idx": 8
1152
+ },
1153
+ {
1154
+ "type": "text",
1155
+ "text": "Nolan Bard, Jakob N. Foerster, Sarath Chandar, Neil Burch, Marc Lanctot, H. Francis Song, Emilio Parisotto, Vincent Dumoulin, Subhodeep Moitra, Edward Hughes, Iain Dunning, Shibl Mourad, Hugo Larochelle, Marc G. Bellemare, and Michael Bowling. The hanabi challenge: A new frontier for AI research. CoRR, abs/1902.00506, 2019. URL http://arxiv.org/abs/1902.00506. Daniel S. Bernstein, Robert Givan, Neil Immerman, and Shlomo Zilberstein. The complexity of decentralized control of markov decision processes. Mathematics of Operations Research, 27(4): 819–840, 2002. doi: 10.1287/moor.27.4.819.297. URL https://doi.org/10.1287/moor.27. 4.819.297. ",
1156
+ "bbox": [
1157
+ 173,
1158
+ 791,
1159
+ 828,
1160
+ 911
1161
+ ],
1162
+ "page_idx": 8
1163
+ },
1164
+ {
1165
+ "type": "text",
1166
+ "text": "Craig Boutilier. Planning, learning and coordination in multiagent decision processes. In Proceedings of the 6th conference on Theoretical aspects of rationality and knowledge, pages 195–210. Morgan Kaufmann Publishers Inc., 1996. ",
1167
+ "bbox": [
1168
+ 174,
1169
+ 90,
1170
+ 823,
1171
+ 133
1172
+ ],
1173
+ "page_idx": 9
1174
+ },
1175
+ {
1176
+ "type": "text",
1177
+ "text": "Greg Brockman, Vicki Cheung, Ludwig Pettersson, Jonas Schneider, John Schulman, Jie Tang, and Wojciech Zaremba. Openai gym. arXiv preprint arXiv:1606.01540, 2016. ",
1178
+ "bbox": [
1179
+ 173,
1180
+ 141,
1181
+ 823,
1182
+ 170
1183
+ ],
1184
+ "page_idx": 9
1185
+ },
1186
+ {
1187
+ "type": "text",
1188
+ "text": "Y. Chen, M. Zhou, Ying Wen, Y. Yang, Y. Su, W. Zhang, Dell Zhang, J. Wang, and Han Liu. Factorized q-learning for large-scale multi-agent systems. In DAI ’19, 2019. ",
1189
+ "bbox": [
1190
+ 173,
1191
+ 178,
1192
+ 823,
1193
+ 207
1194
+ ],
1195
+ "page_idx": 9
1196
+ },
1197
+ {
1198
+ "type": "text",
1199
+ "text": "Karl Cobbe, Christopher Hesse, Jacob Hilton, and John Schulman. Leveraging procedural generation to benchmark reinforcement learning. arXiv preprint arXiv:1912.01588, 2019. ",
1200
+ "bbox": [
1201
+ 171,
1202
+ 214,
1203
+ 823,
1204
+ 243
1205
+ ],
1206
+ "page_idx": 9
1207
+ },
1208
+ {
1209
+ "type": "text",
1210
+ "text": "GitHub. openai/gym dependents, 2021. URL https://web.archive.org/web/ 20210527224052/https://github.com/openai/gym/network/dependents? dependent_type $=$ PACKAGE. ",
1211
+ "bbox": [
1212
+ 176,
1213
+ 251,
1214
+ 823,
1215
+ 292
1216
+ ],
1217
+ "page_idx": 9
1218
+ },
1219
+ {
1220
+ "type": "text",
1221
+ "text": "Jayesh K Gupta, Maxim Egorov, and Mykel Kochenderfer. Cooperative multi-agent control using deep reinforcement learning. In International Conference on Autonomous Agents and Multiagent Systems, pages 66–83. Springer, 2017. ",
1222
+ "bbox": [
1223
+ 174,
1224
+ 301,
1225
+ 825,
1226
+ 344
1227
+ ],
1228
+ "page_idx": 9
1229
+ },
1230
+ {
1231
+ "type": "text",
1232
+ "text": "David Ha. Slime volleyball gym environment. https://github.com/hardmaru/ slimevolleygym, 2020. ",
1233
+ "bbox": [
1234
+ 171,
1235
+ 352,
1236
+ 825,
1237
+ 381
1238
+ ],
1239
+ "page_idx": 9
1240
+ },
1241
+ {
1242
+ "type": "text",
1243
+ "text": "Ashley Hill, Antonin Raffin, Maximilian Ernestus, Adam Gleave, Anssi Kanervisto, Rene Traore, Prafulla Dhariwal, Christopher Hesse, Oleg Klimov, Alex Nichol, Matthias Plappert, Alec Radford, John Schulman, Szymon Sidor, and Yuhuai Wu. Stable baselines. https://github.com/ hill-a/stable-baselines, 2018. ",
1244
+ "bbox": [
1245
+ 174,
1246
+ 388,
1247
+ 826,
1248
+ 444
1249
+ ],
1250
+ "page_idx": 9
1251
+ },
1252
+ {
1253
+ "type": "text",
1254
+ "text": "Dan Horgan, John Quan, David Budden, Gabriel Barth-Maron, Matteo Hessel, Hado Van Hasselt, and David Silver. Distributed prioritized experience replay. arXiv preprint arXiv:1803.00933, 2018. ",
1255
+ "bbox": [
1256
+ 176,
1257
+ 452,
1258
+ 825,
1259
+ 494
1260
+ ],
1261
+ "page_idx": 9
1262
+ },
1263
+ {
1264
+ "type": "text",
1265
+ "text": "Shengyi Huang, Rousslan Dossa, and Chang Ye. Cleanrl: High-quality single-file implementation of deep reinforcement learning algorithms. https://github.com/vwxyzjn/cleanrl/, 2020. ",
1266
+ "bbox": [
1267
+ 171,
1268
+ 502,
1269
+ 825,
1270
+ 532
1271
+ ],
1272
+ "page_idx": 9
1273
+ },
1274
+ {
1275
+ "type": "text",
1276
+ "text": "Edward Hughes, Joel Z Leibo, Matthew Phillips, Karl Tuyls, Edgar Dueñez-Guzman, Antonio García Castañeda, Iain Dunning, Tina Zhu, Kevin McKee, Raphael Koster, et al. Inequity aversion improves cooperation in intertemporal social dilemmas. In Advances in neural information processing systems, pages 3326–3336, 2018. ",
1277
+ "bbox": [
1278
+ 174,
1279
+ 539,
1280
+ 825,
1281
+ 594
1282
+ ],
1283
+ "page_idx": 9
1284
+ },
1285
+ {
1286
+ "type": "text",
1287
+ "text": "Marc Lanctot, Edward Lockhart, Jean-Baptiste Lespiau, Vinícius Flores Zambaldi, Satyaki Upadhyay, Julien Pérolat, Sriram Srinivasan, Finbarr Timbers, Karl Tuyls, Shayegan Omidshafiei, Daniel Hennes, Dustin Morrill, Paul Muller, Timo Ewalds, Ryan Faulkner, János Kramár, Bart De Vylder, Brennan Saeta, James Bradbury, David Ding, Sebastian Borgeaud, Matthew Lai, Julian Schrittwieser, Thomas W. Anthony, Edward Hughes, Ivo Danihelka, and Jonah Ryan-Davis. Openspiel: A framework for reinforcement learning in games. CoRR, abs/1908.09453, 2019. URL http://arxiv.org/abs/1908.09453. ",
1288
+ "bbox": [
1289
+ 174,
1290
+ 603,
1291
+ 826,
1292
+ 700
1293
+ ],
1294
+ "page_idx": 9
1295
+ },
1296
+ {
1297
+ "type": "text",
1298
+ "text": "Dawid Laszuk. Ai-traineree. https://github.com/laszukdawid/ai-traineree, 2020. ",
1299
+ "bbox": [
1300
+ 173,
1301
+ 708,
1302
+ 784,
1303
+ 724
1304
+ ],
1305
+ "page_idx": 9
1306
+ },
1307
+ {
1308
+ "type": "text",
1309
+ "text": "Joel Z Leibo, Vinicius Zambaldi, Marc Lanctot, Janusz Marecki, and Thore Graepel. Multi-agent reinforcement learning in sequential social dilemmas. arXiv preprint arXiv:1702.03037, 2017. ",
1310
+ "bbox": [
1311
+ 173,
1312
+ 731,
1313
+ 820,
1314
+ 761
1315
+ ],
1316
+ "page_idx": 9
1317
+ },
1318
+ {
1319
+ "type": "text",
1320
+ "text": "Eric Liang, Richard Liaw, Philipp Moritz, Robert Nishihara, Roy Fox, Ken Goldberg, Joseph E Gonzalez, Michael I Jordan, and Ion Stoica. Rllib: Abstractions for distributed reinforcement learning. arXiv preprint arXiv:1712.09381, 2017. ",
1321
+ "bbox": [
1322
+ 174,
1323
+ 768,
1324
+ 825,
1325
+ 810
1326
+ ],
1327
+ "page_idx": 9
1328
+ },
1329
+ {
1330
+ "type": "text",
1331
+ "text": "Eric Liang, Richard Liaw, Robert Nishihara, Philipp Moritz, Roy Fox, Ken Goldberg, Joseph E. Gonzalez, Michael I. Jordan, and Ion Stoica. RLlib: Abstractions for distributed reinforcement learning. In International Conference on Machine Learning (ICML), 2018. ",
1332
+ "bbox": [
1333
+ 174,
1334
+ 819,
1335
+ 825,
1336
+ 861
1337
+ ],
1338
+ "page_idx": 9
1339
+ },
1340
+ {
1341
+ "type": "text",
1342
+ "text": "Siqi Liu, Guy Lever, Josh Merel, Saran Tunyasuvunakool, Nicolas Heess, and Thore Graepel. Emergent coordination through competition. CoRR, abs/1902.07151, 2019. URL http://arxiv. org/abs/1902.07151. ",
1343
+ "bbox": [
1344
+ 174,
1345
+ 868,
1346
+ 828,
1347
+ 911
1348
+ ],
1349
+ "page_idx": 9
1350
+ },
1351
+ {
1352
+ "type": "text",
1353
+ "text": "Ryan Lowe, Yi Wu, Aviv Tamar, Jean Harb, Pieter Abbeel, and Igor Mordatch. Multi-agent actorcritic for mixed cooperative-competitive environments. Neural Information Processing Systems (NIPS), 2017. ",
1354
+ "bbox": [
1355
+ 173,
1356
+ 90,
1357
+ 825,
1358
+ 132
1359
+ ],
1360
+ "page_idx": 10
1361
+ },
1362
+ {
1363
+ "type": "text",
1364
+ "text": "Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Andrei A Rusu, Joel Veness, Marc G Bellemare, Alex Graves, Martin Riedmiller, Andreas K Fidjeland, Georg Ostrovski, et al. Human-level control through deep reinforcement learning. nature, 518(7540):529–533, 2015. ",
1365
+ "bbox": [
1366
+ 176,
1367
+ 141,
1368
+ 823,
1369
+ 185
1370
+ ],
1371
+ "page_idx": 10
1372
+ },
1373
+ {
1374
+ "type": "text",
1375
+ "text": "Igor Mordatch and Pieter Abbeel. Emergence of grounded compositional language in multi-agent populations. arXiv preprint arXiv:1703.04908, 2017. ",
1376
+ "bbox": [
1377
+ 169,
1378
+ 191,
1379
+ 823,
1380
+ 222
1381
+ ],
1382
+ "page_idx": 10
1383
+ },
1384
+ {
1385
+ "type": "text",
1386
+ "text": "Chris Nota. The autonomous learning library. https://github.com/cpnota/ autonomous-learning-library, 2020. ",
1387
+ "bbox": [
1388
+ 173,
1389
+ 228,
1390
+ 826,
1391
+ 258
1392
+ ],
1393
+ "page_idx": 10
1394
+ },
1395
+ {
1396
+ "type": "text",
1397
+ "text": "OpenAI. Openai five. https://blog.openai.com/openai-five/, 2018. ",
1398
+ "bbox": [
1399
+ 176,
1400
+ 265,
1401
+ 681,
1402
+ 281
1403
+ ],
1404
+ "page_idx": 10
1405
+ },
1406
+ {
1407
+ "type": "text",
1408
+ "text": "Martin J Osborne and Ariel Rubinstein. A course in game theory. MIT press, 1994. ",
1409
+ "bbox": [
1410
+ 171,
1411
+ 289,
1412
+ 720,
1413
+ 304
1414
+ ],
1415
+ "page_idx": 10
1416
+ },
1417
+ {
1418
+ "type": "text",
1419
+ "text": "G. Palmer. Independent learning approaches: Overcoming multi-agent learning pathologies in team-games. 2020. ",
1420
+ "bbox": [
1421
+ 174,
1422
+ 311,
1423
+ 825,
1424
+ 340
1425
+ ],
1426
+ "page_idx": 10
1427
+ },
1428
+ {
1429
+ "type": "text",
1430
+ "text": "Stefanie Anna Baby Ling Li Ashwini Pokle. Analysis of emergent behavior in multi agent environments using deep reinforcement learning. 2018. ",
1431
+ "bbox": [
1432
+ 173,
1433
+ 348,
1434
+ 825,
1435
+ 378
1436
+ ],
1437
+ "page_idx": 10
1438
+ },
1439
+ {
1440
+ "type": "text",
1441
+ "text": "Antonin Raffin. Rl baselines3 zoo. https://github.com/DLR-RM/rl-baselines3-zoo, 2020. ",
1442
+ "bbox": [
1443
+ 171,
1444
+ 386,
1445
+ 823,
1446
+ 401
1447
+ ],
1448
+ "page_idx": 10
1449
+ },
1450
+ {
1451
+ "type": "text",
1452
+ "text": "Antonin Raffin, Ashley Hill, Maximilian Ernestus, Adam Gleave, Anssi Kanervisto, and Noah Dormann. Stable baselines3. https://github.com/DLR-RM/stable-baselines3, 2019. ",
1453
+ "bbox": [
1454
+ 173,
1455
+ 409,
1456
+ 825,
1457
+ 439
1458
+ ],
1459
+ "page_idx": 10
1460
+ },
1461
+ {
1462
+ "type": "text",
1463
+ "text": "Mikayel Samvelyan, Tabish Rashid, Christian Schröder de Witt, Gregory Farquhar, Nantas Nardelli, Tim G. J. Rudner, Chia-Man Hung, Philip H. S. Torr, Jakob N. Foerster, and Shimon Whiteson. The starcraft multi-agent challenge. CoRR, abs/1902.04043, 2019. URL http://arxiv.org/ abs/1902.04043. ",
1464
+ "bbox": [
1465
+ 173,
1466
+ 445,
1467
+ 826,
1468
+ 501
1469
+ ],
1470
+ "page_idx": 10
1471
+ },
1472
+ {
1473
+ "type": "text",
1474
+ "text": "John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. Proximal policy optimization algorithms. arXiv preprint arXiv:1707.06347, 2017. ",
1475
+ "bbox": [
1476
+ 173,
1477
+ 508,
1478
+ 825,
1479
+ 539
1480
+ ],
1481
+ "page_idx": 10
1482
+ },
1483
+ {
1484
+ "type": "text",
1485
+ "text": "L. S. Shapley. Stochastic games. Proceedings of the National Academy of Sciences, 39(10):1095– 1100, 1953. ISSN 0027-8424. doi: 10.1073/pnas.39.10.1095. ",
1486
+ "bbox": [
1487
+ 176,
1488
+ 546,
1489
+ 823,
1490
+ 577
1491
+ ],
1492
+ "page_idx": 10
1493
+ },
1494
+ {
1495
+ "type": "text",
1496
+ "text": "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. ",
1497
+ "bbox": [
1498
+ 176,
1499
+ 583,
1500
+ 825,
1501
+ 627
1502
+ ],
1503
+ "page_idx": 10
1504
+ },
1505
+ {
1506
+ "type": "text",
1507
+ "text": "David Silver, Julian Schrittwieser, Karen Simonyan, Ioannis Antonoglou, Aja Huang, Arthur Guez, Thomas Hubert, Lucas Baker, Matthew Lai, Adrian Bolton, et al. Mastering the game of go without human knowledge. nature, 550(7676):354–359, 2017. ",
1508
+ "bbox": [
1509
+ 176,
1510
+ 633,
1511
+ 823,
1512
+ 676
1513
+ ],
1514
+ "page_idx": 10
1515
+ },
1516
+ {
1517
+ "type": "text",
1518
+ "text": "Sriram Ganapathi Subramanian, P. Poupart, Matthew E. Taylor, and N. Hegde. Multi type mean field reinforcement learning. In AAMAS, 2020. ",
1519
+ "bbox": [
1520
+ 174,
1521
+ 684,
1522
+ 823,
1523
+ 713
1524
+ ],
1525
+ "page_idx": 10
1526
+ },
1527
+ {
1528
+ "type": "text",
1529
+ "text": "J K Terry, Nathaniel Grammel, Ananth Hari, Luis Santos, and Benjamin Black. Revisiting parameter sharing in multi-agent deep reinforcement learning. arXiv preprint arXiv:2005.13625, 2020a. ",
1530
+ "bbox": [
1531
+ 173,
1532
+ 720,
1533
+ 823,
1534
+ 751
1535
+ ],
1536
+ "page_idx": 10
1537
+ },
1538
+ {
1539
+ "type": "text",
1540
+ "text": "Justin K Terry and Benjamin Black. Multiplayer support for the arcade learning environment. arXiv preprint arXiv:2009.09341, 2020. ",
1541
+ "bbox": [
1542
+ 173,
1543
+ 758,
1544
+ 823,
1545
+ 787
1546
+ ],
1547
+ "page_idx": 10
1548
+ },
1549
+ {
1550
+ "type": "text",
1551
+ "text": "Justin K Terry, Benjamin Black, and Ananth Hari. Supersuit: Simple microwrappers for reinforcement learning environments. arXiv preprint arXiv:2008.08932, 2020b. ",
1552
+ "bbox": [
1553
+ 173,
1554
+ 795,
1555
+ 823,
1556
+ 825
1557
+ ],
1558
+ "page_idx": 10
1559
+ },
1560
+ {
1561
+ "type": "text",
1562
+ "text": "Justin K Terry, Benjamin Black, and Ananth Hari. Supersuit: Simple microwrappers for reinforcement learning environments. arXiv preprint arXiv:2008.08932, 2020c. ",
1563
+ "bbox": [
1564
+ 171,
1565
+ 832,
1566
+ 823,
1567
+ 862
1568
+ ],
1569
+ "page_idx": 10
1570
+ },
1571
+ {
1572
+ "type": "text",
1573
+ "text": "Justin K Terry, Nathaniel Grammel, Ananth Hari, Luis Santos, and Benjamin Black. Revisiting parameter sharing in multi-agent deep reinforcement learning. arXiv preprint arXiv:2005.13625, 2020d. ",
1574
+ "bbox": [
1575
+ 173,
1576
+ 869,
1577
+ 826,
1578
+ 911
1579
+ ],
1580
+ "page_idx": 10
1581
+ },
1582
+ {
1583
+ "type": "text",
1584
+ "text": "Gerald Tesauro. Temporal difference learning and td-gammon. Commun. ACM, 38(3):58–68, March 1995. ISSN 0001-0782. doi: 10.1145/203330.203343. URL https://doi.org/10.1145/ 203330.203343. ",
1585
+ "bbox": [
1586
+ 173,
1587
+ 92,
1588
+ 825,
1589
+ 133
1590
+ ],
1591
+ "page_idx": 11
1592
+ },
1593
+ {
1594
+ "type": "text",
1595
+ "text": "Rene Vidal, Omid Shakernia, H Jin Kim, David Hyunchul Shim, and Shankar Sastry. Probabilistic pursuit-evasion games: theory, implementation, and experimental evaluation. IEEE transactions on robotics and automation, 18(5):662–669, 2002. ",
1596
+ "bbox": [
1597
+ 174,
1598
+ 142,
1599
+ 823,
1600
+ 184
1601
+ ],
1602
+ "page_idx": 11
1603
+ },
1604
+ {
1605
+ "type": "text",
1606
+ "text": "Eugene Vinitsky, Natasha Jaques, Joel Leibo, Antonio Castenada, and Edward Hughes. An open source implementation of sequential social dilemma games. https://github.com/ eugenevinitsky/sequential_social_dilemma_games/, 2019. GitHub repository. ",
1607
+ "bbox": [
1608
+ 174,
1609
+ 194,
1610
+ 825,
1611
+ 236
1612
+ ],
1613
+ "page_idx": 11
1614
+ },
1615
+ {
1616
+ "type": "text",
1617
+ "text": "Oriol Vinyals, Igor Babuschkin, Wojciech M Czarnecki, Michaël Mathieu, Andrew Dudzik, Junyoung Chung, David H Choi, Richard Powell, Timo Ewalds, Petko Georgiev, et al. Grandmaster level in starcraft ii using multi-agent reinforcement learning. Nature, 575(7782):350–354, 2019. ",
1618
+ "bbox": [
1619
+ 174,
1620
+ 244,
1621
+ 825,
1622
+ 287
1623
+ ],
1624
+ "page_idx": 11
1625
+ },
1626
+ {
1627
+ "type": "text",
1628
+ "text": "Jiayi Weng, Minghao Zhang, Alexis Duburcq, Kaichao You, Dong Yan, Hang Su, and Jun Zhu. Tianshou. https://github.com/thu-ml/tianshou, 2020. ",
1629
+ "bbox": [
1630
+ 173,
1631
+ 296,
1632
+ 823,
1633
+ 325
1634
+ ],
1635
+ "page_idx": 11
1636
+ },
1637
+ {
1638
+ "type": "text",
1639
+ "text": "Daochen Zha, Kwei-Herng Lai, Yuanpu Cao, Songyi Huang, Ruzhe Wei, Junyu Guo, and Xia Hu. Rlcard: A toolkit for reinforcement learning in card games. arXiv preprint arXiv:1910.04376, 2019. ",
1640
+ "bbox": [
1641
+ 174,
1642
+ 333,
1643
+ 826,
1644
+ 376
1645
+ ],
1646
+ "page_idx": 11
1647
+ },
1648
+ {
1649
+ "type": "text",
1650
+ "text": "Lianmin Zheng, Jiacheng Yang, Han Cai, Weinan Zhang, Jun Wang, and Yong Yu. Magent: A many-agent reinforcement learning platform for artificial collective intelligence. arXiv preprint arXiv:1712.00600, 2017. ",
1651
+ "bbox": [
1652
+ 173,
1653
+ 386,
1654
+ 826,
1655
+ 428
1656
+ ],
1657
+ "page_idx": 11
1658
+ }
1659
+ ]
parse/train/fLnsj7fpbPI/fLnsj7fpbPI_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/fLnsj7fpbPI/fLnsj7fpbPI_model.json ADDED
The diff for this file is too large to render. See raw diff