Full text
Master in Artificial Intelligence Master’s Thesis On Meta-Reinforcement Learning in Task Distributions with Varying Dynamics Submitted by Federico Retyk Supervised by Mario Martín Facultat d’Informàtica de Barcelona (FIB) Universitat Politècnica de Catalunya (UPC) - Barcelona Tech Facultat de Matemàtiques de Barcelona Universitat de Barcelona (UB) Escola Tècnica Superior d’Enginyeria Universitat Rovira i Virgili (URV) April 19, 2021
Abstract Meta-reinforcement learning has the potential to enable artificial agents to master new skills with improved sample-efficiency by leveraging previous learning experience in tasks that are diverse but share common structure. Our focus is to study the application of such algorithms to task distributions where the function that controls the dynamics of the environment is the main factor of variation. We start by providing an introductory background for related fields, including deep reinforcement learning, variational inference, and meta-learning. Then, we conduct a non-systematic review of the state-of-the-art algorithms for meta-reinforcement learning and perform an empirical investigation of PEARL, a method that combines soft actor-critic with latent task variables. Based on our review, we propose and implement two algorithmic modifications for PEARL: one that aims to improve the meta-training sample complexity by automatically adjusting a critical hyperparameter, and a second one focused on improving the meta-testing asymptotic performance by fine-tuning the policy during adaptation. Using a new multi-task environment suite for simulated robotics continuous control tasks, we compare the original version of PEARL and our proposed modifications, obtaining favourable results. Finally, we ponder our findings and suggest future research directions.
Acknowledgements I would like to thank my supervisor Dr. Mario Martín for his guidance as my Master’s Thesis supervisor. His passionate dedication to this project and to the field has been a source of inspiration for me. I am gratefully indebted for his knowledgeable advice during our work. Also, I would like to express my gratitude to Dr. Ulises Cortés and the High Performance Artificial Intelligence research group (HPAI), within the Barcelona Supercomputing Center (BSC), for granting me access to the computing resources needed to fulfil this work. I would additionally like to thank Johannes Heidecke and Bartomeu Pou Mulet, alumni in previous years’ cohorts, for their advice and help during different stages of this project. Furthermore, I would like to thank my friends Michał, Elli, Daniel, and Jason for their friendship and exciting discussions about machine learning. Finally, I would also like to thank my girlfriend Brenda, my sister Tamara, my brother Ezequiel, and my parents Ligia and Enrique for their unconditional love and support, which has been essential for me during this period.
Contents 1 Introduction 1 1.1 Motivation................................. 1 1.2 Contributions ............................... 1 1.3 Overview.................................. 2 2 Preliminaries 3 2.1 Reinforcement Learning . . . . . . . . . . . . . . . . . . . . . . . . . 3 2.2 Function Approximation with Deep Learning . . . . . . . . . . . . . . 8 2.3 Variational Inference . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 2.4 Variational Autoencoders . . . . . . . . . . . . . . . . . . . . . . . . . 17 2.5 LearningtoLearn............................. 23 2.6 Meta-Reinforcement Learning . . . . . . . . . . . . . . . . . . . . . . 26 3 Literature Review 30 3.1 Methods for Standard Reinforcement Learning . . . . . . . . . . . . . 30 3.1.1 SAC ................................ 30 3.1.2 UNREAL ............................. 33 3.1.3 DIAYN .............................. 34 3.2 Methods for Meta-Reinforcement Learning . . . . . . . . . . . . . . . 35 3.2.1 RL2................................ 35 3.2.2 MAML............................... 37 3.2.3 ProMP............................... 38 3.2.4 MAESN.............................. 39 3.2.5 PEARL .............................. 40 3.2.6 VariBAD ............................. 43 3.2.7 MACAW.............................. 45 3.2.8 MELD............................... 46 I
4 Research Study 49 4.1 ExperimentalSetting........................... 50 4.1.1 Methodology and Evaluation Protocol . . . . . . . . . . . . . 50 4.1.2 Environments........................... 53 4.2 AnalysisofPEARL............................ 57 4.2.1 Sensitivity to Hyperparameters . . . . . . . . . . . . . . . . . 57 4.2.2 Sensitivity to the Network Architecture . . . . . . . . . . . . . 60 4.2.3 Sensitivity to Other Design Decisions . . . . . . . . . . . . . . 62 4.2.4 Sensitivity to the Size of Meta-training Set . . . . . . . . . . . 64 4.2.5 Meta-testing Performance . . . . . . . . . . . . . . . . . . . . 66 4.3 Automatic Temperature Adjustment in Meta-training . . . . . . . . . 68 4.3.1 Bootstrapping with the State-value Function . . . . . . . . . . 69 4.3.2 Bootstrapping with the Action-value Function . . . . . . . . . 70 4.3.3 Experiments............................ 70 4.4 Fine-tuning During Meta-testing . . . . . . . . . . . . . . . . . . . . 75 4.4.1 SAC Training for Adaptation to New Tasks . . . . . . . . . . 76 4.4.2 Experiments............................ 77 5 Discussion 81 5.1 Conclusions ................................ 81 5.2 FutureWork................................ 83 References 83 II
1|Introduction This Master’s Thesis studies meta-reinforcement learning techniques applied to task distributions where the main factor of variation is the dynamics of the environment. For this, we explore the theoretical background and state-of-the-art of this field, and conduct an experimental investigation in order to propose algorithmic variants to an existent method. 1.1 Motivation Despite the stunning results obtained by deep reinforcement learning agents, including the attainment of fully autonomous vehicles or beating world champions in many intellectually sophisticated games, they typically master narrow tasks and require a vast amount of training samples to learn each new skill from scratch. In many application domains, collecting experience may be expensive or even unfeasible. Significant research attention was shifted towards meta-reinforcement learning in the last few years, as this approach appears as a promising path towards obtaining sample-efficient agents that are able to acquire new skills by leveraging experience from previous learning scenarios in related but diverse tasks. A meta-RL agent intends to learn an abstraction of the distribution of tasks in order to exploit this knowledge when facing a new problem. Most of the research literature about meta-RL focus on the goal-oriented scenario, where the different tasks encountered by the agent vary only in terms of the reward function. Nevertheless, we recognize a considerable amount of real-world applications where an agent with a fixed, well-defined goal may need to learn to act optimally in dynamically diverse environments. This is the main motivation to focus our work on meta-reinforcement learning in task distributions with varying dynamics. 1.2 Contributions Below, we list the main contributions of this Thesis. •We provide a detailed review of the state-of-the-art in meta-reinforcement learning, with a particular focus on variational inference methods, which are becoming dominant in the field. 1
•In order to facilitate future research, we implement a new suite of meta-RL simulated environments for continuous control task distributions with varying dynamics, on top of free, open-source software. •We elaborate a study on the sensitivity of PEARL [1], one of the studied meta- RL algorithms, to different design decisions, exploring possible architectures and hyperparameter values. •We propose an algorithmic variant of PEARL with automatic temperature adjustment, with the objective to improve meta-training sample-complexity and asymptotic performance. •Additionally, we propose a fine-tuning procedure to accelerate adaptation to new tasks in PEARL, improving meta-test time asymptotic performance. To the best of our knowledge, all these are novel developments. Our open-source implementation for the new suite and the algorithmic variants are shared publicly and can be found at https://github.com/federetyk/pearl-autotemp. 1.3 Overview Our dissertation is structured as follows. In Chapter 2, we provide a theoretical background with the topics required for the analysis of our work. Reinforcement learning theory basics are briefly presented in Section 2.1, followed by a summary in Section 2.2 of deep learning techniques applied to this field. Variational inference and their instrumentation in deep learning architectures are studied in Sections 2.3 and 2.4 respectively1. Then, in Section 2.5 we provide an introduction to metalearning for deep neural networks in general, in order to focus in Section 2.5 on concepts related to meta-reinforcement learning in particular. Chapter 3 presents the reader with a review of standard reinforcement learning methods in Section 3.1, as well as a detailed state-of-the-art in meta-reinforcement learning in Section 3.2, which represents one of the contributions mentioned above. For the standard (non-meta) algorithms, we provide an introduction for a cutting-edge continuous control off-policy method that forms the basis of a meta-RL algorithm presented later, which was in turn selected for the empirical part. In Chapter 4, we describe the experimental part of our work. Section 4.1 describes the methodology and evaluation protocol and presents a new meta-RL environment suite, composed of task distributions with varying dynamics. A sensitivity analysis of PEARL is provided in Section 4.2, where we document the influence of hyperparameter values and neural architecture decisions on the algorithm. In Sections 4.3 and 4.4 we formulate our proposed algorithmic variants of PEARL and present the results of experiments comparing with the original version. Finally, in Chapter 5 we discuss our findings and the analysis of the results obtained in the previous parts. We put them into context by contrasting with the reviewed literature. At the end, we also present interesting lines for future work. 1We include a review on variational inference since this topic is strongly coupled with the probabilistic view of RL, leading recently to powerful methods that we also study in later Chapters. 2
2|Preliminaries This Chapter is dedicated to present a theoretical background. We include a basic introduction (as well as useful references) for topics such as reinforcement learning, deep learning, variational inference, variational autoencoders, and meta-learning. We provide the necessary definitions and nomenclature, and briefly present some basic algorithms. This should help the reader to review the main concepts involved in each area, which are required to investigate the state-of-the-art methods introduced later and to understand the research questions studied during the experimental stage of this work. 2.1 Reinforcement Learning Consider an agent with access to information about the state of its environment. This agent is also capable to perform actions in order to affect the environment to some extent, and it is subject to a reward signal which needs to be maximized. The area of machine learning that studies acting in this setting is known as reinforcement learning (RL). As expressed by Richard S. Sutton and Andrew G. Barto in their reference textbook on the subject [2], RL is concerned with learning how to map situations to actions in order to maximize the reward, and is, therefore, a framework for goal-directed learning from interactions with the environment. Most of the definitions and notation presented in this Section are based on their book. The standard reinforcement learning setting is mathematically formalized as an infinite-horizon discrete Markov decision process [3], or simply MDP, represented as a tuple (S,A,P,R, ρ, γ). Here, Sis the space of possible states of the environment and Athe space of possible actions that the agent can choose from. The statetransition probability distribution P:S × A × S → Rmaps the current state and the action executed by the agent to a distribution over next states. Because we assume that the Markov property holds in an MDP, this completely defines the dynamics of the environment. The reward function R:S → Rdefines the mapping between states and the reward signal perceived by the agent. The tuple also includes a distribution over initial states ρ:S → Rand a discount factor γwhich is used to define the goal that is ultimately maximized. In this work, we assume that the agent interacts with the environment in discrete time steps t∈ {0,1,2, . . . }. At each particular time step t, the agent perceives a representation of the state of the environment st∈ S, and decides an action at∈ A to take in order to produce an effect. A reward signal rt∈Ris emitted by the 3
environment, which mutates to a new state st+1 ∈ S. These elements constitute a transition, which we will represent as a tuple (st, at, rt+1, st+1). An episode is the unfolding or roll-out of the Markov decision process from an initial state s0∼ρ. We will also refer to the trajectory τof the episode as the concatenation of consecutive transitions in the form of a sequence, τ= (s0, a0, r1, s1, a1, r2, s2, . . . ). The mapping between state representations and actions defines the behaviour of the agent. This is formalized as a policy π:S × A → R, a probability distribution over state-action pairs. We are usually concerned with the conditional distribution π(a|s) which, given a state, assigns a probability distribution over actions. Considering this notation, at time step t, the agent decides which action to perform by sampling from the conditional distribution given the current state st, i.e. at∼π(·|st). Note that for a fixed policy π, if the spaces Sand Aare finite sets, and if the reward signal is bounded, then the random variables st,atand rthave well-defined probability distributions. The purpose of the agent is to maximize the expectation of the cumulative (discounted) reward it receives in the long term. In order to formalize this, we introduce the concept of return G, which is a function of the sequence of reward random variables rt. A usual formulation of the return is the discounted cumulative sum of rewards after starting from a time step tunder consideration. This is, Gt=P∞ i=0 γirt+i+1. In the case of a finite-horizon MDP, we can also introduce a final time step Hand focus our maximization only within that scope, for which the return definition will ignore rewards obtained beyond H. The notion of an episode is usually associated with this case. Most of the methods reviewed here can be adapted to both infinite- and finite-horizon Markov decision processes. Since in real applications it is not frequent to have access to the complete description of the state of the world, the formalism described before can be extended to take into account partial access to the information about the state st. This can be described as a partially observable Markov decision process, or POMDP, which in addition to the elements found in a standard MDP, it includes an observation space Oand an observation function ζ:S × A × O → R, i.e. the probability distribution for observing ot∈ O after taking action at∈ A and landing in state st∈ S. In this way, a POMDP can be represented by a tuple (S,O,A,P,R, ζ, ρ, γ). Although we will study problems with partial observability later, this Section will only consider the case of a fully observable Markov decision process. Now we introduce a key concept of reinforcement learning theory: the state-value function for a policy π, noted as Vπ:S → R. This represents the value that the agent should assign to the situation of the environment being in a state sduring the current time step t, if a fixed policy πwill be governing its actions thereafter. This concept is quantified as the expected discounted return, Vπ(s) = Eπ"∞ X i=0 γirt+i+1 st=s#.(2.1) 4
The Dueling Network Architecture [28] is yet another improvement of DQN which obtained impressive results. It involves a branching architecture, which splits after computing the deep representation of the agent’s state, giving rise to two different function approximations (which are later aggregated with an element-wise addition): the state-value function Vθand the advantage function Aθ, defined in reinforcement learning theory as Aπ(s, a) = Vπ(s)−Qπ(s, a). When forcing the network to learn these two separate elements before computing the final Q(s, a)value, the algorithm efficiently learns good value functions V(s)for each state, representations which are later shared for each action. It was observed in practice that this helps to improve the stability of the algorithm. The last derivation of DQN that we are going to review in this introduction is called Rainbow [29]. It combines many of the improvements described above, together with other enhancements. This combination of techniques allows the algorithm to obtain state-of-the-art performance within the family of model-free Q-learning algorithms for discrete action spaces. The authors include an ablation study, in which they analyze the decrease in performance when removing each of the individual improvements that were used together in this case. While the algorithms discussed so far in this Section are derivations of DQN, and therefore they learn behaviour by approximating the action-value function, a different family of methods learn instead a parametrization of the policy π. For this, the policy is modeled as a conditional probability distribution of actions, given a state: πθ(a|s). In this case, we are therefore searching in policy-space, and the value functions are not necessarily learned in an explicit way. This family of algorithms is very effective for tasks involving high-dimensional or continuous action spaces. Also, this technique avoids bootstrapping methods that are typical in Q-learning, and therefore obtains better convergence properties. There are several ways to optimize the parametrized policy. One possible approach involves the application of gradient-free methods. Nevertheless, the fact that we are modeling the policy as a conditional probability distribution allows the application of efficient numerical optimization methods. Gradient ascent is the most commonly applied, but it is also possible to apply other first-order methods, such as conjugate gradients, or even second-order methods. Although second-order methods require computing the Hessian (as well as it’s inverse), some techniques exist for finding suitable approximations. We refer to the interesting review by James Martens [30] about this topic. Reinforcement learning algorithms that use gradient ascent, or other numerical optimization techniques, are called policy gradient [31] methods. In this case, the objective function (for maximization) can be defined as J(θ) = lim n→∞ Ehr1+r2+· · · +rnπθi =X s µπθ(s)X a πθ(a|s)r(s, a), where r(s, a)is the expected reward as a function of both the state and the action, and µπθ(s)is the stationary distribution in the Markov chain defined by acting in a 11
Markov decision process according to the policy πθ. The authors assume that the expectation exists, and that is independent of the initial state s0. Policy gradient methods use approximations of the gradient of this loss as the optimization steps, to compute the iterates θtaccording to the gradient ascent rule. A notable example in this family of algorithms is called REINFORCE, by Ronald J. Williams [32]. It is a Monte Carlo policy-gradient algorithm that uses the following result for obtaining the value of the gradient, where Gtis the long-term return from time step t, ∇J (θ) = EπθGt ∇θπθ(at|st) πθ(at|st). This result allows compute the gradient of the objective function ∇J (θ), which is used for the gradient ascent step, by computing the value of the policy πθ(a|s), as well as the gradient of the policy, ∇θπθ(a|s). In deep reinforcement learning, where we model the policy πθas a deep neural network, we can obtain its gradient with backpropagation. The introduction of a baseline (which is allowed to depend on sbut not on a) helps to reduce the variance introduced by approximating Gtby aggregation of the observed rewards. As mentioned in the book by Sutton and Barto [2], a natural choice for this baseline is a parametrized version of the state-value function. The weights φof a potentially parametrized state-value function Vφ(s)can be computed in the same loop as the parameters θof the policy in the Monte Carlo algorithm. A third family of reinforcement learning methods with function approximation is the one involving Actor-Critic algorithms [33]. In this case, we learn both the policy and the value function, using two separate function approximation neural networks. The first published Actor-Critic architectures are on-policy methods that use bootstrapping as in Temporal-Difference learning. The policy πθ(a|s)represents the actor, while the parametrized value function Vφ(s)is conceived as its critic since it evaluates the actor. Two separate function approximators (deep neural networks) are maintained in parallel, for the actor and for the critic. One example of this family is the Asynchronous Advantage Actor-Critic (A3C), published by Volodymyr Mnih and colleagues [34]. As in Dueling Network Architecture, A3C learns an approximation of the advantage function A(s, a), which is used in order to help reduce the variance of the policy-gradient method. Three separate deep neural networks are used to parametrize the involved elements, making the algorithm to be more stable. Additionally, a significant speed-up is obtained by using several copies of the agent (referred to as workers) that collect samples in parallel. For all these families of methods, where a parametrized function is optimized, learning is coupled with the generation of training data samples. A bad policy at any time step can impair future iterates in the parameter optimization process. A policy gradient technique called Trust Region Policy Optimization [35], or TRPO, proposes to use the Kullback–Leibler divergence between the old policy πθand the candidate update π˜ θas a regularization term, to limit the difference between the distributions. This was implemented as a model-free, on-policy reinforcement learning algorithm that obtained exceptional asymptotic convergence in continuous control tasks. A 12
later simplification of this method, called Proximal Policy Optimization [36], or simply PPO, uses the same kind of regularizer. An off-policy actor-critic algorithm with state-of-the-art performance is SAC [37], which we present in detail in the next Chapter. This technique augments the typical RL objective with an entropy regularization term, as the design of this algorithm was guided by a generalization of the reinforcement learning problem that incorporates a probabilistic inference view. A tutorial by Sergey Levine [38] studies and unifies previous work regarding this topic, where the reinforcement learning problem is recast as a probabilistic graphical model [39]. This enables the application of approximate inference tools, such as variational inference, together with deep function approximators to build powerful solutions for reinforcement learning problems. 2.3 Variational Inference In Bayesian inference, probabilistic models are fit to a set of observations in order to obtain a probability distribution over the parameters of the model [40]. The kind models that we consider in this Section involve observable random variables x, called observations, and unobservable (or latent) variables zwhich control the distribution of the observations. The join density is then p(x, z) = p(x|z)p(z).(2.8) In this scenario, inference is the process of computing the posterior p(z|x)conditioned on the observations [41]. Unfortunately, this posterior is intractable for many interesting problems, as we discuss below. This requires the use of approximate inference methods, such as sampling with Markov chain Monte Carlo (MCMC) simulation or parametric approximations with variational inference. Variational inference is a method that uses optimization techniques for approximating probability densities that are difficult to compute otherwise [41]. We are mostly interested in the posterior distribution of the latent variables conditioned on the observations, p(z|x) = p(x|z)p(z) p(x) =p(x, z) Rp(x, z)dz . (2.9) In this context, the prior predictive p(x), this is, the marginal over the observed variables, is called evidence. This quantity is intractable in many problems of interest in the real world, either because the integral is unavailable in closed-form, or because its computation has exponential time-complexity. Variational inference uses optimization techniques to find a (hopefully) good variational approximation qφ for the target posterior, qφ(z)≈p(z|x), such that the computation of the evidence is not required during the procedure. This approximation can be then used as a 13
proxy for the posterior p(z|x)to draw conclusions in the statistics problem under consideration. For this, a family of parametric functions Qis defined as the search space for the optimization problem. This is called the variational family1. Each member qφ(z)∈ Q of this family is a density over the latent variables z, parametrized with φ, the variational parameters. A particular value for φrepresents a position in the optimization search-space. The approximate inference problem is therefore posed as a search in the variational parameter space, in order to find the optimal value φ∗ which minimizes the distance between the variational approximation qφ(z)and the target posterior distribution p(z|x), φ∗= arg min φ Dqφ(z), p(z|x),(2.10) for some distance measure D, which acts as the objective function. A particularly popular measure for assessing this distance is the Kullback-Leibler divergence [42], also called KL-divergence. Some interesting properties of this measure are the fact that it is non-negative, and it is evaluated as zero if and only if both input distributions are identical. On the other hand, it is not upper-bounded [43]. It is also the case that it is not symmetrical, as it holds that ∃q, p : DKL(pkq)6= DKL(qkp). This can be easily derived from the formula, DKL qφ(z) p(z|x)=−Ez∼qφlog p(z|x) qφ(z) =−Zlog p(z|x) qφ(z)qφ(z)dz. (2.11) Other distance measures have been used in a variational inference setting as the objective function, such as using the KL-divergence in the opposite direction [44], using the more general family of Rényi’s α-divergences [45], and using the Wasserstein distance instead [46], which leads to a method based on optimal transport theory. Nevertheless, we will focus (as in most of the reviewed literature) on the use of the KL-divergence as the distance measure, and most of the efficient methods for optimizing Equation 2.10 are only guaranteed to approach locally-optimal solutions. It is important to note a trade-off in the choice of the variational family Q, between efficiency in the computational procedure to obtain the optimal φ∗on one hand, and the quality of the resulting variational approximation qφon the other hand. This quality can be quantified as the distance according to the KL-divergence, which acts as the objective function. In this sense, very simple variational families may yield poor inference results as their members are not able to capture a density close to the target posterior, while over-complex choices for the family Qmay pose a harder optimization problem. 1Although the notation of the variational approximation qφand the variational family Qmay resemble that of the action-value function Q(s, a)described in the previous Sections, they are not related. 14
Furthermore, a closer look into Equation 2.11 allows us to notice that the computation of the KL-divergence between qφ(z)and p(z|x)is intractable in case the evidence p(x)is also intractable. This is a problem since, as mentioned before, one of the main motivations for using variational inference is the fact that it does not require computing this quantity. We can unroll the definition of the KL-divergence as, DKL qφ(z) p(z|x)=−Ez∼qφlog p(z|x) qφ(z) =Ez∼qφhlog qφ(z)i−Ez∼qφhlog p(z|x)i =Ez∼qφhlog qφ(z)i−Ez∼qφhlog p(x, z)i+ log p(x). (2.12) Note in the last derivation that p(x)is constant with respect to z[40]. Since the KL-divergence is non-negative, it follows that, log p(x)≥Ez∼qφhlog p(x, z)i−Ez∼qφhlog qφ(z)i.(2.13) Because the right-hand side of the inequality is a lower bound for log p(x), it receives the name of evidence lower bound, or just ELBO, which is a function of the variational parameters φ. This property can be derived from the Jensen’s inequality, which states that f(Ex[x]) ≥Ex[f(x)] for a concave function f(·), for example f(x) = log(x). Nevertheless, deriving the expression for the ELBO using the definition of the KL-divergence allow us to state the optimization problem as, φ∗= arg min φ DKL qφ(z) p(z|x) = arg min φEz∼qφhlog qφ(z)i−Ez∼qφhlog p(x, z)i+ log p(x) = arg max φEz∼qφhlog p(x, z)i−Ez∼qφhlog qφ(z)i = arg max φ ELBO (φ), (2.14) which shows that minimizing the distance between qφ(z)and the target posterior in terms of the KL-divergence is an equivalent optimization problem to the maximization of the evidence lower bound. Furthermore, the expression of the ELBO can be rewritten in order to enable an intuitive interpretation of its components, as noted by Blei and colleagues [41]. We then state it in Equation 2.15. As pointed out in the aforementioned paper, the first term in the resulting derivation, E[log p(x|z)], is an expected log-likelihood. Optimizing the variational parameters φ for this term will push the resulting variational approximation qφ(z)to concentrate the probability where values for the latent variables zbetter explain the observed data. The second term, DKL qφ(z) p(z), is the KL-divergence between the approximation and the prior over latent variables, p(z). As this term is negative in 15
the equation, the optimization of the ELBO will encourage values of φsuch that qφ(z)is similar to the prior. This induces the complete optimization objective to obtain a balance between the prior and the observed data, such as in other Bayesian inference methods. ELBO(φ) = Ez∼qφhlog p(x, z)i−Ez∼qφhlog qφ(z)i =Ez∼qφhlog p(x|z)i+Ez∼qφhlog p(z)i−Ez∼qφhlog qφ(z)i =Ez∼qφhlog p(x|z)i+Ez∼qφlog p(z) qφ(z) =Ez∼qφhlog p(x|z)i−DKL qφ(z) p(z). (2.15) It is interesting to compare variational inference with Markov chain Monte Carlo, which is another popular method for approximating the posterior density. While in MCMC the approximation is obtained as an empirical estimate built with samples from a Markov chain, in variational inference the approximation is the result of a numerical optimization process. MCMC has been more rigorously studied and its statistical properties are better understood, when compared to variational inference [41], with guarantees of producing exact samples of the target density in an asymptotic regime. Variational inference, on the other hand, is usually more computationally efficient, as it can take advantage of modern optimization tools that available in machine learning frameworks, and it can also scale better to big datasets. A very important aspect to consider about variational inference is that it generally underestimates the variance of the posterior density. As mentioned by Blei and colleagues [41], this is a consequence of its objective function. The KL-divergence from the variational approximation to the posterior as in Equation 2.12 penalizes placing mass in qφ(·)on areas where the posterior has little mass, but penalizes less the reverse case. The derivations in Equation 2.15 show different alternatives for the computation the ELBO. This is a very important consideration for designing the variational family Q, as it defines the quantities involved for computing the step updates according to the chosen optimization algorithm, to find the optimal variational parameters φ∗ and ultimately the closest-to-target variational approximation. The efficiency of the method is affected, therefore, by the choice of the variational family. Iterative optimization of the ELBO using closed-form expressions is only possible for models with certain conjugacy properties [40], such as the mixture of Gaussians model studied by Blei and colleagues [41], and other conditionally conjugate models in the exponential family [47]. But this is not the case in general, as for example in Bayesian logistic regression [40, 41]. Recent approaches avoid model-specific derivations by using probabilistic programming. One common choice for Qis the mean-field variational family, which assumes mutual independence between the latent variables zjthat compose c. This technique, which has its roots in the statistical physics literature [48], propose a variational family 16
that factorizes. A generic member of this family, with an m-dimensional variational parameter vector φ, can be expressed as, qφ(z) = m Y j=1 qj,φ(zj),(2.16) where the individual variational factors qj,φ are defined by a subset of φ—potentially all its components— and have arbitrary parametric form. Although the independence assumption is usually over-restrictive, it is also the case that the optimization problem is easier for the mean-field variational family, with respect to the general case. This refers to the aforementioned trade-off between approximation quality and computational efficiency. In some cases, the mean of the variational approximation qφ(z)member of this family may be able to approximate the mean of the original target density. But, on the other hand, the covariance structure of the approximation will be necessarily decoupled, as defined by Equation 2.16, and therefore it will not be able to converge to that of the target density if this has a complex covariance structure. It is also interesting to note that the variance of the individual (marginal) variational factors qj,φ(zj)underrepresent the variance of the same factors in the target posterior density, which can be analyzed in the same way as mentioned above for the case of a general variational family. Also, as noted by Blei and colleagues [41], it is worth mentioning that the variational family is not modeling the observations, as the variational approximation qφ is related to the observed random variables (and affected by them) only through the optimization of the evidence lower bound. One possible algorithm for optimizing the ELBO within this particular variational family is called coordinate ascent [47]. It consists of an iterative algorithm that alternates between the optimization of each factor qj,φ(zj)while holding the others fixed. Proof that each step of this algorithm decreases the KL-divergence between the approximation and the target posterior is available in the reference book by Andrew Gelman and colleagues [40]. 2.4 Variational Autoencoders Autoencoders are unsupervised neural networks that learn useful representations of the data by attempting to fit the identity function [8]. They convert highdimensional data into low-dimensional codes by training the network to reconstruct the input based on the representation it learns in the (possibly smaller) hidden layers. The architecture of the network places constraints to the learning process, which act as an information bottleneck [11]. For example, in the typical autoencoder with an hourglass-shaped architecture, if the central hidden layer is much smaller than the input size, the optimization process forces the network to learn the most useful representation of the data such that the input can be maximally reconstructed. Even when the number of hidden units in the central layers is big, even bigger than the input size, the same information bottleneck effect can be obtained by 17
applying a regularization term in the loss function that penalizes the activation in each unit within a layer [11]. This produces sparse representations, and therefore this technique is called sparse autoencoders (SAE). Yet another way to enforce the information bottleneck effect without limiting the size of the central layers is by introducing noise in the input, and yet expecting the network to obtain the correct reconstruction, that of the pre-noise input [11]. This gives rise to another popular type of such systems, the denoising autoencoder (DAE). This method learns to remove the noise from the original input. Note that this can be seen as a form of regularization, that resembles the famous Dropout technique for training deep neural networks. While in the previous Section we introduced the basic theoretical concepts behind variational inference, we will now study the variational autoencoder (VAE), a very influential machine learning model that is inspired in such theoretical basis [49]. The VAE can be understood as a probabilistic framework which combines probabilistic graphical models and neural networks, possibly with deep architectures and automatic differentiation engines. It provides a way to jointly learn latent-variable generative models and inference models using stochastic gradient descent [50]. Variational autoencoders can be understood as two coupled, but independently parametrized models: an encoder, also refereed to as recognition model, and a decoder or generative model. Considering the Bayesian inference setting under analysis in the previous Section, the encoder is trained to approximate the true posterior p(z|x)of the latent variable zgiven the observation x. Therefore, it provides an approximation, for each observed data point, of its posterior over the latent variable space. The decoder, then, learns a likelihood function p(x|z)that provides a stochastic mapping between the latent space and the original data space. As in any generative model, the aim is to learn an approximation of the true underlying distribution of a given dataset, capturing and understanding its generation process. Assuming the observed variable xis a random sample from an unknown underlying process with distribution p(x), as discussed in the previous Section, the VAE probabilistic framework attempts to approximate this unknown process with a model gθ(x), possibly a neural network, parametrized with a vector θ. This is done through a learning procedure that searches for a value of the parameters θsuch that gθ(x)≈p(x).(2.17) In VAEs, we make use of latent variables zin this learning process. As mentioned in the previous Section, these are variables that are considered as part of the model, but are not observable (i.e. not part of the dataset). Therefore, our graphical model would then represent a joint distribution p(x, z)over both observable variables xand latent variables z. Nonetheless, the ultimate goal, as a generative model, remains to approximate the marginal, p(x) = Zp(x, z)dz. (2.18) In the case of latent variable models, the evidence p(x)is often called marginal likelihood. Typically, it is desired that the approximation gθ(x)is sufficiently flexible 18
to fit the data, producing accurate models. That said, VAEs introduce deep neural networks to parametrize the distributions of the generative model. It is important to note that the high representational power of deep neural networks allows the approximation gθ(x)to be very complex. It was also observed in the previous Section that, in complex and high-dimensional data spaces, the marginal likelihood, p(x) = Rp(x, z)dz, does not have an analytical solution or efficient estimator, as p(x)is usually intractable. Additionally, since the marginal likelihood is related to the posterior p(z|x)by the Bayes theorem, the posterior is also intractable. Variational autoencoders turn the intractable posterior inference and learning problems into a new problem that is indeed tractable, using variational inference to approximate the true posterior p(z|x)with a parametric model qφ(z|x), referred to as an encoder or recognition model, and parametrized with deep neural networks. (Observe that, unlike in the previous Section, we will pose qφas conditioned on the observations x). For this reason, φbecomes the variational parameters that we optimize over, and therefore qφ(z|x)≈p(z|x). An insightful interpretation of the architecture of variational autoencoders is presented in a tutorial by Carl Doersch [51]. If we were to estimate the likelihood of a single data point x, this is, p(x) = Rp(x, z)dz, we would have to sample an intractable number of latent points z. However, in practice, for most zthe likelihood p(x|z)will be near zero, and hence contribute little to the estimate of p(x). The key idea behind VAEs is to attempt to sample values of zthat are likely to have produced x, and compute the approximation gθ(x)just from those. The estimation of the relevant points zcomes from qφ(z|x), the variational approximation to the posterior [51]. In VAEs, it turns out that the optimization of the variational approximation of the posterior (this is, recognition model) results also in an optimization of the marginal likelihood. This is the final goal of a latent-variable generative model. Similar to other variational inference methods, the objective function of variational autoencoders is the evidence lower bound (ELBO). In Section 2.3, we already studied the derivation of the ELBO in the same formulation as it is also presented by the authors of the variational autoencoder [50]. This is, ELBO(φ) = Ez∼qφhlog p(x, z)−log qφ(z|x)i.(2.19) In the case of variational autoencoders, the log joint distribution is also parametrized —this is, by using a parametrized version of the posterior predictive, in the decoder module—, such as p(x, z)≈gθ(x, z), where gθ(x, z) = gθ(x|z)gθ(x), and where it also holds that gθ(z) = Rgθ(x, z)dx. Furthermore, the ELBO is often presented in a different manner by rearranging its terms, in order to resemble an autoencoder objective function, which for this case can be rewritten as in Equation 2.15, ELBO(φ, θ) = Ez∼qφhlog gθ(x|z)i | {z } Negative reconstr. error −DKL qφ(z|x) gθ(z) | {z } Regularization term .(2.20) 19
Notice that, similarly to sparse and denoising autoencoders, a regularization term accompanies the reconstruction error in the objective function. However, unlike other autoencoders, in VAEs this regularization is intrinsic to the model and does not require setting any hyper-parameter [51]. As mentioned in the previous Section, this quantity is a lower bound of the marginal log-likelihood. With this in mind, it is interesting to study the significance for VAEs of the KL- divergence that is optimized in variational inference in general, which was stated in Equation 2.12, and can be restated with the new notation as, DKL qφ(z|x) gθ(z|x)= log gθ(x)−ELBO(φ, θ).(2.21) We note that the KL-divergence of the variational approximation from the true posterior represents the tightness of the approximation: it is the difference between the marginal log-likelihood and the evidence lower bound. So a decrease in the KL-divergence results in a better approximation of the marginal likelihood, and the maximization of the ELBO with respect to parameters φand θimproves the approximation of the posterior. In variational autoencoders, using the ELBO as the objective function allows a joint optimization of both the parameters φand θusing stochastic gradient descent. This is, optimizing the variational approximation qφ(z|x)of the true posterior p(z|x), and the neural-network approximation gθ(x)of the true prior predictive p(x). Therefore, for a dataset with i.i.d samples, the variational lower bound objective for the entire dataset is the sum of the sample-wise individual bounds, ELBOD(φ, θ) = X x∈D Ez∼qφhlog gθ(x|z)i−DKL qφ(z|x) gθ(z)!.(2.22) The sample-wise gradient ∇φ,θ ELBO(φ, θ)may also be intractable, as we have already discussed. For this reason, the authors propose an unbiased estimator ˜ ∇φ,θ ELBO(φ, θ)which allows stochastic optimization. The gradient of the ELBO with respect to the neural model parameters θis straightforward, since the sampling distribution for the expectation is not dependant on θ, ∇θELBO(φ, θ) = ∇θEz∼qφhlog gθ(x, z)−log qφ(z|x)i =Ez∼qφh∇θlog gθ(x, z)−log qφ(z|x)i =Ez∼qφh∇θlog gθ(x, z)i. (2.23) Using a Monte Carlo estimate for this expectation, we obtain the following estimator, ˜ ∇θELBO(φ, θ) = 1 S S X i=1 ∇θlog gθ(x, zi) with zi∼qφ(z|x), (2.24) 20
Figure 2.2: Representation of the meta-reinforcement learning problem, with the base learner acting on a particular task, and the meta-learner acting on a distribution of tasks. In this case, both the inner and outer learning loops use gradient-based optimization for their respective parametrization, θand η. Figure adapted from Matthew Botvinick et al. [72]. During the meta-training stage, the meta-learner has visibility over the identity of the meta-training tasks. It subjects the base learner to several episodes of conventional reinforcement learning for each meta-training task, and should optimize the meta-parameters η. Once this process is finished, during meta-testing (also known as the adaptation phase) the algorithm has no visibility of the identity of the tasks, and therefore needs to exploit the knowledge obtained in the previous phase. For this, it should use the optimized value of ηto help the base learner to learn the parameters θfaster or more proficiently. The need for a good exploration strategy during meta-testing is a critical difference between meta-reinforcement and meta-supervised learning. On one hand, in metalearning algorithms for a supervised problem, such as image classification or object detection, the meta-learner has no control over the data employed to obtain the parameters θat meta-test time. It uses ηand the predetermined dataset given by the meta-test task to synthesize the base learner’s parameters. On the other hand, meta-reinforcement learning algorithms need to learn during meta-training a good strategy to use during meta-test time such that the adaptation to the new task is done using as few interactions with the environment as possible. As in the supervised case, different approaches to meta-RL have been explored by the research community. Yan Duan et al. [73] propose RL2, an algorithm that uses a recurrent neural network to encode the weights θof the base learner, while the meta-learner optimizes the weights ηof the RNN. Simultaneously, Jane X. Wang and colleagues [74] published a similar proposal where they test several configurations of recurrent architectures combined with different actor-critic algorithms. Another meta-RL method is MAML [65] adjusted for reinforcement learning task distributions. The model-agnostic meta-learning algorithm inspired many other methods, such as E-MAML [75], ProMP [63], and MACAW [76]. In the next Chapter we explore some of these methods in further detail. A different family of techniques for meta-reinforcement learning combine strong policies with meta-learned latent representations of the environment. These are often 27
obtained with objective functions derived from variational inference. Although we will study some of these methods in the next Chapter, we present here their main highlights. One example is MAESN [77], which extends MAML to meta-learn a latent space of exploration strategies, such that the agent can explore in a timecoherent way during meta-test time. Other methods incorporate variational inference driven by the view of reinforcement learning as probabilistic inference [38], discussed in Section 2.2. In the context of meta-reinforcement learning, the problem can be framed as task inference in a POMDP where the specification of the current task is not observed by the agent. This idea was formalized by Jan Humplik et al. [78], who devise an algorithm that includes a network for estimating belief over the current tasks. A similar perspective of meta-reinforcement learning is presented by Luisa Zintgraf et al. [79], who devise a method called VariBAD and formalize the problem as a Bayes-adaptive Markov decision process, where the agent maintains a belief distribution over possible tasks. PEARL [1] is a related algorithm, presented by Kate Rakelly and colleagues. They use powerful off-policy reinforcement learning to improve sample-efficiency during meta-training, as well as improving the exploration strategy. MELD [80] is a similar meta-RL method, which is capable to learn from raw images. While some of these meta-reinforcement learning algorithms have been tested in real-world applications such as robots [80], most of the research literature reviewed for this work experiment with their meta-RL methods using simulation. Typically, the distribution of tasks p(T)is represented by a parametrized task-template, where setting particular values for the parameters instantiates a valid task. Consequently, sampling from the parameter space is equivalent to sampling from the task space defined by the template. Examples observed in the research literature for simulated task distributions include bandit problems, mazes, and simple goal-oriented gridworld environments. Chelsea Finn et al. [65] developed a suite of task distributions based on popular continuous control environments from OpenAI Gym [81], which are simulated with the state-of-the-art physics engine MuJoCo [82]. For each continuous control environment, they parametrize the reward function Rand sample values for this parametrization in order to obtain different tasks. Later, so as to explore scenarios where the agent must learn under different environmental dynamics, Kate Rakelly and colleagues [1] expanded this suite by introducing task distributions where the varying element is only the transition function P. Again, they define a parametrization for the dynamics function, and sample from some distribution over this parameter space in order to instantiate a new task. In an effort to obtain a benchmark protocol for meta-RL, which reflect realistic use cases, Tianhe Yu and collaborators [83] present Meta-World. This is a suite of 50 distinct simulated tasks involving robot manipulation objectives, designed such that they represent a distribution of tasks that are sufficiently diverse but still share a good amount of common structure. It is therefore focused on evaluating the degree to which new multi-task and meta-RL methods can generalize and efficiently adapt to genuinely diverse tasks. As mentioned, previous meta-RL experimentation settings [65, 1] define the distribution of tasks p(T)as a task template with simple variability in either P, i.e. 28
parametrizing the dynamics, or in R, this is, parametrizing the goal. The authors of Meta-World argue that these experimental scenarios are not diverse enough, and thus propose to use 50 markedly different tasks, each of which allows narrow parametric variation—only in the reward function R. Furthermore, the authors define an evaluation protocol based in Meta-World, with several levels of complexity. The simplest one for meta-RL, named ML1, includes using only one of the parametrized tasks and sampling both meta-training and meta-test sets by simply instantiating particular cases of the reward function. This is similar to some of the experimentation cases used in previous work [65, 1]. For pure multi-task evaluations (where no meta-RL procedure is used, i.e. no heldout meta-test set) they propose MT10 and MT50, either 10 or the whole 50 tasks, respectively, are used to train and test the agent. In this case, one reward function is instantiated for each base tasks —this is, no parametric variability within each base task. Also, since this involves a multi-task experiment with no intention to evaluate generalization to new tasks, the ID of each task is provided. Finally, for complex meta-RL evaluation, they define ML10 and ML45, where either 10 or 45 base tasks are used to define the distribution of meta-training tasks from which to sample in the meta-learning experiment. In both cases, 5 base tasks are held-out, from which to sample in order to obtain the meta-test set. The authors use ML1, ML10, and ML45 to evaluate and compare three meta-RL algorithms: RL2[73], MAML [65], and PEARL [1]. They found that RL2and MAML perform better on the simpler settings, ML1 and ML10, than on complex experiments such as ML45. On the other hand, PEARL achieves a good result (65% success rate in meta-test tasks) in ML45, but poor performance in both ML1 and ML10. In conclusion, the authors argue that these three meta-RL algorithms still struggle to generalize well to new tasks, when the task distribution involves noticeable diversity, and they suggest that this issue may be related to difficulties intrinsic to the multi-task nature of the meta-RL experiment and that this should be addressed in future work. 29
3|Literature Review In this Chapter, we analyze a selection of relevant research literature, including a detailed review of the state-of-the-art in meta-reinforcement learning methods based on deep learning techniques and variational inference. We first provide, in Section 3.1, a brief introduction to standard reinforcement learning algorithms that are relevant for analysis and experimentation presented later in this dissertation. Then, we summarize the most important meta-reinforcement learning algorithms in Section 3.2. 3.1 Methods for Standard Reinforcement Learning Before approaching meta-learning methods for reinforcement learning, we will first explore three methods that are related to the main focus of this dissertation and which play an important role in the next Chapters. We include SAC [37], which is a state-of-the-art method for continuous, off-policy reinforcement learning. This method is a central component of some of the meta- RL algorithms that we review later, and it will be used for experimentation as well. We then present UNREAL [84] and DIAYN [85], which although not conceived as meta-reinforcement learning methods, they have a very strong relationship to the concepts we discussed in Section 2.6. 3.1.1 SAC Tuomas Haarnoja and colleagues [37] propose an actor-critic agent called soft actorcritic (SAC). This method combines sample-efficient off-policy learning together with a stochastic policy π(a|s), modeled as a posterior distribution over actions given the current state. When compared with previous state-of-the-art off-policy agents, SAC obtains better convergence properties and robustness to choices of the hyper-parameters, since it is optimized by the maximum entropy objective [38]. This objective attaches a new regularization term to the traditional expected, adding αH(π(·|s)), i.e. the entropy of the policy modulated by the temperature α. As observed by the authors of this method, the maximum entropy formulation employed to design SAC allows for a built-in exploration strategy [86], as it encourages the policy to be stochastic. 30
The authors derive a maximum entropy variant of the policy iteration algorithm mentioned in Section 2.1, which learns the optimal policy by alternating between policy evaluation and policy improvement steps. In the policy evaluation steps, the current policy πis used to compute an approximate of its value function, not necessarily until convergence. Then, during the policy improvement step, the approximated value function is used to obtain an improved policy. For the maximum entropy variant of this method, which the authors refer to as soft policy iteration, the maximizing objective is not the standard sum of rewards, but rather an augmented objective such that stochasticity is encouraged in the obtained policy. They use a modified version of the Bellman backup operator to perform the softened version of policy evaluation, and then project the improved policy into a tractable family of policies by minimizing the Kullback-Leibler divergence. The paper provides proof that this procedure obtains the optimal policy (within the family), but it can be applied only in the tabular case. Considering continuous domains, function approximators for the value function are used, and it is also the case that performing policy evaluation and policy improvement steps until convergence is intractable. Therefore, they propose an approximation to the method —the main contribution of the paper—, which they call Soft Actor-Critic (SAC). In this case, SAC uses neural networks as function approximators for both the parametric policy πθ(a|s)and the action-value function Qϕ(s, a), learning their parameter sets by θand ϕusing gradient descent optimization. Additionally, it uses an extra neural approximator for the state-value function Vψ(s), which improves the stability of the training process and can be easily updated within the scheme (and so, training this extra network, does not require much additional effort). The training objective for the state-value function is, LV(ψ) = Est∼B 1 2Vψ(st)−Eat∼πθQϕ(st, at)−log πθ(at|st)2.(3.1) Where stis sampled from an experience replay buffer B, and the evaluation of πθ for a specific action given streturns the action’s probability. The authors note that the gradient of this objective can be estimated with, ˆ ∇ψLV(ψ) = ∇ψVψ(st)Vψ(st)−Qϕ(st, a) + log πθ(a|st),(3.2) which is an unbiased estimator. The actions a, in this estimator, are sampled according to the current policy, and not from the replay buffer. For the action-value function, they train two independent networks (instead of just one), with parameters ϕ1and ϕ2. This technique, called known as clipped Double Q-learning, attempts to mitigate positive bias in the policy improvement step, as explained in a previous work by Scott Fujimoto et al. [87]. Both sets of parameters ϕ1and ϕ2are trained in the same way. The proposed training objective is, LQ(ϕ) = E(st,at)∼B 1 2Qϕ(st, at)−r(st, at)−γEst+1∼ρV¯ ψ(st+1)2.(3.3) As in previous deep reinforcement learning methods, a target state-value network V¯ ψis used to compute the loss of the Q-networks, where the parameters ¯ ψcan be 31
obtained as an exponential moving average of the original parameters ψ, or rather stay freeze most of the time and updated periodically. This is also intended to improve training stability. The estimator proposed by the authors in this case is, ˆ ∇ϕLQ(ϕ) = ∇ϕQϕ(st, at)r(st, at)−Qϕ(s, a) + γ V ¯ ψ(st+1).(3.4) For the policy parameters, as in the case of the soft policy improvement step, they use an objective function defined as the expected Kullback-Leibler divergence between the policy and the normalized exponential of the state-value function, Lπ(θ) = Est∼B DKL πθ(·|st) exp (Qϕ(st,·)) Zϕ(st).(3.5) To obtain a low-variance estimator of the gradient ∇Lπ(θ), they reparametrize the policy, performing a maneuver similar to the reparameterization trick in VAEs described in Section 2.4. Here, the current state stis appended to a noise vector t sampled from a fixed distribution, and this is used as the input of the network πθ to compute the sampled action, at=fθ(st, t). As the authors show in the paper, the gradient can then be approximated by, ˆ ∇θLπ(θ) = ∇θlog πθ(at|st) + ∇atlog πθ(at|st)− ∇atQϕ(st, at)∇θfθ(st, t).(3.6) The action atis evaluated at fθ(st, t). The minimum of the two action-value function approximators is used in the computation of the estimated gradients ˆ ∇ψLV(ψ) and ˆ ∇θLπ(θ). SAC, therefore, alternates between collecting experience from the environment and updating the parameters ψ,ϕ1,ϕ2, and θusing gradient descent, and the parameters ¯ ψwith the exponential moving average, ¯ ψ=τ ψ + (1 −τ)¯ ψ. Experimentation in this work compare SAC with other deep reinforcement learning algorithms: DDPG [88], PPO [36], and TD3 [87]. They show that SAC is comparable to the baseline methods in easy tasks, while it obtains better sample-efficiency and asymptotic performance in the difficult tasks. Also, the stochastic nature of SAC combined with the maximum entropy objective proves to be a strong factor for stability: in comparison, a deterministic version of the same algorithm shows much more variability between initialization random seeds. They also use some of the experiments to show the sensitivity of the algorithm to two important hyperparameters: the reward scale, which absorbs the temperature parameter in the maximum entropy objective, is, therefore, a way to control stochasticity, where high values induce deterministic policy behaviour and low values stochastic behaviour; and the smoothing constant τfor the exponential moving average of the parameters ¯ ψof target network V¯ ψ, where large values turn SAC unstable, and low values slow the training process. A follow-up paper by Tuomas Haarnoja et al. [89] present a variant of SAC where the temperature parameter αis learned, instead of being set as a hyperparameter (via the reward scale). The temperature loss, which uses a new hyperparameter ¯ H representing the target entropy, is computed as 32
Ltemp(α) = Est∼B at∼πθ(·|st)h−αlog πθ(at|st)−α¯ Hi.(3.7) The authors propose an heuristic to set the value of this hyperparameter as the negative of the dimensionality of the action space, ¯ H=−dim(A). They also replace the state-value function Vψwith an implicit parametrization via the Q-functions. To avoid a moving target problem, they use a copy of both Q-functions with their parameters ¯ϕiupdated using rolling average. Therefore, the loss LQ(ϕi)for the original Q-function parameters take the form, LQ(ϕ) = E(st,at,rt)∼B 1 2Qϕ(st, at)−rt+γEst+1∼ρκ2.(3.8) Here κrepresents Q¯ϕ(st+1, at+1)−αlog πθ(at+1|st+1), instead of being V¯ φas in the original formulation of the algorithm. For calculating Q¯ϕ(st+1, at+1), the authors use clipped Double Q-learning, so the value is computed as the minimum action-value between the moving-average parameters ¯ϕ1and ¯ϕ2. The action involved in this term is sampled from the policy, at+1 ∼πθ(·|st+1). 3.1.2 UNREAL Max Jaderberg and colleagues [84] introduce a representation learning technique called UNREAL, which augments a base deep reinforcement learning agent, allowing both better data-efficiency and asymptotic performance. This method uses selfsupervised auxiliary tasks during training, in addition to the objective function of the base learner, to make more efficient use of the information provided by the environment during interaction. In their experimentation, they use A3C [34] as base agent, but the configuration is applicable to any actor-critic architecture. They are motivated by the fact that, for environments and tasks with very sparse reward signals, traditional reinforcement learning methods combined with deep function approximators are not using the available information in the most efficient way: rewards signals, which are rarely observed, lead to high-variance or biased estimates that are used to update the function approximator parameters (millions in the case of deep networks). This, combined with small gradient steps taken by the optimizer, leads to very data-inefficient and unstable learning. The deep neural architecture used for UNREAL includes a feature extractor fφ, which converts the raw image observations into lower-dimensional representations. This network does not only fed the base agent, but rather it outputs to many different heads, which are trained with different loss functions. Because of this, the heads represent auxiliary tasks. Although the actor πθis the only source for sampling actions that are actually used to interact with the environment, the auxiliary tasks do propagate gradients into the feature extractor parameters φ, and therefore shape the representations, improving the performance of the base agent as well. This means that, although many different distributions are learnt at the same time (the base policy and the auxiliary tasks), only the base policy is used to act into the environment, while the auxiliary tasks just help to learn good representations. 33
The auxiliary tasks used for feature learning, which can be modeled as conditional distributions over the state, and therefore resemble a policy, are trained using an off-policy objective. They use data stored in a replay buffer, similar to the training loop of traditional actor-critic algorithms. Three different kinds of auxiliary tasks are defined by the authors: auxiliary control tasks, auxiliary reward prediction tasks, and auxiliary replayed value function tasks. In the first case, they intend to learn auxiliary policies that can control different aspects of the environment, which may hopefully shape representations of the input observations in such a way that the base policy is improved more efficiently. For auxiliary control tasks, they propose two types: pixel control, in which the objective is to maximize change in the pixel intensity in particular regions of the agent’s observed visual input during the next timestep; and feature control, in which the activation signal of different hidden layers of the agent’s neural network are used themselves as reward signal, and so these auxiliary policies learn to maximize activity in such layers. In their experiments, the authors note that pixel control had a stronger effect in performance. These auxiliary policies are trained using n-step Q-learning, and are implemented efficiently using a deconvolution head on top of the function approximator network. Regarding the auxiliary reward prediction task, it basically trains a classifier that predicts whether or not in the next timestep it will get a reward. In consequence, the experience replayed for this objective is intentionally biased in order to provide as many non-zero reward experiences as those with zero-reward. This skewed sampling scheme is important, in particular, for sparse-reward environments. Finally, the auxiliary replayed value function tasks help for faster training of the base critic (the value function head used by the base algorithm, which is A3C in the original paper). They perform additional value function regression, besides the usual on-policy value function learning from the original A3C algorithm. Improving the critic allows for better estimates for the loss function used to optimize the base policy (actor). In particular, they aim to better predict long-term reward in sparse environments. The loss term for each component —the base actor-critic, and each of the auxiliary tasks— is computed independently, and manually-tuned weighting terms are used to balance the overall loss, which determines the impact that each component has on the shared representations. In their implementation, they use on-policy training to minimize the original A3C loss, and off-policy training (with experience from the replay buffer, either randomly sampled or with the aforementioned non-zero reward bias) for the auxiliary terms. 3.1.3 DIAYN A work by Benjamin Eysenbach and colleagues [85] propose an alternative technique to learn from the environment in a self-supervised way, which they name Diversity is All You Need (DIAYN). Motivated by problems in which the reward function is decisively sparse, they define the problem setting as divided into two phases. Initially, the agent interacts with the environment without receiving any kind of extrinsic reward signal. This represents an unsupervised reinforcement learning environment, 34
which can be interpreted as the limit of sparsity. Here, during this unsupervised exploration stage, the agent should efficiently extract useful information that will later be leveraged during the second (exploitation) phase, in which the reward function is now active, and the typical reinforcement learning problem definition is considered. The method uses a parametrized policy that is not only conditioned on the current state, but also on a latent variable Z. In this way, the latent variable affects the distribution of states visited by the agent. The authors call skill to a given policy π(a|s, z)conditioned on a value of Z: diverse values zgive rise to divergent skills. The latent variable zis inferred in such a way that their dependence on the states is maximized, and their conditional independence of actions taken by the agent given states are minimized. To do this, they include the corresponding mutual information terms in their objective function. Furthermore, the set of skills that are learnt during the unsupervised exploration stage should be maximally diverse: for this, they maximize the entropy of the prior over Z. They use a variational approximation qφ(z|s)to infer zgiven a state s, which is optimized using a variational lower bound that the authors derive from the objective, similar to the steps that were presented in Section 2.3. Although DIAYN was conceived as a standard (non-meta) reinforcement learning algorithm, in a multi-task, meta-learning setting it could be understood as doing meta-training during the unsupervised exploration phase. In this way, a metalearner optimizes the policy πand the inference network qφ(z|s)for the given environment. During meta-test, the reward signals are enabled for different tasks (different reward functions) in the same environment, and the policy adapts by both altering the weights in the policy πand leveraging the knowledge captured by the inference network qφwhich samples zgiven the distribution of states visited in the meta-test task. 3.2 Methods for Meta-Reinforcement Learning This Section presents several meta-reinforcement learning algorithms, as a manner of survey, including the state-of-the-art in the field. The methods are presented in chronological order, so as to facilitate their analysis: in many cases, the follow-up paper for one of the algorithms presents an analysis of its predecessor and propose a new one. We first describe black-box meta-RL methods, which are based on recurrent neural networks. Then, we present a group of optimization-based algorithms that use policy gradient in both the inner and outer learning loops. Finally, we study a family of methods that build upon the framework of reinforcement learning as inference, and rely strongly on variational inference. This last family includes PEARL [1], the algorithm on which we base our experimentation. 3.2.1 RL2 An example of black-box meta-reinforcement learning is the RL2algorithm, published by Yan Duan et al. [73]. They cast the learning process of the base agent as 35
the objective of a reinforcement learning procedure itself. They use GRU [90], a popular recurrent neural network architecture, to model the base learner algorithm and the agent. Meta-learning, which shapes the parameters of the network, is performed with policy gradient, the on-policy reinforcement learning procedure presented in Section 2.1, across episodes of interaction with the tasks in the meta-training set. During meta-training, the GRU is presented to each task and interacts with its environment during a fixed number of episodes before turning to the next task. In this way, the agent interacts with the tasks in the meta-training to shape the weights of the recurrent network. While the internal state of the GRU is kept within episodes for the same task, it is reset when a new meta-training task is sampled. For each task, at time step tthe recurrent network was already fed the extended, inter-episode trajectory τ1:t−1up to time step t−1. This means that the GRU has processed the past transition tuples for all the episodes in the current task. In order to replicate a reinforcement learning algorithm, the input to this network needs to be augmented with the episode termination flag. The hidden state of the GRU and its input —the transition tuple observed at time step tand the termination flag— are combined to compute the output of the recurrent unit, which is then fed into a multi-layer perceptron [47], and finally to a softmax layer [11] to compute the probabilities for each action, i.e. the output of the policy. As commented by the authors, this scheme supply the GRU with the same input information as that used by standard reinforcement learning methods. Although the final output of the architecture is the output of the policy, the interaction between the new transition tuple and the hidden state of the recurrent unit acts as the base learner algorithm. Unlike Andrychowicz et al. [66] and other optimization-based methods, RL2does not maintain a parametrized base-learner policy: the optimization involved in the meta-learning component of RL2does not update the parameters of the base-learner. In this case, θis implicitly encoded in the activations of the recurrent network while exposed to the sequence of transitions in the environment. RL2is similar instead to the meta-supervised learning method proposed by Hochreiter and colleagues [67], described in the previous Chapter. The particular value of the weights of the GRU instantiate a base learner algorithm and, when fed a trajectory τ, they give rise to a policy. Using the nomenclature of Section 2.5, we can observe that the recurrent network weights are therefore the meta-parameters η. These are trained using TRPO [35] during meta-training, and held fixed during meta-testing. The meta-objective is to maximize the expected total discounted reward across all the episodes of a single task. As a result of concurrent research work, Jane X. Wang et al. [74] published a similar algorithm named deep meta-RL. In this case, they use LSTM [91], an alternative recurrent neural network architecture, and they explore various architecture designs, including a state encoder before the recurrent unit and employing a stacked (multi-layer) LSTM. Instead of TRPO, in this case the authors use A3C [34] and its synchronous version, A2C. They also focus on a different family of task distributions during experimentation: while RL2explores mainly unstructured task distributions, Wang and colleagues experiment with distributions of tasks that share a significant amount of common structure. 36
comparisons with RL2[73], MAML [65], ProMP [63], and MAESN [77], as well as improving the asymptotic performance. The experiments involved meta-learning procedures using MuJoCo [82] continuous control environments as templates for the task distribution. They provide results for both goal-oriented settings, where only the reward function Rvaries across tasks, and also task distributions where only the dynamics Pis variant. 3.2.6 VariBAD Luisa Zintgraf and colleagues [79] from University of Oxford and other institutions propose a related approach, which they call variational Bayes-adaptive deep RL, abbreviated as VariBAD. As in the case of PEARL, the design of VariBAD consists of an inference network qω(z|c)that learns a stochastic latent variable Zrepresenting the agent’s belief about the current environment given the history of observations, i.e. the context c, and a policy πθthat is conditioned on both the current state and the posterior belief about the environment. But in this case, the policy is not conditioned on a sample from the variational posterior, but conditioned on the posterior distribution itself: πθ(a|s, qω(·|c)). This enables what the paper refers to as a Bayes-optimal policy, which is aware of the uncertainty about the current task, leading to better meta-test time exploration when compared to posterior sampling. VariBAD use a variational autoencoder [49], as presented in Section 2.4, to infer the posterior distribution over tasks. The encoder module of the VAE is used as the distribution qω(z|c)from which to sample the latent variable z. The decoder module is used as a model Γφof the environment, representing the dynamics υ and the reward function Rof the task. The model Γφis devised to reconstruct a transition ct= (st, at, rt, st+1)given the latent variable z, and is conceived as two separate neural networks. Te first network ΓR φreconstructs the reward rtgiven the rest of the elements of the transition, st,at, and st+1, as well as the latent variable z. The second network ΓT φreconstructs the transition, as it approximates the next state st+1 given z, the previous state st, and the action at. The policy πθis meta-trained with PPO [36], and the maximization objective Jπfor the parameters of the policy is therefore similar to those from the policy gradient meta-RL methods studied before. As the authors of this method mention in their paper, the on-policy nature of this implementation of VariBAD does not allow for a sample-efficient meta-training, when compared with off-policy PEARL. In consequence, Zintgraf and colleagues suggest the instrumentation of an off-policy version of their algorithm as an interesting line of future work. Another important difference with PEARL is that, in VariBAD, the encoder qωis modeled as a recurrent neural network, and so it is not permutation-invariant with respect to the transitions in the context. In this regard, the authors also mention the possibility of implementing an alternative encoder, using Gaussian factors as in PEARL or using conditional neural processes [70]. The maximization objective used to train the encoder and decoder components of the VAE is derived by Zintgraf and colleagues in their paper. This objective is a variational lower bound of the intractable marginal likelihood of the model Γφ(c) predicting the observed trajectories in the context c, and it represents an ELBO 43
similar to that of the original formulation of variational autoencoders. For VariBAD, the formulation is policy-dependent, but this is not a problem since VariBAD uses on-policy learning and, for every optimization iterate, the policy parameters θare fixed, as so is the probability distribution of contexts sampled by πθinteracting in the current task. Then, the ELBO as a function of the encoder and decoder parameters, ωand φ, is ELBO(ω, φ) = Ec∼πθ"Ez∼qφ(·|c)hlog Γφ(c|z)i#−DKL qω(· |c) p(z),(3.13) where Ez∼qφ[log Γφ(c|z)] is the expected reconstruction loss of the context cafter being used for sampling a latent value z∼qω(·|c)and recovered with the model Γφconditioned on this latent value. While in PEARL the encoder is optimized to help recovering the action-value function, the policy gradient reinforcement learning method used for meta-training in VariBAD does not use a Q-function. Because of this, the evidence lower bound in Equation 3.13 makes the encoder qωto be optimized such that the resulting posterior distribution qω(z|c)helps the environment model components ΓR φand ΓT φto reconstruct the reward function and dynamics as observed in the context c. The variational autoencoder used to encode and decode the latent variable zin VariBAD is only learned during meta-training, where the complete trajectories c are available. For this reason, both the past and the future of the agent’s experience at each time-step tare available. Consequently, both the past and present context is considered for training qωand Γφ. For this, they derive an expression for the variational lower bound that depends on the context length, ELBOt(ω, φ), representing the reconstruction when encoding only the transitions of the first ttimes steps are available, but decoding the complete context. Since the policy πθ(a|s, qω(·|c)) is parametrized by θbut dependent on the encoder parameters ω, the policy gradient objective Jπ(θ, ω)is also a function of these two sets of parameters. The meta-parameters of VariBAD, η= (θ, ω, φ)is then optimized using the following maximization objective, J(θ, ω, φ) = ET ∼p(T)"Jπ(θ, ω) + N X t=0 ELBOt(ω, φ)#,(3.14) where the ELBO is considered for all possible context lengths, although in their implementation they propose to sample a fixed number of terms in this case. The paper does also mention that, in their implementation, they avoid propagating the gradient of the policy objective, ∇Jπ(θ, ω), through the encoder. During meta-testing, the decoder Γφis discarded and the optimal values for the parameters θand ω, as found during meta-training, are used, which stay fixed during the complete adaptation stage. As in the case of PEARL, no gradient update is performed during meta-test time, as this method was also designed with the framework of meta-RL as task inference. 44
The experiments show that VariBAD has better meta-test efficiency —this is, faster adaptation to unobserved environments— in complex continuous control tasks when compared to RL2[73], PEARL [1], ProMP [63], and E-MAML [75]. This means that the algorithm presented by Zintgraf and colleagues shows an excellent sampleefficiency during adaptation (at meta-test time). On the other hand, during metatraining, PEARL shows much better sample efficiency, arguably because of its offpolicy nature. PEARL is also reported to have better asymptotic performance since it is based on SAC, which outperforms PPO, used to train the policy in VariBAD. An interesting work by Ron Dorfman et al. [95] from Technion Israel analyzes and extends VariBAD. The method presented, called Bayesian offline reinforcement learning (BOReL), is designed to enable the meta-learning agent to use offline experience to synthesize a policy. The meta-training experience is assumed to be collected using arbitrary agents interacting with tasks Tdrawn from a distribution p(T). After this, off-policy algorithms are applied to learn a policy that can succeed in a new environment drawn from the same distribution. As in the previous works they assume that all the Markov decision processes involved in the experimentation share the same state and action spaces. The authors note that, while on-policy algorithms that use policy gradient updates can directly optimize a partially observable MDP (POMDP), using off-policy learning requires a strictly Markov environment. They, therefore, show that the Bayesadaptive MDP (BAMDP) approach used by Zintgraf and colleagues guarantees convergence for the off-policy case, as it concatenates the Markovian state swith the belief over the environment, the random variable Z, represented as the posterior qφ(z|c). This allows them to obtain an augmented state s+= (s, Z), and to use offpolicy algorithms such as SAC for meta-training over a set of previously collected, offline experience trajectories in tasks sampled from the distribution p(T). An interesting remark presented in this work is that, in the offline meta-RL setting, it is possible (and even likely) that the agents used to collect data in the first place will visit states of high-reward for the current environment. The meta-training set is then the result of gathering such trajectories from different environments. This rise a serious problem: considering two different tasks Tiand Tj, the experience produced by both of them combined is indistinguishable from the experience produced by a third task Tkwhere the reward function RTkis the sum the reward functions from Ti and Tj. This issue is referred to as the Markov decision process ambiguity problem, and the authors note that it only rises when both offline learning and meta-learning are combined in an RL setting, as otherwise good exploration is itself a solution. Assuming that the reward function is known for each task (a distinct Markov decision process) encountered during offline meta-training, the authors propose a method, called reward relabelling, that helps to solve the ambiguity problem. The set of trajectories collected for the i-th task Tiis augmented using existing, offline trajectories from other tasks j6=i, but replacing their rewards. 3.2.7 MACAW Eric Mitchell and colleagues [76], from Stanford University and UC Berkeley, introduced meta actor-critic with advantage weighting (MACAW), a different algorithm 45
for meta-reinforcement learning. In this work, the authors also put their focus in offline meta-RL, motivated in this case as well by the potential of transferring representations learnt during meta-training in order to improve the performance and efficiency in adaptation during meta-test time. They explain this using the analogy of successful transfer learning in natural language processing and vision. Unlike Dorfman and Tamar [95], the authors of MACAW approach the offline meta-reinforcement learning problem using an optimization-based approach based in MAML [65]. But, instead of depending on the policy gradient inner-loop objective as in the original version of MAML, in MACAW they introduce a new objective that allows off-policy value-based reinforcement learning methods which are necessary for the offline setting, allowing to structure the agent as an actor-critic. This off-policy, value-based, optimization-based meta-RL extends MAML in order to improve sample-efficiency and allows to leverage available offline experience for the meta-training optimization, assuming that this experience was collected in interaction with tasks sampled from a distribution p(T). Furthermore, it improves consistency: given that sufficient experience was observed during meta-training, the adaptation phase in the meta-test task can find a good policy regardless of the dissimilarity between the meta-test and the meta-training tasks. For the inner-loop objective, MACAW uses advantage-weighted regression [96], or AWR, an off-policy method that maximizes the expected improvement of the policy with respect to the meta-training experience, while keeping the new policy close to the observed trajectories, as the authors explain. They use a bootstrap-free objective that allows learning a value function Vψ, the critic, in a supervised manner using the Monte Carlo return from the current state as observed in the offline experience dataset. This allows optimization within typical MAML adaptation steps, which are both computation and memory constrained. For the optimization of the policy πθ, the actor, they use a combined objective with two components: an AWR objective, which weights each action by its advantage, and an auxiliary factor which performs a regression over the advantage. The auxiliary task helps to satisfy the universality condition, as it equips the final objective function with information that is otherwise missing—we refer the reader to the paper by Finn and Levine [97] for a detailed review on the universality condition. For this, the architecture that encodes the policy πθhas two heads: one for the actual policy, and another for computing an approximation of the advantage A(s, a)given the current state and an action. The encoding of the state is shared between both heads. In the outer-loop, a disjoint subset of the offline meta-training experience is used to perform the MAML meta-objective optimization, using the gradient of the aforementioned inner-loop objective functions. It is worth noting that, for the outerloop meta-objective, the policy is only updated using the AWR component of the objective—the auxiliary advantage regression is not used. 3.2.8 MELD The last meta-reinforcement learning algorithm that we are going to review in this Chapter is called meta-RL with latent dynamics [80], or MELD, published by Tony Z. Zhao and colleagues from UC Berkeley. In their analysis, the authors cast the 46
Figure 3.1: Probabilistic graphical model for the multi-task, meta-reinforcement learning problem cast as a partially observable Markov decision process. The information of the current task Tiis included in the unobserved ground-truth state z. This figure, adapted from the original paper of MELD [80], displays the complete set of dependencies only for states ztand zt+1. multi-task, meta-reinforcement learning problem as a unique partially observable Markov decision process, where the ground-truth state sinclude the identity or description of the current task Ti, but the observation oaccessible to the agent does not provide this information. They analyze this view of the problem using a 2-time- slice Bayesian network [39], a type of directed probabilistic graphical models, that includes the actions a, observations o, and rewards ras observed random variables, as well as an unobserved random variable zrepresenting the ground-truth state including the necessary information to identify the task. This graphical model is depicted in Figure 3.1. As in PEARL [1] and VariBAD [79], the architecture of MELD includes an encoder qω(z|c)that provides an approximation of the posterior belief of the agent about the current task, given the contextual experience observed so far, c. But in the case of MELD, the latent value zis not representing just the identity of the task, but also the complete unobserved state s. Articulated with the words of the authors, this produces a meld of both concepts, allowing the application of tools previously devised for general latent state models. As the problem is framed as a POMDP, the policy πθ(a|b)is conditioned on the current observation o—instead of conditioning on the state s— subsumed in the belief of the current ground-truth state (including the task description). The authors learn a latent state model over the hidden variables, Γφ, and aim to optimize the log-likelihood of the evidence —the observed variables otand rt— conditioned on the actions, in the graphical model of Figure 3.1. This is, for a context of length T, the desired objective is max φ ET ∼p(T)"Ec∼πθhlog Γφ(o1:T, r1:T|a1:T−1)i#,(3.15) where o1:Tis the sequence of observations in the context, r1:Tthe respective sequence of rewards, and a1:T−1is the sequence of actions up to time step T−1. Although this 47
objective should in theory enable the computation of the belief of the agent about the unobserved, ground-truth state zusing posterior inference over the model, this approach is intractable. Therefore, they also use variational inference and derive an evidence lower bound on the desired objective form Equation 3.15. The ELBO in this case is, ELBO(ω, φ) = Ez1:T∼qω"T X t=1 log ΓR φ(rt|zt) + log ΓO φ(ot|zt)# −DKL qω(z1|o1, r1) p(z1) − T−1 X t=1 DKL qω(zt+1|ot+1, rt, zt, at) ΓT φ(zt+1|zt, at). (3.16) All the components involved in this variational objective are neural networks that output the parameters µand σof a Gaussian distribution. In the first term, ΓR φ(rt|zt) and ΓO φ(ot|zt)are decoder networks, that recover the reward rtand the observation otgiven a value for the latent variable zt. This, as well as the second term, help to learn representations ztthat favour reconstruction of the observed random variables, where p(z1)is a prior for the encoder network qω(z|o, r). The subsequent terms, where ΓT φ(zt+1|zt, at)represents a dynamics network, force the inference network (the encoder) to be consistent with the dynamics. As in the case of PEARL, Zhao and colleagues use off-policy reinforcement learning for the meta-learning outer loop. They use an architecture from an earlier work, called stochastic latent actor-critic [98], referred to as SLAC, which is a variant of soft actor-critic [37]. In their implementation, they avoid using the state-value function, such as Haarnoja and colleagues [89] propose in their second implementation of the soft actor-critic. Once the inference network qωis trained, it is used to compute the posterior belief, b=qω(· |ot, rt−1, zt−1, at−1), which is the complete Gaussian parametrization of the posterior distribution of the unobserved state ztas inferred from the graphical model. The SAC-related components of MELD, i.e. the policy πθ(at|bt)and the action-value functions Qϕi(bt, at)with parameters ϕ1and ϕ2, are defined in terms of the belief bt, instead of the state zt. The complete set of meta-parameters is therefore η= (θ, ϕ1, ϕ1, ω, φ). During metatraining, the algorithm iterates through the tasks in the meta-training set. For each task Ti, it first collects new experience with the current value of the policy parameters θ, updating the belief bin each time step using the encoder qω, and store the transitions in a per-task buffer Bi. After this, it trains the encoder, decoder, and dynamics networks maximizing the variational lower bound from Equation 3.16, and finally it trains the policy and the critics using the objectives from SAC. Similar to PERAL and VariBAD, the adaptation in MELD consists of updating the belief busing the encoder qωwith the previous belief and the newly observed transition. No gradient updates are performed during meta-test time. 48
4|Research Study Building upon the theoretical background and literature review presented before, this Chapter describes our experimental study of existing algorithms and the definition, evaluation, and analysis of new variants we propose. We decided to use PEARL [1], the meta-reinforcement algorithm presented in Section 3.2.5, as the main method to experiment with. This was motivated by its state-of-the-art results, in terms of both meta-training sample-efficiency and metatest asymptotic performance. While we use the original version of PEARL for most of our experiments, we also contributed new variants of the algorithm that aim to improve the performance in both meta-training and meta-testing stages, which are described in Sections 4.3 and 4.4, respectively. Our objective for the study presented in this Chapter was to provide insight regarding the following research questions: •What is the sensitivity of PEARL to its hyperparameters and network architecture decisions? •How does a variant of PEARL with automatic adjustment for the temperature αcompare against the original version of the algorithm, in terms of sampleefficiency, asymptotic performance, and stability during meta-training? •How does removing the state-value function Vψimpact those metrics? •Can an alternative optimization-based adaptation improve the meta-test time performance of the original inference-based algorithm? In order to provide an answer to the posed questions, we designed a new suite of meta-RL environments, concerned specifically with the case of a task distribution with varying dynamics, and performed a series of experiments with the selected algorithm and its variants. In Section 4.1, we describe the methodology and the environments we used for the investigation. Then, we present a series of experiments to study the original version of PEARL in Section 4.2. Section 4.3 describes a proposed modification of this algorithm with automatic temperature adjustment, aiming to improve the meta-training procedure, and report experimental results that validate our analysis. For this modification, we present two variants to study the effect of removing the state-value function Vψapproximator. Finally, in Section 4.4 we present a new method for adaptation to new tasks focused on improving the sample-efficiency during meta-test time. 49
4.1 Experimental Setting Below we explain the rationale behind the design of our experiments, including the research methodology, software, and hardware. We then provide a comprehensive review of the meta-reinforcement learning environments we used for the experiments. 4.1.1 Methodology and Evaluation Protocol As it is typical in reinforcement learning research, the performance of a method is evaluated by computing statistics from several replications. In our case, we always use five replications throughout our study. Each of these, noted repli, is an independent run using a different seedito control the pseudo-random number generators involved within the software execution. In this way, we are able to estimate the mean and standard deviation for the interesting metrics used for the experimentation, and ensure reproducibility. Each experiment compares the performance of two or more variants, varj, where each variant is defined for this work as the combination of an algorithm, the specification of the neural networks involved, and the values for its hyperparameters. For example, an experiment may compare between different values for one hyperparameter in the same algorithm, and another experiment may compare between different algorithms. In order to allow fair comparison, the set {seedi}5 i=1 of seeds used for the replications of each variant is the same across all variants. This ensures that the results are comparable: for every experiment, the i-th replication replj ifor variant varjwill share the same meta-training and meta-test sets with the i-th replication replk iof any other variant vark,∀k6=j. Sharing the meta-training and meta-test tasks between the replications of different variants is important since, as we will study in Section 4.1.2, different tasks within a task-template may induce a different optimal policy, producing different distributions for the random variable rt. This may in turn prevent different runs to be comparable, as our metrics are based on the reward. Therefore, we designed the experimental setting in order to force the same sampling of tasks for the meta-sets within the i-th replication for each variant. Our study is focused on PEARL. In the executions involving the original version of this algorithm, we use its official implementation by the authors, as found in Kate Rakelly’s GitHub1. The variants of PEARL that were contributed for this work, which we present in Sections 4.3.1, 4.3.2, and 4.4, were implemented as an adaptation of their source code. We also use the standard, single-task version of soft actor-critic (SAC) as an oracle for the tasks in each environment. In this cases, we are experimenting with an adapted version of the implementation by Philip Ball, shared also in GitHub2, which uses the automatic temperature presented in Section 3.1.1 and replaces the statevalue function V(s)by an implicit parametrization with the Q-functions. 1https://github.com/katerakelly/oyster 2https://github.com/fiorenza2/SAC_PyTorch 50
Parameter Value optimizer Adam [99] learning rate (λ)3·10−4 KL-divergence coefficient (β)0.1 discount (γ)0.99 target smoothing coefficient 0.005 target update interval 1 gradient steps 1 reward scale 10 replay buffer size 106 num. hidden layers — for all networks 2 num. hidden units per layer — for qω256 num. hidden units per layer — for πθ,Qϕi,Vψ300 nonlinearity ReLU batch size — for qω64 batch size — for πθ,Qϕi,Vψ256 meta-batch size 16 num. train tasks to collect data per iteration 5 meta-training set size (nm-tr) 40 meta-testing set size (nm-ts) 10 Table 4.1: Default experimental configuration and hyperparameters in PEARL. The implementations of the original version of PEARL, the soft actor-critic agent by Philip Ball, as well as all the variants and extensions we contribute in this work, are developed in Python on top of PyTorch [92]. In Table 4.1, we display values for PEARL hyperparameters that we will consider as default for all the experiments in our study. For variants where we use other values, this will be explicitly mentioned. These values were chosen as default as they are used by Kate Rakelly and colleagues for the experiments that are mostly similar to ours. Regarding the environments used to perform the experiments, we first considered Meta-World [83], the meta-reinforcement learning environment suite described in Section 2.6, and the continuous control environment suite used by Rakelly and colleagues for evaluating PEARL. Although they were both attractive options, we encountered two problems. First, they both require proprietary software that was difficult to install and use with a license in the Barcelona Supercomputing Center. Second, most of the tasks distributions in these suites are goal-oriented, while the aim of our work was to experiment with tasks distributions where the varying factor is the transition function P. For this reason, we implemented a new environment suite that we present as a contribution later in this Section. We distinguish between two kinds of experiments. We call meta-training experiments those in which we compare the performance of meta-reinforcement learning algorithms during their meta-training stage: i.e. while they train the metaparameters η. They involve an algorithm exposed to a set of tasks {Ti}, i.e. the meta-training set. As in most of the research literature on this topic, we study 51
the learning curves using the evaluation return. In the meta-learning scenario, this is defined as the return of the base learner in meta-test tasks as a function of the number of environment performed during meta-training. This metric is usually computed periodically during meta-training, by halting momentarily the training of the meta-parameters η, evaluating the performance on the unseen meta-test tasks, and then continuing meta-training. The visualization does not take into account the environment steps during meta-testing rollouts. A second type is referred to as adaptation experiments, or equivalently, metatesting experiments. Here we evaluate the performance of meta-RL algorithms during adaptation, once the meta-parameters ηare already optimized. They involve an algorithm exposed to only one task Ttest, never seen during meta-training as it is sampled from the meta-testing set. Since this is a single-task scenario (regardless of how the meta-parameters ηwere previously obtained), we use the same reporting methodology as in standard reinforcement learning: we measure the evaluation return Gby periodically halting training (if applicable), exposing the policy πθto a fixed number of evaluation rollouts (episodes), measuring the sum of rewards in each, and computing the average. The visualization does not take into account the environment steps during evaluation rollouts. In both cases, our analysis in the following Sections use the learning curves to compare between the variants in term of sample-efficiency and asymptotic performance. Note that sample-efficiency in meta-training refers to how fast the meta-learner obtain good values for the meta-parameters η, while sample-efficiency in meta-testing (or adaptation) is equivalent to the classic non-meta reinforcement learning scenario. In some experiments, the curves are smoothed with a moving average over a small window in order to allow a clean interpretation of the results, but this will be expressed in the corresponding Sections. Also, besides the evaluation return, in all cases we also log various auxiliary learning measures, such as the loss for all the networks and statistics of the predictions of the value functions and policy, among others. This was crucial for debugging during the development of this work. Most of the experiments were run on the Barcelona Supercomputing Center (BSC), within a cluster based on IBM Power9 processors with GPU NVIDIA V100, using Linux Operating System, InfiniBand communications standard, and Slurm Workload Manager. A small number of experiments were run on a desktop computer with GPU NVIDIA GeForce. No comparison is ever made in this work between replications executed in different hardware. Although we are grateful for the computing resources that were made available for us to develop this research study, we should note that meta-reinforcement learning experiments are computationally-expensive. Furthermore, the practice of research is generally iterative, and the majority of the experiments executed during the early stages of our work only fulfilled the role of informing the design decisions in posterior iterations. Because of this, only the most important experiments we present here involve all the environments in the new suite. Also, for the architecture and hyperparameter exploration, we are only doing a coarse-grained search of values. The wall-clock time limit used for every experiment in the BSC was 48 hours, and therefore, for long experiments in high-dimensional environments such as Ant and Humanoid, we did not train until convergence. 52
Figure 4.5: Meta-training with different values for the reward scale. assigned for variant var3. This value was chosen as the default in our experiments since it was also the default in the original paper by Kate Rakelly et al. [1] when dealing with similar environments. Figure 4.5 presents the results for this experiment. For the cheeta-bullet-grav environment, variants var3and var4show similar performance, the best among the studied variants, suggesting that higher values for the reward scales induce stronger policies. Variant var2, with reward scale 1.0improves until certain level and then stagnates, and var1, with the smallest scale (i.e. the highest temperature) shows similar returns to those obtained by a random agent. Our results for the walker-bullet-rand environment show that var4, with the highest reward scale, performs better (although at early stages of meta-training it seems to learn slower) than the other variants. This is followed by var3, which also increases the adaptation return as meta-training progresses, but it seems to converge to a lower asymptotic value. Moreover, we notice that var4shows less variability between its replications, when compared to var3. The other two variants, with a lower reward scale, do not seem to learn, as they stagnate early in a very low performance level. Lastly, for the ant-bullet-rand environment, the best performance was obtained by the default parameter value (in var3), although it is also the variant with the highest standard deviation across replications. The second best performance is recorded for var4, while both var1and var2show poor results in this case as well. Analysis. Our results suggest that PEARL is also seriously sensitive to the reward scale. Furthermore, we can also observe a trend: the bigger the dimensionality of the action space A, the smaller the optimal reward scale, and therefore the bigger the optimal temperature. It is interesting to observe here that, in the newer version of soft actor-critic by Haarnoja and colleagues [89], where the temperature (proportionally inverse to the reward scale) is adjusted automatically, they propose as an heuristic to set the target entropy as ¯ H=−dim(A). Taking into account the role that ¯ Hhas in the temperature loss Ltemp(α)shown in Equation 3.7, with high-dimensional action spaces the target entropy ¯ Hwill be smaller according to the aforementioned heuristics. This produces the loss Ltemp(α)to decrease independently of the temperature α, relieving pressure for this parameter to decrease. 59
Figure 4.6: Meta-training with different network sizes for the encoder qω. Based on this analysis, we conclude that it is reasonable that smaller reward scales perform better in environments with higher dimensionality of the action space. It is interesting also to notice that, as PEARL was built on top of the first version of SAC, without automatic temperature tuning, the value for this hyperparameter is not adaptive, and learning the temperature as another meta-parameter using the method by Haarnoja and colleagues may help the performance of the meta-learner. 4.2.2 Sensitivity to the Network Architecture We now present a different set of experiments, where we explore the sensitivity of PEARL to architectural decisions for the neural networks within the method. This includes the encoder qωas well as the networks related to the soft actorcritic component, i.e. πθ,Qϕ1,Qϕ2, and Vψ. We are interested in determining the relationship between the function approximation capacity of these neural networks and the generalization performance of PEARL to new tasks. Experiment III. Regarding the architecture of the encoder, qω, we compare four variants: for variant var1we use a multi-layer perceptron (MLP) with 3layers and 100 units each as the encoder, for var2we use a 3-layer 200-unit MLP, for var3a 3-layer 400-unit MLP, and for for var4a5-layer 200-unit MLP. The default value, as used in other experiments, corresponds to var2in this case. The results for this experiment are presented in Figure 4.6, which we explain below. No significant differences are observed between the variants for the environments with robots Cheetah and Ant, as the performance in every case, when aggregating the result for different replications, is very similar in both mean and standard deviation. On the other hand, we note that in the case of the walker-bullet-rand environment, variant var3(with the largest number of units) has the best performance. Following, variant var4, which has the largest number of hidden layers, is also showing better performance when compared to the default value of var2and the smaller network of var1. Analysis. The variability between the performance of the different encoder architectures explored is limited, when comparing to the previous experiments. An important observation is that our results show that the bigger networks always perform equally or better than the smaller ones. We can hypothesize that, for these three environments, the sample size with which the encoder is trained seems to be 60
Figure 4.7: Meta-training with different network depths for πθ,Qϕ1,Qϕ2, and Vψ. large enough for its model complexity, avoiding an overfitting scenario. It is also possible that the encoder objective Jq(ω)as presented in Equation 3.12 produce a regularization effect. On the other hand, while the smallest networks show an underfitting effect in walker-bullet-rand, this is not the case in the environments for Cheetah and Ant. The reason for this may be the fact that, for the Cheetah environment the smallest network has already enough representation learning capacity, and in the case of Ant it is possible that running the experiment until convergence may allow observing a similar effect to that of the Walker environment (note that we only execute up to 48 hours in this work). Experiment IV. Another experiment for the evaluation of the architecture is aimed to understand the impact of the number of layers in the neural networks related to the SAC component of PEARL: the policy πθand the critics Qϕ1,Qϕ2, and Vψ. In this case, we compare between three variants: in var1we use 1hidden layer, in var2we use 3layers, and in var3we use 5layers. The default in this case is var2, as 3layers are normally used in our experiments. Results are shown in Figure 4.7. In all environments, we observe that the difference between var1and the other variants is important: the network with only one layer stagnates in a very low return value. In cheetah-bullet-grav, the environment the lowest dimensionality for the task parametrization ϑ, the asymptotic performance of var2and var3is similar, although the network with the biggest number of layers has better samplecomplexity. The same is observed for ant-bullet-grav, also with a low-dimensional task parametrization ϑ. But in the case of the environment with higher task parametrization dimensionality, cheetah-bullet-rand, variant var3seems significantly better in both sample complexity and asymptotic performance, as far as the experimentation length allows us to conclude. Analysis. Our main hypothesis to explain the results of the smaller network, var1, is that the representational capacity in this case is too low to approximate the value functions or the policy. On the other hand, var2obtains good performance in the environments with smaller task parametrization, achieving the asymptotic value of the optimal setting in this experiment, although we may be in presence of an underfitting scenario as the biggest network var3obtains better results in all cases. 61
Figure 4.8: Meta-training with different network widths for πθ,Qϕ1,Qϕ2, and Vψ. Experiment V. This experiment compares the performance of PEARL with different number of units for the networks πθ,Qϕ1,Qϕ2, and Vψ. So, while in the previous case we compare between depths, we now turn our attention to the width of the networks. The variants we use are: var1with the default value for this hyperparameter, this is, using 300 units per layer; and var2using 500 units per layer. Results are shown in Figure 4.8. Interestingly, while in the environments with low-dimensional state and action spaces the performance of the algorithm is improved as the capacity of the neural networks is increased (as for variant var2), the opposite is observed for the environment ant-bullet-grav where the performance of the default number of units per layer is the best, with variant var1. In this last environment, we also notice that the algorithm seems to be slightly more unstable when the capacity of the function approximators is much bigger. Analysis. In the case of the Ant environment, this is the first experiment concerning architecture for which we observe a bigger network obtaining worst performance. We hypothesize that, in the low-dimensional environments with the Cheetah robot, the amount of samples collected is enough to avoid overfitting of the model complexity of the networks, while for Ant, overfitting is taking place. 4.2.3 Sensitivity to Other Design Decisions The set of experiments that we present in this part of the Section is concerned with other interesting lines of exploration: removing the reward from the input of the encoder, and using an encoder that is not invariant with respect to the permutation of the context transitions. Experiment VI. We first compare the performance of PEARL between the original implementation, which we refer to as variant var1, with an alternative version, which we call var2in this experiment. In this second variant, the reward signal rt is not part of the input of the encoder: the context cinclude incomplete transitions (st, at, st+1)and therefore the inference of the posterior qω(z|c), from which zis sampled, takes only the dynamics function Pϑinto consideration. Both variants use the default values for the hyperparameters. 62
(a) Comparison between different inputs for the encoder. (b) Comparison between different architectures for the encoder. Figure 4.9: Meta-training with different network designs for the encoder qω. Our main motivation to study this design decision is the fact that the reward signal rtmay be providing the meta-learner with information about the task T ∼ p(T). This is because, as we explain in Section 4.1.2, although the reward function Ris identical for all tasks, the dynamics Pϑmay drive an optimal policy π∗to particular regions of the state space Sand induce particular distribution of rewards, which is not identical to those for other tasks. Visualization of the results for this experiment is provided in Figure 4.9a. For cheetah-bullet-grav, the environment with low-dimensional action task parameter spaces, the performance is very similar for both variants, with a non-significant advantage for var2(excluding the reward rt). This is also the case for the environment ant-bullet-rand, with high-dimensional action space Aand high-dimensional task parametrization, although in var2we observe less standard deviation between the return obtained by the different replications. On the other hand, in the environment walker-bullet-rand, we observe a clear improvement in var2with respect to the original PEARL, in both asymptotic performance and sample-complexity. Analysis. Surprisingly, we observe that the performance of PEARL in the environments used for experimentation, in this case, is improved when the reward signal is not included as input to the encoder, despite the fact that it should help to inform about the tasks. We hypothezise that, although the reward signal provides information about the current task, the remaining items in the transition are sufficient to fully describe the dynamics Pϑ, making the reward rtto be redundant as part of the input. Therefore, a smaller input comprising the same information allows the encoder network to obtain better approximation. 63
Experiment VII. Finally, the last experiment we present in this Section concerns the comparison between the original version of PEARL, also referred to as variant var1, and an alternative version using a recurrent neural network to encode the posterior distribution for the latent random variable Z, called variant var2. Although Kater Rakelly and colleagues [1] include a similar experiment in the Ablations section of their paper, we decided to explore the same comparison in this work as well since the authors of PEARL only use a goal-oriented environment, and also because the official implementation by the authors was not working with the recurrent encoder3. For this reason, we modified the original source code of PEARL to provide a working implementation for the RNN-based encoder, as a way to compare it with the permutation-invariant Gaussian factors encoder. Our implementation for the RNN encoder is trained with de-correlated random samples from the context experience replay, instead of using complete episode transitions in their original order. Our results for this experiment are provided in Figure 4.9b. Similarly to what was reported by Rakelly and colleagues, we also observe that the sample-complexity and asymptotic performance of the recurrent encoder is comparable to that of the original permutation-invariant design, but with an overhead in computational cost because of the expensive backpropagation-through-time operations for the recurrent optimization. Analysis. For this experiment, where we used task distributions with varying dynamics, the comparison between the original and the recurrent encoder is similar to the results obtained by the authors of PEARL for goal-oriented environments. So we empirically validate the permutation-invariant hypothesis in this case as well. 4.2.4 Sensitivity to the Size of Meta-training Set Next, the experiment we present here compares the performance of PEARL when using different sizes for the meta-training set. It aims to help us understand the influence of the number of meta-training tasks on the generalization capabilities of the algorithm when approaching a new, unseen task. Experiment VIII. Let nm-tr denote the number of meta-training tasks. In this experiment, we compare five variants, with values n1 m-tr = 10,n2 m-tr = 40,n3 m-tr = 70, n4 m-tr = 100, and n5 m-tr = 150. In all cases, the size of the meta-test set is the same: we use 10 test tasks. Additionally, the meta-test tasks are shared across variants: for each variant, we executed five replications using the seeds as described in Section 4.1.1, in order to produce comparable results. (Note that variant var2 has the default value for this hyperparameter, nm-tr = 40) In Figure 4.10 we present the results. For the environment cheetah-bullet-grav, with low-dimensional action space Aand low-dimensional parametrization of the dynamics, ϑ, there does not seem to be significant differences between the variants. The asymptotic performance seems to be similar for all sizes of nm-tr, although 3Confirmed in #issue-565275124 from PEARL’s official GitHub repository. 64
Figure 4.10: Meta-training with gradual increases in the number of training tasks. variant var1, the one with the smallest meta-training set, has a slight advantage in sample-complexity. This is followed by var2, the second smallest. A similar trend can be observed in the results of the walker-bullet-rand environment, where the action space Ais low-dimensional but the parametrization of the dynamics is high-dimensional. In this case the different variants do show some divergence in both the perceived asymptotic performance and the sample-complexity. Here, also, we note that the variants with smaller nm-tr achieve good results earlier, although the difference is mild and not remarkable. On the other hand, for the ant-bullet-rand environment, where both Aand ϑare high-dimensional, we observe similar performance between all the variants, with exception of var1, which register the worst return levels, those similar to a random agent. Analysis. We consider first that var1did not solve the high-dimensional Ant environment for any of its replications, while in most other cases the agents did successfully learn a decent policy. We, therefore, hypothesize that, for each environment, with a given dimensionality for S,A, and ϑ, there may be a threshold for the size of the meta-training set, nm-tr, under which the meta-learner is not able to generalize to the meta-test tasks. For the environment ant-bullet-rand, the small value nm-tr = 10 is not sufficient, but any value above nm-tr = 40 is. On the other hand, for both the Cheetah and Walker environments, any value above 10 seems to be sufficient, but we observe the opposite. Having dealt with the aforementioned case, if we compare the rest of the variants for the three environments, we can observe an unexpected tendency: smaller values for nm-tr obtain marginally better performance. Our initial intuition was that larger values for the meta-training size would help the meta-learner to produce metaparameters ηwith improved performance during adaptation. Our main hypothesis to explain this phenomenon concerns the use, in PEARL, of an independent replay buffer Bifor each meta-training task Ti. Also, for every iteration, the algorithm collects experience from a sample of tasks from the metatraining set, instead of using all of them. Because of this, if the value of nm-tr is relatively small, each buffer Biwill be filled with experience faster with respect to the total environment steps. Because of this, we understand that the different variants we are using in this experiment are not comparable in this sense. Furthermore, in PEARL each gradient update considers only a subset of the metatraining tasks, so any delay in filling the replay buffers impede computing the gra- 65
dients with recent experience. Therefore, in relatively small environments, the diversity in tasks in the meta-training set does not compensate for the delay in filling each of the replay buffers. Further experimentation could be conducted in order to test this hypothesis. 4.2.5 Meta-testing Performance In the last set of experiments in this Section, we show the adaptation performance of PEARL in three tasks (with diverse values for the task parametrization ϑ) for a selection of environments. Note that, while all the results presented before correspond to meta-training experiments, in this case we focus on adaptation (or meta-testing) experiments. Therefore, we start this experimentation using the meta-trained values for θobtained for PEARL in each environment with the default hyperparameters. We are interested in analyzing the variability in meta-test time adaptation performance under the following scenarios: (a) diverse task distributions, (b) diverse sampling for the meta-training tasks used for optimizing the meta-parameters η, and (c) diverse sampling for the meta-test task to which the agent has to adapt. For diversity in task distributions, we use different environments. For considering diverse meta-training sets, we resort to the diversity in seeds used for the different replications in previous experiments: we copy the meta-parameters η1,η2, and η3 obtained as the result of three different replications of a previous meta-training experiment, as the starting point for three different variants var1,var2, and var3of this experiments. Finally, for sampling various meta-test tasks for adaptation, we use the same equidistant tasks as presented in Section 4.1.2, and in each case, we compare the meta-RL method adaptation to the single-task SAC models. Experiment IX. We are using four variants in this experiment: variants var1, var2, and var3represent the PEARL meta-test time adaptation algorithm, each using a different meta-parameter value ηi. These meta-parameter values were obtained by executing, in previous meta-training experiments, PEARL with the default parameters, but trained with diverse meta-training sets. Lastly, variant var4in this experiment represents in this experiment the single-task SAC baseline. For the four variants, we again use the same evaluation protocol, executing five runs with different seeds and aggregating the results. In Figure 4.11 we visualize the adaptation performance in three environments. Each subfigure shows the results for a different environment, where we include the results for diverse replications. For each environment, we sample only one task, corresponding to the parametrization ϑAused in Section 4.1.2, and we execute the PEARL meta-test algorithm for each replication with five new independent seeds, in order to aggregate the returns. Considering the results for cheetah-bullet-grav, in this environment, the metatest procedure of PEARL obtains its best performance relative to the single-task oracle. To simplify the analysis, we now propose a normalized scale for the return levels of this environment, such that a random agent represents the origin, 0.00, and the asymptotic performance of SAC is 1.00. Then, between the three already metatrained variants, the worst-performing agent obtained an almost instant return of 66
Figure 4.11: Adaptation performance in different environments. roughly 0.75, and the difference with the best-performing variant was very small, as it obtained roughly 0.80 from the first few iterations. Although the single-task SAC baseline eventually obtains a significantly better asymptotic performance, it does only reach the level of the PEARL agents after 200,000 or 350,000 environments steps, depending on the variant considered. This represents a considerable difference in sample-complexity. It is also noticeable that the PEARL agents are substantially stable, and they show very small variability with respect to the five random seeds, which control the pseudo-random process for sampling z∼qω(z|c). PEARL does not perform as well in walker-bullet-rand. Considering a normalized return level, the worst-performing variant starts from 0.43 and the best-performing 0.66. In this case, we can see that while two of the variants are stable, a third one shows significant oscillations and also greater standard deviation between the seeds. In this case, SAC does not achieve the same performance of meta-test PEARL before 100,000 or 200,000 environment steps, depending on the variant considered, so the sample-complexity of PEARL is still impressive, but the asymptotic performance is significantly worst. Lastly, in ant-bullet-rand we observe variants that are stable during long periods of time and very small standard deviation between their seeds, but the difference of performance between variants (this is, between values ηiof the meta-parameters obtained during different meta-training replications) is significantly diverse: while the best variant obtains a normalized performance of roughly 1.00, the second obtains circa 0.75 and the worst obtains around 0.20. So, in a real-world scenario, the best variant would have obtained perfect return levels almost from scratch, while SAC needs almost 2,000,000 environments steps to achieve. But for the worst variant, SAC only needs 250,000 to obtain similar levels of return. We also study the performance of the PEARL meta-testing procedure for different tasks sampled from the same distribution. For this, in Figure 4.11 we show the return levels obtained during adaptation in only one environment: walker-bullet-rand. But for this environment, we sample three different tasks, corresponding to the parametrizations ϑA,ϑC, and ϑEused in Section 4.1.2. We execute the same variants as in the previous part of this experiment. The results for task ϑAwere already discussed above, and are shown here to provide visual contrast with the other two. In the case of tasks ϑCand ϑE, we can see that 67
Figure 4.12: Adaptation performance in different tasks for the same environment. variant var2has a similar oscillation behaviour as in the previous task, and higher standard deviation between the seeds when compared with the other two variants. On the other hand, variant var3is always the one with best performance. All the variants in all the tasks for this environment obtain normalized returns between 0.40 and 0.60. Analysis. The sample-complexity of the PEARL agent, after meta-training the parameters η, is significantly better than the one obtained by the state-of-the-art single-task algorithm use in this work as reference. Nevertheless, we can observe that the asymptotic performance of the adaptation procedure of PEARL, in some cases, is far from the levels obtained by the oracle. 4.3 Automatic Temperature Adjustment in Metatraining Now we present an alternative version of PEARL with automatic temperature adjustment, which is one of the main contributions of the Thesis. We first explain the motivation for the proposal, then we analyze the algorithm, recognizing two possible variants of this contribution, and finally we compare the performance to that of the original meta-reinforcement learning method. The development of a variant of PEARL with automatic temperature adjustment, using the technique proposed in the follow-up paper of soft actor-critic by Haarnoja and colleagues [89], is motivated by the results in Section 4.2.1, where we observed a significant sensitivity of the algorithm to the reward scale—and, therefore, to the temperature α. To the best of our knowledge, this is the first implementation that combines PEARL with the aforementioned technique. As described in Section 3.1.1, the temperature αcan be instrumented as a learnable parameter, instead of representing a fixed constant via the reward scale. In turn, a new hyperparameter ¯ His included, which represents the target entropy. In the case of PEARL, our algorithmic adaptation presents the temperature as a new metaparameter, i.e. αis part of η, and its meta-objective can be stated in the same way as in the newer SAC formulation. We propose two sub-variants for this new version of PEARL. The first one is a straightforward implementation, including automatic temperature adjustment on 68
Figure 4.15: Adjusted learning rate for stabilizing variant var3. first 2,000,000 environment steps, while in the original paper they report similar return levels after 3,000,000. This may be due to different hyperparameters used by the authors in their initial experimentation. Experiment XI. Based on the aforementioned results and analysis, we run a second ad-hoc experiment where we compare only variants var1and var3in a selection of the environments. This time, manually adjusted the learning rate for var3using a coarse-grained search for this hyperparameter, in order to understand its impact on the stability problems mentioned above. In Figure 4.15 we show the results, using a learning rate of 9·10−5. Curiously, we observe for var3that the sample-efficiency and asymptotic performance in this case is almost identical as in the previous experiment. The only difference is that the variant is much more stable, as the short-term drops in performance are not as frequent or severe. Analysis. We conclude, therefore, that the stability problems observed for var3, mentioned in the previous part of this Section, can be alleviated by tuning the learning rate. The default learning rate value 3·10−4used in all experiments may be slightly high for this variant, while it seems optimal for variants var1and var2 in the suite of environments we use. 4.4 Fine-tuning During Meta-testing In this Section we first propose and describe a new, alternative approach for adaptation during meta-test time with a PEARL agent, which is one of our main contributions. Then, we perform an experimental evaluation to contrast its performance with the original PEARL adaptation algorithm. As discussed in Section 3.2.5, the way in which the original version of PEARL adapts to a new task is by freezing the meta-trained values for the parameters θand ω, in order to use a pre-trained policy πθ. This receives, as input, the state stobserved at each time step together with a sample zfrom the posterior belief qωabout the task at hand. 75
4.4.1 SAC Training for Adaptation to New Tasks As stated in our analysis for the experiments described in Section 4.2.5, using a meta-trained PEARL agent for adaptation to a new task can significantly improve the sample-efficiency, when compared with state-of-the-art standard, singletask reinforcement learning algorithms. The asymptotic performance using PEARL, nonetheless, is generally worst when compared with single-task soft actor-critic. Motivated by these observations, we devise an alternative technique to improve the asymptotic performance of the original adaptation algorithm by Rakelly and colleagues [1], in order to enable return levels similar to those obtained by a single-task SAC agent, but maintaining the sample-efficiency of the original PEARL. The proposed adaptation method is a hybrid between the inference-based and optimizationbased approaches, as it resembles MAML [65] in the sense that the meta-learned parameters ηact as a transferred initialization. Our proposal involves performing adaptation to a new task in two stages. First, during a small number of initial rollouts, we use the original adaptation procedure to collect information about the environment, with the encoder qωand the policy πθhaving their parameters frozen. In the second stage of adaptation, we set the latent variable zas the expected value of the posterior distribution qω(z|c)given the context ccollected so far, and we unfreeze the policy in order to train it using the soft actor-critic reinforcement learning algorithm. Here we describe this algorithm for the variant of PEARL with automatic temperature adjustment and using only the Q-value functions for bootstrapping (corresponding to variant var3in the previous experiments). Nevertheless, it can be easily extended to work with the algorithmic variant described as var2, by adapting the procedure to consider the function approximator for Vψ(s, z), or with the original version of pearl by additionally removing the automatic temperature component. The pseudo-code for the proposed method, fine-tuning during meta-testing, is presented in Algorithm 4.1. Let η= (θ, ϕ1, ϕ2, α, ω)be the meta-parameters optimized using a set of meta-training tasks sampled from a distribution p(T), and let T ∼ p(T)be a new task (unseen during meta-training) sampled from the same distribution. For a small number of episodes (e.g. N= 10), we replicate the original PEARL adaptation procedure to produce a sufficiently accurate posterior distribution qω(z|c). This warm-up period is encoded in lines 2-6in Algorithm 4.1. We have observed in our experiments in Section 4.2.5 that a small number of episodes at the beginning of adaptation in meta-test time is enough to collect a representative set of transitions, and that experience collection beyond this does not modify the latent posterior. Therefore, after the initial calibration of the latent posterior, we stop collecting context and stop inference in qω, such that we can obtain a stable but accurate latent variable z. For this, we use the expected value of the distribution inferred by qω. We then start a new stage in which the frozen latent variable zis concatenated to the observed state stin each time step and the policy πθis now unfrozen and trained using the standard soft actor-critic algorithm. In order to accelerate the learning process, we can optionally load the critics from meta-training. This allows to fine-tune the pre-trained policy in the new task. 76
Algorithm 4.1 PEARL meta-testing with fine-tuning Require: test task T ∼ p(T), meta-trained θ,ϕ1,ϕ2,α, and ω. 1: Initialize context cT={} 2: for k= 1, . . . , N do 3: Sample z∼qω(· |cT) 4: Use πθ(a|s, z)to collect data DT k={(st, at, rt, st+1)}t=1,...,T 5: Accumulate context cT=cT∪DT k 6: end for 7: z=Eqω(z|cT) 8: Resignify context as replay buffer BT=cT 9: Initialize target networks ˆϕ1and ˆϕ2 10: for k= 1, . . . , M do 11: for each environment step do 12: at∼πθ(· |st, z) 13: Observe reward rtand new state st+1 14: Store transition BT=BT∪(st, at, rt, st+1) 15: end for 16: for each gradient step do 17: ϕi=ϕi−λQ∇ϕiLQ(ϕi)for i∈ {1,2} 18: θ=θ−λπ∇θLπ(θ) 19: α=α−λtemp∇αLtemp(α) 20: ˆϕi=τ ϕi+ (1 −τ) ˆϕifor i∈ {1,2} 21: end for 22: end for 4.4.2 Experiments To evaluate our proposal for fine-tuning during meta-test time, we perform a series of experiments that are similar to those presented in Section 4.2.5. We will compare different algorithmic variants of the adaptation procedure, and use a single-task SAC agent as an oracle. Experiment XII. Using again task parametrizations ϑA,ϑC, and ϑE, we explore the performance of the original PEARL adaptation procedure, noted var1in this experiment, comparing this with the fine-tuning procedure with different hyperparameters. We use two variants of our proposal: in var2we apply the method as it was described in Algorithm 4.1, while in var3we avoid stopping inference in qω, and instead we keep updating the posterior with the new samples collected during the whole training process. Finally, we also include the results for single-task soft actor-critic as an oracle in var4. An important observation is that, in order to allow a fair comparison between variants var1,var2, and var3, all the replications for these variants start their adaptation procedure from the same meta-trained ηin all cases. We used the results obtained in Section 4.3 for the implementation of PEARL with automatic temperature tuning, using only the Q-functions. In our experiments, we load the critics from meta-training to speed-up convergence, so in this case the meta-training ver- 77
Figure 4.16: Adaptation performance in diverse environments and tasks. sion of SAC must match with that used for adaptation. Otherwise, if the critics are initialized from scratch in fine-tuning, the SAC version used for meta-training the policy is irrelevant. We present our results in Figure 4.16. In general terms, we see small variability between the results for different tasks ϑi, while we see critical differences between the results for distinct environments. In cheetah-bullet-grav, the original version of PEARL obtain a normalized performance of circa 0.75 for any of the tasks, and stays steady at the same level for the complete experiment, without ever achieving the asymptotic performance of SAC. Both variants with fine-tuning start the experiment with a drop of performance but they quickly outperform original PEARL, while obtaining asymptotic performance similar to SAC. When compared to the singletask oracle, our variants obtain a significant improvement in sample-efficiency. For walker-bullet-rand, the performance of the original PEARL was already optimal. This is probably because the meta-trained parameters ηwere optimal. Here we observe that, as reported in a previous experiment and visualized in Figure 4.13, our 78
implementation of the PEARL meta-training algorithm with automatic temperature adjustment and only Q-functions for bootstrapping obtained an asymptotic performance superior to that of the original version of PEARL. In this case, the steady return values of the meta-test adaptation procedure proposed by Kate Rakelly and colleagues are already above the single-task oracle. While our fine-tuning method improves with respect to SAC in tasks ϑAand ϑCfor this environment, it only degrades the sample-efficiency with respect to the original version of PEARL, as it does not improve the final performance. On the other hand, in task ϑEthe fine-tuning procedure improves the asymptotic performance. We can also observe that the initial drop in performance of our variants (before the policy becomes proficient) is steeper and longer for this environment, when compared to the one observed for the Cheetah tasks. In the task distribution corresponding to the Ant robot, the original adaptation algorithm obtained an asymptotic performance similar to those of a random agent. This is probably because of the bad performance of our implementation for this environment, shown in Figure 4.14. The pre-trained meta-parameters ηcondemn the adaptation procedure to obtain suboptimal performance. Nevertheless, our metatest time algorithm with fine-tuning allows PEARL to recover, and to eventually approach the final return levels o the SAC oracle in task ϑAand ϑC. It is interesting to note that, in Ant, the performance of variants var2and var3is not as similar as in other cases. Analysis. We observe that our fine-tuning procedure represents a compromise between the original PEARL and single-task SAC. When the original version of PEARL is already obtaining optimal asymptotic performance, such as in the case of task ϑAin the Walker environment, our fine-tuning procedure is counter-productive, as it degrades the sample-complexity while obtaining similar or lower final return levels. On the other hand, when the performance of the original PEARL is much lower than SAC, as in tasks ϑAand ϑCin the Ant environment, our fine-tuning procedure allows approaching the asymptotic performance of the oracle. Finally, when the performance of the original version of PEARL lies at the middle ground, such as in any of the Cheetah tasks, our algorithm improves the asymptotic performance with respect to PEARL, and improves sample-complexity (and obtains the same final performance) when compared to single-task SAC trained from scratch, helped by both the meta-trained θand the informative posterior qω(z|cT). After the warm-up phase, we always observe a drop in performance for the finetuning variants var2and var3before they start improving again (and eventually outperform PEARL). We hypothesize that this is because, after the warm-up phase, the policy weights θare unfrozen and the entropy bonus of the soft actor-critic algorithm used for fine-tuning impose an exploratory behaviour to a certain degree. Nevertheless, we note that, in easier tasks, this initial drop in performance is shorter and less intensive. This can be illustrated in Figure 4.16 by contrasting the performance in any Cheetah task with respect to any Walker task, as in the second case the dimensionality of the task parametrization ϑis four times higher. Furthermore, we note that the difference in performance between variants var2 and var3is negligible in tasks within the Cheetah and the Walker environments, while it is more important for the tasks in Ant. We hypothesize that, in the case 79
of Cheetah and Walker, the encoder qωobtained during meta-training was nearoptimal, providing the policy with informative values for latent variable z. This can be observed in the performance of the original PEARL in those tasks. On the other hand, in the case of Ant, the available encoder qωis not able to produce good values for z. In the case of var2, we freeze the encoder after a few episodes, and from this point onwards, the policy receives as input an uninformative but fixed z. Meanwhile, var3does not freeze the encoder (keep inferring zduring training) and the uninformative, non-stationary zdestabilize the policy. When specifically analyzing task ϑAof the Ant environment, we see that the performance of our fine-tuning variants improves with respect to the original PEARL but is still suboptimal with respect to the single-task SAC agent. This is may appear perplexing, because our fine-tuning procedure is using the same soft actor-critic algorithm for learning. We recognize two possible reasons for this difference. First, we need to consider the dimensionality of the input of each policy network. As described in Table 4.2, the state space in the Ant environment has 28 dimensions. The single-task SAC policy of variant var4receives only the current state stas input, which is 28-dimensional. On the other hand, the fine-tuning procedure variants receive a concatenation of the state and the latent variable, which sums up to a total of 33 dimensions. The difference in the dimensionality of the input of the policy network may impact the sample-efficiency of the agents. But this line of inquiry was discarded early in our experiments, as we trained yet another agent (results are not included in this report), which was also a single-task SAC but we concatenate a 5-dimensional constant, simulating an arbitrary value for z. This enlarged-input SAC obtained a very similar result to that of the small-input SAC. Second, we hypothesize that loading the critics Qϕ1and Qϕ2instead of initializing them randomly may be hindering the training process of the policy. This is the other big difference between the single-task SAC of variant var4and our fine-tuning procedure. As part of future work, we could also experiment with a variant in which we do not load the critics, and compare the results. It is also interesting to note the difference between the performance of the original PEARL meta-testing algorithm in this experiment, when compared to the results obtained in Figure 4.11. In this case, the performance in the Walker environment is much better, and the performance in Ant is much worse. This is explained by the difference in performance for the meta-training procedure between the original PEARL and our implementation with automatic temperature adjustment, which in turn was reported in Figure 4.15. 80
5|Discussion In this Thesis, we have first presented a theoretical background on the research fields that are required to understand the state-of-the-art methods for meta-reinforcement learning. We have also provided a review of a selection of very recent algorithms, that we present as a contribution due to its novelty and the detailed extent to which we introduce the methods. Furthermore, we have conducted an empirical study of the performance of one of these techniques using task distributions with varying dynamics function, and described a new environment suite and some algorithmic variants, which we also present as contributions. Here we provide a critical review of our findings. 5.1 Conclusions During the presentation of our experiments, we formulated a set of questions to guide our research study. We start this review with an analysis of those questions, regarding the meta-RL method PEARL [1], presented in Section 3.2.5. With respect to the sensitivity of the algorithm to various design decisions, in Section 4.2 we conducted a series of experiments that allow us to conclude that using adequate values for the learning rate and the reward scale is critical to obtain good performance. Other aspects, such as the number of meta-training tasks, or the design decisions involving the encoder network qω, have a comparatively limited impact. The size of the policy and critic networks is also important for the meta-training performance of the algorithm, as we observed improvements for bigger architectures. When comparing between different network designs, and assessing the effect they have on the performance of PEARL, we concluded in Sections 4.2.2 and 4.2.3 that the impact of the encoder design, architecture size, and input is not significant. On the other hand, when experimenting with different network sizes for the policy and the critics, we encountered some cases of underfitting and overfitting, and therefore it may be the case that, for real applications, these architectures should be considered in more detail. In the case of the meta-training set size, we hypothesized that values below an environment-dependent threshold do not allow the meta-learner to generalize well enough to the new, unseen tasks. This threshold may be influenced by the dimensionality of the state, action, and task-parametrization spaces. Although the algorithm did not show much variability between a wide range of values above this threshold, we noticed in Section 4.2.4 that smaller meta-training sets allow 81
for slightly better performance. We then presented a hypothesis to explain this: the use of independent replay buffers Bifor each meta-training task, together with the fact that training iterations use a sample of meta-training tasks for both collecting experiences and for updating the gradients, may produce this effect. For the impact of the learning rate in the performance of the algorithm, we noticed in this meta-reinforcement learning setting a pattern similar to what Yoshua Bengio [101] describes for standard supervised learning: excessively low values for the learning rate allow the agent to improve its performance but degrading significantly the sample-efficiency, while learning rates that are excessively high directly impede the agent to solve the problem. We also observed the need to further investigate the role of momentum and adaptability as capabilities of the optimizer in the meta-reinforcement learning setting. Our results for the reward scale suggest that this is also a hyperparameter with a significant impact on the performance of PEARL. We detected a correlation between the dimensionality of the action space Aand the optimal value of the reward scale, and noted that this hyperparameter is inversely proportional to the temperature α. It is important to contextualize this finding with the work by Haarnoja et al. [89], as they suggest a heuristics for the target entropy hyperparameter, which controls the learning objective of the temperature, to set it as ¯ H=−dim(A). This last conclusion leads us to the second research question posed in Chapter 4, which refers to the effect in performance of our proposed adaptation of the algorithm: applying automatic temperature adjustment to the original version of PEARL. Our results in Section 4.3 allow us to conclude that in mid-size continuous control task distributions with varying dynamics, our implementations outperform PEARL in both sample-efficiency and asymptotic performance, although this is not the case in very high-dimensional environments. When considering the effect of the state-value function approximator Vψ, we concluded that this component provides stability during training, although in some cases it hinders the performance. Importantly, in high-dimensional environments, omitting the state-value function produces an absolute degradation in performance, comparable to that of a random agent. The last question posed for guiding our research was focused on the adaptation procedure of PEARL. We implemented and evaluated an alternative algorithm, that combines the task-inference approach of PEARL with the optimization-based perspective of MAML. The results obtained in Section 4.4 show that our adaptation procedure with policy fine-tuning provides a way to obtain sample-efficiency comparable to the original PEARL, while also enabling to achieve asymptotic performance similar to a single-task SAC agent. Furthermore, we also observe that our contributed suite of environments with varying dynamics provide an open-source alternative to the popular MuJoCo continuous control tasks, which are normally used for research experimentation in metareinforcement learning. By conducting our experiments in this new suite, and comparing with similar experiments with the corresponding MuJoCo environments, we conclude that the suites are compatible and therefore the findings obtained in each are comparable. 82
5.2 Future Work As a first proposal for future work, we consider the application of our new fine-tuning procedure for meta-testing adaptation to the state-of-the-art reinforcement-learning algorithm MELD [80], described in Section 3.2.8, which is capable of learning from raw image observations, making it possible for the algorithm to approach tasks with partial observability. The application of our adaptation scheme is straightforward, since the meta-testing algorithm provided by the authors is very similar to that of PEARL. This is also true for VariBAD [79], presented in Section 3.2.6, and therefore the combination of our method with this meta-RL algorithm can be explored as well. We plan to start working in another future line of research: the study of our new fine-tuning adaptation procedure in a real-world problem such as continuous control in adaptive optics. An interesting example of this type of problems is image calibration in ground-based telescopes. This involves learning the controller of large-scale deformable mirrors used in adaptive optics systems to correct refraction-based disturbances which degrade the resulting image quality of the telescope. Traditional RL algorithms have been proposed to approach this problem [102]. Below, we provide arguments to support the application of meta-reinforcement learning methods, together with our new fine-tuning procedure. While Zhao and colleagues [80] successfully train a meta-reinforcement learning algorithm in a real-world continuous control application, they use a problem involving a task distribution where the reward function is the only factor of variation. In contrast, image calibration in ground-based telescopes represents an interesting experiment, since the problem involves a task distribution with varying dynamics function (different settings of the atmosphere). Furthermore, for the adaptive optics problem described here, the asymptotic performance is critical. Based on what we observed in Section 4.2.5, the original version of PEARL may obtain return levels that start in a good position during meta-training, but since the procedure does not involve gradient updates, it is unlikely to achieve optimal asymptotic performance. Therefore, we understand that our contributed algorithm for fine-tuning during meta-testing may help to obtain good sample-efficiency but also to achieve asymptotic performance similar to those observed for state-of-the-art single-task RL algorithms. This can be combined with the aforementioned application of our method to MELD instead of PEARL, in order to allow end-to-end representation learning for the input images. 83
Bibliography [1] Kate Rakelly, Aurick Zhou, Chelsea Finn, Sergey Levine, and Deirdre Quillen. Efficient Off-Policy Meta-Reinforcement Learning via Probabilistic Context Variables. In International Conference on Machine Learning (ICML), volume 97 of PMLR, pages 5331–5340, 2019. [2] Richard S. Sutton and Andrew G. Barto. Reinforcement Learning: An Introduction. The MIT Press, second edition, 2018. [3] Richard Bellman. A Markovian Decision Process. Journal of Mathematics and Mechanics, 6(5):679–684, 1957. [4] Ignasi Clavera, Jonas Rothfuss, John Schulman, Yasuhiro Fujita, Tamim Asfour, and Pieter Abbeel. Model-Based Reinforcement Learning via Meta- Policy Optimization. Conference on Robot Learning (CoRL), 2018. [5] Tingwu Wang, Xuchan Bao, Ignasi Clavera, Jerrick Hoang, Yeming Wen, Eric Langlois, Shunshi Zhang, Guodong Zhang, Pieter Abbeel, and Jimmy Ba. Benchmarking Model-Based Reinforcement Learning. arXiv preprint arXiv:1907.02057, 2019. [6] Trevor Hastie, Robert Tibshirani, and Jerome Friedman. The Elements of Statistical Learning. Springer Series in Statistics. Springer-Verlag, New York, NY, USA, 2001. [7] Justin A. Boyan and Andrew W. Moore. Generalization in Reinforcement Learning: Safely Approximating the Value Function. In Neural Information Processing Systems (NeurIPS), pages 369–376. MIT Press, 1995. [8] Geoffrey E. Hinton and Ruslan R. Salakhutdinov. Reducing the Dimensionality of Data with Neural Networks. Science, 313(5786):504–507, 2006. [9] Geoffrey E. Hinton, Simon Osindero, and Yee Whye Teh. A Fast Learning Algorithm for Deep Belief Nets. Neural Computation, 18(7):1527–1554, 2006. [10] Yann LeCun, Yoshua Bengio, and Geoffrey Hinton. Deep Learning. Nature, 521(7553):436–444, 2015. [11] Ian Goodfellow, Yoshua Bengio, and Aaron Courville. Deep Learning. The MIT Press, 2016. 84
[89] Tuomas Haarnoja, Aurick Zhou, Kristian Hartikainen, George Tucker, Sehoon Ha, Jie Tan, Vikash Kumar, Henry Zhu, Abhishek Gupta, Pieter Abbeel, and Sergey Levine. Soft Actor-Critic Algorithms and Applications. arXiv preprint arXiv:1812.05905, 2018. [90] Junyoung Chung, Caglar Gulcehre, KyungHyun Cho, and Yoshua Bengio. Empirical Evaluation of Gated Recurrent Neural Networks on Sequence Modeling. arXiv preprint arXiv:1412.3555, 2014. [91] Sepp Hochreiter and Jürgen Schmidhuber. Long Short-Term Memory. Neural Computation, 9(8):1735–1780, 1997. [92] Adam Paszke et al. PyTorch: An Imperative Style, High-Performance Deep Learning Library. In Advances in Neural Information Processing Systems (NeurIPS), pages 8024–8035. Curran Associates, Inc., 2019. [93] Martín Abadi et al. TensorFlow: Large-Scale Machine Learning on Heterogeneous Systems. arXiv preprint arXiv:1603.04467, 2016. [94] Ian Osband, Daniel Russo, and Benjamin Van Roy. (More) Efficient Reinforcement Learning via Posterior Sampling. In Advances in Neural Information Processing Systems (NeurIPS), volume 26, 2013. [95] Ron Dorfman, Idan Shenfeld, and Aviv Tamar. Offline Meta Reinforcement Learning. arXiv preprint arXiv:2008.02598, 2021. [96] Xue Bin Peng, Aviral Kumar, Grace Zhang, and Sergey Levine. Advantage- Weighted Regression: Simple and Scalable Off-Policy Reinforcement Learning. arXiv preprint arXiv:1910.00177, 2019. [97] Chelsea Finn and Sergey Levine. Meta-Learning and Universality: Deep Representations and Gradient Descent can Approximate any Learning Algorithm. In International Conference on Learning Representations (ICLR), 2018. [98] Alex X. Lee, Anusha Nagabandi, Pieter Abbeel, and Sergey Levine. Stochastic Latent Actor-Critic: Deep Reinforcement Learning with a Latent Variable Model. In Advances in Neural Information Processing Systems (NeurIPS), volume 33, pages 741–752, 2020. [99] Diederik P. Kingma and Jimmy Ba. Adam: A Method for Stochastic Optimization. In International Conference on Learning Representations (ICLR), 2015. [100] Erwin Coumans and Yunfei Bai. PyBullet, a Python module for physics simulation for games, robotics and machine learning. http://pybullet.org, 2016–2019. [101] Yoshua Bengio. Practical Recommendations for Gradient-based Training of Deep Architectures. In Neural Networks: Tricks of the Trade. Springer, 2013. [102] Bartomeu Pou Mulet, Eduardo Quiñones Moreno, Damien Gratadour, and Mario Martín Muñoz. Denoising Wavefront Sensor Images with Deep Neural Networks. In Adaptive Optics Systems VII, volume 11448, pages 910–917. International Society for Optics and Photonics, SPIE, 2020. 91