李宏毅——一天搞懂深度学习PPT学习笔记

该博客是李宏毅教授的深度学习课程笔记,涵盖深度学习的三个步骤:神经网络、函数优化和网络结构,讲解了全连接前馈网络、损失函数、梯度下降及其困难,强调了深度学习的优势,并介绍了Keras等工具。此外,还探讨了训练深度神经网络的技巧,如损失函数选择、小批量、激活函数、自适应学习率、动量法、早停法、权重衰减和dropout。最后,提到了卷积神经网络和循环神经网络的应用,以及监督学习、强化学习和无监督学习的未来趋势。

李宏毅一天搞懂机器学习PPT,SildeShare链接:https://www.slideshare.net/tw_dsconf/ss-62245351?qid=108adce3-2c3d-4758-a830-95d0a57e46bc&v=&b=&from_search=3
也可以在csdn下载中下载(资源附学习笔记全文):https://download.csdn.net/download/wozaipermanent/11998637

1 Introduction of Deep Learning

1.1 Three Steps for Deep Learning

  • Step1: define a set of function (Neural Network)
  • Step2: goodness of function
  • Step3: pick the best function

1.2 Step1: Neural Network

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

1.2.1 Fully Connect Feedforward Network

在这里插入图片描述

1.2.2 Output Layer(Option)

在这里插入图片描述

  • Softmax(归一化指数函数):它能将一个含任意实数的k维向量Z“压缩”到另一个k维向量 σ ( Z ) \sigma(Z) σ(Z)中,使得每一个元素的范围都在(0, 1)之间,并且所有元素的和为1。

1.2.3 Example Application

  • Handwriting Digit Recognition
    在这里插入图片描述

1.3 Step2: Goodness of Function

1.3.1 Learning Target

在这里插入图片描述

1.3.2 Loss

在这里插入图片描述

  • Total Loss:

在这里插入图片描述

1.4 Step3: Pick the Best Function

1.4.1 Gradient Descent

在这里插入图片描述

  • RBM(Restricted Boltzmann Machine): 受限玻尔兹曼机,这部分可以参考链接:https://zhuanlan.zhihu.com/p/22794772

  • Then Compute ∂ L / ∂ w \partial L / \partial w L/w , if Negative then Increase w; elif Positive then decrease w

在这里插入图片描述

  • η \eta η is called “learning rate”

在这里插入图片描述

Gradient Descent Diagram:

在这里插入图片描述

  • Randomly pick a starting point

1.4.2 Gradient Descent Difficulty

在这里插入图片描述

1.5 Deep is Better

1.5.1 Universality Theorem

1.5.2 Thin + Tall is Better

  • Neural network consists of neurons

  • A hidden layer network can represent any continuous function

  • Using multiple layers of neurons to represent some functions are much simper

  • Less parameters, less data

1.5.3 Modularization

在这里插入图片描述

1.6 Toolkit

1.6.1 Keras

在这里插入图片描述

1.6.2 Example of Handwriting Digit Recognition

Step1: define a set of function

在这里插入图片描述

Step2: goodness of function

在这里插入图片描述

Step3: pick the best function

在这里插入图片描述

Testing
score = model.evaluate(x_test, y_test)
print('Total loss on Testing Set: ', score[0])
print('Accuracy of Testing Set: ', score[1])
result = model.predict(x_test)

1.6.3 GPU to Speeding Training

  • Way1

    THEANO_FLAGGS=device=gpu0 python YourCode.py
    
  • Way2

    import os
    os.environ["THEANO_FLAGS"] = "device=gpu0"
    

2 Tips for Training Deep Neural Network

2.1 Good Results on Training Data

2.1.1 Choosing Proper Loss

在这里插入图片描述

2.1.2 Mini-Batch

在这里插入图片描述

2.1.3 New Activation Function

Vanishing Gradient Problem

在这里插入图片描述

ReLU

在这里插入图片描述

model.add(Activation('sigmoid'))
model.add(Activation('relu'))

在这里插入图片描述

ReLU - variant

在这里插入图片描述

2.1.4 Adaptive Learning Rate

Learning Rates
  • If learning rate is too large, total loss may not decrease after each update
  • If learning rate is too small, training would be too slow

在这里插入图片描述

Adagrad

在这里插入图片描述

Notes:

  • Learning rate is smaller and smaller for all parameters
  • Smaller derivatives, larger learning rate, and vice versa

2.1.5 Momentum

在这里插入图片描述

  • Adam: RMSProp (Advanced Adagrad) + Momentum. Adam (Adaptive Moment Estimation)本质上是带有动量项的RMSprop,它利用梯度的一阶矩估计和二阶矩估计动态调整每个参数的学习率。Adam的优点主要在于经过偏置校正后,每一次迭代学习率都有个确定范围,使得参数比较平稳。
    在这里插入图片描述

2.2 Good Results on Testing Data

2.2.1 Early Stopping

Why Overfitting
  • Learning target is defined by the training data.
  • The parameters achieving the learning target do not necessary have good results on the testing data.
Early Stopping

在这里插入图片描述

2.2.2 Weight Decay

Weight decay is one kind of regularization.

  • Our brain prunes out the useless link between neurons.
  • Doing the same thing to machine’s brain imporves the performance.
    在这里插入图片描述

2.2.3 Dropout

Training

在这里插入图片描述

  • Each time before updating the parameters

    • Each neuron has p% to dropout
      • The structure of the network is changed.
    • Using the new network for training
  • For each mini-batch, we resample the dropout neurons

Testing

在这里插入图片描述

Dropout - Intuitive Reason

在这里插入图片描述

Drop is a Kind of Ensemble

在这里插入图片描述

Try It

在这里插入图片描述

2.2.4 Network Structure

e.g. CNN is another good example.

3 Variants of Neural Network

3.1 Convolutional Neural Network (CNN)

3.1.1 Why CNN for Image

  • When processing image, the first layer of fully connected network would be very large.
  • Some patterns are much smaller than the whole image. A neuron does not have to see the whole image to discover the pattern.
  • The same patterns appear in different regions.
    在这里插入图片描述
  • Subsampling the pixels will not change the object, so we can subsample the pixels to make image smaller.

3.1.2 Three Steps

Step1: Convolutional Neural Network

在这里插入图片描述

Convolution

在这里插入图片描述

Max Pooling

在这里插入图片描述

  • Smaller than the original image.
  • The number of the channel is the number of filters.
Flatten

在这里插入图片描述

Summary

在这里插入图片描述

Step2: goodness of function & Step3: pick the best function

在这里插入图片描述

3.2 Recurrent Neural Network (RNN)

Step1: Recurrent Neural Network

在这里插入图片描述

LSTM

在这里插入图片描述

Step2: goodness of function

在这里插入图片描述

Step3 : pick the best function

在这里插入图片描述

4 Next Wave

4.1 Supervised Learning

4.1.1 Ultra Deep Network

在这里插入图片描述

4.1.2 Attention Model

在这里插入图片描述

4.2 Reinforcement Learning

4.2.1 Scenario of Reinforcement Learning

在这里插入图片描述

4.2.2 Supervised v.s. Reinforcement

在这里插入图片描述

4.2.3 Difficulties of Reinforcement Learning

  • It may be better to sacrifice immediate reward to gain more long-term reward.
  • Agent’s actions affect the subsequent data it receives.

4.3 Unsupervised Learning

4.3.1 Image: Realizing what the World Looks Like

在这里插入图片描述

4.3.2 Text: Understanding the Meaning of Words

  • Machine learn the meaning of words from reading a lot of documents without supervision
  • A word can be understood by its context

4.3.3 Audio: Learning Human Language Without Supervision

  • Audio segment corresponding to an unknown word (Fixed-length vector)
  • The audio segments correspondsing to words with similar pronunciations are close to each other.
    在这里插入图片描述
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值