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

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

by 斋藤康毅
July 2018
Intermediate to advanced
310 pages
8h 21m
Chinese
Posts & Telecom Press
Content preview from 深度学习入门 : 基于Python的理论与实现
4.5  学习算法的实现 
109
求出神经网络的梯度后,接下来只需根据梯度法,更新权重参数即可。
在下一节中,我们会以2 层神经网络为例,实现整个学习过程。
为了对应形状为多维数组的权重参数
W
,这里使用的n
umerical_
gradient()
和之前的实现稍有不同。不过,改动只是为了对应多维
数组,所以改动并不大。这里省略了对代码的说明,想知道细节的
读者请参考源代码(
common/gradient.py
)。
4.5
学习算法的实现
关于神经网络学习的基础知识,到这里就全部介绍完了。“损失函
”“
mini-batch
”“梯度”“梯度下降法”等关键词已经陆续登场,这里我们
来确认一下神经网络的学习步骤,顺便复习一下这些内容。神经网络的学习
步骤如下所示。
前提
神经网络存在合适的权重和偏置,调整权重和偏置以便拟合训练数据的
过程称为“学习”。神经网络的学习分成下面 4 个步骤。
步骤1mini-batch
从训练数据中随机选出一部分数据,这部分数据称为mini-batch。我们
的目标是减小 mini-batch 的损失函数的值。
步骤2(计算梯度)
为了减小mini-batch 的损失函数的值,需要求出各个权重参数的梯度。
梯度表示损失函数的值减小最多的方向。
步骤3(更新参数)
将权重参数沿梯度方向进行微小更新。
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