<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>RL &#8211; 编码无悔 /  Intent &amp; Focused</title>
	<atom:link href="https://www.codelast.com/tag/rl/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.codelast.com</link>
	<description>最优化之路</description>
	<lastBuildDate>Mon, 27 Apr 2020 17:21:28 +0000</lastBuildDate>
	<language>zh-Hans</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>[原创] 总有一天，失业不再遥远</title>
		<link>https://www.codelast.com/%e5%8e%9f%e5%88%9b-%e6%80%bb%e6%9c%89%e4%b8%80%e5%a4%a9%ef%bc%8c%e5%a4%b1%e4%b8%9a%e4%b8%8d%e5%86%8d%e9%81%a5%e8%bf%9c/</link>
					<comments>https://www.codelast.com/%e5%8e%9f%e5%88%9b-%e6%80%bb%e6%9c%89%e4%b8%80%e5%a4%a9%ef%bc%8c%e5%a4%b1%e4%b8%9a%e4%b8%8d%e5%86%8d%e9%81%a5%e8%bf%9c/#respond</comments>
		
		<dc:creator><![CDATA[learnhard]]></dc:creator>
		<pubDate>Sat, 25 Apr 2020 18:14:12 +0000</pubDate>
				<category><![CDATA[Algorithm]]></category>
		<category><![CDATA[原创]]></category>
		<category><![CDATA[综合]]></category>
		<category><![CDATA[Reinforcement Learning]]></category>
		<category><![CDATA[RL]]></category>
		<category><![CDATA[强化学习]]></category>
		<guid isPermaLink="false">https://www.codelast.com/?p=11992</guid>

					<description><![CDATA[<p></p>
<section class="RankEditor" data-opacity="1" data-rotate="0" data-width="100%" style="width: 100%; margin: 0px auto; opacity: 1;transform: rotateZ(0deg);-webkit-transform: rotateZ(0deg);-moz-transform: rotateZ(0deg);-ms-transform: rotateZ(0deg);-o-transform: rotateZ(0deg);">
<section style="text-align: center;margin: 10px 0%;">
<section style="text-align:left;width:35px;height:35px;margin-left:20px;background-color: rgb(209,95,238);"></section>
<p></p>
<section style="margin-top: -1.5em; border-style: solid; border-width: 1px; border-color: rgb(178, 58, 238); padding: 8px; box-sizing: border-box;">
<section style="border-style: solid; border-width: 3px; border-color: rgb(178, 58, 238); padding: 15px; box-sizing: border-box;">
<p class="brush active" style="letter-spacing: 2px; font-size: 26px; color: rgb(178, 58, 238); min-width: 1px; text-align: left;">
	<span style="font-size:16px;">尽管人类离[通用人工智能]的路还很远，但越来越多新技术的出现，让这条路得以不断加速。</span></p>
</section>
</section>
<section style="width:35px;height:35px;margin-left:auto;margin-top: -1.2em;margin-right:20px;background-color: rgb(209,95,238);"></section>
</section>
</section>
<p></p>
<section class="RankEditor" data-opacity="1" data-rotate="0" data-width="100%" style="width: 100%; margin: 0px auto; opacity: 1;transform: rotateZ(0deg);-webkit-transform: rotateZ(0deg);-moz-transform: rotateZ(0deg);-ms-transform: rotateZ(0deg);-o-transform: rotateZ(0deg);">
<section style="margin-right: auto; margin-left: auto; display: flex; justify-content: center; align-items: center;">
<section style="display: flex;flex-direction: row;justify-content: center;align-items: center;">
<section style="display: flex;flex-direction: column;justify-content: center;align-items: center;">
<section style="width: 43px; height: 3px; background: rgb(255, 0, 0); border-radius: 2px; flex-shrink: 0; box-sizing: border-box;"></section>
<section style="width: 43px; height: 3px; background: rgb(255, 211, 155); border-radius: 2px; flex-shrink: 0; margin-top: 2px; box-sizing: border-box;"></section>
</section>
<section style="margin-right: 10px; margin-left: 10px;text-align: center;">
<p class="title active" style=" color: rgb(51, 51, 51); letter-spacing: 1.5px; line-height: 1.75;min-width:1px;">
	​What？强化学习设计芯片？</p>
</section>
<section style="display: flex;flex-direction: column;justify-content: center;align-items: center;">
<section style="width: 43px; height: 3px; background: rgb(255, 0, 0); border-radius: 2px; flex-shrink: 0; box-sizing: border-box;"></section>
<section style="width: 43px; height: 3px; background: rgb(255, 211, 155); border-radius: 2px; flex-shrink: 0; margin-top: 2px; box-sizing: border-box;"></section>
</section>
</section>
</section>
</section>
<p>就这几天的事：Google已经开始用强化学习技术来设计芯片了！<br />
如果说用强化学习来玩游戏、下围棋，甚至用来帮助提升互联网广告的点击率、收入，都不是什么新鲜事的话，那么用强化学习来设计芯片，就也太新鲜了吧？但Google就做到了<span style="color:#0000ff;"><sup>[1]</sup></span>：</p>
<blockquote>
<p>
		我们提出了一种基于学习的芯片布局方法，这是芯片设计过程中最复杂、最耗时的阶段之一。与之前的方法不同，我们的方法具有从过去的经验中学习并随着时间的推移而改进的能力。特别是随着我们对更多的芯片块进行训练，我们的方法在快速生成以前未见过的芯片块的优化布局方面变得更好。为了实现这些结果，我们将芯片布局作为一个强化学习（RL）问题，并训练一个Agent将芯片网表的节点放置到芯片画布上。为了使我们的RL策略能够泛化到未见过的芯片块，我们将表征学习置于预测布局质量的有监督任务中。通过设计一个能够准确预测各种网表及其布局质量的神经架构，我们能够生成丰富的输入网表的特征嵌入。然后，我们使用这个架构作为我们的策略和价值网络的编码器来实现转移学习。我们的目标是将PPA（功率、性能和面积）降到最低，我们表明，在6个小时内，我们的方法可以在现代加速器网表上生成超越人类或可与之相媲美的芯片布局，而现有的基线需要人类专家在循环中进行，并需要几周的时间。</p>
</blockquote>
<p>硬件工程师为之虎躯一颤。<br />
<span id="more-11992"></span><br />
这是我今年看到的第二个跟我多少有点关系，并且又让我马上喊出一句&#8220;卧槽&#8221;的技术应用了。<br />
<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a><br />
在机器学习领域，强化学习可能是目前人类发明的、最接近人类成长过程的机器学习范式了。从婴儿的咿呀学步，到掌握海量知识，人都是在不断接受外界反馈中对自我行为做出修正，而强化学习正是模仿了这一过程。<br />
目前科学家们正在不断拓展强化学习的应用边界，从一开始的相对简单领域，到越来越复杂的工作，都尝试用强化学习来完成。<br />
事实上，在现实世界，真正比较大规模的、普通人摸得着看得见的强化学习应用，还是当属游戏领域的AI玩家，但考虑到游戏受众占总人口数的比例很小，所以客观地说，强化学习并没有像人脸识别、语音识别等机器学习技术一样渗透到民生的方方面面。不过，由于强化学习的可预见潜力很大，我们有理由相信，它会在很多领域代替人类的工作，而这些工作，不是低水平的重复工作，而是需要较高知识储备才能胜任的。<br />
<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a></p>
<section class="RankEditor" data-opacity="1" data-rotate="0" data-width="100%" style="width: 100%; margin: 0px auto; opacity: 1;transform: rotateZ(0deg);-webkit-transform: rotateZ(0deg);-moz-transform: rotateZ(0deg);-ms-transform: rotateZ(0deg);-o-transform: rotateZ(0deg);">
<section style="margin-right: auto; margin-left: auto; display: flex; justify-content: center; align-items: center;">
<section style="display: flex;flex-direction: row;justify-content: center;align-items: center;">
<section style="display: flex;flex-direction: column;justify-content: center;align-items: center;">
<section style="width: 43px; height: 3px; background: rgb(255, 0, 0); border-radius: 2px; flex-shrink: 0; box-sizing: border-box;"></section>
<section style="width: 43px; height: 3px; background: rgb(255, 211, 155); border-radius: 2px; flex-shrink: 0; margin-top: 2px; box-sizing: border-box;"></section>
</section>
<section style="margin-right: 10px; margin-left: 10px;text-align: center;">
<p class="title active" style=" color: rgb(51, 51, 51); letter-spacing: 1.5px; line-height: 1.75;min-width:1px;">
	米娜？你真的可以无障碍聊天？</p>
</section>
<section style="display: flex;flex-direction: column;justify-content: center;align-items: center;">
<section style="width: 43px; height: 3px; background: rgb(255, 0, 0); border-radius: 2px; flex-shrink: 0; box-sizing: border-box;"></section>
<section style="width: 43px; height: 3px; background: rgb(255, 211, 155); border-radius: 2px; flex-shrink: 0; margin-top: 2px; box-sizing: border-box;"></section>
</section>
</section>
</section>
</section>
<p>还是Google，在今年1月的时候发布了一个聊天机器人：Meena<span style="color:#0000ff;"><sup>[2]</sup></span>（&#8220;米娜&#8221;？）。当然，说是发布，其实并没有公开地提供这个服务，也没有App提供下载，Google只是发了篇论文说他们达到了什么样的技术成果。<br />
这个Meena有多牛呢？<br />
举个大家生活中随处可见的例子：无论你是在京东淘宝上购物的时候在线咨询，还是在打各种客服电话的时候接线的是个&#8220;机器人&#8221;，可能都会很容易遇到这样一种情况：只要问题问得不是那么直接，那些&#8220;聊天机器人&#8221;就不知道怎么回答了。<br />
再比如，我家里有一个&#8220;小爱同学&#8221;（小米的智能音箱），我问她&#8220;明天的天气怎么样&#8221;，她能完美回答我；但如果我用和人类随意聊天的方式来和她对话，她马上就会进入懵逼状态：&#8220;哎呀，你说的这个问题小爱不懂&#8221;。<br />
理想和现实的差距，就是人类和市面上所有聊天机器人的差距。<br />
而Google的Meena是一个&#8220;<span style="color:#0000ff;">开放领域聊天机器人</span>&#8221;。开放领域聊天机器人不会仅限于在某个特定领域，而是能够和用户聊近乎所有的话题&#8212;&#8212;这不就是人类的正常表现嘛。<br />
<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a></p>
<blockquote>
<p>
		Meena是一个有着26亿参数的端到端神经对话模型，也就是GPT-2模型最大版本（15 亿参数）的1.7倍。通过实验可以看到，Meena 比现有的 SOTA 聊天机器人能够更好地完成对话，对话内容显得更为具体、清楚。</p>
</blockquote>
<p>Google也给出了一些实例，用来说明Meena与人类的对话有多自然。<br />
如果Meena真能达到真人水平，那她一定是我做梦都想拥有的一个chatbot。<br />
我现在每周都在<a href="http://cambly.com/invite/DZZZ" rel="noopener noreferrer" target="_blank"><span style="color: rgb(0, 0, 255);">Cambly</span></a>上和外国人聊天练口语，我当然想把这钱省下来，我曾经也找过英语的chatbot，但没有什么好的结果，在语言学习方面，和人类交流目前还是具有不可替代性。我可以和外国人聊新冠疫情的近况，聊时事政治的发展，但是我和一个chatbot讲这些，它可能当我是傻子（其实它才是傻子）。<br />
所以，如果有一个像Meena那样的chatbot可以和我在开放领域以人类水平用英语聊天，那我真要笑开了花！<br />
<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a>&#8230; <a href="https://www.codelast.com/%e5%8e%9f%e5%88%9b-%e6%80%bb%e6%9c%89%e4%b8%80%e5%a4%a9%ef%bc%8c%e5%a4%b1%e4%b8%9a%e4%b8%8d%e5%86%8d%e9%81%a5%e8%bf%9c/" class="read-more">Read More </a></p>]]></description>
										<content:encoded><![CDATA[<p></p>
<section class="RankEditor" data-opacity="1" data-rotate="0" data-width="100%" style="width: 100%; margin: 0px auto; opacity: 1;transform: rotateZ(0deg);-webkit-transform: rotateZ(0deg);-moz-transform: rotateZ(0deg);-ms-transform: rotateZ(0deg);-o-transform: rotateZ(0deg);">
<section style="text-align: center;margin: 10px 0%;">
<section style="text-align:left;width:35px;height:35px;margin-left:20px;background-color: rgb(209,95,238);"></section>
<p></p>
<section style="margin-top: -1.5em; border-style: solid; border-width: 1px; border-color: rgb(178, 58, 238); padding: 8px; box-sizing: border-box;">
<section style="border-style: solid; border-width: 3px; border-color: rgb(178, 58, 238); padding: 15px; box-sizing: border-box;">
<p class="brush active" style="letter-spacing: 2px; font-size: 26px; color: rgb(178, 58, 238); min-width: 1px; text-align: left;">
	<span style="font-size:16px;">尽管人类离[通用人工智能]的路还很远，但越来越多新技术的出现，让这条路得以不断加速。</span></p>
</section>
</section>
<section style="width:35px;height:35px;margin-left:auto;margin-top: -1.2em;margin-right:20px;background-color: rgb(209,95,238);"></section>
</section>
</section>
<p></p>
<section class="RankEditor" data-opacity="1" data-rotate="0" data-width="100%" style="width: 100%; margin: 0px auto; opacity: 1;transform: rotateZ(0deg);-webkit-transform: rotateZ(0deg);-moz-transform: rotateZ(0deg);-ms-transform: rotateZ(0deg);-o-transform: rotateZ(0deg);">
<section style="margin-right: auto; margin-left: auto; display: flex; justify-content: center; align-items: center;">
<section style="display: flex;flex-direction: row;justify-content: center;align-items: center;">
<section style="display: flex;flex-direction: column;justify-content: center;align-items: center;">
<section style="width: 43px; height: 3px; background: rgb(255, 0, 0); border-radius: 2px; flex-shrink: 0; box-sizing: border-box;"></section>
<section style="width: 43px; height: 3px; background: rgb(255, 211, 155); border-radius: 2px; flex-shrink: 0; margin-top: 2px; box-sizing: border-box;"></section>
</section>
<section style="margin-right: 10px; margin-left: 10px;text-align: center;">
<p class="title active" style=" color: rgb(51, 51, 51); letter-spacing: 1.5px; line-height: 1.75;min-width:1px;">
	​What？强化学习设计芯片？</p>
</section>
<section style="display: flex;flex-direction: column;justify-content: center;align-items: center;">
<section style="width: 43px; height: 3px; background: rgb(255, 0, 0); border-radius: 2px; flex-shrink: 0; box-sizing: border-box;"></section>
<section style="width: 43px; height: 3px; background: rgb(255, 211, 155); border-radius: 2px; flex-shrink: 0; margin-top: 2px; box-sizing: border-box;"></section>
</section>
</section>
</section>
</section>
<p>就这几天的事：Google已经开始用强化学习技术来设计芯片了！<br />
如果说用强化学习来玩游戏、下围棋，甚至用来帮助提升互联网广告的点击率、收入，都不是什么新鲜事的话，那么用强化学习来设计芯片，就也太新鲜了吧？但Google就做到了<span style="color:#0000ff;"><sup>[1]</sup></span>：</p>
<blockquote>
<p>
		我们提出了一种基于学习的芯片布局方法，这是芯片设计过程中最复杂、最耗时的阶段之一。与之前的方法不同，我们的方法具有从过去的经验中学习并随着时间的推移而改进的能力。特别是随着我们对更多的芯片块进行训练，我们的方法在快速生成以前未见过的芯片块的优化布局方面变得更好。为了实现这些结果，我们将芯片布局作为一个强化学习（RL）问题，并训练一个Agent将芯片网表的节点放置到芯片画布上。为了使我们的RL策略能够泛化到未见过的芯片块，我们将表征学习置于预测布局质量的有监督任务中。通过设计一个能够准确预测各种网表及其布局质量的神经架构，我们能够生成丰富的输入网表的特征嵌入。然后，我们使用这个架构作为我们的策略和价值网络的编码器来实现转移学习。我们的目标是将PPA（功率、性能和面积）降到最低，我们表明，在6个小时内，我们的方法可以在现代加速器网表上生成超越人类或可与之相媲美的芯片布局，而现有的基线需要人类专家在循环中进行，并需要几周的时间。</p>
</blockquote>
<p>硬件工程师为之虎躯一颤。<br />
<span id="more-11992"></span><br />
这是我今年看到的第二个跟我多少有点关系，并且又让我马上喊出一句&ldquo;卧槽&rdquo;的技术应用了。<br />
<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a><br />
在机器学习领域，强化学习可能是目前人类发明的、最接近人类成长过程的机器学习范式了。从婴儿的咿呀学步，到掌握海量知识，人都是在不断接受外界反馈中对自我行为做出修正，而强化学习正是模仿了这一过程。<br />
目前科学家们正在不断拓展强化学习的应用边界，从一开始的相对简单领域，到越来越复杂的工作，都尝试用强化学习来完成。<br />
事实上，在现实世界，真正比较大规模的、普通人摸得着看得见的强化学习应用，还是当属游戏领域的AI玩家，但考虑到游戏受众占总人口数的比例很小，所以客观地说，强化学习并没有像人脸识别、语音识别等机器学习技术一样渗透到民生的方方面面。不过，由于强化学习的可预见潜力很大，我们有理由相信，它会在很多领域代替人类的工作，而这些工作，不是低水平的重复工作，而是需要较高知识储备才能胜任的。<br />
<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a></p>
<section class="RankEditor" data-opacity="1" data-rotate="0" data-width="100%" style="width: 100%; margin: 0px auto; opacity: 1;transform: rotateZ(0deg);-webkit-transform: rotateZ(0deg);-moz-transform: rotateZ(0deg);-ms-transform: rotateZ(0deg);-o-transform: rotateZ(0deg);">
<section style="margin-right: auto; margin-left: auto; display: flex; justify-content: center; align-items: center;">
<section style="display: flex;flex-direction: row;justify-content: center;align-items: center;">
<section style="display: flex;flex-direction: column;justify-content: center;align-items: center;">
<section style="width: 43px; height: 3px; background: rgb(255, 0, 0); border-radius: 2px; flex-shrink: 0; box-sizing: border-box;"></section>
<section style="width: 43px; height: 3px; background: rgb(255, 211, 155); border-radius: 2px; flex-shrink: 0; margin-top: 2px; box-sizing: border-box;"></section>
</section>
<section style="margin-right: 10px; margin-left: 10px;text-align: center;">
<p class="title active" style=" color: rgb(51, 51, 51); letter-spacing: 1.5px; line-height: 1.75;min-width:1px;">
	米娜？你真的可以无障碍聊天？</p>
</section>
<section style="display: flex;flex-direction: column;justify-content: center;align-items: center;">
<section style="width: 43px; height: 3px; background: rgb(255, 0, 0); border-radius: 2px; flex-shrink: 0; box-sizing: border-box;"></section>
<section style="width: 43px; height: 3px; background: rgb(255, 211, 155); border-radius: 2px; flex-shrink: 0; margin-top: 2px; box-sizing: border-box;"></section>
</section>
</section>
</section>
</section>
<p>还是Google，在今年1月的时候发布了一个聊天机器人：Meena<span style="color:#0000ff;"><sup>[2]</sup></span>（&ldquo;米娜&rdquo;？）。当然，说是发布，其实并没有公开地提供这个服务，也没有App提供下载，Google只是发了篇论文说他们达到了什么样的技术成果。<br />
这个Meena有多牛呢？<br />
举个大家生活中随处可见的例子：无论你是在京东淘宝上购物的时候在线咨询，还是在打各种客服电话的时候接线的是个&ldquo;机器人&rdquo;，可能都会很容易遇到这样一种情况：只要问题问得不是那么直接，那些&ldquo;聊天机器人&rdquo;就不知道怎么回答了。<br />
再比如，我家里有一个&ldquo;小爱同学&rdquo;（小米的智能音箱），我问她&ldquo;明天的天气怎么样&rdquo;，她能完美回答我；但如果我用和人类随意聊天的方式来和她对话，她马上就会进入懵逼状态：&ldquo;哎呀，你说的这个问题小爱不懂&rdquo;。<br />
理想和现实的差距，就是人类和市面上所有聊天机器人的差距。<br />
而Google的Meena是一个&ldquo;<span style="color:#0000ff;">开放领域聊天机器人</span>&rdquo;。开放领域聊天机器人不会仅限于在某个特定领域，而是能够和用户聊近乎所有的话题&mdash;&mdash;这不就是人类的正常表现嘛。<br />
<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a></p>
<blockquote>
<p>
		Meena是一个有着26亿参数的端到端神经对话模型，也就是GPT-2模型最大版本（15 亿参数）的1.7倍。通过实验可以看到，Meena 比现有的 SOTA 聊天机器人能够更好地完成对话，对话内容显得更为具体、清楚。</p>
</blockquote>
<p>Google也给出了一些实例，用来说明Meena与人类的对话有多自然。<br />
如果Meena真能达到真人水平，那她一定是我做梦都想拥有的一个chatbot。<br />
我现在每周都在<a href="http://cambly.com/invite/DZZZ" rel="noopener noreferrer" target="_blank"><span style="color: rgb(0, 0, 255);">Cambly</span></a>上和外国人聊天练口语，我当然想把这钱省下来，我曾经也找过英语的chatbot，但没有什么好的结果，在语言学习方面，和人类交流目前还是具有不可替代性。我可以和外国人聊新冠疫情的近况，聊时事政治的发展，但是我和一个chatbot讲这些，它可能当我是傻子（其实它才是傻子）。<br />
所以，如果有一个像Meena那样的chatbot可以和我在开放领域以人类水平用英语聊天，那我真要笑开了花！<br />
<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a></p>
<section class="RankEditor" data-opacity="1" data-rotate="0" data-width="100%" style="width: 100%; margin: 0px auto; opacity: 1;transform: rotateZ(0deg);-webkit-transform: rotateZ(0deg);-moz-transform: rotateZ(0deg);-ms-transform: rotateZ(0deg);-o-transform: rotateZ(0deg);">
<section style="margin-right: auto; margin-left: auto; display: flex; justify-content: center; align-items: center;">
<section style="display: flex;flex-direction: row;justify-content: center;align-items: center;">
<section style="display: flex;flex-direction: column;justify-content: center;align-items: center;">
<section style="width: 43px; height: 3px; background: rgb(255, 0, 0); border-radius: 2px; flex-shrink: 0; box-sizing: border-box;"></section>
<section style="width: 43px; height: 3px; background: rgb(255, 211, 155); border-radius: 2px; flex-shrink: 0; margin-top: 2px; box-sizing: border-box;"></section>
</section>
<section style="margin-right: 10px; margin-left: 10px;text-align: center;">
<p class="title active" style=" color: rgb(51, 51, 51); letter-spacing: 1.5px; line-height: 1.75;min-width:1px;">
	有生之年的期盼</p>
</section>
<section style="display: flex;flex-direction: column;justify-content: center;align-items: center;">
<section style="width: 43px; height: 3px; background: rgb(255, 0, 0); border-radius: 2px; flex-shrink: 0; box-sizing: border-box;"></section>
<section style="width: 43px; height: 3px; background: rgb(255, 211, 155); border-radius: 2px; flex-shrink: 0; margin-top: 2px; box-sizing: border-box;"></section>
</section>
</section>
</section>
</section>
<p>随着技术的发展，在我有生之年，我一定会看到很多本来&ldquo;不可替代&rdquo;的人类，会因为技术的发展而失业，这当中，或许就包含了我这样的工程师。而技术的目标之一就是节省更大的成本，我也相信在未来几十年，AI在语言学习上一定可以代替人类，和学生进行几乎无障碍的交流对话。<br />
<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a></p>
<section class="RankEditor" data-opacity="1" data-rotate="0" data-width="100%" style="width: 100%; margin: 0px auto; opacity: 1;transform: rotateZ(0deg);-webkit-transform: rotateZ(0deg);-moz-transform: rotateZ(0deg);-ms-transform: rotateZ(0deg);-o-transform: rotateZ(0deg);">
<section style="margin-right: auto; margin-left: auto; display: flex; justify-content: center; align-items: center;">
<section style="display: flex;flex-direction: row;justify-content: center;align-items: center;">
<section style="display: flex;flex-direction: column;justify-content: center;align-items: center;">
<section style="width: 43px; height: 3px; background: rgb(255, 0, 0); border-radius: 2px; flex-shrink: 0; box-sizing: border-box;"></section>
<section style="width: 43px; height: 3px; background: rgb(255, 211, 155); border-radius: 2px; flex-shrink: 0; margin-top: 2px; box-sizing: border-box;"></section>
</section>
<section style="margin-right: 10px; margin-left: 10px;text-align: center;">
<p class="title active" style=" color: rgb(51, 51, 51); letter-spacing: 1.5px; line-height: 1.75;min-width:1px;">
	链接</p>
</section>
<section style="display: flex;flex-direction: column;justify-content: center;align-items: center;">
<section style="width: 43px; height: 3px; background: rgb(255, 0, 0); border-radius: 2px; flex-shrink: 0; box-sizing: border-box;"></section>
<section style="width: 43px; height: 3px; background: rgb(255, 211, 155); border-radius: 2px; flex-shrink: 0; margin-top: 2px; box-sizing: border-box;"></section>
</section>
</section>
</section>
</section>
<p> [1]&nbsp;<a href="https://ai.googleblog.com/2020/04/chip-design-with-deep-reinforcement.html" rel="noopener noreferrer" target="_blank">https://ai.googleblog.com/2020/04/chip-design-with-deep-reinforcement.html</a><br />
[2]&nbsp;<a href="https://ai.googleblog.com/2020/01/towards-conversational-agent-that-can.html" rel="noopener noreferrer" target="_blank">https://ai.googleblog.com/2020/01/towards-conversational-agent-that-can.html</a></p>
<p><span style="color: rgb(255, 255, 255);">文章来源：</span><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a><br />
<span style="color: rgb(255, 0, 0);">➤➤</span>&nbsp;版权声明&nbsp;<span style="color: rgb(255, 0, 0);">➤➤</span>&nbsp;<br />
转载需注明出处：<u><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><em><span style="color: rgb(0, 0, 255);"><strong style="font-size: 16px;"><span style="font-family: arial, helvetica, sans-serif;">codelast.com</span></strong></span></em></a></u>&nbsp;<br />
感谢关注我的微信公众号（微信扫一扫）：</p>
<p style="border: 0px; font-size: 13px; margin: 0px 0px 9px; outline: 0px; padding: 0px; color: rgb(77, 77, 77);">
	<img decoding="async" alt="wechat qrcode of codelast" src="https://www.codelast.com/codelast_wechat_qr_code.jpg" style="width: 200px; height: 200px;" /></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.codelast.com/%e5%8e%9f%e5%88%9b-%e6%80%bb%e6%9c%89%e4%b8%80%e5%a4%a9%ef%bc%8c%e5%a4%b1%e4%b8%9a%e4%b8%8d%e5%86%8d%e9%81%a5%e8%bf%9c/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>[原创] 强化学习里的 on-policy 和 off-policy 的区别</title>
		<link>https://www.codelast.com/%e5%8e%9f%e5%88%9b-%e5%bc%ba%e5%8c%96%e5%ad%a6%e4%b9%a0%e9%87%8c%e7%9a%84-on-policy-%e5%92%8c-off-policy-%e7%9a%84%e5%8c%ba%e5%88%ab/</link>
					<comments>https://www.codelast.com/%e5%8e%9f%e5%88%9b-%e5%bc%ba%e5%8c%96%e5%ad%a6%e4%b9%a0%e9%87%8c%e7%9a%84-on-policy-%e5%92%8c-off-policy-%e7%9a%84%e5%8c%ba%e5%88%ab/#comments</comments>
		
		<dc:creator><![CDATA[learnhard]]></dc:creator>
		<pubDate>Mon, 30 Sep 2019 03:12:24 +0000</pubDate>
				<category><![CDATA[Algorithm]]></category>
		<category><![CDATA[原创]]></category>
		<category><![CDATA[off-policy]]></category>
		<category><![CDATA[on-policy]]></category>
		<category><![CDATA[Reinforcement Learning]]></category>
		<category><![CDATA[RL]]></category>
		<category><![CDATA[强化学习]]></category>
		<guid isPermaLink="false">https://www.codelast.com/?p=10542</guid>

					<description><![CDATA[<p>
强化学习（Reinforcement Learning，简称RL）是机器学习的一个领域，刚接触的时候，大多数人可能会被它的应用领域领域所吸引，觉得非常有意思，比如用来训练AI玩游戏，用来让机器人学会做某些事情，等等，但是当你越往里看，就会发现跟传统机器学习相比，RL里面的名词简直太多了吧！多到完全可以绕晕人。比如RL里经常会提到的agent，environment，episode（rollout），policy，on-policy，off-policy，state，trajectory，reward，replay buffer，model-based，model-free，MD，TD，PG，AC，等等。强化学习的高手对这些词很熟悉，但对新手来说可能就很痛苦。<br />
在RL领域，on-policy和off-policy是两个非常重要的概念，这两个词，把RL方法分成了两个类别。你可以从网上搜到很多很人提问on-policy的强化学习方法和off-policy的强化学习方法有什么区别，作为一个智商相当平庸的人，鬼知道我当初看了多少教程才认为自己大概搞清楚了它们之间的区别。<br />
所以我在这篇文章里想把自己的肤浅理解分享出来，希望能帮助到少部分人。<br />
<span id="more-10542"></span><br />
由于自己的知识有限，可能会出现错误，请见谅。</p>
<ul>
<li>
		中文含义</li>
</ul>
<p>我见过的 on-policy/off-policy 的中文翻译有：同策略/异策略，在线策略/离线策略，光看这些名字真的会迷惑人，所以不要试图去用中文来理解它们的区别。<br />
<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a></p>
<ul>
<li>
		关键区别</li>
</ul>
<p>这二者之间的区别，不在于选择action的方式，而在于更新网络参数的数据的收集方式。参考Reddit上的<a href="https://www.reddit.com/r/reinforcementlearning/comments/a7242o/arent_offpolicy_algorithms_with_deterministic/" rel="noopener noreferrer" target="_blank"><span style="background-color:#ff8c00;">这个</span></a>讨论。<br />
理论上来说，on-policy的算法只能使用当前正在优化的policy生成的数据来进行训练，当你使用一条(state, action, reward, new_state)的数据对policy网络的参数进行了更新之后，这个&#8220;正在优化&#8221;的policy立即就变了，于是，你就要用它来生成新的一条数据，再继续进行后面的训练，并且你刚才用于训练的那条数据已经&#8220;过时&#8221;了，不能再使用，需要丢弃掉。<br />
有人会说这种做法是不是太低效了？于是在实践中，经常是每收集了N条数据才会去更新一次，这N条数据是一个batch，并且这N条数据是用同一个policy生成的。<br />
有人还会说，这好像不对啊？！理论上，用当前的policy生成了一条数据，就应该更新一次policy网络的参数，然后policy网络就变了，此时才能再生成第2条数据，依此类推，当生成到第N条数据的时候，policy网络都不知道变成什么鬼样子了，而如果我们用同一个policy连续生成N条数据才去更新一次policy网络的参数，这时的policy网络能跟一条条更新方式相比吗？确实，这两种方式表面上看起来policy相差会很大，但是，有其他的一些技术可以从数学上保证、并且也从实际效果上证明了：每N条数据才更新一次policy网络的方式，和每一条数据就更新一次policy网络的方式，没有多大区别，可行！<br />
正因为这二者没有多大区别，我们仍然可以把每N条数据才更新一次policy网络、看似用&#8220;已经过时&#8221;的数据来更新policy网络的方法，叫做on-policy的方法&#8212;&#8212;尽管它在实践操作的时候，看上去非常像off-policy的方法。<br />
我用一个不专业的方法来描述一下：纯粹的on-policy的方法，就像是一个在不停跑步的人，他的姿态永远都在根据当前个人的身体状况调整改变，而每N条数据更新一次policy网络的方法，他只是看上去像off-policy的，但它实际上并没有真的&#8220;off&#8221;（完全落后跟不上），他只是看上去像是反射弧慢了一点，跑几百步就停下来歇一会儿，然后根据个人的身体状况，在接下来的那一段路程里，再用完全一致的姿态继续跑完（在这一段里不改变姿态）。<br />
<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a></p>
<ul>
<li>
		Behavior Policy 和 Target Policy / Update Policy</li>
</ul>
<p>在一些介绍 on-policy / off-policy 区别的文章中，会看到用 behavior policy（行为策略）和 target policy（目标策略）的概念来解释 on-policy / off-policy 之间的区别，至于 update policy，提到这个概念的文章并不算多，比如<a href="https://leimao.github.io/blog/RL-On-Policy-VS-Off-Policy/" rel="noopener noreferrer" target="_blank"><span style="background-color:#ffa07a;">这篇</span></a>文章，我觉得大家就按 target policy 来理解就好了。<br />
behavior policy 是指与environment互动生成training data的策略，target policy 是指你用training data不断去更新、优化，最终要拿去用的那个策略。为什么要搞出这两个概念？其实对于 on-policy 的算法来说，这两样根本就是一个东西！也就是说，我们用于生成training data的behavior policy，在生成了一条training data之后，马上就会被更新（现在你可以把它叫做target policy了，所处的位置不同，名称也不同），所以在 on-policy 算法中它俩其实是一回事。<br />
<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a>&#8230; <a href="https://www.codelast.com/%e5%8e%9f%e5%88%9b-%e5%bc%ba%e5%8c%96%e5%ad%a6%e4%b9%a0%e9%87%8c%e7%9a%84-on-policy-%e5%92%8c-off-policy-%e7%9a%84%e5%8c%ba%e5%88%ab/" class="read-more">Read More </a></p>]]></description>
										<content:encoded><![CDATA[<p>
强化学习（Reinforcement Learning，简称RL）是机器学习的一个领域，刚接触的时候，大多数人可能会被它的应用领域领域所吸引，觉得非常有意思，比如用来训练AI玩游戏，用来让机器人学会做某些事情，等等，但是当你越往里看，就会发现跟传统机器学习相比，RL里面的名词简直太多了吧！多到完全可以绕晕人。比如RL里经常会提到的agent，environment，episode（rollout），policy，on-policy，off-policy，state，trajectory，reward，replay buffer，model-based，model-free，MD，TD，PG，AC，等等。强化学习的高手对这些词很熟悉，但对新手来说可能就很痛苦。<br />
在RL领域，on-policy和off-policy是两个非常重要的概念，这两个词，把RL方法分成了两个类别。你可以从网上搜到很多很人提问on-policy的强化学习方法和off-policy的强化学习方法有什么区别，作为一个智商相当平庸的人，鬼知道我当初看了多少教程才认为自己大概搞清楚了它们之间的区别。<br />
所以我在这篇文章里想把自己的肤浅理解分享出来，希望能帮助到少部分人。<br />
<span id="more-10542"></span><br />
由于自己的知识有限，可能会出现错误，请见谅。</p>
<ul>
<li>
		中文含义</li>
</ul>
<p>我见过的 on-policy/off-policy 的中文翻译有：同策略/异策略，在线策略/离线策略，光看这些名字真的会迷惑人，所以不要试图去用中文来理解它们的区别。<br />
<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a></p>
<ul>
<li>
		关键区别</li>
</ul>
<p>这二者之间的区别，不在于选择action的方式，而在于更新网络参数的数据的收集方式。参考Reddit上的<a href="https://www.reddit.com/r/reinforcementlearning/comments/a7242o/arent_offpolicy_algorithms_with_deterministic/" rel="noopener noreferrer" target="_blank"><span style="background-color:#ff8c00;">这个</span></a>讨论。<br />
理论上来说，on-policy的算法只能使用当前正在优化的policy生成的数据来进行训练，当你使用一条(state, action, reward, new_state)的数据对policy网络的参数进行了更新之后，这个&ldquo;正在优化&rdquo;的policy立即就变了，于是，你就要用它来生成新的一条数据，再继续进行后面的训练，并且你刚才用于训练的那条数据已经&ldquo;过时&rdquo;了，不能再使用，需要丢弃掉。<br />
有人会说这种做法是不是太低效了？于是在实践中，经常是每收集了N条数据才会去更新一次，这N条数据是一个batch，并且这N条数据是用同一个policy生成的。<br />
有人还会说，这好像不对啊？！理论上，用当前的policy生成了一条数据，就应该更新一次policy网络的参数，然后policy网络就变了，此时才能再生成第2条数据，依此类推，当生成到第N条数据的时候，policy网络都不知道变成什么鬼样子了，而如果我们用同一个policy连续生成N条数据才去更新一次policy网络的参数，这时的policy网络能跟一条条更新方式相比吗？确实，这两种方式表面上看起来policy相差会很大，但是，有其他的一些技术可以从数学上保证、并且也从实际效果上证明了：每N条数据才更新一次policy网络的方式，和每一条数据就更新一次policy网络的方式，没有多大区别，可行！<br />
正因为这二者没有多大区别，我们仍然可以把每N条数据才更新一次policy网络、看似用&ldquo;已经过时&rdquo;的数据来更新policy网络的方法，叫做on-policy的方法&mdash;&mdash;尽管它在实践操作的时候，看上去非常像off-policy的方法。<br />
我用一个不专业的方法来描述一下：纯粹的on-policy的方法，就像是一个在不停跑步的人，他的姿态永远都在根据当前个人的身体状况调整改变，而每N条数据更新一次policy网络的方法，他只是看上去像off-policy的，但它实际上并没有真的&ldquo;off&rdquo;（完全落后跟不上），他只是看上去像是反射弧慢了一点，跑几百步就停下来歇一会儿，然后根据个人的身体状况，在接下来的那一段路程里，再用完全一致的姿态继续跑完（在这一段里不改变姿态）。<br />
<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a></p>
<ul>
<li>
		Behavior Policy 和 Target Policy / Update Policy</li>
</ul>
<p>在一些介绍 on-policy / off-policy 区别的文章中，会看到用 behavior policy（行为策略）和 target policy（目标策略）的概念来解释 on-policy / off-policy 之间的区别，至于 update policy，提到这个概念的文章并不算多，比如<a href="https://leimao.github.io/blog/RL-On-Policy-VS-Off-Policy/" rel="noopener noreferrer" target="_blank"><span style="background-color:#ffa07a;">这篇</span></a>文章，我觉得大家就按 target policy 来理解就好了。<br />
behavior policy 是指与environment互动生成training data的策略，target policy 是指你用training data不断去更新、优化，最终要拿去用的那个策略。为什么要搞出这两个概念？其实对于 on-policy 的算法来说，这两样根本就是一个东西！也就是说，我们用于生成training data的behavior policy，在生成了一条training data之后，马上就会被更新（现在你可以把它叫做target policy了，所处的位置不同，名称也不同），所以在 on-policy 算法中它俩其实是一回事。<br />
<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a></p>
<ul>
<li>
		最容易把人搞疯的例子：PPO</li>
</ul>
<p><span style="color:#ff0000;">PPO</span>（Proximal Policy Optimization，近端策略优化）是当前在强化学习领域内，用于离散动作控制的最知名的算法之一（来自于OpenAI）。这玩意让人费解的地方在于，你会看到无数篇文章，这一篇讲它是on-policy的算法，另一篇讲它是off-policy的算法，而且看似各有各的说法各有各的道理。作为一个知识储备还不够多的人来说，很难判断谁对谁错。<br />
我随便举几个网上搜到的例子：<br />
（1）说PPO是on-policy的文章有：<br />
<a href="https://www.zhihu.com/question/321713509">https://www.zhihu.com/question/321713509</a><br />
<a href="https://github.com/openai/baselines/issues/316">https://github.com/openai/baselines/issues/316</a><br />
（2）说PPO是off-policy的文章有：<br />
<a href="https://blog.csdn.net/qq_30615903/article/details/86308045">https://blog.csdn.net/qq_30615903/article/details/86308045</a><br />
<a href="https://zhuanlan.zhihu.com/p/39624504">https://zhuanlan.zhihu.com/p/39624504</a>（在这篇文章的评论里，有网友提出了质疑，认为PPO是on-policy的）<br />
<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a><br />
这些文章，很多充满了大量的数学公式，非常像样，作为一个初学者，恐怕原来有自己的想法，看了这些文章之后可能也会怀疑人生。<br />
在上面的GitHub链接中，OpenAI的research scientist&nbsp;<a href="https://matthiasplappert.com/" rel="noopener noreferrer" target="_blank">Matthias Plappert</a>给了一个明确的说法：PPO是一种on-policy的算法。由于PPO就是OpenAI发明的，因此信他没错。</p>
<blockquote>
<div>
		To clarify: PPO is an on-policy algorithm so you are correct that going over the same data multiple times is technically incorrect.</div>
<div>
		&nbsp;</div>
<div>
		However, we found that PPO is actually quite okay with doing this and we still get stable convergence. This is likely due to the proximal trust region constrained that we enforce, which means that the policy cannot change that much anyway when going over the current set of transitions multiple times, making it still approximately on-policy. You can of course get rid of this but then you&#39;ll need more samples.</div>
</blockquote>
<div>
	所以PPO算是一种&ldquo;近似的&rdquo;on-policy算法。<br />
	<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a><br />
	<span style="color: rgb(255, 0, 0);">➤➤</span>&nbsp;版权声明&nbsp;<span style="color: rgb(255, 0, 0);">➤➤</span>&nbsp;<br />
	转载需注明出处：<u><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><em><span style="color: rgb(0, 0, 255);"><strong style="font-size: 16px;"><span style="font-family: arial, helvetica, sans-serif;">codelast.com</span></strong></span></em></a></u>&nbsp;<br />
	感谢关注我的微信公众号（微信扫一扫）：</p>
<p style="border: 0px; font-size: 13px; margin: 0px 0px 9px; outline: 0px; padding: 0px; color: rgb(77, 77, 77);">
		<img decoding="async" alt="wechat qrcode of codelast" src="https://www.codelast.com/codelast_wechat_qr_code.jpg" style="width: 200px; height: 200px;" /></p>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://www.codelast.com/%e5%8e%9f%e5%88%9b-%e5%bc%ba%e5%8c%96%e5%ad%a6%e4%b9%a0%e9%87%8c%e7%9a%84-on-policy-%e5%92%8c-off-policy-%e7%9a%84%e5%8c%ba%e5%88%ab/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
	</channel>
</rss>
