L EARNING WHAT YOU CAN DO BEFORE DOING ANYTHING
Anonymous authors
Paper under double-blind review
A BSTRACT
Intelligent agents can learn to represent the action spaces of other agents simply by observing them act.
Such representations help agents quickly learn to predict the effects of their own actions on the environment and to plan complex action sequences.
Current deep learning methods can learn to predict and plan from actions, but only when given abundant, action-labeled data.
In this work, we address the problem of learning an agent’s action space purely from visual observation.
We use stochastic video prediction to learn a latent variable that captures the scene’s dynamics while being minimally sensitive to the scene’s static content.
Standard techniques lead to reasonable predictions but fail to capture the structure of the action space, as they do not disentangle actions from static scene content.
We introduce a loss term that encourages the network to capture the composability of visual sequences and show that it leads to representations that disentangle the structure of actions.
We show the applicability of our method to synthetic settings and its potential to capture action spaces in complex, realistic visual settings.
When used in a semi-supervised setting, our learned representations perform comparably to existing fully supervised methods on tasks such as action-conditioned video prediction and visual servoing, while requiring orders of magnitude fewer action labels.
I NTRODUCTION
Agents behaving in real-world environments rely on perception to judge what actions they can take and what effect these actions will have.
Purely perceptual learning may play an important role in how these action representations are acquired and used.
In this work, we focus on the problem of learning an agent’s action space from unlabeled visual observations.
To see the usefulness of this strategy, consider an infant that is ﬁrst learning to walk.
From around 10 months of age, infants rapidly progress from crawling, to irregular gaits with frequent falling, and ﬁnally to reliable locomotion (Adolph et al.
But before they ﬁrst attempt to walk, infants have extensive sensory exposure to adults walking.
Unsupervised learning from sensory experience of this type appears to play a critical role in how humans acquire representations of actions before they can reliably reproduce the corresponding behaviour (Ullman et al.
Infants need to relate the set of motor primitives they can generate to the action spaces exploited by adults (Dominici et al.
(2011)), and a representation acquired by observation may allow an infant to more efﬁciently learn to produce natural, goal-directed walking behavior.
Reinforcement learning (RL) provides an alternative to the unsupervised learning approach as it implicitly discovers an agent’s action space and the consequences of its actions.
Recent breakthroughs in RL suggest that end-to-end training can be used to learn mappings between sensory input and actions (Mnih et al.
; Lillicrap et al.
; Levine et al.
(2016a;b)).
However, these methods are sample inefﬁcient and the action representations learned in this way cannot be easily generalized to new agents with a different control interface.
Unsupervised methods for sensorimotor learning may facilitate learning from passively collected data, as well as make it easier to reuse action representations between systems with different effectors and goals.
The representations learned by unsupervised methods are invariant to these choices because the model does not have access to motor commands or goals during training.
This property may also be useful for imitation learning, where ground truth actions are often hard or impossible to collect other than by visual observation (Finn et al.
; Pathak et al.
In this work, we evaluate the proposal that learning what you can do before doing anything can lead to action space representations that make subsequent learning more efﬁcient.
To this end, we develop a model that learns to represent an agent’s action space given only unlabeled videos of the agent.
The resulting representation enables direct planning in the latent space.
Given a small number of action-labeled sequences we can execute the plan by learning a simple mapping from latent action representations to the agent’s controls.
This representation may be analogous to those in the parietal and premotor areas of cortex, which include populations of neurons that represent the structure of actions produced both by the self and by others (Rizzolatti et al.
; Romo et al.
and that are critical for reliably producing ﬂexible, voluntary motor control (see Kandel et al.
(2012), Chapter 38).
In contrast to most approaches to unsupervised learning of dynamics, which focus on learning the statistical structure of the environment, we focus on disentangling action information from the instantaneous state of the environment (Fig. 1).
We base our work on recent stochastic video prediction methods (Babaeizadeh et al.
(2018); Denton & Fergus (2018);
Lee et al.
and impose two properties on the latent representation.
First, we train the representation to be minimal , i.e. containing minimal information about the current world state.
This forces the representation to focus on dynamic properties of the sensory input.
A similar objective has been used in previous work to constrain the capacity of video prediction models (Denton & Fergus (2018)).
Second, we train the representation to be composable by introducing a novel loss term that enforces that the cumulative effect of a sequence of actions can be computed from the individual actions’ representations (Fig. 1).
Composability encourages disentangling: as a composed representation does not have access to the static content of the intermediate frames, a representation is composable only if the individual action representations are disentangled from the static content.
Taken together, these two properties lead to a representation of sensory dynamics that captures the structure of the agent’s actions.
We make the following three contributions.
First, we introduce a method for unsupervised learning of an agent’s action space by training the latent representation of a stochastic video prediction model for the desiderata of minimality and composability.
Second, we show that our method learns a representation of actions that is independent of scene content on (i) a simulated 1DoF robot and (ii) the BAIR robot pushing dataset (Ebert et al.
Finally, we demonstrate that the learned representation can be used for action-conditioned video prediction and visual servoing, while requiring orders of magnitude fewer action-labeled videos than extant supervised methods.
R ELATED WORK
Learning structured and minimal representations.
Several groups have recently shown how an adaptation of the variational autoencoder (VAE, Kingma & Welling (2014); Rezende et al.
(2014)) can be used to learn representations that are minimal in the information-theoretic sense.
Alemi et al.
(2017) showed that the Information Bottleneck (IB) objective function (Tishby et al.
Shwartz-Ziv & Tishby (2017)) can be optimized with a variational approximation that takes the form of a VAE with an additional weighting hyperparameter.
In parallel, Higgins et al.
(2017) showed that a similar formulation can be used to produce disentangled representations.
The connection between disentaglement and minimality of representations was further clariﬁed by Burgess et al.
In this work, we apply the IB principle to temporal models to enforce minimality of the representation.
Several groups have proposed methods to learn disentangled representations of static content and pose from video (Denton & Birodkar (2017);
Tulyakov et al.
Jaegle et al.
(2018) learn a motion representation by enforcing that the motion acts on video frames as a group-theoretic action.
In contrast, we seek a representation that disentangles the motion from the static pose.
Thomas et al.
(2017) attempt to learn a disentangled representation of controllable factors of variation.
While the goals of their work are similar to ours, their model relies on active learning and requires an embodied agent with access to the environment.
In contrast, our model learns factors of variation purely from passive temporal visual observations, and thus can be applied even if access to the environment is costly or impossible.
Unsupervised learning with video data.
Several recent works have exploited temporal information for representation learning.
Srivastava et al.
(2015) used the Long Short-Term Memory (LSTM,
Hochreiter & Schmidhuber (1997)) recurrent neural network architecture to predict future frames.
The representation learned by the architecture was shown useful for action recognition.
Vondrick et al.
(2016) showed that architectures using convolutional neural networks (CNNs) can be used to predict actions and objects several seconds into the future.
Recently, work such as Finn et al.
; Villegas et al.
(2017); Denton & Birodkar (2017) has adopted various modiﬁcations of the convolutional LSTM architecture (Xingjian et al.
for the task of video prediction and have shown that the resulting representations are useful for a variety of tasks.
Others have explored applications of video prediction models to RL and control (Weber et al.
Ha & Schmidhuber (2018); Wayne et al.
Chiappa et al.
(2017) and Oh et al.
(2015) propose models that predict the consequences of actions taken by an agent given its control output.
Similar models have been used to control a robotic arm (Agrawal et al.
; Finn & Levine (2017); Ebert et al.
The focus of this work is on learning action-conditioned predictive models.
In contrast, our focus is on the unsupervised discovery of the space of possible actions from video data.
Our model is inspired by methods for stochastic video prediction that, given a sequence of past frames, capture the multimodal distribution of future images (Goroshin et al.
; Henaff et al.
We use the recently proposed recurrent latent variable models based on the variational autoencoder (Babaeizadeh et al.
(2018); Denton & Fergus (2018);
Lee et al.
We develop these methods and propose a novel approach to unsupervised representation learning designed to capture an agent’s action space.
Sensorimotor representations.
There is a long history of work developing sensorimotor representations for applications in reinforcement learning and robotics.
Previous work in this domain has primarily focused on introducing hand-crafted abstractions and hierarchies to make sensorimotor mappings more generalizable.
Methods for aggregating low-level controls into higher-level representations on which planning and RL can be performed are well-studied in the robotics literature: notable examples include the options framework for hierarchical RL (Sutton et al.
; Bacon et al.
(2017)), dynamic motion primitives for manipulation (Schaal et al.
; Schaal (2006);
Niekum et al.
(2015)), and recent work that abstracts a learned policy away from low-level control and perception to ease simulation-to-real transfer (Clavera & Abbeel (2017)
; Müller et al.
Other work has learned to separate robot-instance speciﬁc controls from task-related skills through modular policies, but this work does not enforce any structure onto the intermediate representation and requires extensive interaction with the environment (Devin et al.
A PPROACH
In this section, we describe our architecture for learning an action representation that is minimal and composable .
In Sec. 3.1, we describe a variational video prediction model similar to that of Denton &
Fergus (2018) that provides us with a framework for learning a latent representation z t at time t of the change between the past and the current frames.
No labeled actions are considered at this stage.
In
Sec. 3.2, we introduce an unsupervised method for imposing composability of the latent that allows us to recover a structured representation.
To verify that the learned representation corresponds to the executed control, we show that we can learn a bijective mapping between the latent representation and the control output executed at that time using a small number of labeled data points (Sec. 3.3).
In the experimental section, we describe how the learned bijective mapping can be used for tasks such as action-conditioned video prediction (Sec. 4.1) and visual servoing (Sec. 4.2).
3. V IDEO PREDICTION MODEL
At the core of our method is a recurrent latent variable model for video prediction based on a temporal extension of the VAE proposed by Chung et al.
We consider the generative model shown in
Fig.
2 (left).
At each timestep t , the model outputs a latent variable z t ∼ p
( z ) =
N (0 , I ) associated with this timestep.
Given a history of frames x 1: t − 1 and latent samples z 2: t , the generative distribution over possible next frames is given by x t ∼ p θ ( x t | x 1: t − 1 , z 2: t ) =
N ( µ θ ( x 1: t − 1 , z 2: t ) , I ) .
In practice, we generate the next frame by taking the mean of the conditional distribution: ˆ x t = µ θ ( x 1: t − 1 , z 2: t ) .
To optimize the log-likelihood of this generative model, we introduce an additional network approximating the posterior of the latent variable z t ∼ q φ ( z t | x t , x t − 1 ) =
N ( µ φ ( x t , x t − 1 ) , σ φ ( x t , x t − 1 )) .
We can optimize the model using the variational lower bound of the log-likelihood in a formulation similar to the original VAE.
However, as has been shown recently by Alemi et al.
(2018), the standard
VAE formulation does not constrain the amount of information contained in the latent variable z .
To overcome this, and to learn a minimal representation of z , we reformulate the standard VAE objective in terms of the Information Bottleneck (IB) (Shwartz-Ziv & Tishby (2017)).
IB minimizes the mutual information, I , between the action representation, z t , and input frames, x t − 1: t , while maximizing the ability to reconstruct the frame x t as measured by the mutual information between ( z t , x t − 1 ) and x t :
[Equation]
The two components of the objective are balanced with a Lagrange multiplier β z .
When the value of β z is higher, the model learns representations that are more efﬁcient, i.e. minimal in the informationtheoretic sense.
We use this property to achieve our ﬁrst objective of minimality of z .
The variational IB (Alemi et al.
(2017)) provides a variational approximation of the IB objective, that simply takes the form of the original VAE objective with an additional constant β z .
Aggregating over a sequence of frames, the video prediction objective for our model is given by:
[Equation]
The full derivation of the variational lower bound is given in the appendix of Denton & Fergus (2018) 1 .
The full model for one prediction step is shown in the left part of Fig.
3. L EARNING ACTION REPRESENTATIONS WITH COMPOSABILITY
Given a history of frames, the latent variable z t represents the distribution over possible next frames.
It can thus be viewed as a representation of possible changes between the previous and the current frame.
We will associate the latent variable z t with the distribution of such changes.
In video data of an agent executing actions in an environment, the main source of change is the agent itself.
Our model is inspired by the observation that a natural way to represent z t in such settings is by the agents’ actions at time t .
In this section, we describe an objective that encourages the previously described model (Sec. 3.1) to learn action representations.
To encourage composability , we use the procedure illustrated in Fig.
2 (right).
We deﬁne an additional random variable ν t ∼ q ζ ( ν t | z t , z
t − 1 ) =
N ( µ ζ ( z t , z t − 1 ) , σ ζ ( z t , z t − 1 )) that is a representation of the trajectory z t − 1: t .
The process of composing latent samples into a single trajectory can be repeated several times in an iterative fashion, where the generative model q ζ observes a trajectory representation ν t − 1 and the next latent z t to produce the composed trajectory representation ν t ∼ q ζ ( ν t | ν t − 1 , z t ) .
The generative model q ζ is parameterized with a multilayer perceptron, MLP comp .
We want ν to encode entire trajectories, but we also require it to have minimal information about individual latent samples.
We can encourage these two properties by again using the IB objective:
[Equation]
We maximize this objective using the following procedure.
Given a trajectory of T frames, we use MLP infer to retrieve the action representations z .
Next, we generate a sequence of trajectory representations ν t , each of which is composed from C consecutive action representations z t − C : t .
We obtain T C
= (cid:98) T/C (cid:99) such representations.
Finally, we use ν t to produce the corresponding frames ˆ x t = p θ ( x t | x t − C , ν t ) 2 .
The variational approximation to (3) that we use to impose composability takes the following form:
[Equation]
where the prior distribution over ν is given by the unit Gaussian ν ∼ p
( ν ) =
N (0 , I ) .
The objective above encourages the model to ﬁnd a minimal representation for the trajectories ν .
As the trajectories are composed from only the action representations z , this encourages z to assume a form suitable for efﬁcient composition.
This allows us to recover an action representation that is composable .
Our overall training objective is the sum of the two objectives:
[Equation]
3. G ROUNDING THE CONTROL MAPPING
Our approach allows us to learn a latent representation z that is minimal and disentangled from the content of previous images.
To use such a learned representation for control, we want to know which
[Figure] action u a certain sample z corresponds to, or vice versa.
To determine this correspondence, we learn a simple bijective mapping from a small number of action-annotated frame sequences from the training data.
We train the bijection using two lightweight multilayer perceptrons, ˆ z t =
MLP lat ( u t ) and ˆ u t =
MLP act ( z t ) .
Note that only the MLP lat and MLP act networks are trained in this step, as we do not propagate the gradients into the video prediction model.
Because we do not have to re-train the video prediction model, this step requires far less data than models with full action supervision (Section 4.2).
We note that standard image-based representations of motion, e.g., optical ﬂow, do not directly form a bijection with actions in most settings.
For example, the ﬂow ﬁeld produced by a reacher (as in Fig.
3) rotating from 12 o’clock to 9 o’clock is markedly different from the ﬂow produced by rotating from 3 o’clock to 12 o’clock, even though the actions producing the two ﬂow ﬁelds are identical (a 90 degree counter-clockwise rotation in both cases).
In contrast, our representation easily learns a bijection with the true action space.
E MPIRICAL EVALUATION
For evaluation, we consider tasks that involve regression from the latent variable to actions and vice versa: action conditioned video prediction and visual servoing (see Fig.
4, left).
By learning a bijection between the latent variable, z , and the actions, u , we show that our model ﬁnds a representation of actions that is completely disentagled from the static scene content.
We also validate that our approach requires orders of magnitude fewer labels than supervised approaches.
We conduct experiments on a simple simulated reacher dataset and the real-world Berkeley AI Research (BAIR) robot pushing dataset from Ebert et al.
Refer to Appendix B for the exact architectural parameters.
Datasets.
The reacher dataset consists of sequences of a 1DoF reacher arm rotating counterclockwise with random angular distances between consecutive images.
We simulate it using OpenAI’s
Roboschool environment (Klimov & Schulman (2018)).
The actions u are encoded as relative angles between images, and constrained to the range u ∈ [0 ◦ , 40 ◦ ] .
The dataset consists of 100 000 training and 4000 test sequences.
Additionally, we create two variations of this dataset, with (i) varying backgrounds taken from the CIFAR-10 dataset (Krizhevsky (2009)) and (ii) varying robot appearance, with 72 different combinations of arm length and width in the training dataset. Reacher BAIR Method
Abs
[Figure]
Rel
[Figure]
in px
[Figure]
[Figure]
±
[Figure]
[Figure]
Random 26 . 6 ± 21 .-
Denton & Fergus 22 . 6 ± 17 .3 .
6 ± 4 .
[Figure]
9 ± 2 .3 .
0 ± 2 .
Supervised 2 .
6 ± 1 .2 .
0 ± 1 .
The supervised baseline is taken from Oh et al.
(2015) for the reacher dataset and Finn & Levine (2017) for BAIR.
The BAIR robot pushing dataset comprises 44 374 training and 256 test sequences of 30 frames each from which we randomly crop out subsequences of 15 frames.
We deﬁne actions, u , as differences in the spatial position of the end effector in the horizontal plane 3 .
Baselines.
We compare to the original model of Denton & Fergus (2018) that does not use the proposed composability objective.
To obtain an upper bound on our method’s performance we also compare to fully supervised approaches that train with action annotations: our implementations are based on Oh et al.
(2015) for the reacher dataset and the more complex Finn & Levine (2017) for the
BAIR dataset.
For visual servoing we use a model based on the approach of Agrawal et al.
(2016) that learns the forward and inverse dynamics with direct supervision.
Metrics.
In case of the action-conditioned video prediction we use the absolute angular position (obtained using a simple edge detection algorithm, see Appendix D) for the reacher dataset and the change of end effector position (obtained via manual annotation) for the BAIR dataset.
We choose these metrics as they capture the direct consequences of applied actions, as opposed to more commonly used visual appearance metrics like PSNR or SSIM.
For visual servoing in the reacher environment we measure the angular distance to the goal state at the end of servoing.
4. A CTION - CONDITIONED VIDEO PREDICTION
To verify that our model recovers a disentangled representation of actions, we show that the model can be used for two tasks that rely on the structure of the learned representation.
First, we show that it is possible to transplant the action representations z from a given sequence into one with a different initial state.
While the content of the scene changes, the executed actions should remain the same.
Second, we show how our model can be used for action-conditioned video prediction.
Given a ground truth sequence annotated with actions u , we infer the representations z directly from u using
MLP lat .
The inferred representations are fed into the generative model p θ and the resulting sequences are compared to the original sequence.
Qualitative results are shown in Fig.
3, with additional results in Figs. 12, 13 and 14 in the Appendix and at www.tinyurl.com/ya6df9yl .
The quantitative results in Fig.
4 (right) show that the model trained with the full composability objective on the reacher dataset learns a representation corresponding to agent actions.
Our model performs similarly to the fully supervised model.
However, while our method converged when as few as 100 action-labeled sequences were used to train the bijective mapping, the supervised baselines required around 10k labeled sequences to reach this level of performance (see Table 1 in the Appendix).
Denton & Fergus (2018) performs the task only slightly better than random guessing.
This shows that it is infeasible to infer the latent z t learned by the baseline model given only the action u t .
On the BAIR dataset, our model performs better than the baseline of Denton & Fergus (2018), reducing the difference between the best unsupervised method and the supervised baseline by 30 % . [Table]
This is reﬂected in qualitative results as frames generated by the baseline model often contain artifacts such as blurriness when the arm is moving or ghosting effects with two arms present in the scene (Figs. 13 and 14 in the Appendix, videos at www.tinyurl.com/ya6df9yl ).
These results demonstrate the promise of our approach in settings involving more complex, real-world interactions.
4. V ISUAL SERVOING
To demonstrate that the learned action representation is useful for control, we use it to drive visual servoing.
The objective of visual servoing is to move an agent from a start state to a goal state, given by images x 0 and x goal , respectively.
We use a servoing algorithm similar to that of Finn & Levine (2017), but plan trajectories in the latent space z instead of true actions u .
We use MLP act to retrieve the actions that correspond to a planned trajectory.
Our visual servoing approach, based on Model Predictive Control (MPC), is described in Appendix
C. The controller plans the trajectory by performing a number of rollouts and iteratively reﬁnes its predictions using the Cross Entropy Method (CEM, Rubinstein & Kroese (2004)).
We select the rollout whose ﬁnal state is closest to the goal and execute its ﬁrst action.
The distance is measured in image space using the cosine distance between VGG16 representations (Simonyan & Zisserman (2015)).
Servoing terminates once the goal is reached or the maximum steps are executed.
The baseline of Agrawal et al. (2016) uses a different procedure, as described in the original paper.
Figure 5 (left) shows qualitative results of a servoing rollout in the reacher environment.
The agent not only reaches the target but also plans accurate trajectories at each intermediate time step.
The trajectory planned in the latent space can be correctly decoded into actions, u , which further supports the claim that a representation of actions is learned.
In Fig.
5 (right), we measure the data efﬁciency of our method and both baseline approaches that fully rely on action-label supervision during training.
Most notably, our model substantially outperforms the baselines in the low-data regime where only a small number of action-labeled training sequences are used.
This is because our method can leverage the unsupervised training.
With access to more training examples our model performs on par with both supervised baselines.
To test the robustness of our approach to different kinds of visual variability in the environment, we conduct additional experiments on two versions of the reacher dataset.
As shown in the results in
Fig.
5 (right), our model can successfully perform visual servoing when (i) trained with various backgrounds and tested on a held-out set of backgrounds and (ii) trained on a set of agents varying in appearance but sharing the action space and tested on a held-out agent. These experiments are described in more detail in Appendix E. −   − − Ours 0.
−   − −
Baseline 0. investigates why fails representations 4. L EARNED STRUCTURE OF THE ACTION REPRESENTATIONS To inspect the structure that our model learns, we visualize samples from the latent space, z , on the reacher dataset in Fig. 6.
To ﬁnd the two-dimensional subspace with maximal variability, we conducted Principal Component Analysis (PCA) on the means of the distributions generated by
MLP infer .
We note that the ﬁrst PCA dimension captures 99% of the variance, which can be explained by the fact that the robot in consideration has one degree of freedom.
We can see that while the baseline without composability training fails to learn a representation disentangled from the static content, our method correctly recovers the structure of possible actions of the robot.
C ONCLUSION
We have shown a way of learning the structure of an agent’s action space from visual observations alone by imposing the properties of minimality and composability on a latent variable for stochastic video prediction.
This strategy offers a data-efﬁcient alternative to approaches that rely on fully supervised action-conditioned methods.
The resulting representation can be used for a range of tasks, such as action-conditioned video prediction and visual servoing.
It captures meaningful structure in synthetic settings and achieves promising results in realistic visual settings.
A S TOCHASTIC VIDEO PREDICTION
We use an architecture similar to SVG-FP of Denton & Fergus (2018).
Input images x t are encoded using a convolutional neural network CNN e ( · ) to produce a low-dimensional representation
CNN e ( x t ) ; output image encodings can be decoded with a neural network with transposed convolutions CNN d ( · ) .
We use a Long Short-Term Memory network LSTM ( · , · ) for the generative network µ θ ( x t − 1 , z t ) =
CNN d ( LSTM ( CNN e ( x t − 1 ) , z t )) , and a multilayer perceptron MLP infer for the approximate inference network [ µ φ ( x t , x t − 1 ) , σ φ ( x t , x t − 1 )]
=
MLP infer ( CNN e ( x t ) , CNN e ( x t − 1 )) .
During training, our model ﬁrst observes K past input frames.
From these observations, the model generates K − 1 corresponding latents z 2: K and predicts K − 1 images ˆ x 2: K = µ θ ( x 1: K − 1 , z 2: K ) .
The model generates T − K further future images: ˆ x K +1: T = µ θ (ˆ x 1: T − 1 , z 1: T ) .
At test time, latents z t are sampled from the prior N (0 , I ) , and the model behaves identically otherwise.
We show samples from the stochastic video prediction model in Fig.
Unlike in Denton & Fergus (2018), the generating network p θ does not observe ground truth frames x K +1: T − 1 in the future during training but autoregressively takes its own predicted frames ˆ x K +1: T − 1 as inputs.
This allows the network LSTM to generalize to observing the generated frame encodings
LSTM ( CNN e ( x t − 1 ) , z t ) at test time when no ground truth future frames are available.
We use a recurrence relation of the form LSTM ( LSTM ( x t − 2 ,
z t − 1 ) , z t ) .
To overcome the generalization problem, Denton & Fergus (2018) instead re-encode the produced frames with a recurrence relation of the form LSTM ( CNN e ( CNN d ( LSTM ( x t − 2 , z t − 1 ))) , z t ) .
Our approach omits the re-encoding, which saves a considerable amount of computation.
B E XPERIMENTAL PARAMETERS
For all experiments, we condition our model on ﬁve images and roll out ten future images.
We use images with a resolution of 64 × 64 pixels.
The dimension of the image representation is dim ( g ( x ))
= 128 , and the dimensions of the learned representation are dim ( z )
= dim ( ν ) = 10 .
For the reacher dataset, we use the same architecture as Denton & Fergus (2018) for the f, g and LSTM networks.
For experiments with the standard blue background (i.e. all except the varied background experiment) we do not use temporal skip-connections.
For the BAIR dataset, we do not use f, g and use the same model as Lee et al.
(2018) for LSTM.
The MLP infer has two hidden layers with 256 and 128 units, respectively.
The MLP comp , MLP lat , and MLP act networks each have two hidden layers with 32 units.
For MLP lat and MLP act , we tried wider and deeper architectures, but this did not seem to improve performance of either our method or the baseline without composability.
This is probably because the latent space in our experiments had either a simple representation that did not need a more powerful network to interpret it, or was entangled with static content, in which case even a more powerful network could not learn the bijection.
The number of latent samples z used to produce a trajectory representation ν is C = 4 .
For all datasets, β z = 10 − 2 , β ν = 10 − 8 We use the leaky ReLU activation function in the g, f , and MLP networks.
We optimize the objective function using the Adam optimizer with parameters β 1 = 0 .
9 , β 2 = 0 .
999 and a learning rate of 2 × 10 − 4 .
We found the following rule for choosing both bottleneck parameters β z and β ν to be both intuitive and effective in practice: they should be set to the highest value at which samples from the approximate inference q produce high-quality images.
If the value is too high, the latent samples will not contain enough information to specify the next image.
If the value is too low, the divergence between the approximate inference and the prior will be too large and therefore the samples from the prior will be of inferior quality.
We note that the problem of determining β is not unique to this work and occurs in all stochastic video prediction methods, as well as VIB and β -VAE.
C V ISUAL SERVOING
We use Algorithm 1 for visual servoing.
At each time step, we initially sample M latent sequences z 0 from the prior N (0 , I ) and use the video prediction model to retrieve M corresponding image sequences τ , each with K frames.
We deﬁne the cost of an image trajectory as the cosine distance between the VGG16 (Simonyan & Zisserman (2015)) feature representations of the target image and the ﬁnal image of each trajectory.
This is a perceptual distance, as in Johnson et al.
In the update step of the Cross Entropy Method (CEM) algorithm, we rank the trajectories based on their [Table] [Table] cost and ﬁt a diagonal Gaussian distribution to the latents z (cid:48) that generated the M (cid:48) best sequences.
We ﬁt one Gaussian for each prediction time step k ∈ K .
After sampling a new set of latents z n + from the ﬁtted Gaussian distributions we repeat the procedure for a total of N iterations.
Finally
[Table]
we pick the latent sequence corresponding to the best rollout of the last iteration and map its ﬁrst latent sample to the output control action using the learned mapping: u ∗ =
MLP act ( z ∗ N, 0 ) .
This action is then executed in the environment.
The action at the next time step is chosen using the same procedure with the next observation as input.
The algorithm terminates when the speciﬁed number of servoing steps T has been executed.
Require: Video prediction model ˆ x t : t + K = µ θ ( x 1: t − 1 , z 2: t + K ) Require:
Start and goal images i i goal do latents do 4:
Rollout prediction model for K steps obtain M future sequences x
K 5:
Compute cosine distance between ﬁnal and c
Choose M reﬁt Gaussian distribution µ n n[-+
-]
Sample latents
8: end ﬁrst latent sequence to
Execute u ∗ and observe next image 11: end for
The parameters used for our visual servoing experiments are listed in Tab. 2.
[Figure]
D A NGLE D ETECTION A LGORITHM
We employ a simple, hand-engineered algorithm to quickly retrieve the absolute angle values from the images of the reacher environment.
First we convert the input to a grayscale image and run a simple edge detector to obtain a binary image of the reacher arm.
We smooth out noise by morphological opening.
We compute the Euclidean distance to the image center for all remaining non-zero pixels and locate the reacher tip at the pixel closest to the known reacher arm length.
This gives us the absolute reacher arm angle.
To evaluate the accuracy of our angle detection algorithm, we estimated the angle for all images of the simulated training dataset and compare it to ground truth.
A histogram of the angle errors of our algorithm is displayed in Fig.
All errors are below 10 degrees and the majority are smaller than 5 degrees.
This suggests the output of this model is of a suitable quality to serve as surrogate ground truth.
A second approach that used a neural network to regress the angle directly from the pixels achieved similar performance.
We attribute the errors to the discretization effects at low image resolutions – it is impossible to achieve accuracy below a certain level due to the discretization. E E XPERIMENTS WITH VARYING ENVIRONMENTS
To further test the properties of the learned representation we increase the variability of the reacher environment in two ways: (i) we train and test on reacher scenes with varying (but static) background, (ii) we train on reacher instances with visual appearance characteristics that differ from the test reacher setup. We show that the proposed method can reliably discover the agent’s action space and perform visual servoing in these settings, and that the learned representation is insensitive to these visual characteristics, as it only captures the dynamics of the environment. Our results suggest that our method is robust to visual changes and can be used for passive learning from videos that are obtained under different visual conditions, or even videos of different agents, as long as the action space of the observed agents coincides with the target agent. E. R OBUSTNESS TO C HANGING S TATIC B ACKGROUND
We test the robustness of our method to different static backgrounds by replacing the uniform blue background with images from the CIFAR-10 training set (Krizhevsky (2009)). For each sequence we sample a single background image that is constant over the course of the entire sequence. At test time we use background images that the model has not seen at training time, i.e. sampled from a held-out subset of the CIFAR-10 training set. As in previous experiments, we ﬁrst train our model on pure visual observations without action-annotations.
We then train the networks MLP lat and MLP act on a
[Figure]
small set of action-annotated sequences to convergence. For the visual servoing we follow the same algorithm as in the previous experiments (see Appendix C). Qualitative servoing results of our method on the dataset with varied backgrounds are shown in Fig. The model accurately predicts the background image into the future and successfully discovers and controls the action space of the agent.
The fact that the same bijective mapping between latents and actions works for all backgrounds suggests that the network is able to disentangle the static content of the scene and the dynamics attributed to the moving reacher arm.
In addition, we show trajectory transplantation between different backgrounds in Fig.
8 (top), which further validates the claim that the learned latent represents the action consistently, independent of the background.
E. L EARNING FROM A GENTS WITH D IFFERENT V ISUAL A PPEARANCE
We test the ability of our method to learn from agents that differ in their visual appearance from the agent used at test time, but that share a common action space.
We construct a dataset in which we vary parameters that determine the visual characteristics of the reacher arm, speciﬁcally its thickness and length (see Fig. 10, left).
In total our training dataset comprises 72 different conﬁgurations spanning a wide variety of visual appearances.
We show a qualitative example of a servoing trajectory in Fig.
10 (right).
We additionally evaluate the efﬁcacy of training on the novel dataset by following the procedure employed in Section 4.2: we train the mapping between latent representation z and actions to convergence on action-annotated subsets of the training data of varying sizes.
The servoing errors in Figure 5 (right) show that we achieve comparable performance independent of whether we train on the target agent we test on or on a set of agents with different and varied visual appearances.
Our model is able to learn a latent representation that captures the action space shared between all the agents seen at training time.
We can then learn the mapping between this abstract action space and the actions of the agent with the novel visual appearance from a small number of action-annotated sequences. In addition, we show trajectory transplantation between different agents in Fig. 8 (bottom) that further validates our claim that the learned latent represents the action consistently, independent of the agent. True
Generated
Generated Generated Future Past True
Generated Generated Generated
Generated,
Denton & Fergus
True
Generated,
Denton & Fergus
True
Generated,
Ours
Generated,
Denton & Fergus
True
Generated,
Ours
Generated,
Ours
Recipient,
Denton & Fergus
Donor
Recipient,
Ours
Recipient,
Denton & Fergus
Donor
Recipient,
Ours
Recipient,
Denton & Fergus
Donor
Recipient,
Ours
Generated,
Denton & Fergus
True
Generated,
Ours
Generated,
Denton & Fergus
True
Generated,
Ours
Generated,
Denton & Fergus
True
Generated,
Ours