Skip to Content
精通機器學習
book

精通機器學習

by Aurélien Géron
April 2020
Intermediate to advanced
816 pages
18h 32m
Chinese
GoTop Information, Inc.
Content preview from 精通機器學習
636
|
第十八章:強化學習
print
("
\r
{} loss:{:.5f}".format(
iteration, train_loss.loss.numpy()), end="")
if
iteration % 1000 == 0:
log_metrics(train_metrics)
函式先向
collect policy
取得它的初始狀態
提供環境批次大小
在此是
1)。
因為策略是
無狀態的
它會回傳一個空
tuple
所以我們也可以寫成
policy_state = ()
)。
接著
們建立一個處理資料組的
iterator
並執行訓練迴圈
在每一次迭代
我們呼叫
driver
run()
方法
將目前的時步
最初是
None
和目前的策略狀態傳給它
它會執行收集策
略和收集經驗四步
就像我們之前設置的
),
將收集的軌跡廣播給重播緩衝區和評量標
接下來
我們從資料組抽出一批軌跡
並將它傳給
agent
train()
方法
它會回傳
一個
train_loss
物件
這個物件可能隨著
agent
的類型而不同
接下來
我們顯示迭代次
數與訓練
loss
並且每隔
1,000
次迭代就
log
所有評量標準
現在你可以直接呼叫
train_
agent()
來執行幾次迭代
看看
agent
如何逐漸學習
打磚塊
train_agent(10000000)
這將花費許多計算資源
也需要你的耐心
可能花好幾個小時
甚至好幾天
依你的硬體
而定
),
而且你可能需要執行演算法多次
使用不同的隨機種子
才能得到很好的結果
但是當你完成時
age ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

面向数据科学家的实用统计学

面向数据科学家的实用统计学

Peter Bruce, Andrew Bruce
C语言核心技术(原书第2版)

C语言核心技术(原书第2版)

Peter Prinz, Tony Crawford
高效能PYTHON程式設計

高效能PYTHON程式設計

Micha Gorelick, Ian Ozsvald
下一代空间计算:AR与VR创新理论与实践

下一代空间计算:AR与VR创新理论与实践

Erin Pangilinan, Steve Lukas, Vasanth Mohan

Publisher Resources

ISBN: 9789865024345