Skip to Content
Python机器学习手册:从数据预处理到深度学习
book

Python机器学习手册:从数据预处理到深度学习

by Chris Albon
July 2019
Intermediate to advanced
365 pages
8h 13m
Chinese
Publishing House of Electronics Industry
Content preview from Python机器学习手册:从数据预处理到深度学习
324
20
神经网络
讨论
Dropout
是一个流行的、强大的调节神经网络的方法。在
Dropout
方法中,每创建一个
批次的观察值用于训练时,一层或者多层的一部分神经元就会被乘以
0
(即被丢弃)。虽
然每个批次都是在同一个网络中训练的(比如,有同样的参数),但是每个批次面对的
网络结构都有些许差异。
Dropout
方法很有效是因为它不断随机地丢弃每个批次中的神经元,迫使神经元在各种
网络结构下依然能够学习参数。换句话说,神经元们变得对其他隐藏的神经元的中断(也
可以理解为噪声)更加健壮,这样可以阻止网络记住训练集数据。
在隐藏层和输入层都可以添加
Dropout
方法。当一个输入层被丢弃后,它的特征值就不
会在那个批次中被传进网络。一般对神经元丢弃的比例为,输入层
0.2
,隐藏层
0.5
Keras
中,可以通过在网络架构中添加若干个
Dropout
层来实现
Dropout
方法。每个
Dropout
层会在每个批次中丢弃前一层传过来的用户定义数量的神经元,这个数量是超
参数。记住,在
Keras
中输入层被认定为第一层,并且不需要用
add
方法来添加。所以,
如果想给输入层添加
Dropout
方法,给网络结构加的第一层就是
Dropout
层。这一层既
包含输入层神经元的丢弃比例
0.2
,也包含定义观察值的形状
input_shape
。接着,我们
在每个隐藏层之后添加一个神经元丢弃比例为
0.5
Dropout
层。
20.11
 保存模型训练过程
问题描述
假设有一个神经网络需要花很长时间来训练,现在需要保存训练过程以防训练被中断。
解决方案 ...
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

精通特征工程

精通特征工程

Alice Zheng, Amanda Casari
精通機器學習

精通機器學習

Aurélien Géron
Python数据分析基础

Python数据分析基础

Clinton W. Brownley

Publisher Resources

ISBN: 9787121369629