Year: 2020

Abstract:
Many real-world sequential decision-making problems can be formulated as optimal control with high-dimensional observations and unknown dynamics. A promising approach is to embed the high-dimensional observations into a lowerdimensional latent representation space, estimate the latent dynamics model, then utilize this model for control in the latent space. An important open question is how to learn a representation that is amenable to existing control algorithms? In this paper, we focus on learning representations for locally-linear control algorithms, such as iterative LQR (iLQR). By formulating and analyzing the representation learning problem from an optimal control perspective, we establish three underlying principles that the learned representation should comprise: 1) accurate prediction in the observation space, 2) consistency between latent and observation space dynamics, and 3) low curvature in the latent space transitions. These principles naturally correspond to a loss function that consists of three terms: prediction, consistency, and curvature (PCC). Crucially, to make PCC tractable, we derive an amortized variational bound for the PCC loss function. Extensive experiments on benchmark domains demonstrate that the new variational-PCC learning algorithm benefits from significantly more stable and reproducible training, and leads to superior control performance. Further ablation studies give support to the importance of all three PCC components for learning a good latent space for control.

heading: 1 INTRODUCTION
text: Decomposing the problem of decision-making in an unknown environment into estimating dynamics followed by planning provides a powerful framework for building intelligent agents. This decomposition confers several notable benefits. First, it enables the handling of sparse-reward environments by leveraging the dense signal of dynamics prediction. Second, once a dynamics model is learned, it can be shared across multiple tasks within the same environment. While the merits of this decomposition have been demonstrated in low-dimensional environments (Deisenroth & Rasmussen, 2011; Gal et al., 2016), scaling these methods to high-dimensional environments remains an open challenge.
The recent advancements in generative models have enabled the successful dynamics estimation of high-dimensional decision processes (Watter et al., 2015; Ha & Schmidhuber, 2018; Kurutach et al., 2018). This procedure of learning dynamics can then be used in conjunction with a plethora of decision-making techniques, ranging from optimal control to reinforcement learning (RL) (Watter et al., 2015; Banijamali et al., 2018; Finn et al., 2016; Chua et al., 2018; Ha & Schmidhuber, 2018; Kaiser et al., 2019; Hafner et al., 2018; Zhang et al., 2019). One particularly promising line of work in this area focuses on learning the dynamics and conducting control in a low-dimensional latent embedding of the observation space, where the embedding itself is learned through this process (Watter et al., 2015; Banijamali et al., 2018; Hafner et al., 2018; Zhang et al., 2019). We refer to this approach as learning controllable embedding (LCE). There have been two main approaches to this problem: 1) to start by defining a cost function in the high-dimensional observation space and learn the embedding space, its dynamics, and reward function, by interacting with the environment in a RL fashion (Hafner et al., 2018; Zhang et al., 2019), and 2) to first learn the embedding space and its dynamics, and then define a cost function in this low-dimensional space and conduct the control (Watter et al., 2015; Banijamali et al., 2018). This can be later combined with RL for extra fine-tuning of the model and control.
In this paper, we take the second approach and particularly focus on the important question of what desirable traits should the latent embedding exhibit for it to be amenable to a specific class of control/learning algorithms, namely the widely used class of locally-linear control (LLC) algorithms? We argue from an optimal control standpoint that our latent space should exhibit three properties. The first is prediction: given the ability to encode to and decode from the latent space, we expect ∗Equal contribution. Correspondence to nirlevine@google.com
the process of encoding, transitioning via the latent dynamics, and then decoding, to adhere to the true observation dynamics. The second is consistency: given the ability to encode a observation trajectory sampled from the true environment, we expect the latent dynamics to be consistent with the encoded trajectory. Finally, curvature: in order to learn a latent space that is specifically amenable to LLC algorithms, we expect the (learned) latent dynamics to exhibit low curvature in order to minimize the approximation error of its first-order Taylor expansion employed by LLC algorithms. Our contributions are thus as follows: (1) We propose the Prediction, Consistency, and Curvature (PCC) framework for learning a latent space that is amenable to LLC algorithms and show that the elements of PCC arise systematically from bounding the suboptimality of the solution of the LLC algorithm in the latent space. (2) We design a latent variable model that adheres to the PCC framework and derive a tractable variational bound for training the model. (3) To the best of our knowledge, our proposed curvature loss for the transition dynamics (in the latent space) is novel. We also propose a direct amortization of the Jacobian calculation in the curvature loss to help training with curvature loss more efficiently. (4) Through extensive experimental comparison, we show that the PCC model consistently outperforms E2C (Watter et al., 2015) and RCE (Banijamali et al., 2018) on a number of control-from-images tasks, and verify via ablation, the importance of regularizing the model to have consistency and low-curvature.

heading: 2 PROBLEM FORMULATION
text: We are interested in controlling the non-linear dynamical systems of the form st+1 = fS(st, ut) +w, over the horizon T . In this definition, st ∈ S ⊆ Rns and ut ∈ U ⊆ Rnu are the state and action of the system at time step t ∈ {0, . . . , T − 1}, w is the Gaussian system noise, and fS is a smooth non-linear system dynamics. We are particularly interested in the scenario in which we only have access to the high-dimensional observation xt ∈ X ⊆ Rnx of each state st (nx ns). This scenario has application in many real-world problems, such as visual-servoing (Espiau et al., 1992), in which we only observe high-dimensional images of the environment and not its underlying state. We further assume that the high-dimensional observations x have been selected such that for any arbitrary control sequence U = {ut}T−1t=0 , the observation sequence {xt}Tt=0 is generated by a stationary Markov process, i.e., xt+1 ∼ P (·|xt, ut), ∀t ∈ {0, . . . , T − 1}.1
A common approach to control the above dynamical system is to solve the following stochastic optimal control (SOC) problem (Shapiro et al., 2009) that minimizes expected cumulative cost:
min U
L(U,P, c, x0) := E [ cT (xT ) + T−1∑ t=0 ct(xt, ut) | P, x0 ] , 2 (SOC1)
where ct : X ×U → R≥0 is the immediate cost function at time t, cT ∈ R≥0 is the terminal cost, and x0 is the observation at the initial state s0. Note that all immediate costs are defined in the observation space X , and are bounded by cmax > 0 and Lipschitz with constant clip > 0. For example, in visualservoing, (SOC1) can be formulated as a goal tracking problem (Ebert et al., 2018), where we control the robot to reach the goal observation xgoal, and the objective is to compute a sequence of optimal open-loop actions U that minimizes the cumulative tracking error E[ ∑ t ‖xt − xgoal‖2 | P, x0].
Since the observations x are high dimensional and the dynamics in the observation space P (·|xt, ut) is unknown, solving (SOC1) is often intractable. To address this issue, a class of algorithms has been recently developed that is based on learning a low-dimensional latent (embedding) space Z ⊆ Rnz (nz nx) and latent state dynamics, and performing optimal control there. This class that we refer to as learning controllable embedding (LCE) throughout the paper, include recently developed algorithms, such as E2C (Watter et al., 2015), RCE (Banijamali et al., 2018), and SOLAR (Zhang et al., 2019). The main idea behind the LCE approach is to learn a triplet, (i) an encoderE : X → P(Z); (ii) a dynamics in the latent space F : Z ×U → P(Z); and (iii) a decoder D : Z → P(X ). These in turn can be thought of as defining a (stochastic) mapping P̂ : X ×U → P(X ) of the form P̂ = D ◦F ◦E. We then wish to solve the SOC in latent space Z:
min U,P̂
E [ L(U,F, c, z0) | E, x0 ] + λ2 √ R2(P̂ ), (SOC2)
such that the solution of (SOC2), U∗2 , has similar performance to that of (SOC1), U ∗ 1 , i.e., L(U∗1 , P, c, x0) ≈ L(U∗2 , P, c, x0). In (SOC2), z0 is the initial latent state sampled from the encoder E(·|x0); c̄ : Z × U → R≥0 is the latent cost function defined as c̄t(zt, ut) =∫ ct(xt, ut)dD(xt|zt); R2(P̂ ) is a regularizer over the mapping P̂ ; and λ2 is the corresponding
1A method to ensure this Markovian assumption is by buffering observations (Mnih et al., 2013) for a number of time steps.
2See Appendix B.3 for the extension to the closed-loop MDP problem.
tion SOC2 under dynamics F , and (c)(red) in equation SOC3 under dynamics P̂ .
regularization parameter. We will define R2 and λ2 more precisely in Section 3. Note that the expectation in (SOC2) is over the randomness generated by the (stochastic) encoder E.

heading: 3 PCC MODEL: A CONTROL PERSPECTIVE
text: As described in Section 2, we are primarily interested in solving (SOC1), whose states evolve under dynamics P , as shown at the bottom row of Figure 1(a) in (blue). However, because of the difficulties in solving (SOC1), mainly due to the high dimension of observations x, LCE proposes to learn a mapping P̂ by solving (SOC2) that consists of a loss function, whose states evolve under dynamics F (after an initial transition by encoder E), as depicted in Figure 1(b), and a regularization term. The role of the regularizer R2 is to account for the performance gap between (SOC1) and the loss function of (SOC2), due to the discrepancy between their evolution paths, shown in Figures 1(a)(blue) and 1(b)(green). The goal of LCE is to learn P̂ of the particular form P̂ = D ◦ F ◦ E, described in Section 2, such that the solution of (SOC2) has similar performance to that of (SOC1). In this section, we propose a principled way to select the regularizer R2 to achieve this goal. Since the exact form of (SOC2) has a direct effect on learning P̂ , designing this regularization term, in turn, provides us with a recipe (loss function) to learn the latent (embedded) space Z . In the following subsections, we show that this loss function consists of three terms that correspond to prediction, consistency, and curvature, the three ingredients of our PCC model.
Note that these two SOCs evolve in two different spaces, one in the observation space X under dynamics P , and the other one in the latent space Z (after an initial transition from X to Z) under dynamics F . Unlike P and F that only operate in a single space, X and Z , respectively, P̂ can govern the evolution of the system in both X and Z (see Figure 1(c)). Therefore, any recipe to learn P̂ , and as a result the latent space Z , should have at least two terms, to guarantee that the evolution paths resulted from P̂ in X and Z are consistent with those generated by P and F . We derive these two terms, that are the prediction and consistency terms in the loss function used by our PCC model, in Sections 3.1 and 3.2, respectively. While these two terms are the result of learning P̂ in general SOC problems, in Section 3.3, we concentrate on the particular class of LLC algorithms (e.g., iLQR (Li & Todorov, 2004)) to solve SOC, and add the third term, curvature, to our recipe for learning P̂ .

heading: 3.1 PREDICTION OF THE NEXT OBSERVATION
text: Figures 1(a)(blue) and 1(c)(red) show the transition in the observation space under P and P̂ , where xt is the current observation, and xt+1 and x̂t+1 are the next observations under these two dynamics, respectively. Instead of learning a P̂ with minimum mismatch with P in terms of some distribution norm, we propose to learn P̂ by solving the following SOC:
min U,P̂ L(U, P̂ , c, x0) + λ3
√ R3(P̂ ), (SOC3)
whose loss function is the same as the one in (SOC1), with the true dynamics replaced by P̂ . In Lemma 1 (see Appendix A.1, for proof), we show how to set the regularization term R3 in (SOC3), such that the control sequence resulted from solving (SOC3), U∗3 , has similar performance to the solution of (SOC1), U∗1 , i.e., L(U ∗ 1 , P, c, x0) ≈ L(U∗3 , P, c, x0).
Lemma 1. Let U∗1 be a solution to (SOC1) and (U∗3 , P̂ ∗3 ) be a solution to (SOC3) with R3(P̂ ) = Ex,u [ DKL ( P (·|x, u)||P̂ (·|x, u) )] and λ3 = √ 2U · T 2cmax. (1)
Then, we have L(U∗1 , P, c, x0) ≥ L(U∗3 , P, c, x0)− 2λ3 √ R3(P̂ ∗3 ).
In Eq. 1, the expectation is over the state-action stationary distribution of the policy used to generate the training samples (uniformly random policy in this work), and U is the Lebesgue measure of U .3
3In the case when sampling policy is non-uniform and has no measure-zero set, 1/U is its minimum measure.

heading: 3.2 CONSISTENCY IN PREDICTION OF THE NEXT LATENT STATE
text: In Section 3.1, we provided a recipe for learning P̂ (in form of D ◦ F ◦ E) by introducing an intermediate (SOC3) that evolves in the observation space X according to dynamics P̂ . In this section we first connect (SOC2) that operates in Z with (SOC3) that operates in X . For simplicity and without loss generality, assume the initial cost c0(x, u) is zero.4 Lemma 2 (see Appendix A.2, for proof) suggests how we shall set the regularizer in (SOC2), such that its solution performs similarly to that of (SOC3), under their corresponding dynamics models.
Lemma 2. Let (U∗3 , P̂ ∗3 ) be a solution to (SOC3) and (U∗2 , P̂ ∗2 ) be a solution to (SOC2) with R′2(P̂ ) = Ex,u [ DKL (( E ◦ P̂ ) (·|x, u)|| ( F ◦ E ) (·|x, u) )] and λ2 = √ 2U · T 2cmax. (2)
Then, we have L(U∗3 , P̂ ∗ 3 , c, x0) ≥ L(U∗2 , P̂ ∗2 , c, x0)− 2λ2 √ R′2(P̂ ∗ 2 ) .
Similar to Lemma 1, in Eq. 2, the expectation is over the state-action stationary distribution of the policy used to generate the training samples. Moreover, ( E ◦ P̂ ) (z′|x, u) = ∫ x′ E(z′|x′)dP̂ (x′|x, u)
and ( F ◦E ) (z′|x, u) = ∫ z F (z′|z, u)dE(z|x) are the probability over the next latent state z′, given the current observation x and action u, in (SOC2) and (SOC3) (see the paths xt → zt → z̃t+1 and xt → zt → z̃t+1 → x̂t+1 → ẑt+1 in Figures 1(b)(green) and 1(c)(red)). Therefore R′2(P̂ ) can be interpreted as the measure of discrepancy between these models, which we term as consistency loss.
Although Lemma 2 provides a recipe to learn P̂ by solving (SOC2) with the regularizer (2), unfortunately this regularizer cannot be computed from the data – that is of the form (xt, ut, xt+1) – because the first term in the DKL requires marginalizing over current and next latent states (zt and z̃t+1 in Figure 1(c)). To address this issue, we propose to use the (computable) regularizer
R′′2 (P̂ ) = Ex,u,x′ [ DKL ( E(·|x′)|| ( F ◦ E ) (·|x, u) )] , (3)
in which the expectation is over (x, u, x′) sampled from the training data. Corollary 1 (see Appendix A.3, for proof) bounds the performance loss resulted from using R′′2 (P̂ ) instead of R ′
2(P̂ ), and shows that it could be still a reasonable choice. Corollary 1. Let (U∗3 , P̂ ∗3 ) be a solution to (SOC3) and (U∗2 , P̂ ∗2 ) be a solution to (SOC2) with R′′2 (P̂ ) and and λ2 defined by (3) and (2). Then, we have L(U ∗ 3 , P̂ ∗ 3 , c, x0) ≥ L(U∗2 , P̂ ∗2 , c, x0) −
2λ2 √ 2R′′2 (P̂ ∗ 2 ) + 2R3(P̂ ∗ 2 ) .
Lemma 1 suggests a regularizer R3 to connect the solutions of (SOC1) and (SOC3). Similarly, Corollary 1 shows that regularizer R′′2 in (3) establishes a connection between the solutions of (SOC3) and (SOC2). Putting these results together, we achieve our goal in Lemma 3 (see Appendix A.4, for proof) to design a regularizer for (SOC2), such that its solution performs similarly to that of (SOC1).
Lemma 3. Let U∗1 be a solution to (SOC1) and (U∗2 , P̂ ∗2 ) be a solution to (SOC2) with
R2(P̂ ) = 3R3(P̂ ) + 2R ′′ 2 (P̂ ) and λ2 = 2 √ U · T 2cmax, (4)
where R3(P̂ ) and R′′2 (P̂ ) are defined by (1) and (3). Then, we have L(U∗1 , P, c, x0) ≥ L(U∗2 , P, c, x0)− 2λ2 √ R2(P̂ ∗2 ) .

heading: 3.3 LOCALLY-LINEAR CONTROL IN THE LATENT SPACE AND CURVATURE REGULARIZATION
text: In Sections 3.1 and 3.2, we derived a loss function to learn the latent space Z . This loss function, that was motivated by the general SOC perspective, consists of two terms to enforce the latent space to not only predict the next observations accurately, but to be suitable for control. In this section, we focus on the class of locally-linear control (LLC) algorithms (e.g., iLQR), for solving (SOC2), and show how this choice adds a third term, that corresponds to curvature, to the regularizer of (SOC2), and as a result, to the loss function of our PCC model.
The main idea in LLC algorithms is to iteratively compute an action sequence to improve the current trajectory, by linearizing the dynamics around this trajectory, and use this action sequence to generate
4With non-zero initial cost, similar results can be derived by having an additional consistency term on x0.
the next trajectory (see Appendix B for more details about LLC and iLQR). This procedure implicitly assumes that the dynamics is approximately locally linear. To ensure this in (SOC2), we further restrict the dynamics P̂ and assume that it is not only of the form P̂ = D ◦ F ◦ E, but F , the latent space dynamics, has low curvature. One way to ensure this in (SOC2) is to directly impose a penalty over the curvature of the latent space transition function fZ(z, u). Assume F (z, u) = fZ(z, u) + w, where w is a Gaussian noise. Consider the following SOC problem:
min U,P̂
E [L(U,F, c, z0) | E, x0] + λLLC √ R2(P̂ ) +RLLC(P̂ ) , (SOC-LLC)
where R2 is defined by (4); U is optimized by a LLC algorithm, such as iLQR; RLLC(P̂ ) is given by, RLLC(P̂ ) = Ex,u [ E [ fZ(z + z, u+ u)− fZ(z, u)− (∇zfZ(z, u) · z +∇ufZ(z, u) · u)‖22 ] | E ] , (5)
where = ( z, u)> ∼ N (0, δ2I), δ > 0 is a tunable parameter that characterizes the “diameter" of latent state-action space in which the latent dynamics model has low curvature. λLLC = 2 √ 2T 2cmax √ U max ( clip(1 + √ 2 log(2T/η)) √ X/2, 1 ) , where 1/X is the minimum
non-zero measure of the sample distribution w.r.t. X , and 1− η ∈ [0, 1) is a probability threshold. Lemma 4 (see Appendix A.5, for proof and discussions on how δ affects LLC performance) shows that a solution of (SOC-LLC) has similar performance to a solution of (SOC1, and thus, (SOC-LLC) is a reasonable optimization problem to learn P̂ , and also the latent space Z . Lemma 4. Let (U∗LLC, P̂ ∗LLC) be a LLC solution to (SOC-LLC) and U∗1 be a solution to (SOC1). Suppose the nominal latent state-action trajectory {(zt,ut)}T−1t=0 satisfies the condition: (zt,ut) ∼ N ((z∗2,t, u∗2,t), δ2I), where {(z∗2,t, u∗2,t)}T−1t=0 is the optimal trajectory of (SOC2). Then with proba-
bility 1− η, we have L(U∗1 , P, c, x0) ≥ L(U∗LLC, P, c, x0)− 2λLLC √ R2(P̂ ∗LLC) +RLLC(P̂ ∗ LLC) .
In practice, instead of solving (SOC-LLC) jointly for U and P̂ , we treat (SOC-LLC) as a bi-level optimization problem, first, solve the inner optimization problem for P̂ , i.e.,
P̂ ∗ ∈ arg min P̂ λpR ′ 3(P̂ ) + λcR ′′ 2 (P̂ ) + λcurRLLC(P̂ ), (PCC-LOSS)
where R′3(P̂ ) = −Ex,u,x′ [log P̂ (x′|x, u)] is the negative log-likelihood,5 and then, solve the outer optimization problem, minU L(U, F̂ ∗, c̄, z0), where P̂ ∗ = D̂∗◦F̂ ∗◦Ê∗, to obtain the optimal control sequence U∗. Solving (SOC-LLC) this way is an approximation, in general, but is justified, when the regularization parameter λLLC is large. Note that we leave the regularization parameters (λp, λc, λcur) as hyper-parameters of our algorithm, and do not use those derived in the lemmas of this section. Since the loss for learning P̂ ∗ in (PCC-LOSS) enforces (i) prediction accuracy, (ii) consistency in latent state prediction, and (iii) low curvature over fZ , through the regularizers R′3, R ′′
2 , and RLLC, respectively, we refer to it as the prediction-consistency-curvature (PCC) loss.

heading: 4 INSTANTIATING THE PCC MODEL IN PRACTICE
text: The PCC-Model objective in (PCC-LOSS) introduces the optimization problem minP̂ λpR ′ 3(P̂ ) + λcR ′′ 2 (P̂ ) + λcurRLLC(P̂ ). To instantiate this model in practice, we describe P̂ = D ◦ F ◦ E as a latent variable model that factorizes as P̂ (xt+1, zt, ẑt+1 | xt, ut) = P̂ (zt | xt)P̂ (ẑt+1 | zt, ut)P̂ (xt+1 | ẑt+1). In this section, we propose a variational approximation to the intractable negative log-likelihood R′3 and batch-consistency R ′′ 2 losses, and an efficient approximation of the curvature loss RLLC.

heading: 4.1 VARIATIONAL PCC
text: The negative log-likelihood 6 R′3 admits a variational bound via Jensen’s Inequality,
R′3(P̂ ) = − log P̂ (xt+1 | xt, ut) = − logEQ(zt,ẑt+1|xt,ut,xt+1) [ P̂ (xt+1, zt, ẑt+1 | xt, ut) Q(zt, ẑt+1 | xt, ut, xt+1) ]
≤ −EQ(zt,ẑt+1|xt,ut,xt+1)
[ log
P̂ (xt+1, zt, ẑt+1 | xt, ut) Q(zt, ẑt+1 | xt, ut, xt+1)
] = R′3,NLE-Bound(P̂ , Q), (6)
5Since R3(P̂ ) is the sum of R′3(P̂ ) and the entropy of P , we replaced it with R′3(P̂ ) in (PCC-LOSS). 6For notation convenience, we drop the expectation over the empirical data that appears in various loss terms.
which holds for any choice of recognition model Q. For simplicity, we assume the recognition model employs bottom-up inference and thus factorizes as Q(zt, ẑt+1|xt, xt+1, ut) = Q(ẑt+1|xt+1)Q(zt|ẑt+1, xt, ut). The main idea behind choosing a backward-facing model is to allow the model to learn to account for noise in the underlying dynamics. We estimate the expectations in (6) via Monte Carlo simulation. To reduce the variance of the estimator, we decompose R′3,NLE-Bound further into
− EQ(ẑt+1|xt+1) [ log P̂ (xt+1|ẑt+1) ] + EQ(ẑt+1|xt+1) [ DKL ( Q(zt | ẑt+1, xt, ut)‖P̂ (zt | xt) )] −H (Q(ẑt+1 | xt+1))− E Q(ẑt+1|xt+1)
Q(zt|ẑt+1,xt,ut)
[ log P̂ (ẑt+1 | zt, ut) ] ,
and note that the Entropy H(·) and Kullback-Leibler DKL(·‖·) terms are analytically tractable when Q is restricted to a suitably chosen variational family (i.e. in our experiments, Q(ẑt+1 | xt+1) and Q(zt | ẑt+1, xt, ut) are factorized Gaussians). The derivation is provided in Appendix C.1. Interestingly, the consistency loss R′′2 admits a similar treatment. We note that the consistency loss seeks to match the distribution of ẑt+1 | xt, ut with zt+1 | xt+1, which we represent below as
R′′2 (P̂ ) = DKL ( P̂ (zt+1 | xt+1)‖P̂ (ẑt+1 | xt, ut) ) = −H(P̂ (zt+1 | xt+1))− EP̂ (zt+1|xt+1)
ẑt+1=zt+1
[ log P̂ (ẑt+1 | xt, ut) ] .
Here, P̂ (ẑt+1 | xt, ut) is intractable due to the marginalization of zt. We employ the same procedure as in (6) to construct a tractable variational bound
R′′2 (P̂ ) ≤ −H(P̂ (zt+1 | xt+1))− EP̂ (zt+1|xt+1) ẑt+1=zt+1 EQ(zt|ẑt+1,xt,ut)
[ log
P̂ (zt, ẑt+1 | xt, ut) Q(zt | ẑt+1, xt, ut)
] .
We now make the further simplifying assumption that Q(ẑt+1 | xt+1) = P̂ (ẑt+1 | xt+1). This allows us to rewrite the expression as
R′′2 (P̂ ) ≤ −H(Q(ẑt+1 | xt+1))− E Q(ẑt+1|xt+1) Q(zt|ẑt+1,xt,ut)
[ log P̂ (ẑt+1 | zt, ut) ] + EQ(ẑt+1|xt+1) [ DKL(Q(zt | ẑt+1, xt, ut)‖P̂ (zt | xt)) ] = R′′2,Bound(P̂ , Q),
(7)
which is a subset of the terms in (6). See Appendix C.2 for a detailed derivation.

heading: 4.2 CURVATURE REGULARIZATION AND AMORTIZED GRADIENT
text: In practice we use a variant of the curvature loss where Taylor expansions and gradients are evaluated at z̄ = z + z and ū = u+ u,
RLLC(P̂ ) = E ∼N (0,δI)[‖fZ(z̄, ū)− (∇zfZ(z̄, ū) z +∇ufZ(z̄, ū) u)− fZ(z, u)‖22]. (8)
When nz is large, evaluation and differentiating through the Jacobians can be slow. To circumvent this issue, the Jacobians evaluation can be amortized by treating the Jacobians as the coefficients of the best linear approximation at the evaluation point. This leads to a new amortized curvature loss
RLLC-Amor(P̂ , A,B) = E ∼N (0,δI)[‖fZ(z̄, ū)− (A(z̄, ū) z +B(z̄, ū) u − fZ(z, u))‖22]. (9)
where A and B are function approximators to be optimized. Intuitively, the amortized curvature loss seeks—for any given (z, u)—to find the best choice of linear approximation induced by A(z, u) and B(z, u) such that the behavior of Fµ in the neighborhood of (z, u) is approximately linear.

heading: 5 RELATION TO PREVIOUS EMBED-TO-CONTROL APPROACHES
text: In this section, we highlight the key differences between PCC and the closest previous works, namely E2C and RCE. A key distinguishing factor is PCC’s use of a nonlinear latent dynamics model paired with an explicit curvature loss. In comparison, E2C and RCE both employed “locally-linear dynamics” of the form z ′ = A(z̄, ū)z +B(z̄, ū)u+ c(z̄, ū) where z̄ and ū are auxiliary random variables meant to be perturbations of z and u. When contrasted with (9), it is clear that neither A and B in the E2C/RCE formulation can be treated as the Jacobians of the dynamics, and hence the curvature of the dynamics is not being controlled explicitly. Furthermore, since the locally-linear dynamics are wrapped inside the maximum-likelihood estimation, both E2C and RCE conflate the two key elements prediction and curvature together. This makes controlling the stability of training much more difficult. Not only does PCC explicitly separate these two components, we are also the first to explicitly demonstrate theoretically and empirically that the curvature loss is important for iLQR.
Furthermore, RCE does not incorporate PCC’s consistency loss. Note that PCC, RCE, and E2C are all Markovian encoder-transition-decoder frameworks. Under such a framework, the sole reliance on minimizing the prediction loss will result in a discrepancy between how the model is trained (maximizing the likelihood induced by encoding-transitioning-decoding) versus how it is used at test-time for control (continual transitioning in the latent space without ever decoding). By explicitly minimizing the consistency loss, PCC reduces the discrapancy between how the model is trained versus how it is used at test-time for planning. Interestingly, E2C does include a regularization term that is akin to PCC’s consistency loss. However, as noted by the authors of RCE, E2C’s maximization of pair-marginal log-likelihoods of (xt, xt+1) as opposed to the conditional likelihood of xt+1 given xt means that E2C does not properly minimize the prediction loss prescribed by the PCC framework.

heading: 6 EXPERIMENTS
text: In this section, we compare the performance of PCC with two model-based control algorithm baselines: RCE7 (Banijamali et al., 2018) and E2C (Watter et al., 2015), as well as running a thorough ablation study on various components of PCC. The experiments are based on the following continuous control benchmark domains (see Appendix D for more descriptions): (i) Planar System, (ii) Inverted Pendulum, (iii) Cartpole, (iv) 3-link manipulator, and (v) TORCS simulator8 (Wymann et al., 2000).
To generate our training and test sets, each consists of triples (xt, ut, xt+1), we: (1) sample an underlying state st and generate its corresponding observation xt, (2) sample an action ut, and (3) obtain the next state st+1 according to the state transition dynamics, add it a zero-mean Gaussian noise with variance σ2Ins , and generate corresponding observation xt+1.To ensure that the observation-action data is uniformly distributed (see Section 3), we sample the state-action pair (st, ut) uniformly from the state-action space. To understand the robustness of each model, we consider both deterministic (σ = 0) and stochastic scenarios. In the stochastic case, we add noise to the system with different values of σ and evaluate the models’ performance under various degree of noise.
Each task has underlying start and goal states that are unobservable to the algorithms, instead, the algorithms have access to the corresponding start and goal observations. We apply control using the iLQR algorithm (see Appendix B), with the same cost function that was used by RCE and E2C, namely, c̄(zt, ut) = (zt − zgoal)>Q(zt − zgoal) + u>t Rut, and c̄(zT ) = (zT − zgoal)>Q(zT − zgoal), where zgoal is obtained by encoding the goal observation, and Q = κ · Inz , R = Inu9. Details of our implementations are specified in Appendix D.3. We report performance in the underlying system, specifically the percentage of time spent in the goal region10.
A Reproducible Experimental Pipeline In order to measure performance reproducibility, we perform the following 2-step pipeline. For each control task and algorithm, we (1) train 10 models
7For the RCE implementation, we directly optimize the ELBO loss in Equation (16) of the paper. We also tried the approach reported in the paper on increasing the weights of the two middle terms and then annealing them to 1. However, in practice this method is sensitive to annealing schedule and has convergence issues.
8See a control demo on the TORCS simulator at https://youtu.be/GBrgALRZ2fw 9According to the definition of latent cost c̄(z, u) = D ◦ c(z, u), its quadratic approximation is given by
c̄(z, u) ≈ [ z − zgoal
u ]> [∇z ∇u ] D◦c|z=zgoal,u=0 + 1 2 [ z − zgoal u ]> [∇2zz ∇2zu ∇2uz ∇2uu ] D◦c|z=zgoal,u=0 [ z − zgoal u ] .
Yet for simplicity, we choose the same latent cost as in RCE and E2C with fixed, tunable matrices Q and R. 10Another possible metric is the average distance to goal, which has a similar behavior.
independently, and (2) solve 10 control tasks per model (we do not cherry-pick, but instead perform a total of 10× 10 = 100 control tasks). We report statistics averaged over all the tasks (in addition, we report the best performing model averaged over its 10 tasks). By adopting a principled and statistically reliable evaluation pipeline, we also address a pitfall of the compared baselines where the best model needs to be cherry picked, and training variance was not reported.
Results Table 1 shows how PCC outperforms the baseline algorithms in the noiseless dynamics case by comparing means and standard deviations of the means on the different control tasks (for the case of added noise to the dynamics, which exhibits similar behavior, refer to Appendix E.1). It is important to note that for each algorithm, the performance metric averaged over all models is drastically different than that of the best model, which justifies our rationale behind using the reproducible evaluation pipeline and avoid cherry-picking when reporting. Figure 2 depicts 2 instances (randomly chosen from the 10 trained models) of the learned latent space representations on the noiseless dynamics of Planar and Inverted Pendulum tasks for PCC, RCE, and E2C models (additional representations can be found in Appendix E.2). Representations were generated by encoding observations corresponding to a uniform grid over the state space. Generally, PCC has a more interpretable representation of both Planar and Inverted Pendulum Systems than other baselines for both the noiseless dynamics case and the noisy case. Finally, in terms of computation, PCC demonstrates faster training with 64% improvement over RCE, and 2% improvement over E2C.11
Ablation Analysis On top of comparing the performance of PCC to the baselines, in order to understand the importance of each component in (PCC-LOSS), we also perform an ablation analysis on the consistency loss (with/without consistency loss) and the curvature loss (with/without curvature loss, and with/without amortization of the Jacobian terms). Table 2 shows the ablation analysis of PCC on the aforementioned tasks. From the numerical results, one can clearly see that when consistency loss is omitted, the control performance degrades. This corroborates with the theoretical results in Section 3.2, which indicates the relationship of the consistency loss and the estimation error between the next-latent dynamics prediction and the next-latent encoding. This further implies that as the consistency term vanishes, the gap between control objective function and the model training loss is widened, due to the accumulation of state estimation error. The control performance also decreases when one removes the curvature loss. This is mainly attributed to the error between the iLQR control algorithm and (SOC2). Although the latent state dynamics model is parameterized with neural networks, which are smooth, without enforcing the curvature loss term the norm of the Hessian (curvature) might still be high. This also confirms with the analysis in Section 3.3 about sub-optimality performance and curvature of latent dynamics. Finally, we observe that the performance of models trained without amortized curvature loss are slightly better than with their amortized counterpart, however, since the amortized curvature loss does not require computing gradient of the latent dynamics (which means that in stochastic optimization one does not need to estimate its Hessian), we observe relative speed-ups in model training with the amortized version (speed-up of 6%, 9%, and 15% for Planar System, Inverted Pendulum, and Cartpole, respectively).

heading: 7 CONCLUSION
text: In this paper, we argue from first principles that learning a latent representation for control should be guided by good prediction in the observation space and consistency between latent transition and
11Comparison jobs were deployed on the Planar system using Nvidia TITAN Xp GPU.
the embedded observations. Furthermore, if variants of iterative LQR are used as the controller, the low-curvature dynamics is desirable. All three elements of our PCC models are critical to the stability of model training and the performance of the in-latent-space controller. We hypothesize that each particular choice of controller will exert different requirement for the learned dynamics. A future direction is to identify and investigate the additional bias for learning an effective embedding and latent dynamics for other type of model-based control and planning methods.

heading: A TECHNICAL PROOFS OF SECTION 3

heading: A.1 PROOF OF LEMMA 1
text: Following analogous derivations of Lemma 11 in Petrik et al. (2016) (for the case of finite-horizon MDPs), for the case of finite-horizon MDPs, one has the following chain of inequalities for any given control sequence {ut}T−1t=0 and initial observation x0:
|L(U, P̂ , x0)− L(U,P, x0)|
= ∣∣∣∣∣E [ cT (xT )+ T−1∑ t=0 ct(xt, ut) | P̂ , x0 ] − E [ cT (xT )+ T−1∑ t=0 ct(xt, ut) |P, x0 ]∣∣∣∣∣ ≤T 2 · cmax E [ 1
T T−1∑ t=0 DTV(P (·|xt, ut)||P̂ (·|xt, ut)) | P, x0
]
≤ √ 2T 2 · cmax E
[ 1
T T−1∑ t=0 √ KL(P (·|xt, ut)||P̂ (·|xt, ut)) | P, x0
]
≤ √ 2T 2 · cmax √√√√E[ 1 T T−1∑ t=0 KL(P (·|xt, ut)||P̂ (·|xt, ut)) | P, x0 ] ,
where DTV is the total variation distance of two distributions. The first inequality is based on the result of the above lemma, the second inequality is based on Pinsker’s inequality (Ordentlich & Weinberger, 2005), and the third inequality is based on Jensen’s inequality (Boyd & Vandenberghe, 2004) of √ (·) function.
Now consider the expected cumulative KL cost: E [
1 T ∑T−1 t=0 KL(P (·|xt, ut)||P̂ (·|xt, ut)) | P, x0 ] with respect to some arbitrary control action sequence {ut}T−1t=0 . Notice that this arbitrary action sequence can always be expressed in form of deterministic policy ut = π′(xt, t) with some nonstationary state-action mapping π′. Therefore, this KL cost can be written as:
E
[ 1
T T−1∑ t=0 KL(P (·|xt, ut)||P̂ (·|xt, ut)) | P, π, x0
]
=E
[ 1
T T−1∑ t=0 ∫ ut∈U KL(P (·|xt, ut)||P̂ (·|xt, ut))dπ′(ut|xt, t) | P, x0 ]
=E
[ 1
T T−1∑ t=0 ∫ ut∈U KL(P (·|xt, ut)||P̂ (·|xt, ut)) · dπ′(ut|xt, t) dU(ut) · dU(ut) | P, x0 ] ≤U · Ex,u [ KL(P (·|x, u)||P̂ (·|x, u)) ] ,
(10)
where the expectation is taken over the state-action occupation measure 1T ∑T−1 t=0 P(xt = x, ut = u|x0, U) of the finite-horizon problem that is induced by data-sampling policy U . The last inequality is due to change of measures in policy, and the last inequality is due to the facts that (i) π is a deterministic policy, (ii) dU(ut) is a sampling policy with lebesgue measure 1/U over all control actions, (iii) the following bounds for importance sampling factor holds:
∣∣∣dπ′(ut|xt,t)dU(ut) ∣∣∣ ≤ U . To conclude the first part of the proof, combining all the above arguments we have the following inequality for any model P̂ and control sequence U :
|L(U, P̂ , x0)− L(U,P, x0)| ≤ √ 2T 2 · cmaxU · √ Ex,u [ KL(P (·|x, u)||P̂ (·|x, u)) ] . (11)
For the second part of the proof, consider the solution of (SOC3), namely (U∗3 , P̂ ∗ 3 ). Using the optimality condition of this problem one obtains the following inequality:
L(U∗3 , P̂ ∗ 3 , x0) + √ 2T 2 · cmaxU · √ Ex,u [ KL(P (·|x, u)||P̂ ∗3 (·|x, u)) ] ≤L(U∗1 , P̂ ∗3 , x0) + √ 2T 2 · cmaxU · √ Ex,u [ KL(P (·|x, u)||P̂ ∗3 (·|x, u)) ] .
(12)
Using the results in (11) and (12), one can then show the following chain of inequalities:
L(U∗1 , P, c, x0) ≥L(U∗1 , P̂ ∗3 , c, x0)− √ 2T 2 · cmaxU · √ Ex,u [ KL(P (·|x, u)||P̂ ∗3 (·|x, u)) ] =L(U∗1 , P̂ ∗ 3 , c, x0) + √ 2T 2 · cmaxU · √ Ex,u [ KL(P (·|x, u)||P̂ ∗3 (·|x, u))
] − 2 √ 2T 2 · cmaxU · √ Ex,u [ KL(P (·|x, u)||P̂ ∗3 (·|x, u))
] ≥L(U∗3 , P̂ ∗3 , c, x0) + √ 2T 2 · cmaxU · √ Ex,u [ KL(P (·|x, u)||P̂ ∗3 (·|x, u))
] − 2 √ 2T 2 · cmaxU · √ Ex,u [ KL(P (·|x, u)||P̂ ∗3 (·|x, u))
] ≥L(U∗3 , P, c, x0)− 2 √ 2T 2 · cmaxU · √ Ex,u [ KL(P (·|x, u)||P̂ ∗3 (·|x, u)) ] ,
(13)
where U∗1 is the optimizer of (SOC1) and (U ∗ 3 , P̂ ∗ 3 ) is the optimizer of (SOC3). Therefore by letting λ3 = √ 2T 2 · cmaxU and R3(P̂ ) = Ex,u [ KL(P (·|x, u)||P̂ (·|x, u)) ] and by
combining all of the above arguments, the proof of the above lemma is completed.

heading: A.2 PROOF OF LEMMA 2
text: For the first part of the proof, at any time-step t ≥ 1, for any arbitrary control action sequence {ut}T−1t=0 , and any model P̂ , consider the following decomposition of the expected cost :
E[c(xt, ut) | P̂ ,x0] = ∫ x0:t−1∈X t t−1∏ k=1
dP̂ (xk|xk−1, uk−1)·∫ zt∈Z ∫ z′t−1∈Z
dE(z′t−1|xt−1)F (zt|z′t−1, ut−1)︸ ︷︷ ︸ dG(zt|xt−1,ut−1)
∫ xt∈X
dD(xt|zt)c(xt, ut)︸ ︷︷ ︸ c̄(zt,ut) .
Now consider the following cost function: E[c(xt−1, ut−1) + c(xt, ut) | P̂ , x0] for t > 2. Using the above arguments, one can express this cost as
E[c(xt−1, ut−1) + c(xt, ut) | P̂ , x0]
= ∫ x0:t−2∈X t−1 t−2∏ k=1 dP̂ (xk|xk−1, uk−1) · ∫ z′t−2∈Z dE(z′t−2|xt−2) · ∫ zt−1∈Z
dF (zt−1|z′t−2, ut−2)( c̄(zt−1, ut−1) +
∫ xt−1∈X dD(xt−1|zt−1) ∫ z′t−1,zt∈Z dE(z′t−1|xt−1)dF (zt|z′t−1, ut−1)c̄(zt, ut) )
≤ ∫ x0:t−2∈X t−1 t−2∏ k=1 dP̂ (xk|xk−1, uk−1) · ∫ zt−2∈Z
dE(zt−2|xt−2)·∫ zt−1 dF (zt−1|zt−2, ut−2) ( c̄(zt−1, ut−1) + ∫ zt∈Z dF (zt|zt−1, ut−1)c̄(zt, ut) )
+ cmax · ∫ x0:t−2∈X t−1 t−2∏ k=1 dP (xk|xk−1, uk−1) ·DTV (∫ x′∈X dP̂ (x′|xt−2, ut−2)E(·|x′)|| ∫ z∈Z dE(z|xt−2)F (·|z, ut−2) )
By continuing the above expansion, one can show that∣∣∣E [L(U,F, c, z0) | E, x0]− L(U, P̂ , c, x0)∣∣∣ ≤T 2 · cmax E [ 1
T T−1∑ t=0 DTV((E ◦ P̂ )(·|xt, ut)||(F ◦ E)(·|xt, ut)) | P, x0
]
≤ √ 2T 2 · cmax E
[ 1
T T−1∑ t=0 √ KL((E ◦ P̂ )(·|xt, ut)||(F ◦ E)(·|xt, ut)) | P, x0
]
≤ √ 2T 2 · cmax √√√√E[ 1 T T−1∑ t=0 KL((E ◦ P̂ )(·|xt, ut)||(F ◦ E)(·|xt, ut)) | P, x0 ] ,
where the last inequality is based on Jensen’s inequality of √
(·) function. For the second part of the proof, following similar arguments as in the second part of the proof of Lemma 1, one can show the following chain of inequalities for solution of (SOC3) and (SOC2):
L(U∗3 , P̂ ∗ 3 , c, x0)
≥E [L(U∗3 , F ∗3 , c, z0) | E∗3 , x0]− √ 2T 2 · cmaxU · √ Ex,u [ KL((E∗3 ◦ P̂ ∗3 )(·|x, u)||(F ∗3 ◦ E∗3 )(·|x, u)) ] =E [L(U∗3 , F ∗3 , c, z0) | E∗3 , x0] + √ 2T 2 · cmaxU · √ Ex,u [ KL((E∗3 ◦ P̂ ∗3 )(·|x, u)||(F ∗3 ◦ E∗3 )(·|x, u))
] − 2 √ 2T 2 · cmaxU · √ Ex,u [ KL((E∗3 ◦ P̂ ∗3 )(·|x, u)||(F ∗3 ◦ E∗3 )(·|x, u))
] ≥E [L(U∗2 , F ∗2 , c, z0) | E∗2 , x0] + √ 2T 2 · cmaxU · √ Ex,u [ KL((E∗2 ◦ P̂ ∗2 )(·|x, u)||(F ∗2 ◦ E∗2 )(·|x, u))
] − 2 √ 2T 2 · cmaxU · √ Ex,u [ KL((E∗3 ◦ P̂ ∗3 )(·|x, u)||(F ∗3 ◦ E∗3 )(·|x, u))
] ≥L(U∗2 , P̂ ∗2 , c, x0)− 2 √ 2T 2 · cmaxU︸ ︷︷ ︸
λ2
· √ Ex,u [ KL((E∗2 ◦ P̂ ∗2 )(·|x, u)||(F ∗2 ◦ E∗2 )(·|x, u)) ] ︸ ︷︷ ︸
R′′2 (P̂ ∗ 2 )
,
(14) where the first and third inequalities are based on the first part of this Lemma, and the second inequality is based on the optimality condition of problem (SOC2). This completes the proof.

heading: A.3 PROOF OF COROLLARY 1
text: To start with, the total-variation distance DTV (∫ x′∈X dP̂ (x ′|x, u)E(·|x′)||(F ◦ E)(·|x, u) ) can be bounded by the following inequality using triangle inequality:
DTV (∫ x′∈X dP̂ (x′|x, u)E(·|x′)||(F ◦ E)(·|x, u) )
≤DTV (∫
x′∈X dP (x′|x, u)E(·|x′)||(F ◦ E)(·|x, u)
) +DTV (∫ x′∈X dP (x′|x, u)E(·|x′)|| ∫ x′∈X dP̂ (x′|x, u)E(·|x′) )
≤DTV (∫
x′∈X dP (x′|x, u)E(·|x′)||(F ◦ E)(·|x, u)
) +DTV ( P (·|x, u)||P̂ (·|x, u) ) where the second inequality follows from the convexity property of the DTV-norm (w.r.t. convex weights E(·|x′), ∀x′). Then by Pinsker’s inequality, one obtains the following inequality:
DTV (∫ x′∈X dP̂ (x′|x, u)E(·|x′)||(F ◦ E)(·|x, u) )
≤ √ 2KL (∫ x′∈X dP (x′|x, u)E(·|x′)||(F ◦ E)(·|x, u) ) + √ 2KL ( P (·|x, u)||P̂ (·|x, u) ) . (15)
We now analyze the batch consistency regularizer:
R′′2 (P̂ ) = Ex,u,x′ [KL(E(·|x′)||(F ◦ E)(·|x, u))]
and connect it with the inequality in (15). Using Jensen’s inequality of convex function x log x, for any observation-action pair (x, u) sampled from Uτ , one can show that∫
x′∈X dP (x′|x, u) ∫ z′∈Z dE(z′|x′) log (∫ x′∈X dP (x′|x, u)E(z′|x′) ) ≤ ∫ x′∈X dP (x′|x, u) ∫ z′∈Z dE(z′|x′) log (E(z′|x′)) . (16)
Therefore, for any observation-control pair (x, u) the following inequality holds:
KL (∫
x′∈X dP (x′|x, u)E(·|x′)||(F ◦ E)(·|x, u) ) =
∫ x′∈X dP (x′|x, u) ∫ z′∈Z dE(z′|x′) log (∫ x′∈X dP (x′|x, u)E(z′|x′) ) − ∫ x′∈X dP (x′|x, u) log (g(x′|x, u))
≤ ∫ x′∈X dP (x′|x, u) ∫ z′∈Z dE(z′|x′) log (E(z′|x′))− ∫ x′∈X dP (x′|x, u) log (g(x′|x, u)) =KL(E(·|x′)||(F ◦ E)(·|x, u))
(17)
By taking expectation over (x, u) one can show that
Ex,u [ KL( ∫ x′∈X dP (x′|x, u)E(·|x′)||(F ◦ E)(·|x, u)) ]
is the lower bound of the batch consistency regularizer. Therefore, the above arguments imply that
DTV (∫ x′∈X dP̂ (x′|x, u)E(·|x′)||(F ◦ E)(·|x, u) ) ≤ √ 2 √ R′′2 (P̂ ) +R3(P̂ ). (18)
The inequality is based on the property that √ a+ √ b ≤ √ 2 √ a+ b.
Equipped with the above additional results, the rest of the proof on the performance bound follows directly from the results from Lemma 2, in which here we further upper-bound DTV (∫ x′∈X dP̂ (x ′|x, u)E(·|x′)||(F ◦ E)(·|x, u) ) , when P̂ = P̂ ∗2 .

heading: A.4 PROOF OF LEMMA 3
text: For the first part of the proof, at any time-step t ≥ 1, for any arbitrary control action sequence {ut}T−1t=0 and for any model P̂ , consider the following decomposition of the expected cost : E[c(xt, ut) | P, x0] = cmax · ∫ x0:t−1∈X t t−1∏ k=1 dP (xk|xk−1, uk−1)DTV(P (·|xt−1, ut−1)||P̂ (·|xt−1, ut−1))
+ ∫ x0:t−1∈X t t−1∏ k=1 dP (xk|xk−1, uk−1) ∫ zt∈Z ∫ z′t−1∈Z
dE(z′t−1|xt−1)F (zt|z′t−1, ut−1)︸ ︷︷ ︸ dG(zt|xt−1,ut−1)
∫ xt∈X
dD(xt|zt)c(xt, ut)︸ ︷︷ ︸ c̄(zt,ut) .
Now consider the following cost function: E[c(xt−1, ut−1) + c(xt, ut) | P̂ , x0] for t > 2. Using the above arguments, one can express this cost as E[c(xt−1, ut−1) + c(xt, ut) | P, x0]
= ∫ x0:t−2∈X t−1 t−2∏ k=1 dP (xk|xk−1, uk−1) · ∫ z′t−2∈Z dE(z′t−2|xt−2) · ∫ zt−1
dF (zt−1|z′t−2, ut−2)·( c̄(zt−1, ut−1) +
∫ xt−1 dD(xt−1|zt−1) ∫ z′t−1,zt∈Z dE(z′t−1|xt−1)dF (zt|z′t−1, ut−1)c̄(zt, ut) )
+ cmax · 2∑ j=1 j · ∫ x0:t−j t−j∏ k=1 dP (xk|xk−1, uk−1)DTV(P (·|xt−j , ut−j)||P̂ (·|xt−j , ut−j))
≤ ∫ x0:t−2∈X t−1 t−2∏ k=1 dP (xk|xk−1, uk−1) · ∫ zt−2∈Z
dE(zt−2|xt−2)·∫ zt−1 dF (zt−1|zt−2, ut−2) ( c̄(zt−1, ut−1) + ∫ zt∈Z dF (zt|zt−1, ut−1)c̄(zt, ut) )
+ cmax · 2∑ j=1 j · ∫ x0:t−j t−j∏ k=1 dP (xk|xk−1, uk−1)DTV(P (·|xt−j , ut−j)||P̂ (·|xt−j , ut−j))
+ cmax · ∫ x0:t−2∈X t−1 t−2∏ k=1 dP (xk|xk−1, uk−1) ·DTV (∫ x′∈X dP̂ (x′|xt−2, ut−2)E(·|x′)|| ∫ z∈Z dE(z|xt−2)F (·|z, ut−2) ) .
Continuing the above expansion, one can show that |E [L(U,F, c, z0) | E, x0]− L(U,P, x0)|
≤T 2 · cmax E
[ 1
T T−1∑ t=0 DTV(P (·|xt, ut)||P̂ (·|xt, ut)) +DTV( ∫ x′∈X dP̂ (x′|xt, ut)E(·|x′)||(F ◦ E)(·|xt, ut)) | P, x0 ]
≤ √ 2T 2 · cmax E
[ 1
T T−1∑ t=0 √ KL(P (·|xt, ut)||P̂ (·|xt, ut)) + √ KL( ∫ x′∈X dP̂ (x′|xt, ut)E(·|x′)||(F ◦ E)(·|xt, ut)) | P, x0 ]
≤ √ 2T 2 · cmax E
[ 1
T T−1∑ t=0 √ KL(P (·|xt, ut)||P̂ (·|xt, ut))
+ √ KL(P (·|xt, ut)||P̂ (·|xt, ut)) + KL(E(·|xt+1)||(F ◦ E)(·|xt, ut)) | P, x0 ]
≤2T 2 · cmax √√√√E[ 1 T T−1∑ t=0 3KL(P (·|xt, ut)||P̂ (·|xt, ut)) + 2KL(E(·|xt+1)||(F ◦ E)(·|xt, ut)) | P, x0 ] ,
where the last inequality is based on the fact that √ a+ √ b ≤ √ 2 √ a+ b and is based on Jensen’s inequality of √
(·) function. For the second part of the proof, following similar arguments from Lemma 2, one can show the following inequality for the solution of (SOC3) and (SOC2):
L(U∗1 , P, c, x0) ≥E [L(U∗1 , F ∗2 , c, z0) | E∗2 , x0]− √ 2T 2 · cmaxU · √ 2R′′2 (P̂ ∗ 2 ) + 3R3(P̂ ∗ 2 )
=E [L(U∗1 , F ∗2 , c, z0) | E∗2 , x0] + √ 2T 2 · cmaxU · √ 2R′′2 (P̂ ∗ 2 ) + 3R3(P̂ ∗ 2 )
− 2 √ 2T 2 · cmaxU · √ 2R′′2 (P̂ ∗ 2 ) + 3R3(P̂ ∗ 2 )
≥E [L(U∗2 , F ∗2 , c, z0) | E∗2 , x0] + √ 2T 2 · cmaxU · √ 2R′′2 (P̂ ∗ 2 ) + 3R3(P̂ ∗ 2 )
− 2 √ 2T 2 · cmaxU · √ 2R′′2 (P̂ ∗ 2 ) + 3R3(P̂ ∗ 2 )
≥L(U∗2 , P, c, x0)− 2 √ 2T 2 · cmaxU︸ ︷︷ ︸ λ2
· √
2R′′2 (P̂ ∗ 2 ) + 3R3(P̂ ∗ 2 ),
(19)
where the first and third inequalities are based on the first part of this Lemma, and the second inequality is based on the optimality condition of problem (SOC2). This completes the proof.

heading: A.5 PROOF OF LEMMA 4
text: A Recap of the Result: Let (U∗LLC, P̂ ∗LLC) be a LLC solution to (SOC-LLC) and U∗1 be a solution to (SOC1). Suppose the nominal latent state-action pair {(zt,ut)}T−1t=0 satisfies the condition: (zt,ut) ∼ N ((z∗2,t, u∗2,t), δ2I), where {(z∗2,t, u∗2,t}T−1t=0 is the optimal trajectory of problem (SOC2). Then with probability 1 − η, we have L(U∗1 , P, c, x0) ≥ L(U∗LLC, P, c, x0) − 2λLLC √ R2(P̂ ∗LLC) +RLLC(P̂ ∗ LLC) .
Discussions of the effect of δ on LLC Performance: The result of this lemma shows that when the nominal state and actions are δ-close to the optimal trajectory of (SOC2), i.e., at each time step (zt,ut) is a sample from the Gaussian distribution centered at (z∗2,t, u ∗ 2,t) with standard deviation δ, then one can obtain a performance bound of LLC algorithm that is in terms of the regularization loss RLLC. To quantify the above condition, one can use Mahalanobis distance (De Maesschalck et al., 2000) to measure the distance of (zt,ut) to distribution N ((z∗2,t, u∗2,t), δ2I), i.e., we want to check for the condition:
‖(zt,ut)− (z∗2,t, u∗2,t)‖ δ ≤ ′, ∀t,
for any arbitrary error tolerance ′ > 0. While we cannot verify the condition without knowing the optimal trajectory {(z∗2,t, u∗2,t)}T−1t=0 , the above condition still offers some insights in choosing the parameter δ based on the trade-off of designing nominal trajectory {(zt,ut)}T−1t=0 and optimizing RLLC. When δ is large, the low-curvature regularization imposed by the RLLC regularizer will cover a large portion of the state-action space. In the extreme case when δ →∞, RLLC can be viewed as a regularizer that enforces global linearity. Here the trade-off is that the loss RLLC is generally higher, which in turn degrades the performance bound of the LLC control algorithm in Lemma 4. On the other hand, when δ is small the low-curvature regularization in RLLC only covers a smaller region of the latent state-action space, and thus the loss associated with this term is generally lower (which provides a tighter performance bound in Lemma 4). However the performance result will only hold when (zt,ut) happens to be close to (z∗2,t, u ∗ 2,t) at each time-step t ∈ {0, . . . , T − 1}.
Proof: For simplicity, we will focus on analyzing the noiseless case when the dynamics is deterministic (i.e., Σw = 0). Extending the following analysis for the case of non-deterministic dynamics should be straight-forward.
First, consider any arbitrary latent state-action pair (z, u), such that the corresponding nominal state-action pair (z,u) is constructed by z = z− δz, u = u− δu, where (δz, δu) is sampled from the Gaussian distribution N (0, δ2I). (The random vectors are denoted as (δz′, δu′)) By the two-tailed Bernstein’s inequality (Murphy, 2012), for any arbitrarily given η ∈ (0, 1] one has the following inequality with probability 1− η:
|fZ(z,u) +A(z,u)δz +B(z,u)δu− fZ(z, u)| ≤ √ 2 log(2/η) √ V(δz′,δu′)∼N (0,δ2I)[fZ(z,u) +A(z,u)δz′ +B(z,u)δu′ − fZ(z, u)]
+ ∣∣E(δz′,δu′)∼N (0,δ2I)[fZ(z,u) +A(z,u)δz′ +B(z,u)δu′ − fZ(z, u)]∣∣
≤(1 + √ 2 log(2/η)) ( E(δz′,δu′)∼N (0,δ2I) [ ‖fZ(z,u) +A(z,u)δz′ +B(z,u)δu′ − fZ(z, u)‖2 ]︸ ︷︷ ︸ RLLC(P̂ |z,u) )1/2 .
The second inequality is due to the basic fact that variance is less than second-order moment of a random variable. On the other hand, at each time step t ∈ {0, . . . , T −1} by the Lipschitz property of the immediate cost, the value function Vt(z) = minUt:T−1 E [ cT (zT ) + ∑T−1 τ=t cτ (zτ , uτ ) | zt = z ] is also Lipchitz with constant (T − t+ 1)clip. Using the Lipschitz property of Vt+1, for any (z, u)
and (δz, δu), such that (z,u) = (z − δz, u− δu), one has the following property: |Vt+1(z ′ +A(z,u)δz +B(z,u)δu)− Vt+1(fZ(z, u))| ≤(T − t)clip · |fZ(z,u) +A(z,u)δz +B(z,u)δu− fZ(z, u)| ,
(20)
Therefore, at any arbitrary state-action pair (z̃, ũ), for z = z − δz, and u = ũ− δu with Gaussian sample (δz, δu) ∼ N (0, δ2I), the following inequality on the value function holds w.p. 1− η:
Vt+1(fZ(z̃, ũ)) ≥ Vt+1(z ′ +A(z,u)δz +B(z,u)δu)− (T − t)clip(1 + √ 2 log(2/η)) · √ RLLC(P̂ |z̃, ũ),
which further implies
ct(z̃, ũ) + Vt+1(fZ(z̃, ũ)) ≥ct(z̃, ũ) + Vt+1(z ′ +A(z,u)δz +B(z,u)δu)− (T − t)clip(1 + √ 2 log(2/η)) · √ RLLC(P̂ |z̃, ũ),
Now let ũ∗ be the optimal control w.r.t. Bellman operator Tt[Vt+1](z̃) at any latent state z̃. Based on the assumption of this lemma, at each state z̃ the nominal latent state-action pair (z,u) is generated by perturbing (z̃, ũ∗) with Gaussian sample (δz, δu) ∼ N (0, δ2I) that is in form of z = z̃ − δz, u = ũ− δu. Then by the above arguments the following chain of inequalities holds w.p. 1− η:
Tt[Vt+1](z̃) := min ũ ct(z̃, ũ) + Vt+1(fZ(z̃, ũ))
=ct(z̃, ũ ∗) + Vt+1(fZ(z̃, ũ ∗)) ≥ct(z̃, ũ∗) + Vt+1(fZ(z,u) +A(z,u)δz +B(z,u)δu) − |Vt+1(z ′ +A(z,u)δz +B(z,u)δu)− Vt+1(fZ(z̃, ũ∗))|
≥ct(z̃,u + δu) + Vt+1(fZ(z,u) +A(z,u)δz +B(z,u)δu) − (T − t)clip(1 + √ 2 log(2/η)) √ max z,u RLLC(P̂ |z, u)
≥min δu ct(z̃,u + δu) + Vt+1(fZ(z,u) +A(z,u)δz +B(z,u)δu)
− (T − t)clip(1 + √ 2 log(2/η)) √ max z,u RLLC(P̂ |z, u)
(21)
Recall the LLC loss function is given by RLLC(P̂ ) = Ex,u [ E [ RLLC(P̂ |z, u) | z ] | E ] .
Also consider the Bellman operator w.r.t. latent SOC: Tt[V ](z) = minu ct(z, u) + V (fZ(z, u)), and the Bellman operator w.r.t. LLC: Tt,LLC[V ](z) = minδu ct(z, δu+ u) + V (fZ(z,u) +A(z,u)δz + B(z,u)δu). Utilizing these definitions, the inequality in (21) can be further expressed as
Tt[Vt+1](z̃) ≥Tt,LLC[Vt+1](z̃)− (T − t)clipcmax(1 + √ 2 log(2/η)) √ UX √ RLLC(P̂ ), (22)
This inequality is due to the fact that all latent states are generated by the encoding observations, i.e., z ∼ E(·|x), and thus by following analogous arguments as in the proof of Lemma 1, one has
max z,u
RLLC(P̂ |z, u) ≤ UXEx,u [ E [ RLLC(P̂ |z, u) | z ] | E ] = UXRLLC(P̂ ).
Therefore, based on the dynamic programming result that bounds the difference of value function w.r.t. different Bellman operators in finite-horizon problems (for example see Theorem 1.3 in Bertsekas (1995)), the above inequality implies the following bound in the value function, w.p. 1− η:
min U,P̂ L(U,F, c, z0)
≥L(U∗LLC, P̂ ∗LLC, c, z0)− T−1∑ t=1 (T − t) · clipcmax · T · (1 + √ 2 log(2T/η)) · √ UX · √ RLLC(P̂ ∗LLC)
≥L(U∗LLC, P̂ ∗LLC, c, z0)− T 2 · clipcmax · (1 + √ 2 log(2T/η)) · √ UX · √ RLLC(P̂ ∗LLC).
(23)
Notice that here we replace η in the result in (22) with η/T . In order to prove (23), we utilize (22) for each t ∈ {0, . . . , T − 1}, and this replacement is the result of applying the Union Probability bound (Murphy, 2012) (to ensure (23) holds with probability 1− η). Therefore the proof is completed by combining the above result with that in Lemma 3.

heading: B THE LATENT SPACE ILQR ALGORITHM

heading: B.1 PLANNING IN THE LATENT SPACE (HIGH-LEVEL DESCRIPTION)
text: We follow the same control scheme as in Banijamali et al. (2018). Namely, we use the iLQR (Li & Todorov, 2004) solver to plan in the latent space. Given a start observation xstart and a goal observation xgoal, corresponding to underlying states {sstart, sgoal}, we encode the observations to retrieve zstart and zgoal. Then, the procedure goes as follows: we initialize a random trajectory (sequence of actions), feed it to the iLQR solver and apply the first action from the trajectory the solver outputs. We observe the next observation returned from the system (closed-loop control), and feed the updated trajectory to the iLQR solver. This procedure continues until the it reaches the end of the problem horizon. We use a receding window approach, where at every planning step the solver only optimizes for a fixed length of actions sequence, independent of the problem horizon.

heading: B.2 DETAILS ABOUT ILQR IN THE LATENT SPACE
text: Consider the latent state SOC problem
min U
E [ cT (zT ) +
T−1∑ t=0 ct(zt, ut) | z0
] .
At each time instance t ∈ {0, . . . , T} the value function of this problem is given by
VT (z) = cT (z), Vt(z) = min Ut:T−1
E [ cT (zT ) +
T−1∑ τ=t cτ (zτ , uτ ) | zt = z
] , ∀t < T. (24)
Recall that the nonlinear latent space dynamics model is given by:
zt+1 = F (zt, ut, wt) := Fµ(zt, ut) + Fσ · wt, wt ∼ N (0, I), ∀t ≥ 0, (25)
where Fµ(zt, ut) is the deterministic dynamics model and F>σ Fσ is the covariance of the latent dynamics system noise. Notice that the deterministic dynamics model Fµ(zt, ut) is smooth, and therefore the following Jacobian terms are well-posed:
A(z, u) := ∂Fµ(z, u)
∂z , B(z, u) :=
∂Fµ(z, u)
∂u , ∀z ∈ Rnz , ∀u ∈ Rnu .
By the Bellman’s principle of optimality, at each time instance t ∈ {0, . . . , T − 1} the value function is a solution of the recursive fixed point equation
Vt(z) = min u Qt(z, u), (26)
where the state-action value function at time-instance t w.r.t. state-action pair (zt, ut) = (z, u) is given by
Qt(z, u) = ct(z, u) + Ewt [Vt+1(F (zt, ut, wt)) | zt = z, ut = u] .
In the setting of the iLQR algorithm, assume we have access to a trajectory of latent states and actions that is in form of {(zt,ut, zt+1)}T−1t=0 . At each iteration, the iLQR algorithm has the following steps:
1. Given a nominal trajectory, find an optimal policy w.r.t. the perturbed latent states 2. Generate a sequence of optimal perturbed actions that locally improves the cumulative cost
of the given trajectory 3. Apply the above sequence of actions to the environment and update the nominal trajectory 4. Repeat the above steps with new nominal trajectory
Denote by δzt = zt − zt and δut = ut − ut the deviations of state and control action at time step t respectively. Assuming that the nominal next state zt+1 is generated by the deterministic transition Fµ(zt,ut) at the nominal state and action pair (zt,ut), the first-order Taylor series approximation of the latent space transition is given by
δzt+1 := zt+1−zt+1 = A(zt,ut)δzt+B(zt,ut)δut+Fσ ·wt+O(‖(δzt, δut)‖2), wt ∼ N (0, I). (27)
To find a locally optimal control action sequence u∗t = π ∗ δz,t(δzt) + ut, ∀t, that improves the cumulative cost of the trajectory, we compute the locally optimal perturbed policy (policy w.r.t. perturbed latent state) {π∗δz,t(δzt)} T−1 t=0 that minimizes the following second-order Taylor series approximation of Qt around nominal state-action pair (zt,ut), ∀t ∈ {0, . . . , T − 1}:
Qt(zt, ut) = Qt(zt,ut)+ 1
2 [ 1 δzt δut ]> F>σ Fσ Qt,z(zt,ut)> Qt,u(zt,ut)>Qt,z(zt,ut) Qt,zz(zt,ut) Qt,uz(zt,ut)> Qt,u(zt,ut) Qt,uz(zt,ut) Qt,uu(zt,ut) [ 1δzt δut ] , (28)
where the first and second order derivatives of the Q−function are given by
Qt,z(zt,ut) =
[ ∂ct(zt,ut)
∂z +A(zt,ut)
>Vt+1,z(zt,ut) ] ,
Qt,u(zt,ut) =
[ ∂ct(zt,ut)
∂u +B(zt,ut)
>Vt+1,z(zt,ut) ] ,
Qt,zz(zt,ut) =
[ ∂2ct(zt,ut)
∂z2 +A(zt,ut)
>Vt+1,zz(zt,ut)A(zt,ut) ] ,
Qt,uz(zt,ut) =
[ ∂2ct(zt,ut)
∂u∂z +B(zt,ut)
>Vt+1,zz(zt,ut)A(zt,ut) ] ,
Qt,uu(zt,ut) =
[ ∂2ct(zt,ut)
∂u2 +B(zt,ut)
>Vt+1,zz(zt,ut)B(zt,ut) ] ,
and the first and second order derivatives of the value functions are given by Vt+1,z(zt,ut) = Ew [ ∂Vt+1 ∂z (F (zt,ut, w)) ] , Vt+1,zz(zt,ut) = Ew [ ∂2Vt+1 ∂z2 (F (zt,ut, w)) ] . Notice that the Q-function approximation Qt in (28) is quadratic and the matrix[ Qt,zz(zt,ut) Qt,uz(zt,ut) >
Qt,uz(zt,ut) Qt,uu(zt,ut)
] is positive semi-definite. Therefore the optimal perturbed policy
π∗δz,t has the following closed-form solution:
π∗δz,t(·) ∈ arg min δut Qt(zt, ut) =⇒ π∗δz,t(δzt) = kt(zt,ut) +Kt(zt,ut)δzt, (29)
where the controller weights are given by
kt(zt,ut) = − (Qt,uu(zt,ut))−1Qt,u(zt,ut) and Kt(zt,ut) = − (Qt,uu(zt,ut))−1Qt,uz(zt,ut). Furthermore, by putting the optimal solution into the Taylor expansion of the Q-function Qt, we get
Qt(zt, ut)−Qt(zt,ut) = 1
2 [ 1 δzt ]> [ Q∗t,11(zt,ut) ( Q∗t,21(zt,ut) )> Q∗t,21(zt,ut) Q ∗ t,22(zt,ut) ] [ 1 δzt ] ,
where the closed-loop first and second order approximations of the Q-function are given by
Q∗t,11(zt,ut) = C > wCw −Qt,u(zt,ut)>Qt,uu(zt,ut)−1Qt,u(zt,ut),
Q∗t,21(zt,ut) = Qt,z(zt,ut) > − kt(zt,ut)>Qt,uu(zt,ut)Kt(zt,ut),
Q∗t,22(zt,ut) = Qt,zz(zt,ut)−Kt(zt,ut)>Qt,uu(zt,ut)Kt(zt,ut). Notice that at time step t the optimal value function also has the following form: Vt(zt) = min
δut Qt(zt, ut) =δQt(zt,ut, δzt, π
∗ δz,t(δzt)) +Qt(zt,ut)
= 1
2 [ 1 δzt ]> [ Q∗t,11(zt,ut) ( Q∗t,21(zt,ut) )> Q∗t,21(zt,ut) Q ∗ t,22(zt,ut) ] [ 1 δzt ] +Qt(zt,ut).
(30)
Therefore, the first and second order differential value functions can be Vt,z(zt,ut) = Q∗t,21(zt,ut), Vt,zz(zt,ut) = Q∗t,22(zt,ut),
and the value improvement at the nominal state zt at time step t is given by
Vt(zt) = 1
2 Q∗t,11(zt,ut) +Qt(zt,ut).
B.3 INCORPORATING RECEDING-HORIZON TO ILQR
While iLQR provides an effective way of computing a sequence of (locally) optimal actions, it has two limitations. First, unlike RL in which an optimal Markov policy is computed, this algorithm only finds a sequence of open-loop optimal control actions under a given initial observation. Second, the iLQR algorithm requires the knowledge of a nominal (latent state and action) trajectory at every iteration, which restricts its application to cases only when real-time interactions with environment are possible. In order to extend the iLQR paradigm into the closed-loop RL setting, we utilize the concept of model predictive control (MPC) (Rawlings & Mayne, 2009; Borrelli et al., 2017) and propose the following iLQR-MPC procedure. Initially, given an initial latent state z0 we generate a single nominal trajectory: {(zt,ut, zt+1)}T−1t=0 , whose sequence of actions is randomly sampled, and the latent states are updated by forward propagation of latent state dynamics (instead of interacting with environment), i.e., z0 = z0, zt+1 ∼ F (zt,ut, wt), ∀t. Then at each time-step k ≥ 0, starting at latent state zk we compute the optimal perturbed policy {π∗δz,t(·)} T−1 t=k using the iLQR algorithm with T − k lookahead steps. Having access to the perturbed latent state δzk = zk − zk, we only deploy the first action u∗k = π ∗ δz,k(δzk) + uk in the environment and observe the next latent state zk+1. Then, using the subsequent optimal perturbed policy {π∗δz,t(·)} T−1 t=k+1, we generate both the estimated latent state sequence {ẑt}Tt=k+1 by forward propagation with initial state ẑk+1 = zk+1 and action sequence {u∗t }T−1t=k+1, where u∗t = π∗δz,t(δẑt) + ut, and δẑt = ẑt − zt. Then one updates the subsequent nominal trajectory as follows: {(zt,ut, zt+1)}T−1t=k+1 = {(ẑt, u∗t , ẑt+1)} T−1 t=k+1, and repeats the above procedure.
Consider the finite-horizon MDP problem minπt,∀t E [ cT (xT ) + ∑T−1 t=0 ct(xt, ut) | πt, P, x0 ] ,
where the optimizer π is over the class of Markovian policies. (Notice this problem is the closed-loop version of (SOC1).) Using the above iLQR-MPC procedure, at each time step t ∈ {0, . . . , T − 1} one can construct a Markov policy that is in form of
πt,iLQR-MPC(·|xt) := uiLQRt s.t. {u iLQR t , · · · , u iLQR T−1} ← iLQR(L(U, P̃ ∗, c, zt)), with zt ∼ E(·|xt),
where iLQR(`Control(U ; P̃ ∗, z)) denotes the iLQR algorithm with initial latent state z. To understand the performance of this policy w.r.t. the MDP problem, we refer to the sub-optimality bound of iLQR (w.r.t. open-loop control problem in (SOC1)) in Section 3.3, as well as that for MPC policy, whose details can be found in Borrelli et al. (2017).

heading: C TECHNICAL PROOFS OF SECTION 4

heading: C.1 DERIVATION OF R′3,NLE-BOUND(P̂ , Q) DECOMPOSITION
text: We derive the bound for the conditional log-likelihood log P̂ (xt+1|xt, ut).
log P̂ (xt+1|xt, ut) = log ∫ zt,ẑt+1 P̂ (xt+1, zt, ẑt+1|xt, ut)dztdẑt+1
= logEQ(zt,ẑt+1|xt,xt+1,ut) [ P̂ (xt+1, zt, ẑt+1|xt, ut) Q(zt, ẑt+1|xt, xt+1, ut) ] (a) ≥ EQ(zt,ẑt+1|xt,xt+1,ut) [ log
P̂ (xt+1, zt, ẑt+1|xt, ut) Q(zt, ẑt+1|xt, xt+1, ut) ] (b) = E Q(ẑt+1|xt+1)
Q(zt|ẑt+1,xt,ut)
[ log
P̂ (zt|xt)P̂ (ẑt+1|zt, ut)P̂ (xt+1|ẑt+1) Q(ẑt+1|xt+1)Q(zt|ẑt+1, xt, ut) ] (c) = EQ(ẑt+1|xt+1) [ log P̂ (xt+1|ẑt+1)
] − EQ(ẑt+1|xt+1) [ DKL ( Q(zt|ẑt+1, xt, ut)||P̂ (zt|xt)
)] +H (Q(ẑt+1|xt+1))
+ E Q(ẑt+1|xt+1) Q(zt|ẑt+1,xt,ut)
[ log P̂ (ẑt+1|zt, ut) ] = R′3,NLE-Bound(P̂ , Q)
Where (a) holds from the log function concavity, (b) holds by the factorization Q(zt, ẑt+1|xt, xt+1, ut) = Q(ẑt+1|xt+1)Q(zt|ẑt+1, xt, ut), and (c) holds by a simple decomposition to the different components.

heading: C.2 DERIVATION OF R′′2,BOUND(P̂ , Q) DECOMPOSITION
text: We derive the bound for the consistency loss `Consistency(P̂ ).
R′′2 (P̂ ) = DKL ( P̂ (zt+1|xt+1)‖ ∫ zt P̂ (ẑt+1|zt, ut)P̂ (zt|xt)dzt )
(a) = −H (Q(ẑt+1|xt+1))− EQ(ẑt+1|xt+1)
[ log ∫ zt P̂ (ẑt+1|zt, ut)P̂ (zt|xt)dzt ]
= −H (Q(ẑt+1|xt+1))− EQ(ẑt+1|xt+1) [ logEQ(zt|ẑt+1,xt,ut) [ P̂ (ẑt+1|zt, ut)P̂ (zt|xt) Q(zt|ẑt+1, xt, ut) ]] (b) ≤ −H (Q(ẑt+1|xt+1))− E Q(ẑt+1|xt+1) Q(zt|ẑt+1,xt,ut) [ log P̂ (ẑt+1|zt, ut)P̂ (zt, xt) Q(zt|ẑt+1, xt, ut)
] (c) = − ( − EQ(ẑt+1|xt+1) [ DKL ( Q(zt|ẑt+1, xt, ut)||P̂ (zt|xt)
)] +H (Q(ẑt+1|xt+1)) + E Q(ẑt+1|xt+1)
Q(zt|ẑt+1,xt,ut)
[ log P̂ (ẑt+1|zt, ut) ]) = R′′2,Bound(P̂ , Q)
Where (a) holds by the assumption that Q(ẑt+1 | xt+1) = P̂ (zt+1 | xt+1), (b) holds from the log function concavity, and (c) holds by a simple decomposition to the different components.

heading: D EXPERIMENTAL DETAILS
text: In the following sections we will provide the description of the data collection process, domains, and implementation details used in the experiments.

heading: D.1 DATA COLLECTION PROCESS
text: To generate our training and test sets, each consists of triples (xt, ut, xt+1), we: (1) sample an underlying state st and generate its corresponding observation xt, (2) sample an action ut, and (3) obtain the next state st+1 according to the state transition dynamics, add it a zero-mean Gaussian noise with variance σ2Ins , and generate it’s corresponding observation xt+1.To ensure that the observation-action data is uniformly distributed (see Section 3), we sample the state-action pair (st, ut) uniformly from the state-action space. To understand the robustness of each model, we consider both deterministic (σ = 0) and stochastic scenarios. In the stochastic case, we add noise to the system with different values of σ and evaluate the models’ performance under various degree of noise.

heading: D.2 DESCRIPTION OF THE DOMAINS
text: Planar System In this task the main goal is to navigate an agent in a surrounded area on a 2D plane (Breivik & Fossen, 2005), whose goal is to navigate from a corner to the opposite one, while avoiding the six obstacles in this area. The system is observed through a set of 40 × 40 pixel images taken from the top view, which specifies the agent’s location in the area. Actions are two-dimensional and specify the x− y direction of the agent’s movement, and given these actions the next position of the agent is generated by a deterministic underlying (unobservable) state evolution function. Start State: one of three corners (excluding bottom-right). Goal State: bottom-right corner. Agent’s Objective: agent is within Euclidean distance of 2 from the goal state.
Inverted Pendulum — SwingUp & Balance This is the classic problem of controlling an inverted pendulum (Furuta et al., 1991) from 48× 48 pixel images. The goal of this task is to swing up an under-actuated pendulum from the downward resting position (pendulum hanging down) to the top position and to balance it. The underlying state st of the system has two dimensions: angle and angular velocity, which is unobservable. The control (action) is 1-dimensional, which is the torque applied to the joint of the pendulum. To keep the Markovian property in the observation (image) space, similar to the setting in E2C and RCE, each observation xt contains two images generated from consecutive time-frames (from current time and previous time). This is because each image only shows the position of the pendulum and does not contain any information about the velocity. Start State: Pole is resting down (SwingUp), or randomly sampled in ±π/6 (Balance). Agent’s Objective: pole’s angle is within ±π/6 from an upright position.
CartPole This is the visual version of the classic task of controlling a cart-pole system (Geva & Sitte, 1993). The goal in this task is to balance a pole on a moving cart, while the cart avoids hitting the left and right boundaries. The control (action) is 1-dimensional, which is the force applied to the cart. The underlying state of the system st is 4- dimensional, which indicates the angle and angular velocity of the pole, as well as the position and velocity of the cart. Similar to the inverted pendulum, in order to maintain the Markovian property the observation xt is a stack of two 80× 80 pixel images generated from consecutive time-frames. Start State: Pole is randomly sampled in ±π/6. Agent’s Objective: pole’s angle is within ±π/10 from an upright position.
3-link Manipulator — SwingUp & Balance The goal in this task is to move a 3-link manipulator from the initial position (which is the downward resting position) to a final position (which is the top position) and balance it. In the 1-link case, this experiment is reduced to inverted pendulum. In the 2-link case the setup is similar to that of arcobot (Spong, 1995), except that we have torques applied to all intermediate joints, and in the 3-link case the setup is similar to that of the 3-link planar robot arm domain that was used in the E2C paper, except that the robotic arms are modeled by simple rectangular rods (instead of real images of robot arms), and our task success criterion requires both swing-up (manipulate to final position) and balance.12 The underlying (unobservable) state st of the system is 2N -dimensional, which indicates the relative angle and angular velocity at each link, and the actions are N -dimensional, representing the force applied to each joint of the arm. The
12Unfortunately due to copyright issues, we cannot test our algorithms on the original 3-link planar robot arm domain.
state evolution is modeled by the standard Euler-Lagrange equations (Spong, 1995; Lai et al., 2015). Similar to the inverted pendulum and cartpole, in order to maintain the Markovian property, the observation state xt is a stack of two 80× 80 pixel images of the N -link manipulator generated from consecutive time-frames. In the experiments we will evaluate the models based on the case of N = 2 (2-link manipulator) and N = 3 (3-link manipulator). Start State: 1st pole with angle π, 2nd pole with angle 2π/3, and 3rd pole with angle π/3, where angle π is a resting position. Agent’s Objective: the sum of all poles’ angles is within ±π/6 from an upright position.
TORCS Simulaotr This task takes place in the TORCS simulator (Wymann et al., 2000) (specifically in michegan f1 race track, only straight lane). The goal of this task is to control a car so it would remain in the middle of the lane. We restricted the task to only consider steering actions (left / right in the range of [−1, 1]), and applied a simple procedure to ensure the velocity of the car is always around 10. We pre-processed the observations given by the simulator (240× 320 RGB images) to receive 80× 80 binary images (white pixels represent the road). In order to maintain the Markovian property, the observation state xt is a stack of two 80 × 80 images (where the two images are 7 frames apart - chosen so that consecutive observation would be somewhat different). The task goes as follows: the car is forced to steer strongly left (action=1), or strongly right (action=-1) for the initial 20 steps of the simulation (direction chosen randomly), which causes it to drift away from the center of the lane. Then, for the remaining horizon of the task, the car needs to recover from the drift, return to the middle of the lane, and stay there. Start State: 20 steps of drifting from the middle of the lane by steering strongly left, or right (chosen randomly). Agent’s Objective: agent (car) is within Euclidean distance of 1 from the middle of the lane (full width of the lane is about 18).
D.3 IMPLEMENTATION
In the following we describe architectures and hyper-parameters that were used for training the different algorithms.

heading: D.3.1 TRAINING HYPER-PARAMETERS AND REGULIZERS
text: All the algorithms were trained using:
• Batch size of 128. • ADAM (Goodfellow et al., 2016) with α = 5 · 10−4, β1 = 0.9, β2 = 0.999, and = 10−8. • L2 regularization with a coefficient of 10−3. • Additional VAE (Kingma & Welling, 2013) loss term given by `VAEt = −Eq(z|x) [log p(x|z)] + DKL (q(z|x)‖p(z)), where p(z) ∼ N (0, 1). The term was added with a very small coefficient of 0.01. We found this term to be important to stabilize the training process, as there is no explicit term that governs the scale of the latent space.
E2C training specifics:
• λ from the loss term of E2C was tuned using a parameter sweep in {0.25, 0.5, 1}, and was chosen to be 0.25 across all domains, as it performed the best independently for each domain.
PCC training specifics:
• λp was set to 1 across all domains. • λc was set to be 7 across all domains, after it was tuned using a parameter sweep in {1, 3, 7, 10} on the Planar system. • λcur was set to be 1 across all domains without performing any tuning. • {z̄, ū}, for the curvature loss, were generated from {z, u} by adding Gaussian noise N (0, 0.12), where σ = 0.1 was set across all domains without performing any tuning. • Motivated by Hafner et al. (2018), we added a deterministic loss term in the form of cross
entropy between the output of the generative path given the current observation and action (while taking the means of the encoder output and the dynamics model output) and the observation of the next state. This loss term was added with a coefficient of 0.3 across all domains after it was tuned using a parameter sweep over {0.1, 0.3, 0.5} on the Planar system.

heading: D.3.2 NETWORK ARCHITECTURES
text: We next present the specific architecture choices for each domain. For fair comparison, The numbers of layers and neurons of each component were shared across all algorithms. ReLU non-linearities were used between each two layers.
Encoder: composed of a backbone (either a MLP or a CNN, depending on the domain) and an additional fully-connected layer that outputs mean variance vectors that induce a diagonal Gaussian distribution.
Decoder: composed of a backbone (either a MLP or a CNN, depending on the domain) and an additional fully-connected layer that outputs logits that induce a Bernoulli distribution.
Dynamical model: the path that leads from {zt, ut} to ẑt+1. Composed of a MLP backbone and an additional fully-connected layer that outputs mean and variance vectors that induce a diagonal Gaussian distribution. We further added a skip connection from zt and summed it with the output of the mean vector. When using the amortized version, there are two additional outputs A and B.
Backwards dynamical model: the path that leads from {ẑt+1, ut, xt} to zt. each of the inputs goes through a fully-connected layer with {Nz, Nu, Nx} neurons, respectively. The outputs are then concatenated and pass though another fully-connected layer with Njoint neurons, and finally with an additional fully-connected layer that outputs the mean and variance vectors that induce a diagonal Gaussian distribution.

heading: Planar system
text: • Input: 40× 40 images. 5000 training samples of the form (xt, ut, xt+1) • Actions space: 2-dimensional • Latent space: 2-dimensional • Encoder: 3 Layers: 300 units - 300 units - 4 units (2 for mean and 2 for variance) • Decoder: 3 Layers: 300 units - 300 units - 1600 units (logits) • Dynamics: 3 Layers: 20 units - 20 units - 4 units • Backwards dynamics: Nz = 5, Nu = 5, Nx = 100 - Njoint = 100 - 4 units • Number of control actions: or the planning horizon T = 40

heading: Inverted Pendulum — Swing Up & Balance
text: • Input: Two 48× 48 images. 20000 training samples of the form (xt, ut, xt+1) • Actions space: 1-dimensional • Latent space: 3-dimensional • Encoder: 3 Layers: 500 units - 500 units - 6 units (3 for mean and 3 for variance) • Decoder: 3 Layers: 500 units - 500 units - 4608 units (logits) • Dynamics: 3 Layers: 30 units - 30 units - 6 units • Backwards dynamics: Nz = 10, Nu = 10, Nx = 200 - Njoint = 200 - 6 units • Number of control actions: or the planning horizon T = 400

heading: Cart-pole Balancing
text: • Input: Two 80× 80 images. 15000 training samples of the form (xt, ut, xt+1) • Actions space: 1-dimensional • Latent space: 8-dimensional • Encoder: 6 Layers: Convolutional layer: 32 × 5 × 5; stride (1, 1) - Convolutional layer:
32 × 5 × 5; stride (2, 2) - Convolutional layer: 32 × 5 × 5; stride (2, 2) - Convolutional layer: 10× 5× 5; stride (2, 2) - 200 units - 16 units (8 for mean and 8 for variance) • Decoder: 6 Layers: 200 units - 1000 units - 100 units - Convolutional layer: 32 × 5 × 5;
stride (1, 1) - Upsampling (2, 2) - convolutional layer: 32×5×5; stride (1, 1) - Upsampling (2, 2) - Convolutional layer: 32× 5× 5; stride (1, 1) - Upsampling (2, 2) - Convolutional layer: 2× 5× 5; stride (1, 1)
• Dynamics: 3 Layers: 40 units - 40 units - 16 units • Backwards dynamics: Nz = 10, Nu = 10, Nx = 300 - Njoint = 300 - 16 units • Number of control actions: or the planning horizon T = 200
3-link Manipulator — Swing Up & Balance
• Input: Two 80× 80 images. 30000 training samples of the form (xt, ut, xt+1) • Actions space: 3-dimensional • Latent space: 8-dimensional • Encoder: 6 Layers: Convolutional layer: 62 × 5 × 5; stride (1, 1) - Convolutional layer:
32 × 5 × 5; stride (2, 2) - Convolutional layer: 32 × 5 × 5; stride (2, 2) - Convolutional layer: 10× 5× 5; stride (2, 2) - 500 units - 16 units (8 for mean and 8 for variance) • Decoder: 6 Layers: 500 units - 2560 units - 100 units - Convolutional layer: 32 × 5 × 5;
stride (1, 1) - Upsampling (2, 2) - convolutional layer: 32×5×5; stride (1, 1) - Upsampling (2, 2) - Convolutional layer: 32× 5× 5; stride (1, 1) - Upsampling (2, 2) - Convolutional layer: 2× 5× 5; stride (1, 1) • Dynamics: 3 Layers: 40 units - 40 units - 16 units • Backwards dynamics: Nz = 10, Nu = 10, Nx = 400 - Njoint = 400 - 16 units • Number of control actions: or the planning horizon T = 400

heading: TORCS
text: • Input: Two 80× 80 images. 30000 training samples of the form (xt, ut, xt+1) • Actions space: 1-dimensional • Latent space: 8-dimensional • Encoder: 6 Layers: Convolutional layer: 32 × 5 × 5; stride (1, 1) - Convolutional layer:
32 × 5 × 5; stride (2, 2) - Convolutional layer: 32 × 5 × 5; stride (2, 2) - Convolutional layer: 10× 5× 5; stride (2, 2) - 200 units - 16 units (8 for mean and 8 for variance) • Decoder: 6 Layers: 200 units - 1000 units - 100 units - Convolutional layer: 32 × 5 × 5;
stride (1, 1) - Upsampling (2, 2) - convolutional layer: 32×5×5; stride (1, 1) - Upsampling (2, 2) - Convolutional layer: 32× 5× 5; stride (1, 1) - Upsampling (2, 2) - Convolutional layer: 2× 5× 5; stride (1, 1) • Dynamics: 3 Layers: 40 units - 40 units - 16 units • Backwards dynamics: Nz = 10, Nu = 10, Nx = 300 - Njoint = 300 - 16 units • Number of control actions: or the planning horizon T = 200

heading: E ADDITIONAL RESULTS

heading: E.1 PERFORMANCE ON NOISY DYNAMICS
text: Table 3 shows results for the noisy cases.

heading: E.2 LATENT SPACE REPRESENTATION FOR THE PLANAR SYSTEM
text: The following figures depicts 5 instances (randomly chosen from the 10 trained models) of the learned latent space representations for both the noiseless and the noisy planar system from PCC, RCE, and E2C models.

Review summaries:
This paper considers learning low-dimensional representations from high-dimensional observations for control purposes. The authors extend the E2C framework by introducing the new PCC-Loss function. This new loss function aims to reflect the prediction in the observation space, the consistency between latent and observation dynamics, and the low curvature in the latent dynamics. The low curvature term is used to bias the latent dynamics towards models that can be better approximated as locally linear models. The authors provide theory (error bounds) to justify their proposed PCC-Loss function. Then variational PCC is developed to make the algorithm tractable. The proposed method is evaluated in 5 different simulated tasks and compared with the original E2C method and the RCE method. 

This work proposes a regularization strategy for learning optimal policy for a dynamic control problem in a latent low-dimensional domain. The work is based on LCE approach, but with in-depth analysis on how to choose/design the regularization for the \hat{P} operator, which consists of an encoder, a decoder, and dynamics in the latent space. In particular, the author argued that three principles (prediction, consistency, and curvature) should be taken into consideration when designing the regularizer of the learning cost function - so that the learned latent domain can serve better for the purpose of optimizing the long-term cost in the ambient domain.