Title: ADAPT-TO-LEARN: POLICY TRANSFER IN REIN-FORCEMENT LEARNING

Abstract: Efficient and robust policy transfer remains a key challenge in reinforcement learning. Policy transfer through warm initialization, imitation, or interacting over a large set of agents with randomized instances, have been commonly applied to solve a variety of Reinforcement Learning (RL) tasks. However, this is far from how behavior transfer happens in the biological world: Humans and animals are able to quickly adapt the learned behaviors between similar tasks and learn new skills when presented with new situations. Here we seek to answer the question: Will learning to combine adaptation reward with environmental reward lead to a more efficient transfer of policies between domains? We introduce a principled mechanism that can "Adapt-to-Learn", that is adapt the source policy to learn to solve a target task with significant transition differences and uncertainties. We show through theory and experiments that our method leads to a significantly reduced sample complexity of transferring the policies between the tasks.

1. INTRODUCTION:

Lack of principled mechanisms to quickly and efficiently transfer policies learned between domains has become the major bottleneck in Reinforcement Learning (RL). This inability to transfer or adapt policies is one major reason why RL has still not proliferated physical application like robotics. Since RL agents cannot quickly transfer policies, the agent is forced to learn every task from scratch, which is both time and sample expensive. Warm-start, a method in which weights from one neural network are transferred to another, has been reasonably successful for supervised learning. However, this method can often lead to mixed and even negative results in RL (Joshi & Chowdhary, 2018; Taylor & Stone, 2009) .

Our main contribution is an algorithm to transfer policies between tasks with significant differences in state transitions via a policy adaptation mechanism. Unlike the majority of existing work in transfer learning for RL, our approach does not merely use the transferred policy to warm start (initialize the parameter of the target network with learned source network) policy learning in the target domain. Neither does it rely on a multitude of simulations across randomly generated source domains. Instead, we combine supervised reference trajectory tracking and unsupervised reinforcement learning to adapt the source policy to the target domain directly. We show through theory and experiments that our method enjoys significantly reduced sample complexity in solving the task.

Adapt-to-Learn is inspired by the fact that combined adaptation of behaviors and learning through experience is a primary mechanism of learning in biological creatures (Krakauer & Mazzoni, 2011; Fryling et al., 2011) .Inspired by this ability of biological creatures, we seek to answer the question: Will learning to combine intrinsic adaptation reward with environment reward lead to more efficient transfer of policies between domains? Imitation Learning (IL) (Duan et al., 2017; Zhu et al., 2018) seems to play a crucial part in biological learning, and as such has been widely studied in RL. However, the key is, when presented with a new situation, animals do not just imitate, but quickly adapt existing behaviors, and improve them through further experience. In particular, an animal learning to walk on a different terrain does not just imitate its existing gait, but adapts it to the new environment.The theory behind such adaptation in reference tracking control problems has been typically restricted to deterministic dynamical systems with well-defined reference trajectories ( Åström & Wittenmark, 2013; Chowdhary et al., 2013) . This ability to adapt and incorporate further learning through optimization on the environment reward is one key difference between our method and ex-isting imitation learning and Guided Policy Search (GPS) methods (Levine & Koltun, 2013) . Unlike IL and GPS, our method transfers policies between task with significant differences in the transition models. Moreover, by mixing environment reward with intrinsic adaptation rewards, we ensure that the agent quickly adapts and also learns to acquire skills beyond what the source policy can teach. We posit that the presented method can be the foundation of a broader class of RL algorithms that can choose seamlessly between learning through RL to supervised adaptive imitation. Our empirical results show that approach is capable of robustly transferring policies between tasks, even in the presence of nonlinear and time-varying differences in the dynamic model of the systems. In particular, we show that it suffices to execute adapted greedy policies to ensure -optimal behavior in the target domain.

Related work: D-RL has recently enabled agents to learn policies for complex robotic tasks in simulation (Peng et al., 2016; 2017b; Liu & Hodgins, 2017; Heess et al., 2017) . However, D-RL has been plagued by the curse of sample complexity. Therefore, the capabilities demonstrated in the simulated environment are hard to replicate in the real world. This learning inefficiency of RL has led to significant work in the field of TL (Taylor & Stone, 2009) . A significant body of literature on transfer in RL is focused on initialized RL in the target domain using learned source policy; known as jump-start/warm-start methods (Taylor et al., 2005; Ammar et al., 2012; 2015) . Some examples of these transfer architectures include transfer between similar tasks (Banerjee & Stone, 2007) , transfer from human demonstrations (Peters & Schaal, 2006) and transfer from simulation to real (Peng et al., 2017a; Ross et al., 2011; Yan et al., 2017) . Efforts have also been made in exploring accelerated learning directly on real robots, through Guided Policy Search (GPS) (Levine et al., 2015) and parallelizing the training across multiple agents using meta-learning (Levine et al., 2016; Nagabandi et al., 2018; Zhu et al., 2018) . Sim-to-Real transfers have been widely adopted in the recent works and can be viewed as a subset of same domain transfer problems. Daftry et al. (Daftry et al., 2016) demonstrated the policy transfer for control of aerial vehicles across different vehicle models and environments. Christiano et al. (Christiano et al., 2016) transferred policies from simulation to real using an inverse dynamics model estimated interacting with the real robot. Through learning over an adversarial loss, the agents are trained to achieve robust policies across various environments (Wulfmeier et al., 2017) . However, these and other reported architectures do not necessarily lead to improved sample efficiency, handle relatively minor changes in the transition model, and are even known to cause negative transfer. In contrast, our approach directly adapts the source policies to target with significant transition model difference while interacting with the environment. It enjoys empirically and rigorously proven sample efficiency guarantees of order O(nH), depending polynomially on the horizon length "H".

2. PRELIMINARIES:

Consider a finite horizon MDP defined as a tuple M = (S, A, P, R, ρ 0 , γ), where S denote set of continuous states; A is a set of continuous bounded actions, P : S × A × S → R + is state transition probability distribution of reaching s upon taking action a in s, ρ 0 : S → R + is the distribution over initial states s 0 and R : S × A → R + is deterministic reward function and H be the finite horizon of the problem.

Let π(a|s) : S × A → [0, 1] be stochastic policy over continuous state and action space. The action from policy is a draw from this distribution a i ∼ π(a i |s i ). The agent's goal is to find a policy π which maximize the total return. The total return starting from states s 0 ∼ ρ 0 under a policy π is

η π (s 0 ) = E s0,a0,... H t=0 r(s t , a t ) (1)

where, s 0 ∼ ρ 0 , a t ∼ π(a t |s t ) and s t+1 ∼ p(s t+1 |s t , a t ).

We formalize the underlying problem of policy transfer by considering a source and target MDP as follows, M S = (S, A, P, R, ρ 0 , γ) S , M T = (S, A, P, R, ρ 0 , γ) T , each with its own state, action space and transition model respectively. We will mainly focus on the problem of same domain transfer in this paper, where the state and action space are analogous S (S) = S (T ) = S ∈ R m and A (T ) = A (S) = A ∈ R k , but the source and target state transition models differ significantly due to unmodeled dynamics or external environment interactions. Furthermore, an example of how the method can extend to cross-domain transfer using manifold alignment (Joshi & Chowdhary, 2018; Wang & Mahadevan, 2009) is in the supplementary. Let π * be a parameterized optimal stochastic policy for source MDP M S . The policy π * can be obtained using any available RL methods (Sutton et al., 2000; Schulman et al., 2015; 2017) . In this work, we have used the Proximal Policy Optimization(PPO) (Schulman et al., 2017) algorithm to generate the source optimal policy. We will use the following definition of the state value function V π defined under any policy π V π (s t ) = E at,st+1,at+1,...

H i=0 r(s i+t , a i+t )

The associated optimal value function fo source MDP M S is V π * for all s ∈ S. Let T : R n → R n be the Bellman update operator defined as

(T f )(s) = max a∈A r(s, a) + γ E s ∼P (s,a) f (s ) (2) Optimal value function V π * satisfies the Bellman Equation-(2) such that V π * (s) = T V π * (s), ∀ s.

3 ALGORITHMIC CONTRIBUTION: TRANSFER THROUGH ADAPTATION

3.1. ADAPTATION AS A MECHANISM FOR POLICY TRANSFER IN RL:

In this paper, we approach the problem of transfer learning for RL through adaptation of previously learned policies to related tasks. Our approach to adaptation is by enabling the agent to learn the best mixture of imitation and learning from environment reward.Our method differs from RL transfer methods that rely on jump-starts or direct imitation (Zhu et al., 2018; Duan et al., 2017) in a key way: We do not aim to emulate the source optimal policy itself in the target domain, but the source transitions under optimal policy. To make this point, we demonstrate in our empirical results that the source policy, when used directly, does not produce sensible behaviors of the agent in the target domain when transition models are significantly different.On the other hand, our method uses the source transitions projected onto the target task as reference exploration trajectories, helping to adapt and optimize the source policy to the target domain efficiently.

In canonical reinforcement learning, the goal is to learn the optimal policy π * which maximizes the future cumulative reward when the reward function and the transition function of the MDP are unknown. In statistical RL, this leads to the (in)famous explore-exploit tradeoff.Yet, this learnthrough-experience approach has demonstrated significant potential to enable general solutions to control of complex physical systems for which first principles-based models are not easily obtainable. However, one of the key challenges in RL has been the high sample complexity of obtaining a reasonable policy. In other words, RL, and specifically Deep RL, require an absurdly huge amount of interactions with the environment (experience) to find reasonable policies. This high learning inefficiency is in apparent contrast with the efficient learning demonstrated by humans and many biological creatures. For examples, octopuses are known to learn to solve complex problems such as opening jars and squeezing through puzzles with just a few trials. This ability to quickly transfer and adapt learned policies between related tasks is likely a key to general intelligence that seems to be missing from RL. Our goal in the rest of this paper is to show that an algorithm that can judiciously combine adaptation to changes and learning new skills is capable of avoiding brute force random exploration to a large extent and be significantly less sample expensive.

3.2. ADAPT-TO-LEARN: POLICY TRANSFER:

We begin by mathematically describing adaptation for policy transfer in RL and state all the necessary assumptions in Section 3.2.1. We then develop the Adapt-to-Learn algorithm in Section 3.2.2.

3.2.1. ADAPTATION:

The proposed Adapt-to-Learn (ATL) algorithm objective is to accumulate higher total returns through maximizing the likelihood of the target policies π θ , which emulate the optimal source transition behavior in the target MDP. We achieve this objective by minimizing the KL divergence between point-wise local trajectories realized using the target policy and source optimal policy in the target domain . This adaptation objective can be formalized as minimizing the KL-divergence between source and target transition trajectories:

EQUATION

)

where τ is the trajectory in the target domain under the policy π θ defined as τ = (s 0 , a 0 , s 1 , a 1 , . . . ), and probability of the trajectory p π θ (τ ) under policy π θ and target transition p T (.|s t , a t ) can be written as

EQUATION

Similarly q π * (τ ) can be defined as probability of trajectory deviations at every state s t ∈ τ , when the source optimal policy π * is used in place of target policy π θ , and the states evolve according to the source transitions model p S (.|s t , a t ) (Refer Figure-3 in Appendix-C):

EQUATION

Assumption-1: We assume that optimal source policy is available, such that the source policy variance can be assumed to be zero. That is, the action probabilities π * (a t |s t ) = 1, ∀s t . This is a reasonable assumption, since optimal source policy is available it can be treated as deterministic policy and actions can be chosen greedily. We need this assumption only for deriving the expression for intrinsic reward and theoretical analysis. In the empirical evaluation of the algorithm, we treat π * (.) as a stochastic policy.

The transition probabilities in the KL divergence in (3) term are treated as transition likelihoods and the transitioned state s t+1 as a random variable. Since s t+1 is the optimal state reached starting in s t under source transition model using π * (a t |s t ), we try to emulate this behavior in the target domain and hence evaluate the transition likelihoods of the target trajectory at {s i } H i=1 . Using the definition of the probabilities of the trajectories under π θ and π * Equation-( 4) & (5) the log term in the KL divergence of the trajectory (3) is simplified as follows

EQUATION

Using ( 6) and with assumption-1 i.e. π * (a t |s t ) = 1∀s t the KL term can simplified as follows

η KL (π θ , π * ) = E st,at∼τ p π θ (τ ) H t=0 log π θ (a t |s t )p T (s t+1 |s t , a t ) p S (s t+1 |s t , a t ) η KL (π θ , π * ) = E st,at∼τ p π θ (τ ) H t=0 ζ t (7)

where

ζ t = log π θ (at|st)p T (s t+1 |st,at) p S (s t+1 |st,a t )

.

If calculating the above expectation is feasible, it is possible to minimize the KL divergence and move the policy parameters in the direction of emulating source transition behavior in the target domain. However, this is not generally the case since the true expectation is intractable. Therefore a common practice is to use an empirical estimate of the expectation to do approximate planning. We minimize the trajectory KL divergence by handling the term ζ t as the intrinsic adaptation reward, which captures the local deviation in trajectory in the form of the shaped reward function.

Assumption-2: We do not assume to know the true transition distribution for source and the target, but only have access to simulator model of the source. However, we assume both source and target transition models follow a Gaussian distribution centered at the next propagated state and fixed variance "σ".

Assumption-2 is not very restrictive since we empirically show that for any deterministic model, a bootstrapped Gaussian transition assumption is sufficient for ATL agent to learn the task. Using the above assumption, we can approximate the KL term as

EQUATION

)

The individual terms in the expectation ζ t represent the distance between two transition likelihoods of landing in the next state s t+1 starting in s t and under actions a t , a t . The target agent is encouraged to take actions that lead to states which are close in expectation to a reference state provided by an optimal baseline policy operating on the source model. By doing so, we are providing a possible direction of search for the higher environmental rewards "r t ".

We can, therefore, solve the following optimization problem to generate adaptive policy updates:

EQUATION

The distance between two transition models ζ t is used as an intrinsic reward to calculate the total trajectory intrinsic return, and further, any policy update algorithm can be used (Sutton et al., 2000; Schulman et al., 2017; 2015) to update the policy in direction optimizing this objective. However, it is to be noted that though we use policy gradient kind of update for adaptive policy, the optimization is more akin to supervised learning. For every state-action pair, the KL-distance is the true metric to be minimized, and unlike RL, we do not engage in optimal value search in the adaptation part of learning. Hence the algorithm is more sample efficient compared to any RL policy search methods.

3.2.2. ADAPTATION AND LEARNING:

We achieve Adaption and Learning simultaneously by augmenting environment reward r t with intrinsic reward ζ t . By doing so, we achieve transferred policies which try to both optimize optimal reference tracking and also maximize the cumulative future environmental reward to acquire skills beyond what source can teach. This trade-off between learning by exploration and learning by adaptation can be realized as follows:

EQUATION

)

Where the term β is the mixing coefficient. We make a heuristic choice for an appropriate β to start with and annealed over episodes for optimal mixing of adaptation and learning. For consistency of the reward mixing, the rewards r t , ζ t are normalized to form the total reward r t = (1 -β)r t + βζ t .

Algorithm 1 Adaptive-to-Learn Policy Transfer in RL Require: π * (.), p S Inputs: Source Policy, source simulator 1: Initialize s T 0 ∈ ρ 0 . Draw initial state from the given distribution in target task 2: for i = 1 ≤ K do 3:

while s i = terminal do 4: a i ∼ π * (s i )

Generate the optimal action using Source policy 5:

a i ∼ π θ (s i )

Generate the action using the πθ 6:

s i+1 ∼ p T (s i , a i )

Propagate the target task model at state s i and action a i 7:

s i+1 ∼ p S (s i , a i )

Propagate the source task model at state s i and action a i 8:

ζ t = π θ (a i |s i )e -(si+1-s i+1 ) 2 /2σ 2

Calculate the KL divergence intrinsic reward term 9:

Z i = ({s i , r i , ζ i , a i , a i })

Incrementally store the trajectory for policy update 10:

P Z n (η KL ) = 1 n n i=1 H t=0 ∇ θ log π θ (a i,t |s i,t ) ∞ t=0 r i,t

Empirical loss to optimize 11:

πθ = arg max π∈Π P Z n (η KL )

Minimize the loss to obtain a adaptive policy

3.3. SAMPLE-BASED ESTIMATION OF THE GRADIENT:

The previous section proposed an optimization method to find the adaptive policy using KLdivergence as an intrinsic reward, enforcing the target transition model to mimic the source transitions. This section describes how this objective can be approximated using a Monte Carlo simulation. The adaptive policy update methods work by computing an estimator of the gradient of the return and plugging it into a stochastic gradient ascent algorithm.

EQUATION

θ ← θ + αĝ. Where α is the learning rate and ĝ is the empirical estimate of the gradient (Refer Appendix-A) of the total return η KL . The gradient estimate over i.i.d data from the collected trajectories is computed as follows:

EQUATION

where P Z n is empirical distribution over the data (Z n : {s i , a i , a i } n i ).

4. THEORETICAL BOUNDS ON SAMPLE COMPLEXITY:

Although there is some empirical evidence that transfer can improve performance in subsequent reinforcement-learning tasks, there are not many theoretical guarantees. Since many of the existing transfer algorithms approach the problem of transfer as a method of providing good initialization to target task RL, we can expect the sample complexity of those algorithms to still be a function of the cardinality of state-action pairs |N | = |S| × |A|. On the other hand, in supervised learning setting, the theoretical guarantees of most algorithm have no dependency on size (or dimensionality) of the input domain (which is analogous to |N | in RL domains). Having formulated a policy transfer algorithm using labeled reference trajectories derived from optimal source policy in ATL, we construct supervised learning like PAC property of the proposed method. For the sample complexity analysis we consider only the adaptation part of learning i.e. β = 1 in Equation-( 16). This is because in ATL, the adaptive learning is akin to supervised learning, since the source reference trajectories provide the target states given every (s t , a t ) pair.

Suppose we are given the learning problem specified with training set Z n = (Z1, . . . Z n ) where each Z i = ({s i , a i , a i }) H i=0 are independently drawn according to some distribution P . Given the data Z n we can compute the empirical return P Z n (η KL ) for every π θ ∈ Π, and we will show that the following holds: P Z n (η KL ) -P (η KL ) ≤ (13) with probability at least 1 -δ, for some very small δ s.t 0 ≤ δ ≤ 1. We can claim that the empirical return for all π θ is a sufficiently accurate estimate of the true return function. Thus a reasonable learning strategy is to find a π θ ∈ Π that would minimize empirical estimate of the objective (10).

Theorem 4.1 If the induced class of the policy π θ :L Π has uniform convergence property in empirical mean; then the empirical risk minimization is PAC. s.t

P n (P (η KL,π * ) -P (η KL,π * ) ≥ ) ≤ δ (14)

and number of trajectory samples required can be lower bounded as

EQUATION

)

For the proof of the above theorem refer the Appendix-B.

4.1. -OPTIMALITY RESULT UNDER ADAPTIVE TRANSFER-LEARNING:

Consider MDP M * and M which differ in their transition models. For the sake of analysis, let M * be the MDP with ideal transition model, such that target follows source transition p * precisely.

Let p be the transition model achieved (tracked) using the estimated adapted policy learned over data interacting with the target model and the associated MDP be denoted as M . We analyze the -optimality of return under adapted source optimal policy through proposed policy transfer.

Note for the sake of analysis we are deviating from finite horizon assumption and using discout factor γ. To be consistent with previous section we can assume the horizon length H = log γ v 2Vmax , where v is truncation error in total infinite return. Definition 4.2 Given the value function V * = V π * and model M 1 and M 2 , which only differ in the corresponding transition models p 1 and p 2 . Lets define ∀s, a ∈ S × A

d V * M1,M2 = sup s,a∈S×A E s ∼P1(s,a) [V * (s )] - E s ∼P2(s,a) [V * (s )] Lemma 4.3 Given M * , M and value function V π * M * , V π * M

the following bound holds

V π * M * -V π * M ∞ ≤ γ (1-γ) 2

where max s,a p(.|s, a) -p * (.|s, a) ≤ and p and p * are transition of MDP M , M * respectively.

The proof of this lemma is based on the simulation lemma (see Appendix-C). Similar results for RL with imperfect models were reported by (Jiang, 2018) .

5. POLICY TRANSFER IN SIMULATED ROBOTIC LOCOMOTION TASKS:

To evaluate Adapt-to-Learn Policy Transfer in reinforcement learning, we design our experiments using sets of tasks based on the continuous control environments in MuJoCo simulator (Todorov et al., 2012) . Our experimental results demonstrate that ATL can adapt to significant changes in transition dynamics. Therefore, we perturb the parameters of the simulated target models for the policy transfer experiments (see Table -1 for original and perturbed parameters of the target mode).

To create a challenging training environment, we changed the parameters of the model such that the optimal source policy alone without any learning cannot produce any stable results (see source policy performance in Figure -1 ). We compare our results against two baselines: (a) Initialized Reinforcement learning (initialized PPO) (Jumpstart-RL (Wang & Mahadevan, 2009 )) (b) standalone reinforcement policy learning (PPO) (Schulman et al., 2017) .

We experiment with the ATL algorithm on Hopper, Walker2d, and HalfCheetah Environments. The states of the robots are their generalized positions and velocities, and the actions are joint torques. High dimensionality, non-smooth dynamics due to contacts and being under-actuated systems make these tasks very challenging. We use deep neural networks to represent the source and target policy, the details of which are in the Table-2 Appendix-D. The following models are included in our evaluation:

Slippery Hopper: is defined through 11-dimensional state space and 3-dimension action space, with reward function defined as r(t) = (s t+1 -s t )/dt -10 -3 a 2 , and a bonus of +1 for being in a non-terminal state. The simulation is terminated upon reaching 1000 steps or hopper toppling. The target model differs in the floor friction and foot joint damping.

Slippery Fat-Walker2d: is defined through 17-dimensional state space and 6-dimension action space, with reward function and termination condition defined same as Hopper. The target model differs in the model density and floor friction.

Fat HalfCheetah: is defined through 17-dimensional state space and 6-dimension action space, with reward function defined as r(t) = (s t+1 -s t )/dt -0.1 a 2 . The simulation is terminated upon reaching 1000 steps. The target model differs in the floor friction coefficient, gravity, and mass.

To establish a standard baseline, we also included the classic cart-pole and Inverted pendulum balancing tasks, based on the formulation (Barto et al., 1983) . We also demonstrate the cross-domain transfer capabilities using a model-based variant of the proposed algorithm. compared to using a warm-start or standalone RL method. Note that the target domain perturbations introduced are significant enough such that source policy alone without any adaptation in the target domain produced no meaningful results (Figure -1 ). This notion of adaptation in the face of uncertainty is a key advancement over traditional policy transfer, meta-learning, or adversarial RL methods aiming to improve performance by learning a policy over a set of lightly perturbed tasks. 

6. CONCLUSION:

We introduced a new transfer learning technique for RL: Adapt-to-Learn, that utilizes adaptation of the source policy to target tasks. We demonstrated on nonlinear and continuous robotic locomotion tasks that learning to adapt source policy to the target domain leads to a significant reduction in sample complexity over the prevalent jump-start based approaches. We further also proved theoretical guarantees on the reduced sample complexity of our proposed architecture. There are many exciting directions for future work. A network of policies that can generalize across multiple tasks could be learned based on each new adapted policies. How to train this end-to-end is an important question for meta-learning. The ability of Adapt-to-Learn to handle significant perturbations to the transition model indicates that it should naturally extend to sim-to-real transfer. Indeed we argue that such adaptation is necessary for real-world robotics, as has been established previously in classical domains like flight control. Another exciting direction is to extend the work to other combinatorial domains (e.g., multiplayer games). We expect, therefore follow on work will find other exciting ways of exploiting such adaptation in RL and machine learning.

Mengyuan Yan, Iuri Frosio, Stephen Tyree, and Jan Kautz. Sim-to-real transfer of accurate grasping with eye-in-hand observations and continuous control. arXiv preprint arXiv:1712.03303, 2017.

Henry Zhu, Abhishek Gupta, Aravind Rajeswaran, Sergey Levine, and Vikash Kumar. Dexterous manipulation with deep reinforcement learning: Efficient, general, and low-cost. arXiv preprint arXiv:1810.06045, 2018.

A TOTAL RETURN GRADIENT WITH RESPECT TO POLICY PARAMETERS:

The total return which we aim to maximize in adapting the source policy to target is the mixture of environmental rewards and Intrinsic KL divergence reward as follows,

EQUATION

he adaptive policy update methods work by computing an estimator of the gradient of the return and plugging it into a stochastic gradient ascent algorithm.

EQUATION

θ = θ + αĝ

where α is the learning rate and ĝ is the empirical estimate of the gradient of the total discounted return η KL . The derivation of the gradient term is exactly same as for policy gradient methods.

Taking the derivative of the total return term

∇ θ (η KL ) = E st,at∼τ ∇ θ p π θ (τ ) H t=0 r t .

Consider the term ∇ θ p π θ (τ ) and evaluate the derivative. Lets consider the term log p π θ (τ ). Using the definition of p π θ (τ ) and we can write the log term as

log p π θ (τ ) = log(ρ 0 π θ (a 0 |s 0 )p T (s 1 |s 0 , a 0 ) . . .) log p π θ (τ ) = log(ρ 0 ) + H t=0 log π θ (a t |s t ) + H t=0 p T (s t+1 |s t , a t ).

Taking the derivative wrto θ we can write,

∇ θ log p π θ (τ ) = H t=0 ∇ θ log π θ (a t |s t ) ∇ θ p π θ (τ ) p π θ (τ ) = H t=0 ∇ θ log π θ (a t |s t ).

Therefore we can write

∇ θ p π θ (τ ) = p π θ (τ ) H t=0 ∇ θ log π θ (a t |s t )

Substituting the above expression we can write the total gradient as,

∇ θ (η KL ) = E pπ θ H t=0 ∇ θ log π θ (a t |s t ) H t=0 r t .

B PROOF OF THEOREM-4.1

Theorem B.1 If the induced class L Π has uniform convergence in empirical mean property then empirical risk minimization is PAC.

For notation simplicity we drop the superscript T (for Target domain) and subscript θ (policy parameters) in further analysis. Unless stated we will using following simplifications π * = π * T θ and π * = π * T θ .

Proof Fix , δ > 0 we will show that for sufficiently large n ≥ n( , δ)

P n (P (η KL,π * ) -P (η KL,π * ) ≥ ) ≤ δ (18)

Let π * ∈ Π be the minimizer of true return P (η KL ), further adding and subtracting the terms P Z n (η KL,π * ) and P Z n (η KL,π * ) we can write

EQUATION

We can divide the above expression in three terms

1. P (η KL,π * ) -P Z n (η KL,π * ) 2. P Z n (η KL,π * ) -P Z n (η KL,π * ) 3. P Z n (η KL,π * ) -P (η KL,π * )

Lets consider the term P Z n (η KL,π * )-P Z n (η KL,π * ) in the above expression is always negative semidefinite, since π * is a maximizer wrto P Z n (η KL ), hence P Z n (η KL,π * ) ≤ P Z n (η KL,π * ) always, i.e

P Z n (η KL,π * ) -P Z n (η KL,π * ) ≤ 0

Next the 1st term can be bounded as

P (η KL,π * ) -P Z n (η KL,π * ) ≤ sup π∈Π [P Z n (η KL ) -P (η KL )] ≤ sup π∈Π P Z n (η KL ) -P (η KL )

Similarly upper bound can be written for the 3rd term Therefore we can upper bound the above expression as

EQUATION

From Equation-(18) we have

EQUATION

Using McDiarmids inequality and union bound, we can state the probability of this event as

P n ( P Z n (η KL ) -P (η KL ) ≥ /2) ≤ 2|Π|e -n 2 2C 2 H 2 (22)

where C is bound on state space S and H is horizon length. The finite difference bound C is obtained assuming transition p T , p S follow a Gaussian distributions and the i.i.d trajectories collected are of maximum H length.

Equating the RHS of the expression to δ and solving for n we get

EQUATION

for n ≥ n( , δ) the probability of receiving a bad sample is less than δ. The total number of observed transition is of order O(nH). Refer supplementary document for details of the proof.

C PROOF OF LEMMA-4.3

Lemma C.1 Given M * , M and value function V π * M * , V π * M

the following bound holds

V π * M * -V π * M ∞ ≤ γ (1-γ) 2 .

Here max s,a p(.|s, a) -p * (.|s, a) ≤ and p and p * are transition of MDP M , M * respectively.

Note we are deviating from finite horizon assumption and using γ. To be consistent with previous section we can assume the horizon length H = log γ v 2Vmax . Where v is truncation error in total infinite return.

where R max = 1, therefore we can write the complete expression as ) and M i = M 0 + 0.5cos( πi 50 ), where L 0 = 1, M 0 = 1 and i = 1 . . . N . The state variables describing the system are angle and angular velocity {θ, θ} ∈ [-π, π]. The RL objective is to swing-up and balance the pendulum upright such that θ = 0, θ = 0. The reward function is selected as R(θ, θ) = -10|θ| 2 -5| θ| 2 , which yields maximum value at upright position and minimum at the down-most position. The continuous action space is bounded by T ∈ [-1, 1]. Note that the domain is tricky, since full throttle action is assumed to not generate enough torque to be able to swing the pendulum to the upright position, hence, the agent must learn to swing the pendulum back and forth and leverages angular momentum to go to the upright position.

|V π * M (s) -V π * M * (s)| ∞ ≤ γ (1 -γ) 2 ρ 0 s 0 s 1 s 2 s 2 s 3 s 3 s 1 a0 ∼ πθ ( s0 ) a 1 a 2 a 0 ∼ π * ( s o ) a 1 a 2 p S ( s 1 |s 0 , a 0 ) p T ( s1 | s0 , a0 )

D.2 ROBUSTNESS TO NEGATIVE TRANSFER:

We demonstrate that the proposed transfer is robust to negative transfers, that is, cases in transfer learning where naive initialization of the target using source policy could be detrimental. We demonstrate this through an inverted pendulum upright balance task with the sign of control flipped. That is, we use an inverted pendulum model as both source and target systems, but the target is the inverse of the source model with the sign of the control action flipped. It should be noted that dealing with a change of sign in control has been considered a highly challenging problem in adaptive control Chowdhary et al. (2013) . We demonstrate that ATL is immune to negative transfers. Also, the samples observed by UMA-TL in learning the task is much higher compared to no transfer (RL) and proposed ATL methods. If the source and target are not sufficiently related or the features of source task do not correspond to the target, the transfer may not improve or even decrease the performance in target task leading to negative transfer. We show that the UMA-TL suffers from a negative transfer in these results, whereas the performance of presented ATL is much superior compared to UMA-TL and RL(learning from scratch).

E CROSS DOMAIN TRANSFER:

E.1 CART-POLE TO BICYCLE:

Bicycle balancing is a challenging physical problem, especially when the bicycle velocity is below the critical velocity V c = 4m/s to 5m/s. We set the bicycle velocity to be V < V c i.e., V = 2.778m/s such that the bicycle becomes unstable, and active control is required to maintain stability. The simulation itself is very high fidelity and realistic, which was designed for studying the physics of the bicycle. We use the Cart-Pole as source task for learning to balance a bicycle. The bicycle balance problem in principle is similar to that of cart-pole, since the objective is to keep the unstable system upright. The objective of balance is achieved in both the systems by moving in the direction of fall, which is termed as a non-minimum phase behavior in the controls system literature. The control in the cart pole affects the angle of the pole, by moving the cart such that it is always under the pole. In the bicycle, the control is to move the handlebar in the direction of fall. However, balancing the bike is not straightforward, to turn the bike under itself, one must first steer in the other direction before turning in the direction of fall; this is called counter-steering Åström et al. (2005) . We observe that both cart pole and bicycle have this commonality in their dynamical behaviors, as both the system have a non-minimum phase that is the presence of unstable zero. This similarity qualifies the cartpole system as an appropriate choice of source model for bicycle balance task.

Cart pole is characterized by state vector [x, ẋ, θ, θ], i.e., position, the velocity of cart and angle, angular velocity of the pendulum. The action space is the force applied to the cart F ∈ [-1N, 1N ].

For the mapping between the state space of bicycle and cart pole model, we use Unsupervised Manifold Alignment(UMA) to obtain this mapping Wang & Mahadevan (2009) . We do not report

:



Figures and Tables:

Figure 1: Learning curves for locomotion tasks, averaged across three runs of each algorithm with random Initialization for RL, warm initialization using source policy for ATL and Jumpstart(Warm-Start) methods and Source policy performance in Target Task without any adaptation.

Figure 3: Target Trajectory under policy π θ and local trajectory deviation produced by source optimal policy π * and source transition p S

Figure 4: Policy Transfer from Inverted Pendulum to Non-stationary Inverted pendulum: (a) Average Rewards and (b) Training length, TA-TL(ATL ours), UMA-TL(Jumpstart-RL) and Stand-alone RL



Figure 5: Negative Transfer Inverted Pendulum: (a) Average Reward and (b) Training length

Figure 7: (a) Cart-Pole and Bicycle Domain (b)Average Rewards for TA-TL (ours), UMA-TL (jumpstart) and RL

Transition Model and environment properties for Source and Target task and % change

Table content: <table><tr><td>Env</td><td>Property</td><td colspan="3">source Target %Change</td></tr><tr><td>Hopper</td><td>Floor Friction</td><td>1.0</td><td>2.0</td><td>+100%</td></tr><tr><td>HalfCheetah</td><td>gravity</td><td>-9.81</td><td>-15</td><td>+52%</td></tr><tr><td/><td>Total Mass</td><td>14</td><td>35</td><td>+150%</td></tr><tr><td/><td>Back-Foot Damping</td><td>3.0</td><td>1.5</td><td>-100%</td></tr><tr><td/><td>Floor Friction</td><td>0.4</td><td>0.1</td><td>-75%</td></tr><tr><td>Walker2d</td><td>Density</td><td>1000</td><td>1500</td><td>+50%</td></tr><tr><td/><td>Right-Foot Friction</td><td>0.9</td><td>0.45</td><td>-50%</td></tr><tr><td/><td>Left-Foot Friction</td><td>1.9</td><td>1.0</td><td>-47.37%</td></tr></table>

Policy Network details and Network learning parameter details

Table content: <table><tr><td/><td>Hopper</td><td colspan="2">Walker2d HalfCheetah</td></tr><tr><td>State Space</td><td>12</td><td>18</td><td>17</td></tr><tr><td>Control Space</td><td>3</td><td>6</td><td>6</td></tr><tr><td>Number of layers</td><td>3</td><td>3</td><td>3</td></tr><tr><td>Layer Activations</td><td>tanh</td><td>tanh</td><td>tanh</td></tr><tr><td>Total num. of network params</td><td>10530</td><td>28320</td><td>26250</td></tr><tr><td>Discount</td><td>0.995</td><td>0.995</td><td>0.995</td></tr><tr><td>Learning rate</td><td colspan="2">1.5×10 -5 8.7×10 -6</td><td>9×10 -6</td></tr><tr><td>β init</td><td>1.0</td><td>1.0</td><td>1.0</td></tr><tr><td>β-anneal coeff</td><td>0.998</td><td>0.998</td><td>0.998</td></tr><tr><td>Batch size</td><td>20</td><td>20</td><td>5</td></tr><tr><td>Policy Iter</td><td>3000</td><td>5000</td><td>1500</td></tr></table>

Peer review (iclr2020):
Summary ------- The authors propose an algorithm for transferring policies across domains differing in their transition model. The idea is to *regularize* the target policy being learned to generate a trajectory distribution similar to the one induced by the source optimal policy in the respective MDP. The method is proved effective in standard simulated robotic tasks (Mujoco). Major comments -------------- The problem of transfer in RL is fundamental for scaling RL algorithms to real domains. The presented ideas are interesting and could potentially inspire other works in this field. The paper is well-written and easy to read. However, I believe there might be some technical issues with the derivations that overall make me doubt about the significance of this work. My detailed comments follow. 1. Under Assumption 1, the step from (6) to (7) seems flawed. The definition of the KL divergence requires that p is absolutely continuous w.r.t. q. However, under Ass. 1, whenever the trajectory 	au contains an action that is not taken by pi^*, q(	au) = 0, which implies that p(	au) must be zero as well. The only way to enforce this is to set pi_	heta = pi^*, and the solution is trivial. The main issue is that (6) writes the log term of the KL using different action random variables for the numerator and the denominator (a and a*), but these must be the same. Therefore, one cannot simply set to 1 the optimal source actions. Notice also that the action space is defined continuous, hence the value of the pdf in the chosen deterministic action is infinity, not 1. 2. (12) seems to be wrong too. Note that the reward function defined here (r*) contains the policy, hence it is a function of 	heta and must be differentiated. So the standard REINFORCE estimator written here does not work theoretically. 3. Assumption 2 basically requires that either we can get new samples from the source domain *on-demand*, or we have a good simulated model. Both assumptions are often violated in practice. Could the authors elaborate more on why they believe these assumptions to be reasonable? 4. Related to the previous point, assuming the one-step transition models to be Gaussian is convenient, and often reasonable, in practice. But how do we choose the std sigma? What if the true models are deterministic? 5. I would disagree with the last sentence of section 3.2.1, which states that minimizing the KL divergence is more sample efficient than standard RL/policy-search methods. One can always define an MDP where the immediate reward is the KL term and that is a standard RL problem. Furthermore, if we compute the expected return when the reward is (8), decomposing the log into the sum of two logs, one of the two expectations we obtain is of the form: E_pi[-(s_{t+1} -s*_{t+1})^2], which is a standard *tracking* problem. 6. I was quite confused by the theoretical section. The introduction states that the proposed method enjoys a sample complexity of O(nH), where I guess n is the number of state-action pairs. Where does that dependence appear in Section 4? Theorem 4.1 is a standard supervised learning bound. How do we read that in RL? What is C? Is |Pi| the cardinality of the set of policies (assumed finite)? Or is it the pseudo-dimension of the policy space? Lemma 4.3 is also a know result in the literature, but what does it tell us about the proposed approach? The idea is that if I have an accurate model hat{p} I am also close in value function to the true MDP. But what is hat{p} here? The proposed algorithm is not computing any explicit transition model. Minor comments -------------- - In the last sentence of the introduction, it is not clear what n is in O(nH) - In the preliminaries, is the reward R: S x A -> R_+ assumed to be positive or is that a typo? - MDPs are defined with a discount factor gamma which is however missing in (1) and the next equation (V) - In the preliminaries, it is not clear whether the rewards differ or not between domains. It is important to specify that they do not. - In (2), T is defined to map R^n -> R^n. What is n? Is it the number of discrete states? Wasn*t the state space continuos? - I noticed that many sentences in the paper begin without a space after the period of the previous sentence. - In section 3, the KL divergence (e.g., eq. 3,7) is written as an expectation that contains the pdf p(	au). Either only the log term is written in the expectation, or E is replaced by an integral. - In (12), the sum should be up to H and not infinity