ZHANGYUXUAN-zR commited on
Commit
161cf7d
·
verified ·
1 Parent(s): eecf4c5

Add files using upload-large-folder tool

Browse files
parse/train/Bke96sC5tm/Bke96sC5tm.md ADDED
@@ -0,0 +1,300 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # SOLAR: DEEP STRUCTURED REPRESENTATIONS FOR MODEL-BASED REINFORCEMENT LEARNING
2
+
3
+ Anonymous authors Paper under double-blind review
4
+
5
+ # ABSTRACT
6
+
7
+ Model-based reinforcement learning (RL) methods can be broadly categorized as global model methods, which depend on learning models that provide sensible predictions in a wide range of states, or local model methods, which iteratively refit simple models that are used for policy improvement. While predicting future states that will result from the current actions is difficult, local model methods only attempt to understand system dynamics in the neighborhood of the current policy, making it possible to produce local improvements without ever learning to predict accurately far into the future. The main idea in this paper is that we can learn representations that make it easy to retrospectively infer simple dynamics given the data from the current policy, thus enabling local models to be used for policy learning in complex systems. We evaluate our approach against other model-based and model-free RL methods on a suite of robotics tasks, including a manipulation task on a real Sawyer robotic arm directly from camera images.
8
+
9
+ # 1 INTRODUCTION
10
+
11
+ Model-based reinforcement learning (RL) methods use learned models in a variety of ways, such as planning (Levine & Abbeel, 2014; Deisenroth et al., 2014) and generating synthetic experience (Sutton, 1990). We can categorize model-based algorithms as either global model methods, where models are used for planning and trained to give accurate predictions for a wide range of states, or local model methods, where simple models provide gradient directions that are used for policy improvement. On simple, low-dimensional tasks, model-based approaches have demonstrated remarkable data efficiency, learning policies for systems like cart-pole swing-up with under 30 seconds of experience (Deisenroth et al., 2014; Moldovan et al., 2015). However, for more complex systems, one of the main difficulties in applying model-based methods is model bias: local models will often underfit complex systems, but may still be preferred over global models which tend to overfit in the low-data regime and may be difficult to incorporate into control methods (Deisenroth et al., 2014).
12
+
13
+ Most global model methods use the model to make forward predictions and then backpropagate through those predictions. However, this places a heavy burden on the dynamics model, and forward prediction often suffers from significant drift over longer trajectories. In contrast, local models are typically only used to provide gradient directions for local policy improvement (Levine & Abbeel, 2014), and thus a common choice for local model methods is to use linear models, which can themselves be interpreted as gradients. As illustrated in Figure 1, in our work, we present a method that automatically encourages learning representations where linear models better fit the data. From this, we devise an efficient local model method based on the linear-quadratic regulator (LQR) (Camacho & Bordons, 1997; Todorov & Li, 2005; Levine & Abbeel, 2014) that utilizes linear models for gradient directions for policy improvement. Our motivation is similar to that of Watter et al. (2015); Finn et al. (2016); however, as discussed in section 5, our representation learning method specifically allows us to construct a local model method that performs inference in the latent space in order to improve the policy, rather than focusing on forward prediction and planning.
14
+
15
+ Our main contribution is a representation learning and model-based RL procedure, which we term stochastic optimal control with latent representations (SOLAR), which jointly optimizes a latent representation and model such that inference produces local linear models that provide good gradient directions for policy improvement. We demonstrate empirically in section 6 that SOLAR is able to learn policies directly from raw, high-dimensional observations in several robotic environments including a simulated nonholonomic car, a simulated two degree-of-freedom (DoF) arm, and a real 7-DoF Sawyer arm, all of which are learned directly from image pixels. We compare to existing state-of-the-art RL methods and show that SOLAR, while significantly more data efficient than model-free methods, exhibits superior performance compared to other model-based methods.
16
+
17
+ ![](images/26292365d207757a499029b76f3ed212d27801b63f66de57c24c92b2c62f867d.jpg)
18
+ Figure 1: (a) A pictoral depiction of a trajectory for a one-dimensional system. (b) Global models may be used for prediction or planning forward through time, as depicted in red, but this can suffer from trajectory drift for complex systems. (c) Local linear models are fit to trajectories and do not suffer from drift, but may fit the system poorly for complicated interactions such as contacts, as illustrated by the poor model fit circled in gray. (d) Our method finds an embedding of observed trajectories into a latent space where local linear models produce a better fit.
19
+
20
+ # 2 PRELIMINARIES
21
+
22
+ We first formalize our problem setting as a Markov decision process (MDP) $M = ( S , { \mathcal { A } } , p , C , \rho , T )$ , where the state space $s$ , action space $\mathcal { A }$ , and horizon $T$ are known, but the dynamics function $p ( \mathbf { s } _ { t + 1 } | \mathbf { s } _ { t } , \mathbf { a } _ { t } )$ , cost function ${ \cal C } ( \mathbf { s } _ { t } , \mathbf { a } _ { t } )$ , and initial state distribution $\rho ( \mathbf { s } _ { 0 } )$ are unknown. The goal of reinforcement learning is to optimize a policy $\pi ( \mathbf { a } _ { t } | \mathbf { s } _ { t } )$ to minimize the expected sum of costs $\begin{array} { r } { \eta [ \pi ] = \mathbb { E } _ { \pi , p , \rho } \left[ \sum _ { t = 0 } ^ { T } C ( \mathbf { s } _ { t } , \mathbf { a } _ { t } ) \right] } \end{array}$ under the distribution induced by the initial state distribution, dynamics function, and policy. Model-based methods decompose this problem into policy and model optimization subproblems, and we discuss each subproblem as it relates to our approach.
23
+
24
+ # 2.1 MODEL-BASED POLICY SEARCH
25
+
26
+ Policy search methods directly optimize parameterized policies with respect to $\eta ( \theta ) \triangleq \eta [ \pi _ { \theta } ]$ where the parameters $\theta$ may be, for example, weights in a neural network or matrices for a linear policy. Model-based policy search methods typically build models $\left( { \hat { \rho } } , { \hat { p } } , { \hat { C } } \right)$ of the unknown quantities and compute the gradient of $\begin{array} { r } { \hat { \eta } ( \theta ) \triangleq \mathbb { E } _ { \pi _ { \theta } , \hat { p } , \hat { \rho } } \left[ \sum _ { t = 0 } ^ { T } \hat { C } ( \mathbf { s } _ { t } , \mathbf { a } _ { t } ) \right] } \end{array}$ with this model. One particularly tractable model is the linear-quadratic system (LQS), which models the initial state distribution as Gaussian, the dynamics as time-varying linear-Gaussian (TVLG), and the cost as quadratic, i.e.,
27
+
28
+ $$
29
+ \hat { p } ( { \mathbf s } _ { t + 1 } | { \mathbf s } _ { t } , { \mathbf a } _ { t } ) = \mathcal { N } \left( { \mathbf s } _ { t + 1 } \left| \begin{array} { l } { { \mathbf F } _ { t } \left[ \mathbf { s } _ { t } \right] , \Sigma _ { t } \right) , \quad \hat { C } ( { \mathbf s } _ { t } , { \mathbf a } _ { t } ) = \frac { 1 } { 2 } \left[ \mathbf { \bar { a } } _ { t } \right] ^ { \top } { \mathbf C } \left[ \mathbf { \bar { a } } _ { t } \right] + { \mathbf c } ^ { \top } \left[ \mathbf { \bar { a } } _ { t } \right] . } \end{array} \right.
30
+ $$
31
+
32
+ Any deterministic policy operating in an environment with smooth dynamics can be locally modeled with a time-varying LQS (Boyd & Vandenberghe, 2004), while low-entropy stochastic policies are modeled approximately. This makes the time-varying LQS a reasonable local model for many dynamical systems. Furthermore, the optimal policy at any time step given the model is a linear function of the state and the optimal maximum-entropy policy is linear-Gaussian (Tassa et al., 2012; Levine & Koltun, 2013). As shown in Jacobson & Mayne (1970); Todorov & Li (2005), these optimal policies can be computed in closed form using dynamic programming by computing the first and second derivatives of the Q (cost-to-go) and value functions:
33
+
34
+ $$
35
+ \begin{array} { r l r } & { Q _ { \tilde { { \mathbf { s } } } , t } = { \mathbf { c } } _ { \tilde { { \mathbf { s } } } , t } + { \mathbf { F } } _ { \tilde { { \mathbf { s } } } , t } ^ { \top } V _ { { \mathbf { s } } , t + 1 } , } & { Q _ { \tilde { { \mathbf { s } } } { \mathbf { s } } , t } = { \mathbf { C } } _ { \tilde { { \mathbf { s } } } { \mathbf { s } } , t } + { \mathbf { F } } _ { \tilde { { \mathbf { s } } } { \mathbf { s } } , t } ^ { \top } V _ { { \mathbf { s } } { \mathbf { s } } , t + 1 } { \mathbf { F } } _ { \tilde { { \mathbf { s } } } { \mathbf { s } } , t } , } \\ & { V _ { { \mathbf { s } } , t } = Q _ { { \mathbf { s } } , t } - Q _ { { \mathbf { s } } { \mathbf { a } } , t } Q _ { { \mathbf { a } } { \mathbf { a } } , t } ^ { - 1 } Q _ { { \mathbf { a } } , t } , } & { V _ { { \mathbf { s } } { \mathbf { s } } , t } = Q _ { { \mathbf { s } } { \mathbf { s } } , t } - Q _ { { \mathbf { s } } { \mathbf { a } } , t } Q _ { { \mathbf { a } } { \mathbf { a } } , t } ^ { - 1 } Q _ { { \mathbf { a } } { \mathbf { s } } , t } . } \end{array}
36
+ $$
37
+
38
+ Here, similar to Tassa et al. (2012), we use subscripts to denote derivatives, and we use $\tilde { \mathbf { s } }$ to abbreviate h s a i . Once these values are computed, the optimal maximum-entropy policy is TVLG, i.e.,
39
+
40
+ $$
41
+ \begin{array} { r } { \pi _ { \theta } ( \mathbf { a } _ { t } | \mathbf { s } _ { t } ) = \mathcal { N } \left( \mathbf { K } _ { t } \mathbf { s } _ { t } + \mathbf { k } _ { t } , \mathbf { S } _ { t } \right) \mathrm { , ~ w h e r e } \mathbf { K } _ { t } = - Q _ { \mathbf { a a } , t } ^ { - 1 } Q _ { \mathbf { a s } , t } \mathrm { , ~ } \mathbf { k } _ { t } = - Q _ { \mathbf { a a } , t } ^ { - 1 } Q _ { \mathbf { a } , t } \mathrm { , ~ } \mathbf { S } _ { t } = - Q _ { \mathbf { a a } , t } ^ { - 1 } \mathrm { . } } \end{array}
42
+ $$
43
+
44
+ We refer the reader to Appendix A and Levine & Abbeel (2014) for further details. Prior work assumes access to a compact, low-dimensional state representation (Deisenroth et al., 2014; Levine & Abbeel, 2014; Nagabandi et al., 2018), and as we show in section 6, this precludes these local model methods from operating on complex observations such as images. In subsection 2.2 and section 3, we describe a probabilistic latent variable model and variational inference procedure that, conditioned on a full trajectory of observations, produces local models that can be used for policy improvement, enabling us to utilize this local model method in image-based domains.
45
+
46
+ # 2.2 LEARNING LATENT DYNAMICS MODELS
47
+
48
+ The local model-based method described above requires us to learn both a quadratic cost function as well as a linear dynamical system (LDS). We utilize the Bayesian LDS model, which is given by
49
+
50
+ $$
51
+ \begin{array} { r l } & { \mu _ { \hat { \rho } } , \Sigma _ { \hat { \rho } } \sim \mathcal { N } T \mathcal { W } ( \Psi , \nu , \mu _ { 0 } , \kappa ) , \quad \mathbf { F } _ { t } , \Sigma _ { t } \sim \mathcal { M N T W } ( \Psi , \nu , M _ { 0 } , V ) \mathrm { ~ f o r ~ } t \in [ 0 , \dots , T - 1 ] , } \\ & { \mathbf { s } _ { 0 } \mid \mu _ { \hat { \rho } } , \Sigma _ { \hat { \rho } } \sim \mathcal { N } ( \mu _ { \hat { \rho } } , \Sigma _ { \hat { \rho } } ) , \qquad \mathbf { s } _ { t + 1 } \mid \mathbf { s } _ { t } , \mathbf { a } _ { t } \sim \mathcal { N } \left( \mathbf { F } _ { t } \left[ \mathbf { a } _ { t } \right] , \Sigma _ { t } \right) \mathrm { ~ f o r ~ } t \in [ 0 , \dots , T - 1 ] , } \end{array}
52
+ $$
53
+
54
+ Where $\mathcal { N T } \mathcal { W }$ is the normal-inverse-Wishart distribution and $\mathcal { M N T } \mathcal { W }$ is the matrix normal-inverseWishart (MNIW) distribution. This probabilistic graphical model (PGM) allows for tractable approximate inference, i.e., Bayesian linear regression, and also captures uncertainty in the form of a posterior distribution over the initial state and dynamics. However, for dynamical systems with complex non-linear dynamics, this model still suffers from significant bias.
55
+
56
+ Even when the system is poorly modeled by an LDS in the state space, we might be able to find a latent embedding and model the system as approximately linear in that latent space, which may allow us to find a better-performing policy that operates in the learned latent space. This shifts our problem setting to that of a partially observed MDP, as we do not observe the latent state. In particular, our modeling assumption is that we receive an observation as generated from an underlying unobserved state, and as discussed in section 3, we address this by training a recognition model to infer the latent state. In our experiments in section 6, we provide several observations to our recognition model in order to infer information that cannot be observed from a single observation, such as velocity. We can jointly train an embedding and model using the SVAE framework (Johnson et al., 2016), which allows us to combine arbitrary embedding functions, such as neural networks, with PGMs. The model we build off of is a version of the LDS SVAE presented in Johnson et al. (2016) and is given by
57
+
58
+ $$
59
+ \begin{array} { r l } & { \mu _ { \hat { \rho } } , \Sigma _ { \hat { \rho } } \sim \mathcal { N } \mathcal { D } \mathcal { W } ( \Psi , \nu , \mu _ { 0 } , \kappa ) , \quad \mathbf { F } _ { t } , \Sigma _ { t } \sim \mathcal { M } \mathcal { N } \mathcal { D } ( \Psi , \nu , M _ { 0 } , V ) \mathrm { ~ f o r ~ } t \in [ 0 , \dots , T - 1 ] , } \\ & { \mathbf { z } _ { 0 } \mid \mu _ { \hat { \rho } } , \Sigma _ { \hat { \rho } } \sim \mathcal { N } ( \mu _ { \hat { \rho } } , \Sigma _ { \hat { \rho } } ) , \qquad \mathbf { z } _ { t + 1 } \mid \mathbf { z } _ { t } , \mathbf { a } _ { t } \sim \mathcal { N } \left( \mathbf { F } _ { t } \left[ \mathbf { z } _ { t } \right] , \Sigma _ { t } \right) \mathrm { ~ f o r ~ } t \in [ 0 , \dots , T - 1 ] , } \\ & { \mathbf { s } _ { t } \mid \mathbf { z } _ { t } \sim f _ { \gamma } \left( \mathbf { z } _ { t } \right) \mathrm { ~ f o r ~ } t \in [ 0 , \dots , T ] , } \end{array}
60
+ $$
61
+
62
+ Where $f _ { \gamma } ( \mathbf { z } )$ is an observation model, parameterized by neural network weights $\gamma$ , that outputs a distribution over s, e.g., Gaussian or Bernoulli, depending on the nature of the data. This is very similar to the Bayesian LDS, except we are learning the PGM in the latent space.
63
+
64
+ Though this model does not admit the same efficient approximate inference algorithms when $f _ { \gamma }$ is nonlinear, an efficient variational inference algorithm has previously been derived by Johnson et al. (2016). We describe the relevant aspects of this algorithm in the next section.
65
+
66
+ # 3 LEARNING AND MODELING THE LATENT SPACE
67
+
68
+ In this section, we describe how we extend the LDS SVAE for model-based RL, such that we learn an action-conditioned LQS model in the latent space. This then enables a local model method that can leverage the LQS to infer the dynamics of sampled trajectories. In this way, our model-based RL algorithm circumvents the need for forward prediction, in contrast to model-based RL methods that use model-based rollouts or planning (Nagabandi et al., 2018; Deisenroth et al., 2014). In section 4, we describe how these components are combined into our final method, SOLAR.
69
+
70
+ Our goal with this model is to learn a latent representation of the state and a prior over the dynamics in this latent representation that is suitable for fitting local dynamics models via posterior inference. Specifically, we are interested in the setting where we have access to trajectories of the form $\left[ \mathbf { s } _ { 0 } , \mathbf { a } _ { 0 } , c _ { 0 } , \ldots , \mathbf { s } _ { T - 1 } , \mathbf { a } _ { T - 1 } , c _ { T - 1 } , \mathbf { s } _ { T } \right]$ , sampled from the system using our current policy and set of previous policies. Our aim is to infer local linear dynamics in the neighborhood of these trajectories, and we learn a model that makes this fitting process more accurate for the observed trajectories, thus enabling our local model method to find good directions for policy improvement.
71
+
72
+ ![](images/5a042b5a0c0145f83947a13d9eead8c41c5137ce2fe290837a42157101abe5d9.jpg)
73
+ Figure 2: Left: The LQS graphical model. Distributions for each node are as specified in Equation 2-Equation 4, with additional deterministic nodes for observed costs. Right: The variational family we use for our model learning algorithm, with distributions given in Equation 5.
74
+
75
+ We build upon the variational inference algorithm presented in Johnson et al. (2016), such that we are maximizing, with respect to both the PGM and neural network parameters, the variational lower bound (ELBO) of our observed data. This algorithm requires variational factors of the form
76
+
77
+ $$
78
+ \begin{array} { r } { q ( \mathbf { z } _ { t } \mid \mathbf { s } _ { t } ) = \mathcal { N } \left( e _ { \phi } \left( \mathbf { s } _ { t } \right) \right) , q ( \mathbf { F } _ { t } , \Sigma _ { t } ) = \mathcal { M } \mathcal { N } \mathcal { Z } \mathcal { W } ( \Psi _ { t } ^ { \prime } , \nu _ { t } ^ { \prime } , M _ { 0 t } ^ { \prime } , V _ { t } ^ { \prime } ) \mathrm { ~ f o r ~ } t \in \left[ 0 , \dots , T - 1 \right] . } \end{array}
79
+ $$
80
+
81
+ $e _ { \phi } ( \mathbf { s } )$ is a recognition model, parameterized by neural network weights $\phi$ , that outputs the mean and diagonal covariance of a Gaussian distribution over $\mathbf { z }$ . This recognition model is identical to that used in Kingma & Welling (2014); Rezende et al. (2014); Gao et al. (2016), however, as with prior work in the LDS SVAE, we also have variational factors of the form $q ( \mathbf { F } _ { t } , \Sigma _ { t } )$ , which represent our posterior belief about the system dynamics after observing the collected data. We also model this distribution as MNIW but with updated parameters compared to the prior from Equation 2. Given this, we can formulate the variational lower bound (ELBO) which is given by
82
+
83
+ $$
84
+ \begin{array} { l } { { \displaystyle { \mathcal { L } } = { \mathbb { E } } _ { q } [ \log \frac { p ( \{ \mathbf { F } , \Sigma \} _ { t = 0 } ^ { T - 1 } , \{ \mathbf { s } _ { t } \} _ { t = 0 } ^ { T } , \{ \mathbf { a } _ { t } \} _ { t = 0 } ^ { T - 1 } , \mathbf { z } _ { t } \} _ { t = 0 } ^ { T } ) } { q ( \{ \mathbf { F } _ { t } , \Sigma _ { t } \} _ { t = 0 } ^ { T - 1 } , \{ \mathbf { z } _ { t } \} _ { t = 0 } ^ { T } | \mathbf { s } _ { t } ) | \{ \mathbf { s } _ { t } \} _ { t = 0 } ^ { T } ] } } \ ~ } \\ { { \displaystyle ~ = { \mathbb { E } } _ { q } [ \log ( \prod _ { t = 0 } ^ { T } p _ { \gamma } ( \mathbf { s } _ { t } | \mathbf { z } _ { t } ) ) ] } \ ~ } \\ { { \displaystyle ~ - \sum _ { t = 0 } ^ { T - 1 } \mathrm { K L } ( q ( \mathbf { F } _ { t } , \Sigma _ { t } ) \| p ( \mathbf { F } , \Sigma ) ) - \sum _ { t = 1 } ^ { T } \mathbb { E } _ { q } [ \mathrm { K L } ( q _ { \phi } ( \mathbf { z } _ { t } | \mathbf { s } _ { t } ) \| p ( \mathbf { z } _ { t } | \mathbf { z } _ { t - 1 } , \mathbf { a } _ { t - 1 } , \mathbf { F } _ { t } , \Sigma _ { t } ) ] . } \ } \end{array}
85
+ $$
86
+
87
+ Prior work has shown that, for conjugate exponential models such as the Bayesian LDS, the variational model parameters can be updated using natural gradients, which can be computed in closed form using the variational message passing framework (Winn & Bishop, 2005). Specifically, letting $\lambda$ denote the MNIW parameters of the variational factors on $\{ \mathbf { F } _ { t } , \Sigma _ { t } \} _ { t }$ , the natural gradient update is
88
+
89
+ $$
90
+ \tilde { \nabla } _ { \lambda } \mathcal { L } = \lambda ^ { 0 } + B \mathbb { E } _ { q } \left[ t _ { \mathbf { F } , \Sigma } ( \mathbf { F } , \Sigma ) \right] - \lambda ,
91
+ $$
92
+
93
+ Where $B$ is the number of minibatches in the dataset, $\lambda ^ { 0 }$ is the parameter for the prior distribution $p ( \mathbf { F } , \Sigma )$ , and $t _ { \mathbf { F } , \Sigma } ( \mathbf { F } , \Sigma )$ is the sufficient statistic function for $p ( \mathbf { F } , \Sigma )$ . Thus, we can use this equation to compute the natural gradient update for $\lambda$ , whereas for $\gamma$ and $\phi$ we use stochastic gradient updates on Monte Carlo estimates of the ELBO, specifically using the Adam optimization scheme (Kingma & Ba, 2015). This leads to two simultaneous optimizations for the PGM parameters and the neural network parameters, and their learning rates are treated as separate hyperparameters. We have found $1 0 ^ { - 3 }$ and $1 0 ^ { - 4 }$ to be generally suitable for the natural gradient and Adam updates, respectively.
94
+
95
+ # Algorithm 1 SOLAR
96
+
97
+ <table><tr><td></td><td>1:Hyperparameters: # iterations K,# trajectories N,model training buffer size B</td></tr><tr><td></td><td>(0)</td></tr><tr><td>3:</td><td>for iteration k ∈{1,...,K} do</td></tr><tr><td>4:</td><td>(i) N )=1</td></tr><tr><td>5:</td><td>M(b)← MODELUPDATE(M(k-1), {D(i)}k=k-B) (section 3)</td></tr><tr><td>6:</td><td></td></tr><tr><td>7:</td><td>{F(), (k) )}t ← INFERDYNAMICs(D(k),M(k)) (subsection 4.1) 1 t ,</td></tr><tr><td>8: T0 9:</td><td>←POLICYUPDATE(( (k) (k-1) ,{F(), , end for</td></tr></table>
98
+
99
+ Figure 2 details the graphical model presented in Equation 2-Equation 4 along with the variational family described above. Since we are interested in control and RL, there is the added notion of observed costs from the environment, and there are many ways we could model these additional observations. A natural choice is to model costs as a quadratic function of the latent state and action, such that we arrive at the LQS presented in Equation 1 except in the learned latent space. Specifically, given trajectories of the form $\left[ \mathbf { s } _ { 0 } , \mathbf { a } _ { 0 } , c _ { 0 } , \ldots , \mathbf { s } _ { T - 1 } , \mathbf { a } _ { T - 1 } , c _ { T - 1 } , \mathbf { s } _ { T } \right]$ , we first embed the observations $\left\{ \mathbf { s } _ { t } \right\}$ using the mean of our recognition model $\mu ( e _ { \phi } ( \mathbf { s } ) )$ to obtain a set of latent states $\left\{ { \bf z } _ { t } \right\}$ . We then model our cost samples as $\begin{array} { r } { c _ { t } = \frac { 1 } { 2 } \mathbf { z } _ { t } ^ { \top } \mathbf { L } \mathbf { L } ^ { \top } \mathbf { z } _ { t } + \mathbf { c } ^ { \top } \mathbf { z } _ { t } + \alpha \| \mathbf { a } _ { t } \| _ { 2 } ^ { 2 } + b , } \end{array}$ , where we assume that the action-dependent part of the cost is known and we learn L, c, and $b$ by minimizing the mean-squared error of the observed costs with stochastic gradient descent. $\mathbf { L }$ is a lower-triangular matrix with strictly positive diagonal entries, and thus by constructing our cost matrix as $\mathbf { C } = \mathbf { L } \mathbf { L } ^ { \top }$ we guarantee that the learned cost matrix is positive definite, which improves the conditioning of the policy update.
100
+
101
+ # 4 POLICY LEARNING IN THE LATENT SPACE
102
+
103
+ While we could use a variety of model-based policy learning methods in the learned latent space, the ability to infer local time-varying linear dynamics lends itself naturally to the particular analytic local solution to the policy described in subsection 2.1. This approach yields a policy that is TVLG in the latent space, which in general corresponds to a class of nonlinear policies in the original space formed by the composition of the nonlinear neural network embedding and the TVLG policy.
104
+
105
+ As discussed in the following sections, we can use the PGM in the previous section to formulate local model fitting as probabilistic inference, in order to obtain a dynamics estimate that we can then use to improve the policy. Note that this use of the model is quite different from how dynamics models are typically used in standard model-based RL algorithms: instead of using the model to predict into the future, we only use the model to infer local linear dynamics conditioned on real-world trajectory samples. While local models are not burdened by forward prediction compared to global forward models, the simplicity of linear local models prevents accurate modeling of complex systems, and our method mitigates this through a latent representation that is optimized for local linear model fitting.
106
+
107
+ Our overall algorithm, SOLAR, is presented in algorithm 1. At every iteration, we collect $N$ rollouts from the real world (line 4). Then, we update our model using data from the last $B$ iterations (line 5), we linearize our policy given the updated model (line 6, see Appendix C for details), we perform inference within our model to get the dynamics estimates (line 7), and we update our policy using the rollouts from our current iteration and our updated model (line 8). The following subsections detail the modules of our method that are involved in policy learning and improvement.
108
+
109
+ # 4.1 DYNAMICS INFERENCE UNDER THE MODEL
110
+
111
+ To obtain a TVLG dynamics model, we could directly use linear regression to fit $\mathbf { F } _ { t }$ and $\Sigma _ { t }$ to the observed latent trajectories $\tau = [ \mathbf { z } _ { 0 } , \mathbf { a } _ { 0 } , \ldots , \mathbf { z } _ { T - 1 } , \mathbf { a } _ { T - 1 } , \mathbf { z } _ { T } ]$ . However, this may be poorly conditioned in the low-data regime. Instead, we can perform inference within our model to obtain dynamics estimates for policy improvement. As described in section 3, our model provides us with variational approximations to the posterior over dynamics models, i.e., $\{ q ( \mathbf { F } _ { t } , \Sigma _ { t } ) \} _ { t = 0 } ^ { T - 1 }$ , which are MNIW. We can use these as a prior and condition on the data to obtain new variational posteriors $\{ q ( \mathbf { F } _ { t } , \Sigma _ { t } | \{ \tau \} _ { i = 0 } ^ { N } ) \} _ { t = 0 } ^ { T - 1 }$ , which are also MNIW. Writing the parameters of these posteriors – for which the closed form solutions are given in Appendix $\mathrm { \bf B - }$ as $\{ \Psi _ { t } , M _ { 0 t } , V _ { t } , \nu _ { t } \} _ { t }$ , we compute a maximum a posteriori estimate of the dynamics parameters at time step $t$ as: $\begin{array} { r } { \mathbf { F } _ { t } = M _ { 0 t } , \Sigma _ { t } = \frac { \Psi _ { t } } { \nu _ { t } } } \end{array}$ . This inference procedure corresponds to Bayesian linear regression and can be interpreted as resolving the uncertainty in the global dynamics model conditioned on a real-world rollout. In essence, $\{ q ( \mathbf { F } _ { t } , \Sigma _ { t } ) \} _ { t = 0 } ^ { T - 1 }$ captures uncertainty over the latent system dynamics by acting as a global model over all observed data, but in order to accurately model the system within the local region around the current policy, we condition on trajectories collected from the policy in order to resolve the uncertainty and obtain dynamics estimates $\begin{array} { r } { \{ \mathbf { F } _ { t } , \boldsymbol { \Sigma } _ { t } \} _ { t = 0 } ^ { T - 1 } } \end{array}$ that allow us to improve the policy.
112
+
113
+ # 4.2 POLICY UPDATE
114
+
115
+ As described in subsection 2.1, once we have our TVLG dynamics estimates $\{ \mathbf { F } _ { t } , \Sigma _ { t } \} _ { t }$ and quadratic cost fit $\mathbf { C } , \mathbf { c }$ , we can use dynamic programming on the Q and value functions to compute the optimal policy in closed form. However, doing so is typically undesirable as the resulting policy will overfit to the model and likely will not perform well in the real environment. Since our modeling assumption is not that our model will be globally valid, but rather that our model will be valid close to the data distribution of the previous policy, we utilize a constrained policy update such that our new policy does not drastically change the induced trajectory distribution. Specifically, similar to prior work, we impose a KL-divergence constraint on the policy update such that the shift in the induced trajectory distributions before and after the update, which we denote as $\bar { p } ( \tau )$ and $p ( \tau )$ , respectively, is bounded by a step size $\epsilon$ (Levine & Abbeel, 2014). This leads to a constrained optimization of the form $\operatorname* { m a x } _ { \theta } \ \hat { \eta } ( \theta )$ s.t. $D _ { \mathrm { K L } } ( p ( \tau ) \lVert \bar { p } ( \tau ) ) \leq \epsilon$ . As shown in Levine & Abbeel (2014), this constrained optimization can be solved by augmenting the cost function to penalize the deviation from the previous policy $\pi _ { \bar { \theta } }$ , i.e., $\begin{array} { r } { \tilde { C } ( \mathbf { z } _ { t } , \mathbf { a } _ { t } ) = \frac { 1 } { \lambda } C ( \mathbf { z } _ { t } , \mathbf { a } _ { t } ) - \log \pi _ { \bar { \theta } } ( \mathbf { a } _ { t } | \mathbf { z } _ { t } ) } \end{array}$ . Note that this augmented cost function is still quadratic, since the policy is TVLG, and thus we can still compute the optimal policy under this cost function in closed form using the procedure described in subsection 2.1. $\lambda$ is a dual variable that trades off between optimizing the cost function and staying close in distribution to the previous policy, and the weight of this term can be determined through a dual gradient descent procedure. Combined with the model learning from section 3, we arrive at the SOLAR algorithm.
116
+
117
+ # 5 RELATED WORK
118
+
119
+ Model-based RL methods have achieved significant efficiency benefits compared to model-free RL methods (Chebotar et al., 2017; Nagabandi et al., 2018; Deisenroth et al., 2014). Many of these prior methods learn global models of the system that are then used for planning, generating synthetic experience, or policy search (Atkeson & Schaal, 1997; Peters et al., 2010). These methods require an accurate and reliable model and will typically suffer from modeling bias, hence these models are still limited to short horizon prediction in more complex domains (Mishra et al., 2017; Nagabandi et al., 2018; Gu et al., 2016; V.Feinberg et al., 2018). Another class of model-based methods rely only on local system models to compute the gradient for a policy update (An et al., 1988; Kolter & Ng, 2005; Heess et al., 2015; Levine & Abbeel, 2014; Bansal et al., 2017). These methods do not use models for long-term forward prediction, allowing for the use of simple models that enable policy improvement (Montgomery et al., 2017; Levine et al., 2016). As we show in section 6, modeling bias for prior methods can be severely limiting in systems with complex observations such as images, whereas we are able to learn representations that mitigate the effects of modeling bias.
120
+
121
+ Utilizing representation learning within model-based RL has been studied in a number of previous works (Lesort et al., 2018), including using embeddings for state aggregation (Singh et al., 1994), dimensionality reduction (Nouri & Littman, 2010), self-organizing maps (Smith, 2002), value prediction (Oh et al., 2017), and deep auto-encoders (Lange & Riedmiller, 2010; Finn et al., 2016; Watter et al., 2015; Higgins et al., 2017). Within these works, deep spatial auto-encoders (DSAE) (Finn et al., 2016) and embed to control (E2C) (Watter et al., 2015; Banijamali et al., 2017) are the most closely related to our work in that they consider local model methods combined with representation learning. The key difference in our work is that, rather than using a learning objective for reconstruction and forward prediction, we formulate a Bayesian latent variable model such that inference corresponds to fitting local models within the learned representation. As such, our objective enables local model methods by directly encouraging learning representations where fitting local models accurately explains the observed data. We also do not assume a known cost function, goal state, or access to the underlying system state as in DSAE and E2C, thus SOLAR is applicable even when the underlying states and cost function are unknown.1 We find that our approach tends to produce better results on a number of complex image-based tasks, as we discuss in the next section.
122
+
123
+ ![](images/25f1d947657a301ce0b4d4892e094a9246939062b82252ef0bc5e4f6ba3ce971.jpg)
124
+ Figure 3: (a) Top: Visualizing a trajectory in the car navigation environment, with the target denoted by the black dot, and the corresponding image observation. Bottom: An illustration of the 2-DoF arm environment, with the target denoted by the red dot, and the corresponding image observation. Note that we use sliding windows of past observations when learning both tasks. (b) Top: Illustration of the architecture we use for learning Lego block stacking. Bottom: Example trajectory from our learned policy stacking the yellow Lego block on top of the blue block.
125
+
126
+ # 6 EXPERIMENTS
127
+
128
+ We aim to answer the following questions through our experiments: (1) How does SOLAR compare to state-of-the-art model-free and model-based RL algorithms? (2) How do local and global model methods compare when operating in our learned representations? (3) How much benefit do we derive from our particular representation learning method? To answer (1), we compare SOLAR to trust region policy optimization (TRPO) (Schulman et al., 2015) and proximal policy optimization (PPO) (Schulman et al., 2017), two state-of-the-art model-free methods, and LQR with fitted linear models (LQR-FLM) (Levine & Abbeel, 2014), a state-of-the-art model-based method. To answer (2), we test an ablation of our method where we learn a neural network dynamics model with which we perform model-predictive control (MPC) in the latent space. We refer to this as the “global model ablation”. To answer (3), we replace our LDS SVAE model with a variational auto-encoder (VAE) (Kingma & Welling, 2014; Rezende et al., 2014) and with the robust locally-linear controllable embedding (RCE) model (Banijamali et al., 2017), an improved version of the E2C model (Watter et al., 2015). We refer to these as the “VAE ablation” and “E2C-like ablation”, respectively. We additionally compare to a pixel space model similar to Finn & Levine (2017) that utilizes no representation learning and instead learns both a dynamics and cost model on images in order to run MPC in pixel space. Videos of the learned policies are available on the project website.2
129
+
130
+ # 6.1 EXPERIMENTAL TASKS
131
+
132
+ We set up simulated image-based robotic domains for a 2-dimensional navigation task, a nonholonomic car, and a 2-DoF arm, as shown in Figure 3a. We also learn a block stacking task directly from camera images on a real Sawyer robotic arm, as shown in Figure 3b. Details regarding experimental setup and training hyperparameters are provided in Appendix D.
133
+
134
+ ![](images/205af87a310b6b59e8360822d6d7bb88440a9c67dcec261c082060231afdd956.jpg)
135
+ Figure 4: (a) Our method, the VAE ablation, and the global model ablation consistently solve 2D navigation from images, whereas LQR-FLM and the E2C-like ablation are unable to make progress. The final performance of PPO is plotted as the dashed line, though PPO requires 1000 times more samples than our method to reach this performance. (b) On the car from images, both our method and the global model ablation are able to reach the goal, however, we encode prior information into the global model ablation by biasing the control to select positive actions. The VAE ablation is less consistent across random seeds, and the E2C-like ablation once again is unsuccessful at the task. PPO requires over 25 times more episodes to learn a successful policy. (c) For reacher from images, we perform worse than PPO but need about 40 times fewer episodes to learn, whereas the ablations performs noticeably worse. Here we plot reward, so higher is better.
136
+
137
+ 2D navigation. We consider a 2-dimensional navigation task similar to Watter et al. (2015); Banijamali et al. (2017) except we move the goal every episode rather than fixing it to the bottom right. Observations consist of two 32-by-32 images indicating the positions of the agent and goal.
138
+
139
+ Nonholonomic car. The nonholonomic car starts in the bottom right of the 2-dimensional space and controls its acceleration and steering velocity in order to reach the target in the top left. We use a sliding window of four 64-by-64 images as the observation to capture velocity information.
140
+
141
+ Reacher. We experiment with the reacher environment from OpenAI Gym (Brockman et al., 2016), where a 2-DoF arm has to reach a target denoted by a red dot, which we specify to be in the bottom left. For observations, we directly use 64-by-64-by-3 images of the rendered environment, which provides a top-down view of the reacher and target, and we use a sliding window of four images.
142
+
143
+ Sawyer Lego block stacking. To demonstrate a challenging task in the real world, we use our method to learn Lego block stacking with a real 7-DoF Sawyer robotic arm, as depicted in Figure 3b. The observations used are raw 84-by-84-by-3 images from a camera pointed at the robot, and the controller only receives images as the observation, without joint angles or other information.
144
+
145
+ # 6.2 SIMULATION RESULTS
146
+
147
+ Figure 4 details our results on the simulated image-based experimental domains, where each method is tested on three random seeds and the mean and standard deviation of the performance is reported. For the 2D navigation and car tasks from images, we plot the average final distance to the goal as a function of the number of episodes, so lower is better.3 On the reacher task, we plot the reward function as defined by Gym since this is the standard metric used to evaluate performance on this task, and as shown by the videos on our project website, achieving high Gym reward correlates strongly with solving the task in terms of distance to the goal.
148
+
149
+ On 2D navigation from images, our method, the VAE ablation, and the global model ablation are all able to learn very quickly, converging to high-performing policies within 200 episodes. LQR-FLM struggles to learn the task, likely because the images are too complex for local linear model fitting, and makes no progress at all. In fact, LQR-FLM fails to learn on all of the simulated tasks, and we note that this precludes the guided policy search (GPS) method from solving these tasks (Levine et al., 2016), as GPS uses LQR-FLM as a subroutine. For the sake of clarity in the plots, we omit the
150
+
151
+ LQR-FLM results, which are qualitatively similar to the E2C-like ablation results. PPO eventually learns a successful policy, as indicated by the dashed line depicting this method’s final performance, but this requires roughly three orders of magnitude more samples than our method. We present log-scale plots that illustrate the full learning progress of model-free methods in Appendix E.
152
+
153
+ Despite using code directly from the authors of RCE, we were unable to get the E2C-like ablation to learn a good model for this task, and thus the learned policy does not improve over the initial policy. In fact, we were unable to learn successful policies for any of the simulated tasks, though in Appendix E, we demonstrate that this ablation can learn a more successful policy on the 2D navigation domain used by Watter et al. (2015); Banijamali et al. (2017), where the target is fixed to the bottom right. This highlights the difficulty of the tasks we consider.
154
+
155
+ On the image-based car, our method is able to learn a good policy with about 1500 episodes of experience. The global model ablation is competitive with our method, however, we obtained this result by biasing the mean of the MPC random action selection to be positive, effectively encoding prior information that the car should move forward. We also noticed that, even with more data, the variance of the MPC performance remained higher than the policy learned by our method. These observations indicate that forward prediction using the learned global models may be inaccurate, leading to inconsistent control performance. In contrast, our method does not heavily rely on an accurate model and can achieve consistently good behavior on this task. The VAE ablation is able to solve this task for some random seeds, however this method’s performance is less consistent compared to our method. PPO eventually learns a successful policy for this task that performs better than our method, however it uses over 25 times more data than our method.
156
+
157
+ Finally, on the image-based reacher task, our method achieves worse final policy performance than PPO, though we do so with about 40 times fewer episodes, i.e., we use under 700 episodes whereas PPO uses about 30000. This gain in data efficiency compared to model-free methods is typical of model-based methods, however, SOLAR is able to handle this domain directly from raw image observations, which is challenging for other model-based methods. The VAE ablation also makes progress toward the goal, however, the performance is noticeably worse compared to our method. The global model ablation makes very little improvement over its initial behavior, which is better than the other methods as it learns both a dynamics and cost model from the pretraining data and uses these models right away for planning. This performance drop compared to the previous tasks indicates the difficulty in forward prediction for this domain, coupled with the failure of short-horizon control for this task as greedily minimizing distance to the goal often simply leads to collapsing the arm. As it is also less intuitive to encode prior information into this task compared to biasing the actions in the car domain to drive forward, we could not get this ablation to succeed on this task.
158
+
159
+ # 6.3 REAL ROBOT RESULTS
160
+
161
+ Figure 5 details performance on the Lego block stacking tasks in terms of the average final distance in centimeters to the goal, where we test on three random seeds and report the mean and standard deviation of the performance. We define the goal position of the end effector such that reaching the goal leads to successful stacking of the block. Not only is our method able to solve this task directly from raw, high-dimensional camera images within 200 episodes, corresponding to about half an hour of interaction time, our method is also successful at handling the complex, contact-rich dynamics of block stacking. As seen in the video on our project website, our method learns a policy that can react to slightly different contacts, due to the bottom block shifting between episodes, and is ultimately successful in stacking the block in most episodes.4
162
+
163
+ We compare to the VAE and global model ablations, as these proved to be the most successful and data efficient baselines in simulation. These ablations are competitive with our method for this real world task, though our method still achieves a better final policy that is able to more consistently stack the block. The pixel space model is significantly worse than the other methods that learn a latent representation, and given prior work on pixel space global models (Finn & Levine, 2017), we suspect that this method would need more data in order to learn this task.
164
+
165
+ ![](images/1c85e9802e1f9d613d6def55df0837f8da791042e38df07dfdd9f8a7bea6f2d5.jpg)
166
+ Figure 5: Performance on the real-world Sawyer block stacking task. Our method learns to successfully stack the block in about half an hour of interaction time. The VAE and global model ablations are also competitive on this task, while the pixel space model performs worse.
167
+
168
+ # 7 DISCUSSION AND FUTURE WORK
169
+
170
+ We presented SOLAR, a model-based RL algorithm that is capable of learning policies in a dataefficient manner directly from raw high-dimensional observations. The key insights in SOLAR involve learning latent representations where simple models are more accurate and utilizing PGM structure to infer dynamics from data conditioned on entire real-world trajectories. Our experimental results demonstrate that SOLAR is competitive in sample efficiency, while exhibiting superior final policy performance, compared to other model-based methods. Furthermore, SOLAR is significantly more data-efficient compared to state-of-the-art model-free RL methods.
171
+
172
+ There are several interesting directions for future work. First, the ability to learn representations lends itself naturally to multi-task and transfer settings, where new tasks could potentially be learned much more quickly by starting from a latent embedding that has been learned from previous tasks. We can also in principle share dynamics models, where the PGM we learn from solving previous tasks can be used as a global prior when inferring local dynamics fits for a new task. Second, our model is designed for and tested on continuous action domains as we focus on robotic applications. Extending our model to discrete actions would necessitate some type of continuous relaxation or learned action representation, and we believe that this is another interesting direction for future work.
173
+
174
+ # REFERENCES
175
+
176
+ C. An, C. Atkeson, and J. Hollerbach. Model-Based Control of a Robot Manipulator. MIT Press, 1988.
177
+ C. Atkeson and S. Schaal. Robot learning from demonstration. In ICML, 1997.
178
+ E. Banijamali, R. Shu, M. Ghavamzadeh, H. Bui, and A. Ghodsi. Robust locally-linear controllable embedding. arXiv preprint arXiv:1710.05373, 2017.
179
+ S. Bansal, R. Calandra, T. Xiao, S. Levine, and C. Tomlin. Goal-driven dynamics learning via Bayesian optimization. In CDC, 2017.
180
+ S. Boyd and L. Vandenberghe. Convex Optimization. Cambridge University Press, 2004.
181
+ G. Brockman, V. Cheung, L. Pettersson, J. Schneider, J. Schulman, J. Tang, and W. Zaremba. OpenAI gym. arXiv preprint arXiv:1606.01540, 2016.
182
+ E. Camacho and C. Bordons. Model Predictive Control in the Process Industry. Springer-Verlag New York, Inc., 1997.
183
+ Y. Chebotar, K. Hausman, M. Zhang, G. Sukhatme, S. Schaal, and S. Levine. Combining model-based and model-free updates for trajectory-centric reinforcement learning. In ICML, 2017.
184
+ M. Deisenroth, D. Fox, and C. Rasmussen. Gaussian processes for data-efficient learning in robotics and control. PAMI, 2014.
185
+ C. Finn and S. Levine. Deep visual foresight for planning robot motion. In ICRA, 2017.
186
+ C. Finn, X. Tan, Y. Duan, T. Darrell, S. Levine, and P. Abbeel. Deep spatial autoencoders for visuomotor learning. In ICRA, 2016.
187
+ Y. Gao, E. Archer, L. Paninski, and J. Cunningham. Linear dynamical neural population models through nonlinear embeddings. In NIPS, 2016.
188
+ S. Gu, T. Lillicrap, I. Sutskever, and S. Levine. Continuous deep Q-learning with model-based acceleration. In ICML, 2016.
189
+ N. Heess, G. Wayne, D. Silver, T. Lillicrap, Y. Tassa, and T. Erez. Learning continuous control policies by stochastic value gradients. In NIPS, 2015.
190
+ I. Higgins, A. Pal, A. Rusu, L. Matthey, C. Burgess, A. Pritzel, M. Botvinick, C. Blundell, and A. Lerchner. DARLA: Improving zero-shot transfer in reinforcement learning. In ICML, 2017.
191
+ D. Jacobson and D. Mayne. Differential Dynamic Programming. American Elsevier, 1970.
192
+ M. Johnson, D. Duvenaud, A. Wiltschko, S. Datta, and R. Adams. Composing graphical models with neural networks for structured representations and fast inference. In NIPS, 2016.
193
+ D. Kingma and J. Ba. Adam: A method for stochastic optimization. In ICLR, 2015.
194
+ D. Kingma and M. Welling. Auto-encoding variational Bayes. In ICLR, 2014.
195
+ J. Kolter and A. Ng. Policy search via the signed derivative. In RSS, 2005.
196
+ S. Lange and M. Riedmiller. Deep auto-encoder neural networks in reinforcement learning. In IJCNN, 2010.
197
+ T. Lesort, N. Díaz-Rodríguez, J. Goudou, and D. Filliat. State representation learning for control: An overview. arXiv preprint arXiv:1802.04181, 2018.
198
+ S. Levine and P. Abbeel. Learning neural network policies with guided policy search under unknown dynamics. In NIPS, 2014.
199
+ S. Levine and V. Koltun. Guided policy search. In ICML, 2013.
200
+ S. Levine, C. Finn, T. Darrell, and P. Abbeel. End-to-end training of deep visuomotor policies. JMLR, 2016.
201
+ N. Mishra, I. Mordatch, and P. Abbeel. Prediction and control with temporal segment models. In ICML, 2017.
202
+ T. Moldovan, S. Levine, M. Jordan, and P. Abbeel. Optimism-driven exploration for nonlinear systems. In ICRA, 2015.
203
+ W. Montgomery, A. Ajay, C. Finn, P. Abbeel, and S. Levine. Reset-free guided policy search: Efficient deep reinforcement learning with stohcastic initial states. In ICRA, 2017.
204
+ A. Nagabandi, G. Kahn, R. Fearing, and S. Levine. Neural network dynamics for model-based deep reinforcement learning with model-free fine-tuning. In ICRA, 2018.
205
+ A. Nouri and M. Littman. Dimension reduction and its application to model-based exploration in continuous spaces. Machine Learning, 2010.
206
+ J. Oh, S. Singh, and H. Lee. Value prediction network. In NIPS, 2017.
207
+ J. Peters, K. Mülling, and Y. Altün. Relative entropy policy search. In AAAI, 2010.
208
+ D. Rezende, S. Mohamed, and D. Wierstra. Stochastic backpropagation and approximate inference in deep generative models. In ICML, 2014.
209
+ J. Schulman, S. Levine, P. Moritz, M. Jordan, and P. Abbeel. Trust region policy optimization. In ICML, 2015.
210
+ J. Schulman, F. Wolski, P. Dhariwal, A. Radford, and O. Klimov. Proximal policy optimization algorithms. arXiv preprint arXiv:1707.06347, 2017.
211
+ S. Singh, T. Jaakkola, and M. Jordan. Reinforcement learning with soft state aggregation. In NIPS, 1994.
212
+ A. Smith. Applications of the self-organizing map to reinforcement learning. Neural Networks, 2002.
213
+ R. Sutton. Integrated architectures for learning, planning, and reacting based on approximating dynamic programming. In ICML, 1990.
214
+ Y. Tassa, T. Erez, and E. Todorov. Synthesis and stabilization of complex behaviors. In IROS, 2012.
215
+ E. Todorov and W. Li. A generalized iterative LQG method for locally-optimal feedback control of constrained nonlinear stochastic systems. In ACC, 2005.
216
+ V.Feinberg, A. Wan, I. Stoica, M. Jordan, J. Gonzalez, and S. Levine. Model-based value estimation for efficient model-free reinforcement learning. arXiv preprint arXiv:1803.00101, 2018.
217
+ M. Watter, J. Springenberg, J. Boedecker, and M. Riedmiller. Embed to control: A locally linear latent dynamics model for control from raw images. In NIPS, 2015.
218
+ J. Winn and C. Bishop. Variational message passing. JMLR, 2005.
219
+
220
+ # A POLICY LEARNING DETAILS
221
+
222
+ Given a TVLG dynamics model and quadratic cost approximation, we can approximate our Q and value functions to second order with the following dynamic programming updates, which proceed from the last time step $t = T$ to the first step $t = 1$ :
223
+
224
+ $$
225
+ \begin{array} { r l } & { Q _ { \mathbf { s } , t } = c _ { \mathbf { s } , t } + \mathbf { F } _ { \mathbf { s } , t } ^ { \top } V _ { \mathbf { s } , t + 1 } , \ Q _ { \mathbf { s } \mathbf { s } , t } = c _ { \mathbf { s } \mathbf { s } , t } + \mathbf { F } _ { \mathbf { s } , t } ^ { \top } V _ { \mathbf { s } \mathbf { s } , t + 1 } \mathbf { F } _ { \mathbf { s } , t } , } \\ & { Q _ { \mathbf { a } , t } = c _ { \mathbf { a } , t } + \mathbf { F } _ { \mathbf { a } , t } ^ { \top } V _ { \mathbf { s } , t + 1 } , \ Q _ { \mathbf { a } \mathbf { a } , t } = c _ { \mathbf { a } \mathbf { a } , t } + \mathbf { F } _ { \mathbf { a } , t } ^ { \top } V _ { \mathbf { s } \mathbf { s } , t + 1 } \mathbf { F } _ { \mathbf { a } , t } , } \\ & { \qquad Q _ { \mathbf { s } \mathbf { a } , t } = c _ { \mathbf { s } \mathbf { a } , t } + \mathbf { F } _ { \mathbf { s } , t } ^ { \top } V _ { \mathbf { s } \mathbf { s } , t + 1 } \mathbf { F } _ { \mathbf { a } , t } , } \\ & { \qquad V _ { \mathbf { s } , t } = Q _ { \mathbf { s } , t } - Q _ { \mathbf { s } \mathbf { a } , t } Q _ { \mathbf { a } \mathbf { a } , t } ^ { - 1 } Q _ { \mathbf { a } , t } , } \\ & { \qquad V _ { \mathbf { s } \mathbf { s } , t } = Q _ { \mathbf { s } \mathbf { s } , t } - Q _ { \mathbf { s } \mathbf { a } , t } Q _ { \mathbf { a } \mathbf { a } , t } ^ { - 1 } Q _ { \mathbf { a } \mathbf { s } , t } . } \end{array}
226
+ $$
227
+
228
+ It can be shown (e.g., by Tassa et al. (2012)) that the action $\mathbf { a } _ { t }$ that minimizes the second-order approximation of the Q-function at every time step $t$ is given by
229
+
230
+ $$
231
+ { \bf a } _ { t } = - Q _ { { \bf a } { \bf a } , t } ^ { - 1 } Q _ { { \bf a } { \bf s } , t } { \bf s } _ { t } - Q _ { { \bf a } { \bf a } , t } ^ { - 1 } Q _ { { \bf a } , t } .
232
+ $$
233
+
234
+ This action is a linear function of the state $\mathbf { s } _ { t }$ , thus we can construct an optimal linear policy by setting ${ \bf K } _ { t } = - Q _ { { \bf a a } , t } ^ { - 1 } Q _ { { \bf a s } , t }$ and ${ \bf k } _ { t } = - Q _ { { \bf a a } , t } ^ { - 1 } Q _ { { \bf a } , t }$ . We can also show that the maximum-entropy policy that minimizes the approximate Q-function is given by
235
+
236
+ $$
237
+ \pi ( \mathbf { a } _ { t } | \mathbf { s } _ { t } ) = \mathcal { N } ( \mathbf { K } _ { t } \mathbf { s } _ { t } + \mathbf { k } _ { t } , Q _ { \mathbf { a a } , t } ) .
238
+ $$
239
+
240
+ Furthermore, as in Levine & Abbeel (2014), we can impose a constraint on the total KL-divergence between the old and new trajectory distributions induced by the policies through an augmented cost function $\begin{array} { r } { \bar { c } ( { \mathbf s } _ { t } , \mathbf { a } _ { t } ) = \frac { 1 } { \lambda } c ( { \mathbf s } _ { t } , \mathbf { a } _ { t } ) - \log \pi ^ { ( i - 1 ) } ( { \mathbf a } _ { t } | { \mathbf s } _ { t } ) } \end{array}$ , where solving for $\lambda$ via dual gradient descent can yield an exact solution to a KL-constrained LQR problem.
241
+
242
+ # B DYNAMICS INFERENCE
243
+
244
+ Here we provide the closed form parameter computations for the posteriors of our dynamics given observed trajectories, as described in Section 4.1 of the main paper. Given variational factors from our model of the form
245
+
246
+ $$
247
+ \begin{array} { r } { q ( \mathbf { F } _ { t } , \Sigma _ { t } ) = \mathcal { M N T } \mathcal { W } ( \Psi _ { t } ^ { \prime } , \nu _ { t } ^ { \prime } , M _ { 0 t } ^ { \prime } , V _ { t } ^ { \prime } ) \mathrm { ~ f o r ~ } t \in [ 0 , . . . , T - 1 ] , } \end{array}
248
+ $$
249
+
250
+ n observed trajectories . These posteriors are als $\tau$ to obtain new variational posteriors MNIW, and the parameters of these pos$\{ q ( \mathbf { F } _ { t } , \Sigma _ { t } | \{ \tau \} _ { i = 0 } ^ { N } ) \} _ { t = 0 } ^ { T - 1 }$ teriors can be computed in closed form as
251
+
252
+ $$
253
+ \begin{array} { r l } & { \Psi _ { t } = \Psi _ { t } ^ { \prime } + M _ { 0 t } ^ { \prime } V _ { t } ^ { \prime - 1 } M _ { 0 t } ^ { \prime \top } + \displaystyle \sum _ { i = 1 } ^ { N } \mathbf { z } _ { t + 1 } ^ { ( i ) } \mathbf { z } _ { t + 1 } ^ { ( i ) \top } - M _ { 0 t } V _ { t } ^ { - 1 } M _ { 0 t } ^ { \top } , \qquad \kappa _ { t } = \kappa _ { t } + N , } \\ & { M _ { 0 t } = \left( M _ { 0 t } ^ { \prime } V _ { t } ^ { \prime - 1 } + \displaystyle \sum _ { i = 1 } ^ { N } \mathbf { z } _ { t + 1 } ^ { ( i ) } \left[ \mathbf { z } _ { t } ^ { ( i ) } \right] ^ { \top } \right) V _ { t } , \qquad V _ { t } = \left( V _ { t } ^ { \prime - 1 } + \displaystyle \sum _ { i = 1 } ^ { N } \left[ \mathbf { z } _ { t } ^ { ( i ) } \right] \left[ \mathbf { z } _ { t } ^ { ( i ) } \right] ^ { \top } \right) ^ { - 1 } . } \end{array}
254
+ $$
255
+
256
+ Then, a maximum a posteriori estimate gives us the TVLG dynamics parameters as described in the main paper.
257
+
258
+ # C POLICY LINEARIZATION
259
+
260
+ The policy update described in Section 4.2 of the main paper requires us to compute the KL-divergence between the trajectory distributions before and after the policy update, denoted as $\bar { p } ( \tau )$ and $\dot { p } ( \tau )$ , respectively. We compute with the previous policy, a $\begin{array} { r } { p ( \tau ) = \hat { \rho } ( \mathbf { z } _ { 0 } ) \prod _ { t = 0 } ^ { T - 1 } \pi _ { \boldsymbol { \theta } } ( \mathbf { a } _ { t } | \mathbf { z } _ { t } ) \hat { p } ( \mathbf { z } _ { t + 1 } | \mathbf { z } _ { t } , \mathbf { a } _ { t } ) } \end{array}$ , and analogously for y because the policies $\bar { p } ( \tau )$ dynamics model are TVLG, thus the induced trajectory distributions are also Gaussian. However, this operates under the assumption that $\mathbf { z }$ is fixed, which does not hold since the model update changes the latent representation. Since our overall policy is a combination of the model embedding, given by $e _ { \phi } ( \mathbf { s } )$ , and the TVLG policy $\pi _ { \boldsymbol { \theta } } ( \mathbf { a } _ { t } | \mathbf { z } _ { t } )$ , training $e _ { \phi } ( \mathbf { s } )$ will change the behavior of the policy even if $\pi _ { \boldsymbol { \theta } } ( \mathbf { a } _ { t } | \mathbf { z } _ { t } )$ stays fixed. In some cases, this may lead to a policy with worse performance, and constraining against this policy for the policy update may lead to poor results. In fact, what we want to do is to account for the model update by changing $\pi _ { \boldsymbol { \theta } } ( \mathbf { a } _ { t } | \mathbf { z } _ { t } )$ accordingly, so that the overall policy does not change in its distribution. Thus, using $\left( \mathbf { s } _ { t } , \mathbf { a } _ { t } \right)$ pairs from the previous data collection phase, we embed $\mathbf { z } _ { t } = \mu ( e _ { \phi } ( \mathbf { s } _ { t } ) )$ with our updated model and use linear regression to find the TVLG policy $\tilde { \pi } _ { \boldsymbol { \theta } } ( \mathbf { a } _ { t } | \mathbf { z } _ { t } )$ that best explains the data collected from the policy This is line 6 of the SOLAR algorithm presented in the main paper, and after this, we can perform the policy update constrained against the trajectory distribution induced by $\tilde { \pi } _ { \boldsymbol { \theta } } ( \mathbf { a } _ { t } | \mathbf { z } _ { t } )$ .
261
+
262
+ ![](images/44d897a8277a0076f1e5c3373058af16b1a1e69f206ae263fc99599086bb7d86.jpg)
263
+ Figure 6: (a) An illustration of the 2D navigation task, with the agent depicted as the black dot and the target depicted as the blue dot. (b) We use as observations two 32-by-32 images stacked on top of each other, where the first observation indicates the position of the agent the second observation indicates the position of the target. (c) Visualization of the 4-dimensional latent space for an example random trajectory of the 2D-navigation task. Note that the range of values in the latent space is very narrow, and the bottom two dimensions seemingly capture information about the target which does not move.
264
+
265
+ # D EXPERIMENT SETUP
266
+
267
+ Image-based 2D navigation. Our recognition model architecture for the 2D navigation domain consists of two convolution layers with 2-by-2 filters and 32 channels each, with no pooling layers and ReLU non-linearities, followed by another convolution with 2-by-2 filters and 2 channels. The output of the last convolution layer is fed into a spatial softmax layer (Finn et al., 2016), which then outputs a Gaussian distribution with a fixed diagonal covariance of $1 0 ^ { - 4 }$ for the latent distribution. Our observation model consists of two fully-connected (FC) hidden layers with 256 ReLU activations, and the last layer outputs a categorical distribution over pixels. We initially collect 200 episodes which we use to train our model, and for every subsequent iteration we collect 20 episodes to fine tune our model. The cost function we use is the sum of the $L ^ { 2 }$ -norm squared of the distance to the target and the commanded action, with weights of 1 and 0.001, respectively.
268
+
269
+ Image-based nonholonomic car. The image-based car domain consists of 64-by-64 image observations. We include a window of the 3 previous 64-by-64 images in our observation to preserve velocity information. Our recognition model is a convolutional neural network that operates on each image in the sliding window independently. Its architecture is four convolutional layers with 4-by-4 filters with 4 channels each, and the first two convolution layers are followed by a ReLU non-linearity. The output of the last convolutional layer is fed into three FC ReLU layers of width 2048, 512, and 128, respectively. Our final layer outputs a Gaussian distribution with dimension 8. This leads to a final latent dimension of 32. Our observation model consists of four FC ReLU layers of width 256, 512, 1024, and 2048, respectively, followed by a Bernoulli distribution layer that models the image. Like the recognition model, the observation model only operates on each section of the latent representation corresponding to the image window independently. For this domain, we collect 100 episodes initially to train our model, and we collect 100 episodes per iteration after this. The cost function we use is the sum of the $L ^ { 2 }$ -norm squared of the distance from the center of the car to the target and the commanded action, with weights of 1 and 0.001, respectively.
270
+
271
+ Reacher. The reacher domain consists of 64-by-64-by-3 image observations. Similar to the car, we include a window of the 3 previous 64-by-64-by-3 images in our observation. Our recognition model is a convolutional neural network that again operates on each image in the sliding window independently. Its architecture is three convolutional layers with 2-by-2 filters with 64, 32 and 16 channels respectively. Each layer has a ReLU non-linearity followed by a 2-by-2 max-pooling. The output of the last convolutional layer is fed into an FC ReLU layer of width 200, followed by another FC ReLU layer of width 200. Our final layer outputs a Gaussian distribution with dimension 10, leading to a final latent dimension of 40. Our observation model consists of three FC ReLU layers of width 256, followed by a Bernoulli distribution layer and separately models each image in the sliding window. We collect 200 episodes initially to train our model, and we collect 100 episodes per iteration after this. The cost function we use is the sum of the $L ^ { 2 }$ -norm of the distance from the fingertip to the target and the $L ^ { 2 }$ -norm squared of the commanded action.
272
+
273
+ Sawyer Lego block stacking. The image-based Sawyer block-stacking domain consists of 84-by-84-by-3 image observations. The policy outputs velocities on the end effector in order to control the robot. Our recognition model is a convolutional neural network with the following architecture: a 5-by-5 filter convolutional layer with 16 channels followed by two convolutional layers using 5-by-5 filters with 32 channels each. The first two convolutional layers are followed by ReLU activations and the last by a FC ReLU layer of width 256 leading to a 16 dimensional Gaussian distribution layer. Our observation model consists of a FC ReLU layer of width 128 feeding into three deconvolutional layers, the first with 5-by-5 filters with 32 channels and the last two of 6-by-6 filters with 16 and 3 channels respectively. These are followed by a final Bernoulli distribution layer. For this domain, we collect 50 episodes initially to train our model, 20 episodes per iteration for the first 5 iterations, then 10 episodes per iteration for the remainder. The cost function is the sum of the $L ^ { 1 }$ -norm of a weighted displacement vector between the end-effector and the target in 3D-space (weighted 1, 2, 1 for $x , y , z )$ , the $L ^ { 2 }$ -norm in the same space, and the angle of rotation required to reach a valid wrist orientation, with weights of 1, .1, and .15, respectively.
274
+
275
+ # E ADDITIONAL EXPERIMENTS
276
+
277
+ # E.1 E2C-LIKE ABLATION ON SIMPLIFIED 2D NAVIGATION
278
+
279
+ As mentioned in Section 6, our E2C-like ablation was unable to make progress for the 2D navigation task, though we were able to get more successful results by fixing the position of the goal to the bottom right as is done in the image-based 2D navigation task considered in E2C (Watter et al., 2015) and RCE (Banijamali et al., 2017). Figure 7 details this experiment, which we ran for three random seeds and report the mean and standard deviation of the average final distance to the goal as a function of the number of training episodes. It is clear that the policy is improving, and two of the seeds are able to make substantial progress, though the final seed is less successful and significantly worsens the average performance of the method. This indicates that the latent representation learned through RCE is less suitable for local model fitting, as accurate local model fitting is not explicitly encouraged by their representation learning objective.
280
+
281
+ ![](images/f1ab3c9f4b1d17e8e2bf6573ea5c01e754c2609148f330a2fe45097242f4e023.jpg)
282
+ Figure 7: On 2D navigation with the goal fixed to the bottom right, our E2C-like ablation is able to make progress toward the goal.
283
+
284
+ ![](images/b9dc714596bd5c1cba748d67e3d9241e68198b128d12c698a02bfc4f7f4f1072.jpg)
285
+ Figure 9: (a) Comparison of our method to PPO on the 2D navigation task presented in the paper. Our method uses roughly three orders of magnitude fewer samples to solve the task compared to PPO. (b) On the car from images task, our method achieves slightly worse performance than PPO though with about 25 times fewer samples. (c) Comparison of our method to TRPO and PPO for the reacher task. Our method achieves slightly worse final performance but uses about 40 times fewer samples than these methods.
286
+
287
+ # E.2 MODEL-BASED COMPARISONS ON STATE-BASED NONHOLONOMIC CAR
288
+
289
+ To provide a point of comparison to modelbased RL methods, we consider the car domain where the underlying state is observed. The states for the car domain include the position of the center of mass, orientation, forward and angular velocity of the car, and the position of the target, making for a 9-dimensional system. Since this observation is already quite simple, we use a single linear layer for our recognition and observation models that output Gaussian distributions, and we use the same dimensionality for our latent representation as the state.
290
+
291
+ ![](images/0aedca8cd6354ec9922ecfa9f40de2b63b05982b8d1bf8bc11942c6fe6ae57c7.jpg)
292
+ Figure 8: On the car from states, our method is competitive with LQR-FLM, demonstrating that we maintain the sample efficiency of model-based methods for simple tasks.
293
+
294
+ We plot the performances of our method, LQRFLM (Levine & Abbeel, 2014), and Nagabandi et al. (2018), which we refer to as modelpredictive control with neural networks (MPCNN), again based on the average final distance to the target, in Figure 8. In this setting, our
295
+
296
+ method is competitive with LQR-FLM, learning a policy with similar performance in 200 episodes. MPC-NN performs the best for this task, learning a policy that consistently reaches the target in just 20 episodes, though it is given the true cost function whereas our method and LQR-FLM are not. For this simple setup where modeling bias is not an issue, we expect model-based methods to perform very well and learn efficiently. However, when we make the problem more challenging by using image observations, model-based methods will fail quickly: LQR-FLM is unable to fit complex pixel transitions using local linear models, as shown through the 2D navigation experiment, and MPC-NN has never been used with images, as forward video prediction and defining a cost function on images are both very difficult. We extend MPC-NN to the image-based task, and we term this the “global model ablation” of our method – as shown in the paper, this approach is able to make progress toward the goal, though our method is still significantly better at solving this difficult task.
297
+
298
+ # E.3 FULL PERFORMANCE OF TRPO ON 2D NAVIGATION AND REACHER
299
+
300
+ In Figure 9 we include the plots for the simulated tasks comparing SOLAR, PPO, and TRPO. Note that the $\mathbf { X }$ -axis is on a log scale, i.e., though our method is sometimes worse in final policy performance to PPO and TRPO, we do so with one to three orders of magnitude fewer samples. This demonstrates our method’s sample efficiency compared to model-free methods, while being able to solve complex image-based domains that are difficult for model-based methods.
parse/train/Bke96sC5tm/Bke96sC5tm_content_list.json ADDED
@@ -0,0 +1,1424 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "type": "text",
4
+ "text": "SOLAR: DEEP STRUCTURED REPRESENTATIONS FOR MODEL-BASED REINFORCEMENT LEARNING ",
5
+ "text_level": 1,
6
+ "bbox": [
7
+ 176,
8
+ 98,
9
+ 821,
10
+ 146
11
+ ],
12
+ "page_idx": 0
13
+ },
14
+ {
15
+ "type": "text",
16
+ "text": "Anonymous authors Paper under double-blind review ",
17
+ "bbox": [
18
+ 183,
19
+ 170,
20
+ 398,
21
+ 198
22
+ ],
23
+ "page_idx": 0
24
+ },
25
+ {
26
+ "type": "text",
27
+ "text": "ABSTRACT ",
28
+ "text_level": 1,
29
+ "bbox": [
30
+ 454,
31
+ 234,
32
+ 544,
33
+ 251
34
+ ],
35
+ "page_idx": 0
36
+ },
37
+ {
38
+ "type": "text",
39
+ "text": "Model-based reinforcement learning (RL) methods can be broadly categorized as global model methods, which depend on learning models that provide sensible predictions in a wide range of states, or local model methods, which iteratively refit simple models that are used for policy improvement. While predicting future states that will result from the current actions is difficult, local model methods only attempt to understand system dynamics in the neighborhood of the current policy, making it possible to produce local improvements without ever learning to predict accurately far into the future. The main idea in this paper is that we can learn representations that make it easy to retrospectively infer simple dynamics given the data from the current policy, thus enabling local models to be used for policy learning in complex systems. We evaluate our approach against other model-based and model-free RL methods on a suite of robotics tasks, including a manipulation task on a real Sawyer robotic arm directly from camera images. ",
40
+ "bbox": [
41
+ 233,
42
+ 267,
43
+ 766,
44
+ 446
45
+ ],
46
+ "page_idx": 0
47
+ },
48
+ {
49
+ "type": "text",
50
+ "text": "1 INTRODUCTION ",
51
+ "text_level": 1,
52
+ "bbox": [
53
+ 176,
54
+ 474,
55
+ 336,
56
+ 491
57
+ ],
58
+ "page_idx": 0
59
+ },
60
+ {
61
+ "type": "text",
62
+ "text": "Model-based reinforcement learning (RL) methods use learned models in a variety of ways, such as planning (Levine & Abbeel, 2014; Deisenroth et al., 2014) and generating synthetic experience (Sutton, 1990). We can categorize model-based algorithms as either global model methods, where models are used for planning and trained to give accurate predictions for a wide range of states, or local model methods, where simple models provide gradient directions that are used for policy improvement. On simple, low-dimensional tasks, model-based approaches have demonstrated remarkable data efficiency, learning policies for systems like cart-pole swing-up with under 30 seconds of experience (Deisenroth et al., 2014; Moldovan et al., 2015). However, for more complex systems, one of the main difficulties in applying model-based methods is model bias: local models will often underfit complex systems, but may still be preferred over global models which tend to overfit in the low-data regime and may be difficult to incorporate into control methods (Deisenroth et al., 2014). ",
63
+ "bbox": [
64
+ 174,
65
+ 507,
66
+ 825,
67
+ 659
68
+ ],
69
+ "page_idx": 0
70
+ },
71
+ {
72
+ "type": "text",
73
+ "text": "Most global model methods use the model to make forward predictions and then backpropagate through those predictions. However, this places a heavy burden on the dynamics model, and forward prediction often suffers from significant drift over longer trajectories. In contrast, local models are typically only used to provide gradient directions for local policy improvement (Levine & Abbeel, 2014), and thus a common choice for local model methods is to use linear models, which can themselves be interpreted as gradients. As illustrated in Figure 1, in our work, we present a method that automatically encourages learning representations where linear models better fit the data. From this, we devise an efficient local model method based on the linear-quadratic regulator (LQR) (Camacho & Bordons, 1997; Todorov & Li, 2005; Levine & Abbeel, 2014) that utilizes linear models for gradient directions for policy improvement. Our motivation is similar to that of Watter et al. (2015); Finn et al. (2016); however, as discussed in section 5, our representation learning method specifically allows us to construct a local model method that performs inference in the latent space in order to improve the policy, rather than focusing on forward prediction and planning. ",
74
+ "bbox": [
75
+ 174,
76
+ 666,
77
+ 825,
78
+ 847
79
+ ],
80
+ "page_idx": 0
81
+ },
82
+ {
83
+ "type": "text",
84
+ "text": "Our main contribution is a representation learning and model-based RL procedure, which we term stochastic optimal control with latent representations (SOLAR), which jointly optimizes a latent representation and model such that inference produces local linear models that provide good gradient directions for policy improvement. We demonstrate empirically in section 6 that SOLAR is able to learn policies directly from raw, high-dimensional observations in several robotic environments including a simulated nonholonomic car, a simulated two degree-of-freedom (DoF) arm, and a real 7-DoF Sawyer arm, all of which are learned directly from image pixels. We compare to existing state-of-the-art RL methods and show that SOLAR, while significantly more data efficient than model-free methods, exhibits superior performance compared to other model-based methods. ",
85
+ "bbox": [
86
+ 174,
87
+ 854,
88
+ 823,
89
+ 924
90
+ ],
91
+ "page_idx": 0
92
+ },
93
+ {
94
+ "type": "image",
95
+ "img_path": "images/26292365d207757a499029b76f3ed212d27801b63f66de57c24c92b2c62f867d.jpg",
96
+ "image_caption": [
97
+ "Figure 1: (a) A pictoral depiction of a trajectory for a one-dimensional system. (b) Global models may be used for prediction or planning forward through time, as depicted in red, but this can suffer from trajectory drift for complex systems. (c) Local linear models are fit to trajectories and do not suffer from drift, but may fit the system poorly for complicated interactions such as contacts, as illustrated by the poor model fit circled in gray. (d) Our method finds an embedding of observed trajectories into a latent space where local linear models produce a better fit. "
98
+ ],
99
+ "image_footnote": [],
100
+ "bbox": [
101
+ 176,
102
+ 103,
103
+ 823,
104
+ 193
105
+ ],
106
+ "page_idx": 1
107
+ },
108
+ {
109
+ "type": "text",
110
+ "text": "",
111
+ "bbox": [
112
+ 174,
113
+ 309,
114
+ 825,
115
+ 366
116
+ ],
117
+ "page_idx": 1
118
+ },
119
+ {
120
+ "type": "text",
121
+ "text": "2 PRELIMINARIES ",
122
+ "text_level": 1,
123
+ "bbox": [
124
+ 176,
125
+ 386,
126
+ 339,
127
+ 401
128
+ ],
129
+ "page_idx": 1
130
+ },
131
+ {
132
+ "type": "text",
133
+ "text": "We first formalize our problem setting as a Markov decision process (MDP) $M = ( S , { \\mathcal { A } } , p , C , \\rho , T )$ , where the state space $s$ , action space $\\mathcal { A }$ , and horizon $T$ are known, but the dynamics function $p ( \\mathbf { s } _ { t + 1 } | \\mathbf { s } _ { t } , \\mathbf { a } _ { t } )$ , cost function ${ \\cal C } ( \\mathbf { s } _ { t } , \\mathbf { a } _ { t } )$ , and initial state distribution $\\rho ( \\mathbf { s } _ { 0 } )$ are unknown. The goal of reinforcement learning is to optimize a policy $\\pi ( \\mathbf { a } _ { t } | \\mathbf { s } _ { t } )$ to minimize the expected sum of costs $\\begin{array} { r } { \\eta [ \\pi ] = \\mathbb { E } _ { \\pi , p , \\rho } \\left[ \\sum _ { t = 0 } ^ { T } C ( \\mathbf { s } _ { t } , \\mathbf { a } _ { t } ) \\right] } \\end{array}$ under the distribution induced by the initial state distribution, dynamics function, and policy. Model-based methods decompose this problem into policy and model optimization subproblems, and we discuss each subproblem as it relates to our approach. ",
134
+ "bbox": [
135
+ 173,
136
+ 416,
137
+ 826,
138
+ 525
139
+ ],
140
+ "page_idx": 1
141
+ },
142
+ {
143
+ "type": "text",
144
+ "text": "2.1 MODEL-BASED POLICY SEARCH ",
145
+ "text_level": 1,
146
+ "bbox": [
147
+ 176,
148
+ 540,
149
+ 436,
150
+ 554
151
+ ],
152
+ "page_idx": 1
153
+ },
154
+ {
155
+ "type": "text",
156
+ "text": "Policy search methods directly optimize parameterized policies with respect to $\\eta ( \\theta ) \\triangleq \\eta [ \\pi _ { \\theta } ]$ where the parameters $\\theta$ may be, for example, weights in a neural network or matrices for a linear policy. Model-based policy search methods typically build models $\\left( { \\hat { \\rho } } , { \\hat { p } } , { \\hat { C } } \\right)$ of the unknown quantities and compute the gradient of $\\begin{array} { r } { \\hat { \\eta } ( \\theta ) \\triangleq \\mathbb { E } _ { \\pi _ { \\theta } , \\hat { p } , \\hat { \\rho } } \\left[ \\sum _ { t = 0 } ^ { T } \\hat { C } ( \\mathbf { s } _ { t } , \\mathbf { a } _ { t } ) \\right] } \\end{array}$ with this model. One particularly tractable model is the linear-quadratic system (LQS), which models the initial state distribution as Gaussian, the dynamics as time-varying linear-Gaussian (TVLG), and the cost as quadratic, i.e., ",
157
+ "bbox": [
158
+ 173,
159
+ 565,
160
+ 826,
161
+ 670
162
+ ],
163
+ "page_idx": 1
164
+ },
165
+ {
166
+ "type": "equation",
167
+ "img_path": "images/6add39b53bacf8807472b5a384456809244fd675660d72ca6fe27fc855d3f6d4.jpg",
168
+ "text": "$$\n\\hat { p } ( { \\mathbf s } _ { t + 1 } | { \\mathbf s } _ { t } , { \\mathbf a } _ { t } ) = \\mathcal { N } \\left( { \\mathbf s } _ { t + 1 } \\left| \\begin{array} { l } { { \\mathbf F } _ { t } \\left[ \\mathbf { s } _ { t } \\right] , \\Sigma _ { t } \\right) , \\quad \\hat { C } ( { \\mathbf s } _ { t } , { \\mathbf a } _ { t } ) = \\frac { 1 } { 2 } \\left[ \\mathbf { \\bar { a } } _ { t } \\right] ^ { \\top } { \\mathbf C } \\left[ \\mathbf { \\bar { a } } _ { t } \\right] + { \\mathbf c } ^ { \\top } \\left[ \\mathbf { \\bar { a } } _ { t } \\right] . } \\end{array} \\right.\n$$",
169
+ "text_format": "latex",
170
+ "bbox": [
171
+ 192,
172
+ 671,
173
+ 784,
174
+ 710
175
+ ],
176
+ "page_idx": 1
177
+ },
178
+ {
179
+ "type": "text",
180
+ "text": "Any deterministic policy operating in an environment with smooth dynamics can be locally modeled with a time-varying LQS (Boyd & Vandenberghe, 2004), while low-entropy stochastic policies are modeled approximately. This makes the time-varying LQS a reasonable local model for many dynamical systems. Furthermore, the optimal policy at any time step given the model is a linear function of the state and the optimal maximum-entropy policy is linear-Gaussian (Tassa et al., 2012; Levine & Koltun, 2013). As shown in Jacobson & Mayne (1970); Todorov & Li (2005), these optimal policies can be computed in closed form using dynamic programming by computing the first and second derivatives of the Q (cost-to-go) and value functions: ",
181
+ "bbox": [
182
+ 173,
183
+ 712,
184
+ 825,
185
+ 824
186
+ ],
187
+ "page_idx": 1
188
+ },
189
+ {
190
+ "type": "equation",
191
+ "img_path": "images/a1dbb6f3010ddc7d9acb7c6c5d82276cf96dee3c2c9e54c6b381594d38dfe536.jpg",
192
+ "text": "$$\n\\begin{array} { r l r } & { Q _ { \\tilde { { \\mathbf { s } } } , t } = { \\mathbf { c } } _ { \\tilde { { \\mathbf { s } } } , t } + { \\mathbf { F } } _ { \\tilde { { \\mathbf { s } } } , t } ^ { \\top } V _ { { \\mathbf { s } } , t + 1 } , } & { Q _ { \\tilde { { \\mathbf { s } } } { \\mathbf { s } } , t } = { \\mathbf { C } } _ { \\tilde { { \\mathbf { s } } } { \\mathbf { s } } , t } + { \\mathbf { F } } _ { \\tilde { { \\mathbf { s } } } { \\mathbf { s } } , t } ^ { \\top } V _ { { \\mathbf { s } } { \\mathbf { s } } , t + 1 } { \\mathbf { F } } _ { \\tilde { { \\mathbf { s } } } { \\mathbf { s } } , t } , } \\\\ & { V _ { { \\mathbf { s } } , t } = Q _ { { \\mathbf { s } } , t } - Q _ { { \\mathbf { s } } { \\mathbf { a } } , t } Q _ { { \\mathbf { a } } { \\mathbf { a } } , t } ^ { - 1 } Q _ { { \\mathbf { a } } , t } , } & { V _ { { \\mathbf { s } } { \\mathbf { s } } , t } = Q _ { { \\mathbf { s } } { \\mathbf { s } } , t } - Q _ { { \\mathbf { s } } { \\mathbf { a } } , t } Q _ { { \\mathbf { a } } { \\mathbf { a } } , t } ^ { - 1 } Q _ { { \\mathbf { a } } { \\mathbf { s } } , t } . } \\end{array}\n$$",
193
+ "text_format": "latex",
194
+ "bbox": [
195
+ 269,
196
+ 827,
197
+ 725,
198
+ 871
199
+ ],
200
+ "page_idx": 1
201
+ },
202
+ {
203
+ "type": "text",
204
+ "text": "Here, similar to Tassa et al. (2012), we use subscripts to denote derivatives, and we use $\\tilde { \\mathbf { s } }$ to abbreviate h s a i . Once these values are computed, the optimal maximum-entropy policy is TVLG, i.e., ",
205
+ "bbox": [
206
+ 173,
207
+ 872,
208
+ 823,
209
+ 901
210
+ ],
211
+ "page_idx": 1
212
+ },
213
+ {
214
+ "type": "equation",
215
+ "img_path": "images/ae54f29fd0bc9f33b206626a3be049fb6ce2c10a823504b3f3a758e1954a1624.jpg",
216
+ "text": "$$\n\\begin{array} { r } { \\pi _ { \\theta } ( \\mathbf { a } _ { t } | \\mathbf { s } _ { t } ) = \\mathcal { N } \\left( \\mathbf { K } _ { t } \\mathbf { s } _ { t } + \\mathbf { k } _ { t } , \\mathbf { S } _ { t } \\right) \\mathrm { , ~ w h e r e } \\mathbf { K } _ { t } = - Q _ { \\mathbf { a a } , t } ^ { - 1 } Q _ { \\mathbf { a s } , t } \\mathrm { , ~ } \\mathbf { k } _ { t } = - Q _ { \\mathbf { a a } , t } ^ { - 1 } Q _ { \\mathbf { a } , t } \\mathrm { , ~ } \\mathbf { S } _ { t } = - Q _ { \\mathbf { a a } , t } ^ { - 1 } \\mathrm { . } } \\end{array}\n$$",
217
+ "text_format": "latex",
218
+ "bbox": [
219
+ 181,
220
+ 906,
221
+ 820,
222
+ 926
223
+ ],
224
+ "page_idx": 1
225
+ },
226
+ {
227
+ "type": "text",
228
+ "text": "We refer the reader to Appendix A and Levine & Abbeel (2014) for further details. Prior work assumes access to a compact, low-dimensional state representation (Deisenroth et al., 2014; Levine & Abbeel, 2014; Nagabandi et al., 2018), and as we show in section 6, this precludes these local model methods from operating on complex observations such as images. In subsection 2.2 and section 3, we describe a probabilistic latent variable model and variational inference procedure that, conditioned on a full trajectory of observations, produces local models that can be used for policy improvement, enabling us to utilize this local model method in image-based domains. ",
229
+ "bbox": [
230
+ 173,
231
+ 103,
232
+ 825,
233
+ 202
234
+ ],
235
+ "page_idx": 2
236
+ },
237
+ {
238
+ "type": "text",
239
+ "text": "2.2 LEARNING LATENT DYNAMICS MODELS ",
240
+ "text_level": 1,
241
+ "bbox": [
242
+ 176,
243
+ 218,
244
+ 490,
245
+ 232
246
+ ],
247
+ "page_idx": 2
248
+ },
249
+ {
250
+ "type": "text",
251
+ "text": "The local model-based method described above requires us to learn both a quadratic cost function as well as a linear dynamical system (LDS). We utilize the Bayesian LDS model, which is given by ",
252
+ "bbox": [
253
+ 173,
254
+ 243,
255
+ 825,
256
+ 272
257
+ ],
258
+ "page_idx": 2
259
+ },
260
+ {
261
+ "type": "equation",
262
+ "img_path": "images/4cdd4d6f9b9b8f752cfde17fe77e8fbdb64e545696fa3f155e1cd3a36ad10c35.jpg",
263
+ "text": "$$\n\\begin{array} { r l } & { \\mu _ { \\hat { \\rho } } , \\Sigma _ { \\hat { \\rho } } \\sim \\mathcal { N } T \\mathcal { W } ( \\Psi , \\nu , \\mu _ { 0 } , \\kappa ) , \\quad \\mathbf { F } _ { t } , \\Sigma _ { t } \\sim \\mathcal { M N T W } ( \\Psi , \\nu , M _ { 0 } , V ) \\mathrm { ~ f o r ~ } t \\in [ 0 , \\dots , T - 1 ] , } \\\\ & { \\mathbf { s } _ { 0 } \\mid \\mu _ { \\hat { \\rho } } , \\Sigma _ { \\hat { \\rho } } \\sim \\mathcal { N } ( \\mu _ { \\hat { \\rho } } , \\Sigma _ { \\hat { \\rho } } ) , \\qquad \\mathbf { s } _ { t + 1 } \\mid \\mathbf { s } _ { t } , \\mathbf { a } _ { t } \\sim \\mathcal { N } \\left( \\mathbf { F } _ { t } \\left[ \\mathbf { a } _ { t } \\right] , \\Sigma _ { t } \\right) \\mathrm { ~ f o r ~ } t \\in [ 0 , \\dots , T - 1 ] , } \\end{array}\n$$",
264
+ "text_format": "latex",
265
+ "bbox": [
266
+ 199,
267
+ 277,
268
+ 794,
269
+ 333
270
+ ],
271
+ "page_idx": 2
272
+ },
273
+ {
274
+ "type": "text",
275
+ "text": "Where $\\mathcal { N T } \\mathcal { W }$ is the normal-inverse-Wishart distribution and $\\mathcal { M N T } \\mathcal { W }$ is the matrix normal-inverseWishart (MNIW) distribution. This probabilistic graphical model (PGM) allows for tractable approximate inference, i.e., Bayesian linear regression, and also captures uncertainty in the form of a posterior distribution over the initial state and dynamics. However, for dynamical systems with complex non-linear dynamics, this model still suffers from significant bias. ",
276
+ "bbox": [
277
+ 173,
278
+ 335,
279
+ 826,
280
+ 406
281
+ ],
282
+ "page_idx": 2
283
+ },
284
+ {
285
+ "type": "text",
286
+ "text": "Even when the system is poorly modeled by an LDS in the state space, we might be able to find a latent embedding and model the system as approximately linear in that latent space, which may allow us to find a better-performing policy that operates in the learned latent space. This shifts our problem setting to that of a partially observed MDP, as we do not observe the latent state. In particular, our modeling assumption is that we receive an observation as generated from an underlying unobserved state, and as discussed in section 3, we address this by training a recognition model to infer the latent state. In our experiments in section 6, we provide several observations to our recognition model in order to infer information that cannot be observed from a single observation, such as velocity. We can jointly train an embedding and model using the SVAE framework (Johnson et al., 2016), which allows us to combine arbitrary embedding functions, such as neural networks, with PGMs. The model we build off of is a version of the LDS SVAE presented in Johnson et al. (2016) and is given by ",
287
+ "bbox": [
288
+ 173,
289
+ 411,
290
+ 825,
291
+ 565
292
+ ],
293
+ "page_idx": 2
294
+ },
295
+ {
296
+ "type": "equation",
297
+ "img_path": "images/103d840fe4a4df733719693b155c8bc3ef68cf67f2fde641f4adf1a01ada601d.jpg",
298
+ "text": "$$\n\\begin{array} { r l } & { \\mu _ { \\hat { \\rho } } , \\Sigma _ { \\hat { \\rho } } \\sim \\mathcal { N } \\mathcal { D } \\mathcal { W } ( \\Psi , \\nu , \\mu _ { 0 } , \\kappa ) , \\quad \\mathbf { F } _ { t } , \\Sigma _ { t } \\sim \\mathcal { M } \\mathcal { N } \\mathcal { D } ( \\Psi , \\nu , M _ { 0 } , V ) \\mathrm { ~ f o r ~ } t \\in [ 0 , \\dots , T - 1 ] , } \\\\ & { \\mathbf { z } _ { 0 } \\mid \\mu _ { \\hat { \\rho } } , \\Sigma _ { \\hat { \\rho } } \\sim \\mathcal { N } ( \\mu _ { \\hat { \\rho } } , \\Sigma _ { \\hat { \\rho } } ) , \\qquad \\mathbf { z } _ { t + 1 } \\mid \\mathbf { z } _ { t } , \\mathbf { a } _ { t } \\sim \\mathcal { N } \\left( \\mathbf { F } _ { t } \\left[ \\mathbf { z } _ { t } \\right] , \\Sigma _ { t } \\right) \\mathrm { ~ f o r ~ } t \\in [ 0 , \\dots , T - 1 ] , } \\\\ & { \\mathbf { s } _ { t } \\mid \\mathbf { z } _ { t } \\sim f _ { \\gamma } \\left( \\mathbf { z } _ { t } \\right) \\mathrm { ~ f o r ~ } t \\in [ 0 , \\dots , T ] , } \\end{array}\n$$",
299
+ "text_format": "latex",
300
+ "bbox": [
301
+ 187,
302
+ 569,
303
+ 785,
304
+ 645
305
+ ],
306
+ "page_idx": 2
307
+ },
308
+ {
309
+ "type": "text",
310
+ "text": "Where $f _ { \\gamma } ( \\mathbf { z } )$ is an observation model, parameterized by neural network weights $\\gamma$ , that outputs a distribution over s, e.g., Gaussian or Bernoulli, depending on the nature of the data. This is very similar to the Bayesian LDS, except we are learning the PGM in the latent space. ",
311
+ "bbox": [
312
+ 176,
313
+ 648,
314
+ 823,
315
+ 690
316
+ ],
317
+ "page_idx": 2
318
+ },
319
+ {
320
+ "type": "text",
321
+ "text": "Though this model does not admit the same efficient approximate inference algorithms when $f _ { \\gamma }$ is nonlinear, an efficient variational inference algorithm has previously been derived by Johnson et al. (2016). We describe the relevant aspects of this algorithm in the next section. ",
322
+ "bbox": [
323
+ 174,
324
+ 696,
325
+ 825,
326
+ 739
327
+ ],
328
+ "page_idx": 2
329
+ },
330
+ {
331
+ "type": "text",
332
+ "text": "3 LEARNING AND MODELING THE LATENT SPACE ",
333
+ "text_level": 1,
334
+ "bbox": [
335
+ 174,
336
+ 758,
337
+ 606,
338
+ 776
339
+ ],
340
+ "page_idx": 2
341
+ },
342
+ {
343
+ "type": "text",
344
+ "text": "In this section, we describe how we extend the LDS SVAE for model-based RL, such that we learn an action-conditioned LQS model in the latent space. This then enables a local model method that can leverage the LQS to infer the dynamics of sampled trajectories. In this way, our model-based RL algorithm circumvents the need for forward prediction, in contrast to model-based RL methods that use model-based rollouts or planning (Nagabandi et al., 2018; Deisenroth et al., 2014). In section 4, we describe how these components are combined into our final method, SOLAR. ",
345
+ "bbox": [
346
+ 174,
347
+ 790,
348
+ 825,
349
+ 875
350
+ ],
351
+ "page_idx": 2
352
+ },
353
+ {
354
+ "type": "text",
355
+ "text": "Our goal with this model is to learn a latent representation of the state and a prior over the dynamics in this latent representation that is suitable for fitting local dynamics models via posterior inference. Specifically, we are interested in the setting where we have access to trajectories of the form $\\left[ \\mathbf { s } _ { 0 } , \\mathbf { a } _ { 0 } , c _ { 0 } , \\ldots , \\mathbf { s } _ { T - 1 } , \\mathbf { a } _ { T - 1 } , c _ { T - 1 } , \\mathbf { s } _ { T } \\right]$ , sampled from the system using our current policy and set of previous policies. Our aim is to infer local linear dynamics in the neighborhood of these trajectories, and we learn a model that makes this fitting process more accurate for the observed trajectories, thus enabling our local model method to find good directions for policy improvement. ",
356
+ "bbox": [
357
+ 176,
358
+ 882,
359
+ 825,
360
+ 924
361
+ ],
362
+ "page_idx": 2
363
+ },
364
+ {
365
+ "type": "image",
366
+ "img_path": "images/5a042b5a0c0145f83947a13d9eead8c41c5137ce2fe290837a42157101abe5d9.jpg",
367
+ "image_caption": [
368
+ "Figure 2: Left: The LQS graphical model. Distributions for each node are as specified in Equation 2-Equation 4, with additional deterministic nodes for observed costs. Right: The variational family we use for our model learning algorithm, with distributions given in Equation 5. "
369
+ ],
370
+ "image_footnote": [],
371
+ "bbox": [
372
+ 207,
373
+ 99,
374
+ 790,
375
+ 252
376
+ ],
377
+ "page_idx": 3
378
+ },
379
+ {
380
+ "type": "text",
381
+ "text": "",
382
+ "bbox": [
383
+ 174,
384
+ 333,
385
+ 826,
386
+ 390
387
+ ],
388
+ "page_idx": 3
389
+ },
390
+ {
391
+ "type": "text",
392
+ "text": "We build upon the variational inference algorithm presented in Johnson et al. (2016), such that we are maximizing, with respect to both the PGM and neural network parameters, the variational lower bound (ELBO) of our observed data. This algorithm requires variational factors of the form ",
393
+ "bbox": [
394
+ 174,
395
+ 396,
396
+ 825,
397
+ 439
398
+ ],
399
+ "page_idx": 3
400
+ },
401
+ {
402
+ "type": "equation",
403
+ "img_path": "images/27fbda58eaea76131fe959a0cbd73a80c254e1fbf568d09a6afbd0469cdc7316.jpg",
404
+ "text": "$$\n\\begin{array} { r } { q ( \\mathbf { z } _ { t } \\mid \\mathbf { s } _ { t } ) = \\mathcal { N } \\left( e _ { \\phi } \\left( \\mathbf { s } _ { t } \\right) \\right) , q ( \\mathbf { F } _ { t } , \\Sigma _ { t } ) = \\mathcal { M } \\mathcal { N } \\mathcal { Z } \\mathcal { W } ( \\Psi _ { t } ^ { \\prime } , \\nu _ { t } ^ { \\prime } , M _ { 0 t } ^ { \\prime } , V _ { t } ^ { \\prime } ) \\mathrm { ~ f o r ~ } t \\in \\left[ 0 , \\dots , T - 1 \\right] . } \\end{array}\n$$",
405
+ "text_format": "latex",
406
+ "bbox": [
407
+ 186,
408
+ 445,
409
+ 790,
410
+ 463
411
+ ],
412
+ "page_idx": 3
413
+ },
414
+ {
415
+ "type": "text",
416
+ "text": "$e _ { \\phi } ( \\mathbf { s } )$ is a recognition model, parameterized by neural network weights $\\phi$ , that outputs the mean and diagonal covariance of a Gaussian distribution over $\\mathbf { z }$ . This recognition model is identical to that used in Kingma & Welling (2014); Rezende et al. (2014); Gao et al. (2016), however, as with prior work in the LDS SVAE, we also have variational factors of the form $q ( \\mathbf { F } _ { t } , \\Sigma _ { t } )$ , which represent our posterior belief about the system dynamics after observing the collected data. We also model this distribution as MNIW but with updated parameters compared to the prior from Equation 2. Given this, we can formulate the variational lower bound (ELBO) which is given by ",
417
+ "bbox": [
418
+ 173,
419
+ 469,
420
+ 825,
421
+ 568
422
+ ],
423
+ "page_idx": 3
424
+ },
425
+ {
426
+ "type": "equation",
427
+ "img_path": "images/731c6b99796a088b49b54f0f4d41f776fad09aea2ce94d5b719a02a249ec8a70.jpg",
428
+ "text": "$$\n\\begin{array} { l } { { \\displaystyle { \\mathcal { L } } = { \\mathbb { E } } _ { q } [ \\log \\frac { p ( \\{ \\mathbf { F } , \\Sigma \\} _ { t = 0 } ^ { T - 1 } , \\{ \\mathbf { s } _ { t } \\} _ { t = 0 } ^ { T } , \\{ \\mathbf { a } _ { t } \\} _ { t = 0 } ^ { T - 1 } , \\mathbf { z } _ { t } \\} _ { t = 0 } ^ { T } ) } { q ( \\{ \\mathbf { F } _ { t } , \\Sigma _ { t } \\} _ { t = 0 } ^ { T - 1 } , \\{ \\mathbf { z } _ { t } \\} _ { t = 0 } ^ { T } | \\mathbf { s } _ { t } ) | \\{ \\mathbf { s } _ { t } \\} _ { t = 0 } ^ { T } ] } } \\ ~ } \\\\ { { \\displaystyle ~ = { \\mathbb { E } } _ { q } [ \\log ( \\prod _ { t = 0 } ^ { T } p _ { \\gamma } ( \\mathbf { s } _ { t } | \\mathbf { z } _ { t } ) ) ] } \\ ~ } \\\\ { { \\displaystyle ~ - \\sum _ { t = 0 } ^ { T - 1 } \\mathrm { K L } ( q ( \\mathbf { F } _ { t } , \\Sigma _ { t } ) \\| p ( \\mathbf { F } , \\Sigma ) ) - \\sum _ { t = 1 } ^ { T } \\mathbb { E } _ { q } [ \\mathrm { K L } ( q _ { \\phi } ( \\mathbf { z } _ { t } | \\mathbf { s } _ { t } ) \\| p ( \\mathbf { z } _ { t } | \\mathbf { z } _ { t - 1 } , \\mathbf { a } _ { t - 1 } , \\mathbf { F } _ { t } , \\Sigma _ { t } ) ] . } \\ } \\end{array}\n$$",
429
+ "text_format": "latex",
430
+ "bbox": [
431
+ 212,
432
+ 592,
433
+ 784,
434
+ 724
435
+ ],
436
+ "page_idx": 3
437
+ },
438
+ {
439
+ "type": "text",
440
+ "text": "Prior work has shown that, for conjugate exponential models such as the Bayesian LDS, the variational model parameters can be updated using natural gradients, which can be computed in closed form using the variational message passing framework (Winn & Bishop, 2005). Specifically, letting $\\lambda$ denote the MNIW parameters of the variational factors on $\\{ \\mathbf { F } _ { t } , \\Sigma _ { t } \\} _ { t }$ , the natural gradient update is ",
441
+ "bbox": [
442
+ 173,
443
+ 736,
444
+ 825,
445
+ 792
446
+ ],
447
+ "page_idx": 3
448
+ },
449
+ {
450
+ "type": "equation",
451
+ "img_path": "images/f778606cd189eec2a6578b50c06f53f97ca945262fc6b91950ff19fd398caff2.jpg",
452
+ "text": "$$\n\\tilde { \\nabla } _ { \\lambda } \\mathcal { L } = \\lambda ^ { 0 } + B \\mathbb { E } _ { q } \\left[ t _ { \\mathbf { F } , \\Sigma } ( \\mathbf { F } , \\Sigma ) \\right] - \\lambda ,\n$$",
453
+ "text_format": "latex",
454
+ "bbox": [
455
+ 374,
456
+ 799,
457
+ 622,
458
+ 819
459
+ ],
460
+ "page_idx": 3
461
+ },
462
+ {
463
+ "type": "text",
464
+ "text": "Where $B$ is the number of minibatches in the dataset, $\\lambda ^ { 0 }$ is the parameter for the prior distribution $p ( \\mathbf { F } , \\Sigma )$ , and $t _ { \\mathbf { F } , \\Sigma } ( \\mathbf { F } , \\Sigma )$ is the sufficient statistic function for $p ( \\mathbf { F } , \\Sigma )$ . Thus, we can use this equation to compute the natural gradient update for $\\lambda$ , whereas for $\\gamma$ and $\\phi$ we use stochastic gradient updates on Monte Carlo estimates of the ELBO, specifically using the Adam optimization scheme (Kingma & Ba, 2015). This leads to two simultaneous optimizations for the PGM parameters and the neural network parameters, and their learning rates are treated as separate hyperparameters. We have found $1 0 ^ { - 3 }$ and $1 0 ^ { - 4 }$ to be generally suitable for the natural gradient and Adam updates, respectively. ",
465
+ "bbox": [
466
+ 173,
467
+ 825,
468
+ 825,
469
+ 924
470
+ ],
471
+ "page_idx": 3
472
+ },
473
+ {
474
+ "type": "text",
475
+ "text": "Algorithm 1 SOLAR ",
476
+ "text_level": 1,
477
+ "bbox": [
478
+ 174,
479
+ 103,
480
+ 318,
481
+ 117
482
+ ],
483
+ "page_idx": 4
484
+ },
485
+ {
486
+ "type": "table",
487
+ "img_path": "images/7ae94002d96d00d20c39ce7eff4d7c2796d0020d0c4562cc55dcb1067a03a3d8.jpg",
488
+ "table_caption": [],
489
+ "table_footnote": [],
490
+ "table_body": "<table><tr><td></td><td>1:Hyperparameters: # iterations K,# trajectories N,model training buffer size B</td></tr><tr><td></td><td>(0)</td></tr><tr><td>3:</td><td>for iteration k ∈{1,...,K} do</td></tr><tr><td>4:</td><td>(i) N )=1</td></tr><tr><td>5:</td><td>M(b)← MODELUPDATE(M(k-1), {D(i)}k=k-B) (section 3)</td></tr><tr><td>6:</td><td></td></tr><tr><td>7:</td><td>{F(), (k) )}t ← INFERDYNAMICs(D(k),M(k)) (subsection 4.1) 1 t ,</td></tr><tr><td>8: T0 9:</td><td>←POLICYUPDATE(( (k) (k-1) ,{F(), , end for</td></tr></table>",
491
+ "bbox": [
492
+ 179,
493
+ 119,
494
+ 722,
495
+ 270
496
+ ],
497
+ "page_idx": 4
498
+ },
499
+ {
500
+ "type": "text",
501
+ "text": "Figure 2 details the graphical model presented in Equation 2-Equation 4 along with the variational family described above. Since we are interested in control and RL, there is the added notion of observed costs from the environment, and there are many ways we could model these additional observations. A natural choice is to model costs as a quadratic function of the latent state and action, such that we arrive at the LQS presented in Equation 1 except in the learned latent space. Specifically, given trajectories of the form $\\left[ \\mathbf { s } _ { 0 } , \\mathbf { a } _ { 0 } , c _ { 0 } , \\ldots , \\mathbf { s } _ { T - 1 } , \\mathbf { a } _ { T - 1 } , c _ { T - 1 } , \\mathbf { s } _ { T } \\right]$ , we first embed the observations $\\left\\{ \\mathbf { s } _ { t } \\right\\}$ using the mean of our recognition model $\\mu ( e _ { \\phi } ( \\mathbf { s } ) )$ to obtain a set of latent states $\\left\\{ { \\bf z } _ { t } \\right\\}$ . We then model our cost samples as $\\begin{array} { r } { c _ { t } = \\frac { 1 } { 2 } \\mathbf { z } _ { t } ^ { \\top } \\mathbf { L } \\mathbf { L } ^ { \\top } \\mathbf { z } _ { t } + \\mathbf { c } ^ { \\top } \\mathbf { z } _ { t } + \\alpha \\| \\mathbf { a } _ { t } \\| _ { 2 } ^ { 2 } + b , } \\end{array}$ , where we assume that the action-dependent part of the cost is known and we learn L, c, and $b$ by minimizing the mean-squared error of the observed costs with stochastic gradient descent. $\\mathbf { L }$ is a lower-triangular matrix with strictly positive diagonal entries, and thus by constructing our cost matrix as $\\mathbf { C } = \\mathbf { L } \\mathbf { L } ^ { \\top }$ we guarantee that the learned cost matrix is positive definite, which improves the conditioning of the policy update. ",
502
+ "bbox": [
503
+ 173,
504
+ 296,
505
+ 825,
506
+ 465
507
+ ],
508
+ "page_idx": 4
509
+ },
510
+ {
511
+ "type": "text",
512
+ "text": "4 POLICY LEARNING IN THE LATENT SPACE ",
513
+ "text_level": 1,
514
+ "bbox": [
515
+ 174,
516
+ 484,
517
+ 558,
518
+ 501
519
+ ],
520
+ "page_idx": 4
521
+ },
522
+ {
523
+ "type": "text",
524
+ "text": "While we could use a variety of model-based policy learning methods in the learned latent space, the ability to infer local time-varying linear dynamics lends itself naturally to the particular analytic local solution to the policy described in subsection 2.1. This approach yields a policy that is TVLG in the latent space, which in general corresponds to a class of nonlinear policies in the original space formed by the composition of the nonlinear neural network embedding and the TVLG policy. ",
525
+ "bbox": [
526
+ 174,
527
+ 516,
528
+ 825,
529
+ 587
530
+ ],
531
+ "page_idx": 4
532
+ },
533
+ {
534
+ "type": "text",
535
+ "text": "As discussed in the following sections, we can use the PGM in the previous section to formulate local model fitting as probabilistic inference, in order to obtain a dynamics estimate that we can then use to improve the policy. Note that this use of the model is quite different from how dynamics models are typically used in standard model-based RL algorithms: instead of using the model to predict into the future, we only use the model to infer local linear dynamics conditioned on real-world trajectory samples. While local models are not burdened by forward prediction compared to global forward models, the simplicity of linear local models prevents accurate modeling of complex systems, and our method mitigates this through a latent representation that is optimized for local linear model fitting. ",
536
+ "bbox": [
537
+ 174,
538
+ 593,
539
+ 825,
540
+ 705
541
+ ],
542
+ "page_idx": 4
543
+ },
544
+ {
545
+ "type": "text",
546
+ "text": "Our overall algorithm, SOLAR, is presented in algorithm 1. At every iteration, we collect $N$ rollouts from the real world (line 4). Then, we update our model using data from the last $B$ iterations (line 5), we linearize our policy given the updated model (line 6, see Appendix C for details), we perform inference within our model to get the dynamics estimates (line 7), and we update our policy using the rollouts from our current iteration and our updated model (line 8). The following subsections detail the modules of our method that are involved in policy learning and improvement. ",
547
+ "bbox": [
548
+ 174,
549
+ 712,
550
+ 825,
551
+ 795
552
+ ],
553
+ "page_idx": 4
554
+ },
555
+ {
556
+ "type": "text",
557
+ "text": "4.1 DYNAMICS INFERENCE UNDER THE MODEL ",
558
+ "text_level": 1,
559
+ "bbox": [
560
+ 174,
561
+ 813,
562
+ 513,
563
+ 827
564
+ ],
565
+ "page_idx": 4
566
+ },
567
+ {
568
+ "type": "text",
569
+ "text": "To obtain a TVLG dynamics model, we could directly use linear regression to fit $\\mathbf { F } _ { t }$ and $\\Sigma _ { t }$ to the observed latent trajectories $\\tau = [ \\mathbf { z } _ { 0 } , \\mathbf { a } _ { 0 } , \\ldots , \\mathbf { z } _ { T - 1 } , \\mathbf { a } _ { T - 1 } , \\mathbf { z } _ { T } ]$ . However, this may be poorly conditioned in the low-data regime. Instead, we can perform inference within our model to obtain dynamics estimates for policy improvement. As described in section 3, our model provides us with variational approximations to the posterior over dynamics models, i.e., $\\{ q ( \\mathbf { F } _ { t } , \\Sigma _ { t } ) \\} _ { t = 0 } ^ { T - 1 }$ , which are MNIW. We can use these as a prior and condition on the data to obtain new variational posteriors $\\{ q ( \\mathbf { F } _ { t } , \\Sigma _ { t } | \\{ \\tau \\} _ { i = 0 } ^ { N } ) \\} _ { t = 0 } ^ { T - 1 }$ , which are also MNIW. Writing the parameters of these posteriors – for which the closed form solutions are given in Appendix $\\mathrm { \\bf B - }$ as $\\{ \\Psi _ { t } , M _ { 0 t } , V _ { t } , \\nu _ { t } \\} _ { t }$ , we compute a maximum a posteriori estimate of the dynamics parameters at time step $t$ as: $\\begin{array} { r } { \\mathbf { F } _ { t } = M _ { 0 t } , \\Sigma _ { t } = \\frac { \\Psi _ { t } } { \\nu _ { t } } } \\end{array}$ . This inference procedure corresponds to Bayesian linear regression and can be interpreted as resolving the uncertainty in the global dynamics model conditioned on a real-world rollout. In essence, $\\{ q ( \\mathbf { F } _ { t } , \\Sigma _ { t } ) \\} _ { t = 0 } ^ { T - 1 }$ captures uncertainty over the latent system dynamics by acting as a global model over all observed data, but in order to accurately model the system within the local region around the current policy, we condition on trajectories collected from the policy in order to resolve the uncertainty and obtain dynamics estimates $\\begin{array} { r } { \\{ \\mathbf { F } _ { t } , \\boldsymbol { \\Sigma } _ { t } \\} _ { t = 0 } ^ { T - 1 } } \\end{array}$ that allow us to improve the policy. ",
570
+ "bbox": [
571
+ 174,
572
+ 838,
573
+ 825,
574
+ 924
575
+ ],
576
+ "page_idx": 4
577
+ },
578
+ {
579
+ "type": "text",
580
+ "text": "",
581
+ "bbox": [
582
+ 174,
583
+ 102,
584
+ 826,
585
+ 236
586
+ ],
587
+ "page_idx": 5
588
+ },
589
+ {
590
+ "type": "text",
591
+ "text": "4.2 POLICY UPDATE ",
592
+ "text_level": 1,
593
+ "bbox": [
594
+ 174,
595
+ 252,
596
+ 326,
597
+ 267
598
+ ],
599
+ "page_idx": 5
600
+ },
601
+ {
602
+ "type": "text",
603
+ "text": "As described in subsection 2.1, once we have our TVLG dynamics estimates $\\{ \\mathbf { F } _ { t } , \\Sigma _ { t } \\} _ { t }$ and quadratic cost fit $\\mathbf { C } , \\mathbf { c }$ , we can use dynamic programming on the Q and value functions to compute the optimal policy in closed form. However, doing so is typically undesirable as the resulting policy will overfit to the model and likely will not perform well in the real environment. Since our modeling assumption is not that our model will be globally valid, but rather that our model will be valid close to the data distribution of the previous policy, we utilize a constrained policy update such that our new policy does not drastically change the induced trajectory distribution. Specifically, similar to prior work, we impose a KL-divergence constraint on the policy update such that the shift in the induced trajectory distributions before and after the update, which we denote as $\\bar { p } ( \\tau )$ and $p ( \\tau )$ , respectively, is bounded by a step size $\\epsilon$ (Levine & Abbeel, 2014). This leads to a constrained optimization of the form $\\operatorname* { m a x } _ { \\theta } \\ \\hat { \\eta } ( \\theta )$ s.t. $D _ { \\mathrm { K L } } ( p ( \\tau ) \\lVert \\bar { p } ( \\tau ) ) \\leq \\epsilon$ . As shown in Levine & Abbeel (2014), this constrained optimization can be solved by augmenting the cost function to penalize the deviation from the previous policy $\\pi _ { \\bar { \\theta } }$ , i.e., $\\begin{array} { r } { \\tilde { C } ( \\mathbf { z } _ { t } , \\mathbf { a } _ { t } ) = \\frac { 1 } { \\lambda } C ( \\mathbf { z } _ { t } , \\mathbf { a } _ { t } ) - \\log \\pi _ { \\bar { \\theta } } ( \\mathbf { a } _ { t } | \\mathbf { z } _ { t } ) } \\end{array}$ . Note that this augmented cost function is still quadratic, since the policy is TVLG, and thus we can still compute the optimal policy under this cost function in closed form using the procedure described in subsection 2.1. $\\lambda$ is a dual variable that trades off between optimizing the cost function and staying close in distribution to the previous policy, and the weight of this term can be determined through a dual gradient descent procedure. Combined with the model learning from section 3, we arrive at the SOLAR algorithm. ",
604
+ "bbox": [
605
+ 174,
606
+ 280,
607
+ 825,
608
+ 530
609
+ ],
610
+ "page_idx": 5
611
+ },
612
+ {
613
+ "type": "text",
614
+ "text": "5 RELATED WORK ",
615
+ "text_level": 1,
616
+ "bbox": [
617
+ 176,
618
+ 551,
619
+ 344,
620
+ 568
621
+ ],
622
+ "page_idx": 5
623
+ },
624
+ {
625
+ "type": "text",
626
+ "text": "Model-based RL methods have achieved significant efficiency benefits compared to model-free RL methods (Chebotar et al., 2017; Nagabandi et al., 2018; Deisenroth et al., 2014). Many of these prior methods learn global models of the system that are then used for planning, generating synthetic experience, or policy search (Atkeson & Schaal, 1997; Peters et al., 2010). These methods require an accurate and reliable model and will typically suffer from modeling bias, hence these models are still limited to short horizon prediction in more complex domains (Mishra et al., 2017; Nagabandi et al., 2018; Gu et al., 2016; V.Feinberg et al., 2018). Another class of model-based methods rely only on local system models to compute the gradient for a policy update (An et al., 1988; Kolter & Ng, 2005; Heess et al., 2015; Levine & Abbeel, 2014; Bansal et al., 2017). These methods do not use models for long-term forward prediction, allowing for the use of simple models that enable policy improvement (Montgomery et al., 2017; Levine et al., 2016). As we show in section 6, modeling bias for prior methods can be severely limiting in systems with complex observations such as images, whereas we are able to learn representations that mitigate the effects of modeling bias. ",
627
+ "bbox": [
628
+ 174,
629
+ 583,
630
+ 825,
631
+ 763
632
+ ],
633
+ "page_idx": 5
634
+ },
635
+ {
636
+ "type": "text",
637
+ "text": "Utilizing representation learning within model-based RL has been studied in a number of previous works (Lesort et al., 2018), including using embeddings for state aggregation (Singh et al., 1994), dimensionality reduction (Nouri & Littman, 2010), self-organizing maps (Smith, 2002), value prediction (Oh et al., 2017), and deep auto-encoders (Lange & Riedmiller, 2010; Finn et al., 2016; Watter et al., 2015; Higgins et al., 2017). Within these works, deep spatial auto-encoders (DSAE) (Finn et al., 2016) and embed to control (E2C) (Watter et al., 2015; Banijamali et al., 2017) are the most closely related to our work in that they consider local model methods combined with representation learning. The key difference in our work is that, rather than using a learning objective for reconstruction and forward prediction, we formulate a Bayesian latent variable model such that inference corresponds to fitting local models within the learned representation. As such, our objective enables local model methods by directly encouraging learning representations where fitting local models accurately explains the observed data. We also do not assume a known cost function, goal state, or access to the underlying system state as in DSAE and E2C, thus SOLAR is applicable even when the underlying states and cost function are unknown.1 We find that our approach tends to produce better results on a number of complex image-based tasks, as we discuss in the next section. ",
638
+ "bbox": [
639
+ 174,
640
+ 770,
641
+ 826,
642
+ 924
643
+ ],
644
+ "page_idx": 5
645
+ },
646
+ {
647
+ "type": "image",
648
+ "img_path": "images/25f1d947657a301ce0b4d4892e094a9246939062b82252ef0bc5e4f6ba3ce971.jpg",
649
+ "image_caption": [
650
+ "Figure 3: (a) Top: Visualizing a trajectory in the car navigation environment, with the target denoted by the black dot, and the corresponding image observation. Bottom: An illustration of the 2-DoF arm environment, with the target denoted by the red dot, and the corresponding image observation. Note that we use sliding windows of past observations when learning both tasks. (b) Top: Illustration of the architecture we use for learning Lego block stacking. Bottom: Example trajectory from our learned policy stacking the yellow Lego block on top of the blue block. "
651
+ ],
652
+ "image_footnote": [],
653
+ "bbox": [
654
+ 178,
655
+ 103,
656
+ 774,
657
+ 286
658
+ ],
659
+ "page_idx": 6
660
+ },
661
+ {
662
+ "type": "text",
663
+ "text": "",
664
+ "bbox": [
665
+ 174,
666
+ 416,
667
+ 825,
668
+ 472
669
+ ],
670
+ "page_idx": 6
671
+ },
672
+ {
673
+ "type": "text",
674
+ "text": "6 EXPERIMENTS ",
675
+ "text_level": 1,
676
+ "bbox": [
677
+ 174,
678
+ 498,
679
+ 326,
680
+ 513
681
+ ],
682
+ "page_idx": 6
683
+ },
684
+ {
685
+ "type": "text",
686
+ "text": "We aim to answer the following questions through our experiments: (1) How does SOLAR compare to state-of-the-art model-free and model-based RL algorithms? (2) How do local and global model methods compare when operating in our learned representations? (3) How much benefit do we derive from our particular representation learning method? To answer (1), we compare SOLAR to trust region policy optimization (TRPO) (Schulman et al., 2015) and proximal policy optimization (PPO) (Schulman et al., 2017), two state-of-the-art model-free methods, and LQR with fitted linear models (LQR-FLM) (Levine & Abbeel, 2014), a state-of-the-art model-based method. To answer (2), we test an ablation of our method where we learn a neural network dynamics model with which we perform model-predictive control (MPC) in the latent space. We refer to this as the “global model ablation”. To answer (3), we replace our LDS SVAE model with a variational auto-encoder (VAE) (Kingma & Welling, 2014; Rezende et al., 2014) and with the robust locally-linear controllable embedding (RCE) model (Banijamali et al., 2017), an improved version of the E2C model (Watter et al., 2015). We refer to these as the “VAE ablation” and “E2C-like ablation”, respectively. We additionally compare to a pixel space model similar to Finn & Levine (2017) that utilizes no representation learning and instead learns both a dynamics and cost model on images in order to run MPC in pixel space. Videos of the learned policies are available on the project website.2 ",
687
+ "bbox": [
688
+ 174,
689
+ 534,
690
+ 825,
691
+ 755
692
+ ],
693
+ "page_idx": 6
694
+ },
695
+ {
696
+ "type": "text",
697
+ "text": "6.1 EXPERIMENTAL TASKS ",
698
+ "text_level": 1,
699
+ "bbox": [
700
+ 174,
701
+ 779,
702
+ 375,
703
+ 792
704
+ ],
705
+ "page_idx": 6
706
+ },
707
+ {
708
+ "type": "text",
709
+ "text": "We set up simulated image-based robotic domains for a 2-dimensional navigation task, a nonholonomic car, and a 2-DoF arm, as shown in Figure 3a. We also learn a block stacking task directly from camera images on a real Sawyer robotic arm, as shown in Figure 3b. Details regarding experimental setup and training hyperparameters are provided in Appendix D. ",
710
+ "bbox": [
711
+ 174,
712
+ 806,
713
+ 825,
714
+ 863
715
+ ],
716
+ "page_idx": 6
717
+ },
718
+ {
719
+ "type": "image",
720
+ "img_path": "images/205af87a310b6b59e8360822d6d7bb88440a9c67dcec261c082060231afdd956.jpg",
721
+ "image_caption": [
722
+ "Figure 4: (a) Our method, the VAE ablation, and the global model ablation consistently solve 2D navigation from images, whereas LQR-FLM and the E2C-like ablation are unable to make progress. The final performance of PPO is plotted as the dashed line, though PPO requires 1000 times more samples than our method to reach this performance. (b) On the car from images, both our method and the global model ablation are able to reach the goal, however, we encode prior information into the global model ablation by biasing the control to select positive actions. The VAE ablation is less consistent across random seeds, and the E2C-like ablation once again is unsuccessful at the task. PPO requires over 25 times more episodes to learn a successful policy. (c) For reacher from images, we perform worse than PPO but need about 40 times fewer episodes to learn, whereas the ablations performs noticeably worse. Here we plot reward, so higher is better. "
723
+ ],
724
+ "image_footnote": [],
725
+ "bbox": [
726
+ 184,
727
+ 99,
728
+ 816,
729
+ 250
730
+ ],
731
+ "page_idx": 7
732
+ },
733
+ {
734
+ "type": "text",
735
+ "text": "2D navigation. We consider a 2-dimensional navigation task similar to Watter et al. (2015); Banijamali et al. (2017) except we move the goal every episode rather than fixing it to the bottom right. Observations consist of two 32-by-32 images indicating the positions of the agent and goal. ",
736
+ "bbox": [
737
+ 174,
738
+ 430,
739
+ 825,
740
+ 473
741
+ ],
742
+ "page_idx": 7
743
+ },
744
+ {
745
+ "type": "text",
746
+ "text": "Nonholonomic car. The nonholonomic car starts in the bottom right of the 2-dimensional space and controls its acceleration and steering velocity in order to reach the target in the top left. We use a sliding window of four 64-by-64 images as the observation to capture velocity information. ",
747
+ "bbox": [
748
+ 176,
749
+ 479,
750
+ 821,
751
+ 522
752
+ ],
753
+ "page_idx": 7
754
+ },
755
+ {
756
+ "type": "text",
757
+ "text": "Reacher. We experiment with the reacher environment from OpenAI Gym (Brockman et al., 2016), where a 2-DoF arm has to reach a target denoted by a red dot, which we specify to be in the bottom left. For observations, we directly use 64-by-64-by-3 images of the rendered environment, which provides a top-down view of the reacher and target, and we use a sliding window of four images. ",
758
+ "bbox": [
759
+ 174,
760
+ 529,
761
+ 825,
762
+ 584
763
+ ],
764
+ "page_idx": 7
765
+ },
766
+ {
767
+ "type": "text",
768
+ "text": "Sawyer Lego block stacking. To demonstrate a challenging task in the real world, we use our method to learn Lego block stacking with a real 7-DoF Sawyer robotic arm, as depicted in Figure 3b. The observations used are raw 84-by-84-by-3 images from a camera pointed at the robot, and the controller only receives images as the observation, without joint angles or other information. ",
769
+ "bbox": [
770
+ 174,
771
+ 592,
772
+ 825,
773
+ 647
774
+ ],
775
+ "page_idx": 7
776
+ },
777
+ {
778
+ "type": "text",
779
+ "text": "6.2 SIMULATION RESULTS ",
780
+ "text_level": 1,
781
+ "bbox": [
782
+ 176,
783
+ 667,
784
+ 370,
785
+ 681
786
+ ],
787
+ "page_idx": 7
788
+ },
789
+ {
790
+ "type": "text",
791
+ "text": "Figure 4 details our results on the simulated image-based experimental domains, where each method is tested on three random seeds and the mean and standard deviation of the performance is reported. For the 2D navigation and car tasks from images, we plot the average final distance to the goal as a function of the number of episodes, so lower is better.3 On the reacher task, we plot the reward function as defined by Gym since this is the standard metric used to evaluate performance on this task, and as shown by the videos on our project website, achieving high Gym reward correlates strongly with solving the task in terms of distance to the goal. ",
792
+ "bbox": [
793
+ 173,
794
+ 694,
795
+ 825,
796
+ 791
797
+ ],
798
+ "page_idx": 7
799
+ },
800
+ {
801
+ "type": "text",
802
+ "text": "On 2D navigation from images, our method, the VAE ablation, and the global model ablation are all able to learn very quickly, converging to high-performing policies within 200 episodes. LQR-FLM struggles to learn the task, likely because the images are too complex for local linear model fitting, and makes no progress at all. In fact, LQR-FLM fails to learn on all of the simulated tasks, and we note that this precludes the guided policy search (GPS) method from solving these tasks (Levine et al., 2016), as GPS uses LQR-FLM as a subroutine. For the sake of clarity in the plots, we omit the ",
803
+ "bbox": [
804
+ 174,
805
+ 799,
806
+ 825,
807
+ 882
808
+ ],
809
+ "page_idx": 7
810
+ },
811
+ {
812
+ "type": "text",
813
+ "text": "LQR-FLM results, which are qualitatively similar to the E2C-like ablation results. PPO eventually learns a successful policy, as indicated by the dashed line depicting this method’s final performance, but this requires roughly three orders of magnitude more samples than our method. We present log-scale plots that illustrate the full learning progress of model-free methods in Appendix E. ",
814
+ "bbox": [
815
+ 174,
816
+ 103,
817
+ 825,
818
+ 159
819
+ ],
820
+ "page_idx": 8
821
+ },
822
+ {
823
+ "type": "text",
824
+ "text": "Despite using code directly from the authors of RCE, we were unable to get the E2C-like ablation to learn a good model for this task, and thus the learned policy does not improve over the initial policy. In fact, we were unable to learn successful policies for any of the simulated tasks, though in Appendix E, we demonstrate that this ablation can learn a more successful policy on the 2D navigation domain used by Watter et al. (2015); Banijamali et al. (2017), where the target is fixed to the bottom right. This highlights the difficulty of the tasks we consider. ",
825
+ "bbox": [
826
+ 174,
827
+ 166,
828
+ 825,
829
+ 250
830
+ ],
831
+ "page_idx": 8
832
+ },
833
+ {
834
+ "type": "text",
835
+ "text": "On the image-based car, our method is able to learn a good policy with about 1500 episodes of experience. The global model ablation is competitive with our method, however, we obtained this result by biasing the mean of the MPC random action selection to be positive, effectively encoding prior information that the car should move forward. We also noticed that, even with more data, the variance of the MPC performance remained higher than the policy learned by our method. These observations indicate that forward prediction using the learned global models may be inaccurate, leading to inconsistent control performance. In contrast, our method does not heavily rely on an accurate model and can achieve consistently good behavior on this task. The VAE ablation is able to solve this task for some random seeds, however this method’s performance is less consistent compared to our method. PPO eventually learns a successful policy for this task that performs better than our method, however it uses over 25 times more data than our method. ",
836
+ "bbox": [
837
+ 174,
838
+ 257,
839
+ 825,
840
+ 410
841
+ ],
842
+ "page_idx": 8
843
+ },
844
+ {
845
+ "type": "text",
846
+ "text": "Finally, on the image-based reacher task, our method achieves worse final policy performance than PPO, though we do so with about 40 times fewer episodes, i.e., we use under 700 episodes whereas PPO uses about 30000. This gain in data efficiency compared to model-free methods is typical of model-based methods, however, SOLAR is able to handle this domain directly from raw image observations, which is challenging for other model-based methods. The VAE ablation also makes progress toward the goal, however, the performance is noticeably worse compared to our method. The global model ablation makes very little improvement over its initial behavior, which is better than the other methods as it learns both a dynamics and cost model from the pretraining data and uses these models right away for planning. This performance drop compared to the previous tasks indicates the difficulty in forward prediction for this domain, coupled with the failure of short-horizon control for this task as greedily minimizing distance to the goal often simply leads to collapsing the arm. As it is also less intuitive to encode prior information into this task compared to biasing the actions in the car domain to drive forward, we could not get this ablation to succeed on this task. ",
847
+ "bbox": [
848
+ 174,
849
+ 416,
850
+ 825,
851
+ 597
852
+ ],
853
+ "page_idx": 8
854
+ },
855
+ {
856
+ "type": "text",
857
+ "text": "6.3 REAL ROBOT RESULTS ",
858
+ "text_level": 1,
859
+ "bbox": [
860
+ 176,
861
+ 614,
862
+ 374,
863
+ 628
864
+ ],
865
+ "page_idx": 8
866
+ },
867
+ {
868
+ "type": "text",
869
+ "text": "Figure 5 details performance on the Lego block stacking tasks in terms of the average final distance in centimeters to the goal, where we test on three random seeds and report the mean and standard deviation of the performance. We define the goal position of the end effector such that reaching the goal leads to successful stacking of the block. Not only is our method able to solve this task directly from raw, high-dimensional camera images within 200 episodes, corresponding to about half an hour of interaction time, our method is also successful at handling the complex, contact-rich dynamics of block stacking. As seen in the video on our project website, our method learns a policy that can react to slightly different contacts, due to the bottom block shifting between episodes, and is ultimately successful in stacking the block in most episodes.4 ",
870
+ "bbox": [
871
+ 174,
872
+ 641,
873
+ 549,
874
+ 848
875
+ ],
876
+ "page_idx": 8
877
+ },
878
+ {
879
+ "type": "text",
880
+ "text": "We compare to the VAE and global model ablations, as these proved to be the most successful and data efficient baselines in simulation. These ablations are competitive with our method for this real world task, though our method still achieves a better final policy that is able to more consistently stack the block. The pixel space model is significantly worse than the other methods that learn a latent representation, and given prior work on pixel space global models (Finn & Levine, 2017), we suspect that this method would need more data in order to learn this task. ",
881
+ "bbox": [
882
+ 173,
883
+ 857,
884
+ 549,
885
+ 898
886
+ ],
887
+ "page_idx": 8
888
+ },
889
+ {
890
+ "type": "image",
891
+ "img_path": "images/1c85e9802e1f9d613d6def55df0837f8da791042e38df07dfdd9f8a7bea6f2d5.jpg",
892
+ "image_caption": [
893
+ "Figure 5: Performance on the real-world Sawyer block stacking task. Our method learns to successfully stack the block in about half an hour of interaction time. The VAE and global model ablations are also competitive on this task, while the pixel space model performs worse. "
894
+ ],
895
+ "image_footnote": [],
896
+ "bbox": [
897
+ 568,
898
+ 616,
899
+ 816,
900
+ 768
901
+ ],
902
+ "page_idx": 8
903
+ },
904
+ {
905
+ "type": "text",
906
+ "text": "",
907
+ "bbox": [
908
+ 174,
909
+ 103,
910
+ 825,
911
+ 159
912
+ ],
913
+ "page_idx": 9
914
+ },
915
+ {
916
+ "type": "text",
917
+ "text": "7 DISCUSSION AND FUTURE WORK ",
918
+ "text_level": 1,
919
+ "bbox": [
920
+ 176,
921
+ 180,
922
+ 485,
923
+ 196
924
+ ],
925
+ "page_idx": 9
926
+ },
927
+ {
928
+ "type": "text",
929
+ "text": "We presented SOLAR, a model-based RL algorithm that is capable of learning policies in a dataefficient manner directly from raw high-dimensional observations. The key insights in SOLAR involve learning latent representations where simple models are more accurate and utilizing PGM structure to infer dynamics from data conditioned on entire real-world trajectories. Our experimental results demonstrate that SOLAR is competitive in sample efficiency, while exhibiting superior final policy performance, compared to other model-based methods. Furthermore, SOLAR is significantly more data-efficient compared to state-of-the-art model-free RL methods. ",
930
+ "bbox": [
931
+ 174,
932
+ 213,
933
+ 825,
934
+ 310
935
+ ],
936
+ "page_idx": 9
937
+ },
938
+ {
939
+ "type": "text",
940
+ "text": "There are several interesting directions for future work. First, the ability to learn representations lends itself naturally to multi-task and transfer settings, where new tasks could potentially be learned much more quickly by starting from a latent embedding that has been learned from previous tasks. We can also in principle share dynamics models, where the PGM we learn from solving previous tasks can be used as a global prior when inferring local dynamics fits for a new task. Second, our model is designed for and tested on continuous action domains as we focus on robotic applications. Extending our model to discrete actions would necessitate some type of continuous relaxation or learned action representation, and we believe that this is another interesting direction for future work. ",
941
+ "bbox": [
942
+ 174,
943
+ 318,
944
+ 825,
945
+ 429
946
+ ],
947
+ "page_idx": 9
948
+ },
949
+ {
950
+ "type": "text",
951
+ "text": "REFERENCES ",
952
+ "text_level": 1,
953
+ "bbox": [
954
+ 174,
955
+ 449,
956
+ 285,
957
+ 464
958
+ ],
959
+ "page_idx": 9
960
+ },
961
+ {
962
+ "type": "text",
963
+ "text": "C. An, C. Atkeson, and J. Hollerbach. Model-Based Control of a Robot Manipulator. MIT Press, 1988. \nC. Atkeson and S. Schaal. Robot learning from demonstration. In ICML, 1997. \nE. Banijamali, R. Shu, M. Ghavamzadeh, H. Bui, and A. Ghodsi. Robust locally-linear controllable embedding. arXiv preprint arXiv:1710.05373, 2017. \nS. Bansal, R. Calandra, T. Xiao, S. Levine, and C. Tomlin. Goal-driven dynamics learning via Bayesian optimization. In CDC, 2017. \nS. Boyd and L. Vandenberghe. Convex Optimization. Cambridge University Press, 2004. \nG. Brockman, V. Cheung, L. Pettersson, J. Schneider, J. Schulman, J. Tang, and W. Zaremba. OpenAI gym. arXiv preprint arXiv:1606.01540, 2016. \nE. Camacho and C. Bordons. Model Predictive Control in the Process Industry. Springer-Verlag New York, Inc., 1997. \nY. Chebotar, K. Hausman, M. Zhang, G. Sukhatme, S. Schaal, and S. Levine. Combining model-based and model-free updates for trajectory-centric reinforcement learning. In ICML, 2017. \nM. Deisenroth, D. Fox, and C. Rasmussen. Gaussian processes for data-efficient learning in robotics and control. PAMI, 2014. \nC. Finn and S. Levine. Deep visual foresight for planning robot motion. In ICRA, 2017. \nC. Finn, X. Tan, Y. Duan, T. Darrell, S. Levine, and P. Abbeel. Deep spatial autoencoders for visuomotor learning. In ICRA, 2016. \nY. Gao, E. Archer, L. Paninski, and J. Cunningham. Linear dynamical neural population models through nonlinear embeddings. In NIPS, 2016. \nS. Gu, T. Lillicrap, I. Sutskever, and S. Levine. Continuous deep Q-learning with model-based acceleration. In ICML, 2016. \nN. Heess, G. Wayne, D. Silver, T. Lillicrap, Y. Tassa, and T. Erez. Learning continuous control policies by stochastic value gradients. In NIPS, 2015. \nI. Higgins, A. Pal, A. Rusu, L. Matthey, C. Burgess, A. Pritzel, M. Botvinick, C. Blundell, and A. Lerchner. DARLA: Improving zero-shot transfer in reinforcement learning. In ICML, 2017. \nD. Jacobson and D. Mayne. Differential Dynamic Programming. American Elsevier, 1970. \nM. Johnson, D. Duvenaud, A. Wiltschko, S. Datta, and R. Adams. Composing graphical models with neural networks for structured representations and fast inference. In NIPS, 2016. \nD. Kingma and J. Ba. Adam: A method for stochastic optimization. In ICLR, 2015. \nD. Kingma and M. Welling. Auto-encoding variational Bayes. In ICLR, 2014. \nJ. Kolter and A. Ng. Policy search via the signed derivative. In RSS, 2005. \nS. Lange and M. Riedmiller. Deep auto-encoder neural networks in reinforcement learning. In IJCNN, 2010. \nT. Lesort, N. Díaz-Rodríguez, J. Goudou, and D. Filliat. State representation learning for control: An overview. arXiv preprint arXiv:1802.04181, 2018. \nS. Levine and P. Abbeel. Learning neural network policies with guided policy search under unknown dynamics. In NIPS, 2014. \nS. Levine and V. Koltun. Guided policy search. In ICML, 2013. \nS. Levine, C. Finn, T. Darrell, and P. Abbeel. End-to-end training of deep visuomotor policies. JMLR, 2016. \nN. Mishra, I. Mordatch, and P. Abbeel. Prediction and control with temporal segment models. In ICML, 2017. \nT. Moldovan, S. Levine, M. Jordan, and P. Abbeel. Optimism-driven exploration for nonlinear systems. In ICRA, 2015. \nW. Montgomery, A. Ajay, C. Finn, P. Abbeel, and S. Levine. Reset-free guided policy search: Efficient deep reinforcement learning with stohcastic initial states. In ICRA, 2017. \nA. Nagabandi, G. Kahn, R. Fearing, and S. Levine. Neural network dynamics for model-based deep reinforcement learning with model-free fine-tuning. In ICRA, 2018. \nA. Nouri and M. Littman. Dimension reduction and its application to model-based exploration in continuous spaces. Machine Learning, 2010. \nJ. Oh, S. Singh, and H. Lee. Value prediction network. In NIPS, 2017. \nJ. Peters, K. Mülling, and Y. Altün. Relative entropy policy search. In AAAI, 2010. \nD. Rezende, S. Mohamed, and D. Wierstra. Stochastic backpropagation and approximate inference in deep generative models. In ICML, 2014. \nJ. Schulman, S. Levine, P. Moritz, M. Jordan, and P. Abbeel. Trust region policy optimization. In ICML, 2015. \nJ. Schulman, F. Wolski, P. Dhariwal, A. Radford, and O. Klimov. Proximal policy optimization algorithms. arXiv preprint arXiv:1707.06347, 2017. \nS. Singh, T. Jaakkola, and M. Jordan. Reinforcement learning with soft state aggregation. In NIPS, 1994. \nA. Smith. Applications of the self-organizing map to reinforcement learning. Neural Networks, 2002. \nR. Sutton. Integrated architectures for learning, planning, and reacting based on approximating dynamic programming. In ICML, 1990. \nY. Tassa, T. Erez, and E. Todorov. Synthesis and stabilization of complex behaviors. In IROS, 2012. \nE. Todorov and W. Li. A generalized iterative LQG method for locally-optimal feedback control of constrained nonlinear stochastic systems. In ACC, 2005. \nV.Feinberg, A. Wan, I. Stoica, M. Jordan, J. Gonzalez, and S. Levine. Model-based value estimation for efficient model-free reinforcement learning. arXiv preprint arXiv:1803.00101, 2018. \nM. Watter, J. Springenberg, J. Boedecker, and M. Riedmiller. Embed to control: A locally linear latent dynamics model for control from raw images. In NIPS, 2015. \nJ. Winn and C. Bishop. Variational message passing. JMLR, 2005. ",
964
+ "bbox": [
965
+ 171,
966
+ 463,
967
+ 828,
968
+ 924
969
+ ],
970
+ "page_idx": 9
971
+ },
972
+ {
973
+ "type": "text",
974
+ "text": "",
975
+ "bbox": [
976
+ 169,
977
+ 84,
978
+ 830,
979
+ 930
980
+ ],
981
+ "page_idx": 10
982
+ },
983
+ {
984
+ "type": "text",
985
+ "text": "A POLICY LEARNING DETAILS ",
986
+ "text_level": 1,
987
+ "bbox": [
988
+ 176,
989
+ 102,
990
+ 447,
991
+ 118
992
+ ],
993
+ "page_idx": 11
994
+ },
995
+ {
996
+ "type": "text",
997
+ "text": "Given a TVLG dynamics model and quadratic cost approximation, we can approximate our Q and value functions to second order with the following dynamic programming updates, which proceed from the last time step $t = T$ to the first step $t = 1$ : ",
998
+ "bbox": [
999
+ 174,
1000
+ 133,
1001
+ 825,
1002
+ 176
1003
+ ],
1004
+ "page_idx": 11
1005
+ },
1006
+ {
1007
+ "type": "equation",
1008
+ "img_path": "images/699064c59b0159415d228a5d6062b35e146d415c392847f0c2d4bd2991c1be04.jpg",
1009
+ "text": "$$\n\\begin{array} { r l } & { Q _ { \\mathbf { s } , t } = c _ { \\mathbf { s } , t } + \\mathbf { F } _ { \\mathbf { s } , t } ^ { \\top } V _ { \\mathbf { s } , t + 1 } , \\ Q _ { \\mathbf { s } \\mathbf { s } , t } = c _ { \\mathbf { s } \\mathbf { s } , t } + \\mathbf { F } _ { \\mathbf { s } , t } ^ { \\top } V _ { \\mathbf { s } \\mathbf { s } , t + 1 } \\mathbf { F } _ { \\mathbf { s } , t } , } \\\\ & { Q _ { \\mathbf { a } , t } = c _ { \\mathbf { a } , t } + \\mathbf { F } _ { \\mathbf { a } , t } ^ { \\top } V _ { \\mathbf { s } , t + 1 } , \\ Q _ { \\mathbf { a } \\mathbf { a } , t } = c _ { \\mathbf { a } \\mathbf { a } , t } + \\mathbf { F } _ { \\mathbf { a } , t } ^ { \\top } V _ { \\mathbf { s } \\mathbf { s } , t + 1 } \\mathbf { F } _ { \\mathbf { a } , t } , } \\\\ & { \\qquad Q _ { \\mathbf { s } \\mathbf { a } , t } = c _ { \\mathbf { s } \\mathbf { a } , t } + \\mathbf { F } _ { \\mathbf { s } , t } ^ { \\top } V _ { \\mathbf { s } \\mathbf { s } , t + 1 } \\mathbf { F } _ { \\mathbf { a } , t } , } \\\\ & { \\qquad V _ { \\mathbf { s } , t } = Q _ { \\mathbf { s } , t } - Q _ { \\mathbf { s } \\mathbf { a } , t } Q _ { \\mathbf { a } \\mathbf { a } , t } ^ { - 1 } Q _ { \\mathbf { a } , t } , } \\\\ & { \\qquad V _ { \\mathbf { s } \\mathbf { s } , t } = Q _ { \\mathbf { s } \\mathbf { s } , t } - Q _ { \\mathbf { s } \\mathbf { a } , t } Q _ { \\mathbf { a } \\mathbf { a } , t } ^ { - 1 } Q _ { \\mathbf { a } \\mathbf { s } , t } . } \\end{array}\n$$",
1010
+ "text_format": "latex",
1011
+ "bbox": [
1012
+ 294,
1013
+ 181,
1014
+ 702,
1015
+ 287
1016
+ ],
1017
+ "page_idx": 11
1018
+ },
1019
+ {
1020
+ "type": "text",
1021
+ "text": "It can be shown (e.g., by Tassa et al. (2012)) that the action $\\mathbf { a } _ { t }$ that minimizes the second-order approximation of the Q-function at every time step $t$ is given by ",
1022
+ "bbox": [
1023
+ 171,
1024
+ 291,
1025
+ 823,
1026
+ 320
1027
+ ],
1028
+ "page_idx": 11
1029
+ },
1030
+ {
1031
+ "type": "equation",
1032
+ "img_path": "images/ed3c4f69245c405cea4675044f883d423f63675147424a70ed6d802606e364cb.jpg",
1033
+ "text": "$$\n{ \\bf a } _ { t } = - Q _ { { \\bf a } { \\bf a } , t } ^ { - 1 } Q _ { { \\bf a } { \\bf s } , t } { \\bf s } _ { t } - Q _ { { \\bf a } { \\bf a } , t } ^ { - 1 } Q _ { { \\bf a } , t } .\n$$",
1034
+ "text_format": "latex",
1035
+ "bbox": [
1036
+ 382,
1037
+ 325,
1038
+ 614,
1039
+ 344
1040
+ ],
1041
+ "page_idx": 11
1042
+ },
1043
+ {
1044
+ "type": "text",
1045
+ "text": "This action is a linear function of the state $\\mathbf { s } _ { t }$ , thus we can construct an optimal linear policy by setting ${ \\bf K } _ { t } = - Q _ { { \\bf a a } , t } ^ { - 1 } Q _ { { \\bf a s } , t }$ and ${ \\bf k } _ { t } = - Q _ { { \\bf a a } , t } ^ { - 1 } Q _ { { \\bf a } , t }$ . We can also show that the maximum-entropy policy that minimizes the approximate Q-function is given by ",
1046
+ "bbox": [
1047
+ 173,
1048
+ 351,
1049
+ 826,
1050
+ 393
1051
+ ],
1052
+ "page_idx": 11
1053
+ },
1054
+ {
1055
+ "type": "equation",
1056
+ "img_path": "images/f0f6a2203ff37d41d167475384a42759afa9309035b330e9db5341eba4c25003.jpg",
1057
+ "text": "$$\n\\pi ( \\mathbf { a } _ { t } | \\mathbf { s } _ { t } ) = \\mathcal { N } ( \\mathbf { K } _ { t } \\mathbf { s } _ { t } + \\mathbf { k } _ { t } , Q _ { \\mathbf { a a } , t } ) .\n$$",
1058
+ "text_format": "latex",
1059
+ "bbox": [
1060
+ 385,
1061
+ 398,
1062
+ 611,
1063
+ 417
1064
+ ],
1065
+ "page_idx": 11
1066
+ },
1067
+ {
1068
+ "type": "text",
1069
+ "text": "Furthermore, as in Levine & Abbeel (2014), we can impose a constraint on the total KL-divergence between the old and new trajectory distributions induced by the policies through an augmented cost function $\\begin{array} { r } { \\bar { c } ( { \\mathbf s } _ { t } , \\mathbf { a } _ { t } ) = \\frac { 1 } { \\lambda } c ( { \\mathbf s } _ { t } , \\mathbf { a } _ { t } ) - \\log \\pi ^ { ( i - 1 ) } ( { \\mathbf a } _ { t } | { \\mathbf s } _ { t } ) } \\end{array}$ , where solving for $\\lambda$ via dual gradient descent can yield an exact solution to a KL-constrained LQR problem. ",
1070
+ "bbox": [
1071
+ 173,
1072
+ 422,
1073
+ 825,
1074
+ 481
1075
+ ],
1076
+ "page_idx": 11
1077
+ },
1078
+ {
1079
+ "type": "text",
1080
+ "text": "B DYNAMICS INFERENCE ",
1081
+ "text_level": 1,
1082
+ "bbox": [
1083
+ 176,
1084
+ 501,
1085
+ 403,
1086
+ 517
1087
+ ],
1088
+ "page_idx": 11
1089
+ },
1090
+ {
1091
+ "type": "text",
1092
+ "text": "Here we provide the closed form parameter computations for the posteriors of our dynamics given observed trajectories, as described in Section 4.1 of the main paper. Given variational factors from our model of the form ",
1093
+ "bbox": [
1094
+ 173,
1095
+ 531,
1096
+ 825,
1097
+ 574
1098
+ ],
1099
+ "page_idx": 11
1100
+ },
1101
+ {
1102
+ "type": "equation",
1103
+ "img_path": "images/fce7d76d57d42b48a5191961dc872532f5745339fa7c7d7690eb9784e8f79bdb.jpg",
1104
+ "text": "$$\n\\begin{array} { r } { q ( \\mathbf { F } _ { t } , \\Sigma _ { t } ) = \\mathcal { M N T } \\mathcal { W } ( \\Psi _ { t } ^ { \\prime } , \\nu _ { t } ^ { \\prime } , M _ { 0 t } ^ { \\prime } , V _ { t } ^ { \\prime } ) \\mathrm { ~ f o r ~ } t \\in [ 0 , . . . , T - 1 ] , } \\end{array}\n$$",
1105
+ "text_format": "latex",
1106
+ "bbox": [
1107
+ 287,
1108
+ 580,
1109
+ 707,
1110
+ 598
1111
+ ],
1112
+ "page_idx": 11
1113
+ },
1114
+ {
1115
+ "type": "text",
1116
+ "text": "n observed trajectories . These posteriors are als $\\tau$ to obtain new variational posteriors MNIW, and the parameters of these pos$\\{ q ( \\mathbf { F } _ { t } , \\Sigma _ { t } | \\{ \\tau \\} _ { i = 0 } ^ { N } ) \\} _ { t = 0 } ^ { T - 1 }$ teriors can be computed in closed form as ",
1117
+ "bbox": [
1118
+ 174,
1119
+ 604,
1120
+ 826,
1121
+ 648
1122
+ ],
1123
+ "page_idx": 11
1124
+ },
1125
+ {
1126
+ "type": "equation",
1127
+ "img_path": "images/168c26c3067b56d7edab49d23811b73b35dc41c99081609c43b3d98cb6c2fc1c.jpg",
1128
+ "text": "$$\n\\begin{array} { r l } & { \\Psi _ { t } = \\Psi _ { t } ^ { \\prime } + M _ { 0 t } ^ { \\prime } V _ { t } ^ { \\prime - 1 } M _ { 0 t } ^ { \\prime \\top } + \\displaystyle \\sum _ { i = 1 } ^ { N } \\mathbf { z } _ { t + 1 } ^ { ( i ) } \\mathbf { z } _ { t + 1 } ^ { ( i ) \\top } - M _ { 0 t } V _ { t } ^ { - 1 } M _ { 0 t } ^ { \\top } , \\qquad \\kappa _ { t } = \\kappa _ { t } + N , } \\\\ & { M _ { 0 t } = \\left( M _ { 0 t } ^ { \\prime } V _ { t } ^ { \\prime - 1 } + \\displaystyle \\sum _ { i = 1 } ^ { N } \\mathbf { z } _ { t + 1 } ^ { ( i ) } \\left[ \\mathbf { z } _ { t } ^ { ( i ) } \\right] ^ { \\top } \\right) V _ { t } , \\qquad V _ { t } = \\left( V _ { t } ^ { \\prime - 1 } + \\displaystyle \\sum _ { i = 1 } ^ { N } \\left[ \\mathbf { z } _ { t } ^ { ( i ) } \\right] \\left[ \\mathbf { z } _ { t } ^ { ( i ) } \\right] ^ { \\top } \\right) ^ { - 1 } . } \\end{array}\n$$",
1129
+ "text_format": "latex",
1130
+ "bbox": [
1131
+ 191,
1132
+ 655,
1133
+ 810,
1134
+ 752
1135
+ ],
1136
+ "page_idx": 11
1137
+ },
1138
+ {
1139
+ "type": "text",
1140
+ "text": "Then, a maximum a posteriori estimate gives us the TVLG dynamics parameters as described in the main paper. ",
1141
+ "bbox": [
1142
+ 174,
1143
+ 757,
1144
+ 823,
1145
+ 786
1146
+ ],
1147
+ "page_idx": 11
1148
+ },
1149
+ {
1150
+ "type": "text",
1151
+ "text": "C POLICY LINEARIZATION ",
1152
+ "text_level": 1,
1153
+ "bbox": [
1154
+ 176,
1155
+ 805,
1156
+ 413,
1157
+ 821
1158
+ ],
1159
+ "page_idx": 11
1160
+ },
1161
+ {
1162
+ "type": "text",
1163
+ "text": "The policy update described in Section 4.2 of the main paper requires us to compute the KL-divergence between the trajectory distributions before and after the policy update, denoted as $\\bar { p } ( \\tau )$ and $\\dot { p } ( \\tau )$ , respectively. We compute with the previous policy, a $\\begin{array} { r } { p ( \\tau ) = \\hat { \\rho } ( \\mathbf { z } _ { 0 } ) \\prod _ { t = 0 } ^ { T - 1 } \\pi _ { \\boldsymbol { \\theta } } ( \\mathbf { a } _ { t } | \\mathbf { z } _ { t } ) \\hat { p } ( \\mathbf { z } _ { t + 1 } | \\mathbf { z } _ { t } , \\mathbf { a } _ { t } ) } \\end{array}$ , and analogously for y because the policies $\\bar { p } ( \\tau )$ dynamics model are TVLG, thus the induced trajectory distributions are also Gaussian. However, this operates under the assumption that $\\mathbf { z }$ is fixed, which does not hold since the model update changes the latent representation. Since our overall policy is a combination of the model embedding, given by $e _ { \\phi } ( \\mathbf { s } )$ , and the TVLG policy $\\pi _ { \\boldsymbol { \\theta } } ( \\mathbf { a } _ { t } | \\mathbf { z } _ { t } )$ , training $e _ { \\phi } ( \\mathbf { s } )$ will change the behavior of the policy even if $\\pi _ { \\boldsymbol { \\theta } } ( \\mathbf { a } _ { t } | \\mathbf { z } _ { t } )$ stays fixed. In some cases, this may lead to a policy with worse performance, and constraining against this policy for the policy update may lead to poor results. In fact, what we want to do is to account for the model update by changing $\\pi _ { \\boldsymbol { \\theta } } ( \\mathbf { a } _ { t } | \\mathbf { z } _ { t } )$ accordingly, so that the overall policy does not change in its distribution. Thus, using $\\left( \\mathbf { s } _ { t } , \\mathbf { a } _ { t } \\right)$ pairs from the previous data collection phase, we embed $\\mathbf { z } _ { t } = \\mu ( e _ { \\phi } ( \\mathbf { s } _ { t } ) )$ with our updated model and use linear regression to find the TVLG policy $\\tilde { \\pi } _ { \\boldsymbol { \\theta } } ( \\mathbf { a } _ { t } | \\mathbf { z } _ { t } )$ that best explains the data collected from the policy This is line 6 of the SOLAR algorithm presented in the main paper, and after this, we can perform the policy update constrained against the trajectory distribution induced by $\\tilde { \\pi } _ { \\boldsymbol { \\theta } } ( \\mathbf { a } _ { t } | \\mathbf { z } _ { t } )$ . ",
1164
+ "bbox": [
1165
+ 173,
1166
+ 837,
1167
+ 826,
1168
+ 924
1169
+ ],
1170
+ "page_idx": 11
1171
+ },
1172
+ {
1173
+ "type": "image",
1174
+ "img_path": "images/44d897a8277a0076f1e5c3373058af16b1a1e69f206ae263fc99599086bb7d86.jpg",
1175
+ "image_caption": [
1176
+ "Figure 6: (a) An illustration of the 2D navigation task, with the agent depicted as the black dot and the target depicted as the blue dot. (b) We use as observations two 32-by-32 images stacked on top of each other, where the first observation indicates the position of the agent the second observation indicates the position of the target. (c) Visualization of the 4-dimensional latent space for an example random trajectory of the 2D-navigation task. Note that the range of values in the latent space is very narrow, and the bottom two dimensions seemingly capture information about the target which does not move. "
1177
+ ],
1178
+ "image_footnote": [],
1179
+ "bbox": [
1180
+ 181,
1181
+ 102,
1182
+ 816,
1183
+ 223
1184
+ ],
1185
+ "page_idx": 12
1186
+ },
1187
+ {
1188
+ "type": "text",
1189
+ "text": "",
1190
+ "bbox": [
1191
+ 174,
1192
+ 357,
1193
+ 825,
1194
+ 497
1195
+ ],
1196
+ "page_idx": 12
1197
+ },
1198
+ {
1199
+ "type": "text",
1200
+ "text": "D EXPERIMENT SETUP ",
1201
+ "text_level": 1,
1202
+ "bbox": [
1203
+ 176,
1204
+ 517,
1205
+ 382,
1206
+ 534
1207
+ ],
1208
+ "page_idx": 12
1209
+ },
1210
+ {
1211
+ "type": "text",
1212
+ "text": "Image-based 2D navigation. Our recognition model architecture for the 2D navigation domain consists of two convolution layers with 2-by-2 filters and 32 channels each, with no pooling layers and ReLU non-linearities, followed by another convolution with 2-by-2 filters and 2 channels. The output of the last convolution layer is fed into a spatial softmax layer (Finn et al., 2016), which then outputs a Gaussian distribution with a fixed diagonal covariance of $1 0 ^ { - 4 }$ for the latent distribution. Our observation model consists of two fully-connected (FC) hidden layers with 256 ReLU activations, and the last layer outputs a categorical distribution over pixels. We initially collect 200 episodes which we use to train our model, and for every subsequent iteration we collect 20 episodes to fine tune our model. The cost function we use is the sum of the $L ^ { 2 }$ -norm squared of the distance to the target and the commanded action, with weights of 1 and 0.001, respectively. ",
1213
+ "bbox": [
1214
+ 174,
1215
+ 547,
1216
+ 825,
1217
+ 688
1218
+ ],
1219
+ "page_idx": 12
1220
+ },
1221
+ {
1222
+ "type": "text",
1223
+ "text": "Image-based nonholonomic car. The image-based car domain consists of 64-by-64 image observations. We include a window of the 3 previous 64-by-64 images in our observation to preserve velocity information. Our recognition model is a convolutional neural network that operates on each image in the sliding window independently. Its architecture is four convolutional layers with 4-by-4 filters with 4 channels each, and the first two convolution layers are followed by a ReLU non-linearity. The output of the last convolutional layer is fed into three FC ReLU layers of width 2048, 512, and 128, respectively. Our final layer outputs a Gaussian distribution with dimension 8. This leads to a final latent dimension of 32. Our observation model consists of four FC ReLU layers of width 256, 512, 1024, and 2048, respectively, followed by a Bernoulli distribution layer that models the image. Like the recognition model, the observation model only operates on each section of the latent representation corresponding to the image window independently. For this domain, we collect 100 episodes initially to train our model, and we collect 100 episodes per iteration after this. The cost function we use is the sum of the $L ^ { 2 }$ -norm squared of the distance from the center of the car to the target and the commanded action, with weights of 1 and 0.001, respectively. ",
1224
+ "bbox": [
1225
+ 174,
1226
+ 694,
1227
+ 825,
1228
+ 888
1229
+ ],
1230
+ "page_idx": 12
1231
+ },
1232
+ {
1233
+ "type": "text",
1234
+ "text": "Reacher. The reacher domain consists of 64-by-64-by-3 image observations. Similar to the car, we include a window of the 3 previous 64-by-64-by-3 images in our observation. Our recognition model is a convolutional neural network that again operates on each image in the sliding window independently. Its architecture is three convolutional layers with 2-by-2 filters with 64, 32 and 16 channels respectively. Each layer has a ReLU non-linearity followed by a 2-by-2 max-pooling. The output of the last convolutional layer is fed into an FC ReLU layer of width 200, followed by another FC ReLU layer of width 200. Our final layer outputs a Gaussian distribution with dimension 10, leading to a final latent dimension of 40. Our observation model consists of three FC ReLU layers of width 256, followed by a Bernoulli distribution layer and separately models each image in the sliding window. We collect 200 episodes initially to train our model, and we collect 100 episodes per iteration after this. The cost function we use is the sum of the $L ^ { 2 }$ -norm of the distance from the fingertip to the target and the $L ^ { 2 }$ -norm squared of the commanded action. ",
1235
+ "bbox": [
1236
+ 173,
1237
+ 895,
1238
+ 821,
1239
+ 924
1240
+ ],
1241
+ "page_idx": 12
1242
+ },
1243
+ {
1244
+ "type": "text",
1245
+ "text": "",
1246
+ "bbox": [
1247
+ 174,
1248
+ 103,
1249
+ 825,
1250
+ 242
1251
+ ],
1252
+ "page_idx": 13
1253
+ },
1254
+ {
1255
+ "type": "text",
1256
+ "text": "Sawyer Lego block stacking. The image-based Sawyer block-stacking domain consists of 84-by-84-by-3 image observations. The policy outputs velocities on the end effector in order to control the robot. Our recognition model is a convolutional neural network with the following architecture: a 5-by-5 filter convolutional layer with 16 channels followed by two convolutional layers using 5-by-5 filters with 32 channels each. The first two convolutional layers are followed by ReLU activations and the last by a FC ReLU layer of width 256 leading to a 16 dimensional Gaussian distribution layer. Our observation model consists of a FC ReLU layer of width 128 feeding into three deconvolutional layers, the first with 5-by-5 filters with 32 channels and the last two of 6-by-6 filters with 16 and 3 channels respectively. These are followed by a final Bernoulli distribution layer. For this domain, we collect 50 episodes initially to train our model, 20 episodes per iteration for the first 5 iterations, then 10 episodes per iteration for the remainder. The cost function is the sum of the $L ^ { 1 }$ -norm of a weighted displacement vector between the end-effector and the target in 3D-space (weighted 1, 2, 1 for $x , y , z )$ , the $L ^ { 2 }$ -norm in the same space, and the angle of rotation required to reach a valid wrist orientation, with weights of 1, .1, and .15, respectively. ",
1257
+ "bbox": [
1258
+ 173,
1259
+ 250,
1260
+ 825,
1261
+ 444
1262
+ ],
1263
+ "page_idx": 13
1264
+ },
1265
+ {
1266
+ "type": "text",
1267
+ "text": "E ADDITIONAL EXPERIMENTS ",
1268
+ "text_level": 1,
1269
+ "bbox": [
1270
+ 176,
1271
+ 464,
1272
+ 442,
1273
+ 479
1274
+ ],
1275
+ "page_idx": 13
1276
+ },
1277
+ {
1278
+ "type": "text",
1279
+ "text": "E.1 E2C-LIKE ABLATION ON SIMPLIFIED 2D NAVIGATION ",
1280
+ "text_level": 1,
1281
+ "bbox": [
1282
+ 174,
1283
+ 496,
1284
+ 586,
1285
+ 510
1286
+ ],
1287
+ "page_idx": 13
1288
+ },
1289
+ {
1290
+ "type": "text",
1291
+ "text": "As mentioned in Section 6, our E2C-like ablation was unable to make progress for the 2D navigation task, though we were able to get more successful results by fixing the position of the goal to the bottom right as is done in the image-based 2D navigation task considered in E2C (Watter et al., 2015) and RCE (Banijamali et al., 2017). Figure 7 details this experiment, which we ran for three random seeds and report the mean and standard deviation of the average final distance to the goal as a function of the number of training episodes. It is clear that the policy is improving, and two of the seeds are able to make substantial progress, though the final seed is less successful and significantly worsens the average performance of the method. This indicates that the latent representation learned through RCE is less suitable for local model fitting, as accurate local model fitting is not explicitly encouraged by their representation learning objective. ",
1292
+ "bbox": [
1293
+ 174,
1294
+ 522,
1295
+ 483,
1296
+ 786
1297
+ ],
1298
+ "page_idx": 13
1299
+ },
1300
+ {
1301
+ "type": "image",
1302
+ "img_path": "images/f1ab3c9f4b1d17e8e2bf6573ea5c01e754c2609148f330a2fe45097242f4e023.jpg",
1303
+ "image_caption": [
1304
+ "Figure 7: On 2D navigation with the goal fixed to the bottom right, our E2C-like ablation is able to make progress toward the goal. "
1305
+ ],
1306
+ "image_footnote": [],
1307
+ "bbox": [
1308
+ 531,
1309
+ 540,
1310
+ 787,
1311
+ 703
1312
+ ],
1313
+ "page_idx": 13
1314
+ },
1315
+ {
1316
+ "type": "text",
1317
+ "text": "",
1318
+ "bbox": [
1319
+ 173,
1320
+ 785,
1321
+ 576,
1322
+ 799
1323
+ ],
1324
+ "page_idx": 13
1325
+ },
1326
+ {
1327
+ "type": "image",
1328
+ "img_path": "images/b9dc714596bd5c1cba748d67e3d9241e68198b128d12c698a02bfc4f7f4f1072.jpg",
1329
+ "image_caption": [
1330
+ "Figure 9: (a) Comparison of our method to PPO on the 2D navigation task presented in the paper. Our method uses roughly three orders of magnitude fewer samples to solve the task compared to PPO. (b) On the car from images task, our method achieves slightly worse performance than PPO though with about 25 times fewer samples. (c) Comparison of our method to TRPO and PPO for the reacher task. Our method achieves slightly worse final performance but uses about 40 times fewer samples than these methods. "
1331
+ ],
1332
+ "image_footnote": [],
1333
+ "bbox": [
1334
+ 181,
1335
+ 98,
1336
+ 795,
1337
+ 236
1338
+ ],
1339
+ "page_idx": 14
1340
+ },
1341
+ {
1342
+ "type": "text",
1343
+ "text": "E.2 MODEL-BASED COMPARISONS ON STATE-BASED NONHOLONOMIC CAR ",
1344
+ "text_level": 1,
1345
+ "bbox": [
1346
+ 174,
1347
+ 361,
1348
+ 704,
1349
+ 373
1350
+ ],
1351
+ "page_idx": 14
1352
+ },
1353
+ {
1354
+ "type": "text",
1355
+ "text": "To provide a point of comparison to modelbased RL methods, we consider the car domain where the underlying state is observed. The states for the car domain include the position of the center of mass, orientation, forward and angular velocity of the car, and the position of the target, making for a 9-dimensional system. Since this observation is already quite simple, we use a single linear layer for our recognition and observation models that output Gaussian distributions, and we use the same dimensionality for our latent representation as the state. ",
1356
+ "bbox": [
1357
+ 174,
1358
+ 386,
1359
+ 485,
1360
+ 551
1361
+ ],
1362
+ "page_idx": 14
1363
+ },
1364
+ {
1365
+ "type": "image",
1366
+ "img_path": "images/0aedca8cd6354ec9922ecfa9f40de2b63b05982b8d1bf8bc11942c6fe6ae57c7.jpg",
1367
+ "image_caption": [
1368
+ "Figure 8: On the car from states, our method is competitive with LQR-FLM, demonstrating that we maintain the sample efficiency of model-based methods for simple tasks. "
1369
+ ],
1370
+ "image_footnote": [],
1371
+ "bbox": [
1372
+ 531,
1373
+ 381,
1374
+ 789,
1375
+ 542
1376
+ ],
1377
+ "page_idx": 14
1378
+ },
1379
+ {
1380
+ "type": "text",
1381
+ "text": "We plot the performances of our method, LQRFLM (Levine & Abbeel, 2014), and Nagabandi et al. (2018), which we refer to as modelpredictive control with neural networks (MPCNN), again based on the average final distance to the target, in Figure 8. In this setting, our ",
1382
+ "bbox": [
1383
+ 174,
1384
+ 559,
1385
+ 485,
1386
+ 643
1387
+ ],
1388
+ "page_idx": 14
1389
+ },
1390
+ {
1391
+ "type": "text",
1392
+ "text": "method is competitive with LQR-FLM, learning a policy with similar performance in 200 episodes. MPC-NN performs the best for this task, learning a policy that consistently reaches the target in just 20 episodes, though it is given the true cost function whereas our method and LQR-FLM are not. For this simple setup where modeling bias is not an issue, we expect model-based methods to perform very well and learn efficiently. However, when we make the problem more challenging by using image observations, model-based methods will fail quickly: LQR-FLM is unable to fit complex pixel transitions using local linear models, as shown through the 2D navigation experiment, and MPC-NN has never been used with images, as forward video prediction and defining a cost function on images are both very difficult. We extend MPC-NN to the image-based task, and we term this the “global model ablation” of our method – as shown in the paper, this approach is able to make progress toward the goal, though our method is still significantly better at solving this difficult task. ",
1393
+ "bbox": [
1394
+ 173,
1395
+ 643,
1396
+ 825,
1397
+ 795
1398
+ ],
1399
+ "page_idx": 14
1400
+ },
1401
+ {
1402
+ "type": "text",
1403
+ "text": "E.3 FULL PERFORMANCE OF TRPO ON 2D NAVIGATION AND REACHER ",
1404
+ "text_level": 1,
1405
+ "bbox": [
1406
+ 176,
1407
+ 813,
1408
+ 679,
1409
+ 827
1410
+ ],
1411
+ "page_idx": 14
1412
+ },
1413
+ {
1414
+ "type": "text",
1415
+ "text": "In Figure 9 we include the plots for the simulated tasks comparing SOLAR, PPO, and TRPO. Note that the $\\mathbf { X }$ -axis is on a log scale, i.e., though our method is sometimes worse in final policy performance to PPO and TRPO, we do so with one to three orders of magnitude fewer samples. This demonstrates our method’s sample efficiency compared to model-free methods, while being able to solve complex image-based domains that are difficult for model-based methods. ",
1416
+ "bbox": [
1417
+ 174,
1418
+ 838,
1419
+ 825,
1420
+ 907
1421
+ ],
1422
+ "page_idx": 14
1423
+ }
1424
+ ]
parse/train/Bke96sC5tm/Bke96sC5tm_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/Bke96sC5tm/Bke96sC5tm_model.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/SJgIPJBFvH/SJgIPJBFvH.md ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/SJgIPJBFvH/SJgIPJBFvH_content_list.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/crAi7c41xTh/crAi7c41xTh.md ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/crAi7c41xTh/crAi7c41xTh_content_list.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/crAi7c41xTh/crAi7c41xTh_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/crAi7c41xTh/crAi7c41xTh_model.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/lR4aaWCQgB/lR4aaWCQgB.md ADDED
@@ -0,0 +1,294 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Implicit MLE: Backpropagating Through Discrete Exponential Family Distributions
2
+
3
+ Mathias Niepert NEC Laboratories Europe mathias.niepert@neclab.eu
4
+
5
+ Pasquale Minervini University College London p.minervini@ucl.ac.uk
6
+
7
+ Luca Franceschi Istituto Italiano di Tecnologia University College London ucablfr@ucl.ac.uk
8
+
9
+ # Abstract
10
+
11
+ Combining discrete probability distributions and combinatorial optimization problems with neural network components has numerous applications but poses several challenges. We propose Implicit Maximum Likelihood Estimation (I-MLE), a framework for end-to-end learning of models combining discrete exponential family distributions and differentiable neural components. I-MLE is widely applicable as it only requires the ability to compute the most probable states and does not rely on smooth relaxations. The framework encompasses several approaches such as perturbation-based implicit differentiation and recent methods to differentiate through black-box combinatorial solvers. We introduce a novel class of noise distributions for approximating marginals via perturb-and-MAP. Moreover, we show that I-MLE simplifies to maximum likelihood estimation when used in some recently studied learning settings that involve combinatorial solvers. Experiments on several datasets suggest that I-MLE is competitive with and often outperforms existing approaches which rely on problem-specific relaxations.
12
+
13
+ # 1 Introduction
14
+
15
+ While deep neural networks excel at perceptual tasks, they tend to generalize poorly whenever the problem at hand requires some level of symbolic manipulation or reasoning, or exhibit some (known) algorithmic structure. Logic, relations, and explanations, as well as decision processes, frequently find natural abstractions in discrete structures, ill-captured by the continuous mappings of standard neural nets. Several application domains, ranging from relational and explainable ML to discrete decision-making [Mišic and Perakis, 2020], could benefit from general-purpose learning algorithms ´ whose inductive biases are more amenable to integrating symbolic and neural computation. Motivated by these considerations, there is a growing interest in end-to-end learnable models incorporating discrete components that allow, e.g., to sample from discrete latent distributions [Jang et al., 2017, Paulus et al., 2020] or solve combinatorial optimization problems [Poganciˇ c et al., 2019, Mandi et al., ´ 2020]. Discrete energy-based models (EBMs) [LeCun et al., 2006] and discrete world models [Hafner et al., 2020] are additional examples of neural network based models that require the ability to backpropagate through discrete probability distributions.
16
+
17
+ For complex discrete distributions, it is intractable to compute the exact gradients of the expected loss. For combinatorial optimization problems, the loss is discontinuous, and the gradients are zero almost everywhere. The standard approach revolves around problem-specific smooth relaxations, which allow one to fall back to (stochastic) backpropagation. These strategies, however, require tailor-made relaxations, presuppose access to the constraints and are, therefore, not always feasible nor tractable for large state spaces. Moreover, reverting to discrete outputs at test time may cause unexpected behavior. In other situations, discrete outputs are required at training time because one has to make one of a number of discrete choices, such as accessing discrete memory or deciding on an action in a game.
18
+
19
+ With this paper, we take a step towards the vision of general-purpose algorithms for hybrid learning systems. Specifically, we consider settings where the discrete component(s), embedded in a larger computational graph, are discrete random variables from the constrained exponential family1. Grounded in concepts from Maximum Likelihood Estimation (MLE) and perturbation-based implicit differentiation, we propose Implicit Maximum Likelihood Estimation (I-MLE). To approximate the gradients of the discrete distributions’ parameters, I-MLE computes, at each update step, a target distribution $q$ that depends on the loss incurred from the discrete output in the forward pass. In the backward pass, we approximate maximum likelihood gradients by treating $q$ as the empirical distribution. We propose ways to derive target distributions and introduce a novel family of noise perturbations well-suited for approximating marginals via perturb-and-MAP. I-MLE is general-purpose as it only requires the ability to compute most probable states and not faithful samples or probabilistic inference. In summary, we make the following contributions:
20
+
21
+ 1. We propose implicit maximum likelihood estimation (I-MLE) as a framework for computing gradients with respect to the parameters of discrete exponential family distributions; 2. We show that this framework is useful for backpropagating gradients through both discrete probability distributions and discrete combinatorial optimization problems; 3. I-MLE requires two ingredients: a family of target distribution $q$ and a method to sample from complex discrete distributions. We propose two families of target distributions and a family of noise-distributions for Gumbel-max (perturb-and-MAP) based sampling. 4. We show that I-MLE simplifies to explicit maximum-likelihood learning when used in some recently studied learning settings involving combinatorial optimization solvers. 5. Extensive experimental results suggest that I-MLE is flexible and competitive compared to the straight-through and relaxation-based estimators.
22
+
23
+ Instances of the I-MLE framework can be easily integrated into modern deep learning pipelines, allowing one to readily utilize several types of discrete layers with minimal effort. We provide implementations and Python notebooks at https://github.com/nec-research/tf-imle
24
+
25
+ # 2 Problem Statement and Motivation
26
+
27
+ We consider models described by the equations
28
+
29
+ $$
30
+ \pmb \theta = h _ { v } ( \pmb x ) , \quad z \sim p ( z ; \pmb \theta ) , \quad \pmb y = f _ { \pmb u } ( z ) ,
31
+ $$
32
+
33
+ where $\mathbf { \boldsymbol { x } } \in \mathcal { X }$ and $\pmb { y } \in \mathcal { V }$ denote feature inputs and target outputs, $h _ { v } : \mathcal { X } \to \Theta$ and $f _ { u } : \mathcal { Z } \to \mathcal { V }$ are smooth parameterized maps, and $p ( z ; \pmb \theta )$ is a discrete probability distribution.
34
+
35
+ ![](images/eabd7667464ba4e46678b486e4a28c97dec1d9e003f2a0291f040bff469565d0.jpg)
36
+ Figure 1: Illustration of the addressed learning problem. $_ { z }$ is the discrete (latent) structure.
37
+
38
+ Given a set of examples $\boldsymbol { \mathcal { D } } ~ = ~ \{ ( \hat { \mathbf { x } } _ { j } , \hat { \mathbf { y } } _ { j } ) \} _ { j = 1 } ^ { N }$ , we are concerned with learning the parameters $\boldsymbol { \omega } = ( \pmb { v } , \pmb { u } )$ of (1) by finding approximate solutions of $\begin{array} { r } { \operatorname* { m i n } _ { \omega } \sum _ { j } L ( \hat { { \bf x } } _ { j } , \hat { { \bf y } } _ { j } ; \omega ) / N } \end{array}$ . The training error $L$ is typically defined as:
39
+
40
+ $$
41
+ L ( \hat { x } , \hat { y } ; \omega ) = \mathbb { E } _ { \hat { z } \sim p ( z ; \hat { \theta } ) } \left[ \ell ( f _ { u } ( \hat { z } ) , \hat { y } ) \right] \quad \mathrm { w i t h } \quad \hat { \theta } = h _ { v } ( \hat { x } ) ,
42
+ $$
43
+
44
+ where $\ell : \mathcal { V } \times \mathcal { V } \mathbb { R } ^ { + }$ is a point-wise loss function. Fig. 1 illustrates the setting. For example, an interesting instance of (1) and (2) arises in learning to explain user reviews [Chen et al., 2018] where the task is to infer a target sentiment score (e.g. w.r.t. the quality of a product) from a review while also providing a concise explanation of the predicted score by selecting a subset of exactly $k$ words (cf. Example 2). In Section 6, we present experiments precisely in this setting. As anticipated in the introduction, we restrict the discussion to instances in which $p ( z ; \pmb \theta )$ belongs to the (constrained) discrete exponential family, which we now formally introduce.
45
+
46
+ Let $z$ be a vector of discrete random variables over a state space $\mathcal { Z }$ and let $\mathcal { C } \subseteq \mathcal { Z }$ be the set of states that satisfy a given set of linear constraints.2 Let $\pmb { \theta } \in \Theta \subseteq \mathbb { R } ^ { m }$ be a real-valued parameter vector.
47
+
48
+ The probability mass function (PMF) of a discrete constrained exponential family r.v. is:
49
+
50
+ $$
51
+ p ( z ; \pmb { \theta } ) = \left\{ \begin{array} { l l } { \exp \big ( \langle z , \pmb { \theta } \rangle / \tau - A ( \pmb { \theta } ) \big ) } & { \mathrm { i f } z \in \mathcal { C } , } \\ { 0 } & { \mathrm { o t h e r w i s e } . } \end{array} \right.
52
+ $$
53
+
54
+ Here, $\langle \cdot , \cdot \rangle$ is the inner product and $\tau$ the temperature, which, if not mentioned otherwise, is assumed to be 1. $A ( \pmb \theta )$ is the log-partition function defined as $\begin{array} { r } { A ( \pmb { \theta } ) = \log \left( \sum _ { z \in \mathcal { C } } \exp \left( \langle z , \pmb { \theta } \rangle / \tau \right) \right) } \end{array}$ . We call $\langle z , \theta \rangle$ the weight of the state $_ z$ . The marginals (expected value, mean) of the r.v.s $\mathbf { Z }$ are defined as $\mu ( \pmb \theta ) : = \mathbb { E } _ { \hat { z } \sim p ( z ; \pmb \theta ) } [ \hat { z } ]$ . Finally, the most probable or Maximum A-Posteriori (MAP) states are defined as ${ \mathrm { M A P } } ( \pmb { \theta } ) : = \arg \operatorname* { m a x } _ { z \in \mathcal { C } } ~ \langle z , \pmb { \theta } \rangle$ . The family of probability distributions we define here captures a broad range of settings and subsumes probability distributions such as positive Markov random fields and statistical relational formalisms [Wainwright and Jordan, 2008, Raedt et al., 2016]. We now discuss some examples which we will use in the experiments. Crucially, in Example 3 we establish the link between the constrained exponential family and integer linear programming (ILP) identifying the ILP cost coefficients with the distribution’s parameters $\pmb \theta$ .
55
+
56
+ Example 1 (Categorical Variables). An m-way (one-hot) categorical variable corresponds to $p ( z ; \pmb { \theta } ) = \mathrm { e x p } \left( \langle z , \pmb { \theta } \rangle - A ( \pmb { \theta } ) \right)$ , subject to the constraint $\langle z , \mathbf { 1 } \rangle = 1$ , where 1 is a vector of ones.
57
+
58
+ As ${ \mathcal C } = \{ { \bf e } _ { i } \} _ { i = 1 } ^ { m }$ , where $\mathbf { e } _ { i }$ is the $i$ -th vector of the canonical base, the parameters of the above distribution coincide with the weights, which are often called logits in this context. The marginals $\pmb { \mu }$ coincide with the PMF and can be expressed through a closed-form smooth function of $\pmb \theta$ : the softmax. This facilitates a natural relaxation that involves using $\mu ( \theta )$ in place of $_ z$ [Jang et al., 2017]. The convenient properties of the categorical distribution, however, quickly disappear even for slightly more complex distributions, as the following example shows.
59
+
60
+ Example 2 $k$ -subset Selection). Assume we want to sample binary $m$ -dimensional vectors with $k$ ones. This amounts to replacing the constraint in Example 1 by the constraint $\langle z , \mathbf { 1 } \rangle = k$ .
61
+
62
+ Here, a closed-form expression for the marginals does not exist: sampling from this distribution requires computing the ${ \bf \dot { \rho } } ( { m } ) = O ( m ^ { k } )$ weights (if $k \leq m / 2$ ). Computing MAP states instead takes time linear in $m$ .
63
+
64
+ Example 3 (Integer Linear Programs). Consider the combinatorial optimization problem given by the integer linear program arg $\scriptstyle \operatorname* { m i n } _ { z \in { \mathcal { C } } } \langle z , c \rangle$ , where $\mathcal { C }$ is an integral polytope and $c \in \mathbb { R } ^ { m }$ is $a$ vector of cost coefficients, and let $z ^ { * } ( \bar { \boldsymbol { c } } )$ be the set of its solutions. We can associate to the ILP the family (indexed by $\tau > 0$ ) of probability distributions $p ( z ; \pmb \theta )$ from (3), with $\mathcal { C }$ the ILP polytope and $\pmb \theta = - \pmb \ c$ . Then, for every $\tau > 0$ , the solutions of the $I L P$ correspond to the MAP states: $\mathrm { M A P } ( \pmb { \theta } ) = \arg \operatorname* { m a x } _ { \pmb { z } \in \mathcal { C } } \langle \pmb { z } , \pmb { \theta } \rangle = \pmb { z } ^ { \ast } ( \pmb { c } )$ and for $\tau 0$ one has that $\operatorname* { P r } ( \mathbf { Z } \in z ^ { * } ( c ) ) 1$ .
65
+
66
+ Many problems of practical interest can be expressed as ILPs, such as finding shortest paths, planning and scheduling problems, and inference in propositional logic.
67
+
68
+ # 3 The Implicit Maximum Likelihood Estimator
69
+
70
+ In this section, we develop and motivate a family of general-purpose gradient estimators for Eq. (2) that respect the structure of $\mathcal { C }$ . 3 Let $( \hat { \pmb x } , \hat { \pmb y } ) \in \hat { \mathcal { D } }$ be a training example and $\hat { z } \sim p ( z ; h _ { v } ( \hat { { \pmb x } } ) )$ . The gradient of $L$ w.r.t. $\textbf { \em u }$ is given by $\nabla _ { u } L ( \hat { \pmb x } , \hat { \pmb y } ; \omega ) = \mathbb { E } _ { \hat { z } } [ \partial _ { u } f _ { \pmb u } ( \hat { z } ) ^ { \top } \nabla _ { \pmb y } \ell ( \pmb y , \hat { \pmb y } ) ]$ with $\pmb { y } = f _ { \pmb { u } } ( \hat { \pmb z } )$ , which may be estimated by drawing one or more samples from $p$ . Regarding $\nabla _ { v } L$ , one has
71
+
72
+ $$
73
+ \begin{array} { r } { \nabla _ { v } L ( \hat { x } , \hat { y } ; \omega ) = \partial _ { v } h _ { v } ( \hat { x } ) ^ { \intercal } \nabla _ { \theta } L ( \hat { x } , \hat { y } ; \omega ) , } \end{array}
74
+ $$
75
+
76
+ where the major challenge is to compute $\nabla _ { \boldsymbol { \theta } } L$ . A standard approach is to employ the score function estimator (SFE) which typically suffers from high variance. Whenever a pathwise derivative estimator (PDE) is available it is usually the preferred choice [Schulman et al., 2015]. In our setting, however, the PDE is not readily applicable since $_ { z }$ is discrete and, therefore, every (exact) reparameterization path would be discontinuous. Various authors developed (biased) adaptations of the PDE for discrete r.v.s (see Section 5). These involve either smooth approximations of $p ( z ; \pmb \theta )$ or approximations of the derivative of the reparameterization map. Our proposal departs from these two routes and instead involves the formulation of an implicit maximum likelihood estimation problem. In a nutshell, I-MLE is a (biased) estimator that replaces $\nabla _ { \boldsymbol { \theta } } L$ in Eq. (4) with $\hat { \nabla } _ { \boldsymbol { \theta } } \mathcal { L }$ , where $\mathcal { L }$ is an implicitly defined MLE objective and $\hat { \nabla }$ is an estimator of the gradient.
77
+
78
+ <table><tr><td colspan="2">Algorithm1 Instance of I-MLE with perturbation-based implicit differentiation.</td></tr><tr><td>function FORWARDPASS(0) Il Sample from the noise distribution p(e)</td><td>function BACKWARDPASS(Vzl(fu(z),y), λ) load 0,∈,and from the forward pass</td></tr><tr><td>∈~ ρ(∈) l/ Compute a MAP state of perturbed 0 = MAP(0+∈) save 0,∈,and z for the backward pass</td><td>/l Compute target distribution parameters 0&#x27;=θ-λ∀zl(fu(z),y) lSingle sampleI-MLE gradient estimate ∀θL(θ,θ&#x27;)= ≥-MAP(0&#x27;+∈)</td></tr></table>
79
+
80
+ We now focus on deriving the (implicit) MLE objective $\mathcal { L }$ . Let us assume we can, for any given $\hat { y }$ construct an exponential family distribution $q ( z ; \pmb \theta ^ { \prime } )$ that, ideally, is such that
81
+
82
+ $$
83
+ \begin{array} { r } { \mathbb { E } _ { \hat { z } \sim q ( z ; \theta ^ { \prime } ) } \left[ \ell \big ( f _ { u } \big ( \hat { z } \big ) , \hat { y } \big ) \right] \leq \mathbb { E } _ { \hat { z } \sim p ( z ; \theta ) } \left[ \ell \big ( f _ { u } \big ( \hat { z } \big ) , \hat { y } \big ) \right] . } \end{array}
84
+ $$
85
+
86
+ We will call $q$ the target distribution. The idea is that, by making $p$ more similar to $q$ we can (iteratively) reduce the model loss $L ( \hat { \mathbfcal x } , \hat { \pmb y } ; \omega )$ . To this purpose, we define $\mathcal { L }$ as the MLE objective4 between the model distribution $p$ with parameters $\pmb \theta$ and the target distribution $q$ with parameters $\pmb { \theta } ^ { \prime }$ :
87
+
88
+ $$
89
+ \mathcal { L } ( \pmb { \theta } , \pmb { \theta } ^ { \prime } ) : = - \mathbb { E } _ { \hat { z } \sim q ( z ; \pmb { \theta } ^ { \prime } ) } [ \log p ( \hat { z } ; \pmb { \theta } ) ] = \mathbb { E } _ { \hat { z } \sim q ( z ; \pmb { \theta } ^ { \prime } ) } [ A ( \pmb { \theta } ) - \langle \hat { z } , \pmb { \theta } \rangle ]
90
+ $$
91
+
92
+ Now, exploiting the fact that $\nabla _ { \pmb { \theta } } A ( \pmb { \theta } ) = \pmb { \mu } ( \pmb { \theta } )$ , we can compute the gradient of $\mathcal { L }$ as
93
+
94
+ $$
95
+ \nabla _ { \pmb { \theta } } \mathcal { L } ( \pmb { \theta } , \pmb { \theta } ^ { \prime } ) = \pmb { \mu } ( \pmb { \theta } ) - \mathbb { E } _ { \hat { z } \sim q ( z ; \pmb { \theta } ^ { \prime } ) } [ \hat { z } ] = \pmb { \mu } ( \pmb { \theta } ) - \pmb { \mu } ( \pmb { \theta } ^ { \prime } ) ,
96
+ $$
97
+
98
+ that is , the difference between the marginals of the current distribution $p$ and the marginals of the target distribution $q$ , also equivalent to the gradient of the KL divergence between $p$ and $q$ .
99
+
100
+ We will not use Eq. (7) directly, as computing the marginals is, in general, a #P-hard problem and scales poorly with the dimensionality $m$ . MAP states are typically less expensive to compute (e.g. see Example 2) and are often used directly to approximate ${ \bf \dot { \mu } } ( \pmb { \theta } ) ^ { \dot { 5 } }$ or to compute perturb-andMAP approximations, where $\mu ( \pmb \theta ) \approx \mathbb { E } _ { \epsilon \sim \rho ( \epsilon ) } \dot { \mathsf { M A P } } ( \bar { \pmb \theta } + \epsilon )$ where $\epsilon \sim \rho ( \epsilon )$ is an appropriate noise distribution with domain $\mathbb { R } ^ { m }$ . In this work we follow – and explore in more detail in Section $3 . 2 \textrm { - }$ the latter approach (also referred to as the Gumbel-max trick [cf. Papandreou and Yuille, 2011]), a strategy that retains most of the computational advantages of the pure MAP approximation but may be less crude. Henceforth, we only assume access to an algorithm to compute MAP states (such as a standard ILP solver in the case of Example 3) and rephrase Eq. (1) as
101
+
102
+ $$
103
+ \theta = h _ { \boldsymbol { v } } ( \boldsymbol { x } ) , \quad \boldsymbol { z } = \mathtt { M A P } ( \theta + \epsilon ) \mathrm { ~ w i t h ~ } \epsilon \sim p ( \epsilon ) , \quad \boldsymbol { y } = f _ { \boldsymbol { u } } ( \boldsymbol { z } ) .
104
+ $$
105
+
106
+ With Eq. (8) in place, the general expression for the I-MLE estimator is $\widehat { \nabla } _ { \boldsymbol { v } } L ( \boldsymbol { x } , \boldsymbol { y } ; \omega ) \ =$ $\partial _ { v } h _ { v } ( \hat { { \pmb x } } ) ^ { \top } \widehat { \nabla } _ { \theta } \mathcal { L } ( \pmb \theta , \pmb \theta ^ { \prime } )$ with $\pmb { \theta } = h _ { v } ( \hat { \pmb { x } } )$ where, for $S \in \mathbb { N } ^ { + }$ :
107
+
108
+ $$
109
+ \widehat { \nabla } _ { \theta } \mathcal { L } ( \theta , \theta ^ { \prime } ) = \frac { 1 } { S } \sum _ { i = 1 } ^ { S } [ \mathtt { M A P } ( \theta + \epsilon _ { i } ) - \mathtt { M A P } ( \theta ^ { \prime } + \epsilon _ { i } ) ] , \mathrm { ~ w i t h ~ } \epsilon _ { i } \sim \rho ( \epsilon ) \mathrm { ~ f o r ~ } i \in \{ 1 , \dots , S \} .
110
+ $$
111
+
112
+ If the states of both the distributions $p$ and $q$ are binary vectors, $\hat { \nabla } _ { \pmb { \theta } } \mathcal { L } ( \pmb { \theta } , \pmb { \theta } ^ { \prime } ) \in [ - 1 , 1 ] ^ { m }$ and when $S = 1 \widehat { \nabla } _ { \theta } \mathcal { L } ( \theta , \pmb { \theta } ^ { \prime } ) \in \{ - 1 , 0 , 1 \} ^ { m }$ . In the following, we discuss the problem of constructing families of target distributions $q$ . We will also analyze under what assumptions the inequality of Eq. (5) holds.
113
+
114
+ # 3.1 Target Distributions via Perturbation-based Implicit Differentiation
115
+
116
+ The efficacy of the I-MLE estimator hinges on a proper choice of $q$ , a hyperparameter of our framework. In this section we derive and motivate a class of general-purpose target distributions, rooted in perturbation-based implicit differentiation (PID):
117
+
118
+ $$
119
+ q ( z ; \theta ^ { \prime } ) = p ( z ; \theta - \lambda \nabla _ { z } \ell ( f _ { u } ( \overline { { z } } ) , \hat { y } ) ) \mathrm { ~ w i t h ~ } \overline { { z } } = \mathtt { M A P } ( \theta + \epsilon ) \mathrm { ~ a n d ~ } \epsilon \sim \rho ( \epsilon ) ,
120
+ $$
121
+
122
+ where $\pmb { \theta } = h _ { v } ( \hat { \pmb { x } } )$ , $( \hat { \pmb x } , \hat { \pmb y } ) \in \mathcal { D }$ is a data point, and $\lambda > 0$ is a hyperparameter that controls the perturbation intensity.
123
+
124
+ To motivate Eq. (10), consider the setting where the inputs to $f$ are the marginals of $p ( z ; \pmb \theta )$ (rather than discrete perturb-and-MAP samples as in Eq. (8)), that is, $\begin{array} { r } { \pmb { y } = f _ { \pmb { u } } ( \pmb { \mu } ( \pmb { \theta } ) ) } \end{array}$ with $\pmb { \theta } = h _ { v } ( \hat { \pmb { x } } )$ , and redefine the training error $L$ of Eq. (2) accordingly. A seminal result by Domke [2010] shows that, in this case, we can obtain $\nabla _ { \boldsymbol { \theta } } L$ by perturbation-based differentiation as:
125
+
126
+ $$
127
+ \nabla _ { \pmb \theta } L ( \hat { \pmb x } , \hat { \pmb y } ; \omega ) = \operatorname* { l i m } _ { \lambda 0 } \{ \frac { 1 } { \lambda } [ \pmb \mu ( \pmb \theta ) - \pmb \mu ( \pmb \theta - \lambda \nabla _ { \pmb \mu } L ( \hat { \pmb x } , \hat { \pmb y } ; \omega ) ) ] \} ,
128
+ $$
129
+
130
+ where $\nabla _ { \mu } L = \partial _ { \mu } f _ { u } ( \pmb { \mu } ) ^ { \intercal } \nabla _ { \pmb { y } } \ell ( \pmb { y } , \pmb { \hat { y } } )$ . The expression inside the limit may be interpreted as the gradient of an implicit MLE objective (see Eq. (7)) between the distribution $p$ with (current) parameters $\pmb { \theta }$ and $p$ with parameters perturbed in the negative direction of the downstream gradient $\nabla _ { \mu } L$ . Now, we can adapt (11) to our setting of Eq. (8) by resorting to the straight-through estimator (STE) assumption [Bengio et al., 2013]. Here, the STE assumption translates into reparameterizing $_ z$ as a function of $\pmb { \mu }$ and approximating $\partial _ { \mu } z \approx I$ . Then, $\nabla _ { \mu } \bar { L } = \partial _ { \mu } z ^ { \intercal } \nabla _ { z } L \approx \nabla _ { z } \bar { L }$ and we approximate Eq. (11) as:
131
+
132
+ $$
133
+ \nabla _ { \pmb { \theta } } L ( \hat { \pmb x } , \hat { \pmb y } ; \omega ) \approx \frac { 1 } { \lambda } \left[ \mu ( \pmb { \theta } ) - \mu \left( \pmb { \theta } - \lambda \nabla _ { z } L ( \hat { \pmb x } , \hat { \pmb y } ; \omega ) \right) \right] = \frac { 1 } { \lambda } \nabla _ { \pmb { \theta } } \mathcal { L } ( \pmb { \theta } , \pmb { \theta } - \lambda \nabla _ { z } L ( \hat { \pmb x } , \hat { \pmb y } ; \omega ) ) ,
134
+ $$
135
+
136
+ for some $\lambda > 0$ . From Eq. (12) we derive (10) by taking a single sample estimator of $\nabla _ { z } L$ (with perturb-and-MAP sampling) and by incorporating the constant $1 / \lambda$ into a global learning rate. IMLE with PID target distributions may be seen as a way to generalize the STE to more complex distributions. Instead of using the gradients $\nabla _ { z } L$ to backpropagate directly, I-MLE uses them to construct a target distribution $q$ . With that, it defines an implicit maximum likelihood objective, whose gradient (estimator) propagates the supervisory signal upstream, critically, taking the constraints into account. When using Eq. (10) with $\bar { \rho } ( \epsilon ) = \bar { \delta } _ { 0 } ( \bar { \epsilon } ) ^ { 6 }$ , the I-MLE estimator also recovers a recently proposed gradient estimation rule to differentiate through black-box combinatorial optimization problems [Poganciˇ c et al., 2019]. ´ I-MLE unifies existing gradient estimation rules in one framework. Algorithm 1 shows the pseudo-code of the algorithm implementing Eq. (9) for $S = 1$ , using the PID target distribution of Eq. (10). The simplicity of the code also demonstrates that instances of I-MLE can easily be implemented as a layer.
137
+
138
+ We will resume the discussion about target distributions in Section 4, where we analyze more closely the setup of Example 3. Next, we focus on the perturb-and-MAP strategies and derive a class of noise distributions that is particularly apt to the settings we consider in this work.
139
+
140
+ # 3.2 A Novel Family of Perturb-and-MAP Noise Distributions
141
+
142
+ When $p$ is a complex high-dimensional distribution, obtaining Monte Carlo estimates of the gradient in Eq. (7) requires approximate sampling. In this paper, we rely on perturbation-based sampling, also known as perturb and MAP [Papandreou and Yuille, 2011]. In this Section we propose a novel way to design tailored noise perturbations. While the proposed family of noise distributions works with I-MLE, the results of this section are of independent interest and can also be used in other (relaxed) perturb-and-MAP based gradient estimators [e.g. Paulus et al., 2020]. First, we start by revisiting a classic result by Papandreou and Yuille [2011] which theoretically motivates the perturb-and-MAP approach (also known as the Gumbel-max trick), which we generalize here to consider also the temperature parameter $\tau$ .
143
+
144
+ Proposition 1. Let $p ( z ; \pmb \theta )$ be a discrete exponential family distribution with integer polytope $\mathcal { C }$ and temperature $\tau$ , and let $\langle z , \theta \rangle$ be the unnormalized weight of each $z \in { \mathcal { C } }$ . Moreover, let $\tilde { \pmb { \theta } }$ be such that, for all $z \in { \mathcal { C } }$ , $\langle z , \tilde { \theta } \rangle = \langle z , \theta \rangle + \epsilon ( z )$ with each $\epsilon ( z )$ sampled i.i.d. from $\mathrm { G u m b e l } ( 0 , \tau )$ . Then we have that $\operatorname* { P r } ( \mathbb { M } \mathrm { A P } ( \tilde { \pmb { \theta } } ) = z ) = p ( z ; \pmb { \theta } )$ .
145
+
146
+ All proofs can be found in Appendix B. The proposition states that if we can perturb the weights $\langle z , \theta \rangle$ of each $z \in { \mathcal { C } }$ with independent $\mathrm { G u m b e l } ( 0 , \tau )$ noise, then obtaining MAP states from the perturbed model is equivalent to sampling from $p ( z ; \pmb \theta )$ at temperature7 $\tau$ . For complex exponential distributions, perturbing the weights $\langle z , \theta \rangle$ for each state $z \in { \mathcal { C } }$ is at least as expensive as computing the marginals exactly. Hence, one usually resorts to local perturbations of each $[ \pmb \theta ] _ { i }$ (the $i$ -th entry of the vector $\pmb \theta$ ) with Gumbel noise. Fortunately, we can prove that, for a large class of distributions, it is possible to design more suitable local perturbations. First, we show that, for any $\kappa \in \mathbb { N } ^ { + }$ , a Gumbel distribution can be written as a finite sum of $\kappa$ i.i.d. (implicitly defined) random variables.
147
+
148
+ Lemma 1. Let $X \sim \mathrm { G u m b e l } ( 0 , \tau )$ and let $\kappa \in \mathbb { N } ^ { + }$ . Define the Sum-of-Gamma distribution as
149
+
150
+ $$
151
+ \mathrm { S o G } ( \kappa , \tau , s ) : = \frac { \tau } { \kappa } \left\{ \sum _ { i = 1 } ^ { s } \left\{ \mathrm { G a m m a } ( 1 / \kappa , \kappa / i ) \right\} - \log ( s ) \right\} ,
152
+ $$
153
+
154
+ where $s \in \mathbb { N } ^ { + }$ and ${ \mathrm { G a m m a } } ( \alpha , \beta )$ is the Gamma distribution with shape $\alpha$ and scale $\beta$ , and let $\begin{array} { r } { \mathrm { S o G } ( \kappa , \tau ) : = \operatorname* { l i m } _ { s \to \infty } \mathrm { S o G } ( \kappa , \tau , s ) } \end{array}$ . Then we have that $\begin{array} { r } { X \sim \sum _ { j = 1 } ^ { \kappa } \epsilon _ { j } } \end{array}$ , with $\epsilon _ { j } \sim \mathrm { S o G } ( \kappa , \tau )$ .
155
+
156
+ Based on Lemma 1, we can show that for exponential family distributions where every $z \in { \mathcal { C } }$ has exactly $k$ non-zero entries we can design perturbations of $\langle z , \theta \rangle$ following a Gumbel distribution.
157
+
158
+ Theorem 1. Let $p ( z ; \pmb \theta )$ be a discrete exponential family distribution with integer polytope $\mathcal { C }$ and temperature $\tau$ . Assume that if $z \in { \mathcal { C } }$ then $\langle z , \mathbf { 1 } \rangle = k$ for some constant $k \in \mathbb { N } ^ { + }$ . Let $\tilde { \pmb { \theta } }$ be the perturbation obtained by $[ \tilde { \pmb { \theta } } ] _ { j } = [ \pmb { \theta } ] _ { j } + \epsilon _ { j }$ with $\epsilon _ { j } \sim \mathrm { S o G } ( k , \tau )$ from Eq. (13). Then, $\forall z \in { \mathcal { C } }$ we have that $\langle z , \tilde { \theta } \rangle = \langle z , \theta \rangle + \dot { \epsilon } ( z )$ , with $\epsilon ( z ) \sim \mathrm { G u m b e l } ( 0 , \tau )$ .
159
+
160
+ Many problems such as $k$ -subset selection, traveling salesman, spanning tree, and graph matching strictly satisfy the assumption of Theorem 1. We can, however, also apply the strategy in cases where the variance of $\langle \mathbf { Z } , \mathbf { 1 } \rangle$ is small (e.g. shortest weighted path). The Sum-of-Gamma perturbations provide a more fine-grained approach to noise perturbations. For $\tau = \kappa = 1$ , we obtain the standard Gumbel perturbations. In contrast to the standard Gumbel $( 0 , 1 )$ noise, the pro
161
+
162
+ ![](images/e0b58c90a6c30b14ce39e4e93af1d1b872b0db4b9e733cfa46a52fd2587d1609.jpg)
163
+ Figure 2: Histograms for 10k samples where each sample is (left) the sum of $5 ~ \epsilon _ { j } \sim \bar { \mathrm { G u m b e l } } ( 0 , 1 )$ or (right) the sum of $5 \epsilon _ { j } \sim \mathrm { S o G } ( 5 , 1 , 1 0 )$ .
164
+
165
+ posed local Sum-of-Gamma perturbations result in weights’ perturbations that follow the Gumbel distribution. Fig. 2 shows histograms of $1 0 \mathrm { k }$ samples, where each sample is either the sum of 5 samples from $\mathrm { G u m b e l } ( 0 , 1 )$ (the standard approach) or the sum of $k = 5$ samples from $\begin{array} { r } { \mathrm { S o G ( 5 , 1 , 1 0 ) } = \frac { 1 } { 5 } \sum _ { i = 1 } ^ { 1 0 } \{ \mathrm { G a m m a } ( 1 / 5 , 5 / i ) - \log ( 1 0 ) \} } \end{array}$ . While we still cannot sample faithfully from $p ( z ; \pmb \theta )$ as the perturbations are not independent, we can counteract the problem of partially dependent perturbations by increasing the temperature $\tau$ and, therefore, the variance of the noise distribution. We explore and verify the importance of tuning $\tau$ empirically. In the appendix, we also show that the infinite series from Lemma 1 can be well approximated by a finite sum using convergence results for the Euler-Mascheroni series [Mortici, 2010].
166
+
167
+ # 4 Target Distributions for Combinatorial Optimization Problems
168
+
169
+ In this section, we explore the setting where the discrete computational component arises from a combinatorial optimization (CO) problem, specifically an integer linear program (ILP). Many authors have recently considered the setup where the CO component occupies the last layer of the model defined by Eq. (1) (where $f _ { u }$ is the identity) and the supervision is available in terms of examples of either optimal solutions [e.g. Poganciˇ c et al., 2019] or optimal cost coefficients (conditioned on ´ the inputs) [e.g. Elmachtoub and Grigas, 2020]. We have seen in Example 3 that we can naturally associate to each ILP a probability distribution (see Eq. (3)) with $\pmb { \theta }$ given by the negative cost coefficients $^ c$ of the ILP and $\mathcal { C }$ the integral polytope. Letting $\tau 0$ is equivalent to taking the MAP in the forward pass. Furthermore, in Section 3.1 we showed that the I-MLE framework subsumes a recently propose method by Poganciˇ c et al. [2019]. Here, instead, we show that, for a certain choice ´ of the target distribution, I-MLE estimates the gradient of an explicit maximum likelihood learning loss $\mathcal { L }$ where the data distribution is ascribed to either (examples of) optimal solutions or optimal cost coefficients.
170
+
171
+ Let $q ( z ; \pmb \theta ^ { \prime } )$ be the distribution $p ( z ; \pmb \theta ^ { \prime } )$ , with parameters
172
+
173
+ $$
174
+ [ \pmb { \theta } ^ { \prime } ] _ { i } : = \left\{ \begin{array} { l l } { [ \pmb { \theta } ] _ { i } } & { \mathrm { ~ i f ~ } [ \nabla _ { z } L ] _ { i } = 0 } \\ { - [ \nabla _ { z } L ] _ { i } } & { \mathrm { ~ o t h e r w i s e . } } \end{array} \right.
175
+ $$
176
+
177
+ In the first CO setting, we observe training data $\mathcal { D } = \{ ( \hat { \pmb x } _ { j } , \hat { \pmb y } _ { j } ) \} _ { j = 1 } ^ { N }$ where $\hat { y } _ { j } \in \mathcal { C }$ and the loss $\ell$ measures a distance between a discrete $\hat { z } _ { j } \sim p ( z ; \pmb { \theta } _ { j } )$ with $\bar { \theta _ { j } } = h _ { v } ( \hat { \pmb x } )$ and a given optimal solution of the ILP $\hat { y } _ { j }$ . An example is the Hamming loss $\ell _ { H }$ [Poganciˇ c et al., 2019] defined as ´ $\ell _ { H } ( z , y ) = z \circ ( { \bf 1 } - \bar { y } ) + y \circ ( { \bf 1 } - z )$ , where $\circ$ denotes the Hadamard (or entry-wise) product.
178
+
179
+ Fact 1. If one uses $\ell _ { H }$ , then I-MLE with the target distribution of Eq. (14) and $\rho ( \epsilon ) = \delta _ { 0 }$ is equivalent to the perceptron-rule estimator of the MLE objective between $p ( z ; h _ { v } ( \hat { { \bf x } } _ { j } ) )$ and $\hat { y } _ { j }$ .
180
+
181
+ It follows that the method by Poganciˇ c et al. [2019] returns, for a large enough ´ $\lambda$ , the maximumlikelihood gradients (scaled by $1 / \lambda$ ) approximated by the perceptron rule. The proofs are given in Appendix B.
182
+
183
+ In the second CO setting, we observe training data $\mathcal D = \{ ( \hat { \pmb x } _ { j } , \hat { \pmb c } _ { j } ) \} _ { j = 1 } ^ { N }$ , where ${ \hat { \mathbf { c } } } _ { j }$ is the optimal cost conditioned on input $\hat { \mathbf { \Omega } } _ { \hat { \mathbf { \Omega } } } ^ { \hat { \mathbf { \Omega } } } ( \hat { \mathbf { \Omega } } _ { \hat { \mathbf { \Omega } } } ^ { \hat { \mathbf { \Omega } } } )$ . Here, various authors [e.g. Elmachtoub and Grigas, 2020, Mandi et al., 2020, Mandi and Guns, 2020] use as point-wise loss the regret $\ell _ { R } ( \pmb \theta , \pmb c ) = \pmb c ^ { \top } \left( \pmb z ( \pmb \theta ) - \hat { \pmb z } ^ { * } ( \pmb c ) \right)$ where $z ( \theta )$ is a state sampled from $p ( z ; \pmb \theta )$ (possibly with temperature $\tau 0$ , that is, a MAP state) and $\hat { z } ^ { \ast } ( \acute { c } ) \in z ^ { \ast } ( c )$ is an optimal state for $^ c$ .
184
+
185
+ Fact 2. If one uses $\ell _ { R }$ then I-MLE with the target distribution of Eq. (14) is equivalent to the perturb-and-MAP estimator of the MLE objective between $p ( z ; h _ { v } ( \hat { { \bf x } } _ { j } ) )$ and $p ( z ; - \hat { \pmb { c } } _ { j } )$ .
186
+
187
+ This last result also implies that when using the target distribution $q$ from (14) in conjunction with the regret, I-MLE performs maximum-likelihood learning minimizing the KL divergence between the current distribution and the distribution whose parameters are the optimal cost.
188
+
189
+ Moreover, both facts imply that, when sampling from the MAP states of the distribution $q$ defined by Eq. (14), we have that $\bar { \ell } ( \hat { \hat { z } } , \hat { y } ) = 0$ for $\hat { z } \in \mathsf { M A P } ( \theta ^ { \prime } )$ . Therefore, $\ell ( \hat { z } , \hat { y } ) = 0 \leq { \mathbb E } _ { \hat { z } \sim p ( z ; \pmb { \theta } ) } \left[ \ell ( ( \hat { z } , \hat { y } ) \right]$ meaning that the inequality of Eq. (5) is satisfied for $\tau 0$ .
190
+
191
+ # 5 Related Work
192
+
193
+ Several papers address the gradient estimation problem for discrete r.v.s, many resorting to relaxations. Maddison et al. [2017], Jang et al. [2017] propose the Gumbel-softmax distribution to relax categorical r.v.s; Paulus et al. [2020] study extensions to more complex probability distributions. The concrete distribution (the Gumbel-softmax distribution) is only directly applicable to categorical variables. For more complex distributions, one has to come up with tailor-made relaxations or use the straightthrough or score function estimators (see for instance Kim et al. [2016], Grover et al. [2019]). In our experiments, we compare with the Gumbel-softmax estimator in Figure 4 (left and right). We show that the $k$ -subset VAE trained with I-MLE achieves loss values that are similar to those of the categorical (1-subset) VAE trained with the Gumbel-softmax gradient estimator. Tucker et al. [2017], Grathwohl et al. [2018] develop parameterized control variates (the former was named REBAR) based on continuous relaxations for the score-function estimator. In contrast, we focus explicitly on problems where only discrete samples are used during training. Moreover, REBAR is tailored to categorical distributions. I-MLE is intended for models with complex distributions (e.g. those with with many constraints).
194
+
195
+ Approaches that do not rely on relaxations are specific to certain distributions [Bengio et al., 2013, Franceschi et al., 2019, Liu et al., 2019] or assume knowledge of $\mathcal { C }$ [Kool et al., 2020]. We provide a general-purpose framework that does not require access to the linear constraints and the corresponding integer polytope $\mathcal { C }$ . Experiments in the next section show that while I-MLE only requires a MAP solver, it is competitive and sometimes outperforms tailor-made relaxations. SparseMAP [Niculae et al., 2018] is an approach to structured prediction and latent variables, replacing the exponential distribution (specifically, the softmax) with a sparser distribution. Similar to our work, it only presupposes the availability of a MAP oracle. LP-SparseMAP [Niculae and Martins, 2020] is an extension that uses a relaxation of the optimization problem rather than a MAP solver. Sparsity can also be exploited for efficient marginal inference in latent variable models [Correia et al., 2020].
196
+
197
+ A series of works about differentiating through CO problems [Wilder et al., 2019, Elmachtoub and Grigas, 2020, Ferber et al., 2020, Mandi and Guns, 2020] relax ILPs by adding $L ^ { 1 }$ , $L ^ { 2 }$ or log-barrier regularization terms and differentiate through the KKT conditions deriving from the application of the cutting plane or the interior-point methods. These approaches are conceptually linked to techniques for differentiating through smooth programs [Amos and Kolter, 2017, Donti et al., 2017,
198
+
199
+ Agrawal et al., 2019, Chen et al., 2020, Domke, 2012, Franceschi et al., 2018] that arise not only in modelling but also in hyperparameter optimization and meta-learning. Poganciˇ c et al. [2019], ´ Rolínek et al. [2020], Berthet et al. [2020] propose methods that are not tied to a specific ILP solver. As we saw above, the former two, originally derived from a continuous interpolation argument, may be interpreted as special instantiations of I-MLE. The latter addresses the theory of perturbed optimizers and discusses perturb and MAP in the context of the Fenchel-Young loss. All the COrelated works assume that either optimal costs or solutions are given as training data, while I-MLE may be also applied in the absence of such supervision by making use of implicitly generated target distributions. Other authors focus on devising differentiable relaxations for specific CO problems such as SAT [Evans and Grefenstette, 2018] or MaxSAT [Wang et al., 2019]. Machine learning intersects with CO also in other contexts, e.g. in learning heuristics to improve the performances of CO solvers or differentiable models such as GNNs to “replace” them; see Bengio et al. [2020] and references therein.
200
+
201
+ Direct Loss Minimization [DLM, McAllester et al., 2010, Song et al., 2016] is also related to our work, but the assumption there is that examples of optimal states $\hat { z }$ are given. Lorberbom et al. [2019] extend the DLM framework to discrete VAEs using coupled perturbations. Their approach is tailored to VAEs and not general-purpose. Under a methodological viewpoint, I-MLE inherits from classical MLE [Wainwright and Jordan, 2008] and perturb-and-MAP [Papandreou and Yuille, 2011]. The theory of perturb-and-MAP was used to derive general-purpose upper bounds for log-partition functions [Hazan and Jaakkola, 2012, Shpakova and Bach, 2016].
202
+
203
+ # 6 Experiments
204
+
205
+ The set of experiments can be divided into three parts. First, we analyze and compare the behavior of I-MLE with (i) the score function and (ii) the straight-through estimator using a toy problem. Second, we explore the latent variable setting where both $h _ { v }$ and $f _ { u }$ in Eq. (1) are neural networks and the optimal structure is not available during training. Finally, we address the problem of differentiating through black-box combinatorial optimization problems, where we use the target distribution derived in Section 4. More experimental details for available in the appendix.
206
+
207
+ Synthetic Experiments. We conducted a series of experiments with a tractable 5-subset distribution (see Example 2) where $\mathbf { z } \in \{ 0 , 1 \} ^ { 1 0 }$ . We set the loss to $L ( \pmb \theta ) = \mathbb { E } _ { \hat { z } \sim p ( \mathbf { z } ; \pmb \theta ) } [ \| \hat { z } - \mathbf b \| ^ { 2 } ]$ , where $\mathbf { b }$ is a fixed vector sampled from $\mathcal { N } ( 0 , \bf { I } )$ . In Fig. 3 (Top), we plot optimization curves with means and standard deviations, comparing the proposed estimator with the straight-through (STE) and the score function (SFE) estimators. 8 For STE and I-MLE, we use Perturb-and-MAP (PaM) with Gumbel and $\operatorname { S o G } ( 1 , 5 , 1 0 )$ noise, respectively. The SFE uses faithful samples and exact marginals (which is feasible only when $m$ is very small) and converges much more slowly than the other methods, while the STE converges to worse solutions than those found using I-MLE. Fig. 3 (Bottom) shows the benefits of using SoG rather than Gumbel perturbations with I-MLE. While the best configurations for both are comparable, SoG noise achieves in average (over 100 runs) strictly better final values of $L$ for more than $5 0 \%$ of the tested configurations (varying $\lambda$ from Eq. (10) and the learning rate) and exhibit smaller variance (see Fig. 6). Additional details and results in Appendix C.1.
208
+
209
+ Learning to Explain. The BEERADVOCATE dataset [McAuley et al., 2012] consists of free-text reviews and ratings for 4 different aspects of beer: appearance, aroma, palate, and taste. Each sentence in the test set has annotations providing the words that best describe the various aspects. Following the experimental setup of recent work [Paulus et al., 2020], we address the problem introduced by the L2X paper [Chen et al., 2018] of learning a distribution over $k$ -subsets of words that best explain a given aspect rating. The complexity of the MAP problem for the $k$ -subset distribution is linear in $k$ . sThe training set has $8 0 \mathrm { k }$ reviews for the aspect APPEARANCE and 70k reviews for all other aspects. Since the original dataset [McAuley et al., 2012] did not provide separate validation and test sets, we compute 10 different evenly sized validation/test splits of the 10k held out set and compute mean and standard deviation over 10 models, each trained on one split. Subset precision was computed using a subset of 993 annotated reviews. We use pre-trained word embeddings from Lei et al. [2016]. Prior work used non-standard neural networks for which an implementation is not available [Paulus et al., 2020]. Instead, we used the neural network from the L2X paper with 4 convolutional and one dense layer. This neural network outputs the parameters $\pmb \theta$ of the distribution $p ( z ; \pmb \theta )$ over $k$ -hot binary latent masks with $k \in \{ 5 , 1 0 , 1 5 \}$ . We compare to relaxation-based baselines L2X [Chen et al., 2018] and SoftSub [Xie and Ermon, 2019]. We also compare the straight-through estimator (STE) with Sum-of-Gamma (SoG) perturbations. We used the standard hyperparameter settings of Chen et al. [2018] and choose the temperature parameter $t \in \{ 0 . 1 , 0 . 5 , \mathrm { i } . 0 , \bar { 2 } . 0 \}$ . For I-MLE we choose $\lambda \in { \overline { { \{ 1 0 ^ { 1 } , 1 0 ^ { 2 } , 1 0 ^ { 3 } \} } } }$ , while for both I-MLE and STE we choose $\tau \in \{ k , 2 k , 3 k \}$ based on the validation MSE. We used the standard Adam settings. We trained separate models for each aspect using MSE as point-wise loss $\ell$ .
210
+
211
+ ![](images/48f76f7e8f24241085c07798fd126bbd8e641743cdf4ba3d708da522f0e223be.jpg)
212
+ Figure 3: Top: Gradient-based optimization of $L$ with various estimators. Bottom: Mean difference of the final value of $L$ between I-MLE with SoG or Gumbel $\rho ( \epsilon )$ varying $\lambda$ and the learning rate (blue $=$ better SoG).
213
+
214
+ <table><tr><td rowspan="2">Method</td><td colspan="2">Test MSE</td><td colspan="2">Subset Precision</td></tr><tr><td>Mean</td><td>Std. Dev.</td><td>Mean</td><td> Std. Dev.</td></tr><tr><td colspan="5">k=10</td></tr><tr><td>L2X (t = 0.1)</td><td>6.68</td><td>1.08</td><td>26.65</td><td>9.39</td></tr><tr><td>SoftSub (t = 0.5)</td><td>2.67</td><td>0.14</td><td>44.44</td><td>2.27</td></tr><tr><td>STE(T = 30)</td><td>4.44</td><td>0.09</td><td>38.93</td><td>0.14</td></tr><tr><td>I-MLE MAP</td><td>4.08</td><td>0.91</td><td>14.55</td><td>0.04</td></tr><tr><td>I-MLEGumbel</td><td>2.68</td><td>0.10</td><td>39.28</td><td>2.62</td></tr><tr><td>I-MLE(τ = 30)</td><td>2.71</td><td>0.10</td><td>47.98</td><td>2.26</td></tr><tr><td colspan="5">k=5</td></tr><tr><td>L2X (t = 0.1)</td><td>5.75</td><td>0.30</td><td>33.63</td><td>6.91</td></tr><tr><td>SoftSub (t = 0.5)</td><td>2.57</td><td>0.12</td><td>54.06</td><td>6.29</td></tr><tr><td>I-MLE(T = 5)</td><td>2.62</td><td>0.05</td><td>54.76</td><td>2.50</td></tr><tr><td colspan="5">k =15</td></tr><tr><td>L2X (t = 0.1)</td><td>7.71</td><td>0.64</td><td>23.49</td><td>10.93</td></tr><tr><td>SoftSub (t = 0.5)</td><td>2.52</td><td>0.07</td><td>37.78</td><td>1.71</td></tr><tr><td>I-MLE(T = 30)</td><td>2.91</td><td>0.18</td><td>39.56</td><td>2.07</td></tr></table>
215
+
216
+ Table 1: Detailed results for the aspect AROMA. Test MSE and subset precision, both $\times 1 0 0$ , for $k \mathbf { \hat { \in } } \left\{ 5 , 1 0 , 1 5 \right\}$ .
217
+
218
+ Table 1 lists detailed results for the aspect AROMA. I-MLE’s MSE values are competitive with those of the best baseline, and its subset precision is significantly higher than all other methods (for $\tau = 3 0$ ). Using only MAP as the approximation of the marginals leads to poor results. This shows that using the tailored perturbations with tuned temperature is crucial to achieve state of the art results. The Sum-of-Gamma perturbation introduced in this paper outperforms the standard local Gumbel perturbations. More details and results can be found in the appendix.
219
+
220
+ Discrete Variational Auto-Encoder. We evaluate various perturbation strategies for a discrete $k$ -subset Variational Auto-Encoder (VAE) and compare them to the straight-through estimator (STE) and the Gumbel-softmax trick. The latent variables model a probability distribution over $k$ -subsets of (or top- $k$ assignments too) binary vectors of length 20. The special case of $k = 1$ is equivalent to a categorical variable with 20 categories. For $k > 1$ , we use I-MLE using the class of PID target distributions of Eq. (10) and compare various perturb-and-MAP noise sampling strategies. The experimental setup is similar to those used in prior work on the Gumbel softmax tricks [Jang et al., 2017]. The loss is the sum of the reconstruction losses (binary cross-entropy loss on output pixels) and the KL divergence between the marginals of the variables and the uniform distribution. The encoding and decoding functions of the VAE consist of three dense layers (encoding: $5 1 2 - 2 5 6 - 2 0 { \mathrm { x } } 2 0$ ; decoding: 256-512-784). We do not use temperature annealing. Using Eq. (9) with $S = 1$ , we use either $\mathrm { G u m b e l } ( 0 , 1 )$ perturbations (the standard approach)9 or Sum-of-Gamma (SoG) perturbations at a temperature of $\tau = 1 0$ . We run 100 epochs and record the loss on the test data. The difference in training time is negligible. Fig. 4 shows that using the SoG noise distribution is beneficial. The test loss using the SoG perturbations is lower despite the perturbations having higher variance and, therefore, samples of the model being more diverse. This shows that using perturbations of the weights that follow a proper Gumbel distribution is indeed beneficial. I-MLE significantly outperforms the
221
+
222
+ ![](images/baf320b362e8112a6ab5e186b2f2316b789ce54dfcc1d6006e125d5608329658.jpg)
223
+ Figure 4: Plots of the sum of the binary reconstruction loss and the KL divergence as a function of the number of epochs (lower is better). (Left) Discrete 10-subset VAE trained with I-MLE with $\lambda = 1 0$ (I-MLE). (Center) Discrete 10-subset VAE trained with the straight-through estimator (STE). (Right) Discrete 1-subset VAE using the Gumbel softmax trick (GSMT). The down-up-down artifact is due to temperature annealing. Sum-of-Gamma (SoG) perturbations have the lowest test loss for the 10-subset VAEs. For $\bar { \lambda } = 1 0$ and SoG perturbations, the test loss is similar to that of the categorical (1-subset) VAE trained with the Gumbel softmax trick.
224
+
225
+ STE, which does not work in this setting and is competitive with the Gumbel-Softmax trick for the 1-subset (categorical) distribution where marginals can be computed in closed form.
226
+
227
+ Differentiating through Combinatorial Solvers. In these experiments, proposed by Poganciˇ c´ et al. [2019], the training datasets consists of 10,000 examples of randomly generated images of terrain maps from the Warcraft II tile set [Guyomarch, 2017]. Each example has an underlying $K \times K$ grid whose cells represent terrains
228
+
229
+ Table 2: Results for the Warcraft shortest path task. Reported is the accuracy, i.e. percentage of paths with the optimal costs. Standard deviations are over five runs.
230
+
231
+ <table><tr><td>K</td><td>I-MLE (μ-μ)</td><td>I-MLE (M-M)</td><td>BB</td><td>DPO</td></tr><tr><td>12</td><td>97.2 ± 0.5</td><td>95.2± 0.3</td><td>95.2 ± 0.7</td><td>94.8 ± 0.3</td></tr><tr><td>18</td><td>95.8±0.7</td><td>94.4± 0.5</td><td>94.7 ± 0.4</td><td>92.3± 0.8</td></tr><tr><td>24</td><td>94.3 ± 1.0</td><td>93.2 ± 0.2</td><td>93.8 ± 0.3</td><td>91.5 ± 0.4</td></tr><tr><td>30</td><td>93.6 ± 0.4</td><td>93.7 ± 0.6</td><td>93.6 ± 0.5</td><td>91.5 ± 0.8</td></tr></table>
232
+
233
+ with a fixed cost. The shortest (minimum cost) path between the top-left and bottom-right cell in the grid is encoded as an indicator matrix and serves as the target output. An image of the terrain map is presented to a CNN, which produces a $K \times K$ matrix of vertex costs. These costs are then given to Dijkstra’s algorithm (the MAP solver) to compute the shortest path. We closely follow the evaluation protocol of Poganciˇ c et al. [2019]. We considered two instantiations of ´ I-MLE: one derived from Fact 1 (M-M in Table 2) using $\ell _ { H }$ and one derived from Fact 2 $( \pmb { \mu } \mathbf { - } \pmb { \mu } )$ using $\ell _ { R }$ , with $\rho ( \epsilon ) = \mathrm { S o G } ( k , 1 , 1 0 )$ where $k$ is the empirical mean of the path lengths (different for each grid size $K _ { \cdot }$ ). We compare with the method proposed by Poganciˇ c et al. [2019]´ $( \mathrm { B B } ^ { 1 0 } )$ and Berthet et al. [2020] (DPO). The results are listed in Table 2. I-MLE obtains results comparable to (BB) with M-M and is more accurate with $\pmb { \mu } \mathbf { - } \pmb { \mu }$ . We believe that the $\pmb { \mu } \mathbf { - } \pmb { \mu }$ advantage may be partially due to an implicit form of data augmentation since we know from Fact 2 that, by using I-MLE, we obtain samples from the distribution whose parameters are the optimal cost. Training dynamics, showing faster convergence of I-MLE $( \pmb { \mu } \mathbf { - } \pmb { \mu } )$ , and additional details are available in Table 4.
234
+
235
+ # 7 Conclusions
236
+
237
+ I-MLE is an efficient, simple-to-implement, and general-purpose framework for learning hybrid models. I-MLE is competitive with relaxation-based approaches for discrete latent-variable models and with approaches to backpropagate through CO solvers. Moreover, we showed empirically that I-MLE outperforms the straight-through estimator. A limitation of the work is its dependency on computing MAP states which is, in general, an NP-hard problem (although for many interesting cases there are efficient algorithms). Future work includes devising target distributions when $\nabla _ { z } L$ is not available, studying the properties (including the bias) of the proposed estimator, developing adaptive strategies for $\tau$ and $\lambda$ , and integrating and testing I-MLE in several challenging application domains.
238
+
239
+ # References
240
+
241
+ A. Agrawal, B. Amos, S. Barratt, S. Boyd, S. Diamond, and Z. Kolter. Differentiable convex optimization layers. arXiv preprint arXiv:1910.12430, 2019.
242
+ B. Amos and J. Z. Kolter. Optnet: Differentiable optimization as a layer in neural networks. In International Conference on Machine Learning, pages 136–145. PMLR, 2017.
243
+ Y. Bengio, N. Léonard, and A. Courville. Estimating or propagating gradients through stochastic neurons for conditional computation. arXiv preprint arXiv:1308.3432, 2013.
244
+ Y. Bengio, A. Lodi, and A. Prouvost. Machine learning for combinatorial optimization: a methodological tour d’horizon. European Journal of Operational Research, 2020.
245
+ Q. Berthet, M. Blondel, O. Teboul, M. Cuturi, J. Vert, and F. R. Bach. Learning with differentiable pertubed optimizers. In NeurIPS, 2020.
246
+ J. Chen, L. Song, M. Wainwright, and M. Jordan. Learning to explain: An information-theoretic perspective on model interpretation. In International Conference on Machine Learning, pages 883–892. PMLR, 2018.
247
+ X. Chen, Y. Zhang, C. Reisinger, and L. Song. Understanding deep architecture with reasoning layer. Advances in Neural Information Processing Systems, 33, 2020.
248
+ G. M. Correia, V. Niculae, W. Aziz, and A. F. Martins. Efficient marginalization of discrete and structured latent variables via sparsity. Advances in Neural Information Processing Systems, 2020.
249
+ J. Domke. Implicit differentiation by perturbation. In Advances in Neural Information Processing Systems 23, pages 523–531. 2010.
250
+ J. Domke. Generic methods for optimization-based modeling. In Artificial Intelligence and Statistics, pages 318–326. PMLR, 2012.
251
+ P. L. Donti, B. Amos, and J. Z. Kolter. Task-based end-to-end model learning in stochastic optimization. Advances in Neural Information Processing Systems, 2017.
252
+ A. N. Elmachtoub and P. Grigas. Smart “predict, then optimize", 2020.
253
+ R. Evans and E. Grefenstette. Learning explanatory rules from noisy data. Journal of Artificial Intelligence Research, 61:1–64, 2018.
254
+ A. Ferber, B. Wilder, B. Dilkina, and M. Tambe. Mipaal: Mixed integer program as a layer. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pages 1504–1511, 2020.
255
+ L. Franceschi, P. Frasconi, S. Salzo, R. Grazzi, and M. Pontil. Bilevel programming for hyperparameter optimization and meta-learning. In International Conference on Machine Learning, pages 1568–1577. PMLR, 2018.
256
+ L. Franceschi, M. Niepert, M. Pontil, and X. He. Learning discrete structures for graph neural networks. In International conference on machine learning, pages 1972–1982. PMLR, 2019.
257
+ W. Grathwohl, D. Choi, Y. Wu, G. Roeder, and D. Duvenaud. Backpropagation through the void: Optimizing control variates for black-box gradient estimation. ICLR, 2018.
258
+ A. Grover, E. Wang, A. Zweig, and S. Ermon. Stochastic optimization of sorting networks via continuous relaxations. arXiv preprint arXiv:1903.08850, 2019.
259
+ J. Guyomarch. Warcraft II Open-Source Map Editor. http://github.com/war2/war2edit, 2017.
260
+ D. Hafner, T. Lillicrap, M. Norouzi, and J. Ba. Mastering atari with discrete world models. arXiv preprint arXiv:2010.02193, 2020.
261
+ T. Hazan and T. Jaakkola. On the partition function and random maximum a-posteriori perturbations. In Proceedings of the 29th International Coference on International Conference on Machine Learning, pages 1667–1674, 2012.
262
+ K. He, X. Zhang, S. Ren, and J. Sun. Deep residual learning for image recognition. In CVPR, pages 770–778. IEEE Computer Society, 2016.
263
+ E. Jang, S. Gu, and B. Poole. Categorical reparameterization with gumbel-softmax. ICLR, 2017.
264
+ N. L. Johnson and N. Balakrishnan. Advances in the theory and practice of statistics, 1998.
265
+ C. Kim, A. Sabharwal, and S. Ermon. Exact sampling with integer linear programs and random perturbations. In Thirtieth AAAI Conference on Artificial Intelligence, 2016.
266
+ W. Kool, H. van Hoof, and M. Welling. Estimating gradients for discrete random variables by sampling without replacement. ICLR, 2020.
267
+ Y. LeCun, S. Chopra, R. Hadsell, M. Ranzato, and F. Huang. A tutorial on energy-based learning. Predicting structured data, 1(0), 2006.
268
+ T. Lei, R. Barzilay, and T. Jaakkola. Rationalizing neural predictions. In EMNLP, 2016.
269
+ R. Liu, J. Regier, N. Tripuraneni, M. Jordan, and J. Mcauliffe. Rao-blackwellized stochastic gradients for discrete distributions. In International Conference on Machine Learning, pages 4023–4031. PMLR, 2019.
270
+ G. Lorberbom, A. Gane, T. Jaakkola, and T. Hazan. Direct optimization through argmax for discrete variational auto-encoder. In Advances in Neural Information Processing Systems, pages 6203–6214, 2019.
271
+ C. J. Maddison, A. Mnih, and Y. W. Teh. The concrete distribution: A continuous relaxation of discrete random variables. ICLR, 2017.
272
+ J. Mandi and T. Guns. Interior point solving for lp-based prediction+optimisation. In Advances in Neural Information Processing Systems, 2020.
273
+ J. Mandi, E. Demirovic, P. J. Stuckey, and T. Guns. Smart predict-and-optimize for hard combina- ´ torial optimization problems. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pages 1603–1610, 2020.
274
+ D. A. McAllester, T. Hazan, and J. Keshet. Direct loss minimization for structured prediction. In Advances in Neural Information Processing Systems, volume 1, page 3, 2010.
275
+ J. McAuley, J. Leskovec, and D. Jurafsky. Learning attitudes and attributes from multi-aspect reviews. 2012 IEEE 12th International Conference on Data Mining, pages 1020–1025, 2012.
276
+ V. V. Mišic and G. Perakis. Data analytics in operations management: A review. ´ Manufacturing & Service Operations Management, 22(1):158–169, 2020.
277
+ C. Mortici. Fast convergences towards Euler-Mascheroni constant. Computational & Applied Mathematics, 29, 00 2010.
278
+ K. P. Murphy. Machine learning: a probabilistic perspective. MIT press, 2012.
279
+ V. Niculae and A. F. T. Martins. Lp-sparsemap: Differentiable relaxed optimization for sparse structured prediction. In ICML, 2020.
280
+ V. Niculae, A. F. T. Martins, M. Blondel, and C. Cardie. Sparsemap: Differentiable sparse structured inference. In ICML, 2018.
281
+ G. Papandreou and A. L. Yuille. Perturb-and-map random fields: Using discrete optimization to learn and sample from energy models. In 2011 International Conference on Computer Vision, pages 193–200, 2011.
282
+ M. B. Paulus, D. Choi, D. Tarlow, A. Krause, and C. J. Maddison. Gradient estimation with stochastic softmax tricks. arXiv preprint arXiv:2006.08063, 2020.
283
+ M. V. Poganciˇ c, A. Paulus, V. Musil, G. Martius, and M. Rolinek. Differentiation of blackbox ´ combinatorial solvers. In International Conference on Learning Representations, 2019.
284
+ L. D. Raedt, K. Kersting, S. Natarajan, and D. Poole. Statistical relational artificial intelligence: Logic, probability, and computation. Synthesis Lectures on Artificial Intelligence and Machine Learning, 10(2):1–189, 2016.
285
+ M. Rolínek, P. Swoboda, D. Zietlow, A. Paulus, V. Musil, and G. Martius. Deep graph matching via blackbox differentiation of combinatorial solvers. In ECCV, 2020.
286
+ J. Schulman, N. Heess, T. Weber, and P. Abbeel. Gradient estimation using stochastic computation graphs. In Proceedings of the 28th International Conference on Neural Information Processing Systems-Volume 2, pages 3528–3536, 2015.
287
+ T. Shpakova and F. Bach. Parameter learning for log-supermodular distributions. In Advances in Neural Information Processing Systems, volume 29, pages 3234–3242, 2016.
288
+ Y. Song, A. Schwing, R. Urtasun, et al. Training deep neural networks via direct loss minimization. In International Conference on Machine Learning, pages 2169–2177, 2016.
289
+ G. Tucker, A. Mnih, C. J. Maddison, D. Lawson, and J. Sohl-Dickstein. Rebar: Low-variance, unbiased gradient estimates for discrete latent variable models. Advances in Neural Information Processing Systems, 2017.
290
+ M. J. Wainwright and M. I. Jordan. Graphical models, exponential families, and variational inference. Now Publishers Inc, 2008.
291
+ P.-W. Wang, P. Donti, B. Wilder, and Z. Kolter. Satnet: Bridging deep learning and logical reasoning using a differentiable satisfiability solver. In International Conference on Machine Learning, pages 6545–6554. PMLR, 2019.
292
+ B. Wilder, B. Dilkina, and M. Tambe. Melding the data-decisions pipeline: Decision-focused learning for combinatorial optimization. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 33, pages 1658–1665, 2019.
293
+ Xi’an. Which pdf of x leads to a gumbel distribution of the finite-size average of $\mathbf { \boldsymbol { x } } \mathrm { ? }$ Cross Validated, 2016. URL https://stats.stackexchange.com/q/214875. URL:https://stats.stackexchange.com/q/214875 (version: 2016-05-27).
294
+ S. M. Xie and S. Ermon. Reparameterizable subset sampling via continuous relaxations. In IJCAI, 2019.
parse/train/lR4aaWCQgB/lR4aaWCQgB_content_list.json ADDED
@@ -0,0 +1,1259 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "type": "text",
4
+ "text": "Implicit MLE: Backpropagating Through Discrete Exponential Family Distributions ",
5
+ "text_level": 1,
6
+ "bbox": [
7
+ 192,
8
+ 122,
9
+ 805,
10
+ 172
11
+ ],
12
+ "page_idx": 0
13
+ },
14
+ {
15
+ "type": "text",
16
+ "text": "Mathias Niepert NEC Laboratories Europe mathias.niepert@neclab.eu ",
17
+ "bbox": [
18
+ 184,
19
+ 227,
20
+ 400,
21
+ 267
22
+ ],
23
+ "page_idx": 0
24
+ },
25
+ {
26
+ "type": "text",
27
+ "text": "Pasquale Minervini University College London p.minervini@ucl.ac.uk ",
28
+ "bbox": [
29
+ 418,
30
+ 226,
31
+ 599,
32
+ 267
33
+ ],
34
+ "page_idx": 0
35
+ },
36
+ {
37
+ "type": "text",
38
+ "text": "Luca Franceschi Istituto Italiano di Tecnologia University College London ucablfr@ucl.ac.uk ",
39
+ "bbox": [
40
+ 617,
41
+ 227,
42
+ 813,
43
+ 281
44
+ ],
45
+ "page_idx": 0
46
+ },
47
+ {
48
+ "type": "text",
49
+ "text": "Abstract ",
50
+ "text_level": 1,
51
+ "bbox": [
52
+ 462,
53
+ 299,
54
+ 535,
55
+ 315
56
+ ],
57
+ "page_idx": 0
58
+ },
59
+ {
60
+ "type": "text",
61
+ "text": "Combining discrete probability distributions and combinatorial optimization problems with neural network components has numerous applications but poses several challenges. We propose Implicit Maximum Likelihood Estimation (I-MLE), a framework for end-to-end learning of models combining discrete exponential family distributions and differentiable neural components. I-MLE is widely applicable as it only requires the ability to compute the most probable states and does not rely on smooth relaxations. The framework encompasses several approaches such as perturbation-based implicit differentiation and recent methods to differentiate through black-box combinatorial solvers. We introduce a novel class of noise distributions for approximating marginals via perturb-and-MAP. Moreover, we show that I-MLE simplifies to maximum likelihood estimation when used in some recently studied learning settings that involve combinatorial solvers. Experiments on several datasets suggest that I-MLE is competitive with and often outperforms existing approaches which rely on problem-specific relaxations. ",
62
+ "bbox": [
63
+ 233,
64
+ 333,
65
+ 766,
66
+ 526
67
+ ],
68
+ "page_idx": 0
69
+ },
70
+ {
71
+ "type": "text",
72
+ "text": "1 Introduction ",
73
+ "text_level": 1,
74
+ "bbox": [
75
+ 174,
76
+ 555,
77
+ 310,
78
+ 573
79
+ ],
80
+ "page_idx": 0
81
+ },
82
+ {
83
+ "type": "text",
84
+ "text": "While deep neural networks excel at perceptual tasks, they tend to generalize poorly whenever the problem at hand requires some level of symbolic manipulation or reasoning, or exhibit some (known) algorithmic structure. Logic, relations, and explanations, as well as decision processes, frequently find natural abstractions in discrete structures, ill-captured by the continuous mappings of standard neural nets. Several application domains, ranging from relational and explainable ML to discrete decision-making [Mišic and Perakis, 2020], could benefit from general-purpose learning algorithms ´ whose inductive biases are more amenable to integrating symbolic and neural computation. Motivated by these considerations, there is a growing interest in end-to-end learnable models incorporating discrete components that allow, e.g., to sample from discrete latent distributions [Jang et al., 2017, Paulus et al., 2020] or solve combinatorial optimization problems [Poganciˇ c et al., 2019, Mandi et al., ´ 2020]. Discrete energy-based models (EBMs) [LeCun et al., 2006] and discrete world models [Hafner et al., 2020] are additional examples of neural network based models that require the ability to backpropagate through discrete probability distributions. ",
85
+ "bbox": [
86
+ 174,
87
+ 588,
88
+ 825,
89
+ 767
90
+ ],
91
+ "page_idx": 0
92
+ },
93
+ {
94
+ "type": "text",
95
+ "text": "For complex discrete distributions, it is intractable to compute the exact gradients of the expected loss. For combinatorial optimization problems, the loss is discontinuous, and the gradients are zero almost everywhere. The standard approach revolves around problem-specific smooth relaxations, which allow one to fall back to (stochastic) backpropagation. These strategies, however, require tailor-made relaxations, presuppose access to the constraints and are, therefore, not always feasible nor tractable for large state spaces. Moreover, reverting to discrete outputs at test time may cause unexpected behavior. In other situations, discrete outputs are required at training time because one has to make one of a number of discrete choices, such as accessing discrete memory or deciding on an action in a game. ",
96
+ "bbox": [
97
+ 174,
98
+ 773,
99
+ 825,
100
+ 898
101
+ ],
102
+ "page_idx": 0
103
+ },
104
+ {
105
+ "type": "text",
106
+ "text": "With this paper, we take a step towards the vision of general-purpose algorithms for hybrid learning systems. Specifically, we consider settings where the discrete component(s), embedded in a larger computational graph, are discrete random variables from the constrained exponential family1. Grounded in concepts from Maximum Likelihood Estimation (MLE) and perturbation-based implicit differentiation, we propose Implicit Maximum Likelihood Estimation (I-MLE). To approximate the gradients of the discrete distributions’ parameters, I-MLE computes, at each update step, a target distribution $q$ that depends on the loss incurred from the discrete output in the forward pass. In the backward pass, we approximate maximum likelihood gradients by treating $q$ as the empirical distribution. We propose ways to derive target distributions and introduce a novel family of noise perturbations well-suited for approximating marginals via perturb-and-MAP. I-MLE is general-purpose as it only requires the ability to compute most probable states and not faithful samples or probabilistic inference. In summary, we make the following contributions: ",
107
+ "bbox": [
108
+ 173,
109
+ 90,
110
+ 826,
111
+ 257
112
+ ],
113
+ "page_idx": 1
114
+ },
115
+ {
116
+ "type": "text",
117
+ "text": "1. We propose implicit maximum likelihood estimation (I-MLE) as a framework for computing gradients with respect to the parameters of discrete exponential family distributions; 2. We show that this framework is useful for backpropagating gradients through both discrete probability distributions and discrete combinatorial optimization problems; 3. I-MLE requires two ingredients: a family of target distribution $q$ and a method to sample from complex discrete distributions. We propose two families of target distributions and a family of noise-distributions for Gumbel-max (perturb-and-MAP) based sampling. 4. We show that I-MLE simplifies to explicit maximum-likelihood learning when used in some recently studied learning settings involving combinatorial optimization solvers. 5. Extensive experimental results suggest that I-MLE is flexible and competitive compared to the straight-through and relaxation-based estimators. ",
118
+ "bbox": [
119
+ 210,
120
+ 268,
121
+ 825,
122
+ 439
123
+ ],
124
+ "page_idx": 1
125
+ },
126
+ {
127
+ "type": "text",
128
+ "text": "Instances of the I-MLE framework can be easily integrated into modern deep learning pipelines, allowing one to readily utilize several types of discrete layers with minimal effort. We provide implementations and Python notebooks at https://github.com/nec-research/tf-imle ",
129
+ "bbox": [
130
+ 176,
131
+ 452,
132
+ 826,
133
+ 493
134
+ ],
135
+ "page_idx": 1
136
+ },
137
+ {
138
+ "type": "text",
139
+ "text": "2 Problem Statement and Motivation ",
140
+ "text_level": 1,
141
+ "bbox": [
142
+ 173,
143
+ 512,
144
+ 500,
145
+ 530
146
+ ],
147
+ "page_idx": 1
148
+ },
149
+ {
150
+ "type": "text",
151
+ "text": "We consider models described by the equations ",
152
+ "bbox": [
153
+ 174,
154
+ 542,
155
+ 485,
156
+ 558
157
+ ],
158
+ "page_idx": 1
159
+ },
160
+ {
161
+ "type": "equation",
162
+ "img_path": "images/a596e22c05dd8383175e9f5db56ce73160e86ddd1fa2f4883fc1b7b4eb63aab9.jpg",
163
+ "text": "$$\n\\pmb \\theta = h _ { v } ( \\pmb x ) , \\quad z \\sim p ( z ; \\pmb \\theta ) , \\quad \\pmb y = f _ { \\pmb u } ( z ) ,\n$$",
164
+ "text_format": "latex",
165
+ "bbox": [
166
+ 186,
167
+ 564,
168
+ 465,
169
+ 580
170
+ ],
171
+ "page_idx": 1
172
+ },
173
+ {
174
+ "type": "text",
175
+ "text": "where $\\mathbf { \\boldsymbol { x } } \\in \\mathcal { X }$ and $\\pmb { y } \\in \\mathcal { V }$ denote feature inputs and target outputs, $h _ { v } : \\mathcal { X } \\to \\Theta$ and $f _ { u } : \\mathcal { Z } \\to \\mathcal { V }$ are smooth parameterized maps, and $p ( z ; \\pmb \\theta )$ is a discrete probability distribution. ",
176
+ "bbox": [
177
+ 173,
178
+ 587,
179
+ 498,
180
+ 642
181
+ ],
182
+ "page_idx": 1
183
+ },
184
+ {
185
+ "type": "image",
186
+ "img_path": "images/eabd7667464ba4e46678b486e4a28c97dec1d9e003f2a0291f040bff469565d0.jpg",
187
+ "image_caption": [
188
+ "Figure 1: Illustration of the addressed learning problem. $_ { z }$ is the discrete (latent) structure. "
189
+ ],
190
+ "image_footnote": [],
191
+ "bbox": [
192
+ 511,
193
+ 536,
194
+ 820,
195
+ 603
196
+ ],
197
+ "page_idx": 1
198
+ },
199
+ {
200
+ "type": "text",
201
+ "text": "Given a set of examples $\\boldsymbol { \\mathcal { D } } ~ = ~ \\{ ( \\hat { \\mathbf { x } } _ { j } , \\hat { \\mathbf { y } } _ { j } ) \\} _ { j = 1 } ^ { N }$ , we are concerned with learning the parameters $\\boldsymbol { \\omega } = ( \\pmb { v } , \\pmb { u } )$ of (1) by finding approximate solutions of $\\begin{array} { r } { \\operatorname* { m i n } _ { \\omega } \\sum _ { j } L ( \\hat { { \\bf x } } _ { j } , \\hat { { \\bf y } } _ { j } ; \\omega ) / N } \\end{array}$ . The training error $L$ is typically defined as: ",
202
+ "bbox": [
203
+ 173,
204
+ 647,
205
+ 825,
206
+ 694
207
+ ],
208
+ "page_idx": 1
209
+ },
210
+ {
211
+ "type": "equation",
212
+ "img_path": "images/5c340512839b414141eef08edc9cb07951e96f98ade65cdece9c93a0689f49f6.jpg",
213
+ "text": "$$\nL ( \\hat { x } , \\hat { y } ; \\omega ) = \\mathbb { E } _ { \\hat { z } \\sim p ( z ; \\hat { \\theta } ) } \\left[ \\ell ( f _ { u } ( \\hat { z } ) , \\hat { y } ) \\right] \\quad \\mathrm { w i t h } \\quad \\hat { \\theta } = h _ { v } ( \\hat { x } ) ,\n$$",
214
+ "text_format": "latex",
215
+ "bbox": [
216
+ 300,
217
+ 700,
218
+ 694,
219
+ 723
220
+ ],
221
+ "page_idx": 1
222
+ },
223
+ {
224
+ "type": "text",
225
+ "text": "where $\\ell : \\mathcal { V } \\times \\mathcal { V } \\mathbb { R } ^ { + }$ is a point-wise loss function. Fig. 1 illustrates the setting. For example, an interesting instance of (1) and (2) arises in learning to explain user reviews [Chen et al., 2018] where the task is to infer a target sentiment score (e.g. w.r.t. the quality of a product) from a review while also providing a concise explanation of the predicted score by selecting a subset of exactly $k$ words (cf. Example 2). In Section 6, we present experiments precisely in this setting. As anticipated in the introduction, we restrict the discussion to instances in which $p ( z ; \\pmb \\theta )$ belongs to the (constrained) discrete exponential family, which we now formally introduce. ",
226
+ "bbox": [
227
+ 173,
228
+ 728,
229
+ 825,
230
+ 827
231
+ ],
232
+ "page_idx": 1
233
+ },
234
+ {
235
+ "type": "text",
236
+ "text": "Let $z$ be a vector of discrete random variables over a state space $\\mathcal { Z }$ and let $\\mathcal { C } \\subseteq \\mathcal { Z }$ be the set of states that satisfy a given set of linear constraints.2 Let $\\pmb { \\theta } \\in \\Theta \\subseteq \\mathbb { R } ^ { m }$ be a real-valued parameter vector. ",
237
+ "bbox": [
238
+ 174,
239
+ 833,
240
+ 823,
241
+ 862
242
+ ],
243
+ "page_idx": 1
244
+ },
245
+ {
246
+ "type": "text",
247
+ "text": "The probability mass function (PMF) of a discrete constrained exponential family r.v. is: ",
248
+ "bbox": [
249
+ 169,
250
+ 90,
251
+ 753,
252
+ 106
253
+ ],
254
+ "page_idx": 2
255
+ },
256
+ {
257
+ "type": "equation",
258
+ "img_path": "images/685c351e6860299339dfbaa84b637f23dc4f3432d43d4aae4056613e8a65373d.jpg",
259
+ "text": "$$\np ( z ; \\pmb { \\theta } ) = \\left\\{ \\begin{array} { l l } { \\exp \\big ( \\langle z , \\pmb { \\theta } \\rangle / \\tau - A ( \\pmb { \\theta } ) \\big ) } & { \\mathrm { i f } z \\in \\mathcal { C } , } \\\\ { 0 } & { \\mathrm { o t h e r w i s e } . } \\end{array} \\right.\n$$",
260
+ "text_format": "latex",
261
+ "bbox": [
262
+ 328,
263
+ 112,
264
+ 655,
265
+ 147
266
+ ],
267
+ "page_idx": 2
268
+ },
269
+ {
270
+ "type": "text",
271
+ "text": "Here, $\\langle \\cdot , \\cdot \\rangle$ is the inner product and $\\tau$ the temperature, which, if not mentioned otherwise, is assumed to be 1. $A ( \\pmb \\theta )$ is the log-partition function defined as $\\begin{array} { r } { A ( \\pmb { \\theta } ) = \\log \\left( \\sum _ { z \\in \\mathcal { C } } \\exp \\left( \\langle z , \\pmb { \\theta } \\rangle / \\tau \\right) \\right) } \\end{array}$ . We call $\\langle z , \\theta \\rangle$ the weight of the state $_ z$ . The marginals (expected value, mean) of the r.v.s $\\mathbf { Z }$ are defined as $\\mu ( \\pmb \\theta ) : = \\mathbb { E } _ { \\hat { z } \\sim p ( z ; \\pmb \\theta ) } [ \\hat { z } ]$ . Finally, the most probable or Maximum A-Posteriori (MAP) states are defined as ${ \\mathrm { M A P } } ( \\pmb { \\theta } ) : = \\arg \\operatorname* { m a x } _ { z \\in \\mathcal { C } } ~ \\langle z , \\pmb { \\theta } \\rangle$ . The family of probability distributions we define here captures a broad range of settings and subsumes probability distributions such as positive Markov random fields and statistical relational formalisms [Wainwright and Jordan, 2008, Raedt et al., 2016]. We now discuss some examples which we will use in the experiments. Crucially, in Example 3 we establish the link between the constrained exponential family and integer linear programming (ILP) identifying the ILP cost coefficients with the distribution’s parameters $\\pmb \\theta$ . ",
272
+ "bbox": [
273
+ 173,
274
+ 154,
275
+ 825,
276
+ 296
277
+ ],
278
+ "page_idx": 2
279
+ },
280
+ {
281
+ "type": "text",
282
+ "text": "Example 1 (Categorical Variables). An m-way (one-hot) categorical variable corresponds to $p ( z ; \\pmb { \\theta } ) = \\mathrm { e x p } \\left( \\langle z , \\pmb { \\theta } \\rangle - A ( \\pmb { \\theta } ) \\right)$ , subject to the constraint $\\langle z , \\mathbf { 1 } \\rangle = 1$ , where 1 is a vector of ones. ",
283
+ "bbox": [
284
+ 171,
285
+ 301,
286
+ 823,
287
+ 330
288
+ ],
289
+ "page_idx": 2
290
+ },
291
+ {
292
+ "type": "text",
293
+ "text": "As ${ \\mathcal C } = \\{ { \\bf e } _ { i } \\} _ { i = 1 } ^ { m }$ , where $\\mathbf { e } _ { i }$ is the $i$ -th vector of the canonical base, the parameters of the above distribution coincide with the weights, which are often called logits in this context. The marginals $\\pmb { \\mu }$ coincide with the PMF and can be expressed through a closed-form smooth function of $\\pmb \\theta$ : the softmax. This facilitates a natural relaxation that involves using $\\mu ( \\theta )$ in place of $_ z$ [Jang et al., 2017]. The convenient properties of the categorical distribution, however, quickly disappear even for slightly more complex distributions, as the following example shows. ",
294
+ "bbox": [
295
+ 173,
296
+ 340,
297
+ 825,
298
+ 424
299
+ ],
300
+ "page_idx": 2
301
+ },
302
+ {
303
+ "type": "text",
304
+ "text": "Example 2 $k$ -subset Selection). Assume we want to sample binary $m$ -dimensional vectors with $k$ ones. This amounts to replacing the constraint in Example 1 by the constraint $\\langle z , \\mathbf { 1 } \\rangle = k$ . ",
305
+ "bbox": [
306
+ 173,
307
+ 429,
308
+ 823,
309
+ 457
310
+ ],
311
+ "page_idx": 2
312
+ },
313
+ {
314
+ "type": "text",
315
+ "text": "Here, a closed-form expression for the marginals does not exist: sampling from this distribution requires computing the ${ \\bf \\dot { \\rho } } ( { m } ) = O ( m ^ { k } )$ weights (if $k \\leq m / 2$ ). Computing MAP states instead takes time linear in $m$ . ",
316
+ "bbox": [
317
+ 173,
318
+ 468,
319
+ 825,
320
+ 511
321
+ ],
322
+ "page_idx": 2
323
+ },
324
+ {
325
+ "type": "text",
326
+ "text": "Example 3 (Integer Linear Programs). Consider the combinatorial optimization problem given by the integer linear program arg $\\scriptstyle \\operatorname* { m i n } _ { z \\in { \\mathcal { C } } } \\langle z , c \\rangle$ , where $\\mathcal { C }$ is an integral polytope and $c \\in \\mathbb { R } ^ { m }$ is $a$ vector of cost coefficients, and let $z ^ { * } ( \\bar { \\boldsymbol { c } } )$ be the set of its solutions. We can associate to the ILP the family (indexed by $\\tau > 0$ ) of probability distributions $p ( z ; \\pmb \\theta )$ from (3), with $\\mathcal { C }$ the ILP polytope and $\\pmb \\theta = - \\pmb \\ c$ . Then, for every $\\tau > 0$ , the solutions of the $I L P$ correspond to the MAP states: $\\mathrm { M A P } ( \\pmb { \\theta } ) = \\arg \\operatorname* { m a x } _ { \\pmb { z } \\in \\mathcal { C } } \\langle \\pmb { z } , \\pmb { \\theta } \\rangle = \\pmb { z } ^ { \\ast } ( \\pmb { c } )$ and for $\\tau 0$ one has that $\\operatorname* { P r } ( \\mathbf { Z } \\in z ^ { * } ( c ) ) 1$ . ",
327
+ "bbox": [
328
+ 173,
329
+ 515,
330
+ 825,
331
+ 599
332
+ ],
333
+ "page_idx": 2
334
+ },
335
+ {
336
+ "type": "text",
337
+ "text": "Many problems of practical interest can be expressed as ILPs, such as finding shortest paths, planning and scheduling problems, and inference in propositional logic. ",
338
+ "bbox": [
339
+ 173,
340
+ 609,
341
+ 825,
342
+ 638
343
+ ],
344
+ "page_idx": 2
345
+ },
346
+ {
347
+ "type": "text",
348
+ "text": "3 The Implicit Maximum Likelihood Estimator ",
349
+ "text_level": 1,
350
+ "bbox": [
351
+ 173,
352
+ 656,
353
+ 584,
354
+ 675
355
+ ],
356
+ "page_idx": 2
357
+ },
358
+ {
359
+ "type": "text",
360
+ "text": "In this section, we develop and motivate a family of general-purpose gradient estimators for Eq. (2) that respect the structure of $\\mathcal { C }$ . 3 Let $( \\hat { \\pmb x } , \\hat { \\pmb y } ) \\in \\hat { \\mathcal { D } }$ be a training example and $\\hat { z } \\sim p ( z ; h _ { v } ( \\hat { { \\pmb x } } ) )$ . The gradient of $L$ w.r.t. $\\textbf { \\em u }$ is given by $\\nabla _ { u } L ( \\hat { \\pmb x } , \\hat { \\pmb y } ; \\omega ) = \\mathbb { E } _ { \\hat { z } } [ \\partial _ { u } f _ { \\pmb u } ( \\hat { z } ) ^ { \\top } \\nabla _ { \\pmb y } \\ell ( \\pmb y , \\hat { \\pmb y } ) ]$ with $\\pmb { y } = f _ { \\pmb { u } } ( \\hat { \\pmb z } )$ , which may be estimated by drawing one or more samples from $p$ . Regarding $\\nabla _ { v } L$ , one has ",
361
+ "bbox": [
362
+ 173,
363
+ 689,
364
+ 825,
365
+ 746
366
+ ],
367
+ "page_idx": 2
368
+ },
369
+ {
370
+ "type": "equation",
371
+ "img_path": "images/8040b12f7edfbca84eec6ba390478956f0ff348ba8b48175a9a56622a00dd85e.jpg",
372
+ "text": "$$\n\\begin{array} { r } { \\nabla _ { v } L ( \\hat { x } , \\hat { y } ; \\omega ) = \\partial _ { v } h _ { v } ( \\hat { x } ) ^ { \\intercal } \\nabla _ { \\theta } L ( \\hat { x } , \\hat { y } ; \\omega ) , } \\end{array}\n$$",
373
+ "text_format": "latex",
374
+ "bbox": [
375
+ 356,
376
+ 752,
377
+ 640,
378
+ 768
379
+ ],
380
+ "page_idx": 2
381
+ },
382
+ {
383
+ "type": "text",
384
+ "text": "where the major challenge is to compute $\\nabla _ { \\boldsymbol { \\theta } } L$ . A standard approach is to employ the score function estimator (SFE) which typically suffers from high variance. Whenever a pathwise derivative estimator (PDE) is available it is usually the preferred choice [Schulman et al., 2015]. In our setting, however, the PDE is not readily applicable since $_ { z }$ is discrete and, therefore, every (exact) reparameterization path would be discontinuous. Various authors developed (biased) adaptations of the PDE for discrete r.v.s (see Section 5). These involve either smooth approximations of $p ( z ; \\pmb \\theta )$ or approximations of the derivative of the reparameterization map. Our proposal departs from these two routes and instead involves the formulation of an implicit maximum likelihood estimation problem. In a nutshell, I-MLE is a (biased) estimator that replaces $\\nabla _ { \\boldsymbol { \\theta } } L$ in Eq. (4) with $\\hat { \\nabla } _ { \\boldsymbol { \\theta } } \\mathcal { L }$ , where $\\mathcal { L }$ is an implicitly defined MLE objective and $\\hat { \\nabla }$ is an estimator of the gradient. ",
385
+ "bbox": [
386
+ 173,
387
+ 775,
388
+ 826,
389
+ 887
390
+ ],
391
+ "page_idx": 2
392
+ },
393
+ {
394
+ "type": "table",
395
+ "img_path": "images/e5838011e3e53ef47719fd3e441e4b577119fbaef748e8d79c7b4d5cdabbb385.jpg",
396
+ "table_caption": [],
397
+ "table_footnote": [],
398
+ "table_body": "<table><tr><td colspan=\"2\">Algorithm1 Instance of I-MLE with perturbation-based implicit differentiation.</td></tr><tr><td>function FORWARDPASS(0) Il Sample from the noise distribution p(e)</td><td>function BACKWARDPASS(Vzl(fu(z),y), λ) load 0,∈,and from the forward pass</td></tr><tr><td>∈~ ρ(∈) l/ Compute a MAP state of perturbed 0 = MAP(0+∈) save 0,∈,and z for the backward pass</td><td>/l Compute target distribution parameters 0&#x27;=θ-λ∀zl(fu(z),y) lSingle sampleI-MLE gradient estimate ∀θL(θ,θ&#x27;)= ≥-MAP(0&#x27;+∈)</td></tr></table>",
399
+ "bbox": [
400
+ 173,
401
+ 90,
402
+ 826,
403
+ 219
404
+ ],
405
+ "page_idx": 3
406
+ },
407
+ {
408
+ "type": "text",
409
+ "text": "",
410
+ "bbox": [
411
+ 174,
412
+ 241,
413
+ 823,
414
+ 273
415
+ ],
416
+ "page_idx": 3
417
+ },
418
+ {
419
+ "type": "text",
420
+ "text": "We now focus on deriving the (implicit) MLE objective $\\mathcal { L }$ . Let us assume we can, for any given $\\hat { y }$ construct an exponential family distribution $q ( z ; \\pmb \\theta ^ { \\prime } )$ that, ideally, is such that ",
421
+ "bbox": [
422
+ 173,
423
+ 280,
424
+ 823,
425
+ 309
426
+ ],
427
+ "page_idx": 3
428
+ },
429
+ {
430
+ "type": "equation",
431
+ "img_path": "images/ad43e9276ac4d4cd24051563c3e98bcb58045f62d18c00d93a7e77fe302bd890.jpg",
432
+ "text": "$$\n\\begin{array} { r } { \\mathbb { E } _ { \\hat { z } \\sim q ( z ; \\theta ^ { \\prime } ) } \\left[ \\ell \\big ( f _ { u } \\big ( \\hat { z } \\big ) , \\hat { y } \\big ) \\right] \\leq \\mathbb { E } _ { \\hat { z } \\sim p ( z ; \\theta ) } \\left[ \\ell \\big ( f _ { u } \\big ( \\hat { z } \\big ) , \\hat { y } \\big ) \\right] . } \\end{array}\n$$",
433
+ "text_format": "latex",
434
+ "bbox": [
435
+ 325,
436
+ 313,
437
+ 671,
438
+ 332
439
+ ],
440
+ "page_idx": 3
441
+ },
442
+ {
443
+ "type": "text",
444
+ "text": "We will call $q$ the target distribution. The idea is that, by making $p$ more similar to $q$ we can (iteratively) reduce the model loss $L ( \\hat { \\mathbfcal x } , \\hat { \\pmb y } ; \\omega )$ . To this purpose, we define $\\mathcal { L }$ as the MLE objective4 between the model distribution $p$ with parameters $\\pmb \\theta$ and the target distribution $q$ with parameters $\\pmb { \\theta } ^ { \\prime }$ : ",
445
+ "bbox": [
446
+ 173,
447
+ 334,
448
+ 825,
449
+ 376
450
+ ],
451
+ "page_idx": 3
452
+ },
453
+ {
454
+ "type": "equation",
455
+ "img_path": "images/24b8afad6fb3175188787761f78883b108cdb975198c71216c5962ad137961a2.jpg",
456
+ "text": "$$\n\\mathcal { L } ( \\pmb { \\theta } , \\pmb { \\theta } ^ { \\prime } ) : = - \\mathbb { E } _ { \\hat { z } \\sim q ( z ; \\pmb { \\theta } ^ { \\prime } ) } [ \\log p ( \\hat { z } ; \\pmb { \\theta } ) ] = \\mathbb { E } _ { \\hat { z } \\sim q ( z ; \\pmb { \\theta } ^ { \\prime } ) } [ A ( \\pmb { \\theta } ) - \\langle \\hat { z } , \\pmb { \\theta } \\rangle ]\n$$",
457
+ "text_format": "latex",
458
+ "bbox": [
459
+ 279,
460
+ 381,
461
+ 720,
462
+ 398
463
+ ],
464
+ "page_idx": 3
465
+ },
466
+ {
467
+ "type": "text",
468
+ "text": "Now, exploiting the fact that $\\nabla _ { \\pmb { \\theta } } A ( \\pmb { \\theta } ) = \\pmb { \\mu } ( \\pmb { \\theta } )$ , we can compute the gradient of $\\mathcal { L }$ as ",
469
+ "bbox": [
470
+ 174,
471
+ 410,
472
+ 723,
473
+ 425
474
+ ],
475
+ "page_idx": 3
476
+ },
477
+ {
478
+ "type": "equation",
479
+ "img_path": "images/3632fd7a242249617122564161950923aefd56f2d8120eb71bac40dc2eb13314.jpg",
480
+ "text": "$$\n\\nabla _ { \\pmb { \\theta } } \\mathcal { L } ( \\pmb { \\theta } , \\pmb { \\theta } ^ { \\prime } ) = \\pmb { \\mu } ( \\pmb { \\theta } ) - \\mathbb { E } _ { \\hat { z } \\sim q ( z ; \\pmb { \\theta } ^ { \\prime } ) } [ \\hat { z } ] = \\pmb { \\mu } ( \\pmb { \\theta } ) - \\pmb { \\mu } ( \\pmb { \\theta } ^ { \\prime } ) ,\n$$",
481
+ "text_format": "latex",
482
+ "bbox": [
483
+ 318,
484
+ 429,
485
+ 679,
486
+ 448
487
+ ],
488
+ "page_idx": 3
489
+ },
490
+ {
491
+ "type": "text",
492
+ "text": "that is , the difference between the marginals of the current distribution $p$ and the marginals of the target distribution $q$ , also equivalent to the gradient of the KL divergence between $p$ and $q$ . ",
493
+ "bbox": [
494
+ 176,
495
+ 450,
496
+ 820,
497
+ 479
498
+ ],
499
+ "page_idx": 3
500
+ },
501
+ {
502
+ "type": "text",
503
+ "text": "We will not use Eq. (7) directly, as computing the marginals is, in general, a #P-hard problem and scales poorly with the dimensionality $m$ . MAP states are typically less expensive to compute (e.g. see Example 2) and are often used directly to approximate ${ \\bf \\dot { \\mu } } ( \\pmb { \\theta } ) ^ { \\dot { 5 } }$ or to compute perturb-andMAP approximations, where $\\mu ( \\pmb \\theta ) \\approx \\mathbb { E } _ { \\epsilon \\sim \\rho ( \\epsilon ) } \\dot { \\mathsf { M A P } } ( \\bar { \\pmb \\theta } + \\epsilon )$ where $\\epsilon \\sim \\rho ( \\epsilon )$ is an appropriate noise distribution with domain $\\mathbb { R } ^ { m }$ . In this work we follow – and explore in more detail in Section $3 . 2 \\textrm { - }$ the latter approach (also referred to as the Gumbel-max trick [cf. Papandreou and Yuille, 2011]), a strategy that retains most of the computational advantages of the pure MAP approximation but may be less crude. Henceforth, we only assume access to an algorithm to compute MAP states (such as a standard ILP solver in the case of Example 3) and rephrase Eq. (1) as ",
504
+ "bbox": [
505
+ 173,
506
+ 484,
507
+ 826,
508
+ 611
509
+ ],
510
+ "page_idx": 3
511
+ },
512
+ {
513
+ "type": "equation",
514
+ "img_path": "images/9e701a970248d939404f1dc4f4509913a64aaeb3db7e37770af855bd72fd9aca.jpg",
515
+ "text": "$$\n\\theta = h _ { \\boldsymbol { v } } ( \\boldsymbol { x } ) , \\quad \\boldsymbol { z } = \\mathtt { M A P } ( \\theta + \\epsilon ) \\mathrm { ~ w i t h ~ } \\epsilon \\sim p ( \\epsilon ) , \\quad \\boldsymbol { y } = f _ { \\boldsymbol { u } } ( \\boldsymbol { z } ) .\n$$",
516
+ "text_format": "latex",
517
+ "bbox": [
518
+ 297,
519
+ 614,
520
+ 700,
521
+ 632
522
+ ],
523
+ "page_idx": 3
524
+ },
525
+ {
526
+ "type": "text",
527
+ "text": "With Eq. (8) in place, the general expression for the I-MLE estimator is $\\widehat { \\nabla } _ { \\boldsymbol { v } } L ( \\boldsymbol { x } , \\boldsymbol { y } ; \\omega ) \\ =$ $\\partial _ { v } h _ { v } ( \\hat { { \\pmb x } } ) ^ { \\top } \\widehat { \\nabla } _ { \\theta } \\mathcal { L } ( \\pmb \\theta , \\pmb \\theta ^ { \\prime } )$ with $\\pmb { \\theta } = h _ { v } ( \\hat { \\pmb { x } } )$ where, for $S \\in \\mathbb { N } ^ { + }$ : ",
528
+ "bbox": [
529
+ 173,
530
+ 638,
531
+ 823,
532
+ 671
533
+ ],
534
+ "page_idx": 3
535
+ },
536
+ {
537
+ "type": "equation",
538
+ "img_path": "images/c2b7485d311bca6c460295f1823330b7dc490c0ec6d5ec73483da3efe8030174.jpg",
539
+ "text": "$$\n\\widehat { \\nabla } _ { \\theta } \\mathcal { L } ( \\theta , \\theta ^ { \\prime } ) = \\frac { 1 } { S } \\sum _ { i = 1 } ^ { S } [ \\mathtt { M A P } ( \\theta + \\epsilon _ { i } ) - \\mathtt { M A P } ( \\theta ^ { \\prime } + \\epsilon _ { i } ) ] , \\mathrm { ~ w i t h ~ } \\epsilon _ { i } \\sim \\rho ( \\epsilon ) \\mathrm { ~ f o r ~ } i \\in \\{ 1 , \\dots , S \\} .\n$$",
540
+ "text_format": "latex",
541
+ "bbox": [
542
+ 199,
543
+ 675,
544
+ 779,
545
+ 718
546
+ ],
547
+ "page_idx": 3
548
+ },
549
+ {
550
+ "type": "text",
551
+ "text": "If the states of both the distributions $p$ and $q$ are binary vectors, $\\hat { \\nabla } _ { \\pmb { \\theta } } \\mathcal { L } ( \\pmb { \\theta } , \\pmb { \\theta } ^ { \\prime } ) \\in [ - 1 , 1 ] ^ { m }$ and when $S = 1 \\widehat { \\nabla } _ { \\theta } \\mathcal { L } ( \\theta , \\pmb { \\theta } ^ { \\prime } ) \\in \\{ - 1 , 0 , 1 \\} ^ { m }$ . In the following, we discuss the problem of constructing families of target distributions $q$ . We will also analyze under what assumptions the inequality of Eq. (5) holds. ",
552
+ "bbox": [
553
+ 173,
554
+ 724,
555
+ 826,
556
+ 772
557
+ ],
558
+ "page_idx": 3
559
+ },
560
+ {
561
+ "type": "text",
562
+ "text": "3.1 Target Distributions via Perturbation-based Implicit Differentiation ",
563
+ "text_level": 1,
564
+ "bbox": [
565
+ 173,
566
+ 786,
567
+ 686,
568
+ 803
569
+ ],
570
+ "page_idx": 3
571
+ },
572
+ {
573
+ "type": "text",
574
+ "text": "The efficacy of the I-MLE estimator hinges on a proper choice of $q$ , a hyperparameter of our framework. In this section we derive and motivate a class of general-purpose target distributions, rooted in perturbation-based implicit differentiation (PID): ",
575
+ "bbox": [
576
+ 174,
577
+ 811,
578
+ 825,
579
+ 854
580
+ ],
581
+ "page_idx": 3
582
+ },
583
+ {
584
+ "type": "equation",
585
+ "img_path": "images/84a486d995123cf8216a4c5874f94955aff2a26e3ed48c7f5d752726fe4ff5cc.jpg",
586
+ "text": "$$\nq ( z ; \\theta ^ { \\prime } ) = p ( z ; \\theta - \\lambda \\nabla _ { z } \\ell ( f _ { u } ( \\overline { { z } } ) , \\hat { y } ) ) \\mathrm { ~ w i t h ~ } \\overline { { z } } = \\mathtt { M A P } ( \\theta + \\epsilon ) \\mathrm { ~ a n d ~ } \\epsilon \\sim \\rho ( \\epsilon ) ,\n$$",
587
+ "text_format": "latex",
588
+ "bbox": [
589
+ 250,
590
+ 858,
591
+ 745,
592
+ 876
593
+ ],
594
+ "page_idx": 3
595
+ },
596
+ {
597
+ "type": "text",
598
+ "text": "where $\\pmb { \\theta } = h _ { v } ( \\hat { \\pmb { x } } )$ , $( \\hat { \\pmb x } , \\hat { \\pmb y } ) \\in \\mathcal { D }$ is a data point, and $\\lambda > 0$ is a hyperparameter that controls the perturbation intensity. ",
599
+ "bbox": [
600
+ 171,
601
+ 90,
602
+ 823,
603
+ 119
604
+ ],
605
+ "page_idx": 4
606
+ },
607
+ {
608
+ "type": "text",
609
+ "text": "To motivate Eq. (10), consider the setting where the inputs to $f$ are the marginals of $p ( z ; \\pmb \\theta )$ (rather than discrete perturb-and-MAP samples as in Eq. (8)), that is, $\\begin{array} { r } { \\pmb { y } = f _ { \\pmb { u } } ( \\pmb { \\mu } ( \\pmb { \\theta } ) ) } \\end{array}$ with $\\pmb { \\theta } = h _ { v } ( \\hat { \\pmb { x } } )$ , and redefine the training error $L$ of Eq. (2) accordingly. A seminal result by Domke [2010] shows that, in this case, we can obtain $\\nabla _ { \\boldsymbol { \\theta } } L$ by perturbation-based differentiation as: ",
610
+ "bbox": [
611
+ 173,
612
+ 126,
613
+ 825,
614
+ 181
615
+ ],
616
+ "page_idx": 4
617
+ },
618
+ {
619
+ "type": "equation",
620
+ "img_path": "images/1660ef81a7c80bb652d57b937f74032294261b4a21de1b5eeafc9a900fc355e6.jpg",
621
+ "text": "$$\n\\nabla _ { \\pmb \\theta } L ( \\hat { \\pmb x } , \\hat { \\pmb y } ; \\omega ) = \\operatorname* { l i m } _ { \\lambda 0 } \\{ \\frac { 1 } { \\lambda } [ \\pmb \\mu ( \\pmb \\theta ) - \\pmb \\mu ( \\pmb \\theta - \\lambda \\nabla _ { \\pmb \\mu } L ( \\hat { \\pmb x } , \\hat { \\pmb y } ; \\omega ) ) ] \\} ,\n$$",
622
+ "text_format": "latex",
623
+ "bbox": [
624
+ 287,
625
+ 186,
626
+ 707,
627
+ 222
628
+ ],
629
+ "page_idx": 4
630
+ },
631
+ {
632
+ "type": "text",
633
+ "text": "where $\\nabla _ { \\mu } L = \\partial _ { \\mu } f _ { u } ( \\pmb { \\mu } ) ^ { \\intercal } \\nabla _ { \\pmb { y } } \\ell ( \\pmb { y } , \\pmb { \\hat { y } } )$ . The expression inside the limit may be interpreted as the gradient of an implicit MLE objective (see Eq. (7)) between the distribution $p$ with (current) parameters $\\pmb { \\theta }$ and $p$ with parameters perturbed in the negative direction of the downstream gradient $\\nabla _ { \\mu } L$ . Now, we can adapt (11) to our setting of Eq. (8) by resorting to the straight-through estimator (STE) assumption [Bengio et al., 2013]. Here, the STE assumption translates into reparameterizing $_ z$ as a function of $\\pmb { \\mu }$ and approximating $\\partial _ { \\mu } z \\approx I$ . Then, $\\nabla _ { \\mu } \\bar { L } = \\partial _ { \\mu } z ^ { \\intercal } \\nabla _ { z } L \\approx \\nabla _ { z } \\bar { L }$ and we approximate Eq. (11) as: ",
634
+ "bbox": [
635
+ 173,
636
+ 224,
637
+ 826,
638
+ 324
639
+ ],
640
+ "page_idx": 4
641
+ },
642
+ {
643
+ "type": "equation",
644
+ "img_path": "images/03349e2a1b2593ac3bc5b751f220be5989e0ad44218303db5fa2d7eb1a1cbfd5.jpg",
645
+ "text": "$$\n\\nabla _ { \\pmb { \\theta } } L ( \\hat { \\pmb x } , \\hat { \\pmb y } ; \\omega ) \\approx \\frac { 1 } { \\lambda } \\left[ \\mu ( \\pmb { \\theta } ) - \\mu \\left( \\pmb { \\theta } - \\lambda \\nabla _ { z } L ( \\hat { \\pmb x } , \\hat { \\pmb y } ; \\omega ) \\right) \\right] = \\frac { 1 } { \\lambda } \\nabla _ { \\pmb { \\theta } } \\mathcal { L } ( \\pmb { \\theta } , \\pmb { \\theta } - \\lambda \\nabla _ { z } L ( \\hat { \\pmb x } , \\hat { \\pmb y } ; \\omega ) ) ,\n$$",
646
+ "text_format": "latex",
647
+ "bbox": [
648
+ 187,
649
+ 328,
650
+ 781,
651
+ 358
652
+ ],
653
+ "page_idx": 4
654
+ },
655
+ {
656
+ "type": "text",
657
+ "text": "for some $\\lambda > 0$ . From Eq. (12) we derive (10) by taking a single sample estimator of $\\nabla _ { z } L$ (with perturb-and-MAP sampling) and by incorporating the constant $1 / \\lambda$ into a global learning rate. IMLE with PID target distributions may be seen as a way to generalize the STE to more complex distributions. Instead of using the gradients $\\nabla _ { z } L$ to backpropagate directly, I-MLE uses them to construct a target distribution $q$ . With that, it defines an implicit maximum likelihood objective, whose gradient (estimator) propagates the supervisory signal upstream, critically, taking the constraints into account. When using Eq. (10) with $\\bar { \\rho } ( \\epsilon ) = \\bar { \\delta } _ { 0 } ( \\bar { \\epsilon } ) ^ { 6 }$ , the I-MLE estimator also recovers a recently proposed gradient estimation rule to differentiate through black-box combinatorial optimization problems [Poganciˇ c et al., 2019]. ´ I-MLE unifies existing gradient estimation rules in one framework. Algorithm 1 shows the pseudo-code of the algorithm implementing Eq. (9) for $S = 1$ , using the PID target distribution of Eq. (10). The simplicity of the code also demonstrates that instances of I-MLE can easily be implemented as a layer. ",
658
+ "bbox": [
659
+ 173,
660
+ 361,
661
+ 825,
662
+ 529
663
+ ],
664
+ "page_idx": 4
665
+ },
666
+ {
667
+ "type": "text",
668
+ "text": "We will resume the discussion about target distributions in Section 4, where we analyze more closely the setup of Example 3. Next, we focus on the perturb-and-MAP strategies and derive a class of noise distributions that is particularly apt to the settings we consider in this work. ",
669
+ "bbox": [
670
+ 174,
671
+ 535,
672
+ 825,
673
+ 577
674
+ ],
675
+ "page_idx": 4
676
+ },
677
+ {
678
+ "type": "text",
679
+ "text": "3.2 A Novel Family of Perturb-and-MAP Noise Distributions ",
680
+ "text_level": 1,
681
+ "bbox": [
682
+ 174,
683
+ 592,
684
+ 609,
685
+ 608
686
+ ],
687
+ "page_idx": 4
688
+ },
689
+ {
690
+ "type": "text",
691
+ "text": "When $p$ is a complex high-dimensional distribution, obtaining Monte Carlo estimates of the gradient in Eq. (7) requires approximate sampling. In this paper, we rely on perturbation-based sampling, also known as perturb and MAP [Papandreou and Yuille, 2011]. In this Section we propose a novel way to design tailored noise perturbations. While the proposed family of noise distributions works with I-MLE, the results of this section are of independent interest and can also be used in other (relaxed) perturb-and-MAP based gradient estimators [e.g. Paulus et al., 2020]. First, we start by revisiting a classic result by Papandreou and Yuille [2011] which theoretically motivates the perturb-and-MAP approach (also known as the Gumbel-max trick), which we generalize here to consider also the temperature parameter $\\tau$ . ",
692
+ "bbox": [
693
+ 173,
694
+ 617,
695
+ 826,
696
+ 742
697
+ ],
698
+ "page_idx": 4
699
+ },
700
+ {
701
+ "type": "text",
702
+ "text": "Proposition 1. Let $p ( z ; \\pmb \\theta )$ be a discrete exponential family distribution with integer polytope $\\mathcal { C }$ and temperature $\\tau$ , and let $\\langle z , \\theta \\rangle$ be the unnormalized weight of each $z \\in { \\mathcal { C } }$ . Moreover, let $\\tilde { \\pmb { \\theta } }$ be such that, for all $z \\in { \\mathcal { C } }$ , $\\langle z , \\tilde { \\theta } \\rangle = \\langle z , \\theta \\rangle + \\epsilon ( z )$ with each $\\epsilon ( z )$ sampled i.i.d. from $\\mathrm { G u m b e l } ( 0 , \\tau )$ . Then we have that $\\operatorname* { P r } ( \\mathbb { M } \\mathrm { A P } ( \\tilde { \\pmb { \\theta } } ) = z ) = p ( z ; \\pmb { \\theta } )$ . ",
703
+ "bbox": [
704
+ 174,
705
+ 746,
706
+ 825,
707
+ 810
708
+ ],
709
+ "page_idx": 4
710
+ },
711
+ {
712
+ "type": "text",
713
+ "text": "All proofs can be found in Appendix B. The proposition states that if we can perturb the weights $\\langle z , \\theta \\rangle$ of each $z \\in { \\mathcal { C } }$ with independent $\\mathrm { G u m b e l } ( 0 , \\tau )$ noise, then obtaining MAP states from the perturbed model is equivalent to sampling from $p ( z ; \\pmb \\theta )$ at temperature7 $\\tau$ . For complex exponential distributions, perturbing the weights $\\langle z , \\theta \\rangle$ for each state $z \\in { \\mathcal { C } }$ is at least as expensive as computing the marginals exactly. Hence, one usually resorts to local perturbations of each $[ \\pmb \\theta ] _ { i }$ (the $i$ -th entry of the vector $\\pmb \\theta$ ) with Gumbel noise. Fortunately, we can prove that, for a large class of distributions, it is possible to design more suitable local perturbations. First, we show that, for any $\\kappa \\in \\mathbb { N } ^ { + }$ , a Gumbel distribution can be written as a finite sum of $\\kappa$ i.i.d. (implicitly defined) random variables. ",
714
+ "bbox": [
715
+ 174,
716
+ 819,
717
+ 825,
718
+ 862
719
+ ],
720
+ "page_idx": 4
721
+ },
722
+ {
723
+ "type": "text",
724
+ "text": "",
725
+ "bbox": [
726
+ 174,
727
+ 90,
728
+ 825,
729
+ 161
730
+ ],
731
+ "page_idx": 5
732
+ },
733
+ {
734
+ "type": "text",
735
+ "text": "Lemma 1. Let $X \\sim \\mathrm { G u m b e l } ( 0 , \\tau )$ and let $\\kappa \\in \\mathbb { N } ^ { + }$ . Define the Sum-of-Gamma distribution as ",
736
+ "bbox": [
737
+ 173,
738
+ 162,
739
+ 795,
740
+ 178
741
+ ],
742
+ "page_idx": 5
743
+ },
744
+ {
745
+ "type": "equation",
746
+ "img_path": "images/635e28ff2d41e63b9ebd67f1f193d28144ea13c18586f87f57cd9d606ff9de0a.jpg",
747
+ "text": "$$\n\\mathrm { S o G } ( \\kappa , \\tau , s ) : = \\frac { \\tau } { \\kappa } \\left\\{ \\sum _ { i = 1 } ^ { s } \\left\\{ \\mathrm { G a m m a } ( 1 / \\kappa , \\kappa / i ) \\right\\} - \\log ( s ) \\right\\} ,\n$$",
748
+ "text_format": "latex",
749
+ "bbox": [
750
+ 303,
751
+ 179,
752
+ 692,
753
+ 222
754
+ ],
755
+ "page_idx": 5
756
+ },
757
+ {
758
+ "type": "text",
759
+ "text": "where $s \\in \\mathbb { N } ^ { + }$ and ${ \\mathrm { G a m m a } } ( \\alpha , \\beta )$ is the Gamma distribution with shape $\\alpha$ and scale $\\beta$ , and let $\\begin{array} { r } { \\mathrm { S o G } ( \\kappa , \\tau ) : = \\operatorname* { l i m } _ { s \\to \\infty } \\mathrm { S o G } ( \\kappa , \\tau , s ) } \\end{array}$ . Then we have that $\\begin{array} { r } { X \\sim \\sum _ { j = 1 } ^ { \\kappa } \\epsilon _ { j } } \\end{array}$ , with $\\epsilon _ { j } \\sim \\mathrm { S o G } ( \\kappa , \\tau )$ . ",
760
+ "bbox": [
761
+ 174,
762
+ 223,
763
+ 825,
764
+ 255
765
+ ],
766
+ "page_idx": 5
767
+ },
768
+ {
769
+ "type": "text",
770
+ "text": "Based on Lemma 1, we can show that for exponential family distributions where every $z \\in { \\mathcal { C } }$ has exactly $k$ non-zero entries we can design perturbations of $\\langle z , \\theta \\rangle$ following a Gumbel distribution. ",
771
+ "bbox": [
772
+ 173,
773
+ 262,
774
+ 823,
775
+ 291
776
+ ],
777
+ "page_idx": 5
778
+ },
779
+ {
780
+ "type": "text",
781
+ "text": "Theorem 1. Let $p ( z ; \\pmb \\theta )$ be a discrete exponential family distribution with integer polytope $\\mathcal { C }$ and temperature $\\tau$ . Assume that if $z \\in { \\mathcal { C } }$ then $\\langle z , \\mathbf { 1 } \\rangle = k$ for some constant $k \\in \\mathbb { N } ^ { + }$ . Let $\\tilde { \\pmb { \\theta } }$ be the perturbation obtained by $[ \\tilde { \\pmb { \\theta } } ] _ { j } = [ \\pmb { \\theta } ] _ { j } + \\epsilon _ { j }$ with $\\epsilon _ { j } \\sim \\mathrm { S o G } ( k , \\tau )$ from Eq. (13). Then, $\\forall z \\in { \\mathcal { C } }$ we have that $\\langle z , \\tilde { \\theta } \\rangle = \\langle z , \\theta \\rangle + \\dot { \\epsilon } ( z )$ , with $\\epsilon ( z ) \\sim \\mathrm { G u m b e l } ( 0 , \\tau )$ . ",
782
+ "bbox": [
783
+ 173,
784
+ 292,
785
+ 825,
786
+ 357
787
+ ],
788
+ "page_idx": 5
789
+ },
790
+ {
791
+ "type": "text",
792
+ "text": "Many problems such as $k$ -subset selection, traveling salesman, spanning tree, and graph matching strictly satisfy the assumption of Theorem 1. We can, however, also apply the strategy in cases where the variance of $\\langle \\mathbf { Z } , \\mathbf { 1 } \\rangle$ is small (e.g. shortest weighted path). The Sum-of-Gamma perturbations provide a more fine-grained approach to noise perturbations. For $\\tau = \\kappa = 1$ , we obtain the standard Gumbel perturbations. In contrast to the standard Gumbel $( 0 , 1 )$ noise, the pro",
793
+ "bbox": [
794
+ 173,
795
+ 366,
796
+ 493,
797
+ 503
798
+ ],
799
+ "page_idx": 5
800
+ },
801
+ {
802
+ "type": "image",
803
+ "img_path": "images/e0b58c90a6c30b14ce39e4e93af1d1b872b0db4b9e733cfa46a52fd2587d1609.jpg",
804
+ "image_caption": [
805
+ "Figure 2: Histograms for 10k samples where each sample is (left) the sum of $5 ~ \\epsilon _ { j } \\sim \\bar { \\mathrm { G u m b e l } } ( 0 , 1 )$ or (right) the sum of $5 \\epsilon _ { j } \\sim \\mathrm { S o G } ( 5 , 1 , 1 0 )$ . "
806
+ ],
807
+ "image_footnote": [],
808
+ "bbox": [
809
+ 508,
810
+ 375,
811
+ 816,
812
+ 457
813
+ ],
814
+ "page_idx": 5
815
+ },
816
+ {
817
+ "type": "text",
818
+ "text": "posed local Sum-of-Gamma perturbations result in weights’ perturbations that follow the Gumbel distribution. Fig. 2 shows histograms of $1 0 \\mathrm { k }$ samples, where each sample is either the sum of 5 samples from $\\mathrm { G u m b e l } ( 0 , 1 )$ (the standard approach) or the sum of $k = 5$ samples from $\\begin{array} { r } { \\mathrm { S o G ( 5 , 1 , 1 0 ) } = \\frac { 1 } { 5 } \\sum _ { i = 1 } ^ { 1 0 } \\{ \\mathrm { G a m m a } ( 1 / 5 , 5 / i ) - \\log ( 1 0 ) \\} } \\end{array}$ . While we still cannot sample faithfully from $p ( z ; \\pmb \\theta )$ as the perturbations are not independent, we can counteract the problem of partially dependent perturbations by increasing the temperature $\\tau$ and, therefore, the variance of the noise distribution. We explore and verify the importance of tuning $\\tau$ empirically. In the appendix, we also show that the infinite series from Lemma 1 can be well approximated by a finite sum using convergence results for the Euler-Mascheroni series [Mortici, 2010]. ",
819
+ "bbox": [
820
+ 173,
821
+ 503,
822
+ 826,
823
+ 631
824
+ ],
825
+ "page_idx": 5
826
+ },
827
+ {
828
+ "type": "text",
829
+ "text": "4 Target Distributions for Combinatorial Optimization Problems ",
830
+ "text_level": 1,
831
+ "bbox": [
832
+ 174,
833
+ 648,
834
+ 730,
835
+ 666
836
+ ],
837
+ "page_idx": 5
838
+ },
839
+ {
840
+ "type": "text",
841
+ "text": "In this section, we explore the setting where the discrete computational component arises from a combinatorial optimization (CO) problem, specifically an integer linear program (ILP). Many authors have recently considered the setup where the CO component occupies the last layer of the model defined by Eq. (1) (where $f _ { u }$ is the identity) and the supervision is available in terms of examples of either optimal solutions [e.g. Poganciˇ c et al., 2019] or optimal cost coefficients (conditioned on ´ the inputs) [e.g. Elmachtoub and Grigas, 2020]. We have seen in Example 3 that we can naturally associate to each ILP a probability distribution (see Eq. (3)) with $\\pmb { \\theta }$ given by the negative cost coefficients $^ c$ of the ILP and $\\mathcal { C }$ the integral polytope. Letting $\\tau 0$ is equivalent to taking the MAP in the forward pass. Furthermore, in Section 3.1 we showed that the I-MLE framework subsumes a recently propose method by Poganciˇ c et al. [2019]. Here, instead, we show that, for a certain choice ´ of the target distribution, I-MLE estimates the gradient of an explicit maximum likelihood learning loss $\\mathcal { L }$ where the data distribution is ascribed to either (examples of) optimal solutions or optimal cost coefficients. ",
842
+ "bbox": [
843
+ 173,
844
+ 679,
845
+ 826,
846
+ 859
847
+ ],
848
+ "page_idx": 5
849
+ },
850
+ {
851
+ "type": "text",
852
+ "text": "Let $q ( z ; \\pmb \\theta ^ { \\prime } )$ be the distribution $p ( z ; \\pmb \\theta ^ { \\prime } )$ , with parameters ",
853
+ "bbox": [
854
+ 173,
855
+ 864,
856
+ 547,
857
+ 880
858
+ ],
859
+ "page_idx": 5
860
+ },
861
+ {
862
+ "type": "equation",
863
+ "img_path": "images/1d2de265697db4610eb53e7340e0f4d94e45820394690c0debcdfb29ff430ee4.jpg",
864
+ "text": "$$\n[ \\pmb { \\theta } ^ { \\prime } ] _ { i } : = \\left\\{ \\begin{array} { l l } { [ \\pmb { \\theta } ] _ { i } } & { \\mathrm { ~ i f ~ } [ \\nabla _ { z } L ] _ { i } = 0 } \\\\ { - [ \\nabla _ { z } L ] _ { i } } & { \\mathrm { ~ o t h e r w i s e . } } \\end{array} \\right.\n$$",
865
+ "text_format": "latex",
866
+ "bbox": [
867
+ 367,
868
+ 882,
869
+ 620,
870
+ 916
871
+ ],
872
+ "page_idx": 5
873
+ },
874
+ {
875
+ "type": "text",
876
+ "text": "In the first CO setting, we observe training data $\\mathcal { D } = \\{ ( \\hat { \\pmb x } _ { j } , \\hat { \\pmb y } _ { j } ) \\} _ { j = 1 } ^ { N }$ where $\\hat { y } _ { j } \\in \\mathcal { C }$ and the loss $\\ell$ measures a distance between a discrete $\\hat { z } _ { j } \\sim p ( z ; \\pmb { \\theta } _ { j } )$ with $\\bar { \\theta _ { j } } = h _ { v } ( \\hat { \\pmb x } )$ and a given optimal solution of the ILP $\\hat { y } _ { j }$ . An example is the Hamming loss $\\ell _ { H }$ [Poganciˇ c et al., 2019] defined as ´ $\\ell _ { H } ( z , y ) = z \\circ ( { \\bf 1 } - \\bar { y } ) + y \\circ ( { \\bf 1 } - z )$ , where $\\circ$ denotes the Hadamard (or entry-wise) product. ",
877
+ "bbox": [
878
+ 174,
879
+ 90,
880
+ 825,
881
+ 150
882
+ ],
883
+ "page_idx": 6
884
+ },
885
+ {
886
+ "type": "text",
887
+ "text": "Fact 1. If one uses $\\ell _ { H }$ , then I-MLE with the target distribution of Eq. (14) and $\\rho ( \\epsilon ) = \\delta _ { 0 }$ is equivalent to the perceptron-rule estimator of the MLE objective between $p ( z ; h _ { v } ( \\hat { { \\bf x } } _ { j } ) )$ and $\\hat { y } _ { j }$ . ",
888
+ "bbox": [
889
+ 171,
890
+ 154,
891
+ 823,
892
+ 181
893
+ ],
894
+ "page_idx": 6
895
+ },
896
+ {
897
+ "type": "text",
898
+ "text": "It follows that the method by Poganciˇ c et al. [2019] returns, for a large enough ´ $\\lambda$ , the maximumlikelihood gradients (scaled by $1 / \\lambda$ ) approximated by the perceptron rule. The proofs are given in Appendix B. ",
899
+ "bbox": [
900
+ 176,
901
+ 191,
902
+ 823,
903
+ 234
904
+ ],
905
+ "page_idx": 6
906
+ },
907
+ {
908
+ "type": "text",
909
+ "text": "In the second CO setting, we observe training data $\\mathcal D = \\{ ( \\hat { \\pmb x } _ { j } , \\hat { \\pmb c } _ { j } ) \\} _ { j = 1 } ^ { N }$ , where ${ \\hat { \\mathbf { c } } } _ { j }$ is the optimal cost conditioned on input $\\hat { \\mathbf { \\Omega } } _ { \\hat { \\mathbf { \\Omega } } } ^ { \\hat { \\mathbf { \\Omega } } } ( \\hat { \\mathbf { \\Omega } } _ { \\hat { \\mathbf { \\Omega } } } ^ { \\hat { \\mathbf { \\Omega } } } )$ . Here, various authors [e.g. Elmachtoub and Grigas, 2020, Mandi et al., 2020, Mandi and Guns, 2020] use as point-wise loss the regret $\\ell _ { R } ( \\pmb \\theta , \\pmb c ) = \\pmb c ^ { \\top } \\left( \\pmb z ( \\pmb \\theta ) - \\hat { \\pmb z } ^ { * } ( \\pmb c ) \\right)$ where $z ( \\theta )$ is a state sampled from $p ( z ; \\pmb \\theta )$ (possibly with temperature $\\tau 0$ , that is, a MAP state) and $\\hat { z } ^ { \\ast } ( \\acute { c } ) \\in z ^ { \\ast } ( c )$ is an optimal state for $^ c$ . ",
910
+ "bbox": [
911
+ 174,
912
+ 239,
913
+ 825,
914
+ 313
915
+ ],
916
+ "page_idx": 6
917
+ },
918
+ {
919
+ "type": "text",
920
+ "text": "Fact 2. If one uses $\\ell _ { R }$ then I-MLE with the target distribution of Eq. (14) is equivalent to the perturb-and-MAP estimator of the MLE objective between $p ( z ; h _ { v } ( \\hat { { \\bf x } } _ { j } ) )$ and $p ( z ; - \\hat { \\pmb { c } } _ { j } )$ . ",
921
+ "bbox": [
922
+ 174,
923
+ 318,
924
+ 823,
925
+ 347
926
+ ],
927
+ "page_idx": 6
928
+ },
929
+ {
930
+ "type": "text",
931
+ "text": "This last result also implies that when using the target distribution $q$ from (14) in conjunction with the regret, I-MLE performs maximum-likelihood learning minimizing the KL divergence between the current distribution and the distribution whose parameters are the optimal cost. ",
932
+ "bbox": [
933
+ 174,
934
+ 356,
935
+ 825,
936
+ 398
937
+ ],
938
+ "page_idx": 6
939
+ },
940
+ {
941
+ "type": "text",
942
+ "text": "Moreover, both facts imply that, when sampling from the MAP states of the distribution $q$ defined by Eq. (14), we have that $\\bar { \\ell } ( \\hat { \\hat { z } } , \\hat { y } ) = 0$ for $\\hat { z } \\in \\mathsf { M A P } ( \\theta ^ { \\prime } )$ . Therefore, $\\ell ( \\hat { z } , \\hat { y } ) = 0 \\leq { \\mathbb E } _ { \\hat { z } \\sim p ( z ; \\pmb { \\theta } ) } \\left[ \\ell ( ( \\hat { z } , \\hat { y } ) \\right]$ meaning that the inequality of Eq. (5) is satisfied for $\\tau 0$ . ",
943
+ "bbox": [
944
+ 174,
945
+ 405,
946
+ 823,
947
+ 446
948
+ ],
949
+ "page_idx": 6
950
+ },
951
+ {
952
+ "type": "text",
953
+ "text": "5 Related Work ",
954
+ "text_level": 1,
955
+ "bbox": [
956
+ 174,
957
+ 465,
958
+ 321,
959
+ 483
960
+ ],
961
+ "page_idx": 6
962
+ },
963
+ {
964
+ "type": "text",
965
+ "text": "Several papers address the gradient estimation problem for discrete r.v.s, many resorting to relaxations. Maddison et al. [2017], Jang et al. [2017] propose the Gumbel-softmax distribution to relax categorical r.v.s; Paulus et al. [2020] study extensions to more complex probability distributions. The concrete distribution (the Gumbel-softmax distribution) is only directly applicable to categorical variables. For more complex distributions, one has to come up with tailor-made relaxations or use the straightthrough or score function estimators (see for instance Kim et al. [2016], Grover et al. [2019]). In our experiments, we compare with the Gumbel-softmax estimator in Figure 4 (left and right). We show that the $k$ -subset VAE trained with I-MLE achieves loss values that are similar to those of the categorical (1-subset) VAE trained with the Gumbel-softmax gradient estimator. Tucker et al. [2017], Grathwohl et al. [2018] develop parameterized control variates (the former was named REBAR) based on continuous relaxations for the score-function estimator. In contrast, we focus explicitly on problems where only discrete samples are used during training. Moreover, REBAR is tailored to categorical distributions. I-MLE is intended for models with complex distributions (e.g. those with with many constraints). ",
966
+ "bbox": [
967
+ 174,
968
+ 497,
969
+ 826,
970
+ 690
971
+ ],
972
+ "page_idx": 6
973
+ },
974
+ {
975
+ "type": "text",
976
+ "text": "Approaches that do not rely on relaxations are specific to certain distributions [Bengio et al., 2013, Franceschi et al., 2019, Liu et al., 2019] or assume knowledge of $\\mathcal { C }$ [Kool et al., 2020]. We provide a general-purpose framework that does not require access to the linear constraints and the corresponding integer polytope $\\mathcal { C }$ . Experiments in the next section show that while I-MLE only requires a MAP solver, it is competitive and sometimes outperforms tailor-made relaxations. SparseMAP [Niculae et al., 2018] is an approach to structured prediction and latent variables, replacing the exponential distribution (specifically, the softmax) with a sparser distribution. Similar to our work, it only presupposes the availability of a MAP oracle. LP-SparseMAP [Niculae and Martins, 2020] is an extension that uses a relaxation of the optimization problem rather than a MAP solver. Sparsity can also be exploited for efficient marginal inference in latent variable models [Correia et al., 2020]. ",
977
+ "bbox": [
978
+ 174,
979
+ 696,
980
+ 825,
981
+ 835
982
+ ],
983
+ "page_idx": 6
984
+ },
985
+ {
986
+ "type": "text",
987
+ "text": "A series of works about differentiating through CO problems [Wilder et al., 2019, Elmachtoub and Grigas, 2020, Ferber et al., 2020, Mandi and Guns, 2020] relax ILPs by adding $L ^ { 1 }$ , $L ^ { 2 }$ or log-barrier regularization terms and differentiate through the KKT conditions deriving from the application of the cutting plane or the interior-point methods. These approaches are conceptually linked to techniques for differentiating through smooth programs [Amos and Kolter, 2017, Donti et al., 2017, ",
988
+ "bbox": [
989
+ 174,
990
+ 842,
991
+ 825,
992
+ 911
993
+ ],
994
+ "page_idx": 6
995
+ },
996
+ {
997
+ "type": "text",
998
+ "text": "Agrawal et al., 2019, Chen et al., 2020, Domke, 2012, Franceschi et al., 2018] that arise not only in modelling but also in hyperparameter optimization and meta-learning. Poganciˇ c et al. [2019], ´ Rolínek et al. [2020], Berthet et al. [2020] propose methods that are not tied to a specific ILP solver. As we saw above, the former two, originally derived from a continuous interpolation argument, may be interpreted as special instantiations of I-MLE. The latter addresses the theory of perturbed optimizers and discusses perturb and MAP in the context of the Fenchel-Young loss. All the COrelated works assume that either optimal costs or solutions are given as training data, while I-MLE may be also applied in the absence of such supervision by making use of implicitly generated target distributions. Other authors focus on devising differentiable relaxations for specific CO problems such as SAT [Evans and Grefenstette, 2018] or MaxSAT [Wang et al., 2019]. Machine learning intersects with CO also in other contexts, e.g. in learning heuristics to improve the performances of CO solvers or differentiable models such as GNNs to “replace” them; see Bengio et al. [2020] and references therein. ",
999
+ "bbox": [
1000
+ 174,
1001
+ 90,
1002
+ 826,
1003
+ 270
1004
+ ],
1005
+ "page_idx": 7
1006
+ },
1007
+ {
1008
+ "type": "text",
1009
+ "text": "Direct Loss Minimization [DLM, McAllester et al., 2010, Song et al., 2016] is also related to our work, but the assumption there is that examples of optimal states $\\hat { z }$ are given. Lorberbom et al. [2019] extend the DLM framework to discrete VAEs using coupled perturbations. Their approach is tailored to VAEs and not general-purpose. Under a methodological viewpoint, I-MLE inherits from classical MLE [Wainwright and Jordan, 2008] and perturb-and-MAP [Papandreou and Yuille, 2011]. The theory of perturb-and-MAP was used to derive general-purpose upper bounds for log-partition functions [Hazan and Jaakkola, 2012, Shpakova and Bach, 2016]. ",
1010
+ "bbox": [
1011
+ 174,
1012
+ 276,
1013
+ 825,
1014
+ 375
1015
+ ],
1016
+ "page_idx": 7
1017
+ },
1018
+ {
1019
+ "type": "text",
1020
+ "text": "6 Experiments ",
1021
+ "text_level": 1,
1022
+ "bbox": [
1023
+ 174,
1024
+ 393,
1025
+ 312,
1026
+ 411
1027
+ ],
1028
+ "page_idx": 7
1029
+ },
1030
+ {
1031
+ "type": "text",
1032
+ "text": "The set of experiments can be divided into three parts. First, we analyze and compare the behavior of I-MLE with (i) the score function and (ii) the straight-through estimator using a toy problem. Second, we explore the latent variable setting where both $h _ { v }$ and $f _ { u }$ in Eq. (1) are neural networks and the optimal structure is not available during training. Finally, we address the problem of differentiating through black-box combinatorial optimization problems, where we use the target distribution derived in Section 4. More experimental details for available in the appendix. ",
1033
+ "bbox": [
1034
+ 174,
1035
+ 425,
1036
+ 825,
1037
+ 508
1038
+ ],
1039
+ "page_idx": 7
1040
+ },
1041
+ {
1042
+ "type": "text",
1043
+ "text": "Synthetic Experiments. We conducted a series of experiments with a tractable 5-subset distribution (see Example 2) where $\\mathbf { z } \\in \\{ 0 , 1 \\} ^ { 1 0 }$ . We set the loss to $L ( \\pmb \\theta ) = \\mathbb { E } _ { \\hat { z } \\sim p ( \\mathbf { z } ; \\pmb \\theta ) } [ \\| \\hat { z } - \\mathbf b \\| ^ { 2 } ]$ , where $\\mathbf { b }$ is a fixed vector sampled from $\\mathcal { N } ( 0 , \\bf { I } )$ . In Fig. 3 (Top), we plot optimization curves with means and standard deviations, comparing the proposed estimator with the straight-through (STE) and the score function (SFE) estimators. 8 For STE and I-MLE, we use Perturb-and-MAP (PaM) with Gumbel and $\\operatorname { S o G } ( 1 , 5 , 1 0 )$ noise, respectively. The SFE uses faithful samples and exact marginals (which is feasible only when $m$ is very small) and converges much more slowly than the other methods, while the STE converges to worse solutions than those found using I-MLE. Fig. 3 (Bottom) shows the benefits of using SoG rather than Gumbel perturbations with I-MLE. While the best configurations for both are comparable, SoG noise achieves in average (over 100 runs) strictly better final values of $L$ for more than $5 0 \\%$ of the tested configurations (varying $\\lambda$ from Eq. (10) and the learning rate) and exhibit smaller variance (see Fig. 6). Additional details and results in Appendix C.1. ",
1044
+ "bbox": [
1045
+ 173,
1046
+ 523,
1047
+ 825,
1048
+ 693
1049
+ ],
1050
+ "page_idx": 7
1051
+ },
1052
+ {
1053
+ "type": "text",
1054
+ "text": "Learning to Explain. The BEERADVOCATE dataset [McAuley et al., 2012] consists of free-text reviews and ratings for 4 different aspects of beer: appearance, aroma, palate, and taste. Each sentence in the test set has annotations providing the words that best describe the various aspects. Following the experimental setup of recent work [Paulus et al., 2020], we address the problem introduced by the L2X paper [Chen et al., 2018] of learning a distribution over $k$ -subsets of words that best explain a given aspect rating. The complexity of the MAP problem for the $k$ -subset distribution is linear in $k$ . sThe training set has $8 0 \\mathrm { k }$ reviews for the aspect APPEARANCE and 70k reviews for all other aspects. Since the original dataset [McAuley et al., 2012] did not provide separate validation and test sets, we compute 10 different evenly sized validation/test splits of the 10k held out set and compute mean and standard deviation over 10 models, each trained on one split. Subset precision was computed using a subset of 993 annotated reviews. We use pre-trained word embeddings from Lei et al. [2016]. Prior work used non-standard neural networks for which an implementation is not available [Paulus et al., 2020]. Instead, we used the neural network from the L2X paper with 4 convolutional and one dense layer. This neural network outputs the parameters $\\pmb \\theta$ of the distribution $p ( z ; \\pmb \\theta )$ over $k$ -hot binary latent masks with $k \\in \\{ 5 , 1 0 , 1 5 \\}$ . We compare to relaxation-based baselines L2X [Chen et al., 2018] and SoftSub [Xie and Ermon, 2019]. We also compare the straight-through estimator (STE) with Sum-of-Gamma (SoG) perturbations. We used the standard hyperparameter settings of Chen et al. [2018] and choose the temperature parameter $t \\in \\{ 0 . 1 , 0 . 5 , \\mathrm { i } . 0 , \\bar { 2 } . 0 \\}$ . For I-MLE we choose $\\lambda \\in { \\overline { { \\{ 1 0 ^ { 1 } , 1 0 ^ { 2 } , 1 0 ^ { 3 } \\} } } }$ , while for both I-MLE and STE we choose $\\tau \\in \\{ k , 2 k , 3 k \\}$ based on the validation MSE. We used the standard Adam settings. We trained separate models for each aspect using MSE as point-wise loss $\\ell$ . ",
1055
+ "bbox": [
1056
+ 173,
1057
+ 708,
1058
+ 825,
1059
+ 873
1060
+ ],
1061
+ "page_idx": 7
1062
+ },
1063
+ {
1064
+ "type": "image",
1065
+ "img_path": "images/48f76f7e8f24241085c07798fd126bbd8e641743cdf4ba3d708da522f0e223be.jpg",
1066
+ "image_caption": [
1067
+ "Figure 3: Top: Gradient-based optimization of $L$ with various estimators. Bottom: Mean difference of the final value of $L$ between I-MLE with SoG or Gumbel $\\rho ( \\epsilon )$ varying $\\lambda$ and the learning rate (blue $=$ better SoG). "
1068
+ ],
1069
+ "image_footnote": [],
1070
+ "bbox": [
1071
+ 191,
1072
+ 92,
1073
+ 400,
1074
+ 320
1075
+ ],
1076
+ "page_idx": 8
1077
+ },
1078
+ {
1079
+ "type": "table",
1080
+ "img_path": "images/62231f3a59a5605b54aa4e43d5b03023d0bfdc0ff960faaaff2b07e9b00fca25.jpg",
1081
+ "table_caption": [],
1082
+ "table_footnote": [
1083
+ "Table 1: Detailed results for the aspect AROMA. Test MSE and subset precision, both $\\times 1 0 0$ , for $k \\mathbf { \\hat { \\in } } \\left\\{ 5 , 1 0 , 1 5 \\right\\}$ . "
1084
+ ],
1085
+ "table_body": "<table><tr><td rowspan=\"2\">Method</td><td colspan=\"2\">Test MSE</td><td colspan=\"2\">Subset Precision</td></tr><tr><td>Mean</td><td>Std. Dev.</td><td>Mean</td><td> Std. Dev.</td></tr><tr><td colspan=\"5\">k=10</td></tr><tr><td>L2X (t = 0.1)</td><td>6.68</td><td>1.08</td><td>26.65</td><td>9.39</td></tr><tr><td>SoftSub (t = 0.5)</td><td>2.67</td><td>0.14</td><td>44.44</td><td>2.27</td></tr><tr><td>STE(T = 30)</td><td>4.44</td><td>0.09</td><td>38.93</td><td>0.14</td></tr><tr><td>I-MLE MAP</td><td>4.08</td><td>0.91</td><td>14.55</td><td>0.04</td></tr><tr><td>I-MLEGumbel</td><td>2.68</td><td>0.10</td><td>39.28</td><td>2.62</td></tr><tr><td>I-MLE(τ = 30)</td><td>2.71</td><td>0.10</td><td>47.98</td><td>2.26</td></tr><tr><td colspan=\"5\">k=5</td></tr><tr><td>L2X (t = 0.1)</td><td>5.75</td><td>0.30</td><td>33.63</td><td>6.91</td></tr><tr><td>SoftSub (t = 0.5)</td><td>2.57</td><td>0.12</td><td>54.06</td><td>6.29</td></tr><tr><td>I-MLE(T = 5)</td><td>2.62</td><td>0.05</td><td>54.76</td><td>2.50</td></tr><tr><td colspan=\"5\">k =15</td></tr><tr><td>L2X (t = 0.1)</td><td>7.71</td><td>0.64</td><td>23.49</td><td>10.93</td></tr><tr><td>SoftSub (t = 0.5)</td><td>2.52</td><td>0.07</td><td>37.78</td><td>1.71</td></tr><tr><td>I-MLE(T = 30)</td><td>2.91</td><td>0.18</td><td>39.56</td><td>2.07</td></tr></table>",
1086
+ "bbox": [
1087
+ 429,
1088
+ 92,
1089
+ 821,
1090
+ 361
1091
+ ],
1092
+ "page_idx": 8
1093
+ },
1094
+ {
1095
+ "type": "text",
1096
+ "text": "",
1097
+ "bbox": [
1098
+ 174,
1099
+ 414,
1100
+ 825,
1101
+ 539
1102
+ ],
1103
+ "page_idx": 8
1104
+ },
1105
+ {
1106
+ "type": "text",
1107
+ "text": "Table 1 lists detailed results for the aspect AROMA. I-MLE’s MSE values are competitive with those of the best baseline, and its subset precision is significantly higher than all other methods (for $\\tau = 3 0$ ). Using only MAP as the approximation of the marginals leads to poor results. This shows that using the tailored perturbations with tuned temperature is crucial to achieve state of the art results. The Sum-of-Gamma perturbation introduced in this paper outperforms the standard local Gumbel perturbations. More details and results can be found in the appendix. ",
1108
+ "bbox": [
1109
+ 173,
1110
+ 545,
1111
+ 825,
1112
+ 628
1113
+ ],
1114
+ "page_idx": 8
1115
+ },
1116
+ {
1117
+ "type": "text",
1118
+ "text": "Discrete Variational Auto-Encoder. We evaluate various perturbation strategies for a discrete $k$ -subset Variational Auto-Encoder (VAE) and compare them to the straight-through estimator (STE) and the Gumbel-softmax trick. The latent variables model a probability distribution over $k$ -subsets of (or top- $k$ assignments too) binary vectors of length 20. The special case of $k = 1$ is equivalent to a categorical variable with 20 categories. For $k > 1$ , we use I-MLE using the class of PID target distributions of Eq. (10) and compare various perturb-and-MAP noise sampling strategies. The experimental setup is similar to those used in prior work on the Gumbel softmax tricks [Jang et al., 2017]. The loss is the sum of the reconstruction losses (binary cross-entropy loss on output pixels) and the KL divergence between the marginals of the variables and the uniform distribution. The encoding and decoding functions of the VAE consist of three dense layers (encoding: $5 1 2 - 2 5 6 - 2 0 { \\mathrm { x } } 2 0$ ; decoding: 256-512-784). We do not use temperature annealing. Using Eq. (9) with $S = 1$ , we use either $\\mathrm { G u m b e l } ( 0 , 1 )$ perturbations (the standard approach)9 or Sum-of-Gamma (SoG) perturbations at a temperature of $\\tau = 1 0$ . We run 100 epochs and record the loss on the test data. The difference in training time is negligible. Fig. 4 shows that using the SoG noise distribution is beneficial. The test loss using the SoG perturbations is lower despite the perturbations having higher variance and, therefore, samples of the model being more diverse. This shows that using perturbations of the weights that follow a proper Gumbel distribution is indeed beneficial. I-MLE significantly outperforms the ",
1119
+ "bbox": [
1120
+ 173,
1121
+ 646,
1122
+ 826,
1123
+ 881
1124
+ ],
1125
+ "page_idx": 8
1126
+ },
1127
+ {
1128
+ "type": "image",
1129
+ "img_path": "images/baf320b362e8112a6ab5e186b2f2316b789ce54dfcc1d6006e125d5608329658.jpg",
1130
+ "image_caption": [
1131
+ "Figure 4: Plots of the sum of the binary reconstruction loss and the KL divergence as a function of the number of epochs (lower is better). (Left) Discrete 10-subset VAE trained with I-MLE with $\\lambda = 1 0$ (I-MLE). (Center) Discrete 10-subset VAE trained with the straight-through estimator (STE). (Right) Discrete 1-subset VAE using the Gumbel softmax trick (GSMT). The down-up-down artifact is due to temperature annealing. Sum-of-Gamma (SoG) perturbations have the lowest test loss for the 10-subset VAEs. For $\\bar { \\lambda } = 1 0$ and SoG perturbations, the test loss is similar to that of the categorical (1-subset) VAE trained with the Gumbel softmax trick. "
1132
+ ],
1133
+ "image_footnote": [],
1134
+ "bbox": [
1135
+ 176,
1136
+ 97,
1137
+ 820,
1138
+ 218
1139
+ ],
1140
+ "page_idx": 9
1141
+ },
1142
+ {
1143
+ "type": "text",
1144
+ "text": "STE, which does not work in this setting and is competitive with the Gumbel-Softmax trick for the 1-subset (categorical) distribution where marginals can be computed in closed form. ",
1145
+ "bbox": [
1146
+ 173,
1147
+ 327,
1148
+ 823,
1149
+ 354
1150
+ ],
1151
+ "page_idx": 9
1152
+ },
1153
+ {
1154
+ "type": "text",
1155
+ "text": "Differentiating through Combinatorial Solvers. In these experiments, proposed by Poganciˇ c´ et al. [2019], the training datasets consists of 10,000 examples of randomly generated images of terrain maps from the Warcraft II tile set [Guyomarch, 2017]. Each example has an underlying $K \\times K$ grid whose cells represent terrains ",
1156
+ "bbox": [
1157
+ 173,
1158
+ 378,
1159
+ 395,
1160
+ 516
1161
+ ],
1162
+ "page_idx": 9
1163
+ },
1164
+ {
1165
+ "type": "table",
1166
+ "img_path": "images/511e8b90464f8a2b3bc12ba9f7621b6430143ff803af958f3bb62425d6b8459f.jpg",
1167
+ "table_caption": [
1168
+ "Table 2: Results for the Warcraft shortest path task. Reported is the accuracy, i.e. percentage of paths with the optimal costs. Standard deviations are over five runs. "
1169
+ ],
1170
+ "table_footnote": [],
1171
+ "table_body": "<table><tr><td>K</td><td>I-MLE (μ-μ)</td><td>I-MLE (M-M)</td><td>BB</td><td>DPO</td></tr><tr><td>12</td><td>97.2 ± 0.5</td><td>95.2± 0.3</td><td>95.2 ± 0.7</td><td>94.8 ± 0.3</td></tr><tr><td>18</td><td>95.8±0.7</td><td>94.4± 0.5</td><td>94.7 ± 0.4</td><td>92.3± 0.8</td></tr><tr><td>24</td><td>94.3 ± 1.0</td><td>93.2 ± 0.2</td><td>93.8 ± 0.3</td><td>91.5 ± 0.4</td></tr><tr><td>30</td><td>93.6 ± 0.4</td><td>93.7 ± 0.6</td><td>93.6 ± 0.5</td><td>91.5 ± 0.8</td></tr></table>",
1172
+ "bbox": [
1173
+ 411,
1174
+ 428,
1175
+ 818,
1176
+ 507
1177
+ ],
1178
+ "page_idx": 9
1179
+ },
1180
+ {
1181
+ "type": "text",
1182
+ "text": "with a fixed cost. The shortest (minimum cost) path between the top-left and bottom-right cell in the grid is encoded as an indicator matrix and serves as the target output. An image of the terrain map is presented to a CNN, which produces a $K \\times K$ matrix of vertex costs. These costs are then given to Dijkstra’s algorithm (the MAP solver) to compute the shortest path. We closely follow the evaluation protocol of Poganciˇ c et al. [2019]. We considered two instantiations of ´ I-MLE: one derived from Fact 1 (M-M in Table 2) using $\\ell _ { H }$ and one derived from Fact 2 $( \\pmb { \\mu } \\mathbf { - } \\pmb { \\mu } )$ using $\\ell _ { R }$ , with $\\rho ( \\epsilon ) = \\mathrm { S o G } ( k , 1 , 1 0 )$ where $k$ is the empirical mean of the path lengths (different for each grid size $K _ { \\cdot }$ ). We compare with the method proposed by Poganciˇ c et al. [2019]´ $( \\mathrm { B B } ^ { 1 0 } )$ and Berthet et al. [2020] (DPO). The results are listed in Table 2. I-MLE obtains results comparable to (BB) with M-M and is more accurate with $\\pmb { \\mu } \\mathbf { - } \\pmb { \\mu }$ . We believe that the $\\pmb { \\mu } \\mathbf { - } \\pmb { \\mu }$ advantage may be partially due to an implicit form of data augmentation since we know from Fact 2 that, by using I-MLE, we obtain samples from the distribution whose parameters are the optimal cost. Training dynamics, showing faster convergence of I-MLE $( \\pmb { \\mu } \\mathbf { - } \\pmb { \\mu } )$ , and additional details are available in Table 4. ",
1183
+ "bbox": [
1184
+ 173,
1185
+ 517,
1186
+ 825,
1187
+ 695
1188
+ ],
1189
+ "page_idx": 9
1190
+ },
1191
+ {
1192
+ "type": "text",
1193
+ "text": "7 Conclusions ",
1194
+ "text_level": 1,
1195
+ "bbox": [
1196
+ 174,
1197
+ 724,
1198
+ 305,
1199
+ 741
1200
+ ],
1201
+ "page_idx": 9
1202
+ },
1203
+ {
1204
+ "type": "text",
1205
+ "text": "I-MLE is an efficient, simple-to-implement, and general-purpose framework for learning hybrid models. I-MLE is competitive with relaxation-based approaches for discrete latent-variable models and with approaches to backpropagate through CO solvers. Moreover, we showed empirically that I-MLE outperforms the straight-through estimator. A limitation of the work is its dependency on computing MAP states which is, in general, an NP-hard problem (although for many interesting cases there are efficient algorithms). Future work includes devising target distributions when $\\nabla _ { z } L$ is not available, studying the properties (including the bias) of the proposed estimator, developing adaptive strategies for $\\tau$ and $\\lambda$ , and integrating and testing I-MLE in several challenging application domains. ",
1206
+ "bbox": [
1207
+ 174,
1208
+ 761,
1209
+ 825,
1210
+ 872
1211
+ ],
1212
+ "page_idx": 9
1213
+ },
1214
+ {
1215
+ "type": "text",
1216
+ "text": "References ",
1217
+ "text_level": 1,
1218
+ "bbox": [
1219
+ 174,
1220
+ 90,
1221
+ 267,
1222
+ 106
1223
+ ],
1224
+ "page_idx": 10
1225
+ },
1226
+ {
1227
+ "type": "text",
1228
+ "text": "A. Agrawal, B. Amos, S. Barratt, S. Boyd, S. Diamond, and Z. Kolter. Differentiable convex optimization layers. arXiv preprint arXiv:1910.12430, 2019. \nB. Amos and J. Z. Kolter. Optnet: Differentiable optimization as a layer in neural networks. In International Conference on Machine Learning, pages 136–145. PMLR, 2017. \nY. Bengio, N. Léonard, and A. Courville. Estimating or propagating gradients through stochastic neurons for conditional computation. arXiv preprint arXiv:1308.3432, 2013. \nY. Bengio, A. Lodi, and A. Prouvost. Machine learning for combinatorial optimization: a methodological tour d’horizon. European Journal of Operational Research, 2020. \nQ. Berthet, M. Blondel, O. Teboul, M. Cuturi, J. Vert, and F. R. Bach. Learning with differentiable pertubed optimizers. In NeurIPS, 2020. \nJ. Chen, L. Song, M. Wainwright, and M. Jordan. Learning to explain: An information-theoretic perspective on model interpretation. In International Conference on Machine Learning, pages 883–892. PMLR, 2018. \nX. Chen, Y. Zhang, C. Reisinger, and L. Song. Understanding deep architecture with reasoning layer. Advances in Neural Information Processing Systems, 33, 2020. \nG. M. Correia, V. Niculae, W. Aziz, and A. F. Martins. Efficient marginalization of discrete and structured latent variables via sparsity. Advances in Neural Information Processing Systems, 2020. \nJ. Domke. Implicit differentiation by perturbation. In Advances in Neural Information Processing Systems 23, pages 523–531. 2010. \nJ. Domke. Generic methods for optimization-based modeling. In Artificial Intelligence and Statistics, pages 318–326. PMLR, 2012. \nP. L. Donti, B. Amos, and J. Z. Kolter. Task-based end-to-end model learning in stochastic optimization. Advances in Neural Information Processing Systems, 2017. \nA. N. Elmachtoub and P. Grigas. Smart “predict, then optimize\", 2020. \nR. Evans and E. Grefenstette. Learning explanatory rules from noisy data. Journal of Artificial Intelligence Research, 61:1–64, 2018. \nA. Ferber, B. Wilder, B. Dilkina, and M. Tambe. Mipaal: Mixed integer program as a layer. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pages 1504–1511, 2020. \nL. Franceschi, P. Frasconi, S. Salzo, R. Grazzi, and M. Pontil. Bilevel programming for hyperparameter optimization and meta-learning. In International Conference on Machine Learning, pages 1568–1577. PMLR, 2018. \nL. Franceschi, M. Niepert, M. Pontil, and X. He. Learning discrete structures for graph neural networks. In International conference on machine learning, pages 1972–1982. PMLR, 2019. \nW. Grathwohl, D. Choi, Y. Wu, G. Roeder, and D. Duvenaud. Backpropagation through the void: Optimizing control variates for black-box gradient estimation. ICLR, 2018. \nA. Grover, E. Wang, A. Zweig, and S. Ermon. Stochastic optimization of sorting networks via continuous relaxations. arXiv preprint arXiv:1903.08850, 2019. \nJ. Guyomarch. Warcraft II Open-Source Map Editor. http://github.com/war2/war2edit, 2017. \nD. Hafner, T. Lillicrap, M. Norouzi, and J. Ba. Mastering atari with discrete world models. arXiv preprint arXiv:2010.02193, 2020. \nT. Hazan and T. Jaakkola. On the partition function and random maximum a-posteriori perturbations. In Proceedings of the 29th International Coference on International Conference on Machine Learning, pages 1667–1674, 2012. \nK. He, X. Zhang, S. Ren, and J. Sun. Deep residual learning for image recognition. In CVPR, pages 770–778. IEEE Computer Society, 2016. \nE. Jang, S. Gu, and B. Poole. Categorical reparameterization with gumbel-softmax. ICLR, 2017. \nN. L. Johnson and N. Balakrishnan. Advances in the theory and practice of statistics, 1998. \nC. Kim, A. Sabharwal, and S. Ermon. Exact sampling with integer linear programs and random perturbations. In Thirtieth AAAI Conference on Artificial Intelligence, 2016. \nW. Kool, H. van Hoof, and M. Welling. Estimating gradients for discrete random variables by sampling without replacement. ICLR, 2020. \nY. LeCun, S. Chopra, R. Hadsell, M. Ranzato, and F. Huang. A tutorial on energy-based learning. Predicting structured data, 1(0), 2006. \nT. Lei, R. Barzilay, and T. Jaakkola. Rationalizing neural predictions. In EMNLP, 2016. \nR. Liu, J. Regier, N. Tripuraneni, M. Jordan, and J. Mcauliffe. Rao-blackwellized stochastic gradients for discrete distributions. In International Conference on Machine Learning, pages 4023–4031. PMLR, 2019. \nG. Lorberbom, A. Gane, T. Jaakkola, and T. Hazan. Direct optimization through argmax for discrete variational auto-encoder. In Advances in Neural Information Processing Systems, pages 6203–6214, 2019. \nC. J. Maddison, A. Mnih, and Y. W. Teh. The concrete distribution: A continuous relaxation of discrete random variables. ICLR, 2017. \nJ. Mandi and T. Guns. Interior point solving for lp-based prediction+optimisation. In Advances in Neural Information Processing Systems, 2020. \nJ. Mandi, E. Demirovic, P. J. Stuckey, and T. Guns. Smart predict-and-optimize for hard combina- ´ torial optimization problems. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pages 1603–1610, 2020. \nD. A. McAllester, T. Hazan, and J. Keshet. Direct loss minimization for structured prediction. In Advances in Neural Information Processing Systems, volume 1, page 3, 2010. \nJ. McAuley, J. Leskovec, and D. Jurafsky. Learning attitudes and attributes from multi-aspect reviews. 2012 IEEE 12th International Conference on Data Mining, pages 1020–1025, 2012. \nV. V. Mišic and G. Perakis. Data analytics in operations management: A review. ´ Manufacturing & Service Operations Management, 22(1):158–169, 2020. \nC. Mortici. Fast convergences towards Euler-Mascheroni constant. Computational & Applied Mathematics, 29, 00 2010. \nK. P. Murphy. Machine learning: a probabilistic perspective. MIT press, 2012. \nV. Niculae and A. F. T. Martins. Lp-sparsemap: Differentiable relaxed optimization for sparse structured prediction. In ICML, 2020. \nV. Niculae, A. F. T. Martins, M. Blondel, and C. Cardie. Sparsemap: Differentiable sparse structured inference. In ICML, 2018. \nG. Papandreou and A. L. Yuille. Perturb-and-map random fields: Using discrete optimization to learn and sample from energy models. In 2011 International Conference on Computer Vision, pages 193–200, 2011. \nM. B. Paulus, D. Choi, D. Tarlow, A. Krause, and C. J. Maddison. Gradient estimation with stochastic softmax tricks. arXiv preprint arXiv:2006.08063, 2020. \nM. V. Poganciˇ c, A. Paulus, V. Musil, G. Martius, and M. Rolinek. Differentiation of blackbox ´ combinatorial solvers. In International Conference on Learning Representations, 2019. \nL. D. Raedt, K. Kersting, S. Natarajan, and D. Poole. Statistical relational artificial intelligence: Logic, probability, and computation. Synthesis Lectures on Artificial Intelligence and Machine Learning, 10(2):1–189, 2016. \nM. Rolínek, P. Swoboda, D. Zietlow, A. Paulus, V. Musil, and G. Martius. Deep graph matching via blackbox differentiation of combinatorial solvers. In ECCV, 2020. \nJ. Schulman, N. Heess, T. Weber, and P. Abbeel. Gradient estimation using stochastic computation graphs. In Proceedings of the 28th International Conference on Neural Information Processing Systems-Volume 2, pages 3528–3536, 2015. \nT. Shpakova and F. Bach. Parameter learning for log-supermodular distributions. In Advances in Neural Information Processing Systems, volume 29, pages 3234–3242, 2016. \nY. Song, A. Schwing, R. Urtasun, et al. Training deep neural networks via direct loss minimization. In International Conference on Machine Learning, pages 2169–2177, 2016. \nG. Tucker, A. Mnih, C. J. Maddison, D. Lawson, and J. Sohl-Dickstein. Rebar: Low-variance, unbiased gradient estimates for discrete latent variable models. Advances in Neural Information Processing Systems, 2017. \nM. J. Wainwright and M. I. Jordan. Graphical models, exponential families, and variational inference. Now Publishers Inc, 2008. \nP.-W. Wang, P. Donti, B. Wilder, and Z. Kolter. Satnet: Bridging deep learning and logical reasoning using a differentiable satisfiability solver. In International Conference on Machine Learning, pages 6545–6554. PMLR, 2019. \nB. Wilder, B. Dilkina, and M. Tambe. Melding the data-decisions pipeline: Decision-focused learning for combinatorial optimization. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 33, pages 1658–1665, 2019. \nXi’an. Which pdf of x leads to a gumbel distribution of the finite-size average of $\\mathbf { \\boldsymbol { x } } \\mathrm { ? }$ Cross Validated, 2016. URL https://stats.stackexchange.com/q/214875. URL:https://stats.stackexchange.com/q/214875 (version: 2016-05-27). \nS. M. Xie and S. Ermon. Reparameterizable subset sampling via continuous relaxations. In IJCAI, 2019. ",
1229
+ "bbox": [
1230
+ 171,
1231
+ 116,
1232
+ 828,
1233
+ 916
1234
+ ],
1235
+ "page_idx": 10
1236
+ },
1237
+ {
1238
+ "type": "text",
1239
+ "text": "",
1240
+ "bbox": [
1241
+ 168,
1242
+ 56,
1243
+ 830,
1244
+ 917
1245
+ ],
1246
+ "page_idx": 11
1247
+ },
1248
+ {
1249
+ "type": "text",
1250
+ "text": "",
1251
+ "bbox": [
1252
+ 169,
1253
+ 83,
1254
+ 828,
1255
+ 578
1256
+ ],
1257
+ "page_idx": 12
1258
+ }
1259
+ ]
parse/train/lR4aaWCQgB/lR4aaWCQgB_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/lR4aaWCQgB/lR4aaWCQgB_model.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/nQxCYIFk7Rz/nQxCYIFk7Rz.md ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/nQxCYIFk7Rz/nQxCYIFk7Rz_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/rygBVTVFPB/rygBVTVFPB.md ADDED
@@ -0,0 +1,368 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # LEARNING TO DISCRETIZE: SOLVING 1D SCALAR CONSERVATION LAWS VIA DEEP REINFORCEMENT LEARNING
2
+
3
+ Anonymous authors Paper under double-blind review
4
+
5
+ # ABSTRACT
6
+
7
+ Conservation laws are considered to be fundamental laws of nature. It has broad application in many fields including physics, chemistry, biology, geology, and engineering. Solving the differential equations associated with conservation laws is a major branch in computational mathematics. Recent success of machine learning, especially deep learning, in areas such as computer vision and natural language processing, has attracted a lot of attention from the community of computational mathematics and inspired many intriguing works in combining machine learning with traditional methods. In this paper, we are the first to view numerical PDE solvers as a MDP and to use (deep) RL to learn new solvers. As a proof of concept, we focus on 1-dimensional scalar conservation laws. We deploy the machinery of deep reinforcement learning to train a policy network that can decide on how the numerical solutions should be approximated in a sequential and spatial-temporal adaptive manner. We will show that the problem of solving conservation laws can be naturally viewed as a sequential decision making process and the numerical schemes learned in such a way can easily enforce long-term accuracy. Furthermore, the learned policy network is carefully designed to determine a good local discrete approximation based on the current state of the solution, which essentially makes the proposed method a meta-learning approach. In other words, the proposed method is capable of learning how to discretize for a given situation mimicking human experts. Finally, we will provide details on how the policy network is trained, how well it performs compared with some state-of-the-art numerical solvers such as WENO schemes, and how well it generalizes. Our code is released anomynously at https://github.com/qwerlanksdf/L2D.
8
+
9
+ # 1 INTRODUCTION
10
+
11
+ Conservation laws are considered to be one of the fundamental laws of nature, and has broad applications in multiple fields such as physics, chemistry, biology, geology, and engineering. For example, Burger’s equation, a very classic partial differential equation (PDE) in conservation laws, has important applications in fluid mechanics, nonlinear acoustics, gas dynamics, and traffic flow.
12
+
13
+ Solving the differential equations associated with conservation laws has been a major branch of computational mathematics (LeVeque, 1992; 2002), and a lot of effective methods have been proposed, from classic methods such as the upwind scheme, the Lax-Friedrichs scheme, to the advanced ones such as the ENO/WENO schemes (Liu et al., 1994; Shu, 1998), the flux-limiter methods (Jerez Galiano & Uh Zapata, 2010), and etc. In the past few decades, these traditional methods have been proven successful in solving conservation laws. Nonetheless, the design of some of the high-end methods heavily relies on expert knowledge and the coding of these methods can be a laborious process. To ease the usage and potentially improve these traditional algorithms, machine learning, especially deep learning, has been recently incorporated into this field. For example, the ENO scheme requires lots of ‘if/else’ logical judgments when used to solve complicated system of equations or high-dimensional equations. This very much resembles the old-fashioned expert systems. The recent trend in artificial intelligence (AI) is to replace the expert systems by the so-called ‘connectionism’, e.g., deep neural networks, which leads to the recent bloom of AI. Therefore, it is natural and potentially beneficial to introduce deep learning in traditional numerical solvers of conservation laws.
14
+
15
+ # 1.1 RELATED WORKS
16
+
17
+ In the last few years, neural networks (NNs) have been applied to solving ODEs/PDEs or the associated inverse problems. These works can be roughly classified into three categories according to the way that the NN is used.
18
+
19
+ The first type of works propose to harness the representation power of NNs, and are irrelevant to the numerical discretization based methods. For example, Raissi et al. (2017a;b); Yohai Bar-Sinai (2018) treated the NNs as new ansatz to approximate solutions of PDEs. It was later generalized by Wei et al. (2019) to allow randomness in the solution which is trained using policy gradient. More recent works along this line include (Magiera et al., 2019; Michoski et al., 2019; Both et al., 2019). Besides, several works have focused on using NNs to establish direct mappings between the parameters of the PDEs (e.g. the coefficient field or the ground state energy) and their associated solutions (Khoo et al., 2017; Khoo & Ying, 2018; Li et al., 2019; Fan et al., 2018b). Furthermore, Han et al. (2018); Beck et al. (2017) proposed a method to solve very high-dimensional PDEs by converting the PDE to a stochastic control problem and use NNs to approximate the gradient of the solution.
20
+
21
+ The second type of works focus on the connection between deep neural networks (DNNs) and dynamic systems (Weinan, 2017; Chang et al., 2017; Lu et al., 2018; Long et al., 2018b; Chen et al., 2018). These works observed that there are connections between DNNs and dynamic systems (e.g. differential equations or unrolled optimization algorithms) so that we can combine deep learning with traditional tools from applied and computational mathematics to handle challenging tasks in inverse problems (Long et al., 2018b;a; Qin et al., 2018).The main focus of these works, however, is to solve inverse problems, instead of learning numerical discretizations of differential equations. Nonetheless, these methods are closely related to numerical differential equations since learning a proper discretization is often an important auxiliary task for these methods to accurately recover the form of the differential equations.
22
+
23
+ The third type of works, which target at using NNs to learn new numerical schemes, are closely related to our work. However, we note that these works mainly fall in the setting of supervised learning (SL). For example, Discacciati et al. (2019) proposed to integrate NNs into high-order numerical solvers to predict artificial viscosity; Ray & Hesthaven (2018) trained a multilayer perceptron to replace traditional indicators for identifying troubled-cells in high-resolution schemes for conservation laws. These works greatly advanced the development in machine learning based design of numerical schemes for conservation laws. Note that in Discacciati et al. (2019), the authors only utilized the one-step error to train the artificial viscosity networks without taking into account the longterm accuracy of the learned numerical scheme. Ray & Hesthaven (2018) first constructed several functions with known regularities and then used them to train a neural network to predict the location of discontinuity, which was later used to choose a proper slope limiter. Therefore, the training of the NNs is separated from the numerical scheme. Then, a natural question is whether we can learn discretization of differential equations in an end-to-end fashion and the learned discrete scheme also takes long-term accuracy into account. This motivates us to employ reinforcement learning to learn good solvers for conservation laws.
24
+
25
+ # 1.2 OUR APPROACH
26
+
27
+ The main objective of this paper is to design new numerical schemes in an autonomous way. We propose to use reinforcement learning (RL) to aid the process of solving the conservation laws. To our best knowledge, we are the first to regard numerical PDE solvers as a MDP and to use (deep) RL to learn new solvers. We carefully design the proposed RL-based method so that the learned policy can generate high accuracy numerical schemes and can well generalize in varied situations. Details will be given in section 3.
28
+
29
+ Here, we first provide a brief discussion on the benefits of using RL to solve conservation laws (the arguments apply to general evolution PDEs as well):
30
+
31
+ • Most of the numerical solvers of conservation law can be interpreted naturally as a sequential decision making process (e.g., the approximated grid values at the current time instance definitely affects all the future approximations). Thus, it can be easily formulated as a Markov Decision Process (MDP) and solved by RL.
32
+
33
+ • In almost all the RL algorithms, the policy $\pi$ (which is the AI agent who decides on how the $\begin{array} { r } { r ( s _ { 0 } , a _ { 0 } ) + \sum _ { t = 1 } ^ { \infty } \gamma ^ { t } \dot { r } ( s _ { t } , a _ { t } ) } \end{array}$ ated locally) is optimized with regards to the values , which by definition considers the long-term accumula $Q ^ { \pi } ( s _ { 0 } , a _ { 0 } ) =$ error of the learned numerical scheme), thus could naturally guarantee the long-term accuracy of the learned schemes, instead of greedily deciding the local approximation which is the case for most numerical PDEs solvers. Furthermore, it can gracefully handle the cases when the action space is discrete, which is in fact one of the major strength of RL.
34
+
35
+ • By optimizing towards long-term accuracy and effective exploration, we believe that RL has a good potential in improving traditional numerical schemes, especially in parts where no clear design principles exist. For example, although the WENO-5 scheme achieves optimal order of accuracy at smooth regions of the solution (Shu, 1998), the best way of choosing templates near singularities remains unknown. Our belief that RL could shed lights on such parts is later verified in the experiments: the trained RL policy demonstrated new behaviours and is able to select better templates than WENO and hence approximate the solution better than WENO near singularities.
36
+
37
+ • Non-smooth norms such as the infinity norm of the error is often used to evaluate the performance of the learned numerical schemes. As the norm of the error serves as the loss function for the learning algorithms, computing the gradient of the infinity norm can be problematic for supervised learning, while RL does not have such problem since it does not explicitly take gradients of the loss function (i.e. the reward function for RL).
38
+
39
+ • Learning the policy $\pi$ within the RL framework makes the algorithm meta-learning-like (Schmidhuber, 1987; Bengio et al., 1992; Andrychowicz et al., 2016; Li & Malik, 2016; Finn et al., 2017). The learned policy $\pi$ can decide on which local numerical approximation to use by judging from the current state of the solution (e.g. local smoothness, oscillatory patterns, dissipation, etc). This is vastly different from regular (non-meta-) learning where the algorithms directly make inference on the numerical schemes without the aid of an additional network such as $\pi$ . As subtle the difference as it may seem, meta-learning-like methods have been proven effective in various applications such as in image restoration (Jin et al., 2017; Fan et al., 2018a; Zhang et al., 2019). See (Vanschoren, 2018) for a comprehensive survey on meta-learning.
40
+
41
+ • Another purpose of this paper is to raise an awareness of the connection between MDP and numerical PDE solvers, and the general idea of how to use RL to improve PDE solvers or even finding brand new ones. Furthermore, in computational mathematics, a lot of numerical algorithms are sequential, and the computation at each step is expert-designed and usually greedy, e.g., the conjugate gradient method, the fast sweeping method (Zhao, 2005), matching pursuit (Mallat & Zhang, 1993), etc. We hope our work could motivate more researches in combining RL and computational mathematics, and stimulate more exploration on using RL as a tool to tackle the bottleneck problems in computational mathematics.
42
+
43
+ Our paper is organized as follows. In section 2 we briefly review 1-dimensional conservation laws and the WENO schemes. In section 3, we discuss how to formulate the process of numerically solving conservation laws into a Markov Decision Process. Then, we present details on how to train a policy network to mimic human expert in choosing discrete schemes in a spatial-temporary adaptive manner by learning upon WENO. In section 4, we conduct numerical experiments on 1-D conservation laws to demonstrate the performance of our trained policy network. Our experimental results show that the trained policy network indeed learned to adaptively choose good discrete schemes that offer better results than the state-of-the-art WENO scheme which is 5th order accurate in space and 4th order accurate in time. This serves as an evidence that the proposed RL framework has the potential to design high-performance numerical schemes for conservation laws in a data-driven fashion. Furthermore, the learned policy network generalizes well to other situations such as different initial conditions, mesh sizes, temporal discrete schemes, etc. The paper ends with a conclusion in section 5, where possible future research directions are also discussed.
44
+
45
+ # 2 PRELIMINARIES
46
+
47
+ # 2.1 NOTATIONS
48
+
49
+ In this paper, we consider solving the following 1-D conservation laws:
50
+
51
+ $$
52
+ u _ { t } ( x , t ) + f _ { x } ( u ( x , t ) ) = 0 , a \leq x \leq b , t \in [ 0 , T ] , u ( x , 0 ) = u _ { 0 } ( x ) .
53
+ $$
54
+
55
+ For example, $\begin{array} { r } { f = \frac { u ^ { 2 } } { 2 } } \end{array}$ is the famous Burger’s Equation. We discretize the $( x , t )$ -plane by choosing a mesh with spatial size and temporal step size $\Delta t$ , and define the discrete mesh points $( x _ { j } , t _ { n } )$ by
56
+
57
+ $$
58
+ x _ { j } = a + j \Delta x , \ t _ { n } = n \Delta t \quad { \mathrm { w i t h } } \ j = 0 , 1 , . . . , J = { \frac { b - a } { \Delta x } } , \ n = 0 , 1 , . . . , N = \frac { T } { \Delta t } .
59
+ $$
60
+
61
+ We denote $x _ { j + \frac { 1 } { 2 } } = x _ { j } + \Delta x / 2 = a + ( j + \textstyle { \frac { 1 } { 2 } } ) \Delta x$ . The finite difference methods will produce approximations $U _ { j } ^ { n }$ to the solution $u ( x _ { j } , t _ { n } )$ on the given discrete mesh points. We denote pointwise values of the true solution to be $u _ { j } ^ { n } = u ( x _ { j } , t _ { n } )$ , and the true point-wise flux values to be $f _ { j } ^ { n } = f ( u ( x _ { j } , t _ { n } ) )$ .
62
+
63
+ # 2.2 WENO – WEIGHTED ESSENTIALLY NON-OSCILLATORY SCHEMES
64
+
65
+ WENO (Weighted Essentially Non-Oscillatory) (Liu et al., 1994) is a family of high order accurate finite difference schemes for solving hyperbolic conservation laws, and has been successful for many practical problems. The key idea of WENO is a nonlinear adaptive procedure that automatically chooses the smoothest local stencil to reconstruct the numerical flux. Generally, a finite difference method solves Eq.1 by using a conservative approximation to the spatial derivative of the flux:
66
+
67
+ $$
68
+ \frac { d u _ { j } ( t ) } { d t } = - \frac { 1 } { \Delta x } \left( \hat { f } _ { j + \frac { 1 } { 2 } } - \hat { f } _ { j - \frac { 1 } { 2 } } \right) ,
69
+ $$
70
+
71
+ where $u _ { j } ( t )$ is the numerical approximation to the point value $u ( x _ { j } , t )$ and ${ \hat { f } } _ { j + { \frac { 1 } { 2 } } }$ is the numerical flux generated by a numerical flux policy
72
+
73
+ $$
74
+ { \hat { f } } _ { j + \frac { 1 } { 2 } } = { \pi } ^ { f } ( u _ { j - r } , . . . , u _ { j + s } ) ,
75
+ $$
76
+
77
+ which is manually designed. Note that the term “numerical flux policy" is a new terminology that we introduce in this paper, which is exactly the policy we shall learn using RL. In WENO, $\bar { \pi } ^ { f }$ works as follows. Using the physical flux values $\{ f _ { j - 2 } , f _ { j - 1 } , f _ { j } \}$ , we could obtain a $3 ^ { t h }$ order accurate polynomial interpolation $\hat { f } _ { j + \frac { 1 } { 2 } } ^ { - 2 }$ , where the indices $\{ j - 2 , j - 1 , j \}$ is called a ‘stencil’. We could also use the stencil $\hat { f } _ { j + \frac { 1 } { 2 } } ^ { - 1 } , \hat { f } _ { j + \frac { 1 } { 2 } } ^ { 0 }$ an $\{ j - 1 , j , j + 1 \}$ d ˆf 1j+ 12 . The key idea of WENO is to average (with properly designed weights) all , $\{ j , j { + } 1 , j { + } 2 \}$ or to obtain another three interpolants these interpolants to obtain the final reconstruction: $\begin{array} { r } { \hat { f } _ { j + \frac { 1 } { 2 } } = \sum _ { r = - 2 } ^ { 1 } w _ { r } \hat { f } _ { j + 1 / 2 } ^ { r } } \end{array}$ , $\scriptstyle \sum _ { r = - 2 } ^ { 1 } w _ { r } = 1$ .
78
+
79
+ The weight $w _ { i }$ depends on the smoothness of the stencil. A general principal is: the smoother is the stencil, the more accurate is the interpolant and hence the larger is the weight. To ensure convergence, we need the numerical scheme to be consistent and stable (LeVeque, 1992). It is known that WENO schemes as described above are consistent. For stability, upwinding is required in constructing the flux. The most easy way is to use the sign of the Roe speed $\bar { a } _ { j + \frac { 1 } { 2 } } = ( f _ { j + \frac { 1 } { 2 } } - f _ { j - \frac { 1 } { 2 } } ) / ( u _ { j + \frac { 1 } { 2 } } - u _ { j - \frac { 1 } { 2 } } )$ to determine the upwind direction: if $\bar { a } _ { j + \frac { 1 } { 2 } } \geq 0$ , we only average among the three interpolants $\hat { f } _ { j + \frac { 1 } { 2 } } ^ { - 2 }$ , $\hat { f } _ { j + \frac { 1 } { 2 } } ^ { - 1 }$ an d ˆf 0j+ 12 ; if a¯j+ 12 < 0, we use ˆf $\hat { f } _ { j + \frac { 1 } { 2 } } ^ { - 1 } , \hat { f } _ { j + \frac { 1 } { 2 } } ^ { 0 }$ and ˆf 1j + 12 .
80
+
81
+ Some further thoughts. WENO achieves optimal order of accuracy (up to 5) at the smooth region of the solutions (Shu, 1998), while lower order of accuracy at singularities. The key of the WENO method lies in how to compute the weight vector $( w _ { 1 } , w _ { 2 } , w _ { 3 } , w _ { 4 } )$ , which primarily depends on the smoothness of the solution at local stencils. In WENO, such smoothness is characterized by handcrafted formula, and was proven to be successful in many practical problems when coupled with high-order temporal discretization. However, it remains unknown whether there are better ways to combine the stencils so that optimal order of accuracy in smooth regions can be reserved while, at the same time, higher accuracy can be achieved near singularities. Furthermore, estimating the upwind directions is another key component of WENO, which can get quite complicated in high-dimensional situations and requires lots of logical judgments (i.e. “if/else"). Can we ease the (some time painful) coding and improve the estimation at the aid of machine learning?
82
+
83
+ # 3 METHODS
84
+
85
+ In this section we present how to employ reinforcement learning to solve the conservation laws given by Eq.1. To better illustrate our idea, we first show in general how to formulate the process of numerically solving a conservation law into an MDP. We then discuss how to incorporate a policy network with the WENO scheme. Our policy network targets at the following two key aspects of WENO: (1) Can we learn to choose better weights to combine the constructed fluxes? (2) Can we learn to automatically judge the upwind direction, without complicated logical judgments?
86
+
87
+ # 3.1 MDP FORMULATION
88
+
89
+ # Algorithm 1: A Conservation Law Solving Procedure
90
+
91
+ 1 Input: initial values $u _ { 0 } ^ { 0 } , u _ { 1 } ^ { 0 } , . . . , u _ { J } ^ { 0 }$ , flux $f ( u ) , \Delta x , \Delta t$ , evolve time $N$ , left shift $r$ and right shift $s$ .
92
+ 2 Output: $\{ U _ { j } ^ { n } | j = 0 , . . . , J , n = 1 , . . . , N \}$
93
+ 3 $U _ { j } ^ { 0 } = u _ { j } ^ { 0 }$ , $j = 0 , . . . , J$
94
+ 4 for $n = 1$ to $N$ do
95
+ 5 for $\overline { { j = 0 } }$ to $J$ do
96
+ 6 cal flux , e.g., u $\hat { f } _ { j - \frac { 1 } { 2 } } ^ { n } = \pi ^ { f } ( U _ { j - r - 1 } ^ { n - 1 } , U _ { j - r } ^ { n - 1 } , . . . , U _ { j + s - 1 } ^ { n - 1 } )$ U n−1j+s−1) and f $\hat { f } _ { j + \frac { 1 } { 2 } } ^ { n } = \pi ^ { f } ( U _ { j - r } ^ { n - 1 }$ ,
97
+ $U _ { j - r + 1 } ^ { n - 1 } , . . . , U _ { j + s } ^ { n - 1 } )$
98
+ 7 Compute $\begin{array} { r } { \frac { d u _ { j } ( t ) } { d t } = - \frac { 1 } { \Delta x } \big ( \hat { f } _ { { j + \frac { 1 } { 2 } } } ^ { n } - \hat { f } _ { { j - \frac { 1 } { 2 } } } ^ { n } \big ) } \end{array}$
99
+ 8 Compute U nj = πt(U n−1j , duj (t)dt ), e.g., using the Euler scheme U nj = U n−1j + ∆t duj (t)dt
100
+ 9 Return $\{ U _ { j } ^ { n } | j = 0 , . . . , J , n = 1 , . . . , N \}$
101
+
102
+ As shown in Algorithm 1, the procedure of numerically solving a conservation law is naturally a sequential decision making problem. The key of the procedure is the numerical flux policy $\pi ^ { f }$ and the temporal scheme $\pi ^ { t }$ as shown in line 6 and 8 in Algorithm 1. Both policies could be learned using RL. However, in this paper, we mainly focus on using RL to learn the numerical flux policy $\pi ^ { f }$ , while leaving the temporal scheme $\pi ^ { t }$ with traditional numerical schemes such as the Euler scheme or the Runge–Kutta methods. A quick review of RL is given in the appendix.
103
+
104
+ Now, we show how to formulate the above procedure as an MDP and the construction of the state $S$ , action $A$ , reward $r$ and transition dynamics $P$ . Algorithm 2 shows in general how RL is incorporated into the procedure. In Algorithm 2, we use a single RL agent. Specifically, when computing $U _ { j } ^ { n }$ :
105
+
106
+ • The state for the RL agent is $s _ { j } ^ { n } = g _ { s } ( U _ { j - r - 1 } ^ { n - 1 } , . . . , U _ { j + s } ^ { n - 1 } )$ , where $g _ { s }$ is the state function.
107
+
108
+ • In general, the action of the agent is used to determine how the numerical fluxes $\hat { f } _ { j + \frac { 1 } { 2 } } ^ { n }$ and $\hat { f } _ { j - \frac { 1 } { 2 } } ^ { n }$ is computed. In the next subsection, we detail how we incorporate $a _ { j } ^ { n }$ to be the linear weights of the fluxes computed using different stencils in the WENO scheme. • The reward should encourage the agent to generate a scheme that minimizes the error between its approximated value and the true value. Therefore, we define the reward function as $r _ { j } ^ { n } =$ $g _ { r } ( U _ { j - r - 1 } ^ { n } - u _ { j - r - 1 } ^ { n } , \cdot \cdot \cdot , U _ { j + s } ^ { n } - u _ { j + s } ^ { n } )$ , e.g., a simplest choice is $g _ { r } = - | | \cdot | | _ { 2 }$ . • The transition dynamics $P$ is fully deterministic, and depends on the choice of the temporal scheme at line 10 in Algorithm 2. Note that the next state can only be constructed when we have obtained all the point values in the next time step, i.e., n n $s _ { j } ^ { n + 1 } = \stackrel { \cdot } { g _ { s } } ( U _ { j - r - 1 } ^ { n } , . . . , U _ { j + s } ^ { n } )$ does not only depends on action $a _ { j } ^ { n }$ , but also on actions $a _ { j - r - 1 } ^ { n } , . . . , a _ { j + s } ^ { n }$ j−(action $a _ { j } ^ { n }$ j+scan only determine the value $U _ { j } ^ { n } .$ ). This subtlety can be resolved by viewing the process under the framework of multi-agent RL, in which at each mesh point $j$ we use a distinct agent $A _ { j } ^ { R L }$ , and the next state sn+1j = $s _ { j } ^ { n + 1 } = g _ { s } ( U _ { j - r - 1 } ^ { n } , . . . , U _ { j + s } ^ { n } )$ depends on these agents’ joint action $\mathbf { a } _ { \mathbf { j } } ^ { \mathbf { n } } = ( a _ { j - r - 1 } ^ { n } , . . . , a _ { j + s } ^ { n } )$
109
+
110
+ However, it is impractical to train $J$ different agents as $J$ is usually very large, therefore we enforce the agents at different mesh point $j$ to share the same weight, which reduces to case of using just a single agent. The single agent can be viewed as a counterpart of a human designer who decides on the choice of a local scheme based on the current state in traditional numerical methods.
111
+
112
+ # Algorithm 2: General RL Running Procedure
113
+
114
+ <table><tr><td rowspan="11">1 Input: initial values u8,.,u,flux f(u),△x,△t,evolve time N,left shift r, right shift s and RL policy πRL</td><td></td></tr><tr><td>2 Output: {U| j = 0,..,J, n = 1,.., N} U</td></tr><tr><td>=ug,j=0.,..J</td></tr><tr><td>forMany iterationsdo</td></tr><tr><td>Construct initial states s = gs(U𝑗-r-1,.,U}+s) for j =0.,., J</td></tr><tr><td>for n=1 to N do</td></tr><tr><td>forj=OtoJdo</td></tr><tr><td>7 Compute the action a = πRL(s)that determines how j fn and fn is computed</td></tr><tr><td>8 1 1 Jj+ duj(t) f一 Compute 1 fn 9</td></tr><tr><td>dt △x (Jj+ 1 ) +△tduj(t)</td></tr><tr><td>10 Compute the rewardr =gr(U-r-1-u_r-1,,U+s-u+s). , dt dt</td></tr><tr><td>11</td></tr><tr><td>=gs(u−r-1,,+s)forj=0,,J 12</td></tr><tr><td>13 )j=0.</td></tr><tr><td></td></tr></table>
115
+
116
+ 14 Return the well-trained RL policy $\pi ^ { R L }$
117
+
118
+ # 3.2 RL EMPOWERED WENO
119
+
120
+ We now present how to transfer the actions of the RL policy to the weights of WENO fluxes. Instead of directly using $\pi ^ { R L }$ to generate the numerical flux, we use it to produce the weights of numerical fluxes computed using different stencils in WENO. Since the weights are part of the configurations of the WENO scheme, our design of action essentially makes the RL policy a meta-learner, and enables more stable learning and better generalization power than directly generating the fluxes.
121
+
122
+ Specifically, at point $x _ { j }$ (here we drop the time superscript $n$ for simplicity), to compute the numerical flux ${ \hat { f } } _ { j - { \frac { 1 } { 2 } } }$ and ${ \hat { f } } _ { j + { \frac { 1 } { 2 } } }$ , we first construct four fluxes $\{ \hat { f } _ { j - \frac { 1 } { 2 } } ^ { i } \} _ { i = - 2 } ^ { 1 }$ and $\{ \hat { f } _ { j + \frac { 1 } { 2 } } ^ { i } \} _ { i = - 2 } ^ { 1 }$ using four different stencils just as in WENO, and then use the RL policy $\pi ^ { R L }$ to generate the weights of these fluxes:
123
+
124
+ $$
125
+ \pi ^ { R L } ( s _ { j } ) = \left( w _ { j - \frac { 1 } { 2 } } ^ { - 2 } , w _ { j - \frac { 1 } { 2 } } ^ { - 1 } , w _ { j - \frac { 1 } { 2 } } ^ { 0 } , w _ { j - \frac { 1 } { 2 } } ^ { 1 } , w _ { j + \frac { 1 } { 2 } } ^ { - 2 } , w _ { j + \frac { 1 } { 2 } } ^ { - 1 } , w _ { j + \frac { 1 } { 2 } } ^ { 0 } , w _ { j + \frac { 1 } { 2 } } ^ { 1 } \right) .
126
+ $$
127
+
128
+ onstructed by averaging these fluxes: $\begin{array} { r } { \hat { f } _ { j - \frac { 1 } { 2 } } = \sum _ { i = - 2 } ^ { 1 } w _ { j - \frac { 1 } { 2 } } ^ { i } \hat { f } _ { j - \frac { 1 } { 2 } } ^ { i } } \end{array}$ − 12 , and $\begin{array} { r } { \hat { f } _ { j + \frac { 1 } { 2 } } = \sum _ { i = - 2 } ^ { 1 } w _ { j + \frac { 1 } { 2 } } ^ { i } \hat { f } _ { j + \frac { 1 } { 2 } } ^ { i } . } \end{array}$
129
+
130
+ Note that the determination of upwind direction is automatically embedded in the RL policy since it generates four weights at once. For instance, when the roe speed $\bar { a } _ { j + \frac { 1 } { 2 } } \geq 0$ , we expect the $4 ^ { t h }$ weight $w _ { j + \frac { 1 } { 2 } } ^ { 1 } \approx 0$ and when $\bar { a } _ { j + \frac { 1 } { 2 } } < 0$ , we expect $w _ { j + \frac { 1 } { 2 } } ^ { - 2 } \approx 0$ . Note that the upwind direction can be very complicated in a system of equations or in the high-dimensional situations, and using the policy network to automatically embed such a process could save lots of efforts in algorithm design and implementation. Our numerical experiments show that $\pi ^ { R L }$ can indeed automatically determine upwind directions for 1D scalar cases. Although this does not mean that it works for systems and/or in high-dimensions, it shows the potential of the proposed framework and value for further studies.
131
+
132
+ # 4 EXPERIMENTS
133
+
134
+ In this section, we describe training and testing of the proposed RL conservation law solver and compare it with WENO. More comparisons and discussions can be found in the appendix.
135
+
136
+ # 4.1 SETUP
137
+
138
+ In this subsection, we explain the general training setup. We train the RL policy network on the Burger’s equation, whose flux is computed as $\begin{array} { r } { f ( u ) = \frac { 1 } { 2 } u ^ { 2 } } \end{array}$ . In all the experiments, we set the left-shift $r = 2$ and the right shift $s = 3$ . The state function $g _ { s } ( \overline { { \mathscr { s } } } _ { j } ) = g _ { s } ( U _ { j - r - 1 } , . . . , U _ { j + s } )$ will generate two vectors: $s ^ { l } = ( f _ { j - r - 1 } , . . . , f _ { j + s - 1 } , \bar { a } _ { j - \frac { 1 } { 2 } } )$ , and $s ^ { r } = ( f _ { j - r } , . . . , f _ { j + s } , \bar { a } _ { j + \frac { 1 } { 2 } } )$ for computing ${ \hat { f } } _ { j - { \frac { 1 } { 2 } } }$ and ${ \hat { f } } _ { j + { \frac { 1 } { 2 } } }$ respectively. $s _ { l }$ and $s _ { r }$ will be passed into the same policy neural network $\pi _ { \boldsymbol { \theta } } ^ { R L }$ to produce the desired actions, as described in section 3.2. The reward function $g _ { r }$ simply computes the infinity norm, i.e., $g _ { r } ( U _ { j - r - 1 } - u _ { j - r - 1 } , . . . , U _ { j + s } - u _ { j + s } ) = - | | ( U _ { j - r - 1 } - u _ { j - r - 1 } , . . . , \bar { U } _ { j + s } - u _ { j + s } ) | | _ { \infty } .$ . The policy network $\pi _ { \boldsymbol { \theta } } ^ { R L }$ is a feed-forward Multi-layer Perceptron with 6 hidden layers, each has 64 neurons and use Relu (Goodfellow et al., 2016) as the activation function. We use the Deep Deterministic Policy Gradient Algorithm (Lillicrap et al., 2015) to train the RL policy.
139
+
140
+ To guarantee the generalization power of the trained RL agent, we randomly sampled 20 initial conditions in the form $u _ { 0 } ( x ) = { \bigcirc } + b \cdot \operatorname { f u n c } ( c \pi x )$ , where $| \bar { a } | + | b | \leq 3 . 5$ , func $\in \{ s i n , c o s \}$ and $c \in \{ 2 , 4 , 6 \}$ . The goal of generating such kind of initial conditions is to ensure they have similar degree of smoothness and thus similar level of difficulty in learning. The computation domain is $- 1 \leq x \leq 1$ and $0 \leq t \leq 0 . 8$ with $\Delta x = 0 . 0 2$ , $\Delta t = 0 . 0 0 4$ , and evolve steps $N = 2 0 0$ (which ensures the appearance of shocks). When training the RL agent, we use the Euler scheme for temporal discretization. The true solution needed for reward computing is generated using WENO on the same computation domain with $\Delta x = 0 . 0 0 1$ , $\Delta t = 0 . 0 0 0 2$ and the 4th order Runge-Kutta (RK4).
141
+
142
+ In the following, we denote the policy network that generates the weights of the WENO fluxes (as described in section 3.2) as RL-WENO. We randomly generated another different 10 initial conditions in the same form as training for testing.
143
+
144
+ Table 1: Comparison of relative errors $( \times 1 0 ^ { - 2 } )$ of RL-WENO and WENO with standard deviations of the errors among 10 trials in the parenthesis. Temporal discretization: RK4; flux function: $\scriptstyle { \frac { 1 } { 2 } } u ^ { 2 }$ .
145
+
146
+ <table><tr><td rowspan=2 colspan=1>△x△t</td><td rowspan=1 colspan=2>0.02</td><td rowspan=1 colspan=2>0.04</td><td rowspan=1 colspan=2>0.05</td></tr><tr><td rowspan=1 colspan=1>RL-WENO</td><td rowspan=1 colspan=1>WENO</td><td rowspan=1 colspan=1>RL-WENO</td><td rowspan=1 colspan=1>WENO</td><td rowspan=1 colspan=1>RL-WENO</td><td rowspan=1 colspan=1>WENO</td></tr><tr><td rowspan=1 colspan=1>0.002</td><td rowspan=1 colspan=1>5.66 (1.59)</td><td rowspan=1 colspan=1>5.89 (1.74)</td><td rowspan=1 colspan=1>8.76 (2.50)</td><td rowspan=1 colspan=1>9.09 (2.62)</td><td rowspan=1 colspan=1>9.71 (2.42)</td><td rowspan=1 colspan=1>10.24 (2.84)</td></tr><tr><td rowspan=1 colspan=1>0.003</td><td rowspan=1 colspan=1>5.64 (1.54)</td><td rowspan=1 colspan=1>5.86 (1.67)</td><td rowspan=1 colspan=1>8.73 (2.46)</td><td rowspan=1 colspan=1>9.06 (2.58)</td><td rowspan=1 colspan=1>9.75 (2.41)</td><td rowspan=1 colspan=1>10.28 (2.81)</td></tr><tr><td rowspan=1 colspan=1>0.004</td><td rowspan=1 colspan=1>5.63 (1.55)</td><td rowspan=1 colspan=1>5.81 (1.66)</td><td rowspan=1 colspan=1>8.72 (2.46)</td><td rowspan=1 colspan=1>9.05 (2.55)</td><td rowspan=1 colspan=1>9.61 (2.42)</td><td rowspan=1 colspan=1>10.13 (2.84)</td></tr><tr><td rowspan=1 colspan=1>0.005</td><td rowspan=1 colspan=1>5.08 (1.46)</td><td rowspan=1 colspan=1>5.19 (1.58)</td><td rowspan=1 colspan=1>8.29 (2.34)</td><td rowspan=1 colspan=1>8.58 (2.47)</td><td rowspan=1 colspan=1>9.30 (2.26)</td><td rowspan=1 colspan=1>9.78 (2.69)</td></tr><tr><td rowspan=1 colspan=1>0.006</td><td rowspan=1 colspan=1>-</td><td rowspan=1 colspan=1>-</td><td rowspan=1 colspan=1>8.71 (2.49)</td><td rowspan=1 colspan=1>9.02 (2.61)</td><td rowspan=1 colspan=1>9.72 (2.38)</td><td rowspan=1 colspan=1>10.24 (2.80)</td></tr><tr><td rowspan=1 colspan=1>0.007</td><td rowspan=1 colspan=1>-</td><td rowspan=1 colspan=1>-</td><td rowspan=1 colspan=1>8.56 (2.49)</td><td rowspan=1 colspan=1>8.84 (2.62)</td><td rowspan=1 colspan=1>9.59 (2.41)</td><td rowspan=1 colspan=1>10.12 (2.80)</td></tr><tr><td rowspan=1 colspan=1>0.008</td><td rowspan=1 colspan=1>-</td><td rowspan=1 colspan=1>-</td><td rowspan=1 colspan=1>8.68 (2.55)</td><td rowspan=1 colspan=1>8.93 (2.66)</td><td rowspan=1 colspan=1>9.57 (2.49)</td><td rowspan=1 colspan=1>10.06 (2.92)</td></tr></table>
147
+
148
+ Table 2: Comparison of relative errors $( \times 1 0 ^ { - 2 } )$ of RL-WENO and WENO with standard deviations of the errors among 10 trials in the parenthesis. Temporal discretization: RK4; flux function: $\scriptstyle { \frac { 1 } { 1 6 } } u ^ { 4 }$ .
149
+
150
+ <table><tr><td rowspan=2 colspan=1>△x△t</td><td rowspan=1 colspan=2>0.02</td><td rowspan=1 colspan=2>0.04</td><td rowspan=1 colspan=2>0.05</td></tr><tr><td rowspan=1 colspan=1>RL-WENO</td><td rowspan=1 colspan=1>WENO</td><td rowspan=1 colspan=1>RL-WENO</td><td rowspan=1 colspan=1>WENO</td><td rowspan=1 colspan=1>RL-WENO</td><td rowspan=1 colspan=1>WENO</td></tr><tr><td rowspan=1 colspan=1>0.002</td><td rowspan=1 colspan=1>4.85 (1.15)</td><td rowspan=1 colspan=1>5.17 (1.26)</td><td rowspan=1 colspan=1>7.77 (1.95)</td><td rowspan=1 colspan=1>8.05 (2.02)</td><td rowspan=1 colspan=1>8.16 (1.93)</td><td rowspan=1 colspan=1>8.56 (2.19)</td></tr><tr><td rowspan=1 colspan=1>0.003</td><td rowspan=1 colspan=1>-</td><td rowspan=1 colspan=1>-</td><td rowspan=1 colspan=1>7.79 (1.96)</td><td rowspan=1 colspan=1>8.06 (2.03)</td><td rowspan=1 colspan=1>8.18 (1.92)</td><td rowspan=1 colspan=1>8.59 (2.18)</td></tr><tr><td rowspan=1 colspan=1>0.004</td><td rowspan=1 colspan=1>二</td><td rowspan=1 colspan=1>二</td><td rowspan=1 colspan=1>7.72 (1.93)</td><td rowspan=1 colspan=1>7.98 (2.01)</td><td rowspan=1 colspan=1>8.15 (1.95)</td><td rowspan=1 colspan=1>8.54 (2.20)</td></tr><tr><td rowspan=1 colspan=1>0.005</td><td rowspan=1 colspan=1>-</td><td rowspan=1 colspan=1>-</td><td rowspan=1 colspan=1>-</td><td rowspan=1 colspan=1>-</td><td rowspan=1 colspan=1>8.18 (1.94)</td><td rowspan=1 colspan=1>8.55 (2.15)</td></tr></table>
151
+
152
+ # 4.2 RESULTS
153
+
154
+ We compare the performance of RL-WENO and WENO. We also test whether the trained RL policy can generalize to different temporal discretization schemes, mesh sizes and flux functions that are not included in training. Table 1 and Table 2 present the comparison results, where the number shows the relative error (computed as ||U−u||2||u|| with the 2-norm taking over all x) between the approximated solution $U$ and the true solution $u$ , averaged over 250 evolving steps $T = 1 . 0$ ) and 10 random initial values. Numbers in the bracket shows the standard deviation over the 10 initial conditions. Several entries in the table are marked as ‘-’ because the corresponding CFL number is not small enough to guarantee convergence. Recall that training of the RL-WENO was conducted with Euler time discretization, $( \Delta x , \Delta t ) = ( 0 . 0 2 , 0 . 0 0 4 )$ , $T = 0 . 8$ and $\begin{array} { r } { f ( u ) = \frac { 1 } { 2 } u ^ { 2 } } \end{array}$ .
155
+
156
+ Our experimental results show that, compared with the high order accurate WENO (5th order accurate in space and 4th order accurate in time), the linear weights learned by RL not only achieves smaller errors, but also generalizes well to: 1) longer evolving time $T = 0 . 8$ for training and $T = 1 . 0$ for testing); 2) new time discretization schemes (trained on Euler, tested on RK4); 3) new mesh sizes (see Table 1 and Table 2 for results of varied $\Delta x$ and $\Delta t$ ); and 4) a new flux function (trained on $\begin{array} { r } { \dot { f } ( u ) = \frac { 1 } { 2 } u ^ { 2 } } \end{array}$ shown in Table 1, tested on $\scriptstyle { \frac { 1 } { 1 6 } } u ^ { 4 }$ Table 2).
157
+
158
+ Figure 1 shows some examples of the solutions. As one can see, the solutions generated by RL-WENO not only achieve the same accuracy as WENO at smooth regions, but also have clear advantage over WENO near singularities which is particularly challenging for numerical PDE solvers and important in applications. Figure 2 shows that the learned numerical flux policy can indeed correctly determine upwind directions and generate local numerical schemes in an adaptive fashion. More interestingly, Figure 2 further shows that comparing to WENO, RL-WENO seems to be able to select stencils in a different way from it, and eventually leads to a more accurate solution. This shows that the proposed RL framework has the potential to surpass human experts in designing numerical schemes for conservation laws.
159
+
160
+ ![](images/049a25870b4b0bef20a62a255c7558bada01c4e5293c345e5d3239f7fd743a16.jpg)
161
+ Figure 1: First row: solutions of RL-WENO (red), WENO (blue) and exact solutions (green). Second row: zoom-in views corresponding to the first row.
162
+
163
+ ![](images/f0d6377f47d74881b71ddd23684c41d376876f277c4535c3196dd91359330587.jpg)
164
+ Figure 2: This figure compares the weights generated by the learned numerical flux policy πthose of WENO. The weights shown in (a) are {wrj− 12 }1r=−2; while those in (b) are {wrj+ 12 } and . In each of the two plots, the 4 numbers in the upper bracket of each location are the weights of RLWENO and those in the lower bracket are the weights of WENO. The relative errors of RL-WENO and WENO are $8 . 0 \times 1 0 ^ { - 3 }$ and $2 . 5 \times 1 0 ^ { - 2 }$ respectively.
165
+
166
+ # 5 CONCLUSION
167
+
168
+ In this paper, we proposed a general framework to learn how to solve 1-dimensional conservation laws via deep reinforcement learning. We first discussed how the procedure of numerically solving conservation laws can be naturally cast in the form of Markov Decision Process. We then elaborated how to relate notions in numerical schemes of PDEs with those of reinforcement learning. In particular, we introduced a numerical flux policy which was able to decide on how numerical flux should be designed locally based on the current state of the solution. We carefully design the action of our RL policy to make it a meta-learner. Our numerical experiments showed that the proposed RL based solver was able to outperform high order WENO and was well generalized in various cases.
169
+
170
+ As part of the future works, we would like to consider using the numerical flux policy to inference more complicated numerical fluxes with guaranteed consistency and stability. Furthermore, we can use the proposed framework to learn a policy that can generate adaptive grids and the associated numerical schemes. Lastly, we would like consider system of conservation laws in 2nd and 3rd dimensional space.
171
+
172
+ # REFERENCES
173
+
174
+ Marcin Andrychowicz, Misha Denil, Sergio Gomez, Matthew W Hoffman, David Pfau, Tom Schaul, Brendan Shillingford, and Nando De Freitas. Learning to learn by gradient descent by gradient descent. In Advances in Neural Information Processing Systems, pp. 3981–3989, 2016.
175
+
176
+ Christian Beck, E Weinan, and Arnulf Jentzen. Machine learning approximation algorithms for highdimensional fully nonlinear partial differential equations and second-order backward stochastic differential equations. Journal of Nonlinear Science, pp. 1–57, 2017.
177
+
178
+ Samy Bengio, Yoshua Bengio, Jocelyn Cloutier, and Jan Gecsei. On the optimization of a synaptic learning rule. In Preprints Conf. Optimality in Artificial and Biological Neural Networks, pp. 6–8. Univ. of Texas, 1992.
179
+
180
+ Gert-Jan Both, Subham Choudhury, Pierre Sens, and Remy Kusters. Deepmod: Deep learning for model discovery in noisy data. arXiv preprint arXiv:1904.09406, 2019.
181
+
182
+ Bo Chang, Lili Meng, Eldad Haber, Frederick Tung, and David Begert. Multi-level residual networks from dynamical systems view. arXiv preprint arXiv:1710.10348, 2017.
183
+
184
+ Tian Qi Chen, Yulia Rubanova, Jesse Bettencourt, and David K Duvenaud. Neural ordinary differential equations. In Advances in Neural Information Processing Systems, pp. 6571–6583, 2018.
185
+
186
+ Niccolo’ Discacciati, Jan S Hesthaven, and Deep Ray. Controlling oscillations in high-order discontinuous galerkin schemes using artificial viscosity tuned by neural networks. Technical report, 2019.
187
+
188
+ Qingnan Fan, Dongdong Chen, Lu Yuan, Gang Hua, Nenghai Yu, and Baoquan Chen. Decouple learning for parameterized image operators. In Proceedings of the European Conference on Computer Vision (ECCV), pp. 442–458, 2018a.
189
+
190
+ Yuwei Fan, Lin Lin, Lexing Ying, and Leonardo Zepeda-Núnez. A multiscale neural network based on hierarchical matrices. arXiv preprint arXiv:1807.01883, 2018b.
191
+
192
+ Chelsea Finn, Pieter Abbeel, and Sergey Levine. Model-agnostic meta-learning for fast adaptation of deep networks. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pp. 1126–1135. JMLR. org, 2017.
193
+
194
+ Ian Goodfellow, Yoshua Bengio, and Aaron Courville. Deep learning. MIT press, 2016.
195
+
196
+ Jiequn Han, Arnulf Jentzen, and E Weinan. Solving high-dimensional partial differential equations using deep learning. Proceedings of the National Academy of Sciences, 115(34):8505–8510, 2018.
197
+
198
+ Silvia Jerez Galiano and Miguel Uh Zapata. A new tvd flux-limiter method for solving nonlinear hyperbolic equations. Journal of Computational and Applied Mathematics, 234(5):1395–1403, 2010.
199
+
200
+ Meiguang Jin, Stefan Roth, and Paolo Favaro. Noise-blind image deblurring. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 3510–3518, 2017.
201
+
202
+ Yuehaw Khoo and Lexing Ying. Switchnet: a neural network model for forward and inverse scattering problems. arXiv preprint arXiv:1810.09675, 2018.
203
+
204
+ Yuehaw Khoo, Jianfeng Lu, and Lexing Ying. Solving parametric pde problems with artificial neural networks. arXiv preprint arXiv:1707.03351, 2017.
205
+
206
+ Randall J LeVeque. Numerical methods for conservation laws, volume 132. Springer, 1992.
207
+
208
+ Randall J LeVeque. Finite volume methods for hyperbolic problems, volume 31. Cambridge university press, 2002.
209
+
210
+ Ke Li and Jitendra Malik. Learning to optimize. arXiv preprint arXiv:1606.01885, 2016.
211
+
212
+ Yingzhou Li, Jianfeng Lu, and Anqi Mao. Variational training of neural network approximations of solution maps for physical models. arXiv preprint arXiv:1905.02789, 2019.
213
+
214
+ Timothy P Lillicrap, Jonathan J Hunt, Alexander Pritzel, Nicolas Heess, Tom Erez, Yuval Tassa, David Silver, and Daan Wierstra. Continuous control with deep reinforcement learning. arXiv preprint arXiv:1509.02971, 2015.
215
+
216
+ Xu-Dong Liu, Stanley Osher, and Tony Chan. Weighted essentially non-oscillatory schemes. Journal of computational physics, 115(1):200–212, 1994.
217
+
218
+ Zichao Long, Yiping Lu, and Bin Dong. Pde-net 2.0: Learning pdes from data with a numericsymbolic hybrid deep network. arXiv preprint arXiv:1812.04426, 2018a.
219
+
220
+ Zichao Long, Yiping Lu, Xianzhong Ma, and Bin Dong. Pde-net: Learning pdes from data. In ICML, 2018b.
221
+
222
+ Yiping Lu, Aoxiao Zhong, Quanzheng Li, and Bin Dong. Beyond finite layer neural networks: Bridging deep architectures and numerical differential equations. In ICML, 2018.
223
+
224
+ Jim Magiera, Deep Ray, Jan S Hesthaven, and Christian Rohde. Constraint-aware neural networks for riemann problems. arXiv preprint arXiv:1904.12794, 2019.
225
+
226
+ Stéphane G Mallat and Zhifeng Zhang. Matching pursuits with time-frequency dictionaries. IEEE Transactions on signal processing, 41(12):3397–3415, 1993.
227
+
228
+ Craig Michoski, Milos Milosavljevic, Todd Oliver, and David Hatch. Solving irregular and dataenriched differential equations using deep neural networks. arXiv preprint arXiv:1905.04351, 2019.
229
+
230
+ 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.
231
+
232
+ Tong Qin, Kailiang Wu, and Dongbin Xiu. Data driven governing equations approximation using deep neural networks. arXiv preprint arXiv:1811.05537, 2018.
233
+
234
+ Maziar Raissi, Paris Perdikaris, and George Em Karniadakis. Physics informed deep learning (part i): Data-driven solutions of nonlinear partial differential equations. arXiv preprint arXiv:1711.10561, 2017a.
235
+
236
+ Maziar Raissi, Paris Perdikaris, and George Em Karniadakis. Physics informed deep learning (part ii): Data-driven discovery of nonlinear partial differential equations. arXiv preprint arXiv:1711.10566, 2017b.
237
+
238
+ Deep Ray and Jan S Hesthaven. An artificial neural network as a troubled-cell indicator. Journal of Computational Physics, 367:166–191, 2018.
239
+
240
+ Jurgen Schmidhuber. Evolutionary principles in self-referential learning. On learning how to learn: The meta-meta-... hook.) Diploma thesis, Institut f. Informatik, Tech. Univ. Munich, 1987.
241
+
242
+ John Schulman, Sergey Levine, Pieter Abbeel, Michael Jordan, and Philipp Moritz. Trust region policy optimization. In Proceedings of the 32nd International Conference on Machine Learning (ICML-15), pp. 1889–1897, 2015.
243
+
244
+ John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. Proximal policy optimization algorithms. arXiv preprint arXiv:1707.06347, 2017.
245
+
246
+ Chi-Wang Shu. Essentially non-oscillatory and weighted essentially non-oscillatory schemes for hyperbolic conservation laws. In Advanced numerical approximation of nonlinear hyperbolic equations, pp. 325–432. Springer, 1998.
247
+
248
+ 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.
249
+
250
+ Joaquin Vanschoren. Meta-learning: A survey. arXiv preprint arXiv:1810.03548, 2018.
251
+
252
+ Shiyin Wei, Xiaowei Jin, and Hui Li. General solutions for nonlinear differential equations: a rule-based self-learning approach using deep reinforcement learning. Computational Mechanics, pp. 1–14, 2019.
253
+
254
+ E Weinan. A proposal on machine learning via dynamical systems. Communications in Mathematics and Statistics, 5(1):1–11, 2017.
255
+
256
+ Jason Hickey Michael P. Brenner Yohai Bar-Sinai, Stephan Hoyer. Data-driven discretization: a method for systematic coarse graining of partial differential equations. arXiv preprint arXiv:1808.04930, 2018.
257
+
258
+ Xiaoshuai Zhang, Yiping Lu, Jiaying Liu, and Bin Dong. Dynamically unfolding recurrent restorer: A moving endpoint control method for image restoration. ICLR, 2019.
259
+
260
+ Hongkai Zhao. A fast sweeping method for eikonal equations. Mathematics of computation, 74 (250):603–627, 2005.
261
+
262
+ # A COMPLEMENTARY EXPERIMENTS
263
+
264
+ # A.1 COMPARISON WITH SUPERVISED LEARNING (SL) BASED METHODS
265
+
266
+ We first note that most of the neural network based numerical PDE solvers cited in the introduction requires retraining when the initialization, terminal time, or the form of the PDE is changed; while the proposed RL solver is much less restricted as shown in our numerical experiments. This makes proper comparisons between existing NN-based solvers and our proposed solver very difficult. Therefore, to demonstrate the advantage of our proposed RL PDE solver, we would like to propose a new SL method that does not require retraining when the test setting (e.g. initialization, flux function, etc.) is different from the training.
267
+
268
+ However, as far as we are concerned, it is challenging to design such SL methods without formulating the problem into an MDP. One may think that we can use WENO to generate the weights for the stencil at a particular grid point on a dense grid, and use the weights of WENO generated from the dense grid as the label to train a neural network in the coarse grid. But such setting has a fatal flaw in that the stencils computed in the dense grids are very different from those in the coarse grids, especially near singularities. Therefore, good weights on dense grids might perform very poorly on coarse grids. In other words, simple imitation of WENO on dense grids is not a good idea. One might also argue that instead of learning the weights of the stencils, we could instead generate the discrete operators, sthe numerical fluxes $f _ { j + \frac { 1 } { 2 } } ( u ) , f _ { j - \frac { 1 } { 2 } } ( u ) .$ iscretization of , etc., on a dense $\frac { \partial u _ { j } } { \partial x }$ , or the temporal discretization of d, and then use them as labels to tr $\frac { \partial u _ { j } } { \partial t }$ , neural network in the supervised fashion on a coarse grid. However, the major problem with such design is that there is no guarantee that the learned discrete operators obey the conservation property of the equations, and thus they may also generalize very poorly.
269
+
270
+ After formulating the problem into a MDP, there is indeed one way that we can use back-propagation (BP) instead of RL algorithms to optimize the policy network. Because all the computations on using the stencils to calculate the next-step approximations are differentiable, we can indeed use SL to train the weights. One possible way is to minimize the error (e.g. 2 norm) between the approximated and the true values, where the true value is pre-computed using a more accurate discretization on a fine mesh. The framework to train the SL network is described in Algorithm 3. Note that the framework to train the SL network is essentially the same as that of the proposed RL-WENO (Algorithm 2). The only difference is that we train the SL network using BP and the RL network using DDPG.
271
+
272
+ # Algorithm 3: Using BP instead of RL algorithm to train the policy
273
+
274
+ 1 Input: initial values $u _ { 0 } ^ { 0 } , . . . , u _ { J } ^ { 0 }$ , flux $f ( u ) , \Delta x , \Delta t .$ evolve time $N$ , left shift $r$ , right shift $s$ and a neural network
275
+ πθ
276
+ 2 Output: $\{ U _ { j } ^ { n } | j = 0 , . . . , J , n = 1 , . . . , N \}$
277
+ 3 $U _ { j } ^ { 0 } = u _ { j } ^ { 0 } , j = 0 , . . . , J$
278
+ 4 for Many iterations do
279
+ 5 Construct initial states $s _ { j } ^ { 0 } = g _ { s } ( U _ { j - r - 1 } ^ { 0 } , . . . , U _ { j + s } ^ { 0 } )$ for $j = 0 , . . . , J$
280
+ 6 for $n = 1$ to $N$ do
281
+ 7 for Compute the weights (wn,−2j− 1 , ${ \overline { { j = 0 } } }$ to $J$ do $( w _ { j - \frac { 1 } { 2 } } ^ { n , - 2 } , w _ { j - \frac { 1 } { 2 } } ^ { n , - 1 } , w _ { j - \frac { 1 } { 2 } } ^ { n , 0 } , w _ { j - \frac { 1 } { 2 } } ^ { n , 1 } , w _ { j + \frac { 1 } { 2 } } ^ { n , - 2 } , w _ { j + \frac { 1 } { 2 } } ^ { n , - 1 } , w _ { j + \frac { 1 } { 2 } } ^ { n , 0 } , w _ { j + \frac { 1 } { 2 } } ^ { n , 1 } ) = \pi ^ { \theta } ( s _ { j } ^ { n } )$
282
+ 9 Compute the fluxes $\begin{array} { r } { \hat { f } _ { j - \frac { 1 } { 2 } } ^ { n } = \sum _ { i = - 2 } ^ { 1 } w _ { j - \frac { 1 } { 2 } } ^ { n , i } \hat { f } _ { j - \frac { 1 } { 2 } } ^ { n , i } , \hat { f } _ { j + \frac { 1 } { 2 } } = \sum _ { i = - 2 } ^ { 1 } w _ { j + \frac { 1 } { 2 } } ^ { i } \hat { f } _ { j + \frac { 1 } { 2 } } ^ { n , i } } \end{array}$ f j + 12 , where $\hat { f } _ { j \pm \frac { 1 } { 2 } } ^ { n , i }$ are
283
+ 10 the fluxeCompute $\begin{array} { r } { \frac { d u _ { j } ( t ) } { d t } = - \frac { 1 } { \Delta x } ( \hat { f } _ { { j + \frac { 1 } { 2 } } } ^ { n } - \hat { f } _ { { j - \frac { 1 } { 2 } } } ^ { n } ) } \end{array}$
284
+ 11 Compute U nj = πt(U n−1j , duj (t) ), e.g., the Euler scheme U nj = U n−1j $\begin{array} { r } { U _ { j } ^ { n } = U _ { j } ^ { n - 1 } + \Delta t \frac { d u _ { j } ( t ) } { d t } } \end{array}$
285
+ 12 Compute the loss for $\theta$ :
286
+ $L _ { j } ^ { n } ( \theta ) = | | ( U _ { j - r - 1 } ^ { n } - u _ { j - r - 1 } ^ { n } , \cdot \cdot , U _ { j + s } ^ { n } - u _ { j + s } ^ { n } ) - ( U _ { j - r - 1 } ^ { n } - u _ { j - r - 1 } ^ { n } , \cdot \cdot , U _ { j + s } ^ { n } - u _ { j + s } ^ { n } ) | | _ { 2 } ^ { 2 } .$
287
+ 13 Perform a gradient descent on $\theta$ w.r.t $L _ { j } ^ { n } ( \theta )$
288
+
289
+ Construct the next states $s _ { j } ^ { n + 1 } = g _ { s } ( u _ { j - r - 1 } ^ { n } , . . . , u _ { j + s } ^ { n } )$ for $j = 0 , . . . , J$
290
+
291
+ 15 Return the BP optimized policy $\pi ^ { \theta }$ .
292
+
293
+ However, we argue that the main drawback of using SL (BP) to optimize the stencils in such a way is that it cannot enforce long-term accuracy and thus cannot outperform the proposed RL-WENO. To support such claims, we have added experiments using SL to train the weights of the stencils, and the results are shown in table 3 and 4. The SL policy is trained till it achieves very low loss (i.e., converges) in the training setting. However, as shown in the table, the SL-trained policy does not perform well overall. To improve longer time stability, one may argue that we could design the loss of SL to be the accumulated loss over multiple prediction steps, but in practice as the dynamics of our problem (computations for obtaining multiple step approximations) is highly non-linear, thus the gradient flow through multiple steps can be highly numerically unstable, making it difficult to obtain a decent result.
294
+
295
+ Table 3: Comparison of relative errors $( \times 1 0 ^ { - 2 } )$ of RL-WENO, WENO, and SL-trained policy with standard deviations of the errors among 10 trials in the parenthesis. Temporal discretization: RK4; flux function: $\scriptstyle { \frac { 1 } { 2 } } u ^ { 2 }$ . RL-weno consistently outperforms WENO and SL-trained policy in all test cases.
296
+
297
+ <table><tr><td rowspan=2 colspan=1>△x△t</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>0.02</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>0.04</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>0.05</td><td rowspan=1 colspan=1></td></tr><tr><td rowspan=1 colspan=1>RL-WENO</td><td rowspan=1 colspan=1>SL</td><td rowspan=1 colspan=1>WENO</td><td rowspan=1 colspan=1>RL-WENO</td><td rowspan=1 colspan=1>SL</td><td rowspan=1 colspan=1>WENO</td><td rowspan=1 colspan=1>RL-WENO</td><td rowspan=1 colspan=1>SL</td><td rowspan=1 colspan=1>WENO</td></tr><tr><td rowspan=1 colspan=1>0.002</td><td rowspan=1 colspan=1>5.66 (1.59)</td><td rowspan=1 colspan=1>7.86 (1.23)</td><td rowspan=1 colspan=1>5.89 (1.74)</td><td rowspan=1 colspan=1>8.76 (2.50)</td><td rowspan=1 colspan=1>12.48 (0.78)</td><td rowspan=1 colspan=1>9.09 (2.62)</td><td rowspan=1 colspan=1>9.71 (2.42)</td><td rowspan=1 colspan=1>12.14 (0.44)</td><td rowspan=1 colspan=1>10.24 (2.84)</td></tr><tr><td rowspan=1 colspan=1>0.003</td><td rowspan=1 colspan=1>5.64 (1.54)</td><td rowspan=1 colspan=1>7.77 (1.26)</td><td rowspan=1 colspan=1>5.86 (1.67)</td><td rowspan=1 colspan=1>8.73 (2.46)</td><td rowspan=1 colspan=1>12.44 (0.78)</td><td rowspan=1 colspan=1>9.06 (2.58)</td><td rowspan=1 colspan=1>9.75 (2.41)</td><td rowspan=1 colspan=1>12.13 (0.41)</td><td rowspan=1 colspan=1>10.28 (2.81)</td></tr><tr><td rowspan=1 colspan=1>0.004</td><td rowspan=1 colspan=1>5.63 (1.55)</td><td rowspan=1 colspan=1>7.72 (1.14)</td><td rowspan=1 colspan=1>5.81 (1.66)</td><td rowspan=1 colspan=1>8.72 (2.46)</td><td rowspan=1 colspan=1>12.44 (0.64)</td><td rowspan=1 colspan=1>9.05 (2.55)</td><td rowspan=1 colspan=1>9.61 (2.42)</td><td rowspan=1 colspan=1>12.14 (0.45)</td><td rowspan=1 colspan=1>10.13 (2.84)</td></tr><tr><td rowspan=1 colspan=1>0.005</td><td rowspan=1 colspan=1>5.08 (1.46)</td><td rowspan=1 colspan=1>7.14 (1.37)</td><td rowspan=1 colspan=1>5.19 (1.58)</td><td rowspan=1 colspan=1>8.29 (2.34)</td><td rowspan=1 colspan=1>12.06 (0.86)</td><td rowspan=1 colspan=1>8.58 (2.47)</td><td rowspan=1 colspan=1>9.30 (2.26)</td><td rowspan=1 colspan=1>11.86 (0.38)</td><td rowspan=1 colspan=1>9.78 (2.69)</td></tr><tr><td rowspan=1 colspan=1>0.006</td><td rowspan=1 colspan=1>-</td><td rowspan=1 colspan=1>·</td><td rowspan=1 colspan=1>-</td><td rowspan=1 colspan=1>8.71 (2.49)</td><td rowspan=1 colspan=1>12.33 (0.73)</td><td rowspan=1 colspan=1>9.02 (2.61)</td><td rowspan=1 colspan=1>9.72 (2.38)</td><td rowspan=1 colspan=1>12.14 (0.41)</td><td rowspan=1 colspan=1>10.24 (2.80)</td></tr><tr><td rowspan=1 colspan=1>0.007</td><td rowspan=1 colspan=1>·</td><td rowspan=1 colspan=1>-</td><td rowspan=1 colspan=1>-</td><td rowspan=1 colspan=1>8.56 (2.49)</td><td rowspan=1 colspan=1>12.29 (0.83)</td><td rowspan=1 colspan=1>8.84 (2.62)</td><td rowspan=1 colspan=1>9.59 (2.41)</td><td rowspan=1 colspan=1>12.06 (0.45)</td><td rowspan=1 colspan=1>10.12 (2.80)</td></tr><tr><td rowspan=1 colspan=1>0.008</td><td rowspan=1 colspan=1>=</td><td rowspan=1 colspan=1>-</td><td rowspan=1 colspan=1>-</td><td rowspan=1 colspan=1>8.68 (2.55)</td><td rowspan=1 colspan=1>12.22 (0.70)</td><td rowspan=1 colspan=1>8.93 (2.66)</td><td rowspan=1 colspan=1>9.57 (2.49)</td><td rowspan=1 colspan=1>12.08 (0.46)</td><td rowspan=1 colspan=1>10.06 (2.92)</td></tr></table>
298
+
299
+ <table><tr><td rowspan="2">△x △t</td><td colspan="3">0.02</td><td colspan="3">0.04</td><td colspan="3">0.05</td></tr><tr><td>RL-WENO</td><td>SL</td><td>WENO</td><td>RL-WENO</td><td>SL</td><td>WENO</td><td>RL-WENO</td><td>SL</td><td>WENO</td></tr><tr><td>0.002</td><td>4.85 (1.15)</td><td>5.84 (0.79)</td><td>5.17(1.26)</td><td>7.77 (1.95)</td><td>8.60(1.12)</td><td>8.05 (2.02)</td><td>8.16 (1.93)</td><td>8.42 (1.00)</td><td>8.56(2.19)</td></tr><tr><td>0.003</td><td>-</td><td>-</td><td>-</td><td>7.79 (1.96)</td><td>8.62 (1.12)</td><td>8.06 (2.03)</td><td>7.70 (1.96)</td><td>8.42 (0.98)</td><td>8.59 (2.18)</td></tr><tr><td>0.004</td><td>-</td><td>-</td><td>-</td><td>7.72 (1.93)</td><td>8.55 (1.15)</td><td>7.98 (2.01)</td><td>8.15 (1.95)</td><td>8.41 (1.02)</td><td>8.54 (2.20)</td></tr><tr><td>0.005</td><td>-</td><td>-</td><td>-</td><td>-</td><td></td><td>-</td><td>8.18 (1.94)</td><td>8.40 (1.03)</td><td>8.55 (2.15)</td></tr></table>
300
+
301
+ Table 4: Comparison of relative errors $( \times 1 0 ^ { - 2 } )$ of RL-WENO, WENO, and SL-trained policy with standard deviations of the errors among 10 trials in the parenthesis. Temporal discretization: RK4; flux function: $\scriptstyle { \frac { 1 } { 2 } } u ^ { 4 }$ . RL-weno consistently outperforms WENO and SL-trained policy in all test cases.
302
+
303
+ # A.2 RL-WENO’S PERFORMANCE ON SMOOTH AND SINGULAR REGIONS
304
+
305
+ As mentioned in section 2.2, WENO itself already achieves an optimal order of accuracy in the smooth regions. Since RL-WENO can further improve upon WENO, it must have obtained higher accuracy especially near singularities. Here we provide additional demonstrations on how RL-WENO performs in the smooth/singular regions. We run RL-WENO and WENO on a set of initial conditions, and record the approximation errors at every locations and then separate the errors in the smooth and singular regions for every time step. We then compute the distribution of the errors on the entire spatial-temporal grids with multiple initial conditions. The results are shown in figure 3. In figure 3, the $x$ -axis is the logarithmic (base 10) value of the error and the y-axis is the number of grid points whose error is less than the corresponding value on the $x$ -axis, i.e., the accumulated distribution of the errors. The results show that RL-WENO indeed performs better than WENO near singularities. RL-WENO even achieves better accuracy than WENO in the smooth region when the flux function is 116 u 4 .
306
+
307
+ # A.3 INFERENCE TIME OF RL-WENO AND WENO
308
+
309
+ In this subsection we report the inference time of RL-WENO and WENO. Although the computation complexity of the trained RL policy (a MLP) is higher than that of WENO, we could parallel and accelerate the computations using GPU.
310
+
311
+ Our test is conducted in the following way: for each grid size $\Delta x$ , we fix the initial condition as $u _ { 0 } ( x ) = 1 + c o s ( 6 \pi x )$ , the evolving time $T = 0 . 8$ and the flux function $f = u ^ { 2 }$ . We then use RL-WENO and WENO to solve the problem 20 times, and report the average running time. For completeness, we also report the relative error of RL-WENO and WENO in each of these grid sizes in table 6. Note that the relative error is computed on average of several initial functions, and our RL-WENO policy is only trained on grid $( \Delta \dot { x } , \Delta t ) = ( 0 . 0 2 , \dot { 0 } . 0 0 4 )$ .
312
+
313
+ ![](images/70edbc56bd523eaa94e7feb588b9e798ddd1472b272f4eb5a9500c86b40a60b9.jpg)
314
+ Figure 3: These figures show the total number of grids whose error is under a specific value (i.e. the accumulated distribution function). The $x$ -axis is the error in logarithmic (base 10) scale. (a) and (c) show the distribution in smooth regions, (b) and (d) are near singularities.
315
+
316
+ For RL-WENO, we test it on both CPU and on GPU; For WENO, we test it purely on CPU, with a well-optimized version (e.g., good numpy vectorization in python), and a poor-implemented version (e.g., no vectorization, lots of loops). The CPU used for the tests is a custom Intel CORE i7, and the GPU is a custom NVIDIA GTX 1080. The results are shown in table 5.
317
+
318
+ Table 5: Average inference time (in seconds) for RL-WENO and WENO. Bold numbers are the smallest ones.
319
+
320
+ <table><tr><td>(△x,△t)</td><td>RL-WENO(CPU)</td><td>RL-WENO(GPU)</td><td>WENO-optimized</td><td>WENO-poor</td></tr><tr><td>(0.02, 0.004)</td><td>2.490</td><td>1.650</td><td>0.148</td><td>2.739</td></tr><tr><td>(0.01, 0.002)</td><td>7.720</td><td>1.700</td><td>0.349</td><td>10.778</td></tr><tr><td>(0.005, 0.001)</td><td>26.70</td><td>1.628</td><td>0.921</td><td>44.23</td></tr><tr><td>(0.002,0.0004)</td><td>110.92</td><td>1.611</td><td>1.961</td><td>277.88</td></tr></table>
321
+
322
+ <table><tr><td>(△x,△t)</td><td>RL-WENO error</td><td>WENO error</td></tr><tr><td>(0.02,0.004)</td><td>3.73(0.40)</td><td>4.08(0.23)</td></tr><tr><td>(0.01, 0.002)</td><td>1.86(0.17)</td><td>1.99(0.12)</td></tr><tr><td>(0.005,0.001)</td><td>1.00(0.05)</td><td>0.93(0.01)</td></tr><tr><td>(0.002, 0.0004)</td><td>0.48(0.03)</td><td>0.39(0.02)</td></tr></table>
323
+
324
+ Table 6: Relative error of RL-WENO and WENO $( \times 1 0 ^ { - 2 } )$ on grid sizes tested in table 5. Note RL-WENO is only trained on grid $( \Delta x , \Delta t ) = ( 0 . 0 2 , 0 . 0 0 4 )$
325
+
326
+ From the table we can tell that as $\Delta x$ decreases, i.e., as the grid becomes denser, all methods, except for the RL-WENO (GPU), requires significant more time to finish the computation. The reason that the time cost of the GPU-version of RL-WENO does not grow is that on GPU, we can compute all approximations in the next step (i.e., to compute $( U _ { 0 } ^ { t + 1 } , U _ { 1 } ^ { t + 1 } , . . . , U _ { J } ^ { t + 1 } )$ given $( U _ { 0 } ^ { t } , U _ { 1 } ^ { t } , . . . , U _ { J } ^ { t } )$ , which dominates the computation cost of the algorithm) together in parallel. Thus, the increase of grids does not affect much of the computation time. Therefore, for coarse grid, well-optimized WENO indeed has clear speed advantage over RL-WENO (even on GPU), but on a much denser grid, RL-WENO (GPU) can be faster than well-optimized WENO by leveraging the paralleling nature of the algorithm.
327
+
328
+ # B REVIEW OF REINFORCEMENT LEARNING
329
+
330
+ # B.1 REINFORCEMENT LEARNING
331
+
332
+ Reinforcement Learning (RL) is a general framework for solving sequential decision making problems. Recently, combined with deep neural networks, RL has achieved great success in various tasks such as playing video games from raw screen inputs (Mnih et al., 2015), playing Go (Silver et al., 2016), and robotics control (Schulman et al., 2017). The sequential decision making problem RL tackles is usually formulated as a Markov Decision Process (MDP), which comprises five elements: the state space $S$ , the action space $A$ , the reward $r : S \times A \mathcal { R }$ , the transition probability of the environment $P : S \times A \times S [ 0 , 1 ]$ , and the discounting factor $\gamma$ . The interactions between an RL agent and the environment forms a trajectory $\tau = ( s _ { 0 } , a _ { 0 } , r _ { 0 } , . . . , s _ { T } , a _ { T } , r _ { T } , . . . )$ . The return of $\tau$ is the discounted sum of all its future rewards:
333
+
334
+ $$
335
+ G ( \tau ) = \sum _ { t = 0 } ^ { \infty } \gamma ^ { t } r _ { t }
336
+ $$
337
+
338
+ Similarly, the return of a state-action pair $\left( { { s _ { t } } , { a _ { t } } } \right)$ is:
339
+
340
+ $$
341
+ G ( s _ { t } , a _ { t } ) = \sum _ { l = t } ^ { \infty } \gamma ^ { l - t } r _ { l }
342
+ $$
343
+
344
+ A policy $\pi$ in RL is a probability distribution on the action $A$ given a state $S$ : $\pi : S \times A \to [ 0 , 1 ]$ . We say a trajectory $\tau$ is generated under policy $\pi$ if all the actions along the trajectory is chosen following $\pi$ , i.e., $\tau \sim \pi$ means $a _ { t } \sim \pi ( \cdot | s _ { t } )$ and $s _ { t + 1 } \sim P ( \cdot | s _ { t } , a _ { t } )$ . Given a policy $\pi$ , the value of a state $s$ is defined as the expected return of all the trajectories when the agent starts at $s$ and then follows $\pi$ :
345
+
346
+ $$
347
+ V ^ { \pi } ( s ) = { \cal E } _ { \tau } [ G ( \tau ) | \tau ( s _ { 0 } ) = s , \tau \sim \pi ]
348
+ $$
349
+
350
+ Similarly, the value of a state-action pair is defined as the expected return of all trajectories when the agent starts at $s$ , takes action $a$ , and then follows $\pi$ :
351
+
352
+ $$
353
+ Q ^ { \pi } ( s , a ) = E _ { \tau } [ G ( \tau ) | \tau ( s _ { 0 } ) = s , \tau ( a _ { 0 } ) = a , \tau \sim \pi ]
354
+ $$
355
+
356
+ As aforementioned in introduction, in most RL algorithms the policy $\pi$ is optimized with regards to the values $Q ^ { \pi } ( s , a )$ , thus naturally guarantees the long-term accumulated rewards (in our setting, the long-term accuracy of the learned schemes). Bellman Equation, one of the most important equations in RL, connects the value of a state and the value of its successor state:
357
+
358
+ $$
359
+ \begin{array} { c } { { Q ^ { \pi } ( s , a ) = r ( s , a ) + \gamma E _ { s ^ { \prime } \sim P ( \cdot \vert s , a ) , a ^ { \prime } \sim \pi ( \cdot \vert s ^ { \prime } ) } [ Q ^ { \pi } ( s ^ { \prime } , a ^ { \prime } ) ] } } \\ { { V ^ { \pi } ( s ) = E _ { a \sim \pi ( \cdot \vert s ) , s ^ { \prime } \sim P ( \cdot \vert s ^ { \prime } , a ) } [ r ( s , a ) + \gamma V ^ { \pi } ( s ^ { \prime } ) ] } } \end{array}
360
+ $$
361
+
362
+ The goal of RL is to find a policy $\pi$ to maximize the expected discounted sum of rewards starting from the initial state $s _ { 0 }$ , $J ( \pi ) = E _ { s _ { 0 } \sim \rho } [ V ^ { \pi } ( s _ { 0 } ) ]$ , where $\rho$ is the initial state distribution. If we parameterize $\pi$ using $\theta$ , then we can optimize it using the famous policy gradient theorem:
363
+
364
+ $$
365
+ \frac { d J ( \pi _ { \theta } ) } { d \theta } = E _ { s \sim \rho ^ { \pi _ { \theta } } , a \sim \pi _ { \theta } } [ \nabla _ { \theta } \mathrm { l o g } \pi _ { \theta } ( a | s ) Q ^ { \pi _ { \theta } } ( s , a ) ]
366
+ $$
367
+
368
+ where $\rho ^ { \pi _ { \theta } }$ is the state distribution deduced by the policy $\pi _ { \theta }$ . In this paper we focus on the case where the action space $A$ is continuous, and a lot of mature algorithms has been proposed for such a case, e.g., the Deep Deterministic Policy Gradient (DDPG) (Lillicrap et al., 2015), the Trust Region Policy Optimization algorithm (Schulman et al., 2015), and etc.
parse/train/rygBVTVFPB/rygBVTVFPB_content_list.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/rygBVTVFPB/rygBVTVFPB_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/rygBVTVFPB/rygBVTVFPB_model.json ADDED
The diff for this file is too large to render. See raw diff