gpt4 book ai didi

machine-learning - 将转移概率纳入 SARSA

转载 作者:行者123 更新时间:2023-11-30 09:00:31 28 4
gpt4 key购买 nike

我正在用 C++ 实现 SARSA(lambda) 模型,以克服 DP 模型的一些限制(DP 模型所需的大量时间和空间),这有望减少计算时间(需要相当多的时间 atm)对于类似的研究),更少的空间将允许为模型添加更多的复杂性。

我们确实有明确的转移概率,而且它们确实会产生影响。那么我们应该如何将它们纳入 SARSA 模型中呢?

简单地根据概率本身选择下一个状态?显然 SARSA 模型并不完全期望你使用概率 - 或者也许我读错了书。

PS- 有没有办法知道算法是否正确实现?第一次与 SARSA 合作。

最佳答案

动态规划(DP)和强化学习(RL)之间的根本区别在于,前者假设环境的动态是已知的(即模型),而后者可以直接从过程中获得的数据中学习,在一组样本、一组过程轨迹或单个轨迹的形式。由于此功能,当模型构建困难或成本高昂时,强化学习方法非常有用。但是,应该注意的是,这两种方法具有相同的工作原理(在 Sutton's book 中称为广义策略迭代)。

鉴于它们相似,这两种方法也有一些局限性,即维数灾难。来自 Busoniu's book (第 3 章是免费的,可能对您有用):

A central challenge in the DP and RL fields is that, in their original form (i.e., tabular form), DP and RL algorithms cannot be implemented for general problems. They can only be implemented when the state and action spaces consist of a finite number of discrete elements, because (among other reasons) they require the exact representation of value functions or policies, which is generally impossible for state spaces with an infinite number of elements (or too costly when the number of states is very high).

Even when the states and actions take finitely many values, the cost of representing value functions and policies grows exponentially with the number of state variables (and action variables, for Q-functions). This problem is called the curse of dimensionality, and makes the classical DP and RL algorithms impractical when there are many state and action variables. To cope with these problems, versions of the classical algorithms that approximately represent value functions and/or policies must be used. Since most problems of practical interest have large or continuous state and action spaces, approximation is essential in DP and RL.

就您的情况而言,很明显您应该采用某种函数近似。但是,如果您知道转移概率矩阵,则可以选择基于 DP 或 RL 的方法。在强化学习的情况下,转换仅用于计算给定 Action 的下一个状态。

使用 DP 还是 RL 哪个更好?实际上我不知道答案,最佳方法可能取决于您的具体问题。直观上,以有计划的方式 (DP) 对一组状态进行采样似乎更安全,但状态空间的很大一部分可能与找到最佳策略无关。在这种情况下,对一组轨迹(RL)进行采样可能在计算上更有效。无论如何,如果正确应用这两种方法,应该会得到类似的解决方案。

注意:当采用函数逼近时,收敛性比较脆弱,在迭代过程中发散的情况并不罕见,特别是当逼近器是非线性的(例如人工神经网络)与强化学习结合时。

关于machine-learning - 将转移概率纳入 SARSA,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41242329/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com