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

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

by 斋藤康毅
July 2018
Intermediate to advanced
310 pages
8h 21m
Chinese
Posts & Telecom Press
Content preview from 深度学习入门 : 基于Python的理论与实现
6章 与学习相关的技巧
198
这里介绍的超参数的最优化方法是实践性的方法。不过,这个方
法与其说是科学方法,倒不如说有些实践者的经验的感觉。在超
参数的最优化中,如果需要更精炼的方法,可以使用贝叶斯最优
(Bayesian optimization)。贝叶斯最优化运用以贝叶斯定理为中
心的数学理论,能够更加严密、高效地进行最优化。详细内容请
文“Practical Bayesian Optimization of Machine Learning 
Algorithms”
[16]
等。
6.5.3
 超参数最优化的实现
现在,我们使用
MNIST
数据集进行超参数的最优化。这里我们将学习
率和控制权值衰减强度的系数(下文称为“权值衰减系数”)这两个超参数的
搜索问题作为对象。这个问题的设定和解决思路参考了斯坦福大学的课程
CS231n
”。
如前所述,通过从0.00110
3
)到 100010
3
)这样的对数尺度的范围
中随机采样进行超参数的验证。这在
Python
中可以写成
10 ** np.random.
uniform(-3, 3)
。在该实验中,权值衰减系数的初始范围为10
8
10
4
,学
习率的初始范围为10
6
10
2
。此时,超参数的随机采样的代码如下所示。
weight_decay = 10 ** np.random.uniform(-8, -4)
lr = 10 ** np.random.uniform(-6, -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