reinforcement-learning - TD(0)学习中如何选择 Action

标签 reinforcement-learning temporal-difference

我目前正在阅读萨顿的 Reinforcement Learning: An introduction书。阅读第 6.1 章后,我想实现一个 TD(0)此设置的 RL 算法:

enter image description here
enter image description here

为此,我尝试实现此处提供的伪代码:
enter image description here

这样做我想知道如何做这一步A <- action given by π for S : 我可以选择最佳 Action A对于我目前的状态 S ?作为值函数V(S)只是取决于状态而不是取决于我真的不知道如何做到这一点的行动。

我找到了 this处理相同练习的问题(我从哪里得到图像的) - 但这里的 Action 只是随机选择,而不是由 Action 策略选择 π .

编辑:或者这是伪代码不完整,所以我必须近似 action-value function Q(s, a)换一种方式,也是吗?

最佳答案

您是对的,您不能仅从值函数 π 中选择操作(既不能派生策略 V(s) )因为,正如您所注意到的,它仅取决于状态 s .

您可能在这里遗漏了一个关键概念,即 TD(0) 学习是一种计算给定策略的值(value)函数的算法。因此,您假设您的代理遵循已知策略。在随机游走问题的情况下,策略在于随机选择 Action 。

如果你想能够学习一个策略,你需要估计 action-value 函数 Q(s,a) .有几种学习方法Q(s,a)基于时间差分学习,例如 SARSA 和 Q-learning。

在萨顿的 RL 书中,作者区分了两类问题:预测问题和控制问题。前者是指估计给定策略的值(value)函数的过程,后者是指估计策略的过程(通常通过 Action 值(value)函数的方式)。您可以在 starting part of Chapter 6 中找到对这些概念的引用。 :

As usual, we start by focusing on the policy evaluation or prediction problem, that of estimating the value function for a given policy . For the control problem (finding an optimal policy), DP, TD, and Monte Carlo methods all use some variation of generalized policy iteration (GPI). The differences in the methods are primarily differences in their approaches to the prediction problem.

关于reinforcement-learning - TD(0)学习中如何选择 Action ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45231492/

相关文章:

python - 了解稳定基线模型中的total_timesteps参数

python - 发生异常 : AttributeError 'int' object has no attribute 'shape' when calling dqn. fit()

python - 了解梯度策略推导

machine-learning - 强化学习-Afterstates 的 TD 学习

r - 随着时间的推移逐行比较 2 个数据帧的分析

delphi - Delphi:神经网络类(TD-lambda)中的EInvalidOp

python - 如何访问 Tensorflow 中循环单元的权重?

google-colaboratory - 如何在 colab 中运行 env.render()