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 achieves 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 categorized into three categories: value-base , 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 actions that maximize the learned value function.
Choosing actions 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 estimate 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 variances 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 estimate 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 show that the second-order information of the critic is useful for learning the actor.
To this end, we propose a novel actor-critic method for continuous controls which we call guide actor-critic (GAC).
The main idea of our method is to ﬁrstly learn a non-parameterized Gaussian policy that locally maximizes the critic under a Kullback-Leibler (KL) divergence constraint.
This
Gaussian policy is obtained in a closed form by using Taylor’s approximations of the critic.
Then, the policy is used as a guide for learning a parameterized policy by supervised learning.
Our analysis shows that learning the mean of the Gaussian policy is equivalent to performing a second-order optimization step in the action space where the curvature matrix is given by the KL constraint and
Hessians of the critic.
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
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 1 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
ă γ ă 1 assigns different weights to rewards received at different time steps.
The expected returns of π 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
[Equation]
where p π p s q is the stationary state density which satisﬁes p π p s
[Equation]
The goal of reinforcement learning is to ﬁnd an optimal policy that maximizes the expected returns.
The policy search approach (Deisenroth et al., 2013) parameterizes π by a parameter θ and ﬁnds θ ‹ which maximizes the expected returns:
[Equation]
Policy gradient methods such as REINFORCE (Williams, 1992) solve this optimization problem by
[Equation]
where α ą 0 .
In policy search, the action-value function is commonly estimated by the sample returns : 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 π θ .
However, sample returns often yield high variance estimates which lead 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 .
The policy gradient theorem (Sutton et al., 1999) shows that the critic can be used instead of the sample returns.
This theorem leads to the actor-critic method (Sutton et al., 1999) which updates the policy parameter by
[Equation]
The gradient in Eq.(5) often has less variance than that of Eq.(4) which leads to faster convergence 2 .
A large class of existing actor-critic methods are based on this method (Peters & Schaal, 2008; Mnih et al., 2016).
As shown in these papers, these methods only use values of the critic for learning 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 policy π θ p s q by
[Equation]
A method related to DPG is the stochastic value gradients method (Heess et al., 2015) that is able to learn a stochastic policy but it requires learning a model of the transition function.
As shown above, existing actor-critic methods only use up to the ﬁrst-order information of the critic when learning the actor and ignore higher-order ones.
In the next section, we describe our proposed method that also uses the second-order information of the critic when learning the actor.
G UIDE A CTOR -C RITIC
In this section, we propose the guide actor-critic (GAC) method.
Unlike existing methods that directly learn the parameterized actor from the critic, GAC ﬁrstly learns a guide actor that locally maximizes the critic by using the second-order Taylor’s approximation of the critic.
This step is described in Sections 3.1 to 3.4.
Then, we use supervised learning to learn the parameterized actor.
This step is described in Section 3.5.
The pseudo-code 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]
where ˜ π p a | s q is the guide actor to be learned, π θ p a | s q is the current actor that we want to improve upon.
The state distribution p β p s q is induced by a behavioral policy β p a | s q which we deﬁne as a mixture of all past actors.
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 of the behavioral policy and this gives us off-policy methods with better 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 exploration-exploitation 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. (2015).
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.(8) 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 distribution 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 employing two assumptions.
First, we assume that the actor is the Gaussian distribution:
[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]
[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]
[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.(8) 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 inverse when the dimension of actions is small.
3. G UIDE A CTOR L EARNING AS S ECOND - ORDER O PTIMIZATION
For now we assume that the critic is an accurate estimate of the true action-value function.
In this case, the quality of a guide actor mostly depends on the accuracy of Taylor’s approximation.
Since
Taylor’s approximation is accurate locally, the action a 0 should be in a local 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.(8)).
Thus, the action a 0 should be similar to actions sampled from π θ p a | s q .
Based on this observation, we propose two approaches for obtaining accurate 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.(12).
In this case, we can show that the mean update in Eq.(13) corresponds to performing a second-order optimization step in the action space to maximize p Q p s , a q :
[Equation]
(16) 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 (Nocedal & Wright, 2006).
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 upper-bound and can be viewed as a trustregion that controls the update step-size.
This damping term is particularly important since Taylor’s approximation is accurate locally and we should not take a large step in each update.
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.(17) 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 π θ p a 0 | s q r F 0 p s qs “ η ‹ Σ ´ 1 θ p s q ´ E π θ p a 0 | s q r H 0 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.(13) indicates that F p s q “ η ‹ Σ ´ 1 θ p s q ´ H p s q needs to be positive deﬁnite.
Since η ‹ Σ ´ 1 θ p s q is positive deﬁnite by construction, we need H p s q to be negative semideﬁnite.
However, this is not guaranteed in general and H p s q can be indeﬁnite.
To overcome this issue, we propose to use the following Hessian approximation:
[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 Hessians can be obtained as
[Equation] [Equation]
which is closely related to the Gauss-Newton approximation (Nocedal & Wright,
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 that are attractive due to their connections to an existing method.
However, more sophisticated approaches can be used too.
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] [Equation]
where L W p θ q “ E p β p s q ”
[Equation]
ı 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 to use a parametrized Gaussian distribution with state-independent covariance: π θ p a | s q “ N p a | φ θ p s q , Σ q .
This class of policy 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 an average of the guide covariances: Σ “ p η ‹ ` ω ‹ q E p β
[Equation] q
[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 MSE w.r.t.
θ can be expanded and rewritten into
[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 an identity matrix.
We can also substitute these values back into Eq.(16).
Then, we can interpret DPG as a method that performs ﬁrst-order optimization in the action space:
[Equation]
and then uses the gradient in Eq.(24) 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 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, 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 adjustments to learn ν .
More concretely, we use gradient descent to minimize the squared Bellman residual 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 ¯ ν .
The expectation for the squared error is approximated using mini-batch 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 i u Mi “ 1 „ π θ p a 1 | s 1 n q .
We do not use a target actor to compute y since the KL bound already constraints the actor update and a target actor will further slow it down.
Note that we are not restricted to this policy evaluation method and more efﬁcient methods such as Retrace (Munos et al., 2016) can also be used.
R ELATED W ORK
Besides the connections to DPG, GAC also relates to existing methods as follows.
A similar optimization problem to Eq.(7) was considered by the model-free trajectory optimization (MOTO) method Akrour et al.
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.
Beside 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 beside the state distributions, the entropy constraint and direction of KL constraints.
First, TRPO optimizes for the policy parameter while we optimize for the guide actor.
Second, TRPO solves the optimization problem by conjugate gradient with a quadratic approximation of the KL divergence, 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 learn 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 iterative linear-quadratic Gaussian regulator (Li & Todorov, 2004) which require a model of transition function.
In contrast, we learn the guide policy via the critic without learning the transition function.
E XPERIMENT R ESULTS
We evaluate GAC on the OpenAI gym platform (Brockman et al., 2016) with Mujoco Physics simulator (Todorov et al., 2012).
Both actor and critic use neural networks with two hidden layers of 300 and 400 units, as described in Appendix C.
The state space is deﬁned as a joint space of the agent for all tasks.
However, an extension to pixel state space is straightforward by using convolutional neural networks (Goodfellow et al., 2016).
We compare GAC-0 and GAC-1 against deep
DPG (DDPG) (Lillicrap et al., 2015), Q-learning with 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.
[Figure]
[Figure]
The performance of GAC-0 and GAC-1 are comparable on these tasks, except on Humanoid where
GAC-1 seems to learn 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 local optima.
We believe GAC-S that uses S ą 1 samples for the averaged Taylor’s approximation should outperform both GAC-1 and GAC-0.
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.
(16) can be very large near a local optima for Gauss-Newton approximation.
That is, the gradient near a local optima is small 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 of performance.
We expect that this scenario can be avoided by adding a regularization constant to the Gauss-Newton approximation.
C ONCLUSION AND F UTURE W ORK
Actor-critic methods are appealing for real-world problems due to its 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 framework that distinguishes itself from existing work by utilizing
Hessians of the critic for actor learning.
Within our framework, we proposed a practical method that uses Gauss-Newton approximation instead of 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 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 one of 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 state-of-the-art performances.
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]
28) 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]
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
[Equation]
we obtain
[Equation] [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]
36) where ψ φ θ p s q “ ∇
[Equation]
p Q p s , a q|
[Equation]
θ 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]
38) which is a second-order optimization step with a curvature matrix F p s q “ η ‹ Σ ´ 1 θ p s q
´ H
[Equation]
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
[Equation]
0 | s q r H 0 p
[Equation]
q a 0 p s qs
[Equation]
E
[Equation]
p
[Equation]
|
[Equation]
q
[Equation]
H
[Equation]
E π θ
[Equation]
0 | s q r a
s
[Equation]
we obtain
[Equation]
Therefore
[Equation]
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 assumption E π θ p a 0 | s
q r H 0 p s q a 0 p s qs “ E π θ p a 0 | s q r H 0 s E π θ p a
| s q r a 0 s holds.
However, we can still use the expectation of Taylor’s approxi-
mation to perform policy update regardless of this assumption.
A. P ROOF OF G AUSS -N EWTON A PPROXIMATION
Let f p s , a q “ exp p p Q p s
[Equation]
a qq
[Equation]
then the Hessian H p s q “ ∇ 2 a p Q p s
[Equation]
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]
[Equation]
By assuming that H φ θ p s q is strictly negative deﬁnite 3 , 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 the gradient w.r.t.
θ as follows:
[Equation]
This concludes the proof for the gradient in Eq.(22).
Note that we should not directly replace the mean functions in the weight mean-square-error by Eq.(45) and Eq.(46) 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.(24).
To show that ∇ a p Q p s , a q|
[Equation]
“ φ
[Equation]
“ 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.(46) 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.(7) 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.(8) and the log-integral term in Eq.(9), 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]
q
[Equation] [Equation]
[Equation]
(62) 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]
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]
[Equation]
23: end procedure 24: end procedure 25: end for 26: Output: 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 noise parameters θ “ 0 . 15 and σ “ 0 . 2 for exploration .
[Figure]
GACGAC-
DDPG
QNAF
TRPO
For TRPO, 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]
65) 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 5 times with different random seeds.
The ﬁgures below show the results averaged over 5 trials except for
[Figure] [Figure]
[Figure] [Figure]
[Figure] [Figure]
[Figure] [Figure]