Skip to Content
深度学习入门 : 基于Python的理论与实现
book

深度学习入门 : 基于Python的理论与实现

by 斋藤康毅
July 2018
Intermediate to advanced
310 pages
8h 21m
Chinese
Posts & Telecom Press
Content preview from 深度学习入门 : 基于Python的理论与实现
7章 卷积神经网络
216
7-16  输入数据在宽度方向上只偏离 1 个元素时,输出仍为相同的结果(根据数据的不同,
有时结果也不相同)
1 2
0 1 2
3 0 1
1’
9
6
7
8
17
6
4
4 8
1 2 0 0
0 9 2 23 3
3 0
0
1
1
1
1
2
2
2
2
2
2
0
0
01
1
1
1
1 2
0 1 2
3 0 1
1’
9
6
7
8
3
2
17
6
4
4 8
1 2 0
0 9 2 23
3 0
0
1
1
1
1
2
2
2
2
0
0
01
1
3
1
3
2
2
1
7.4
卷积层和池化层的实现
前面我们详细介绍了卷积层和池化层,本节我们就用
Python
来实现这
两个层。和第5 章一样,也给进行实现的类赋予
forward
backward
方法,并
使其可以作为模块使用。
大家可能会感觉卷积层和池化层的实现很复杂,但实际上,通过使用某
种技巧,就可以很轻松地实现。本节将介绍这种技巧,将问题简化,然后再
进行卷积层的实现。
7.4.1
 4维数组
如前所述,
CNN
中各层间传递的数据是4 维数据。所谓4 维数据,比如
数据的形状是
(
10, 1, 28, 28
)
,则它对应10 个高为 28、长为28、通道为 1的数
据。用
Python
来实现的话,如下所示。
>>> x = np.random.rand(10, 1, 28, 28) #
随机生成数据
>>> x.shape
(10, 1, 28, 28)
这里,如果要访问第1 个数据,只要写
x[0]
就可以了(注意
Python
的索
引是从0 开始的)。同样地,用
x[1]
可以访问第2 个数据。
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

ルールズ・オブ・プログラミング ―より良いコードを書くための21のルール

ルールズ・オブ・プログラミング ―より良いコードを書くための21のルール

Chris Zimmerman, 久富木 隆一

Publisher Resources

ISBN: 9787115485588