reinforcement-learning - 选择用于近似策略预测的函数

标签 reinforcement-learning approximation

我目前正在阅读萨顿关于强化学习的介绍。到了第 10 章(On-Policy prediction with approximation)后,我现在想知道如何选择函数的形式 q最佳权重 w应近似。

我指的是下面来自 Sutton 的伪代码的第一行:如何选择一个好的可微函数 enter image description here ?是否有任何标准策略来选择它?

enter image description here

最佳答案

您可以选择任何可微的函数逼近器。
两种常用的值函数逼近器是:

  • 线性函数逼近器:特征的线性组合
     For approximating Q (the action-value)
     1. Find features that are functions of states and actions.
     2. Represent q as a weighted combination of these features.
    

    enter image description here

    哪里phi_saRd 中的向量与 ithenter image description here 提供的组件和 w是权重向量 enter image description here谁的ith组件由 enter image description here 给出.
  • 神经网络

    代表qSAW使用神经网络。您可以近似使用 action-in(下图左侧)类型或 action-out(下图右侧)类型。不同之处在于,神经网络既可以将状态和 Action 的表示作为输入,并生成单个值(Q 值)作为输出,也可以仅将状态的表示 s 作为输入作为输入。并为每个 Action 提供一个值作为输出, Action 空间中的 a (如果 Action 空间是离散和有限的,这种类型更容易实现)。

    enter image description here

    使用第一种类型( Action 输入)作为示例,因为它接近线性情况下的示例,您可以使用以下方法使用神经网络创建 Q 值逼近器:
      Represent the state-action value as a normalized vector
      (or as a one-hot vector representing the state and action)
      1. Input layer : Size= number of inputs
      2. `n` hidden layers with `m` neurons
      3. Output layer: single output neuron
      Sigmoid activation function.
      Update weights using gradient descent as per the * semi-gradient Sarsa algorithm*.
    

    您还可以直接使用视觉效果(如果可用)作为输入并使用卷积层,如 DQN paper .但是请阅读下面关于收敛和其他技巧的注释,以稳定这种基于非线性逼近器的方法。


  • 从图形上看,函数逼近器如下所示:

    linearFA

    请注意 varphi_eqphielementary functionxi用于表示状态- Action 向量的元素。
    您可以使用任何基本函数来代替 enter image description here .一些常见的是线性回归量,Radial Basis Functions等等。

    一个好的可微函数取决于上下文。但在强化学习设置中,收敛特性和误差界限很重要。书中讨论的 Episodic 半梯度 Sarsa 算法具有与 TD(0) 类似的收敛特性,适用于恒定策略。

    由于您特别要求进行在策略预测,因此建议使用线性函数逼近器,因为它可以保证收敛。以下是使线性函数逼近器适用的一些其他属性:
  • 误差面变成一个二次面,具有一个具有均方误差函数的最小值。这使它成为一个可靠的解决方案,因为梯度下降可以保证找到全局最优的最小值。
  • 误差界限(如 Tsitsiklis & Roy,1997 证明的 TD(lambda) 的一般情况)是:

    enter image description here

    这意味着渐近误差不会超过enter image description here乘以最小的可能误差。哪里gamma是折扣因子。
    梯度很容易计算!

  • 然而,使用非线性逼近器(如(深度)神经网络)本身并不能保证收敛。
    梯度 TD 方法使用投影贝尔曼误差的真实梯度进行更新,而不是在已知提供 convergence even with non-linear function approximators 的 Episodic 半梯度 Sarsa 算法中使用的半梯度。 (即使对于离策略预测)如果满足某些条件。

    关于reinforcement-learning - 选择用于近似策略预测的函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45298898/

    相关文章:

    python - Open AI Gym Cartpole 的策略梯度方法

    tensorflow - 为什么q-learning函数在openai山地车上不收敛

    python - 如何在 python 中使用 Gurobi 的 MIPGap 和 TimeLimit?

    algorithm - 证明最小循环覆盖的不可近似性

    algorithm - 不知道限制 sin(x) 公式循环

    asynchronous - 关于openai基线A2C实现的问题

    machine-learning - 在 PDF 文本挖掘中使用 AI/ML

    machine-learning - 带有负奖励的 RL 激活函数

    java - Riemann Siegel Formula in Java的实现,好奇改进余数项

    c - Linux内核源码中的指数近似法计算