当前位置:网站首页>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完全不同
边栏推荐
- MySQL advanced SQL statement of database (2)
- Circuit breaker hystrixcircuitbreaker
- Overview of currency
- 半钢同轴射频线的史密斯圆图查看和网络分析仪E5071C的射频线匹配校准
- Migrate full RT thread to gd32f4xx (detailed)
- & and - > priority
- 苹果5G芯片被曝研发失败,QQ密码bug引热议,蔚来回应做空传闻,今日更多大新闻在此...
- Skill sorting [email protected]+ Alibaba cloud +nbiot+dht11+bh1750+ soil moisture sensor +oled
- Go -- maximum heap and minimum heap
- GD32 RT-Thread OTA/Bootloader驱动函数
猜你喜欢

ArcGIS Pro脚本工具(5)——排序后删除重复项

ArcGIS Pro脚本工具(6)——修复CAD图层数据源

从0使用keil5软件仿真调试GD32F305

MySQL advanced SQL statement of database (1)

"Kunming City coffee map" was opened again, and coffee brought the city closer

同事的接口文档我每次看着就头大,毛病多多。。。

Implementation of monitor program with assembly language

那个程序员,被打了。

今晚19:00知识赋能第2期直播丨OpenHarmony智能家居项目之控制面板界面设计

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
随机推荐
Harvester ch1 of CKB and HNS, connection tutorial analysis
潘多拉 IOT 开发板学习(HAL 库)—— 实验1 跑马灯(RGB)实验(学习笔记)
Who should the newly admitted miners bow to in front of the chip machine and the graphics card machine
Go -- standard library sort package
Ant s19xp appeared in 140t, why is it called the computing power ceiling by the world
Jinbei LT6 is powerful in the year of the tiger, making waves
从0使用keil5软件仿真调试GD32F305
Why can't you rob scientists of NFT
GD32 RT-Thread DAC驱动函数
Questions about cookies and sessions
Skill combing [email protected] intelligent instrument teaching aids based on 51 series single chip microcomputer
June training (day 30) - topology sorting
Get through the supply chain Shenzhen gift show helps cross-border e-commerce find ways to break the situation
Skill sorting [email protected]+adxl345+ Motor vibration + serial port output
那个程序员,被打了。
GD32 RT-Thread OTA/Bootloader驱动函数
Compare the maximum computing power of the Cenozoic top ant s19xp and the existing s19pro in bitland
How to deploy deflationary combustion destruction contract code in BSC chain_ Deploy dividend and marketing wallet contract code
MySQL log management, backup and recovery of databases (2)
马斯克推特粉丝过亿了,但他在线失联已一周