Skip to Content
机器学习实战:基于Scikit-Learn、Keras 和TensorFlow (原书第2 版)
book

机器学习实战:基于Scikit-Learn、Keras 和TensorFlow (原书第2 版)

by Aurélien Géron
October 2020
Intermediate to advanced
693 pages
16h 26m
Chinese
China Machine Press
Content preview from 机器学习实战:基于Scikit-Learn、Keras 和TensorFlow (原书第2 版)
436
|
第
15
章
被忽略的输出
编码器 解码器
X
(0)
X
(0)
X
(0)
X
(0)
Y
(0)
Y
(0)
Y
'
(0)
Y
'
(1)
Y
'
(2)
Y
(0)
Y
(0)
0 0 0
0 0 0
X
(1)
X
(1)
X
(1)
Y
(1)
Y
(1)
Y
(1)
Y
(1)
X
(2)
X
(2)
Y
(2)
Y
(2)
Y
(2)
X
(3)
X
(3)
Y
(3)
Y
(3)
Y
(3)
X
(4)
Y
(4)
图 15-4 :序列到序列(左上),序列到向量(右上),向量到序列(左下)和编码器
-
解码器
(右下)网络
听起来很有前途,但是如何训练循环神经网络呢?
15.2 训练 RNN
要训 练 RNN,诀窍是将其按照时间逐步展开(就像我们刚才所做的那样),然后简单地
使用常规的反向传播(见图 15-5)。这种策略称为“时间反向传播”(BackPropagation
Through Time, BPTT)。
就像在常规反向传播中一样,这里有一个通过展开网络的第一次前向通路(以虚线箭头
表示)。然后使用成本函数
C
(
Y
(0)
,
Y
(1)
, …,
Y
(
T
)
)(其中
T
是最大时间步长)来评估输出序
列。请注意,此成本函数可能会忽略某些输出,如图 15-5 所示(例如,在序列到向量
RNN 中,除最后一个输出外,所有的输出都将被忽略)。然后,该成本函数的梯度通过
展开的网络反向传播(由实线箭头表示)。最后,使用在 BPTT 期间计算的梯度来更新
模型参数。请注意,梯度反向通过成本函数使用的所有输出,而不是最终输出(例如,
在图 15-5 中,成本函数是使用网络的最后三个输出
Y
(2)
,
Y
(3)
和
Y
(4)
来计算的,因此梯度 ...
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

算法技术手册(原书第2 版)

算法技术手册(原书第2 版)

George T.Heineman, Gary Pollice, Stanley Selkow
管理Kubernetes

管理Kubernetes

Brendan Burns, Craig Tracey

Publisher Resources

ISBN: 9787111665977