深度学习中Dropout原理详解

背景

Dropout原文:Dropout: A Simple Way to Prevent Neural Networks from Overfi tting 发表于2014年。

提出Dropout的目的是为了解决深度神经网络中的如下问题:

  1. 参数过多,训练速度慢
  2. 过拟合

Dropout关键思想:在训练过程中从神经网络中随机删除单元(及其连接),这样可以防止单元之间的相互适应过多。

原理

训练阶段:
假设神经元被保留的概率为 p p p,则在前向传播中,神经元以 1 − p 1-p 1p概率被删除,并同时删除它的所有连接,包括income和outcome。
图片名称
假设神经网络有L个隐藏层
l ∈ { 1 , 2 , . . . , L } l \in \{1, 2, ..., L\} l{1,2,...,L}代表隐藏层的下标, z ( l ) z^{(l)} z(l)表示第 l l l层输入, y ( l ) y^{(l)} y(l)表示第 l l l层输出, W ( l ) , b ( l ) W^{(l)}, b^{(l)} W(l),b(l)表示第 l l l层参数。则标准神经网络前向传播过程如下:
z i ( l + 1 ) = w i ( l + 1 ) y ( l ) + b i ( l + 1 ) y ( l + 1 ) = f ( z i ( l + 1 ) ) z_i^{(l+1)}=w_i^{(l+1)}y^{(l)}+b_i^{(l+1)}\\ y^{(l+1)}=f(z_i^{(l+1)}) zi(l+1)=wi(l+1)y(l)+bi(l+1)y(l+1)=f(zi(l+1))
其中f代表激活函数
添加Dropout后,前向传播过程如下:
r j ( l ) = B e r n o u l l i ( p ) y ~ ( l ) = r j ( l ) ∗ y ( l ) z i ( l + 1 ) = w i ( l + 1 ) y ~ ( l ) + b i ( l + 1 ) y ( l + 1 ) = f ( z i ( l + 1 ) ) r_j^{(l)}=Bernoulli(p)\\ \widetilde{y}^{(l)}=r_j^{(l)}*y^{(l)}\\ z_i^{(l+1)}=w_i^{(l+1)}\widetilde{y}^{(l)}+b_i^{(l+1)}\\ y^{(l+1)}=f(z_i^{(l+1)}) rj(l)=Bernoulli(p)y (l)=rj(l)y(l)zi(l+1)=wi(l+1)y (l)+bi(l+1)y(l+1)=f(zi(l+1))
图片名称

测试阶段:
如果在训练期间以概率p保留一个单位,则在测试时将该单位的输出权重乘以p,如图所示。

图片名称

模型的使用

  1. 通过MBGD (Mini-Batch Gradient Descent) 训练Dropout神经网络。和传统MBGD的区别是,对于Mini-Batch中的每个train案例,我们都通过剔除神经元来对网络进行采样,也就是每个Batch,都对神经网络进行一次Dropout
  2. 最后每个神经元参数的梯度在所有Mini-Batch的训练案例中取平均值。 任何不使用参数的训练案例都会为该参数贡献零梯度。

模型改善

  1. 使用Momentum梯度下降法
  2. 使用退火的学习速率
  3. L2权重衰减
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
code! 此为源代码! 视频教程见: May 1, 2020 Machine Learning Projects with TensorFlow 2.0: Supercharge your Machine Learning skills with Tensorflow 2 English | MP4 | AVC 1920×1080 | AAC 48KHz 2ch | 4h 20m | 965 MB eLearning | Skill level: All Levels Build and train models for real-world machine learning projects using Tensorflow 2.0 TensorFlow is the world’s most widely adopted framework for Machine Learning and Deep Learning. TensorFlow 2.0 is a major milestone due to its inclusion of some major changes making TensorFlow easier to learn and use such as “Eager Execution”. It will support more platforms and languages, improved compatibility and remove deprecated APIs. This course will guide you to upgrade your skills in Machine Learning by practically applying them by building real-world Machine Learning projects. Each section should cover a specific project on a Machine Learning task and you will learn how to implement it into your system using TensorFlow 2. You will implement various Machine Learning techniques and algorithms using the TensorFlow 2 library. Each project will put your skills to test, help you understand and overcome the challenges you can face in a real-world scenario and provide some tips and tricks to help you become more efficient. Throughout the course, you will cover the new features of TensorFlow 2 such as Eager Execution. You will cover at least 3-4 projects. You will also cover some tasks such as Reinforcement Learning and Transfer Learning. By the end of the course, you will be confident to build your own Machine Learning Systems with TensorFlow 2 and will be able to add this valuable skill to your CV. Learn Strengthen your foundations to build TensorFlow 2.0 projects by exploring its new features Analyze the Titanic data set to obtain desired results with ease Implement and organize your Tensorflow projects in a professional manner Use Tensorboard to inspect various metrics and monitor your project’s performance Research and make the most of other people’s Kaggle solutions Use OpenAI Gym Environments for implementing state of the art reinforcement learning techniques using TF-Agents Apply the latest Transfer Learning techniques from Tensorflow + Table of Contents Regression Task Airbnb Prices in New York 1 Course Overview 2 Setting Up TensorFlow 2.0 3 Getting Started with TensorFlow 2.0 4 Analyzing the Airbnb Dataset and Making a Plan 5 Implementing a Simple Linear Regression Algorithm 6 Implementing a Multi Layer Perceptron (Artificial Neural Network) 7 Improving the Network with Better Activation Functions and Dropout 8 Adding More Metrics to Gain a Better Understanding 9 Putting It All Together in a Professional Way Classification Task Build Real World Apps – Who Will Win the Next UFC 10 Collecting Possible Kaggle Data 11 Analysis and Planning of the Dataset 12 Introduction to Google Colab and How It Benefits Us 13 Setting Up Training on Google Colab 14 Some Advanced Neural Network Approaches 15 Introducing a Deeper Network 16 Inspecting Metrics with TensorBoard 17 Inspecting the Existing Kaggle Solutions Natural Language Processing Task – How to Generate Our Own Text 18 Introduction to Natural Language Processing 19 NLP and the Importance of Data Preprocessing 20 A Simple Text Classifier 21 Text Generation Methods 22 Text Generation with a Recurrent Neural Network 23 Refinements with Federated Learning Reinforcement Learning Task – How to Become Best at Pacman 24 Introduction to Reinforcement Learning 25 OpenAI Gym Environments 26 The Pacman Gym Environment That We Are Going to Use 27 Reinforcement Learning Principles with TF-Agents 28 TF-Agents for Our Pacman Gym Environment 29 The Agents That We Are Going to Use 30 Selecting the Best Approaches and Real World Applications Transfer Learning Task – How to Build a Powerful Image Classifier 31 Introduction to Transfer Learning in TensorFlow 2 32 Picking a Kaggle Dataset to Work On 33 Picking a Base Model Suitable for Transfer Learning with Our Dataset 34 Implementing our Transfer Learning approach 35 How Well Are We Doing and Can We Do Better 36 Conclusions and Future Work

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值