Reinforcement Learning in Continuous State and Action Spaces: A Brief Note

简介: Thanks Hado van Hasselt for the great work.IntroductionIn the problems of sequential decision making in continuous domains with delayed reward signals, the main purpose for the algori

Thanks Hado van Hasselt for the great work.

Introduction

In the problems of sequential decision making in continuous domains with delayed reward signals, the main purpose for the algorithms is to learn how to choose actions from an infinitely large action space to optimize a noisy delayed cumulative reward signal in an infinitely large state space, where even the outcome of a single action can be stochastic.

Here we assume that a model of environment is not known. Analytically computing a good policy from a continuous model can be infeasible, we focus on methods that explicitly update a representation of a value function, a policy or both here. In addition, we focus mainly on the problem of control, which means we want to find action-selection polices that yield high returns, as opposed to the problem of prediction, which aims to estimate the value of a given policy.

Some possible valuable books are given below: (we suppose that you are familiar with Sutton)

  1. Szepesvari, C.: Algorithms for reinforcement learning. Synthesis Lectures on Artificial Intelligence and Machine Learning 4(1), 1-103(2010).
  2. Busoniu, L., Babuska, R., De Schutter, B., Ernst, D.: Reinforcement learning and dynamic programming using function approximators. CRC Press, Boca Raton (2010).

Function Approximation

In this section, we mostly limit ourselves to the general functional form of the approximators and general methods to update the parameters. Non-parametric approaches, such as kernel-based methods are not included. Turn to the following references for more details if you are interested in kernel based methods:

  1. Ormoneit, D., Sen, S.: Kernel-based reinforcement learning. Machine Learning 49(2), 161-178 (2002).

Linear Function Approximation

A linear function is a simple parametric function that depends on the feature vector. For instance, consider a value-approximation algorithm where the value function is approximated by:

Vt(s)=θTtϕ(s)

A common method to find features for a linear function approximator divides the continuous state space into separate segments and attaches one feature to each segment, ex. tile coding. However, one potential problem with discretizing methods such as tile coding is that the resulting function that maps state into features is not injective, i.e. ϕ(s)=ϕ(s) does not imply that s=s . Another issue is related to the step-size parameter that many algorithms use. In general, it is often a good idea to make sure that |ϕ(s)|=DΦkϕk(s)1 for all s . A final issue is that it introduces discontinuities in the function.

Some of the issues mentioned above can be tackled by suing so-called fuzzy sets. A fuzzy set is a generalization of normal sets to fuzzy membership. A state may belong partially to the set defined by feature ϕi and partially to the set defined by ϕj . An advantage of this view is that it is quite natural to assume that kϕk1 , since each part of an element can belong to only one set. It is possible to define the sets such that each combination of feature activations corresponds precisely to one single state, thereby avoiding the partial-observability problem sketched earlier. A common choice is to use triangular functions that are equal to one at the center of the corresponding feature and decay linearly to zero for states further from the center. A drawback of fuzzy sets is that these sets still need to be defined beforehand, which may be difficult.

Non-linear Function Approximation

In a parametric non-linear function approximator, the function that should be optimized is represented by some predetermined parameterized function. For instance, for value-based algorithms we may have:

Vt(s)=V(ϕ(s),θt)

In general, a non-linear function approximator may approximate an unknown function with better accuracy than a linear function approximator that uses the same input features. A drawback of non-linear function approximation is that less convergence guarantees can be given.

Updating Parameters

Gradient Descent

A gradient descent update follows the direction of the negative gradient of some parameterized function that we want to minimize. The gradient of a parameterized function is a vector in parameter space that points in the direction in which the function decreases. Because the gradient only describes the local shape of the function, this algorithm can end up in a local minimum. For instance, using an error measure such as temporal-difference or a prediction error, i.e.

E(st,at,θt)=(R(st,at,θt)rt+1)2

Update parameter:
θt+1=θtαtθE(x,θt)

If the parameter space is a curved space, it is more appropriate to use dθTGdθ where G is a P×P positive semi-definite matrix. Wit this weighted distance metric, the direction of steepest descent becomes
~θE(x,θ)=G1θE(x,θ)

which is known as the natural gradient. In general, the best choice for matrix G depends on the functional form of E .

Gradient-Free Optimization

Gradient free methods are useful when the function that is optimized is not differentiable or when it is expected that many local optima exist. There are many general global methods for optimization exist, including evolutionary algorithms. Details about evolutionary algorithms are beyond the scope of this note.

Approximate Reinforcement Learning

Value Approximation

In value-approximation algorithms, experience samples are used to update a value function that gives an approximation of the current or the optimal policy. Many reinforcement learning algorithms fall into this category. Important differences between algorithms within this category is whether they are on-policy or off-policy and whether they update online or offline. Online algorithms are sometimes more sample-efficient in control problems.

In order to update a value with gradient descent, we must choose some measure of error that we can minimize. This measure is often referred to as objective function. We generalize standard temporal-difference learning to a gradient update on the parameters of a function approximator. The tabular TD-Learning update is

Vt+1(st)=Vt(st)+αt(st)δt

with
δt=rt+1+γVt(st+1)Vt(st)
and αt(s)[0,1] is a step-size parameter. When the state values are stored in a table, TD-learning can be interpreted as a stochastic gradient-descent update on the one-step temporal-difference error:
E(st)=12(rt+1+γVt(st+1)Vt(st))2=12δ2t

However, if Vt is a parametrized function s.t. Vt(s)=V(s,θt) , the negative gradient with respect to the parameters is given by
θE(st,θ)=(rt+1+γVt(st+1)Vt(st))θ(rt+1+γVt(st+1)Vt(st))

Anyway, we can interpret rt+1+γVt(st+1) as a stochastic approximation for Vπ that does not depend on θ . Then
θE(st,θ)=(rt+1+γVt(st+1)Vt(st))θVt(st)

This implies the parameters can be updated as
θt+1=θt+αtδtθVt(st)

Similarly, updates for action-value algorithms are
δt=rt+1+γQt(st+1,at+1)Qt(st,at)
or
δt=rt+1+γmaxaQt(st+1,a)Qt(st,at)
for SARSA and Q-Learning respectively. We can also incorporate accumulating eligibility traces with trace parameter λ with the following two equations:
et+1θt+1=λγet+θVt(st)=θt+αtδtet+1

Parameters updated with equations above may diverge when off-policy updates are used. This holds for any temporal-difference method with λ<1 . In other words, if we sample transitions from a distribution that does not comply completely to the state-visit probabilities that would occur under the estimation policy, the parameters of the function may diverge. This is unfortunate, because in the control setting ultimately we want to learn about the unknown optimal policy. Recently, a class of algorithms has been proposed to deal with this issue:
  1. Maei, H.R., Sutton, R.S.: GQ (λ ): A general gradient algorithm for temporal-difference prediction learning with eligibility traces. In: Proceedings of the Third Conference On Artificial General Intelligence (AGI-2010), pp. 91–96. Atlantis Press, Lugano (2010).
  2. Sutton, R.S., Maei, H.R., Precup, D., Bhatnagar, S., Silver, D., Szepesv´ari, C., Wiewiora, E.: Fast gradient-descent methods for temporal-difference learning with linear function approximation. In: Proceedings of the 26th Annual International Conference on Machine Learning (ICML 2009), pp. 993–1000. ACM (2009).

It is nontrivial to extend the standard online temporal difference algorithms to continuous action spaces. The algorithms in the next section are usually much better suited for use in problems with continuous actions.

Policy Approximation

If the action space is continuous finding the greedy action in each state can be nontrivial and time-consuming.

Policy Gradient Algorithms

The idea of policy-gradient algorithms is to update the policy with gradient ascent on the cumulative expected value Vπ . If the gradient is known, we can update the policy parameters with

ψk+1=ψk+βkψE(Vπ(st))=ψk+βkψsSP(st=s)Vπ(s)ds

As a practical alternative, we can use stochastic gradient descent:
ψt+1=ψt+βt(st)ψVπ(st)

Such procedures can be at best hope to find a local optimum, because they use a gradient of a value function that is usually not convex with respect to the policy parameters. Define the trajectory as T which is a sequence of states and actions. Then
ψVπ(s)=TψP(T|s,ψ)E{t=0γtrt+1T}dT=TP(T|s,ψ)ψlogP(T|s,ψ)E{t=0γtrt+1T}dT=E{ψlogP(T|s,ψ)E{t=0γtrt+1T}s,ψ}

Moreover, since only the policy term depend on ψ , then
ψlogP(T|s,ψ)=t=0ψlogπ(st,at,ψ)

This only holds if the policy is stochastic. In most cases, this is not a big problem, for stochastic polices are needed anyway to ensure sufficient exploration.

There are two examples of stochastic polices for policy gradient algorithms:

  1. Boltzmann Exploration
  2. Gaussian Exploration
    Two Exploration Methods

We need to sample the expected cumulative discounted reward to get the gradient. For instance, if the task is episodic we can take a Monte Carlo sample that gives the cumulative (possibly discounted) reward for each episode:

ψVπ(s)=ERk(st)j=tTk1ψlogπ(sj,aj,ψ)
where Rk=Tk1j=tγtjrj+1 is the total discounted return obtained after reaching state st in episode k .

Actor Critic Algorithms

The variance of the estimate of ψVπ(st) can be very high if Monte Carlo roll-outs are used, which can severely slow convergence. A potential solution to this problem is presented by using an explicit approximation of Vπ . Such an approximate value function is called a critic and the combined algorithm is called an actor-critic algorithm.

Actor critic algorithms typically use a temporal difference algorithm to update Vt , an estimate for Vπ . Assuming b(st)=Vπ(st) as a baseline, this leads to an unbiased estimate of δtψlogπ(st,at,ψt) for the gradient of the policy. A typical actor-critic update would update the policy parameters with

ψt+1=ψt+βt(st)δtψlogπ(st,at,ψt)

where δt=rt+1+γVt(st+1)Vt(st) is an unbiased estimate of Qπ(st,at)Vπ(st)

Cacla (continuous actor-critic learning-automation) is special AC algorithm using an error in action space rather than in parameter or policy space and it uses the sign of the temporal difference error rather than its size. During learning, it is assumed that there is exploration. As in many other actor-critic algorithms, if the temporal-difference error δt is positive, we judge at to be a good choice and we reinforce it. In Cacla, this is done by updating the output of the actor towards at . This is why exploration is necessary: without exploration the actor output is already equal to the action, and the parameters cannot be updated.

An update to the actor only occurs when the temporal difference error is positive. As an extreme case, consider an actor that already outputs the optimal action in each state for some deterministic MDP. For most exploring actions, the temporal-difference error is then negative. If the actor would be updated away from such an action, its output would almost certainly no longer be optimal.

This is an important difference between Cacla and policy-gradient methods: Cacla only updates its actor when actual improvements have been observed. This avoids slow learning when there are plateaus in the value space and the temporal difference errors are small. Intuitively, it makes sense that the distance to a promising action at is more important than the size of the improvement in value.

Here is a simple Cacla algorithm:
Cacla

More details about actor critic algorithms? Refer to :

  1. van Hasselt, H.P.,Wiering, M.A.: Using continuous action spaces to solve discrete problems. In: Proceedings of the International Joint Conference on Neural Networks (IJCNN 2009), pp. 1149–1156 (2009).
  2. http://blog.csdn.net/philthinker/article/details/71104095
相关文章
|
3天前
|
机器学习/深度学习 算法
|
2月前
|
算法 数据挖掘
文献解读-Consistency and reproducibility of large panel next-generation sequencing: Multi-laboratory assessment of somatic mutation detection on reference materials with mismatch repair and proofreading deficiency
Consistency and reproducibility of large panel next-generation sequencing: Multi-laboratory assessment of somatic mutation detection on reference materials with mismatch repair and proofreading deficiency,大panel二代测序的一致性和重复性:对具有错配修复和校对缺陷的参考物质进行体细胞突变检测的多实验室评估
28 6
文献解读-Consistency and reproducibility of large panel next-generation sequencing: Multi-laboratory assessment of somatic mutation detection on reference materials with mismatch repair and proofreading deficiency
|
数据挖掘
【提示学习】Automatic Multi-Label Prompting: Simple and Interpretable Few-Shot Classification
文章提出了一种简单确高效地构建verbalization的方法:
|
机器学习/深度学习 移动开发 自然语言处理
DEPPN:Document-level Event Extraction via Parallel Prediction Networks 论文解读
当在整个文档中描述事件时,文档级事件抽取(DEE)是必不可少的。我们认为,句子级抽取器不适合DEE任务,其中事件论元总是分散在句子中
132 0
DEPPN:Document-level Event Extraction via Parallel Prediction Networks 论文解读
|
存储 机器学习/深度学习 人工智能
PTPCG: Efficient Document-level Event Extraction via Pseudo-Trigger-aware Pruned Complete Graph论文解读
据我们所知,我们目前的方法是第一项研究在DEE中使用某些论元作为伪触发词的效果的工作,我们设计了一个指标来帮助自动选择一组伪触发词。此外,这种度量也可用于度量DEE中带标注触发词的质量。
126 1
|
机器学习/深度学习 存储 数据挖掘
Global Constraints with Prompting for Zero-Shot Event Argument Classification 论文解读
确定事件论元的角色是事件抽取的关键子任务。大多数以前的监督模型都利用了昂贵的标注,这对于开放域应用程序是不实际的。
74 0
|
自然语言处理
【论文速递】ACL 2022 - Prompt for Extraction? PAIE: Prompting Argument Interaction for Event Argument Extr
在本文中,我们提出了一个既有效又高效的模型PAIE,用于句子级和文档级的事件论元抽取(EAE),即使在缺乏训练数据的情况下也能很好地泛化。一方面,PAIE利用抽取目标的提示调优,以充分利用预训练语言模型(PLMs)的优势。
86 0
|
自然语言处理 算法 知识图谱
DEGREE: A Data-Efficient Generation-Based Event Extraction Model论文解读
事件抽取需要专家进行高质量的人工标注,这通常很昂贵。因此,学习一个仅用少数标记示例就能训练的数据高效事件抽取模型已成为一个至关重要的挑战。
159 0
|
机器学习/深度学习 自然语言处理 算法
TPLinker: Single-stage Joint Extraction of Entities and Relations Through Token Pair Linking 论文解读
近年来,从非结构化文本中提取实体和关系引起了越来越多的关注,但由于识别共享实体的重叠关系存在内在困难,因此仍然具有挑战性。先前的研究表明,联合学习可以显著提高性能。然而,它们通常涉及连续的相互关联的步骤,并存在暴露偏差的问题。
221 0
|
机器学习/深度学习 算法 图形学
Deep learning based multi-scale channel compression feature surface defect detection system
简述:首先应用背景分割和模板匹配技术来定义覆盖目标工件的ROI区域。提取的感兴趣区域被均匀地裁剪成若干个图像块,每个块被送到基于CNN的模型,以分类杂乱背景中不同大小的表面缺陷。最后,对空间上相邻且具有相同类别标签的图像块进行合并,以生成各种表面缺陷的识别图。
151 0