当前位置:网站首页>Q-Learning笔记
Q-Learning笔记
2022-06-30 10:05:00 【显哥无敌】
emmmmm,被迫强化学习
强化学习的思想其实很好理解啦,通过不断和环境交互,来修正agent的行为,得到agent在不同state下应该采取什么action,来得到最大化的收益。
这里强推一下这个知乎博主
https://www.zhihu.com/column/c_1215667894253830144
真的是用大白话把我给讲懂了,搜别的动不动上来这个公式那个理论的,真的是一脸懵逼。。。。。。(理解流程之后你去看那些公式发现其实也没那么难懂)
先看一下Q-Learning的算法流程,然后一一解释,这里借用一下莫凡python的流程图:
首先要说的是你要有一个基础化的Q表的,否则你毛都没有,agent怎么给你下一状态s’的指导意见呢,是吧,这一步说明对应第一行Initialize
然后episode我搜了一下是step的集合,即从游戏开始到游戏结束的每一步集合,s是游戏的初始状态
下面是要说的就是off-policy和on-policy的问题了
关于这两者的定义,我是参考了这一篇文章:
所谓的off-policy和on-policy的区别其实就是生成数据和为了保证收益最大更新Q表阶段所采取的策略是否一致,以Q-Learning为例,你玩游戏的时候当然选的action是已经训练好的Q(s,a)里面值最大的那个是吧,这个叫做目标策略
目标策略(target policy):智能体要学习的策略
但是我们说了初期的Q-表是随机给的,他需要很多轮去训练,去收敛,于是要求我们在take-action的时候遍历某一个状态下所有可能的动作,于是这个就叫做
行为策略(behavior policy):智能体与环境交互的策略,即用于生成行为的策略
当这两者一致的时候就是on-policy,不一致就是off-policy
现在来考虑,在训练的时候,智能体选取的是eplison-greedy策略,即我有一定概率选取现在在我q表里action值最大的那个动作,但是不一定,我也可以选其他动作,那么包括后续过程包括状态和动作都会不一样,这样就实现了不同动作探索的可能性
通过不断地玩,Q表会不断收敛,到了玩的时候就会根据Q-table在目标策略下进行游戏,以获得较大的收益。
所以Q-Learning是一个off-policy算法,因为这两个阶段的policy完全不同
边栏推荐
- [deep learning] common methods for deep learning to detect small targets
- About Library (function library), dynamic library and static library
- Auto Seg-Loss: 自动损失函数设计
- ArcGIS Pro脚本工具(5)——排序后删除重复项
- Getting started with X86 - take over bare metal control
- Anhui "requirements for design depth of Hefei fabricated building construction drawing review" was printed and distributed; Hebei Hengshui city adjusts the pre-sale license standard for prefabricated
- Machine learning interview preparation (I) KNN
- ArcGIS Pro + PS 矢量化用地规划图
- Skill combing [email protected] intelligent instrument teaching aids based on 51 series single chip microcomputer
- Test memory read rate
猜你喜欢
I found a wave of "alchemy artifact" in the goose factory. The developer should pack it quickly
MySQL log management, backup and recovery of databases (2)
Harvester ch1 of CKB and HNS, connection tutorial analysis
Oracle creates a stored procedure successfully, but the compilation fails
[email protected]基于51系列单片机的智能仪器教具"/>
技能梳理[email protected]基于51系列单片机的智能仪器教具
马斯克推特粉丝过亿了,但他在线失联已一周
Voir le changement technologique à travers la Légion Huawei (5): Smart Park
How to seize the opportunity of NFT's "chaos"?
Getting started with X86 - take over bare metal control
ArcGIS PRO + PS vectorized land use planning map
随机推荐
透过华为军团看科技之变(五):智慧园区
The latest SCI impact factor release: the highest score of domestic journals is 46! Netizen: I understand if
技能梳理[email protected]+adxl345+电机震动+串口输出
最新SCI影响因子公布:国产期刊最高破46分!网友:算是把IF玩明白了
Didi open source agile test case management platform!
转卡通学习笔记
【深度学习】深度学习检测小目标常用方法
Node environment configuration
Go -- maximum heap and minimum heap
Smith chart view of semi steel coaxial RF line and RF line matching calibration of network analyzer e5071c
"Hackers and painters" -- why not be stupid
ArcGIS Pro脚本工具(5)——排序后删除重复项
mysql数据库基础:视图、变量
SGD有多种改进的形式,为什么大多数论文中仍然用SGD?
My in-depth remote office experience | community essay solicitation
The AOV function of R language was used for repeated measures ANOVA (one intra group factor and one inter group factor) and interaction Plot function and boxplot to visualize the interaction
Overview of currency
js常见问题
透過華為軍團看科技之變(五):智慧園區
ArcGIS Pro + PS 矢量化用地规划图