Mastering Visual Continuous Control: Improved Data-Augmented Reinforcement Learning
Code: https://github.com/facebookresearch/drqv
Abstract
We present DrQ-v2, a model-free reinforcement learning (RL) algorithm for visual continuous control.
DrQ-v2 builds on DrQ, an off-policy actor-critic approach that uses data augmentation to learn directly from pixels.
We introduce several improvements that yield state-of-the-art results on the DeepMind Control Suite.
Notably, DrQ-v2 is able to solve complex humanoid locomotion tasks directly from pixel observations, previously unattained by model-free RL.
DrQ-v2 is conceptually simple, easy to implement, and provides signiﬁcantly better computational footprint compared to prior work, with the majority of tasks taking just 8 hours to train on a single GPU.
Finally, we publicly release DrQ-v2’s implementation to provide RL practitioners with a strong and computationally efﬁcient baseline. [Figure] [Figure] e R e t u r n
[Figure] [Figure]
Introduction
Creating sample-efﬁcient continuous control methods that observe high-dimensional images has been a long standing challenge in reinforcement learning (RL) .
Over the last three years, the RL community has made signiﬁcant headway on this problem, improving sample-efﬁciency signiﬁcantly.
The key insight to solving visual control is the learning of better low-dimensional representations, either through autoencoders
[Yarats et al., 2019, Finn et al., 2015], variational inference [Hafner et al., 2018, 2019, Lee et al., 2019], contrastive learning [Srinivas et al., 2020, Yarats et al., 2021a], self-prediction [Schwarzer et al., 2020b], or data augmentations [Yarats et al., 2021b, Laskin et al., 2020].
However, current state-of-the-art model-free methods are still limited in three ways.
First, they are unable to solve the more challenging visual control problems such as quadruped and humanoid locomotion.
Second, they often require signiﬁcant computational resources, i.e. lengthy training times using distributed multi-GPU infrastructure.
Lastly, it is often unclear how different design choices affect overall system performance.
In this paper we present DrQ-v2 , a simple model-free algorithm that builds on the idea of using data augmentations [Yarats et al., 2021b, Laskin et al., 2020] to solve hard visual control problems.
Most notably, it is the ﬁrst model-free method that solves complex humanoid tasks directly from pixels.
Compared to previous state-of-the-art model-free methods, DrQ-v2 provides signiﬁcant improvements in sample efﬁciency across tasks from the DeepMind Control Suite
[Tassa et al., 2018].
Conceptually simple, DrQ-v2 is also computationally efﬁcient, which allows solving most tasks in
DeepMind Control Suite in just 8 hours on a single GPU (see Figure 1).
Recently, a model-based method, DreamerV2 [Hafner et al., 2020] was also shown to solve visual continuous control problems and it was ﬁrst to solve the humanoid locomotion problem from pixels.
While our model-free
DrQ-v2 matches DreamerV2 in terms sample efﬁciency and performance, it does so 4 × faster in terms of wall-clock time to train.
We believe this makes DrQ-v2 a more accessible approach to support research in visual continuous control and it reinforces the question on whether model-free or model-based is the more suitable approach to solve this type of tasks.
DrQ-v2, which is detailed in Section 3, improves upon DrQ [Yarats et al., 2021b] by making several algorithmic changes: (i) switching the base RL algorithm from SAC [Haarnoja et al., 2018b] to DDPG [Lillicrap et al., 2015a], (ii) this allows us straightforwardly incorporating multi-step return, (iii) adding bilinear interpolation to the random shift image augmentation, (iv) introducing an exploration schedule, (v) selecting better hyper-parameters including a larger capacity of the replay buffer.
A careful ablation study of these design choices is presented in Section 4.3.
Furthermore, we re-examine the original implementation of DrQ and identify several computational bottlenecks such as replay buffer management, data augmentation processing, batch size, and frequency of learning updates (see Section 3.2).
To remedy these, we have developed a new implementation that both achieves better performance and trains around 3 .
5 times faster with respect to wall-clock time than the previous implementation on the same hardware with an increase in environment frame throughput (FPS) from 28 to 96 (i.e., it takes 10 6 / 96 / 3600 ≈ 2 .
9 hours to train for 1M environment steps).
Background 2.1 Reinforcement Learning from Images
We formulate image-based control as an inﬁnite-horizon Markov Decision Process (MDP) [Bellman, 1957].
Generally, in such a setting, an image rendering of the system is not sufﬁcient to perfectly describe the system’s underlying state.
To this end and per common practice [Mnih et al., 2013], we approximate the current state of the system by stacking three consecutive prior observations.
With this in mind, such MDP can be described as a tuple ( X , A , P, R, γ, d 0 ) , where X is the state space (a three-stack of image observations), A is the action space, P :
X × A → ∆( X ) is the transition function 1 that deﬁnes a probability distribution over the next state given the current state and action,
R : X ×
A → [0 , 1] is the reward function, γ ∈ [0 , 1) is a discount factor, and d 0 ∈ ∆( X ) is the distribution of the initial state x 0 .
The goal is to ﬁnd a policy π : X → ∆( A ) that maximizes the expected discounted sum of rewards E π [ {+(cid:80) ∞ t =
+}
[-P 1 t =
 -]γ t r t ] , where x 0 ∼ d 0 , and ∀ t we have a t ∼ π ( ·| x t ) , x t +1 ∼ P ( ·| x t , a t ) , and r t =
R ( x t , a t ) .
2.2 Deep Deterministic Policy Gradient
Deep Deterministic Policy Gradient (DDPG) [Lillicrap et al., 2015a] is an actor-critic algorithm for continuous control that concurrently learns a Q-function Q θ and a deterministic policy π φ .
For this,
DDPG uses Q-learning [Watkins and Dayan, 1992] to learn Q θ by minimizing the one-step Bellman residual J θ ( D ) =
E ( x t , a t ,r t , x t +1 )
∼D [( Q θ ( x t , a t ) − r t − γQ ¯ θ ( x t +1 , π φ ( x t +1 )) 2 ] .
The policy π φ is learned by employing Deterministic Policy Gradient (DPG)
[Silver et al., 2014] and maximizing
J φ ( D ) =
E x t ∼D [ Q θ ( x t , π φ ( x t ))] , so π φ ( x t ) approximates argmax a Q θ ( x t , a ) .
Here, D is a replay buffer of environment transitions and ¯ θ is an exponential moving average of the weights.
DDPG is amenable to incorporate n -step returns [Watkins, 1989, eng and Williams, 1996] when estimating
TD error beyond a single step [Barth-Maron et al., 2018].
In practice, n -step returns allow for faster reward propagation and has been previously used in policy gradient and Q-learning methods [Mnih et al., 2016b, Barth-Maron et al., 2018, Hessel et al., 2017].
2.3 Data Augmentation in Reinforcement Learning
Recently, it has been shown that data augmentation techniques, commonplace in Computer Vision, are also important for achieving the state-of-the-art performance in image-based RL [Yarats et al., 2021b, Laskin et al., 2020].
For example, the state-of-the-art algorithm for visual RL, DrQ [Yarats et al., 2021b] builds on top of Soft Actor-Critic [Haarnoja et al., 2018b], a model-free actor-critic algorithm, by adding a convolutional encoder and data augmentation in the form of random shifts.
The use of such data augmentations now forms an essential component of several recent visual RL algorithms [Srinivas et al., 2020, Raileanu et al., 2020, Yarats et al., 2021a, Stooke et al., 2020,
Hansen and Wang, 2021, Schwarzer et al., 2020b].
DrQ-v2: Improved Data-Augmented Reinforcement Learning
In this section, we describe DrQ-v2 , a simple model-free actor-critic RL algorithm for image-based continuous control, that builds upon DrQ.
3.1 Algorithmic Details
Image Augmentation
As in DrQ we apply random shifts image augmentation to pixel observations of the environment.
In the settings of visual continuous control by DMC, this augmentation can be instantiated by ﬁrst padding each side of 84 × 84 observation rendering by 4 pixels (by repeating boundary pixels), and then selecting a random 84 × 84 crop, yielding the original image shifted by ± 4 pixels.
We also ﬁnd it useful to apply bilinear interpolation on top of the shifted image (i.e, we replace each pixel value with the average of the four nearest pixel values).
In our experience, this modiﬁcation provides an additional performance boost across the board.
Image Encoder
The augmented image observation is then embedded into a low-dimensional latent vector by applying a convolutional encoder.
We use the same encoder architecture as in DrQ, which ﬁrst was introduced introduced in SAC-AE [Yarats et al., 2019].
This process can be succinctly summarized as h = f ξ (aug( x )) , where f ξ is the encoder, aug is the random shifts augmentation, and x is the original image observation.
Actor-Critic Algorithm
We use DDPG [Lillicrap et al., 2015a] as a backbone actor-critic RL algorithm and, similarly to Barth-Maron et al.
[2018], augment it with n -step returns to estimate TD error.
This results into faster reward propagation and overall learning progress [Mnih et al., 2016a].
While some methods [Hafner et al., 2020] employ more sophisticated techniques such as TD( λ ) or
Retrace( λ ) [Munos et al., 2016], they are often computationally demanding when n is large.
We ﬁnd that using simple n -step returns, without an importance sampling correction, strikes a good balance between performance and efﬁciency.
We also employ clipped double Q-learning [Fujimoto et al., 2018] to reduce overestimation bias in the target value.
Practically, this requires training two Qfunctions Q θ 1 and Q θ 2 .
For this, we sample a mini-batch of transitions τ = ( x t , a t , r t : t + n − 1 , x t + n ) from the replay buffer D and compute the following two losses:
[Equation]
with the TD target y deﬁned as:
[Equation]
where h t = f ξ (aug( x t )) , h t + n = f ξ (aug( x t + n )) , a t + n = π φ ( h t + n ) + (cid:15) , and ¯ θ 1 , ¯ θ 2 are the slowmoving weights for the Q target networks.
We note, that in contrast to DrQ, we do not employ a target network for the encoder f ξ and always use the most recent weights ξ to embed x t and x t + n .
The exploration noise (cid:15) is sampled from clip( N (0 , σ 2 ) , − c, c ) similar to TD3 [Fujimoto et al., 2018], with the exception of decaying σ , which we describe below.
Finally, we train the deterministic actor π φ using DPG with the following loss:
[Equation]
where h t = f ξ (aug( x t )) , a t = π φ ( h t ) + (cid:15) , and (cid:15) ∼ clip( N (0 , σ 2 ) , − c, c ) .
Similar to DrQ, we do not use actor’s gradients to update the encoder’s parameters ξ .
Scheduled Exploration Noise Empirically, we observe that it is helpful to have different levels of exploration at different stages of learning.
At the beginning of training we want the agent to be more stochastic and explore the environment more effectively, while at the later stages of training, when the agent has already identiﬁed promising behaviors, it is better to be more deterministic and master those behaviors.
Similar to Amos et al.
[2020], we instantiate this idea by using linear decay σ ( t ) for the variance σ 2 of the exploration noise deﬁned as:
[Equation]
where σ init and σ ﬁnal are the initial and ﬁnal values for standard deviation, and T is the decay horizon.
Key Hyper-Parameter Changes
We also conduct an extensive hyper-parameter search and identify several useful hyper-parameter modiﬁcations compared to DrQ. The three most important hyperparameters are: (i) the size of the replay buffer, (ii) mini-batch size, and (iii) learning rate.
Speciﬁcally, we use a 10 times larger replay buffer than DrQ. We also use a smaller mini-batch size of 256 without any noticeable performance degradation.
This is in contrast to CURL [Srinivas et al., 2020] and
DrQ [Yarats et al., 2021b] that both use a larger batch size of 512 to attain more stable training in the expense of computational efﬁciency.
Finally, we ﬁnd that using smaller learning rate of 1 × 10 − 4 , rather than DrQ’s learning rate of 1 × 10 − 3 , results into more stable training without any loss in learning speed.
[Figure]
3.2 Implementation Details
Faster Image Augmentation We replace DrQ’s random shifts augmentation (i.e., kornia.augmentation.
RandomCrop ) by a custom implementation that uses ﬂow-ﬁeld image sampling provided in PyTorch (i.e., grid_sample ).
This is done for two reasons.
First, we noticed that Kornia’s implementation does not fully utilize GPU pipelining since it has some intermediate CPU to GPU data transferring which breaks the computational ﬂow.
Second, using grid_sample allows straightforward addition of bilinear interpolation.
Our custom random shifts augmentation improves training throughput by a factor of 2 .
Faster Replay Buffer Another computational bottleneck of DrQ was the replay buffer.
The speciﬁc implementation had poor memory management which resulted in slow CPU to GPU data transfer, which also restricted the number of image-based transitions that could be stored.
We reimplemented the replay buffer to address these issues which led to a ten-fold increase in storage capacity and faster data transfer.
More details are available in our open-source release.
We note that the improved training speed of DrQ-v2 was key to solving humanoid tasks as it enabled much faster experimentation.
Experiments
In this section we provide empirical evaluation of DrQ-v2 on an extensive set of visual continuous control tasks from DMC
[Tassa et al., 2018].
We ﬁrst present comparison to prior methods, both model-free and model-based, in terms of sample efﬁciency and wall-clock time.
We then present a large scale ablation study that guided the ﬁnal version of DrQ-v2.
4.1 Setup
Environments We consider a set of MuJoCo tasks
[Todorov et al., 2012] provided by DMC [Tassa et al., 2018], a widely used benchmark for continous control.
DMC offers environments of various difﬁculty, ranging from the simple control problems such as the single degree of freedom (DOF) pendulum and cartpool, to the control of complex multi-joint bodies such as the humanoid (21 DOF).
We consider learning from pixels.
In this setting, environment observations are stacks of 3 consecutive
RGB images of size 84 × 84 , stacked along the channel dimension to enable inference of dynamic information like velocity and acceleration.
In total, we consider 24 different tasks, which we group into three buckets, easy , medium , and hard , according to the sample complexity to reach near-optimal performance (see Appendix B).
Our motivation for this is to encourage RL practitioners to focus on the medium and hard tasks and stop using the easy tasks for evaluation, as they are mostly solved at this point and may no longer provide any valuable signal in comparing different methods.
Training Details For all tasks in the suite an episode corresponds to 1000 steps, where a per-step reward is in the unit interval [0 , 1] .
This upper bounds the episode return to 1000 making it easier to compute aggregated performance measures across tasks, as we do in Figure 1a.
To facilitate fair wall-clock time comparison all algorithms are trained on the same hardware (i.e., a single NVIDIA
V100 GPU machine) and evaluated with the same periodicity of 20000 environment steps.
Each evaluation query averages episode returns over 10 episodes.
Per common practice [Hafner et al., 2019], we employ action repeat of 2 and measure sample complexity in the environment steps, rather than the actor steps.
In all the ﬁgures we plot the mean performance over 10 seeds together with the shaded regions which represent 95% conﬁdence intervals.
A full list of hyper-parameters can be found in Appendix C.
Comparison Axes
In many real-world applications, taking a step in the environment incurs signiﬁcant computational cost making sample efﬁciency a critical feature of an RL algorithm.
It is hence important to compare RL algorithms in terms of their sample efﬁciency.
We facilitate this comparison by computing an algorithm’s performance measured by episode return with respect to environment steps.
On the other end, striving low sample complexity often comes at the cost of a poor computational efﬁciency.
Unfortunately, recent deep RL literature has paid very little attention to this important axis which has led to skyrocketing hardware requirements.
Such a trend has made it virtually impossible for an RL practitioner with modest hardware capacity to contribute to advancements in image-based RL, leaving research in this area to a few well-equipped labs.
To democratize research in visual RL, we additionally propose to compare the agents in terms of wall-clock training time given the same single GPU hardware.
We note that it is possible to adapt DrQ-v2 to a distributed setup, as has been done for DDPG in prior work [Barth-Maron et al., 2018, Hoffman et al., 2020].
4.2 Comparison to Model-Free Methods
Baselines We compare our method to several state-of-the-art model-free algorithms for visual RL including CURL [Srinivas et al., 2020], DrQ [Yarats et al., 2021b], and vanilla SAC [Haarnoja et al., 2018b] augmented with the convolutional encoder from SAC-AE [Yarats et al., 2019].
Vanilla SAC is a weak baseline and only included as a ground point to showcase the recent progress in visual RL.
Sample Efﬁciency Axis
We present results on the hard (Figure 3), medium (Figure 4), and easy (Figure 7 in Appendix) subsets of the DMC tasks, where the maximum number of environment interactions is limited to thirty , three , and one million of steps respectively.
Our empirical study reveals that DrQ-v2 outperforms prior model-free methods in terms of sample efﬁciency across the three benchmarks with different levels of difﬁculty.
Importantly, DrQ-v2’s advantage is more pronounced on harder tasks (i.e., acrobot, quadruped, and humanoid), where exploration is especially challenging.
Finally, DrQ-v2 solves the DMC humanoid locomotion tasks directly from pixels, which, to the best of our knowledge, is the ﬁrst successful demonstration of such feat by a model-free method.
Compute Efﬁciency Axis To facilitate a fair comparison in terms of sheer wall-clock training time, besides employee the identical training protocol (see Section 4.1), we also use the same mini-batch size of 256 for each agent.
In Figure 5, we evaluate DrQ-v2 on a subset of DMC tasks for the sake of brevity only, and note that the demonstrated results can be easily extrapolated to the other tasks given the linear dependency between training time and sample complexity.
In our benchmarks, DrQ-v2 is able to achieve a throughput of 96 FPS, which favorably compares to DrQ’s 28 FPS (a 3 . 4 × increase), and CURL’s {+
+} FPS (a 6 × increase) throughputs.
Practically, DrQ-v2 solves easy, medium, and hard tasks within 2 . 9 , 8 . 6 , and 86 hours respectively.
4.3 Ablation Study
In this section we present an extensive ablation study that guided us to the ﬁnal version of DrQ-v2.
Here, for brevity we only discuss experiments that were most impactful and omit others that did not pan out.
For computational reasons, we only ablate on 3 different control tasks of various difﬁculty levels.
Our ﬁndings are summarized in Figure 6 and detailed below.
Switching from SAC to DDPG DrQ [Yarats et al., 2021b] leverages SAC [Haarnoja et al., 2018b] as the backbone RL algorithm.
While it has been demonstrated by many works, including the original manuscripts [Haarnoja et al., 2018b,a] that SAC is superior to DDPG [Lillicrap et al., 2015b], our careful examination identiﬁes two shortcomings that preclude SAC (within DrQ) to solve hard exploration-wise image-based tasks.
First, the automatic entropy adjustment strategy, introduced in Haarnoja et al.
[2018a], is inadequate and in some cases leads to a premature entropy collapse.
This prevents the agent from ﬁnding more optimal behaviors due to the insufﬁcient exploration.
[Figure] In Figure 6a, we empirically verify our intuition and, indeed, observe that DDPG demonstrates better exploration properties than SAC.
Here, DDPG uses constant σ = 0 . 2 for the exploration noise.
The second issue concerns the inability of soft Q-learning to incorporate n -step returns to estimate TD error in a straightforward manner.
The reason for this is that computing a target value for soft Q-function requires estimating per-step entropy of the policy, which is challenging to do for large n in the off-policy regime.
In contrast, DDPG does not require estimating per-step entropy to compute targets and is more amenable for n -step returns.
In Figure 6b we demonstrate that estimating TD error with n -step returns improves sample efﬁciency over vanilla DDPG.
We select 3 -step returns as a sensible choice for our method.
Replay Buffer Size We hypothesize that a larger replay buffer plays an important role in circumventing the catastrophic forgetting problem [Fedus et al., 2020].
This issue is especially prominent in tasks with more diverse initial state distributions (i.e., reacher or humanoid tasks), where the vast variety of possible behaviors requires signiﬁcantly larger memory.
We conﬁrm this intuition by ablating the size of the replay buffer in Figure 6c, where we observe that a buffer size of 1M helps to improve performance on Reacher Hard considerably. [Figure] [Figure]
Scheduled Exploration Noise Finally, we demonstrate that it is useful to decay the variance of the exploration noise over the course of training according to Equation (3).
In Figure 6d, we compare two versions of our algorithm, where the ﬁrst variant uses a ﬁxed standard deviation of σ = 0 .
2 , while the second variant employes the decaying schedule σ ( t ) , with parameters σ init = 1 . 0 , σ ﬁnal = 0 .
1 , and
T = 500000 .
Having the exploration noise to decay linearly over time turns out to be helpful and provide an additional performance boost, which was especially useful for solving humanoid tasks.
Related Work
Visual Reinforcement Learning Successes of visual representation learning in computer vision [Vincent et al., 2008, Doersch et al., 2015, Wang and Gupta, 2015, Noroozi and Favaro, 2016,
Zhang et al., 2017, Gidaris et al., 2018] has inspired successes in visual RL, where coherent representations are learned alongside RL.
Works such as SAC-AE
[Yarats et al., 2019], PlaNet [Hafner et al., 2018], and SLAC [Lee et al., 2019], demonstrated how auto-encoders [Finn et al., 2015] could improve visual RL.
Following this, other self-supervised objectives such as contrastive learning in CURL [Srinivas et al., 2020] and ATC [Stooke et al., 2020], self-prediction in SPR [Schwarzer et al., 2020a], contrastive cluster assignment in Proto-RL [Yarats et al., 2021a], and augmented data in DrQ [Yarats et al., 2021b] and RAD [Laskin et al., 2020], have signiﬁcantly bridged the gap between state-based and image-based RL.
Future prediction objectives [Hafner et al., 2018, 2019, Yan et al., 2020, Finn et al., 2015, Pinto et al., 2016, Agrawal et al., 2016] and other auxiliary objectives [Jaderberg et al., 2016, Zhan et al., 2020, Young et al., 2020, Chen et al., 2020] have shown improvements on a variety of problems ranging from gameplay, continuous control, and robotics.
In the context of visual control settings, clever use of augmented data [Yarats et al., 2021b, Laskin et al., 2020] currently produces state-of-the-art results on visual tasks from DMC [Tassa et al., 2018].
Humanoid Control
The humanoid control problem ﬁrst presented in Tassa et al.
[2012], has been studied as one of the hardest control problems due to its large state and action spaces.
The earliest solutions to this problem use ideas in model-based optimal control to generate policies given an accurate model of the humanoid .
Subsequent works in RL have shown that model-free policies can solve the humanoid control problem given access to proprioceptive state observations.
However, solving such a problem from visual observations has been a challenging problem, with leading RL algorithms making little progress to solve the task [Tassa et al., 2018].
Recently, Hafner et al.
[2020] was able to solve this problem through a model-based technique in around 30M environment steps and 340 hours of training on a single GPU machine. DrQ-v2, presented in this paper, marks the ﬁrst [Figure] i
[Figure]
o d
[Figure] R [Figure] t u r n
Acrobot Swingup
[Figure]
[Figure]
u r n
[Figure]
[Figure]
Increasing the size of the replay buffer improves performance, over the original 100k used by DrQ (silver).
Going forward, we use a buffer size of 1M (red).
[Figure]
(d) Finally, a decaying schedule for the variance of the exploration noise (blue) helps on hard exploration tasks, versus the ﬁxed
[Figure]
model-free RL method that can solve humanoid control from visual observations, taking also around 30M steps and 86 hours of training on the same hardware.
Appendix A DrQ-v2: Improved Data-Augmented Reinforcement Learning
Training routine: for each timestep t = 1 ..
T do σ t ← σ ( t )
(cid:46) Compute noise a t ← π φ ( f ξ ( x t ))
+ (cid:15) and (cid:15) ∼ N (0 , σ 2 t ) (cid:46)
Add noise to the deterministic action x t +1 ∼ P ( ·| x t , a t ) (cid:46)
Run transition for one step
D ← D ∪ ( x t , a t , R ( x t , a t ) , x t +1 ) (cid:46) Add the
U PDATE C RITIC ( D , σ t )
U PDATE A CTOR
( D , σ t ) end for procedure U PDATE C RITIC
( D , σ ) { ( x t , a t , r t : t + n − 1 , x t + n ) } ∼ D (cid:46)
Sample a mini batch of B transitions h t , h t + n ← f ξ (aug( x t )) , f ξ (aug( x t + n ))
(cid:46) Apply data augmentation and encode a t + n ← π φ ( h t + n ) + (cid:15) and (cid:15) ∼ clip( N (0 , σ 2 ))
(cid:46)
Sample action
Compute L θ 1 ,ξ and L θ 2 ,ξ using Equation (1) (cid:46) Compute critic losses ξ ← ξ − α ∇ ξ ( L θ 1 ,ξ + L θ 2 ,ξ ) (cid:46) Update encoder weights θ k ← θ k − α ∇ θ k L θ k ,ξ ∀ k ∈ { 1 , 2 } (cid:46) Update critic weights ¯ θ k ← (1 − τ )¯ θ k
+ τθ k ∀ k ∈ { 1 , 2 } (cid:46) Update critic target weights end procedure procedure U PDATE
A CTOR ( D , σ ) { ( x t ) } ∼ D (cid:46)
Sample a mini batch of B observations h t ← f ξ (aug( x t ))
(cid:46) Apply data augmentation and encode a t ← π φ ( h t ) + (cid:15) and (cid:15) ∼ clip( N (0 , σ 2 ))
(cid:46)
Sample action
Compute L φ using Equation (2) (cid:46) Compute actor loss φ ← φ − α ∇ φ L φ (cid:46) Update actor’s weights only end procedure
B Benchmarks
We classify a set of 24 continuous control tasks from DMC
[Tassa et al., 2018] into easy , medium , and hard benchmarks and provide a summary for each task in Table 1.
Task
Traits
Difﬁculty
Allowed Steps dim( S ) dim( A )
Cartpole Balance
[Table]
dense easy
[Table]
{+Cartpole Balance Sparse balance, sparse easy 1 × 
+}
{+Cartpole Swingup swing dense 1 × 
+}
{+Cup Catch swing, catch, sparse easy 1 × 
+}
{+Finger Spin rotate, dense easy 1 × 
+}
{+Hopper Stand stand, dense easy 1 × 
+}
{+Pendulum Swingup swing, sparse easy 1 × 
+}
{+Walker Stand stand, dense easy 1 × 
+}
{+Walker Walk walk, dense easy 1 × 
+}
Acrobot Swingup diff.
{+balance, dense medium 3 × 
+}
{+Cartpole Swingup Sparse swing, sparse medium 3 × 
+}
{+Cheetah Run run, dense medium 3 × 
+}
{+Finger Turn Easy turn, sparse medium 3 × 
+}
{+Finger Turn Hard turn, sparse medium 3 × 
+}
{+Hopper Hop move, dense medium 3 × 
+}
{+Quadruped Run run, dense medium 3 × 
+}
{+Quadruped Walk walk, dense medium 3 × 
+}
{+Reach Duplo manipulation, sparse medium 3 × 
+}
{+Reacher Easy reach, dense medium 3 × 
+}
{+Reacher Hard reach, dense medium 3 × 
+}
{+Walker Run run, dense medium 3 × 
+}
{+Humanoid Stand stand, dense hard 30 × 
+}
{+Humanoid Walk walk, dense hard 30 × 
+}
[Table]
C Hyper-parameters
The full list of hyper-parameters is presented in Table 2.
While we tried to keep the settings identical for each of the task, there are a few speciﬁc deviations for some tasks.
Walker Stand/Walk/Run For all three tasks we use mini-batch size of 512 and n -step return of 1 .
Cartpole Swingup Sparse stddev.
schedule is set to 1 . 0 to facilitate stronger exploration in the sparse reward setting.
Quadruper Run We set the replay buffer size to 10 5 .
Humanoid Stand/Walk/Run We set learning rate to 8 × 10 − 5 and increase features dim.
to 100 .
[Table]
D Comparison to Model-Free Methods
[Figure]
E Comparison to Model-Based Methods
Baseline To see how DrQ-v2 stacks up against model-based methods, which tend to achieve better sample complexity in expense of a larger computational footprint, we also compare to recent and unpublished 2 improvements to Dreamer-v2 [Hafner et al., 2020], a leading model-based approach for visual continuous control.
The recent update shows that the model-based approach can solve the DMC humanoid tasks directly from pixel inputs.
The open-source implementation of Dreamerv2 ( https://github.com/danijar/dreamerv2 ) only provides learning curves for Humanoid
Walk .
For this reason we run their code to obtain results on other DMC tasks.
To limit hardware requirements of compute-expensive Dreamer-v2, we only run it on a subset of 12 out of 24 considered tasks.
This subset, however, overlaps with all the three (i.e. easy, medium, and hard) benchmarks.
Sample Efﬁciency Axis
Our empirical study in Figure 8 reveals that in many cases, DrQ-v2, despite being a model-free method, can rival sample efﬁciency of state-of-the-art model-based
Dreamer-v2.
We note, however, that on several tasks (for example Acrobot Swingup and Finger Turn
Hard ) Dreamer-v2 outperforms DrQ-v2.
We leave investigation of such discrepancy for future work.
Compute Efﬁciency Axis
A different picture emerges if comparison is done with respect to wallclock training time.
Dreamer-v2, being a model-based method, performs signiﬁcantly more ﬂoating point operations to reach its sample efﬁciency.
In our benchmarks, Dreamer-v2 records a throughput of 24 FPS, which is 4 × less than DrQ-v2’s throughput of 96 FPS, measured on the same hardware.
In Figure 9 we plot learning curves against wall-clock time and observe that DrQ-v2 takes less time to solve the tasks.
[Figure]
r n
[Figure]
n
[Figure]
E p
i s o d e R e t u r n
[Figure]
[Figure]
d
[Figure]
R
[Figure]
t u r n
[Figure]