G UIDE A CTOR -C RITIC FOR C ONTINUOUS C ONTROL
Anonymous authors
Paper under double-blind review
A BSTRACT
Actor-critic methods solve reinforcement learning problems by updating a parameterized policy known as an actor in a direction that increases an estimate of the expected return known as a critic.
However, existing actor-critic methods only use values or gradients of the critic to update the policy parameter.
In this paper, we propose a novel actor-critic method called the guide actor-critic (GAC).
GAC ﬁrstly learns a guide actor that locally maximizes the critic and then it updates the policy parameter based on the guide actor by supervised learning.
Our main theoretical contributions are two folds.
First, we show that GAC updates the guide actor by performing second-order optimization in the action space where the curvature matrix is based on the Hessians of the critic.
Second, we show that the deterministic policy gradient method is a special case of GAC when the Hessians are ignored.
Through experiments, we show that our method is a promising reinforcement learning method for continuous controls.
I NTRODUCTION
The goal of reinforcement learning is to learn an optimal policy that lets an agent achieve the maximum cumulative rewards known as the return (Sutton & Barto, 1998).
Reinforcement learning has been shown to be effective in solving challenging artiﬁcial intelligence tasks such as playing games (Mnih et al., 2015; Silver et al., 2016) and controlling robots (Deisenroth et al., 2013; Levine et al., 2016).
Reinforcement learning methods can be classiﬁed into three categories: value-based , policy-based , and actor-critic methods.
Value-based methods learn an optimal policy by ﬁrstly learning a value function that estimates the expected return.
Then, they infer an optimal policy by choosing an action that maximizes the learned value function.
Choosing an action in this way requires solving a maximization problem which is not trivial for continuous controls.
While extensions to continuous controls were considered recently, they are restrictive since speciﬁc structures of the value function are assumed (Gu et al., 2016; Amos et al., 2017).
On the other hand, policy-based methods, also called policy search methods (Deisenroth et al., 2013), learn a parameterized policy maximizing a sample approximation of the expected return without learning the value function.
For instance, policy gradient methods such as REINFORCE (Williams, 1992) use gradient ascent to update the policy parameter so that the probability of observing high sample returns increases.
Compared with value-based methods, policy search methods are simpler and naturally applicable to continuous problems.
Moreover, the sample return is an unbiased estimator of the expected return and methods such as policy gradients are guaranteed to converge to a locally optimal policy under standard regularity conditions (Sutton et al., 1999).
However, sample returns usually have high variance and this makes such policy search methods converge too slowly.
Actor-critic methods combine the advantages of value-based and policy search methods.
In these methods, the parameterized policy is called an actor and the learned value-function is called a critic.
The goal of these methods is to learn an actor that maximizes the critic.
Since the critic is a low variance estimator of the expected return, these methods often converge much faster than policy search methods.
Prominent examples of these methods are actor-critic (Sutton et al., 1999; Konda & Tsitsiklis, 2003), natural actor-critic (Peters & Schaal, 2008), trust-region policy optimization (Schulman et al., 2015a), and asynchronous advantage actor-critic (Mnih et al., 2016).
While their approaches to learn the actor are different, they share a common property that they only use the value of the critic, i.e., the zero-th order information, and ignore higher-order ones such as gradients and
Hessians w.r.t.
actions of the critic 1 .
To the best of our knowledge, the only actor-critic methods that use gradients of the critic to update the actor are deterministic policy gradients (DPG) (Silver et al., 2014) and stochastic value gradients (Heess et al., 2015).
However, these two methods do not utilize the second-order information of the critic.
In this paper, we argue that the second-order information of the critic is useful and should not be ignored.
A motivating example can be seen by comparing gradient ascent to the Newton method: the Newton method which also uses the Hessian converges to a local optimum in a fewer iterations when compared to gradient ascent which only uses the gradient (Nocedal & Wright, 2006). This suggests that the Hessian of the critic can accelerate actor learning which leads to higher data efﬁciency.
However, the computational complexity of second-order methods is at least quadratic in terms of the number of optimization variables. For this reason, applying second-order methods to optimize the parameterized actor directly is prohibitively expensive and impractical for deep reinforcement learning which represents the actor by deep neural networks. Our contribution in this paper is a novel actor-critic method for continuous controls which we call guide actor-critic (GAC). Unlike existing methods, the actor update of GAC utilizes the secondorder information of the critic in a computationally efﬁcient manner.
This is achieved by separating actor learning into two steps. In the ﬁrst step, we learn a non-parameterized Gaussian actor that locally maximizes the critic under a Kullback-Leibler (KL) divergence constraint.
Then, the Gaussian actor is used as a guide for learning a parameterized actor by supervised learning.
Our analysis shows that learning the mean of the Gaussian actor is equivalent to performing a second-order update in the action space where the curvature matrix is given by Hessians of the critic and the step-size is controlled by the KL constraint.
Furthermore, we establish a connection between GAC and DPG where we show that DPG is a special case of GAC when the Hessians and KL constraint are ignored.
B ACKGROUND
In this section, we ﬁrstly give a background of reinforcement learning.
Then, we discuss existing second-order methods for policy learning and their issue in deep reinforcement learning.
We consider discrete-time Markov decision processes (MDPs) with continuous state space S Ď R d s and continuous action space A Ď R d a .
We denote the state and action at time step t P N by s t and a t , respectively.
The initial state s 1 is determined by the initial state density s 1 „ p p s q .
At time step t , the agent in state s t takes an action a t according to a policy a t „ π p a | s t q and obtains a reward r t “ r p s t , a t q .
Then, the next state s t ` 1 is determined by the transition function s t ` 1 „ p p s 1 | s t , a t q .
A trajectory τ “ p s 1 , a 1 , r 1 , s 2 , . . .
q gives us cumulative rewards or returns deﬁned as ř 8 t “ 1 γ t ´ 1 r p s t , a t q , where the discount factor [-
-]0 ă γ ă 1 assigns different weights to rewards given at different time steps.
The expected returns of π after executing an action a in a state s can be expressed through the action-value function which is deﬁned as
[Equation]
where E p r¨s denotes the expectation over the density p and the subscript t ě 1 indicates that the expectation is taken over the densities at time steps t ě 1 .
We can deﬁne the expected returns as
J p π q “ E p p
[Equation]
1 q ,π p a t | s t q t [Equation] 1 ,p p s t
[Equation]
1 | s t [Equation] [Equation] The goal of reinforcement learning is to ﬁnd an optimal policy that maximizes the expected returns
[Equation]
The policy search approach (Deisenroth et al., 2013) parameterizes π by a parameter θ P R d θ and ﬁnds θ ‹ which maximizes the expected returns:
[Equation]
Policy gradient methods such as REINFORCE (Williams, 1992) solve this optimization problem by gradient ascent:
[Equation]
where α ą 0 is a step-size.
In policy search, the action-value function is commonly estimated by the sample return : Q π θ p s , a q « 1 N ř Nn,t “ 1 γ t ´ 1 r p s t,n , a t,n q obtained by collecting N trajectories using π θ . The sample return is an unbiased estimator of the action-value function.
However, it often has high variance which leads to slow convergence.
An alternative approach is to estimate the action-value function by a critic denoted by p Q p s , a q whose parameter is learned such that p Q p s , a q « Q π θ p s , a q .
By replacing the action-value function in Eq.(3) with the critic, we obtain the following optimization problem: [Equation]
The actor-critic method (Sutton et al., 1999) solves this optimization problem by gradient ascent:
[Equation]
The gradient in Eq.(6) often has less variance than that in Eq.(4), which leads to faster convergence 2 .
A large class of actor-critic methods is based on this method (Peters & Schaal, 2008; Mnih et al., 2016).
As shown in these papers, these methods only use the value of the critic to learn the actor.
The deterministic policy gradients (DPG) method (Silver et al., 2014) is an actor-critic method that uses the ﬁrst-order information of the critic.
DPG updates a deterministic actor π θ p s q by θ Ð θ `
[Equation]
A method related to DPG is the stochastic value gradients (SVG) method (Heess et al., 2015) that is able to learn a stochastic policy but it requires learning a model of the transition function.
The actor-critic methods described above only use up to the ﬁrst-order information of the critic when learning the actor and ignore higher-order ones.
Below, we discuss existing approaches that utilize the second-order information by applying second-order optimization methods to solve Eq.(5).
2. S ECOND - ORDER M ETHODS FOR P OLICY L EARNING
The actor-critic methods described above are ﬁrst-order methods which update the optimization variables based on the gradient of the objective function.
First-order methods are popular in deep learning thanks to their computational efﬁciency.
However, it is known in machine learning that second-order methods often lead to faster learning because they use the curvature information to compute a better update direction, i.e., the steepest ascent direction along the curvature 3 . The main idea of second-order methods is to rotate the gradient by the inverse of a curvature matrix . For instance, second-order updates for the actor-critic method in Eq.(6) are in the following form: [Equation]
where G P R d θ ˆ d θ is a curvature matrix.
The behavior of second-order methods depend on the deﬁnition of a curvature matrix.
The most well-known second-order method is the Newton method where its curvature matrix is the Hessian of the objective function w.r.t.
the optimization variables:
[Equation]
ı .
The natural gradient method is another well-known second-order method which uses the Fisher information matrix (FIM) as the curvature matrix (Amari, 1998):
[Equation]
Unlike the Hessian matrix, FIM provides information about changes of the policy measured by an approximated KL divergence:
[Equation]
Kakade
[Equation]
We can see that G Hessian and G FIM are very similar but the former also contains the critic and the Hessian of the actor while the latter does not.
This suggests that the Hessian provides more information than that in FIM.
However, FIM is always positive semi-deﬁnite while the Hessian may be indeﬁnite.
See Furmston et al.
(2016) for detailed comparisons between the two curvature matrices in policy search 4 .
Nonetheless, actor-critic methods based on natural gradient were shown to be very efﬁcient (Peters & Schaal, 2008; Schulman et al., 2015a).
We are not aware of existing work that considers second-order updates for DPG or SVG.
However, their second-order updates can be trivially derived.
For example, a Newton update for DPG is
[Equation]
where the p i, j q -th entry of the Hessian matrix D P R d θ ˆ d θ is
[Equation]
[Equation]
Note that B π θ p s q{B θ and B 2 π θ p s q{B θ B θ 1 are vectors since π θ p s q is a vector-valued function.
Interestingly, the Hessian of DPG contains the Hessians of the actor and the critic.
In contrast, the
Hessian of the actor-critic method contains the Hessian of the actor and the value of the critic.
Second-order methods are appealing in reinforcement learning because they have high data efﬁciency.
However, inverting the curvature matrix (or solving a linear system) requires cubic computational complexity in terms of the number of optimization variables.
For this reason, the secondorder updates in Eq.(8) and Eq.(11) are impractical in deep reinforcement learning due to a large number of weight parameters in deep neural networks.
In such a scenario, an approximation of the curvature matrix is required to reduce the computational burden.
For instance, Furmston et al.
(2016) proposed to use only diagonal entries of an approximated Hessian matrix.
However, this approximation clearly leads to a loss of useful curvature information since the gradient is scaled but not rotated.
More recently, Wu et al.
(2017) proposed a natural actor-critic method that approximates block-diagonal entries of FIM.
However, this approximation corresponds to ignoring useful correlations between weight parameters in different layers of neural networks.
G UIDE A CTOR -C RITIC
In this section, we propose the guide actor-critic (GAC) method that performs second-order updates without the previously discussed computational issue.
Unlike existing methods that directly learn the parameterized actor from the critic, GAC separates the problem of learning the parameterized actor into problems of 1) learning a guide actor that locally maximizes the critic, and 2) learning a parameterized actor based on the guide actor.
This separation allows us to perform a second-order update for the guide actor where the dimensionality of the curvature matrix is independent of the parameterization of the actor. We formulate an optimization problem for learning the guide actor in Section 3.1 and present its solution in Section 3.2. Then in Section 3.3 and Section 3.4, we show that the solution corresponds to performing second-order updates.
Finally, Section 3.5 presents the learning step for the parameterized actor using supervised learning.
The pseudo-code of our method is provided in Appendix B.
3. O PTIMIZATION P ROBLEM FOR G UIDE A CTOR Our
ﬁrst goal is to learn a guide actor that maximizes the critic.
However, greedy maximization should be avoided since the critic is a noisy estimate of the expected return and a greedy actor may change too abruptly across learning iterations.
Such a behavior is undesirable in real-world problems, especially in robotics (Deisenroth et al., 2013).
Instead, we maximize the critic with additional constraints:
[Equation]
to [Equation] [Equation] where ˜ π p a | s q is the guide actor to be learned, π θ p a | s q is the current parameterized actor that we want to improve upon.
The state distribution p β p s q is induced by past trajectories.
The objective function differs from the ones in Eq.(3) in two important aspects.
First, we maximize for a policy function ˜ π and not for the policy parameter.
This is more advantageous than optimizing for a policy parameter since the policy function can be obtained in a closed form, as will be shown in the next subsection.
Second, the expectation is deﬁned over a state distribution from past trajectories and this gives us off-policy methods with higher data efﬁciency.
The ﬁrst constraint is the Kullback-Leibler (KL) divergence constraint where KL p p
p x q|| q p x qq “ E p p x q r log p p x q ´ log q p x qs .
The second constraint is the Shannon entropy constraint where H p p
p x qq “ ´ E p p x q r log p p x qs .
The KL constraint is commonly used in reinforcement learning to prevent unstable behavior due to excessively greedy update (Peters & Schaal, 2008; Peters et al., 2010; Levine & Koltun, 2013; Abdolmaleki et al., 2015; Schulman et al., 2015a).
The entropy constraint is crucial for maintaining stochastic behavior and preventing premature convergence (Abdolmaleki et al., 2015; Mnih et al., 2016; Haarnoja et al., 2017).
The ﬁnal constraint ensures that the guide actor is a proper probability distribution.
The KL bound (cid:15) ą 0 and the entropy bound κ are hyper-parameters which control the explorationexploitation trade-off of the method.
In practice, we ﬁx the value of (cid:15) and adaptively reduce the value of κ based on the current actor’s entropy, as suggested by Abdolmaleki et al.
More details of these tuning parameters are given in Appendix C.
This optimization problem can be solved by the method of Lagrange multipliers.
The solution is
[Equation]
where η ‹ ą 0 and ω ‹ ą 0 are dual variables corresponding to the KL and entropy constraints, respectively.
The dual variable corresponding to the probability distribution constraint is contained in the normalization term and is determined by η ‹ and ω ‹ .
These dual variables are obtained by minimizing the dual function:
[Equation]
All derivations and proofs are given in Appendix A.
The solution in Eq.(14) tells us that the guide actor is obtained by weighting the current actor with p Q p s , a q .
If we set (cid:15) Ñ
then we have ˜ π « π θ and the actor is not updated.
On the other hand, if we set (cid:15) Ñ 8 then we have ˜ π p a | s q9 exp p p Q p s , a q{ ω ‹ q , which is a softmax policy where ω ‹ is the temperature parameter.
3. L EARNING G UIDE A CTOR
Computing ˜
π p a | s q and evaluating g p η, ω q are intractable for an arbitrary π θ p a | s q .
We overcome this issue by imposing two assumptions.
First, we assume that the actor is the Gaussian distribution: [Equation]
[Equation]
where the mean φ θ p s q and covariance Σ θ p s q are functions parameterized by a policy parameter θ .
Second, we assume that Taylor’s approximation of p Q p s , a q is locally accurate up to the secondorder.
More concretely, the second-order Taylor’s approximation using an arbitrary action a 0 is given by
[Equation]
where g 0 p s q “ ∇ a p Q p s , a q| a “ a 0 and H
p s q “ ∇ 2 a p Q p s , a q| a “ a 0 are the gradient and Hessian of the critic w.r.t.
a evaluated at a 0 , respectively.
By assuming that the higher order term O p} a } 3 q is sufﬁciently small, we can rewrite Taylor’s approximation at a 0 as
[Equation]
where ψ 0 p s q “ g 0 p s q ´ H 0 p s q a 0 and ξ 0 p s q “ 12 a J 0 H 0 p s q a
´ a J 0 g 0 p s q ` p Q p s , a 0 q .
Note that
H
p s q , ψ 0 p s q , and ξ 0 p s q depend on the value of a 0 and do not depend on the value of a .
This dependency is explicitly denoted by the subscript.
Substituting the Gaussian distribution and Taylor’s approximation into Eq.(14) yields another Gaussian distribution ˜
π p a | s q “ N p a | φ ` p s q , Σ ` p s qq , where the mean and covariance are given by
[Equation]
The matrix F p s q P R d a ˆ d a and vector L p s q P R d a are deﬁned as
[Equation]
The dual variables η ‹ and ω ‹ are obtained by minimizing the following dual function:
[Equation]
where F η p s q and L η p s q are deﬁned similarly to F p s q and L p s q but with η instead of η ‹ .
The term ξ 0 p s q is contained in the normalization term of the guide actor and in the constant term.
The practical advantage of using the Gaussian distribution and Taylor’s approximation is that the guide actor can be obtained in a closed form and the dual function can be evaluated through matrixvector products.
The expectation over p β p s q can be approximated by e.g., samples drawn from a replay buffer (Mnih et al., 2015).
We require inverting F η p s q to evaluate the dual function.
However, these matrices are computationally cheap to invert when the dimension of actions is not large.
3. G UIDE A CTOR L EARNING AS S ECOND - ORDER O PTIMIZATION
For now we assume that the critic is an accurate estimator of the true action-value function.
In this case, the quality of the guide actor depends on the accuracy of sample approximation in p g p η, ω q and the accuracy of Taylor’s approximation.
To make Taylor’s approximation locally accurate, we should take the action a 0 in the vicinity of a .
However, we did not directly use any individual a to compute the guide actor, but we weight π θ p a | s q by the critic (see Eq.(14)). Thus, to obtain an accurate
Taylor’s approximation of the critic, the action a 0 needs to be similar to actions sampled from π θ p a | s q .
Based on this observation, we propose two approaches to perform Taylor’s approximation.
Taylor’s approximation around the mean.
In this approach, we perform Taylor’s approximation using the mean of π θ p a | s q .
More speciﬁcally, we use a 0 “ E π θ p a | s q r a s “ φ θ p s q for Eq.(18).
In this case, we can show that the mean update in Eq.(19) corresponds to performing a second-order update in the action space to maximize p Q p s , a q :
[Equation]
where F φ θ p s q “ η ‹ Σ ´ 1 θ p s q ´ H φ θ p s q and H φ θ p s q “ ∇ 2 a p Q p s , a q| a “ φ θ p s q .
This equivalence can be shown by substitution and the proof is given in Appendix A.2.
This update equation reveals that the guide actor maximizes the critic by taking a step in the action space similarly to the Newton method.
However, the main difference lies in the curvature matrix where the Newton method uses Hessians H φ θ p s q but GAC uses a damped Hessian F φ θ p s q .
The damping term η ‹ Σ ´ 1 θ p s q corresponds to the effect of the KL constraint and can be viewed as a trust-region that controls the update step-size.
This damping term is particularly important since Taylor’s approximation is accurate only locally and we should not take a large step in each update (Nocedal & Wright, 2006).
Expectation of Taylor’s approximations.
Instead of using a 0 “ φ θ p s q , we may perform Taylor’s approximation at samples a 0 „ π θ p a | s q and compute its expectation.
More concretely, we deﬁne r
Q p s , a q to be an expectation of p Q 0 p s , a q over π θ p a 0 | s q :
[Equation]
Note that E π θ p a 0 | s q r H 0 p s qs “ E π θ p a 0 | s q r ∇ 2 a p Q p s , a q| a “ a 0 s and the expectation is computed w.r.t.
the distribution π θ of a 0 .
We use this notation to avoid confusion even though π θ p a 0 | s q and π θ p a | s q are the same distribution.
When Eq.(23) is used, the mean update does not directly correspond to any second-order optimization step.
However, under an (unrealistic) independence assumption E
[Equation]
s , we can show that the mean update corre- sponds to the following second-order optimization step:
[Equation]
where E [Equation] H [Equation]
p s qs . Interestingly, the mean is updated using averaged gradients and Hessians.
We believe that this can be advantageous for avoiding local optima.
Note that r Q p s , a q can be used even when the independence assumption does not hold.
In the remainder, we use F p s q to denote both of F φ θ p s q and E π θ p a 0 | s q r F 0 p s qs , and use H p s q to denote both of H φ θ p s q and E π θ p a 0 | s q r H 0 p s qs .
In the experiments, we use GAC-0 to refer to GAC with Taylor’s approximation by a 0 “ φ θ p s q , and we use GAC-1 to refer to GAC with Taylor’s approximation by a 0 „
π θ p a | s q , where we use a single sample for computational efﬁciency.
3. G AUSS -N EWTON A PPROXIMATION OF H ESSIAN
The covariance update in Eq.(19) indicates that F p s q “ η ‹ Σ ´ 1 θ p s q ´ H p s q needs to be positive deﬁnite.
The matrix F p s q is guaranteed to be positive deﬁnite if H p s q is negative semi-deﬁnite.
However, this is not guaranteed in general since H p s q can be indeﬁnite.
To overcome this issue, we ﬁrstly consider the following identity:
[Equation]
The proof is given in Appendix A.3.
The ﬁrst term is always negative semi-deﬁnite while the second term is indeﬁnite.
Therefore, a negative semi-deﬁnite approximation of the Hessian can be obtained as
[Equation]
The second term in Eq.(25) is proportional to exp p´ p Q p s , a qq and it will be small for high values of p Q p s , a q . This implies that the approximation should gets more accurate as the policy approach a local maxima of p Q p s , a q .
We call this approximation Gauss-Newton approximation since it is similar to the Gauss-Newton approximation for the Newton method (Nocedal & Wright, 2006).
3. L EARNING P ARAMETERIZED A CTOR
The second step of GAC is to learn a parameterized actor that well represents the guide actor.
Below, we discuss two supervised learning approaches.
3.5. F ULLY -P ARAMETERIZED G AUSSIAN P OLICY
Since the guide actor is a Gaussian distribution with a state-dependent mean and covariance, a natural choice for the parameterized actor is again a parameterized Gaussian distribution with a state-dependent mean and covariance: π θ p a | s q “ N p a | φ θ p s q , Σ θ p s qq .
The parameter θ can be learned by minimizing the expected KL divergence to the guide actor:
[Equation]
where L W p θ q “ E p β p s q ” } φ θ p s q ´ φ ` p s q}
[Equation]
F [Equation] q ı is the weighted-mean-squared-error (WMSE) which only depends on θ of the mean function.
The const term does not depend on θ .
Minimizing the KL divergence reveals connections between GAC and deterministic policy gradients (DPG) (Silver et al., 2014).
By computing the gradient of the WMSE, we can show that ∇
[Equation]
The proof is given in Appendix A.4.
The negative of the ﬁrst term is precisely equivalent to DPG.
Thus, updating the mean parameter by minimizing the KL loss with gradient descent can be regarded as updating the mean parameter with biased DPG where the bias terms depend on η ‹ .
We can verify that ∇ a p Q p s , a q| a “ φ ` p s q “ 0 when η ‹ “ 0 and this is the case of (cid:15) Ñ 8 .
Thus, all bias terms vanish when the KL constraint is ignored and the mean update of GAC coincides with DPG.
However, unlike DPG which learns a deterministic policy, we can learn both the mean and covariance in GAC.
3.5. G AUSSIAN P OLICY WITH P ARAMETERIZED M EAN
While a state-dependent parameterized covariance function is ﬂexible, we observe that learning performance is sensitive to the initial parameter of the covariance function.
For practical purposes, we propose using a parametrized Gaussian distribution with state-independent covariance: π θ p [Equation] |
[Equation]
q [Equation] p a | φ θ p s q , Σ q . This class of policies subsumes deterministic policies with additive independent Gaussian noise for exploration.
To learn θ , we minimize the mean-squared-error (MSE):
[Equation]
For the covariance, we use the average of the guide covariances: Σ
[Equation]
For computational efﬁciency, we execute a single gradient update in each learning iteration instead of optimizing this loss function until convergence.
Similarly to the above analysis, the gradient of the MSE w.r.t.
θ can be expanded and rewritten into
[Equation]
[Equation] Again, the mean update of GAC coincides with DPG when we minimize the MSE and set η ‹ “ 0 and
H p s q “ ´ I where I is the identity matrix.
We can also substitute these values back into Eq.(22).
Then, we can interpret DPG as a method that performs ﬁrst-order optimization in the action space:
[Equation]
(31) and then uses the gradient in Eq.(30) to update the policy parameter.
This interpretation shows that
DPG is indeed a ﬁrst-order method that only uses the ﬁrst-order information of the critic for the actor learning.
Therefore in principle, GAC, which uses the second-order information, should learn faster than DPG.
3. P OLICY E VALUATION FOR C RITIC
Beside actor learning, the performance of actor-critic methods also depends on the accuracy of the critic.
We assume that the critic p Q ν p s , a q is represented by neural networks with a parameter ν .
We adopt the approach proposed by Lillicrap et al. (2015) with some adjustment to learn ν .
More concretely, we use gradient descent to minimize the squared Bellman error with a slowly moving target critic:
[Equation]
where α ą 0 is the step-size.
The target value y “ r p s , a q ` γ E π p a 1 | s 1 q r p Q ¯ ν
p s 1 , a 1 qs is computed by target critic p Q ¯ ν
p s 1 , a 1 q which has parameter ¯ ν updated by ¯ ν Ð τ ν ` p 1 ´ τ q ¯ ν {+for 
 ă τ ă 1+} .
As suggested by Lillicrap et al. (2015), the target critic improves the learning stability and we set τ “ 0 . 001 in experiments.
The expectation for the squared error is approximated using minibatch samples tp s n , a n , r n , s 1 n qu Nn “ 1 drawn from a replay buffer.
The expectation over π p a 1 | s 1 q is approximated using samples t a 1 n,m u Mm “ 1 „ π θ p a 1 | s 1 n q for each s 1 n .
We do not use a target actor to compute y since the KL upper-bound already constrains the actor update and a target actor will further slow it down.
Note that we are not restricted to this evaluation method and more efﬁcient methods such as Retrace (Munos et al., 2016) can also be used.
GAC requires computing ∇ a p Q ν p s , a q and its outer product for the Gauss-Newton approximation.
The computational complexity of the outer product operation is O p d 2 a q and is inexpensive when compared to the dimension of ν .
For a linear-in-parameter model p Q
ν p s , a q “ ν J µ p s , a q , the gradient can be efﬁciently computed for common choices of the basis function µ such as the Gaussian function.
For deep neural network models, the gradient can be computed by the automaticdifferentiation (Goodfellow et al., 2016) where its cost depends on the network architecture.
R ELATED W ORK
Besides the connections to DPG, GAC also relates to existing methods as follows.
A similar optimization problem to Eq.(13) was considered by the model-free trajectory optimization (MOTO) method (Akrour et al., 2016).
GAC can be viewed as an extension of MOTO with two significant novelties.
First, MOTO learns a sequence of time-dependent log-linear Gaussian policies π t p a | s q “ N p a | B t s ` b t , Σ t q , while GAC learns a log-nonlinear Gaussian policy.
Second, MOTO learns a time-dependent critic given by p Q t p s , a q “ 12 a J C t a ` a J D t s ` a J c t ` ξ t p s q and performs policy update with these functions.
In contrast, our method learns a more complex critic and performs Taylor’s approximation in each training step.
Besides MOTO, the optimization problem also resembles that of trust region policy optimization (TRPO) (Schulman et al., 2015a).
TRPO solves the following optimization problem:
[Equation]
where p Q p s , a q may be replaced by an estimate of the advantage function (Schulman et al., 2015b).
There are two major differences between the two problems.
First, TRPO optimizes the policy parameter while we optimize the guide actor.
Second, TRPO solves the optimization problem by conjugate gradient where the KL divergence is approximated by the Fisher information matrix, while we solve the optimization problem in a closed form with a quadratic approximation of the critic.
The idea of ﬁrstly learning a non-parameterized policy and then later learning a parameterized policy by supervised learning was considered previously in guided policy search (GPS) (Levine & Koltun, 2013).
However, GPS learns the guide policy by trajectory optimization methods such as an iterative linear-quadratic Gaussian regulator (Li & Todorov, 2004) which require a model of the transition function.
In contrast, we learn the guide policy via the critic without learning the transition function.
E XPERIMENTAL R ESULTS
We evaluate GAC on the OpenAI gym platform (Brockman et al., 2016) with the Mujoco Physics simulator (Todorov et al., 2012).
Both the actor and critic use neural networks with two hidden layers of 300 and 400 units, as described in Appendix C. We use the provided state space from the platform and do not use the pixel state space.
However, an extension to the pixel state space is straightforward by using convolutional neural networks (Goodfellow et al., 2016).
We compare GAC-0 and GACagainst deep DPG (DDPG) (Lillicrap et al., 2015), Q-learning with a normalized advantage function (Q-NAF) (Gu et al., 2016), and TRPO (Schulman et al., 2015a;b).
Figure 1 shows the learning performance on 9 continuous control tasks.
Overall, both GAC-0 and GAC-1 perform comparably with existing methods and they clearly outperform the other methods in Half-Cheetah.
The performance of GAC-0 and GAC-1 is comparable on these tasks, except on Humanoid where
GAC-1 learns faster.
We expect GAC-0 to be more stable and reliable but easier to get stuck at local optima.
On the other hand, the randomness introduced by GAC-1 leads to high variance approximation but this could help escape poor local optima.
We conjecture GAC-S that uses S ą [Figure] samples for the averaged Taylor’s approximation should outperform both GAC-0 and GAC-1.
While this is computationally expensive, we can use parallel computation to reduce the computation time.
The expected returns of both GAC-0 and GAC-1 have high ﬂuctuations on the Hopper and Walker2D tasks when compared to TRPO as can be seen in Figure 1g and Figure 1h.
We observe that they can learn good policies for these tasks in the middle of learning.
However, the policies quickly diverge to poor ones and then they are quickly improved to be good policies again.
We believe that this happens because the step size F ´ 1 p s q “ ` η ‹ Σ ´
´ H p s q ˘ ´ 1 of the guide actor in Eq.
(22) can be very large near local optima for Gauss-Newton approximation.
That is, the gradients near local optima have small magnitude and this makes the approximation H p s q “ ∇ a p Q p s , a q ∇ a p Q p s , a q J small as well.
If η ‹ Σ ´ 1 is also relatively small then the matrix F ´ 1 p s q can be very large.
Thus, under these conditions, GAC may use too large step sizes to compute the guide actor and this results in high ﬂuctuations in performance.
We expect that this scenario can be avoided by adding a regularization constant to the Gauss-Newton approximation.
Table 1 in Appendix C shows the wall-clock computation time.
DDPG is computationally the most efﬁcient method on all tasks.
GAC has low computation costs on tasks with low dimensional actions and its cost increases as the dimensionality of action increases.
This high computation cost is due to the dual optimization for ﬁnding the step-size parameters η and ω .
We believe that the computation cost of GAC can be signiﬁcantly reduced by letting η and ω be external tuning parameters.
C ONCLUSION AND F UTURE W ORK
Actor-critic methods are appealing for real-world problems due to their good data efﬁciency and learning speed.
However, existing actor-critic methods do not use second-order information of the critic.
In this paper, we established a novel framework that distinguishes itself from existing work by utilizing Hessians of the critic for actor learning.
Within this framework, we proposed a practical method that uses Gauss-Newton approximation instead of the Hessians.
We showed through experiments that our method is promising and thus the framework should be further investigated.
Our analysis showed that the proposed method is closely related to deterministic policy gradients (DPG).
However, DPG was also shown to be a limiting case of the stochastic policy gradients when the policy variance approaches zero (Silver et al., 2014).
It is currently unknown whether our framework has a connection to the stochastic policy gradients as well, and ﬁnding such a connection is our future work.
Our main goal in this paper was to provide a new actor-critic framework and we do not claim that our method achieves the state-of-the-art performance.
However, its performance can still be improved in many directions.
For instance, we may impose a KL constraint for a parameterized actor to improve its stability, similarly to TRPO (Schulman et al., 2015a).
We can also apply more efﬁcient policy evaluation methods such as Retrace (Munos et al., 2016) to achieve better critic learning.
A D ERIVATIONS AND P ROOFS A. D ERIVATION OF S OLUTION AND D UAL F UNCTION OF G UIDE A CTOR
The solution of the optimization problem:
[Equation]
) can be obtained by the method of Lagrange multipliers.
The derivation here follows the derivation of similar optimization problems by Peters et al.
(2010) and Abdolmaleki et al.
The Lagrangian of this optimization problem is
[Equation]
where η , ω
[Equation]
and ν are the dual variables.
Then, by taking derivative of L w.r
[Equation]
t. r π we obtain
B
[Equation] [Equation]
We set this derivation to zero in order to obtain
[Equation]
Then the solution is given by
[Equation]
To obtain the dual function g p η, ω q , we substitute the solution to the constraint terms of the Lagrangian and this gives us
[Equation]
After some calculation, we obtain
[Equation]
where in the second line we use the fact that exp p´ η ` ω ´ ν η ` ω q is the normalization term of r π p a | s q .
A. P ROOF OF S ECOND - ORDER O PTIMIZATION IN A CTION S PACE
Firstly, we show that GAC performs second-order optimization in the action space when Taylor’s approximation is performed with a 0 “ E π p a | s q r a s “ φ θ p s q .
Recall that Taylor’s approximation with φ θ is given by
[Equation]
) where ψ φ θ p s q “ ∇ a p Q p s , a q|
[Equation]
q ´ H φ θ p s q φ θ p s q .
By substituting ψ φ θ p s q into L p s q “ η ‹ Σ ´ 1 θ p s q φ θ p s q ´ ψ θ p s q , we obtain
[Equation]
Therefore, the mean update is equivalent to
[Equation]
44) which is a second-order optimization step with a curvature matrix F p s q “ η ‹ Σ ´ 1 θ p s q ´ H φ θ p s q
[Equation]
For the case when t a 0 u „ π θ p a 0 | s q “ N p a 0 | φ θ p s q , Σ p s qq are used for averaged Taylor’s approximation, we obtain
[Equation]
Then, by assuming that E π θ p a 0 | s q r H 0 p s q a 0 p s qs
[Equation]
E π θ p
[Equation]
0 | s q r [-a 
 s-]H
[Equation]
s E π θ p a 0 | s q r a 0 s , we obtain
[Equation]
Therefore, we have a second-order optimization step
[Equation]
where F ´ 1 p s q “ η ‹ Σ ´ 1 θ p s q ´ E π θ p a 0 | s
q r H 0 p s qs is a curvature matrix.
As described in the main paper, this interpretation is only valid when the equality E π θ p a {+
+}
| s q r H 0 p s q a 0 p s qs “ E π θ p a 0 | s q r H {+
+} s E π θ p a [-
-]0 | s q r a 0 s holds.
While this equality does not hold in general, it holds for GAC- 1.
Nonetheless, we can still use the expectation of Taylor’s approximation to perform policy update regardless of this assumption.
A. P ROOF OF G AUSS -N EWTON A PPROXIMATION
Let f p s
[Equation]
a q “ exp p p Q p s
[Equation]
a qq , then the Hessian H p s q “ ∇ 2 a p Q p s , a q can be expressed as
[Equation]
which concludes the proof.
Beside Gauss-Newton approximation, an alternative approach is to impose a special structure on p
Q p s , a q so that Hessians are always negative semi-deﬁnite.
In literature, there exists two special structures that satisﬁes this requirement.
Normalized advantage function (NAF) (Gu et al., 2016): NAF represents the critic by a quadratic function with a negative curvature:
[Equation]
where a negative-deﬁnite matrix-valued function W p s q , a vector-valued function b p s q and a scalarvalued function V p s q are parameterized functions whose their parameters are learned by policy evaluation methods such as Q-learning (Sutton & Barto, 1998).
With NAF, negative deﬁnite Hessians can be simply obtained as H p s q “ W p s q .
However, a signiﬁcant disadvantage of NAF is that it assumes the action-value function is quadratic regardless of states and this is generally not true for most reward functions.
Moreover, the Hessians become action-independent even though the critic is a function of actions.
Input convex neural networks (ICNNs) (Amos et al., 2017): ICNNs are neural networks with special structures which make them convex w.r.t.
their inputs.
Since Hessians of concave functions are always negative semi-deﬁnite, we may use ICNNs to represent a negative critic and directly use its Hessians.
However, similarly to NAF, ICNNs implicitly assume that the action-value function is concave w.r.t.
actions regardless of states and this is generally not true for most reward functions.
A.
G RADIENT OF THE L OSS F UNCTIONS FOR L EARNING P ARAMETERIZED A CTOR
We ﬁrst consider the weight mean-squared-error loss function where the guide actor is
N p a | φ ` p s q , Σ ` p s qq and the current actor is N p a | φ θ p s q , Σ θ p s qq .
Taylor’s approximation of p
Q p s , a q at a 0 “ φ θ p s q is
[Equation]
By assuming that H φ θ p s q is strictly negative deﬁnite 5 , we can take a derivative of this approximation w.r.t.
a and set it to zero to obtain a “ H ´ 1 φ θ p s q ∇ a p Q p s , a q ´ H ´ 1 φ θ p s q ψ φ θ p s q .
Replacing a by φ θ p s q and φ ` p s q yields
[Equation]
[Equation]
Let the weight mean-squared-error be deﬁned as
[Equation]
We consider its gradient w.r.t.
θ as follows:
[Equation]
This concludes the proof for the gradient in Eq.(28).
Note that we should not directly replace the mean functions in the weight mean-square-error by Eq.(51) and Eq.(52) before expanding the gradient.
This is because the analysis would require computing the gradient w.r.t.
θ inside the
Hessians and this is not trivial.
Moreover, when we perform gradient descent in practice, the mean φ ` p s q is considered as a constant w.r.t.
θ similarly to an output function in supervised learning.
That is, there are no computation graph connection between φ ` p s q and θ .
The gradient for the mean-squared-error can be derived similarly.
Let the mean-squared-error be deﬁned as
[Equation]
Its gradient w.r.t.
θ is given by
[Equation]
which concludes the proof for the gradient in Eq.(30).
To show that ∇ a p Q p s , a q| a “ φ ` p
[Equation]
q “ 0 when η ‹ “ 0 , we directly substitute η ‹ “ 0 into φ ` p s q “ ` η
[Equation]
¯ and this yield
[Equation] [Equation]
Since φ ` p s q “ H ´ 1 φ θ p s q ∇ a p Q p s , a q| a “ φ ` p s q ´ H ´ 1 φ θ p s q ψ φ θ p s q from Eq.(52) and the Hessians are non-zero, it has to be that ∇ a p Q p s , a q| a “ φ ` p s q “ 0 .
This is intuitive since without the KL constraint, the mean of the guide actor always be at the optima of the second-order Taylor’s approximation and the gradients are zero at the optima.
A. R ELATION TO Q- LEARNING WITH N ORMALIZED A DVANTAGE F UNCTION
The normalized advantage function (NAF) (Gu et al., 2016) is deﬁned as
[Equation]
where W p s q is a negative deﬁnite matrix.
Gu et al.
(2016) proposed to perform Q-learning with
NAF by using the fact that argmax a p Q NAF p s , a q “ b p s q and max a p Q NAF p s , a q “ V p s q .
Here, we show that GAC includes the Q-learning method by Gu et al.
as its special case.
This can be shown by using NAF as a critic instead of performing Taylor’s approximation of the critic.
Firstly, we expand the quadratic term of NAF as follows:
[Equation]
) where ψ p s q “ ´ W p s q b p s q and ξ p s q “ 12 b p s q J W p s q b p s q ` V p s q .
By substituting the quadratic model obtained by NAF into the GAC framework, the guide actor is now given by ˜ π p a | s q “
N p a | φ ` p s q , Σ ` p s qqq with
[Equation]
To obtain Q-learning with NAF, we set η ‹ “ 0 , i.e., we perform a greedy maximization where with the KL upper-bound approaches inﬁnity, and this yields
[Equation]
which is the policy obtained by performing Q-learning with NAF.
Thus, NAF with Q-learning is a special case of GAC when the NAF model is used and the KL upper-bound approaches inﬁnity.
A. R ELATION TO M AXIMUM E NTROPY R EINFORCEMENT L EARNING
The entropy constraint in the optimization problem in Eq.(13) suggests that GAC is closely related to the maximum entropy reinforcement learning (MaxEnt RL) framework.
The
MaxEnt RL aims to maximize an expected returns with an additional entropy bonus: řt “ 1 E p π p s q r r p s t , a t q ` α H p
π p a t | s t qqs where α ą 0 is a trade-off parameter.
The optimal policy is given by (Haarnoja et al., 2017)
[Equation]
where the V ‹ soft p s q and Q ‹ soft p s , a q are the optimal soft state-value and action-value functions, respectively.
The soft value functions of a policy π are deﬁned as
[Equation]
The optimal policy and the soft state-value function closely resemble the guide actor in Eq.(14) and the log-integral term in Eq.(15), respectively, except for the deﬁnition of action-value functions and the weight π p a | s q ηη ` ω .
To learn the optimal policy of MaxEnt-RL, Haarnoja et al.
(2017) proposed soft Q-learning which uses importance sampling to compute the soft value functions and approximates the intractable policy using a separate policy function.
The proposed method largely differs from soft Q-learning since we use Taylor’s approximation to convert the intractable integral into more convenient matrix-vector products.
B P SEUDO - CODE OF GAC
The pseudo-code of GAC is given in Algorithm 1.
C E XPERIMENT DETAILS C. I MPLEMENTATION
We try to follow the network architecture proposed by the authors of each baseline method as close as possible.
For GAC and DDPG, we use neural networks with two hidden layers for the actor network
1: Input:
Initial actor π θ p a | s q “ N p a | φ θ p s q , Σ q , critic p Q ν p s , a q , target critic network p
Q ¯ ν p s , a q , KL bound (cid:15) , entropy bound κ , learning rates α 1 , α 2 , and data buffer D “ H .
2: for t “ 1 , . . .
, T max do 3: procedure C OLLECT TRANSITION SAMPLE 4:
Observe state s t and sample action a t „ N p a | φ θ p s t q , Σ q .
Execute a t , receive reward r t and next state s 1 t .
Add transition tp s t , a t , r t , s 1 t qu to D .
7: end procedure 8: procedure L EARN 9:
Sample N mini-batch samples tp s n , a n , r n , s 1 n qu Nn “ 1 uniformly from D .
10: procedure U PDATE CRITIC 11:
Sample actions t a 1 n,m u Mm “ 1 „ N p a | φ θ p s n q , Σ q for each s n .
Compute y n , update ν by, e.g., Adam, and update ¯ ν by moving average:
[Equation]
[Equation]
[Equation]
[Equation]
(68) 13: end procedure 14: procedure L EARN GUIDE ACTOR 15:
Compute a n, 0 for each s n by a n, 0 “ φ θ p s n q or a n, 0 „ N p a | φ θ p s n q , Σ q .
Compute g 0 p s q “ ∇ a p Q p s n , a q| a “ a n, 0 and H
p s s q “ ´ g 0 p s
[Equation]
Solve for p η ‹ , ω ‹ q “ argmin
η ą 0 ,ω
ą 0 g p η, ω q by a non-linear optimization method.
Compute the guide actor r π p
[Equation]
n
[Equation]
p
[Equation]
|
[Equation]
p
[Equation]
n
[Equation]
p
[Equation]
qq for each s n .
19: end procedure 20: procedure U PDATE PARAMETERIZED ACTOR 21:
Update policy parameter by, e.g., Adam, to minimize the MSE:
[Equation]
Update policy covariance by averaging the guide covariances:
[Equation]
23: end procedure 24: end procedure 25: end for 26: and the critic network.
For both networks the ﬁrst layer has 400 hidden units and the second layer has 300 units.
For NAF, we use neural networks with two hidden layers to represent each of the functions b p s q , W p s q and V p s q where each layer has 200 hidden units.
All hidden units use the relu activation function except for the output of the actor network where we use the tanh activation function to bound actions.
We use the Adam optimizer (Kingma & Ba, 2014) with learning rate 0 .
001 and 0 .
for the critic network and the actor network, respectively.
The moving average step for target networks is set to τ “ 0 . 001 .
The maximum size of the replay buffer is set to 1000000 .
The mini-batches size is set to N “ 256 .
The weights of the actor and critic networks are initialized as described by Glorot & Bengio (2010), except for the output layers where the initial weights are drawn uniformly from U p´ 0 . 003 , 0 .
003 q , as described by Lillicrap et al. (2015).
The initial covariance Σ in GAC is set to be an identity matrix.
DDPG and QNAF use the OU-process with
[Table]
For TRPO [Table]
we use the implementation publicly available at https://github.com/openai/ baselines .
We also use the provided network architecture and hyper-parameters except the batch size where we use 1000 instead of 1024 since this is more suitable in our test setup.
For GAC, the KL upper-bound is ﬁxed to (cid:15) “ 0 . 0001 .
The entropy lower-bound κ is adjusted heuristically by
[Equation]
where E « E p β
p s q r H p π θ p a | s qqs denotes the expected entropy of the current policy and E 0 denotes the entropy of a base policy
N p a | 0 , 0 .
I q .
This heuristic ensures that the lower-bound gradually decreases but the lower-bound cannot be too small.
We apply this heuristic update once everytraining steps.
The dual function is minimize by the sequential least-squares quadratic programming (SLSQP) method with an initial values η “ 0 .
and ω “ 0 . 05 .
The number of samples for computing the target critic value is M “ 10 .
C. E NVIRONMENTS AND R ESULTS
We perform experiments on the OpenAI gym platform (Brockman et al., 2016) with Mujoco Physics simulator (Todorov et al., 2012) where all environments are v1.
We use the state space, action space and the reward function as provided and did not perform any normalization or gradient clipping.
The maximum time horizon in each episode is set to 1000 .
The discount factor γ “ 0 . 99 is only used for learning and the test returns are computed without it.
Experiments are repeated for 10 times with different random seeds.
The total computation time are reported in Table 1. The ﬁgures below show the results averaged over 10 trials. The y-axis indicates the averaged test returns where the test returns in each trial are computed once every 5000 training time steps by executing 10 test episodes without exploration. The error bar indicates standard error.
The performance of each method is denoted by the following colors, red: GAC-1, blue: GAC-0, black: DDPG, green: QNAF, and purple: TRPO.
[Figure] [Figure]
[Figure] [Figure]
[Figure] [Figure]
[Figure] [Figure] [Figure]