Abstract
Dataefficiency is crucial for autonomous robots to adapt to new tasks andenvironments. In this work we focus on robotics problems with a budget of only1020 trials. This is a very challenging setting even for dataefficientapproaches like Bayesian optimization (BO), especially when optimizinghigherdimensional controllers. Simulated trajectories can be used to constructinformed kernels for BO. However, previous work employed supervised ways ofextracting lowdimensional features for these. We propose a model andarchitecture for a sequential variational autoencoder that embeds the space ofsimulated trajectories into a lowerdimensional space of latent paths in anunsupervised way. We further compress the search space for BO by reducingexploration in parts of the state space that are undesirable, without requiringexplicit constraints on controller parameters. We validate our approach withhardware experiments on a Daisy hexapod robot and an ABB Yumi manipulator. Wealso present simulation experiments with further comparisons to severalbaselines on Daisy and two manipulators. Our experiments indicate the proposedtrajectorybased kernel with dynamic compression can offer ultra dataefficientoptimization.
Quick Read (beta)
Bayesian Optimization in Variational Latent Spaces with Dynamic Compression
Abstract
Dataefficiency is crucial for autonomous robots to adapt to new tasks and environments. In this work we focus on robotics problems with a budget of only 1020 trials. This is a very challenging setting even for dataefficient approaches like Bayesian optimization (BO), especially when optimizing higherdimensional controllers. Simulated trajectories can be used to construct informed kernels for BO. However, previous work employed supervised ways of extracting lowdimensional features for these. We propose a model and architecture for a sequential variational autoencoder that embeds the space of simulated trajectories into a lowerdimensional space of latent paths in an unsupervised way. We further compress the search space for BO by reducing exploration in parts of the state space that are undesirable, without requiring explicit constraints on controller parameters. We validate our approach with hardware experiments on a Daisy hexapod robot and an ABB Yumi manipulator. We also present simulation experiments with further comparisons to several baselines on Daisy and two manipulators. Our experiments indicate the proposed trajectorybased kernel with dynamic compression can offer ultra dataefficient optimization.
Bayesian Optimization in Variational Latent Spaces with Dynamic Compression
Rika Antonova^{†}^{†}thanks: Both of these authors contributed equally. $$ 

KTH Royal Institute of Technology, Sweden 
[email protected] 
Akshara Rai^{1}^{1}footnotemark: 1 $$ 

Facebook AI Research $$ 
[email protected] $$ 
$$ Tianyu Li 
$$ Facebook AI Research 
Danica Kragic 
KTH Royal Institute of Technology, Sweden 
noticebox[b]\[email protected]
Keywords: Bayesian Optimization, Dataefficient Reinforcement Learning, Variational Inference
1 Introduction
Reinforcement learning (RL) is becoming popular in robotics, since in some cases it can deal with realworld challenges, such as noise in control and measurements, nonconvexity and discontinuities in objectives. However, most flexible RL methods require thousands to millions of data samples, which can make direct application to realworld robotics infeasible. For example, 10,000 30s trials/episodes on a real robot would require $\approx $100 hours of operation. Most fullscale platforms, especially in locomotion, cannot operate this long without maintenance. Nowadays, commercially available arms can operate for longer, however sophisticated anthropomorphic hands and advanced grippers are still highly prone to breakage after even a handful of trials [1]. Hence the need for algorithms that can learn in very few trials, without causing significant wearand tear to the hardware.
In this work we focus on cases with a budget of only 1020 trials. In such settings, using approaches like Bayesian optimization (BO) to adjust parameters of structured controllers can help improve data efficiency. However, success of BO on hardware has been demonstrated either with lowdimensional controllers or with simulationbased kernels that required handdesigned features. We propose learning simulationbased kernels in unsupervised way with a sequential variational autoencoder (SVAE). Our approach embeds simulated trajectories $\bm{\xi}$ to a space of latent paths $\bm{\tau}$, and jointly learns a probability distribution $p(\bm{\tau}\bm{x})$ that controllers with parameters $\bm{x}$ induce over the space of latent paths. Our work is inspired by initial success of trajectorybased BO kernels [2], however that was demonstrated for BO in low dimensions (24D). Our results show that performance of a kernel based on raw trajectories deteriorates quickly for higherdimensional problems. In contrast, a kernel based on latent paths can still offer gains even for 48dimensional controllers.
Global optimization in latent space can still suffer from sampling unsuccessful controllers, especially in the absence of dense rewards. One solution can be adding domainspecific constraints to point optimization in the right direction. While these can be hard to define in controller parameter space, frequently they can be easily expressed in observation/state space. For example, high velocities might be undesirable if they result in hard impacts. However, formulating this as constrained optimization could result in overly conservative controllers. Instead, we incorporate controller desirability into BO by reducing exploration in the part of the trajectory space that leads to undesirable behavior. We compress the search space during BO dynamically by scaling the distance between controllers based on their desirability, initially inferred from simulation. BO can then quickly reject the undesirable parts of the search space, allowing for more exploration in the desirable parts. Figure 1 gives an overview of the proposed approach.
We test our approach (SVAEDC: informed kernel with Dynamic Compression) on a Daisy hexapod and an ABB Yumi manipulator on hardware^{1}^{1} 1 Video demonstrating hardware experiments: https://youtu.be/2SvdwGZNrvY. We also conduct further simulationbased analysis on Daisy and two manipulators. On Daisy, our method consistently learns to walk in less than 10 hardware trials, outperforming uninformed BO. We also demonstrate significant gains on a nonprehensile manipulation task on Yumi. All latent components of our kernel can be adjusted online (by optimizing marginal likelihood as is done for BO hyperparameters). We anticipate that such adjustment could be useful for future works for settings with a medium budget of trials ($\approx $100+). Our code builds on the recently released BoTorch library [3] that supports highly scalable BO on GPUs. We open source our code for simulation environments, training and BO^{2}^{2} 2 SVAEDC and BO code: https://github.com/contactrika/bosvaedc.
2 Background and Related Work
For learning with a small number of trials we turn to Bayesian Optimization (BO). BO can be thought of as a dataefficient RL method that obtains a reward only at the end of each trial/episode. For higherdimensional robotics problems BO can benefit significantly from using simulationbased kernels. However, previous work required defining domainspecific features to be extracted from largescale simulation data (see Section 2.1). Variational Autoencoders (VAEs) [4] provide an unsupervised alternative for embedding highdimensional observations into a lowerdimensional space. For example, [5] recently used VAE in a Gaussian Process (GP) kernel to optimize chemical molecules. In robotics, VAEs have been used to process visual and tactile data (see [6] for a survey). We are interested in encoding trajectory data, so a sequential VAE (SVAE) could be applicable. [7, 8] show SVAEs learning latent dynamics. However, their physics simulations are lowdimensional (e.g. position of a 2D ball), sequences have length 2030 steps, and the focus is on visual reconstruction. We aim to develop SVAE architecture that can easily handle simulations from fullscale robotics systems (state spaces 27D+) and much longer sequences (lengths 5001000).
Our original motivation for embedding trajectory data into the kernel was Behavior Based Kernel (BBK) [2]. On lowdimensional problems it matched the performance of PILCO [9], which is a popular dataefficient modelbased RL algorithm for small domains. BBK is directly applicable only to stochastic policies, but we adapted it to our setting as BBKKL baseline. We randomize simulator parameters when collecting trajectories. Hence even though the simulator and controllers are deterministic, each controller still induces a probability distribution over the trajectories. As proposed for BBK, for kernel distances we used symmetrized KL between trajectory distributions induced by the controllers. The generation and reconstruction parts of SVAE were used to estimate this KL. Since this baseline uses a neural network in the kernel, there is some relation to methods like [10, 11] (though these focused on GP regression, and did not incorporate trajectories).
2.1 BO for Locomotion and Manipulation
Locomotion controllers most commonly used for real systems are structured and parametric [12, 13, 14]. BO has been used to optimize their parameters, e.g. [15, 16, 17]. Typically, these methods take $\approx $40 trials for lowdimensional controllers (35D). For highdimensional controllers further domain information is needed. For example [18] use simulation and userdefined features to transform the space of a 36dimensional controller into 6D, making the search for walking controllers of a hexapod much more dataefficient. [19] employ bipedal locomotion features to build informed kernels.
In manipulation, active learning and BO have been used, for example, for grasping [20, 21]. These works did not incorporate simulation into the kernel, so their performance would be similar to BO with uninformed/standard kernel. [22] showed advantages of a simulationbased kernel, but needed graspingspecific features. Somewhat related are works in simtoreal transfer, like [1], though many have visuomotor control as the focus (not considered here) and usually do not adapt online. [23] do adjust simulation parameters to match reality, so it would be interesting to combine this with BO in the future for global optimality (their work employs PPO, which is locally optimal). Due to uncertainty over friction and contact forces, simtoreal is challenging for nonprehensile problems. However, such motions can be useful to make solutions feasible (e.g pushing when the object is too large/heavy to lift or the goal is out of reach). [24, 25, 26] report success in transfer/adaptation on a pushtogoal task, showing the task is challenging but feasible. In our experiments we consider a ‘stable push’ task: push two tall objects across a table without tipping them over. The further challenges come from interaction between objects and inability to recover from them tipping over.
2.2 Challenges of Realworld Locomotion: the Need for Ultra Dataefficient Optimization
Learning for legged locomotion can be a daunting task, since a robot needs to perfectly balance its interaction forces with the ground to move forward. For a hexapod robot, this means coordinating the movements of six legs, as well as the forces being applied on each leg. While it is easy to find a walking gait, it is extremely difficult to find a gait that can move forward at a reasonable speed.
Recently, [27, 28] showed that RL can be used for locomotion on hardware. However, they learn conservative controllers in simulation and help transfer via system identification of actuator dynamics [27] and a userdesigned structured controller [28]. While these methods can help, they do not guarantee that a controller learned in simulation will perform well on hardware. [29] showed learning to walk on a Minitaur quadruped in only two hours. The Minitaur robot has 8 motors that control its longitudinal motion, and no actuation for lateral movements. In comparison, our hexapod (Daisy) has 18 motors, and has omnidirectional movements. This makes the problem of controlling Daisy especially challenging, and would require significantly longer training. However, most present day locomotion robots get damaged from wear and tear when operated for long. For example, in the course of our experiments, we had to replace two motors, and fix issues such as faulty wiring and broken parts multiple times. With these considerations, we develop a ultra dataefficient approach that can learn controllers on Daisy in less than 10 hardware trials.
3 SVAEDC: Learning Informed Trajectorybased Embeddings
We model our setting as a joint Variational Inference problem: learning to compress/reconstruct trajectories while at the same time learning to associate controllers with their corresponding probability distributions over the latent paths. For this we develop a version of sequential VAE (SVAE). The training is guided by ELBO (Evidence Lower Bound) derived for our setting directly from the modeling assumptions and doesn’t require any auxiliary objectives. First, we define notation:

${\pi}_{\bm{x}}$ : policy/controller with parameters $\bm{x},\bm{x}\in {\mathbb{R}}^{D}$; policies can be either deterministic or stochastic; for brevity we will refer to ${\pi}_{\bm{x}}$ simply as ‘controller $\bm{x}$’

$\bm{\xi}\equiv {\bm{\xi}}_{1:T}$ : original trajectory for $T$ time steps containing highfrequency sensor readings

$\bm{\tau}\equiv {\bm{\tau}}_{1:K}$ : latent space ‘path’ (embedding of a trajectory)

$p({\bm{\xi}}_{1:T}\bm{x})$ : a conditional probability distribution over the trajectories induced by controller $\bm{x}$; the relationship between the controller and trajectories could be probabilistic either because the controller is stochastic, or because the simulator environment is stochastic, or both

$p({\bm{\tau}}_{1:K}\bm{x})$ : a conditional probability distribution over latent space paths induced controller by $\bm{x}$

${G}_{bad}:S\to \{0,1\}$ a map denoting whether an observation ${\bm{\xi}}_{t}\in S$ is within an undesirable region

$y$ : fraction of time $\bm{\xi}$ spends in undesirable regions; $\psi $ captures analogous notion in latent space
Our goal is to learn $p(\bm{\tau},\psi \bm{x})$. $p(\bm{\tau}\bm{x})$ is analogous to $p(\bm{\xi}\bm{x})$, only the paths are encoded in a lowerdimensional latent space.
This is useful for constructing kernels for efficient BO on hardware.
As a measure of trajectory ‘quality’ we can keep track of how long each trajectory spends in undesirable regions ($y$). For the latent paths we learn the analogous notion ($\psi $). We will not impose hard constraints during optimization, so ${G}_{bad}$ used to compute $y$ can be specified roughly with approximate guesses. Our framework also supports ${G}_{bad}:S\to [0,1]$, but for users it is frequently easier to make a rough thresholded estimate rather than providing smooth estimates or probabilities. The graphical model we construct for this setting is shown in Figure 2. Not all independencies are captured by the illustration. So explicitly, the generative model is:
$p(\bm{\tau},\psi ,\bm{\xi},y\bm{x})=p({\bm{\tau}}_{1:K},\psi \bm{x})p(y\psi ){\prod}_{t=1}^{T}p({\bm{\xi}}_{t}{\bm{\xi}}_{t1},{\bm{\tau}}_{1:K})$.
Approximate posterior is modeled by: $q(\bm{\tau},\psi ,\bm{\xi},y)=q({\bm{\tau}}_{1:K},\psi {\bm{\xi}}_{1:T},y)$.
We collect trajectories ${\bm{\xi}}_{1:T}^{(i)}$ by simulating $N$ controllers with parameters ${\bm{x}}^{(i)}$ for $T$ time steps.
We derive ELBO for this setting to maximize $\mathrm{log}p(Data)=\mathrm{log}p({\{{\bm{x}}^{(i)},{\bm{\xi}}_{1:T}^{(i)}\}}_{i=1\mathrm{\dots}N})$. Using ‘$\stackrel{~}{}$’ over the variables to indicate samples from the current variational approximation, we get:
$\begin{array}{c}\hfill {\mathcal{L}}^{DC}(\bm{w},\mathit{\varphi}\bm{x},\bm{\xi},y)={\mathbb{E}}_{\begin{array}{c}\stackrel{~}{\bm{\tau}},\stackrel{~}{\psi}\sim \\ q(\bm{\tau},\psi \bm{\xi},y)\end{array}}\left[\mathrm{log}p(\bm{\xi}\stackrel{~}{\bm{\tau}})+\mathrm{log}p(y\stackrel{~}{\psi})+\mathrm{log}p(\stackrel{~}{\bm{\tau}},\stackrel{~}{\psi}\bm{x})\mathrm{log}q(\stackrel{~}{\bm{\tau}},\stackrel{~}{\psi}\bm{\xi},y)\right]\end{array}$  (1) 
Some aspects of this model resemble a setup from [30]; see derivation details in Appendix A.
4 Bayesian Optimization with Dynamic Compression
In Bayesian Optimization (BO), the problem of optimizing controllers is viewed as finding controller parameters ${\bm{x}}^{*}$ that optimize some objective function $f(\bm{x})$: $f({\bm{x}}^{*})={\mathrm{max}}_{\bm{x}}f(\bm{x})$. At each optimization trial BO optimizes an auxiliary function to select the next promising $\bm{x}$ to evaluate. $f$ is commonly modeled with a Gaussian process (GP): $f(\bm{x})\sim \mathcal{G}\mathcal{P}(m(\bm{x}),k({\bm{x}}_{i},{\bm{x}}_{j}))$.
The key object is the kernel function $k(\cdot ,\cdot )$, which encodes similarity between inputs. If $k({\bm{x}}_{i},{\bm{x}}_{j})$ is large for inputs ${\bm{x}}_{i},{\bm{x}}_{j}$, then $f({\bm{x}}_{i}$) strongly influences $f({\bm{x}}_{j})$. One of the most widely used kernel functions is the Squared Exponential (SE) kernel: ${k}_{SE}(\bm{r}\equiv {\bm{x}}_{i}{\bm{x}}_{j})={\sigma}_{k}^{2}\mathrm{exp}(\frac{1}{2}{\bm{r}}^{T}diag{(\mathbf{\ell})}^{2}\bm{r})$, where ${\sigma}_{k}^{2},\mathbf{\ell}$ are signal variance and a vector of length scales respectively. ${\sigma}_{k}^{2},\mathbf{\ell}$ are called ‘hyperparameters’ and are optimized automatically by maximizing marginal likelihood ([31], Section VA). SE belongs to a broader class of Matérn kernels. One common parameter choice yields Matérn${}_{5/2}$: ${k}_{{\text{Mat\xe9rn}}_{5/2}}(\bm{r})=\left(1+\frac{\sqrt{5}\bm{r}}{\mathbf{\ell}}+\frac{5{\bm{r}}^{2}}{3{\mathbf{\ell}}^{2}}\right)\mathrm{exp}\left(\frac{\sqrt{5}\bm{r}}{\mathbf{\ell}}\right)$. SE and Matérn kernels are stationary, since they depend on $\bm{r}\equiv {\bm{x}}_{i}{\bm{x}}_{j}\forall {\bm{x}}_{i,j}$, and not on individual ${\bm{x}}_{i},{\bm{x}}_{j}$. Section 2.1 discussed recent work that showed how to effectively remove nonstationarity by using informed feature transforms for kernel computations. But these required extracting domainspecific features manually, or learning to fit a predefined set of features using a deterministic NN in a supervised way.
We propose to use $p(\bm{\tau},\psi \bm{x})$ learned by SVAEDC. [2] showed that a ‘symmetrization’ of KL divergence can be used to define a KLbased kernel for trajectories in the original space:
$${k}_{KL}=\mathrm{exp}(\text{}\alpha D({\bm{x}}_{i},{\bm{x}}_{j}));D({\bm{x}}_{i},{\bm{x}}_{j})=\sqrt{KL(p(\bm{\xi}{\bm{x}}_{i})p(\bm{\xi}{\bm{x}}_{j}))}+\sqrt{KL(p(\bm{\xi}{\bm{x}}_{j})p(\bm{\xi}{\bm{x}}_{i}))}$$  (2) 
We could use this to define an analogous kernel in the latent space:
${k}_{LKL}=\mathrm{exp}(\text{}\alpha {D}_{\tau}({\bm{x}}_{i},{\bm{x}}_{j}));{D}_{\tau}({\bm{x}}_{i},{\bm{x}}_{j})=\sqrt{KL(p(\bm{\tau}{\bm{x}}_{i})p(\bm{\tau}{\bm{x}}_{j}))}+\sqrt{KL(p(\bm{\tau}{\bm{x}}_{j})p(\bm{\tau}{\bm{x}}_{i}))}$ 
In theory, this would be a natural way to define a pathbased kernel in the latent space. However, it is widely known that Variational Inference tends to underestimate variances in theory [32, 33] and in practice [34, 35]. This underestimation could negatively impact the practical performance of such kernel. Since we indeed observed variance underestimation we implemented a version of the kernel to work with the latent means ${\overline{\bm{\tau}}}_{\bm{x}},{\overline{\psi}}_{\bm{x}}=E\left[p(\bm{\tau},\psi \bm{x})\right]$ directly. We define our kernel function with:
${\bm{r}}_{\tau}={D}_{\tau}({\bm{x}}_{i},{\bm{x}}_{j})=(1{\overline{y}}_{{\bm{x}}_{i}}){\overline{\bm{\tau}}}_{{\bm{x}}_{i}}(1{\overline{y}}_{{\bm{x}}_{j}}){\overline{\bm{\tau}}}_{{\bm{x}}_{j}}\mathit{\hspace{1em}};{y}_{\bm{x}}\sim p(y{\overline{\psi}}_{\bm{x}})$  (3) 
${k}_{SVAE\text{}DC}({\bm{x}}_{i},{\bm{x}}_{j})={\sigma}_{k}^{2}\mathrm{exp}(\frac{1}{2}{\bm{r}}_{\tau}^{T}diag{(\mathbf{\ell})}^{2}{\bm{r}}_{\tau})$  (4) 
This formulation is convenient in practice, since the form of Equation 4 allows us to apply existing machinery for optimizing kernel hyperparameters ${\sigma}_{k}^{2},\mathbf{\ell}$. We can also define SVAEDCMatérn version of the kernel by changing the form of Equation 4 to the Matérn function. Scaling latent representations by $1{\overline{y}}_{\bm{x}}$ yields dynamic compression: latent representations that correspond to controllers frequently visiting undesirable parts of the space are scaled down. Hence ‘bad’ controllers are brought closer together. This allows BO to reduce the number of samples from the ‘bad’ parts of the space. ‘Dynamic compression’ here means this search space transformation is applied after SVAE training, in addition to the compression obtained by SVAE’s dimensionality reduction. The scaling can be made nonlinear with $sigmoid(\alpha ({\overline{y}}_{\bm{x}}c))$. This can help achieving aggressive compression in settings like ours with an extremely small budget of trials. The additional parameters $\alpha ,c$, as well as $p(\bm{\tau},\psi \bm{x}),p(y\psi )$ can be optimized online in the same way as BO hyperparameters.
Overall, SVAEDC and the resulting kernel described above allow us to obtain a fully automatic way of learning latent trajectory embeddings in unsupervised way. For domains where ${G}_{bad}$ is given we can also achieve dynamic compression of the latent space, making BO ultra dataefficient. All the components used during BO can be optimized online via the same methods already implemented for automatically adjusting BO hyperparameters.
5 SVAEDC: NN Architectures and Training
Guided by prior literature we experimented with RNNs, LSTMs, and sequencetosequence RNNs. Learning was slow and frequently unsuccessful, despite trying adaptive learning rates, manual tuning, weighting various parts of ELBO. Using MLPs instead did not improve performance either. [36] notes that CNNs can succeed on sequence data, but one recent alternative (QuasiRNNs [37]) did not yield a notable improvement for us. Instead, an effective idea we had was to view dimensions of ${\bm{\xi}}_{t},{\bm{\tau}}_{k}$ as different channels. Then we could feed ${\bm{\xi}}_{1:T}$ to 1D convolutional layers to learn $q(\bm{\tau}\bm{\xi})$, deconvolutional for $p(\bm{\xi}\bm{\tau})$. With that, for all our experiments (all different robot and controller architectures) we were able to use the same network parameters: 3layer 1D convolutions with [32, 64, 128] channels (reverse order for deconvolutions; kernel size 4, stride 2) followed by MLP layer for $\mu ,\sigma $ outputs. We were also able to use same latent space sizes: 3dimensional $\bm{\tau}$, latent sequence length $K\text{=}3$. This yielded a small 9D optimization space for BO, which is highly desirable for optimization with few trials. Notably, this NN architecture also retained good reconstruction accuracy, not far from results with larger latent spaces ($\bm{\tau}\text{=}6D,12D;K\text{=}5,15$) and hidden sizes (2561024). We also interpreted $\bm{x}$ as a sequence of length 1 and used deconvolutional architecture for $p(\bm{\tau}\bm{x})$. It had 4layers with [512, 256, 128, 128] channels, since $p(\bm{\tau}\bm{x})$ was one of the key parts for BO (though a smaller CNN or MLP could have sufficed). For $p(y\psi )$ we used a 2layer MLP (hidden size 64). Training took $\approx $30180 minutes on 1 GPU, using $1e\text{}4$ learning rate (halving after each 5K gradient updates, stopping at $1e\text{}5$). See Appendix B for reconstruction/generation visualizations.
6 Locomotion on the Daisy Hexapod
For our locomotion experiments we used Daisy robot (Figure 3) from Hebi robotics [38]. It has six legs, each with 3 motors – base, shoulder and elbow. The robot is practically omnidirectional, however, the motors are velocity limited, so the robot is unable to achieve very high velocities. Vive tracking system was used to measure robot’s position in the global frame for rewards.
In general, locomotion is a hard learning problem, but complex high degreeoffreedom robots further complicate it. While in simulation all 6 legs of Daisy are identical, each motor has a slightly different behavior on hardware. This also depends on the environment, and makes it extremely hard to predict the robot’s behavior from simulation. For example, one of our successful straightwalking controllers from simulation, turns left when executed on a carpet floor, but turns right on a wooden floor. This raises the need for learning approaches that can transfer information from simulation to hardware, without suffering too much from the mismatch between the two. We simulated the Daisy robot in PyBullet [39]. The simulator was fast, but did not have an accurate contact model with the ground. While freespace motion of individual joints transferred to hardware, the overall behavior of the robot when interacting with the ground was very different between simulation and hardware. As a result, rewards obtained by controllers in simulation could be significantly different on hardware.
Daisy Controllers: We used Central Pattern Generators (CPGs) from [40]. These are capable of generating a large number of locomotion gaits by changing the frequency, amplitude, and offset of each joint, as well as the relative phase differences between joints. Different CPG parameters can be restricted to obtain controllers with various dimensionalities. We experimented with 11D controller on hardware and 27D in simulation. For hardware, we assume that all joints have the same amplitude, frequency and offset (3 parameters), all base motors have independent phases (6 parameters), all shoulders and elbows have the same phase difference w.r.t. the base (2 parameters). This assumption implies that all joints are treated identically, which doesn’t always hold, since each motor has slightly different tracking and bandwidth. In the future, we would like to use alternatives that allow each motor to learn independently. For simulation: base, shoulder and elbow joints were allowed to have independent amplitudes, frequencies and offsets, but fixed across the six legs (9 parameters); each of the 18 joints was allowed to have an independent phase (18 parameters).
6.1 Daisy Experiments
For SVAEDC training we sampled $500,000$ controllers randomly in simulation and collected the corresponding trajectories for $1000$ time steps ($\approx 16.5s$). For dynamic compression the states were marked as undesirable if they had: high joint velocities (more than 10rad/sec); robot base tilting by more than 60°in roll and pitch, elbows hitting the ground; height of the base outside of [0.1, 0.7]cm from the ground. These aimed to reduce the chance of robot breaking: controllers with high joint velocities can harm the motors on impact with the ground; tilting the torso can cause the robot to fall on its back; scraping the ground or lifting off and then falling can cause further damage. Since our BO trials were in a narrow walkway, we also marked as undesirable states deviating more than $0.5$m from the starting $x$coordinate of the base. The objective function for BO was: $f(\bm{x})=10{y}_{final}{N}_{high\mathrm{\_}vel}$, where ${y}_{final}$ was the final $y$coordinate of the robot (how much the robot walked forward), ${N}_{high\mathrm{\_}vel}$ was the number of timesteps with velocities exceeding 10rad/sec. All BO experiments used UCB acquisition function (with $\beta =1$).
We completed 5 runs of BO on the Daisy robot hardware, initializing with 2 random samples, followed by 10 trials of BO (Figure 4). BO with SE kernel used the same initialization as BO with SVAEDC kernel. For Daisy robot on hardware the controller would be considered acceptable if it walked forward for more than $1.5m$ during a trial of 25 seconds. For comparison to random search we sampled 60 controllers at random. Of these only 2 were able to walk forward a distance of over $1.5m$ in $25s$. So the problem was challenging, as the chance of randomly sampling a successful controller was $$%. BO with SVAEDC kernel found walking controllers reliably in all 5/5 runs within fewer than 10 trials. In contrast, both BO with SE found forward walking controllers only in 2/5 runs.
For simulation experiments, we created an artificial ‘simtoreal’ gap, allowing to gauge the potential for simulationbased kernels without running all the experiments on hardware. For each BO run we randomly sampled ground restitution parameters, and kept them fixed for all trials within a run. Hence simulationbased kernels did not have full information about the exact properties of the environment used during BO (even though the range of parameters was the same as for data collection). Kernels were informed about performance on a range of parameters, but could have caused negative transfer by lagging to identify controllers that perform best in a particular setting (not only well on average across settings).
Figure 5 shows BO with 27D controller. BO with SVAEDC outperformed all baselines. BBKKL kernel obtained smaller improvements over SE and Random baselines. This indicated that a trajectorybased kernel was useful even when optimizing a highdimensional controller, although BBKKL benefits were greatly diminished compared to BBK results for 24 dimensional controllers reported in prior work. In these experiments, SVAE without dynamic compression was very similar to SE (omitted from the plot for clarity, since it was overlapping with SE). This showed that dimensionality reduction alone does not guarantee improvement (even when the latent space contains information needed to decode back into the space of original trajectories).
7 Manipulation Experiments
Our manipulation task was to push two objects from one side of the table to another without tipping them over. For Yumi environment the objects had mass and inertial properties similar to paper towel rolls (mass of 150g, 22cm height, 5cm radius); for Franka these had properties similar to wooden rolls (2kg, 22cm height, 8cm radius). Compared to ‘pushtotarget’ task, our task had two different challenges. The objects were likely to come into contact with each other (not only the robot arm). Moreover, they could easily tip over, especially if forces were applied above an object’s center of mass. Reward was given only at the end of the task: the distance each upright object moved in the desired direction minus a penalty for objects that tipped over (with ${y}_{max}$ being table width): $f(\bm{x})={\sum}_{i}\left[({y}_{final}^{ob{j}_{i}}{y}_{start}^{ob{j}_{i}}){\mathrm{\U0001d7d9}}_{ob{j}_{i}\in Up}{y}_{max}{\mathrm{\U0001d7d9}}_{ob{j}_{i}\in Tipped}\right]$.
Controllers: We tested our approach on two types of controllers: 1) joint velocity controller suitable for robots like ABB Yumi and 2) torque controller suitable for robots like Franka Emika. The first was parameterized by 6 joint velocity “waypoints”, one target velocity for each joint of the robot arm (so $6\cdot 7=42$ parameters for a 7DoF arm). Each “waypoint” also had a duration parameter that specified the fraction of time to be spent attaining the desired joint velocities. Overall this yielded a 48dimensional parametric controller. The second controller type was aimed to be safe to use on robots with torque control that are more powerful than ABB Yumi. Instead of exploring randomly in torque space, we designed a parametric controller with desired waypoints in endeffector space. Each of the 6 waypoints had 6 parameters for the pose (3D position, 3D orientation) and 2 parameters for controller proportional and derivative gains. Overall this yielded a 48dimensional parametric controller: $6\cdot (6+2)$. This controller interpolated between the waypoints using a ${5}^{th}$ order minimum jerk trajectory for positions, and used linear interpolation for orientations. End effector Jacobian for the corresponding robot model was used to convert to joint torques.
7.1 Experimental Setup and Results
For training SVAEDC we collected 500,000 simulated trajectories for both Yumi and Franka robot. These contained joint angles of the robot and object poses at each time step (1000 steps for Yumi and 500 steps for Franka, simulated with pybullet at 500Hz). A step on the trajectory was marked as undesirable $\left({G}_{bad}({\bm{\xi}}_{t})=1\right)$ when: any object tipped over or was pushed beyond the table; robot collided with the table or the end effector was outside of main workspace (not over the table area). Mass, friction and restitution of the objects were randomized at the start of each episode/trajectory. Randomization ranges were set to roughly resemble variability of how realworld objects behaved.
ABB Yumi robot available to us could operate effectively only at low velocities ($\frac{1}{5}$ of simulation maximum). Highvelocity trajectories successful in simulation yielded different results on hardware. To prevent Yumi from shutting down due to high load we stopped execution if the robot’s arm extended too far outside the main workspace, also stopped if it was about to collide with the table (giving $2{y}_{max}$ reward in such cases). These factors caused a large simreal gap. Nonetheless,
BO with SVAEDC kernel was still able to significantly outperform BO with SE (Figure 7). Even when controllers successful in simulation yielded very different outcomes on hardware, SVAEDC kernel was still able to find wellperforming alternatives (more conservative, yet successful on hardware).
For simulation experiments with manipulators we emulated ‘simtoreal’ gap as with Daisy simulation: sampled different object properties (mass, friction, restitution) at the start of each BO run. Results in Figure 8 show that BO on Yumi with SVAEDC kernel yielded substantial improvement over all baselines. BO in the latent space of SVAE (without dynamic compression) was also able to substantially outperform all baselines, matching SVAEDC gains after $\approx $15 trials.
Figure 9 shows BO results on Franka Emika simulation (left).
Furthermore, we analyze how increasing the size of SVAE latent space and NNs impacts performance (middle). The larger latent space is $6\cdot 5=30$D (vs 9D in other experiments), the hidden layer size of NNs is increased from 128 to 256. Larger latent space implies larger search space for BO, which could impair data efficiency. Indeed, we see what BO with SVAE kernel outperforms BBKKL and SE kernels not as early as before. However, BO with SVAEDC is able to keep the gains and even decrease the variance between runs (wellperforming points are found more reliably). This indicates that dynamic compression could counterbalance increase in kernel dimensionality. Finally, we experimented with Matérn kernel (right plot in Figure 9), but it did not show benefits over using SE kernel. We attempted changing hyperparameter prior and restricting hyperparameter ranges, but it did not consistently outperform random search (same held for SE in high dimensions). The performance of BO with SVAE kernel using Matérn as outer kernel function showed modest improvement over baselines. In contrast, BO with SVAEDC kernel kept most improvements.
8 Conclusion
In this work employed BO to optimize robot controllers with a small budget of trials. Previously, the success of BO has been either limited to lowdimensional controllers or required simulationbased kernels with domainspecific features. We proposed an unsupervised alternative with sequential variational autoencoder. We used it to embed simulated trajectories into a latent space, and to jointly learn relating controllers with latent space paths they induce. Furthermore, we provided a mechanism for dynamic compression, helping BO reject undesirable regions quickly, and explore more in other regions. Our approach yielded ultradata efficient BO in hardware experiments with hexapod locomotion and a manipulation task, using the same SVAEDC architecture, training and BO parameters.
Acknowledgments
This research was supported in part by the Knut and Alice Wallenberg Foundation.
References
 OpenAI [2018] OpenAI. Learning dexterous inhand manipulation. arXiv:1808.00177, 2018.
 Wilson et al. [2014] A. Wilson, A. Fern, and P. Tadepalli. Using Trajectory Data to Improve Bayesian Optimization for Reinforcement Learning. Journal of Machine Learning Research, 15(1):253–282, 2014.
 [3] Max Balandat, Brian Karrer, Daniel Jiang, Ben Letham, Sam Daulton, Andrew Wilson, Eytan Bakshy. BoTorch. https://botorch.org/. Accessed: 201905.
 Kingma and Welling [2013] D. P. Kingma and M. Welling. Autoencoding variational bayes. arXiv:1312.6114, 2013.
 GómezBombarelli et al. [2018] R. GómezBombarelli, J. N. Wei, D. Duvenaud, J. M. HernándezLobato, B. SánchezLengeling, D. Sheberla, J. AguileraIparraguirre, T. D. Hirzel, R. P. Adams, and A. AspuruGuzik. Automatic chemical design using a datadriven continuous representation of molecules. ACS central science, 4(2):268–276, 2018.
 Lesort et al. [2018] T. Lesort, N. DíazRodríguez, J.F. Goudou, and D. Filliat. State representation learning for control: An overview. Neural Networks, 2018.
 Yingzhen and Mandt [2018] L. Yingzhen and S. Mandt. Disentangled sequential autoencoder. In International Conference on Machine Learning, pages 5656–5665, 2018.
 Fraccaro et al. [2017] M. Fraccaro, S. Kamronn, U. Paquet, and O. Winther. A disentangled recognition and nonlinear dynamics model for unsupervised learning. In Advances in Neural Information Processing Systems, pages 3601–3610, 2017.
 Deisenroth and Rasmussen [2011] M. Deisenroth and C. E. Rasmussen. Pilco: A modelbased and dataefficient approach to policy search. In Proceedings of the 28th International Conference on machine learning (ICML11), pages 465–472, 2011.
 Calandra et al. [2016] R. Calandra, J. Peters, C. E. Rasmussen, and M. P. Deisenroth. Manifold gaussian processes for regression. In 2016 International Joint Conference on Neural Networks (IJCNN), pages 3338–3345. IEEE, 2016.
 Wilson et al. [2016] A. G. Wilson, Z. Hu, R. Salakhutdinov, and E. P. Xing. Deep kernel learning. In Artificial Intelligence and Statistics, pages 370–378, 2016.
 Thatte et al. [2018] N. Thatte, H. Duan, and H. Geyer. A method for online optimization of lower limb assistive devices with high dimensional parameter spaces. In 2018 IEEE International Conference on Robotics and Automation (ICRA), pages 1–6. IEEE, 2018.
 Feng et al. [2015] S. Feng, E. Whitman, X. Xinjilefu, and C. G. Atkeson. Optimizationbased Full Body Control for the DARPA Robotics Challenge. Journal of Field Robotics, 32(2):293–312, 2015.
 Gong et al. [2018] Y. Gong, R. Hartley, X. Da, A. Hereid, O. Harib, J.K. Huang, and J. Grizzle. Feedback control of a cassie bipedal robot: Walking, standing, and riding a segway. arXiv:1809.07279, 2018.
 Calandra [2017] R. Calandra. Bayesian Modeling for Optimization and Control in Robotics. PhD thesis, Darmstadt University of Technology, Germany, 2017.
 Lizotte et al. [2007] D. J. Lizotte, T. Wang, M. H. Bowling, and D. Schuurmans. Automatic Gait Optimization with Gaussian Process Regression. In International Joint Conference on Artificial Intelligence (IJCAI), volume 7, pages 944–949, 2007.
 Tesch et al. [2011] M. Tesch, J. Schneider, and H. Choset. Using response surfaces and expected improvement to optimize snake robot gait parameters. In IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), pages 1069–1074. IEEE, 2011.
 Cully et al. [2015] A. Cully, J. Clune, D. Tarapore, and J.B. Mouret. Robots that can adapt like animals. Nature, 521(7553):503–507, 2015.
 Rai et al. [2019] A. Rai, R. Antonova, F. Meier, and C. G. Atkeson. Using simulation to improve sampleefficiency of bayesian optimization for bipedal robots. Journal of machine learning research, 20(49):1–24, 2019.
 Kroemer et al. [2010] O. Kroemer, R. Detry, J. Piater, and J. Peters. Combining active learning and reactive control for robot grasping. Robotics and Autonomous systems, 58(9):1105–1116, 2010.
 Montesano and Lopes [2012] L. Montesano and M. Lopes. Active learning of visual descriptors for grasping using nonparametric smoothed beta distributions. Robotics and Autonomous Systems, 60(3):452–462, 2012.
 Antonova et al. [2018] R. Antonova, M. Kokic, J. A. Stork, and D. Kragic. Global search with bernoulli alternation kernel for taskoriented grasping informed by simulation. In Conference on Robot Learning, pages 641–650, 2018.
 Chebotar et al. [2018] Y. Chebotar, A. Handa, V. Makoviychuk, M. Macklin, J. Issac, N. Ratliff, and D. Fox. Closing the simtoreal loop: Adapting simulation randomization with real world experience. arXiv:1810.05687, 2018.
 Peng et al. [2018] X. B. Peng, M. Andrychowicz, W. Zaremba, and P. Abbeel. Simtoreal transfer of robotic control with dynamics randomization. In 2018 IEEE International Conference on Robotics and Automation (ICRA), pages 1–8. IEEE, 2018.
 He et al. [2018] Z. He, R. Julian, E. Heiden, H. Zhang, S. Schaal, J. Lim, G. Sukhatme, and K. Hausman. Zeroshot skill composition and simulationtoreal transfer by learning task representations. arXiv:1810.02422, 2018.
 Arnekvist et al. [2019] I. Arnekvist, D. Kragic, and J. A. Stork. VPE: Variational Policy Embedding for Transfer Reinforcement Learning. In 2019 IEEE International Conference on Robotics and Automation (ICRA). IEEE, 2019.
 Tan et al. [2018] J. Tan, T. Zhang, E. Coumans, A. Iscen, Y. Bai, D. Hafner, S. Bohez, and V. Vanhoucke. Simtoreal: Learning agile locomotion for quadruped robots. arXiv:1804.10332, 2018.
 Li et al. [2018] T. Li, A. Rai, H. Geyer, and C. G. Atkeson. Using deep reinforcement learning to learn highlevel policies on the atrias biped. arXiv:1809.10811, 2018.
 Haarnoja et al. [2019] T. Haarnoja, S. Ha, A. Zhou, J. Tan, G. Tucker, and S. Levine. Learning to walk via deep reinforcement learning. In Robotics: Science and Systems (RRS), 2019.
 Louizos et al. [2016] C. Louizos, K. Swersky, Y. Li, M. Welling, and R. Zemel. The variational fair autoencoder. International Conference on Learning Representations, 2016.
 Shahriari et al. [2016] B. Shahriari, K. Swersky, Z. Wang, R. P. Adams, and N. de Freitas. Taking the Human Out of the Loop: A Review of Bayesian Optimization. Proceedings of the IEEE, 104(1):148–175, 2016.
 Minka [2005] T. Minka. Divergence measures and message passing. Technical report, Microsoft Research, 2005.
 Bishop [2006] C. M. Bishop. Pattern recognition and machine learning. springer, 2006.
 Riquelme et al. [2018] C. Riquelme, M. Johnson, and M. Hoffman. Failure modes of variational inference for decision making. Prediction and Generative Modeling in RL Workshop (AAMAS, ICML, IJCAI), 2018.
 Tschiatschek et al. [2018] S. Tschiatschek, K. Arulkumaran, J. Stühmer, and K. Hofmann. Variational inference for dataefficient model learning in pomdps. arXiv:1805.09281, 2018.
 Bai et al. [2018] S. Bai, J. Z. Kolter, and V. Koltun. An empirical evaluation of generic convolutional and recurrent networks for sequence modeling. arXiv:1803.01271, 2018.
 Bradbury et al. [2017] J. Bradbury, S. Merity, C. Xiong, and R. Socher. Quasirecurrent neural networks. International Conference on Learning Representations, 2017.
 [38] Hebi Robotics. http://docs.hebi.us. Accessed: 201906.
 [39] Pybullet simulator. https://github.com/bulletphysics/bullet3. Accessed: 201906.
 Crespi and Ijspeert [2008] A. Crespi and A. J. Ijspeert. Online optimization of swimming and crawling in an amphibious snake robot. IEEE Transactions on Robotics, 24(1):75–87, 2008.
 Kingma et al. [2014] D. P. Kingma, S. Mohamed, D. J. Rezende, and M. Welling. Semisupervised learning with deep generative models. In Advances in neural information processing systems, pages 3581–3589, 2014.
Appendix A: SVAEDC Modeling Details
The backbone of our model is inspired by hierarchical constructions, like those developed in [30, 41]. However, these works considered supervised and semisupervised settings, where a discrete label was associated with each highdimensional data point (e.g. a label for an image). We are dealing with sequential trajectory data instead, so the internal structure of our data is different. But for the moment let us think about each trajectory as a point in some highdimensional space. Our idea is to interpret controllers $\bm{x}$ as continuous ‘labels’ for trajectories $\bm{\xi}$. Then, on a high level, for random variables $\bm{x},\bm{\xi},\bm{\tau}$ we can extend the standard ELBO bound as follows:
$\mathcal{L}(\bm{w},\mathit{\varphi}\bm{\xi},\bm{x})$  $={\mathbb{E}}_{\stackrel{~}{\bm{\tau}}\sim {q}_{{\varphi}_{\tau}}(\bm{\tau}\bm{\xi})}\left[\mathrm{log}{p}_{{w}_{\xi}}(\bm{\xi}\stackrel{~}{\bm{\tau}})\mathrm{log}{q}_{{\varphi}_{\tau}}(\stackrel{~}{\bm{\tau}}\bm{\xi})+\mathrm{log}{p}_{{w}_{\tau}}(\stackrel{~}{\bm{\tau}}\bm{x})\right]$  (5) 
In the above, $\mathit{\varphi}=[{\mathit{\varphi}}_{\xi}]$ denote parameters of the variational approximation, $\bm{w}=[{\bm{w}}_{\tau},{\bm{w}}_{\xi}]$ denote the parameters of the generative part of the model. In our work, $\mathit{\varphi},\bm{w}$ are weights of deep neural networks. It is customary to drop subscripts indicating NN weight parameters and write $q,p$ for a shorthand notation.
The derivation for the above is similar to [30]. We can also recognize the similarity to a standard ELBO for a simplified model without $\bm{x}$:
$\mathcal{L}(q,p)$  $={\displaystyle \int q(\bm{\tau}\bm{\xi})\mathrm{log}\frac{p(\bm{\tau},\bm{\xi})}{q(\bm{\tau}\bm{\xi})}d\bm{\tau}}$  
$={\mathbb{E}}_{q(\bm{\tau}\bm{\xi})}\left[\mathrm{log}p(\bm{\xi}\bm{\tau})\right]KL(q(\bm{\tau}\bm{\xi})p(\bm{\tau}))$  
$={\mathbb{E}}_{q(\bm{\tau}\bm{\xi})}\left[\mathrm{log}p(\bm{\xi}\bm{\tau})q(\bm{\tau}\bm{\xi})+p(\bm{\tau})\right]$ 
In our case, $\bm{x}$ is observed (we know which controller is executed when we obtain a trajectory $\bm{\xi}$), so there is no further uncertainty about $\bm{x}$. Also, from the independencies in the model we see that the rest of the variables are independent of $\bm{x}$ given $\bm{\tau}$. Hence $p(\bm{\tau}\bm{x})$ conditioning is the only modification that appears in $\mathcal{L}(\bm{w},\mathit{\varphi}\bm{\xi},\bm{x})$. This is why terms like $p(\bm{x}),q(\bm{x}\bm{\tau})$ do not appear in our ELBO, but they would have been included if we also had a nontrivial prior $p(\bm{x})$. Our construction treats $\bm{x}$ and $\bm{\xi}$ as observed data, which is in fact what we have available from simulating trajectories. For data collection we can sample controllers at random, since we assume access to a relatively inexpensive simulator (in a sense that it is viable to simulate 100K+ trajectories for training). So we don’t need a sophisticated prior for $p(\bm{x})$.
To derive the full SVAEDC ELBO we can use the decomposition assumptions of the generative model and the approximate posterior:
Generative model:  $p(\bm{\tau},\psi ,\bm{\xi},y\bm{x})=p({\bm{\tau}}_{1:K},\psi \bm{x})p(y\psi ){\prod}_{t=1}^{T}p({\bm{\xi}}_{t}{\bm{\xi}}_{t1},{\bm{\tau}}_{1:K})$  
Approximate posterior:  $q(\bm{\tau},\psi ,\bm{\xi},y)=q({\bm{\tau}}_{1:K},\psi {\bm{\xi}}_{1:T},y)$ 
${\mathcal{L}}^{DC}(\bm{w},\mathit{\varphi}\bm{x},\bm{\xi},y)$  $={\mathbb{E}}_{\stackrel{~}{\bm{\tau}},\stackrel{~}{\psi}\sim q(\bm{\tau},\psi \bm{\xi},y)}\left[\mathrm{log}p(\bm{\xi},y\stackrel{~}{\bm{\tau}},\psi )\mathrm{log}q(\stackrel{~}{\bm{\tau}},\psi \bm{\xi},y)+\mathrm{log}p(\stackrel{~}{\bm{\tau}},\psi \bm{x})\right]$ 
${\mathcal{L}}^{DC}(\bm{w},\mathit{\varphi}\bm{x},\bm{\xi},y)$  $={\mathbb{E}}_{\begin{array}{c}\stackrel{~}{\bm{\tau}},\stackrel{~}{\psi}\sim \\ q(\bm{\tau},\psi \bm{\xi},y)\end{array}}\left[\mathrm{log}p(\bm{\xi}\stackrel{~}{\bm{\tau}})+\mathrm{log}p(y\stackrel{~}{\psi})+\mathrm{log}p(\stackrel{~}{\bm{\tau}},\stackrel{~}{\psi}\bm{x})\mathrm{log}q(\stackrel{~}{\bm{\tau}},\stackrel{~}{\psi}\bm{\xi},y)\right]$  (6) 
The 4 terms inside the expectation in Equation 6 above are the 4 neural networks whose parameters will be optimized by gradient ascent to maximize ${\mathcal{L}}^{DC}$. The choices for their architectures are described in the main paper. For ease of implementation we treat the outputs of $p(\bm{\tau},\psi \bm{x}),q(\bm{\tau},\psi \bm{\xi},y)$ as a single latent code $[\bm{\tau},\psi ]$, and separate it into components only when needed (e.g. to feed only the $\psi $ part into $p(y\psi )$ NN, etc.
One advantage of our formulation is that it is agnostic to whether policies/controllers are stochastic or deterministic, and to whether the simulators used to collect samples are stochastic or deterministic. This is especially convenient, since in robotics deterministic controllers are used widely, while the Reinforcement Learning community frequently considers stochastic policies and environments. With our model: the stochasticity of either environment or controllers (or both) will be encoded in $p(\bm{\tau}\bm{x})$. Even in the case of deterministic controllers and environment (deterministic relationship between $\bm{x}$ and $\bm{\xi}$) the model remains meaningful because of the bottleneck $\bm{\tau}$ and randomness coming from sampling of $\bm{x}$ during data collection.
One fair question would be: why learn an embedding into lowerdimensional space of path $\bm{\tau}$ jointly with learning $p(\bm{\tau}\bm{x})$, instead of decomposing the problem into separate dimensionality reduction and $p(\bm{\tau}\bm{x})$ modeling stages. For an arbitrary space of paths (either lowdimensional, or even the original highdimensional space of trajectories) the relationship between $\bm{x}$ and the corresponding probability distribution over the paths would be challenging. This is because it involves the controller properties and the dynamics of the physical environment, both of which are usually highly nontrivial. In the joint model we propose, $p(\bm{\tau}\bm{x})$ term can be seen as a ‘regularization’ part of the ELBO. It keeps the latent representation s.t. it is well suited for modeling the relationship between $\bm{x}$ and $\bm{\tau}$. The terms pertaining to ‘reconstructing’ original trajectories are the encoder $q(\bm{\tau}\bm{\xi})$ and decoder $p(\bm{\xi}\bm{\tau})$. Learning progress for these is fast if there is sufficient capacity in the bottleneck $\bm{\tau}$. However, if these make fast progress, but learn the space of latent paths $\bm{\tau}$ that is not easy to relate to the space of controllers – then $p(\bm{\tau}\bm{x})$ will drop. Hence ELBO will be lower for this ‘inconvenient’ representation for $\bm{\tau}$, encouraging alternatives. Consequently, our joint representation allows not only ‘compressing’ the space of trajectories, but also finding a compression scheme that simplifies the problem of modeling $p(\bm{\tau}\bm{x})$.
As is customary with VAEs, at first we expressed variational approximate posterior and generative model components by multivariate Gaussians with diagonal covariance. Later we found that using Laplace distributions yielded more consistent training results. The reconstruction and generation for successful training runs were comparable. However, some runs using Gaussians collapsed to the mean instead of learning useful latent representations. So we kept Laplace as the default choice.
Appendix B: SVAEDC Training Visualizations
Below we include visualizations of the training progress. We developed an easytouse training pipeline that generates training statistics and visualization videos in Tensorboard. We included our code and a detailed README with instructions on how to install and use the codebase. We took care to comment our implementation, so all further details about our implementation, parameter choices and training procedure would be easy to infer from the code attached to this submission.
Appendix C: Parametric vs Intrinsic Dimensionality
When optimizing higherdimensional controllers with few trials, one could question whether BO with SE kernel should be among the baselines. If our reward functions came from an arbitrary distribution, for BO in 30D space, for example, we would expect to need at least 60 trials to starts seeing the benefits. However, our reward landscapes come from realworld problems, not from purely analytic constructions. While robotics problems have a clear parametric dimensionality, their intrinsic dimensionality is usually unknown. The vision community is familiar with this concept: they frequently refer to a ‘lowerdimensional manifold of realworld images’. The intrinsic dimensionality of vision problems could be orders of magnitude lower than their parametric dimensionality expressed in pixel space.
In the context of BO, consider a 30D quadratic: $f(\bm{x})={\sum}_{i}{({x}_{i}+1)}^{2},\bm{x}\in {\mathbb{R}}^{30}$ with ${x}_{i}\in [0,1]$. Even on this simple quadratic BO with SE kernel gives only modest gains for the first 60 trials. Now consider $f$ such that a large number of dimensions do not contribute significantly: $f(\bm{x})={\sum}_{i=1}^{3}{({x}_{i}+1)}^{2}+0.001{\sum}_{i=4}^{30}{x}_{i}$. Figure 13 shows that BO with SE kernel succeeds with few trials (as long as hyperparameters do not force BO to overexplore). So SE baseline is a reasonable check for adequate performance in such settings.
In most cases it is difficult to estimate (or even approximately guess) the intrinsic dimensionality of a realworld problem. Parametric representation doesn’t even give an upper bound on complexity. In robotics, intrinsic dimensionality of a problem could be higher than parametric dimensionality of its most commonly used representation. For example, the effects of friction are sometimes abstracted away as a few parameters of a simplified friction model. When such problems are declared ‘lowdimensional’, it creates a misconception that they are ‘easy’. In fact, they remain hard for cases where friction matters for success and a crude model is inadequate. It is also not easy to gauge the complexity of a problem by applying algorithms like PCA on the whole optimization space. A ‘simple’ structure might be characteristic for only a part of the space. For example, failing controllers could exhibit near chaotic behavior, making $f(\bm{x})$ have high intrinsic dimensionality when considering the whole space. But this space might contain subregions, where the relationship between reward and change in controller parameters is gradual. If domain knowledge or informed kernels can help find a few points close to a successful region: the gains for BO could be paramount. BO could quickly focus exploration on the promising regions, without being restricted to a particular model or simulator structure that originally helped to point to a promising part of the space.