Compatible Natural Gradient Policy Search

Joni Pajarinen, Hong Linh Thai, Riad Akrour, Jan Peters, Gerhard Neumann

Introduction

The natural gradient (Amari, 1998) is an integral part of many reinforcement learning (Kakade, 2001; Bagnell and Schneider, 2003; Peters and Schaal, 2008; Geist and Pietquin, 2010) and optimization (Wierstra et al., 2008) algorithms. Due to the natural gradient, gradient updates become invariant to affine transformations of the parameter space and the natural gradient is also often used to define a trust-region for the policy update. The trust-region is defined by a bound of the Kullback-Leibler (KL) (Peters et al., 2010; Schulman et al., 2015) divergence between new and old policy and it is well known that the Fisher information matrix, used to compute the natural gradient is a second order approximation of the KL divergence. Such trust-region optimization is common in policy search and has been successfully used to optimize neural network policies.

However, many properties of the natural gradient are still under-explored, such as compatible value function approximation (Sutton et al., 1999) for neural networks, the approximation quality of the KL-divergence and the online performance of the natural gradient. We analyze the convergence of the natural gradient analytically and empirically and show that the natural gradient does not give fast convergence properties if we do not add an entropy regularization term. This entropy regularization term results in a new update rule which ensures that the policy looses entropy at the correct pace, leading to convergence to a good policy. We further show that the natural gradient is the optimal (and not the approximate) solution to a trust region optimization problem for log-linear models if the natural parameters of the distribution are optimized and we use compatible value function approximation.

We analyze compatible value function approximation for neural networks and show that the components of this approximation are composed of two terms, a state value function which is subtracted from a state-action value function. While it is well known that the compatible function approximation denotes an advantage function, the exact structure was unclear. We show that using compatible value function approximation, we can derive similar algorithms to Trust Region Policy Search that obtain the policy update in closed form. A summary of our contributions is as follows:

It is well known that the second-order Taylor approximation to trust-region optimization with a KL-divergence bound leads to an update direction identical to the natural gradient. However, what is not known is that when using the natural parameterization for an exponential policy and using compatible features we can compute the step-size for the natural gradient that solves the trust-region update exactly for the log-linear parameters.

When using an entropy bound in addition to the common KL-divergence bound, the compatible features allow us to compute the exact update for the trust-region problem in the log-linear case and for a Gaussian policy with a state independent covariance we can compute the exact update for the covariance also in the non-linear case.

Our new algorithm called Compatible Policy Search (COPOS), based on the above insights, outperforms comparison methods in both continuous control and partially observable discrete action experiments due to entropy control allowing for principled exploration.

Preliminaries

This section discusses background information needed to understand our compatible policy search approach. We first go into Markov decision process (MDP) basics and introduce the optimization objective. We continue by showing how trust region methods can help with challenges in updating the policy by using a KL-divergence bound, continue with the classic policy gradient update, introduce the natural gradient and the connection to the KL-divergence bound. Moreover, we introduce the compatible value function approximation and connect it to the natural gradient. Finally, this section concludes by showing how the optimization problem resulting from using an entropy bound to control exploration can be solved.

The expected reward can be defined as (Schulman et al., 2015)

where pπ(s)p_{\pi}(\boldsymbol{s}) denotes a (discounted) state distribution induced by policy π\pi and

denote the state-action value function Qπ(st,at)Q^{\pi}(\boldsymbol{s}_{t},\boldsymbol{a}_{t}), value function Vπ(st)V^{\pi}(\boldsymbol{s}_{t}), and advantage function Aπ(st,at)A^{\pi}(\boldsymbol{s}_{t},\boldsymbol{a}_{t}).

The goal in policy search is to find a policy π(a∣s)\pi(\boldsymbol{a}|\boldsymbol{s}) that maximizes Eq. (1). Usually, policy search computes in each iteration a new improved policy π\pi based on samples generated using the old policy πold\pi_{\textrm{old}} since maximizing Eq. (1) directly is too challenging. However, since the estimates for pπ(s)p_{\pi}(\boldsymbol{s}) and Qπ(s,a)Q^{\pi}(\boldsymbol{s},\boldsymbol{a}) are based on the old policy, that is, pπold(s)p_{\pi_{\textrm{old}}(\boldsymbol{s})} and Qπold(s,a)Q^{\pi_{\textrm{old}}}(\boldsymbol{s},\boldsymbol{a}) are actually used in Eq. (1), they may not be valid for the new policy. A solution to this is to use Trust-Region Optimization methods which keep the new policy sufficiently close to the old policy. Trust-Region Optimization for policy search was first introduced in the relative entropy policy search (REPS) algorithm (Peters et al., 2010). Many variants of this algorithm exist (Akrour et al., 2016; Abdolmaleki et al., 2015; Daniel et al., 2016; Akrour et al., 2018). All these algorithms use a bound for the KL-divergence of the policy update which prevents the policy update from being unstable as the new policy will not go too far away from areas it has not seen before. Moreover, the bound prevents the policy from being too greedy. Trust region policy optimization (TRPO) (Schulman et al., 2015) uses this bound to optimize neural network policies. The policy update can be formulated as finding a policy that maximizes the objective in Eq. (1) under the KL-constraint:

where Qπold(s,a)Q^{\pi_{\textrm{old}}}(\boldsymbol{s},\boldsymbol{a}) denotes the future accumulated reward values of the old policy πold\pi_{\textrm{old}}, pπold(s)p_{\pi_{\textrm{old}}}(\boldsymbol{s}) the (discounted) state distribution under the old policy, and ϵ\epsilon is a constant hyper-parameter. For an ϵ\epsilon small enough the state-value and state distribution estimates generated using the old policy are valid also for the new policy since the new and old policy are sufficiently close to each other.

Policy Gradient. We consider parameterized policies πθ(a∣s)\pi_{\boldsymbol{\theta}}(\boldsymbol{a}|\boldsymbol{s}) with parameter vector θ\boldsymbol{\theta}. A policy can be improved by modifying the policy parameters in the direction of the policy gradient which is computed w.r.t. Eq. (1). The "vanilla" policy gradient (Williams, 1992; Sutton et al., 1999) obtained by the likelihood ratio trick is given by

The Q-values can be computed by Monte-Carlo estimates (high variance), that is, Qπold(st,at)≈∑h=0∞γhrt+hQ^{\pi_{\textrm{old}}}(\boldsymbol{s}_{t},\boldsymbol{a}_{t})\approx\sum_{h=0}^{\infty}\gamma^{h}r_{t+h} or estimated by policy evaluation techniques (typically high bias). We can further subtract a state-dependent baseline V(s)V(\boldsymbol{s}) which decreases the variance of the gradient estimate while leaving it unbiased, that is,

Peters and Schaal (2008) showed that in the case of compatible value function approximation, the inverse of the Fisher information matrix cancels with the matrix spanned by the compatible features and, hence, ∇θJNAC=η−1w∗\nabla_{\boldsymbol{\theta}}J_{\textrm{NAC}}=\eta^{-1}\boldsymbol{w}^{*}. Another interesting observation is that the compatible value function approximation is in fact not an approximation for the Q-function but for the advantage function Aπold(s,a)=Qπold(s,a)−Vπold(s)A^{\pi_{\textrm{old}}}(\boldsymbol{s},\boldsymbol{a})=Q^{\pi_{\textrm{old}}}(\boldsymbol{s},\boldsymbol{a})-V^{\pi_{\textrm{old}}}(\boldsymbol{s}) as the compatible features are always zero mean. In Section 3, we show how with compatible value function approximation the natural gradient directly gives us an exact solution to the trust region optimization problem instead of requiring a search for the update step size to satisfy the KL-divergence bound in trust region optimization.

Entropy Regularization. Recently, some approaches (Abdolmaleki et al., 2015; Akrour et al., 2016; Mnih et al., 2016; O’Donoghue et al., 2016) use an additional bound for the entropy of the resulting policy. The entropy bound can be beneficial since it allows to limit the change in exploration potentially preventing greedy policy convergence. The trust region problem is in this case given by

where the second constraint limits the expected loss in entropy (H()H() denotes Shannon entropy in the discrete case and differential entropy in the continuous case) for the new distribution (applying an entropy constraint only on π(a∣s)\pi(\boldsymbol{a}|\boldsymbol{s}) but adjusting β\beta according to πold(a∣s)\pi_{\textrm{old}}(\boldsymbol{a}|\boldsymbol{s}) is equivalent in (Akrour et al., 2016, 2018)). The policy update rule can be formed for the constrained optimization problem by using the method of Lagrange multipliers:

where η\eta and ω\omega are Lagrange multipliers (Akrour et al., 2016). η\eta is associated with the KL-divergence bound ϵ\epsilon and ω\omega is related to the entropy bound β\beta. Note that, for ω=0\omega=0, the entropy bound is not active and therefore, the solution is equivalent to the standard trust region solution. It has been realized that the entropy bound is needed to prevent premature convergence issues connected with the natural gradient. We show that these premature convergence issues are inherent to the natural gradient as it always reduces entropy of the distribution. In contrast, entropy control can prevent this.

Compatible Policy Search with Natural Parameters

In this section, we analyze the natural gradient update equations for exponential family distributions. This analysis reveals an important connection between the natural gradient and the trust region optimization: Both are equivalent if we use the natural parameterization of the distribution in combination with compatible value function approximation. This is an important insight as the natural gradient now provides the optimal solution for a given trust region, not just an approximation which is commonly believed: for example, Schulman et al. (2015) have to use line search to fit the natural gradient update to the KL-divergence bound. Moreover, this insight can be applied together with the entropy bound to control policy exploration and get a closed form update in the case of compatible log-linear policies. Furthermore, the use of compatible value function approximation has several advantages in terms of variance reduction which can not be achieved with the plain Monte-Carlo estimates which we leave for future work. We also present an analysis of the online performance of the natural gradient and show that entropy regularization can converge exponentially faster. Finally, we present our new algorithm for Compatible Policy Search (COPOS) which uses the insights above.

We first consider soft-max distributions that are log-linear in the parameters (for example, Gaussian distributions or the Boltzmann distribution) and subsequently extend our results to non-linear soft-max distributions, for example given by neural networks. A log-linear soft-max distribution can be represented as

Note that also Gaussian distributions can be represented this way (see, for example, Eq. (9)), however, the natural parameterization is commonly not used for Gaussian distributions. Typically, the Gaussian is parameterized by the mean μ\boldsymbol{\mu} and the covariance matrix Σ\boldsymbol{\Sigma}. However, the natural parameterization and our analysis suggest that the precision matrix B=Σ−1\boldsymbol{B}=\boldsymbol{\Sigma}^{-1} and the linear vector b=Σ−1μ\boldsymbol{b}=\boldsymbol{\Sigma}^{-1}\boldsymbol{\mu} should be used to benefit from many beneficial properties of the natural gradient.

It makes sense to study the exact form of the compatible approximation for these log-linear models. The compatible features are given by

Furthermore, the suggested update is equivalent to the natural gradient update: The natural gradient is the optimal solution for a given trust region problem and not just an approximation. However, this statement only holds if we use natural parameters and compatible value function approximation. Moreover, the update needs only the Q-function part of the compatible function approximation.

We can do a similar analysis for the optimization problem with entropy regularization given in Eq. (4) using Eq. (5). The optimal policy given the compatible value function approximation is now given by

In comparison to the standard natural gradient, the influence of the old parameter vector is diminished by the factor η/(η+ω)\eta/(\eta+\omega) which will play an important role for our further analysis.

2 Compatible Approximation for Neural Networks

So far, we have only considered models that are log-linear in the parameters (ignoring the normalization constant). For more complex models, we need to introduce non-linear parameters β\boldsymbol{\beta} for the feature vector, that is, ψ(s,a)=ψβ(s,a)\boldsymbol{\psi}(\boldsymbol{s},\boldsymbol{a})=\boldsymbol{\psi}_{\boldsymbol{\beta}}(\boldsymbol{s},\boldsymbol{a}). We are in particular interested in Gaussian policies in the continuous case and softmax policies in the discrete case as they are the standard for continuous and discrete actions, respectively. In the continuous case, we could either use a Gaussian with a constant variance where the mean is parameterized by a neural network, a non-linear interpolation linear feedback controllers with Gaussian noise or also Gaussians with state-dependent variance. For simplicity, we will focus on Gaussians with a constant covariance Σ\boldsymbol{\Sigma} where the mean is a product of neural network (or any other non-linear function) features φi(s)\varphi_{i}(\boldsymbol{s}) and a mixing matrix K\boldsymbol{K} that could be part of the neural network output layer. The policy and the log policy are then

where K=(k1,…,kN)\boldsymbol{K}=(\boldsymbol{k}_{1},\dots,\boldsymbol{k}_{N}) and U=KTΣ−1\boldsymbol{U}=\boldsymbol{K}^{T}\boldsymbol{\Sigma}^{-1}. To compute ψ(s,a)\boldsymbol{\psi}(\boldsymbol{s},\boldsymbol{a}) we note that

To get ψ(s,a)\boldsymbol{\psi}(\boldsymbol{s},\boldsymbol{a}) we note that some parts of Eq.(9) and thus of ∇θlog⁡πθ(a∣s)\nabla_{\boldsymbol{\theta}}\log\pi_{\boldsymbol{\theta}}(\boldsymbol{a}|\boldsymbol{s}) do not depend on a\boldsymbol{a}. We ignore those parts for computing ψ(s,a)\boldsymbol{\psi}(\boldsymbol{s},\boldsymbol{a}) since ψ(s,a)θ\boldsymbol{\psi}(\boldsymbol{s},\boldsymbol{a})\boldsymbol{\theta} is the state-action value function and action independent parts of the state-action value function do not influence the optimal action choice. Thus we get

We then take the gradient w.r.t. the log-linear parameters θ=(Σ−1,U)\boldsymbol{\theta}=(\boldsymbol{\Sigma}^{-1},\boldsymbol{U}) resulting in ∇Σ−1log⁡π^(a∣s)=−0.5aaT\nabla_{\boldsymbol{\Sigma}^{-1}}\log\hat{\pi}(\boldsymbol{a}|\boldsymbol{s})=-0.5\boldsymbol{a}\boldsymbol{a}^{T}, ∇Ulog⁡π^(a∣s)=aφ(s)T\nabla_{\boldsymbol{U}}\log\hat{\pi}(\boldsymbol{a}|\boldsymbol{s})=\boldsymbol{a}\boldsymbol{\varphi}(\boldsymbol{s})^{T}, and ψ(s,a)=[−vec[0.5aaT],vec[aφ(s)T]]T\boldsymbol{\psi}(\boldsymbol{s},\boldsymbol{a})=[-\textrm{vec}[0.5\boldsymbol{a}\boldsymbol{a}^{T}],\textrm{vec}[\boldsymbol{a}\boldsymbol{\varphi}(\boldsymbol{s})^{T}]]^{T}, where vec[⋅]\textrm{vec}[\cdot] concatenates matrix columns into a column vector.

Note that the variances and the linear parameters of the mean are contained in the parameter vector θ\boldsymbol{\theta} and can be updated by the update rule in Eq. (7) explained above. However, for obtaining the update rules for the non-linear parameters β\boldsymbol{\beta}, we first have to compute the compatible basis, that is,

Note that due to the log⁡\log operator the derivative is linear w.r.t. log-linear parameters θ\boldsymbol{\theta}. For the Gaussian distribution in Eq. (8) the gradient of the action dependent parts of the log policy in Eq. (11) become

Now, in order to find the update rule for the non-linear parameters we will write the update rule for the policy using Eq. (5), and, using the value function formed by multiplying the compatible basis in Eq. (11) by wβ\boldsymbol{w}_{\beta} which is the part of the compatible approximation vector that is responsible for β\boldsymbol{\beta}:

where we dropped action independent parts, which can be seen as part of the distribution normalization, from Eq. (12) to Eq. (13). Note that Eq. (15) represents the first order Taylor approximation of Eq.( 14) at wβ/η=0\boldsymbol{w}_{\boldsymbol{\beta}}/\eta=0. Moreover, note that rescaling of the energy function ψβ(s,a)θ\boldsymbol{\psi}_{\boldsymbol{\beta}}(\boldsymbol{s},\boldsymbol{a})\boldsymbol{\theta} is implemented by the update of the parameters θ\boldsymbol{\theta} and hence can often be ignored for the update for β\boldsymbol{\beta}. The approximate update rule for β\boldsymbol{\beta} is thus

Hence, we can conclude that the natural gradient is an approximate trust region solution for the non-linear parameters β\boldsymbol{\beta} as the first order Taylor approximation of the energy function is replaced by the real energy function after the update. Still, for the parameters θ\boldsymbol{\theta}, which in the end dominate the mean and covariance of the policy, the natural gradient is the exact trust region solution.

3 Compatible Value Function Approximation in Practice

Algorithm 1 shows the Compatible Policy Search (COPOS) approach (see Appendix B for a more detailed description of the discrete action algorithm version). In COPOS, for the policy updates in Eq. (7) and Eq. (16), we need to find w\boldsymbol{w}, η\eta, and ω\omega. For estimating w\boldsymbol{w} we could use the compatible function approximation. In this paper, we do not estimate the value function explicitly but instead estimate w\boldsymbol{w} as a natural gradient using the conjugate gradient method which removes the need for computing the inverse of the Fisher information matrix explicitly (see for example (Schulman et al., 2015)). As discussed before η\eta and ω\omega are Lagrange multipliers associated with the KL-divergence and entropy bounds. In the log-linear case with compatible natural parameters, we can compute them exactly using the dual of the optimization objective Eq. (4) and in the non-linear case approximately. In the continuous action case, the basic dual includes integration over both actions and states but we can integrate over actions in closed form due to the compatible value function: we can eliminate terms which do not depend on the action. The dual resolves into an integral over just states allowing computing η\eta and ω\omega efficiently. Please, see Appendix A for more details. Since η\eta is an approximation for the non-linear parameters, we performed in the experiments for the continuous action case an additional alternating optimization twice: 1) we did a binary search to satisfy the KL-divergence bound while keeping ω\omega fixed, 2) we re-optimized ω\omega (exactly, since ω\omega depends only on log-linear parameters) keeping η\eta fixed. For discrete actions it was sufficient to perform only an additional line search to update the non-linear parameters.

Analysis and Illustration of the Update Rules

For now, we will analyze the performance of the natural gradient if η\eta is a constant and not optimized for a given KL-bound. After nn update steps, the parameters of the policy are given by Bn=B0+nR/ηB_{n}=B_{0}+nR/\eta, bn=b0+nr/ηb_{n}=b_{0}+nr/\eta. The distance between the mean μn=Bn−1bn\mu_{n}=B_{n}^{-1}b_{n} of the policy and the optimal solution a∗a^{*} is

We can see that the learned solution approaches the optimal solution, however, very slowly and heavily depending on the precision B0B_{0} of the initial solution. The reason for this effect can be explained by the update rule of the precision. As we can see, the precision BnB_{n} is increased at every update step. This shrinking variance in turn decreases the step-size for the next update.

Entropy Regularization. Here we provide the derivation of dnd_{n} for the entropy regularization case. We perform a similar analysis for the entropy regularization update rule. We start with constant parameters η\eta and ω\omega and later consider the case with the trust region. The distance dn=μn−a∗d_{n}=\mu_{n}-a^{*} is again a function of nn. The updates for the entropy regularization result in the following parameters after nn iterations

The distance dn=μn−a∗d_{n}=\mu_{n}-a^{*} can again be expressed as a function of nn:

with c2>1c_{2}>1. Hence, also this update rule converges to the correct solution but contrary to the natural gradient, the part of the denominator that depends on nn grows exponentially. As the old parameter vector is always multiplied by a factor smaller than one, the influence of the initial precision matrix B0B_{0} vanishes while B0B_{0} dominates natural gradient convergence. While the natural gradient always decreases variance, entropy regularization avoids the entropy loss and can even increase variance.

Empirical Evaluation of Constant Updates. We plotted the behavior of the algorithms, and standard policy gradient, for this simple toy task in Figure 1 (top). We use η=10\eta=10 and ω=1\omega=1 for the natural gradient and the entropy regularization and a learning rate of α=1000\alpha=1000 for the policy gradient. We estimate the standard policy gradients from 1000 samples. Entropy regularization performs favorably speeding up learning in the beginning by increasing the entropy. With constant parameters η\eta and ω\omega, the algorithm drives the entropy to a given target-value. The policy gradient performs better than the natural gradient as it does not reduce the variance all the time and even increases the variance. However, the KL-divergence of the standard policy gradient appears uncontrolled.

Empirical Evaluation of Trust Region Updates. In the trust region case, we minimized the Lagrange dual at each iteration yielding η\eta and ω\omega. We chose at each iteration the highest policy gradient learning rate where the KL-bound was still met. For entropy regularization we tested two setups: 1) We fixed the entropy of the policy (that is, γ=0\gamma=0), 2) The entropy of the policy was slowly driven to . Figure 1 (bottom) shows the results. The natural gradient still suffers from slow convergence due to decreasing the entropy of the policy gradually. The standard gradient again performs better as it increases the entropy outperforming even the zero entropy loss natural gradient. For entropy control, even more sophisticated scheduling could be used such as the step-size control of CMA-ES (Hansen and Ostermeier, 2001) as a heuristic that works well.

Related Work

Similar to classical reinforcement learning the leading contenders in deep reinforcement learning can be divided into value based-function methods such as Q-learning with deep Q-Network (DQN) (Mnih et al., 2015), actor-critic methods (Wu et al., 2017; Tangkaratt et al., 2018; Abdolmaleki et al., 2018), policy gradient methods such as deep deterministic policy gradient (DDPG) (Silver et al., 2014; Lillicrap et al., 2015) and policy search methods based on information theoretic / trust region methods, such as proximal policy optimization (PPO) (Schulman et al., 2017) and trust region policy optimization (TRPO) (Schulman et al., 2015).

Trust region optimization was introduced in the relative entropy policy search (REPS) method (Peters et al., 2010). TRPO and TNPG (Schulman et al., 2015) are the first methods to apply trust region optimization successfully to neural networks. In contrast to TRPO and TNPG, we derive our method from the compatible value function approximation perspective. TRPO and TNPG differ from our approach, in that they do not use an entropy constraint and do not consider the difference between the log-linear and non-linear parameters for their update. On the technical level, compared to TRPO, we can update the log-linear parameters (output layer of neural network and the covariance) with an exact update step while TRPO does a line search to find the update step. Moreover, for the covariance we can find an exact update to enforce a specific entropy and thus control exploration while TRPO does not bound the entropy, only the KL-divergence. PPO also applies an adaptive KL penalty term.

Kakade (2001); Bagnell and Schneider (2003); Peters and Schaal (2008); Geist and Pietquin (2010) have also suggested similar update rules based on the natural gradient for the policy gradient framework. Wu et al. (2017) applied approximate natural gradient updates to both the actor and critic in an actor-critic framework but did not utilize compatible value functions or an entropy bound. Peters and Schaal (2008); Geist and Pietquin (2010) investigated the idea of compatible value functions in combination with the natural gradient but used manual learning rates instead of trust region optimization. The approaches in (Abdolmaleki et al., 2015; Akrour et al., 2016) use an entropy bound similar to ours. However, the approach in (Abdolmaleki et al., 2015) is a stochastic search method, that is, it ignores sequential decisions and views the problem as black-box optimization, and the approach in (Akrour et al., 2016) is restricted to trajectory optimization. Moreover, both of these approaches do not explicitly handle non-linear parameters such as those found in neural networks. The entropy bound used in (Tangkaratt et al., 2018) is similar to ours, however, their method depends on second order approximations of a deep Q-function, resulting in a much more complex policy update that can suffer from the instabilities of learning a non-linear Q-function.

For exploration one can in general add an entropy term to the objective. In the experiments, we compare against TRPO with this additive entropy term. In preliminary experiments, to control entropy in TRPO, we also combined the entropy and KL-divergence constraints into a single constraint without success.

Experiments

In the experiments, we focused on investigating the following research question: Does the proposed entropy regularization approach help to improve performance compared to other methods which do not control the entropy explicitly? For selecting comparison methods we followed (Duan et al., 2016) and took four gradient based methods: Trust Region Policy Optimization (TRPO) (Schulman et al., 2015), Truncated Natural Policy Gradient (Duan et al., 2016; Schulman et al., 2015), REINFORCE (VPG) (Williams, 1992), Reward-Weighted Regression (RWR) (Kober and Peters, 2009) and two gradient-free black box optimization methods: Cross Entropy Method (CEM) (Rubinstein, 1999), Covariance Matrix Adaption Evolution Strategy (CMA-ES) (Hansen and Ostermeier, 2001). We used rllab http://rllab.readthedocs.io/en/latest/ for algorithm implementation. We ran experiments in both challenging continuous control tasks and discrete partially observable tasks which we discuss next.

Continuous Tasks. In the continuous case, we ran experiments in eight different Roboschool https://github.com/openai/roboschool environments which provide continuous control tasks of increasing difficulty and action dimensions without requiring a paid license.

We ran all evaluations, 1010 random seeds for each method, for 10001000 iterations of 1000010000 samples each. In all problems, we used the Gaussian policy defined in Eq. (8) for COPOS and TRPO (denoted by π1(a∣s)\pi_{1}(a|s)) with max⁡(10,action dimensions)\max(10,\textrm{action dimensions}) neural network outputs as basis functions, a neural network with two hidden layers each containing 3232 tanh-neurons, and a diagonal precision matrix. For TRPO and other methods, except COPOS, we also evaluated a policy, denoted for TRPO by π2(a∣s)\pi_{2}(a|s), where the neural network directly specifies the mean and the diagonal covariance is parameterized with log standard deviations. In the experiments, we used high identical initial variances (we tried others without success) for all policies. We set ϵ=0.01\epsilon=0.01 (Schulman et al., 2015) in all experiments. For COPOS we used two equality entropy constraints: β=ϵ\beta=\epsilon and β=\beta=auto. In β=\beta=auto, we assume positive initial entropy and schedule the entropy to be the negative initial entropy after 10001000 iterations. Since we always initialize the variances to one, higher dimensional problems have higher initial entropy. Thus β=\beta=auto reduces the entropy faster for high dimensional problems effectively scaling the reduction with dimensionality. Table 1 summarizes the results in continuous tasks: COPOS outperforms comparison methods in most of the environments. Fig. 2 and Fig. 3 show learning curves and performance of COPOS compared to the other methods. COPOS prevents both too fast, and, too slow entropy reduction while outperforming comparison methods. Table 4 in Appendix C shows additional results for experiments where different constant entropy bonuses were added to the objective function of TRPO without success, highlighting the necessity of principled entropy control.

Discrete control task. Partial observability often requires efficient exploration due to non-myopic actions yielding long term rewards which is challenging for model-free methods. The Field Vision Rock Sample (FVRS) (Ross et al., 2008) task is a partially observable Markov decision process (POMDP) benchmark task. For the discrete action experiments we used as policy a softmax policy with a fully connected feed forward neural network consisting of 2 hidden layers with 30 tanh nonlinearities each. The input to the neural network is the observation history and the current position of the agent in the grid. To obtain the hyperparameters β\beta, ϵ\epsilon, and the scaling factor for TRPO with additive entropy regularization, denoted with “TRPO ent reg”, we performed a grid search on smaller instances of FVRS. See Appendix B for more details about the setup. Results in Table 2 and Figure 4 show that COPOS outperforms the comparison methods due to maintaining higher entropy. FVRS has been used with model-based online POMDP algorithms (Ross et al., 2008) but not with model-free algorithms. The best model-based results in (Ross et al., 2008) (scaled to correspond to our rewards, COPOS in parentheses) are 2.2752.275 (1.941.94) in FVRS(5,5) and 2.342.34 (2.452.45) in FVRS(5,7).

Conclusions & Future Work

We showed that when we use the natural parameterization of a standard exponential policy distribution in combination with compatible value function approximation, the natural gradient and trust region optimization are equivalent. Furthermore, we demonstrated that natural gradient updates may reduce the entropy of the policy according to a schedule which can lead to premature convergence. To combat the problem of bad entropy scheduling in trust region methods we proposed a new compatible policy search method called COPOS that can control the entropy of the policy using an entropy bound. In both challenging high dimensional continuous and discrete tasks the approach yielded state-of-the-art results due to better entropy control. In future work, an exciting direction is to apply efficient approximations to compute the natural gradient (Bernacchia et al., 2018). Moreover, we have started work on applying the proposed algorithm in challenging partially observable environments found for example in autonomous driving where exploration and sample efficiency is crucial for finding high quality policies (Dosovitskiy et al., 2017).

Acknowledgements

This work was supported by EU Horizon 2020 project RoMaNS and ERC StG SKILLS4ROBOTS, project references #645582 and #640554, and, by German Research Foundation project PA 3179/1-1 (ROBOLEAP).

References

Appendix

Appendix A Solution for the Lagrange Multipliers

In order to compute a solution to the optimization objective with a KL-divergence and an entropy bound, we solve, using the dual of the problem, for the Lagrange multipliers associated with the bounds. We first discuss for the continuous action case how we optimize the multipliers exactly in the case of only log-linear parameters, continue with how we find an approximate solution in the case of also non-linear parameters, and then discuss the discrete action case.

Minimize the dual of the optimization objective (see e.g. Akrour et al. for a similar dual)

w.r.t. η\eta and ω\omega. Note that action independent parts of log⁡π(a∣s)\log\pi(\boldsymbol{a}|\boldsymbol{s}) in Eq. (18) do not have an effect on the choice of η\eta and ω\omega and we will discard them.

and kk is the dimensionality of actions. We got the end result by completing the square.

A.2 Computing η𝜂\eta and ω𝜔\omega for non-linear parameters

Similarly to the log-linear parameters we minimize the dual

w.r.t. η\eta and ω\omega. As before action independent parts of log⁡π(a∣s)\log\pi(\boldsymbol{a}|\boldsymbol{s}) in Eq. (18) do not have an effect on the choice of η\eta and ω\omega and we will discard them.

In our Linear Gaussian policy with constant covariance

where const=−(2π)k∣Σ∣\textrm{const}=-\sqrt{(2\pi)^{k}|\boldsymbol{\Sigma}|} and U=KTΣ−1\boldsymbol{U}=\boldsymbol{K}^{T}\boldsymbol{\Sigma}^{-1}. Therefore,

where we are able to split the equation into action-value and value parts depending on whether they depend on a\boldsymbol{a}. Using the action-value part ∂∂βφ(s)TUa\frac{\partial}{\partial\boldsymbol{\beta}}\boldsymbol{\varphi}(\boldsymbol{s})^{T}\boldsymbol{U}\boldsymbol{a} to estimate w3\boldsymbol{w}_{3} we get

where wa(s)T=w3T∂φ(s)T∂βU\boldsymbol{w}_{a}(s)^{T}=\boldsymbol{w}_{3}^{T}\frac{\partial\boldsymbol{\varphi}(\boldsymbol{s})^{T}}{\partial\boldsymbol{\beta}}\boldsymbol{U}. By completing the square we get

and kk is the dimensionality of actions.

A.3 Derivation of the dual for the discrete action case

To derive the dual of our trust region optimization problem with entropy regularization and discrete actions we start with following program, where we replaced the expectation with integrals and use the compatible value function for the returns.

Since we are in the discrete action case we will be using sums for the brevity of the derivation, but the same derivation can be also done with integrals. Using the method of Lagrange multipliers Boyd and Vandenberghe , we obtain following Lagrange

We differentiate now the Lagrange with respect to π(a∣s)\pi(\boldsymbol{a}|\boldsymbol{s}) and obtain following system

Setting it to zero and rearranging terms results in

where the last term can be seen as a normalization constant

Plugging Eq. (51) and Eq. (52) into Eq. (48) results in the dual (similar to Akrour et al. ) used for optimization

Appendix B Technical Details for Discrete Action Experiments

Here, we provide details on the experiments with discrete actions. Table 3 shows details on the hyper-parameters used in the Field Vision RockSample (FVRS) experiments and Algorithm 2 describes details on the discrete action algorithm.

Appendix C Additional Continuous Control Experiments with a TRPO Entropy Bonus

Table 4 shows additional results for continuous control in the Roboschool environment. In these experiments, an additonal entropy bonus is added to the objective function of TRPO.