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章 神经网络的学习
98
>>> numerical_diff(function_1, 5)
0.1999999999990898
>>> numerical_diff(function_1, 10)
0.2999999999986347
这里计算的导数是f
(
x
)
相对于x 的变化量,对应函数的斜率。另外,
f
(
x
) =
0.01x
2
+
0.1x 的解析解是
。因 此,在 x
=
5
x
=
10 处,“真的导数”分别为0.2 0.3。和上面的结果相比,我们发现虽然
严格意义上它们并不一致,但误差非常小。实际上,误差小到基本上可以认
为它们是相等的。
现在,我们用上面的数值微分的值作为斜率,画一条直线。结果如图 4
-
7
所示,可以确认这些直线确实对应函数的切线(源代码在
ch04/gradient_1d.
py
)。
4-7 
x
= 5
x
= 10 处的切线:直线的斜率使用数值微分的值
f ( x )
f ( x )
4.3.3
 偏导数
接下来,我们看一下式
(
4.6
)
表示的函数。虽然它只是一个计算参数的
平方和的简单函数,但是请注意和上例不同的是,这里有两个变量。
4.6
这个式子可以用
Python
来实现,如下所示。
def function_2(x):
4.3 数值微分
99
return x[0]**2 + 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