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 精通機器學習
486
|
第十五章:使用 RNN CNN 來處理序列
訓練
RNN
訓練
RNN
的技巧是將它在時間軸上展開
就像之前的做法
),
並直接使用一般的反向傳播
見圖
15-5)。
這種策略稱為
backpropagation through timeBPTT)。
如同一般的反向傳播
它會先順向經過未展開的網路
用虛線來表示
),
再用一個代價函
C(Y
(0)
, Y
(1)
, ...Y
(T)
)T
是最大時步
來評估輸出的序列
要注意的是
這個代價函數可
能會忽略一些輸出
如圖
15-5
所示
例如
sequence-to-vector RNN
除了最後一
個輸出之外的所有輸出都會被忽略
)。
接著在未展開的網路中
反向傳播代價函數的梯度
用實線箭頭表示
)。
最後用
BPTT
過程中算出來的梯度來更新模型參數
要注意的是
梯度會反向流經代價函數使用的每一個輸出
而不是只流經最終的輸出
例如
在圖
15-5
代價函數是用網路的最後三個輸出
Y
(2)
Y
(3)
Y
(4)
來計算的
所以梯度會流經這三個
輸出
但不會經過
Y
(0)
Y
(1)
)。
此外
因為每一個時步都使用同樣的參數
W
b
反向傳
播將會做正確的事情
加總所有的時步
15-5  BPTT
幸好
tf.keras
可幫你處理這些麻煩的事情
我們開始寫程式吧
預測時間序列
假設你想要研究網站每一個小時的活躍用戶數量
或城市的每日溫度
或公司的財務健
康狀況
在每一季使用多個指標來評估
在這些情況下
每個時步的資料都是有一或多個
值的序列
稱為
時間序列
在前兩個例子中
每個時步都有一個值 ...
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