Playing hard exploration games by watching YouTube

05/29/2018 ∙ by Yusuf Aytar, et al. ∙ 2

Deep reinforcement learning methods traditionally struggle with tasks where environment rewards are particularly sparse. One successful method of guiding exploration in these domains is to imitate trajectories provided by a human demonstrator. However, these demonstrations are typically collected under artificial conditions, i.e. with access to the agent's exact environment setup and the demonstrator's action and reward trajectories. Here we propose a two-stage method that overcomes these limitations by relying on noisy, unaligned footage without access to such data. First, we learn to map unaligned videos from multiple sources to a common representation using self-supervised objectives constructed over both time and modality (i.e. vision and sound). Second, we embed a single YouTube video in this representation to construct a reward function that encourages an agent to imitate human gameplay. This method of one-shot imitation allows our agent to convincingly exceed human-level performance on the infamously hard exploration games Montezuma's Revenge, Pitfall! and Private Eye for the first time, even if the agent is not presented with any environment rewards.

READ FULL TEXT VIEW PDF

Authors

page 2

page 3

page 7

This week in AI

Get the week's most popular data science and artificial intelligence research sent straight to your inbox every Saturday.

1 Introduction

People learn many tasks, from knitting to dancing to playing games, by watching videos online. They demonstrate a remarkable ability to transfer knowledge from the online demonstrations to the task at hand, despite huge gaps in timing, visual appearance, sensing modalities, and body differences. This rich setup with abundant unlabeled data motivates a research agenda in AI, which could result in significant progress in third-person imitation, self-supervised learning, reinforcement learning (RL) and related areas. In this paper, we show how this proposed research agenda enables us to make some initial progress in self-supervised alignment of noisy demonstration sequences for RL agents, enabling human-level performance on the most complex and previously unsolved Atari 2600 games.

Despite the recent advancements in deep reinforcement learning algorithms [7, 9, 17, 19] and architectures [22, 35], there are many “hard exploration” challenges, characterized by particularly sparse environment rewards, that continue to pose a difficult challenge for existing RL agents. One epitomizing example is Atari’s Montezuma’s Revenge [10], which requires a human-like avatar to navigate a series of platforms and obstacles (the nature of which change substantially room-to-room) to collect point-scoring items. Such tasks are practically impossible using naive -greedy exploration methods, as the number of possible action trajectories grows exponentially in the number of frames separating rewards. For example, reaching the first environment reward in Montezuma’s Revenge takes approximately environment steps, equivalent to possible action sequences. Even if a reward is randomly encountered, -discounted RL struggles to learn stably if this signal is backed-up across particularly long time horizons.

Successful attempts at overcoming the issue of sparse rewards have fallen broadly into two categories of guided exploration. First, intrinsic motivation methods provide an auxiliary reward that encourages the agent to explore states or action trajectories that are “novel” or “informative” with respect to some measure [8, 30, 27]

. These methods tend to help agents to re-explore discovered parts of state space that appear novel or uncertain (known-unknowns), but often fail to provide guidance about where in the environment such states are to be found in the first place (unknown-unknowns). Accordingly, these methods typically rely on an additional random component to drive the initial exploration process. The other category is imitation learning 

[20, 41], whereby a human demonstrator generates state-action trajectories that are used to guide exploration toward areas considered salient with respect to their inductive biases. These biases prove to be a very useful constraint in the context of Atari, as humans can immediately identify e.g. that a skull represents danger, or that a key unlocks a door.

Among existing imitation learning methods, DQfD by Hester et al. [20] has shown the best performance on Atari’s hardest exploration games. Despite these impressive results, there are two limitations of DQfD [20] and related methods. First, they assume that there is no “domain gap” between the agent’s and demonstrator’s observation space, e.g. variations in color or resolution, or the introduction of other visual artifacts. An example of domain gap in Montezuma’s Revenge is shown in Figure 1, considering the first frame of (a) our environment compared to (b) YouTube gameplay footage. Second, they assume that the agent has access to the exact action and reward sequences that led to the demonstrator’s observation trajectory. In both cases, these assumptions constrain the set of useful demonstrations to those collected under artificial conditions, typically requiring a specialized software stack for the sole purpose of RL agent training.

To address these limitations, this paper proposes a method for overcoming domain gaps between the observation sequences of multiple demonstrations, by using self-supervised classification tasks that are constructed over both time (temporal distance classification) and modality (cross-modal temporal distance classification) to learn a common representation (see Figure 2). Unlike previous approaches, our method requires neither (a) frame-by-frame alignment between demonstrations, or (b) class labels or other annotations from which an alignment might be indirectly inferred. We additionally propose a new unsupervised measure (cycle-consistency) for evaluating the quality of such a learnt embedding.

Using our embedding, we propose an auxiliary imitation loss that allows an agent to successfully play hard exploration games without requiring the knowledge of the demonstrator’s action trajectory. Specifically, providing a standard RL agent with an imitation reward learnt from a single YouTube video, we are the first to convincingly exceed human-level performance on three of Atari’s hardest exploration games: Montezuma’s Revenge, Pitfall! and Private Eye. Despite the challenges of designing reward functions [18, 36] or learning them using inverse reinforcement learning [1, 49], we also achieve human-level performance even in the absence of an environment reward signal.


(a) ALE frame         (b) Frames from different YouTube videos

Figure 1: Illustration of the domain gap that exists between the Arcade Learning Environment and YouTube videos from which our agent is able to learn to play Montezuma’s Revenge. Note different size, resolution, aspect ratio, color and addition of visual artifacts such as text and avatars.

2 Related Work

Imitation learning methods such as DQfD have yielded promising results for guiding agent exploration in sparse-reward tasks, both in game-playing [20, 32] and robotics domains [41]. However, these methods have traditionally leveraged observations collected in artificial conditions, i.e. in the absence of a domain gap (see Figure 1) and with full visibility over the demonstrator’s action and reward trajectories. Other approaches include interacting with the environment before introducing the expert demonstrations [38, 31] and goal conditioned policies for high fidelity imitation [29], although these papers typically do not assume domain gap or operate in sparse reward settings.

There are several methods of overcoming the domain gap in the previous literature. In the simple scenario of demonstrations that are aligned frame-by-frame [24, 34], methods such as CCA [2], DCTW [39] or time-contrastive networks (TCN)  [34] can be used to learn a common representation space. However, YouTube videos of Atari gameplay are more complex, as the actions taken by different demonstrators can lead to very different observation sequences lacking such an alignment. In this scenario, another common approach for domain alignment involves solving a shared auxiliary objective across the domains [5, 6]. For example, Aytar et al. [5]

demonstrated that by solving the same scene classification task bottlenecked by a common decision mechanism (i.e. using the same network), several very different domains (i.e. natural images, line drawings and text descriptions) could be successfully aligned. Similarly, domain adaptive meta-learning

[44] uses a shared policy network for addressing the domain gap for robotic tasks, though they require both first person robot demonstrations and third person human demonstrations. Our work differs from the above approaches in that we do not make use of any category-guided supervision or first person demonstrations. Instead, we define our shared tasks using self-supervision over unlabeled data. This idea is motivated by several recent works in the self-supervised feature learning literature [3, 11, 12, 28, 42, 45, 26].

Other related approaches include single-view TCN [34], which is another self-supervised task that does not require paired training data. We differ from this work by using temporal classification instead of triplet-based ranking, which removes the need to empirically tune sensitive hyper parameters (local neighborhood size, ranking margin, etc). Another approach [33] performs temporal classification but limits its categories to frames close or far away in time. With respect to our use of cross-modal data, another similar existing method in the feature learning literature is -net [3]. This approach learns to align vision and sound modalities, whereas we learn to align multiple audio-visual sequences (i.e. demonstrations) using multi-modal alignment as a self-supervised objective. We adapt both TCN and -net for domain alignment and provide an evaluation compared to our proposed method in Section 6. We also experimented with third-person imitation methods [37] that combine the ideas of generative adversarial imitation learning (GAIL) [21] and adversarial domain confusion [16, 40], but were unable to make progress using the very long YouTube demonstration trajectories.

Considering the imitation component of our work, one perspective is that we are learning a reward function that explains the demonstrator’s behavior, which is closely related to inverse reinforcement learning [1, 49]. There have also been many previous studies that consider supervised [4] and few-shot methods [13, 15] for imitation learning. However, in both cases, our setting is more complex due to the presence of domain gap and absence of demonstrator action and reward sequences.


(a) An example path    (b) Aligned frames   (c) Our embedding   (d) Pixel embedding

Figure 2: For the path shown in (a), t-SNE projections [25] of observation sequences using (c) our embedding, versus (d) raw pixels. Four different domains are compared side-by-side in (b) for an example frame of Montezuma’s Revenge: (purple) the Arcade Learning Environment, (cyan/yellow) two YouTube training videos, and (red) an unobserved YouTube video. It is evident that all four trajectories are well-aligned in our embedding space, despite (purple) and (red) being held-aside during training. Using raw pixel values fails to achieve any meaningful alignment.

3 Closing the domain gap

Learning from YouTube videos is made difficult by both the lack of frame-by-frame alignment, and the presence of domain-specific variations in color, resolution, screen alignment and other visual artifacts. We propose that by learning a common representation across multiple demonstrations, our method will generalize to agent observations without ever being explicitly exposed to the Atari environment. In the absence of pre-aligned data, we adopt self-supervision in order to learn this embedding. The rationale of self-supervision is to propose an auxiliary task that we learn to solve simultaneously across all domains, thus encouraging the network to learn a common representation. This is motivated by the work of Aytar et al. [5], but differs in that we do not have access to class labels to establish a supervised objective. Instead, we propose two novel self-supervised objectives: temporal distance classification (TDC), described in Section 3.1 and cross-modal temporal distance classification (CMC), described in Section 3.2. We also propose cycle-consistency in Section 3.3 as a quantitative measure for evaluating the one-to-one alignment capacity of an embedding.

3.1 Temporal distance classification (TDC)

We first consider the unsupervised task of predicting the temporal distance between two frames of a single video sequence. This task requires an understanding of how visual features move and transform over time, thus encouraging an embedding that learns meaningful abstractions of environment dynamics conditioned on agent interactions.

We cast this problem as a classification task, with categories corresponding to temporal distance intervals, . Given two frames from the same video, , we learn to predict the interval s.t. . Specifically, we implement two functions: an embedding function

, and a classifier

, both implemented as neural networks (see Section 

5 for implementation details). We can then train to predict the distribution over class labels, , using the following cross-entropy classification loss:

(1)

where and are the true and predicted label distributions respectively.


(a) Temporal and cross-modal pair selection   (b) Embedding networks   (c) Classification networks

Figure 3: Illustration of the network architectures and interactions involved in our combined TDC+CMC self-supervised loss calculation. The final layer fc2 of is later used to embed the demonstration trajectory to imitate. Although the Arcade Learning Environment does not expose an audio signal to our agent at training time, the audio signal present in YouTube footage made a substantial contribution to the learnt visual embedding function .

3.2 Cross-modal temporal distance classification (CMC)

In addition to visual observations, our YouTube videos contain audio tracks that can be used to define an additional self-supervised task. As the audio of Atari games tends to correspond with salient events such as jumping, obtaining items or collecting points, a network that learns to correlate audio and visual observations should learn an abstraction that emphasizes important game events.

We define the cross-modal classification task of predicting the temporal distance between a given video frame, , and audio snippet, . To achieve this, we introduce an additional embedding function, , which maps from a frequency-decomposed audio snippet to an

-dimensional embedding vector,

. The associated classification loss, , is equivalent to Equation (1) using the classification function . Note that by limiting our categories to the two intervals and with being the local positive neighborhood, this method reduces to -Net of Arandjelovic et al. [3]. In our following experiments, we obtain a final embedding by a -weighted combination of both cross-modal and temporal distance classification losses, i.e. minimizing .

(a) Cycle-consistency visualization                            (b) One shot imitation

Figure 4: (a) Visualization of two embedding spaces with low and high cycle-consistency. Note that the selected point in sequence (left) fails and (right) succeeds at cycling back to the original point. (b) Demonstration of one shot imitation through RL visualized in the embedding space.

3.3 Model selection through cycle-consistency

A challenge of evaluating and meta-optimizing the models presented in Section 3 is defining a measure of the quality of an embedding . Motivated by the success of cyclic relations in CycleGAN [48] and for matching visual features across images [47], we propose cycle-consistency for this purpose. Assume that we have two length- sequences, and . We also define the distance, , as the Euclidean distance in the associated embedding space, . To evaluate cycle-consistency, we first select and determine its nearest neighbor, . We then repeat the process to find the nearest neighbor of , i.e. . We say that is cycle-consistent if and only if , and further define the one-to-one alignment capacity, , of the embedding space as the percentage of that are cycle-consistent. Figure 4(a) illustrates cycle-consistency in two example embedding spaces. The same process can be extended to evaluate the 3-cycle-consistency of , , by requiring that remains cycle consistent along both paths and , where is a third sequence.

4 One-shot imitation from YouTube footage

In Section 3, we learned to extract features from unlabeled and unaligned gameplay footage, and introduced a measure to evaluate the quality of the learnt embedding. In this section, we describe how these features can be exploited to learn to play games with very sparse rewards, such as the infamously difficult Pitfall! and Montezuma’s Revenge. Specifically, we demonstrate how a sequence of checkpoints placed along the embedding of a single YouTube video can be presented as a reward signal to a standard reinforcement learning agent (IMPALA for our experiments [14]), allowing successful one-shot imitation even in the complete absence of the environment rewards.

Taking a single YouTube gameplay video, we simply generate a sequence of “checkpoints" every frames along the embedded trajectory. We can then represent the following reward:

(2)

where are the zero-centered and -normalized embeddings of the agent and checkpoint observations. We also require that checkpoints be visited in soft-order, i.e. if the last collected checkpoint is at , then . We set and for our experiments (except when considering pixel-only embeddings, where provided the best performance).

Embedding Method
pixel distance 30.5 08.4
single-view TCN [34] 32.2 15.9
TDC (ours) 42.0 23.0
-Net [3] 27.3 10.9
CMC (ours) 41.7 23.6
combined (TDC+CMC) 44.2 27.5
Figure 5: Cycle-consistency evaluation considering different embedding spaces. We compare naive pixel loss to temporal methods (TDC and single-view TCN) and cross-modal methods (CMC and -Net). Combining TDC and CMC yields the best performance for both 2 and 3-cycle-consistency, particularly at deeper levels of abstraction (e.g. no performance loss using fc1 or fc2).

5 Implementation Details

The visual embedding function,

, is composed of three spatial, padded, 3x3 convolutional layers with (32, 64, 64) channels and 2x2 max-pooling, followed by three residual-connected blocks with 64 channels and no down-sampling. Each layer is ReLU-activated and batch-normalized, and the output fed into a 2-layer 1024-wide MLP. The network input is a 128x128x3x4 tensor constructed by random spatial cropping of a stack of four consecutive 140x140 RGB images, sampled from our dataset. The final embedding vector is

-normalized.

The audio embedding function, , is as per except that it has four, width-8, 1D convolutional layers with (32, 64, 128, 256) channels and 2x max-pooling, and a single width-1024 linear layer. The input is a width-137 (6ms) sample of 256 frequency channels, calculated using STFT. ReLU-activation and batch-normalization are applied throughout and the embedding vector is -normalized.

The same shallow network architecture, , is used for both temporal and cross-modal classification. Both input vectors are combined by element-wise multiplication, with the result fed into a 2-layer MLP with widths (1024, 6) and ReLU non-linearity in between. A visualization of these networks and their interaction is provided in Figure 3. Note that although and share the same architecture, they are operating on two different problems and therefore maintain separate sets of weights.

To generate training data, we sample input pairs (where and are sampled from the same domain) as follows. First, we sample a demonstration sequence from our three training videos. Next, we sample both an interval, , and a distance, . Finally, we randomly select a pair of frames from the sequence with temporal distance . The model is trained with Adam using a learning rate of and batch size of 32 for 200,000 steps.

As described in Section 4, our imitation loss is constructed by generating checkpoints every frames along the -embedded observation sequence of a single YouTube video. We train an agent using the sum of imitation and (optionally) environment rewards. We use the distributed A3C RL agent IMPALA [14] with 100 actors for our experiments. The only modification we make to the published network is to calculate the distance (as per Equation(2)) between the agent and the next two checkpoints and concatenate this 2-vector with the flattened output of the last convolutional layer. We also tried re-starting our agent from checkpoints recorded along its trajectory, similar to Hosu et al. [23], but found that it provided minimal improvement given even our very long demonstrations.


Figure 6: For each embedding method, we visualize the t-SNE projection of four observation sequences traversing the first room of Montezuma’s Revenge. Using pixel space alone fails to provide any meaningful cross-domain alignment. Purely cross-modal methods perform better, but produce a very scattered embedding due to missing long-range dependencies. The combination of temporal and cross-modal objectives yields the best alignment and continuity of trajectories.

6 Analysis and Experiments

In this section we analyze (a) the learnt embedding spaces, and (b) the performance of our RL agent. We consider three Atari 2600 games that are considered very difficult exploration challenges: Montezuma’s Revenge, Pitfall! and Private Eye. For each, we select four YouTube videos (three training and one test) of human gameplay, varying in duration from 3-to-10 minutes. Importantly, none of the YouTube videos were collected using our specific Arcade Learning Environment [10], and the only pre-processing that we apply is keypoint-based (i.e. Harris corners) affine transformation to spatially align the game screens from the first frame only. The dataset used and additional experiments can be found in the supplemental material to this paper.

6.1 Embedding space evaluation

To usefully close the domain gap between YouTube gameplay footage and our environment observations, our learnt embedding space should exhibit two desirable properties: (1) one-to-one alignment capacity and (2) meaningful abstraction. We consider each of these properties in turn.

First, one-to-one alignment is desirable for reliably mapping observations between different sequences. We evaluate this property using the cycle-consistency measure introduced in Section 3.3. The features from earlier layers in (see Figure 5) are centered and -normalized before computing cycle-consistency. Specifically, we consider both (a) the 2-way cycle-consistency, , between the test video and the first training video, and (b) the 3-way cycle-consistency, , between the test video and the first two training videos. These results are presented in Figure 5, comparing the cycle-consistencies of our TDC, CMC and combined methods to a naive -distance in pixel space, single-view time-contrastive networks (TCN) [34] and -Net [3]. Note that we implemented single-view TCN and

-Net in our framework and tuned the hyperparameters to achieve the best

cycle-consistency. As expected, pixel loss performs worst in the presence of sequence-to-sequence domain gaps. Our TDC and CMC methods alone yield improved performance compared to TCN and -Net (particularly at deeper levels of abstraction), and combining both methods provides the best results overall.

Next, Figure 6 shows the t-SNE projection of observation trajectories taken by different human demonstrators to traverse the first room of Montezuma’s Revenge. It is again evident that a pixel-based loss entirely fails to align the sequences. The embeddings learnt using purely cross-modal alignment (i.e. -Net and CMC) perform better but still yield particularly scattered and disjoint trajectories, which is an undesirable property likely due to the sparsity of salient audio signals. TDC and our combined TDC+CMC methods provide the more globally consistent trajectories, and are less likely to produce false-positives with respect to the distance metric described in Section 4.


(a) Neuron #46     (b) Neuron #8       (c) Neuron #39          (d) TDC, Overall       (e) CMC, Overall

Figure 7: (Left) Visualization of select activations in the final convolutional layer. Individual neurons focus on e.g. (a) the player, (b) enemies, and (c) the inventory. Notably absent are activations associated with distractors or domain-specific artifacts. (Right) Visualization of activations summed across all channels in the final layer. We observe that use of the audio signal in CMC results in more emphasis being placed on key items and their location in the inventory.

Finally, a useful embedding should provide a useful abstraction that encodes meaningful, high-level information of the game while ignoring irrelevant features. To aid in visualizing this property, Figure 7 demonstrates the spatial activation of neurons in the final convolutional layer of the embedding network , using the visualization method proposed in [46]. It is compelling that the top activations are centered on features including the player and enemy positions in addition to the inventory state, which is informative of the next location that needs to be explored (e.g. if we have collected the key required to open a door). Important objects such as the key are emphasized more in the cross-modal and combined embeddings, likely due to the unique sounds that are played when collected (see figure 7(d) and (e)). Notably absent are activations associated with distractors such as the moving sand animation, or video-specific artifacts indicative of the domain gap we wished to close.

6.2 Solving hard exploration games with one-shot imitation

Using the method described in Section 4, we train an IMPALA agent to play the hard exploration Atari games Montezuma’s Revenge, Pitfall! and Private Eye using a learned auxiliary reward to guide exploration. For each game, the embedding network, , was trained using just three YouTube videos, and an additional video was embedded to generate a sequence of exploration checkpoints. Videos of our agent playing these games can be found here111https://www.youtube.com/playlist?list=PLZuOGGtntKlaOoq_8wk5aKgE_u_Qcpqhu.

Figure 8 presents our learning curves for each hard exploration Atari game. Without imitation reward, the pure RL agent is unable to collect any of the sparse rewards in Montezuma’s Revenge and Pitfall!, and only reaches the first two rewards in Private Eye (consistent with previous studies using DQN variants [19, 22]). Using pixel-space features, the guided agent is able to obtain 17k points in Private Eye but still fails to make progress in the other games. Replacing a pixel embedding with our combined TDC+CMC embedding convincingly yields the best results, even if the agent is presented only with our TDC+CMC imitation reward (i.e. no environment reward).

To test the impact of the choice of expert trajectory, we generate checkpoints from two additional videos of Montezuma’s Revenge from our set, and train agents with those sequences (figure 8, left). While all three agents manage to clear the first level, expert 1 achieves the highest score. Out of the three expert sequence considered, expert 1 also has the biggest domain shift. This is in line with our findings from section 6.1 that our embedding space can sufficiently align our sequences. Domain shift in the expert trajectories is therefore not a significant factor on performance.

Finally, in Table 1 we compare our best policies for each game to the best previously published results; Rainbow [19] and ApeX DQN [22] without demonstrations, and DQfD [20] using expert demonstrations. Unlike DQfD our demonstrations are unaligned YouTube footage without access to action or reward trajectories. Our results are calculated using the standard approach of averaging over 200 episodes initialized using a random 1-to-30 no-op actions. Importantly, our approach is the first to convincingly exceed human-level performance on all three games – even in the absence of an environment reward signal. We are the first to solve the entire first level of Montezuma’s Revenge and Private Eye, and substantially outperform state-of-the-art on Pitfall!.


Montezuma’s Revenge                          Pitfall!                                Private Eye

Figure 8: Learning curves of our combined TDC+CMC algorithm with (purple) and without (yellow) environment reward, versus imitation from pixel-space features (blue) and IMPALA without demonstrations (green). The red line represents the maximum reward achieved using previously published methods, and the brown line denotes the score obtained by an average human player.

7 Conclusion

In this paper, we propose a method of guiding agent exploration through hard exploration challenges by watching YouTube videos. Unlike traditional methods of imitation learning, where demonstrations are generated under controlled conditions with access to action and reward sequences, YouTube videos contain only unaligned and often noisy audio-visual sequences. We have proposed novel self-supervised objectives that allow a domain-invariant representation to be learnt across videos, and described a one-shot imitation mechanism for guiding agent exploration by embedding checkpoints throughout this space. Combining these methods with a standard IMPALA agent, we demonstrate the first human-level performance in the infamously difficult exploration games Montezuma’s Revenge, Pitfall! and Private Eye.

Acknowledgments

We would like to thank the team, especially Serkan Cabi, Bilal Piot and Tobias Pohlen, for many fruitful discussions. We thank the reviewers for their comments, which helped in making this a better paper. And finally, we say ’thank you’ to all the amazing Atari players on Youtube and Twitch, which inspired this project.

Montezuma’s Revenge Pitfall! Private Eye
Rainbow [19] 384.0 0.0 4,234.0
ApeX [22] 2,500.0 -0.6 49.8
DQfD [20] 4,659.7 57.3 42,457.2
Average Human [43] 4,743.0 6,464.0 69,571.0
Ours ( only) 37,232.7 54,912.4 98,212.5
Ours () 58,175.1 76,812.5 98,763.2
Table 1: Comparison of our best policy (mean of 200 evaluation episodes) to previously published results across Montezuma’s Revenge, Pitfall! and Private Eye. Our agent is the first to exceed average human-level performance on all three games, even without environment rewards.

References

8 Supplementary Material

Figure 9: First frames of all videos in our dataset, after pre-processing.

8.1 Dataset

For each Atari game we consider, we chose four game-play videos on Youtube. We aimed at selecting videos with different visual appearance, to make our learnt embedding robust against distractors. Montezuma’s Revenge contains an additional validation video far outside the distribution, which we only used to test the robustness of the trained embedding in aligning sequences.

Fig. 9 shows the first frames of these videos after pre-processing, i.e., clipping the image with the coordinates listed below, and re-sizing to pixels. We start the video at the time indicated in the table below. For training the embedding, we limit video duration to 9000 frames(10 mins); for creating the checkpoints, we use the whole duration of the video.

Game Video link high score clip window start time
https://youtu.be/... ()
Montezuma’s sYbBgkP9aMo 242,900 0, 22, 480, 341 0.0s
Revenge 6zXXZvVvTFs 54,700 35, 50, 445, 300 0.6s
SuZVyOlgVek 72,700 79, 18, 560, 360 0.2s
2AYaxTiWKoY 6,100 0, 13, 640, 335 8.8s
pF6xCZA72o0 11,900 20, 3, 620, 360 24.1s
Private Eye zfdov0gmPRM 101,800 382, 37, 1221, 681 14.5s
YvaSsTIbvfc 101,600 235, 64, 1043, 654 7.6s
3Rqxqrbi9KE 101,500 -59, -18, 1128, 765 2.8s
jt0YhI_CYUs 101,800 296, 0, 1280, 718 4.3s
Pitfall! CkDllyETiBA 113,332 123, 26, 527, 341 25.6s
aAJzamWAFOE 64,275 -30, -11, 570, 381 8.3s
sH4UpYOeDFA 27,334 0, 44, 480, 359 8.3s
BPYsqj5N_0I 114,000 70, 21, 506, 359 1.0s

8.2 Game-play videos

You can observe our learnt agent playing Atari games in the following videos.

In https://youtu.be/DhUqfLjvONY, we demonstrate how our agent interprets expert videos with the example of Montezuma’s Revenge. Notice that our agent learns to optimize the timing of jumps over the enemy, while still following the expert’s trajectory.

8.3 Learning from features

If pre-trained TDC+CMC features work well as a similarity metric, we can consider to also learn the policy itself from features. Learning in feature space enables significant reductions in the size of the policy network. It is also very attractive for off-policy learning, as it allows us to store a small feature vector, instead of the full input image, in the replay table.

In an experiment, we replaced the convolutional layers of IMPALA’s policy network with our frozen, pre-trained embedding network. The policy network therefore reduces to two linear layers of width 256, which take an embedding vector of dimension 1024 as input, and output policy and baseline. This reduces the number of trainable parameters by about 60%. The generation of imitation rewards, and all other aspects of the algorithm remain unchanged.

In figure LABEL:fig:rl_feat_results we compare the performance of the method when learning from features to the full method. While the performance does not quite match the original method, it still significantly outperforms the state-of-the-art. This is quite surprising, considering that the feature layers were pre-trained without any environment interactions, and may miss certain screen elements. As the inputs of our agent are now in feature space, we also can condition the agent on the the next checkpoint in sequence, simply by providing the checkpoints’ embedding as an additional input. This allows the agent to compute a rich similarity signal, which significantly speeds up learning (see green curve in figure LABEL:fig:rl_feat_results).


8.4 Visualization of the learnt embedding space

In figure 11, we visualize the t-SNE projection of four observation sequences using embeddings computed using TCN, TDC, -Net, CMC and our combined method. The trajectories traverse the first room of Montezuma’s Revenge, i.e. moving from the start position to the key location, and back to the start position.

The feature vectors from earlier convolutional layers fail to provide any meaningful cross-domain alignment, while later layers can align the trajectories. In the later layers, we observe a strong difference in continuity between the embedding methods considered. The embeddings learnt using purely cross-modal alignment, i.e. -Net and CMC, yield particularly scattered and disjoint trajectories. On the other hand, TCN reduces the state space to a single curve, despite the fact that we should see some similarity between the first half (start to key) and the second half (key back to start) of the trajectory. The combination of temporal and cross-modal objectives yields very good alignment and continuity of trajectories.

The video https://youtu.be/RyxPAYhQ-Vo shows an animation of four expert videos, temporally aligned using our combined embedding. Note that while the four observation sequences are mostly traversing the same path, there are small differences due to e.g. different timing of jumps, which can be observed as divergences in the embedding space.

Figure 11: Visualization of the t-SNE projection of four observation sequences traversing the first room of Montezuma’s Revenge.