[Machinie Learning] 吴恩达机器学习课程笔记——Week5

Machine Learning by Andrew Ng

吴恩达机器学习课程学习笔记——Week 5
本人学习笔记汇总 合订本
✓ 课程网址 standford machine learning
参考资源

  • 课程笔记
  • python版作业

学习提纲

  • Cost Function and Back-propagation
  • Back-propagation in Practice
  • Application of Neural Networks
  • Review

Cost Function and Back-propagation

Notation

  • L = total number of layers in the network
  • S l S_l Sl = number of units (not counting bias unit) in layer l
  • K = number of output units/classes

we denote h Θ ​ ( x ) k ​ h_Θ​(x)_k​ hΘ(x)k as being a hypothesis that results in the k-th output
输入x, h Θ ​ ( x ) k ​ h_Θ​(x)_k​ hΘ(x)k是输出的第k个特征

[Machinie Learning] 吴恩达机器学习课程笔记——Week5_第1张图片

1.Cost Function
the cost function for regularized logistic regression
and the cost function for neural network are as below
[Machinie Learning] 吴恩达机器学习课程笔记——Week5_第2张图片


the cost function for regularized logistic regression was

2

for neural network, the cost function is
3
Here, we define δ j l \delta_j^l δjl as the error for a j l a_j^l ajl

[Machinie Learning] 吴恩达机器学习课程笔记——Week5_第3张图片


2.Back-propagation Algorithm

Same as other ml algorithms, our goal is to minimize the cost function

5

Therefor, we need to compute

  • J ( θ ) J(\theta) J(θ)
  • ∂ ∂ θ i , j ( l ) J ( θ ) \frac{\partial}{\partial \theta_{i,j} ^{(l)}} J(\theta) θi,j(l)J(θ)

The algorithm to compute ∂ ∂ θ i , j ( l ) J ( θ ) \frac{\partial}{\partial \theta_{i,j} ^{(l)}} J(\theta) θi,j(l)J(θ) is as below
[Machinie Learning] 吴恩达机器学习课程笔记——Week5_第4张图片

The whole algorithm is as below

step1 and step2, forward propagation
[Machinie Learning] 吴恩达机器学习课程笔记——Week5_第5张图片[Machinie Learning] 吴恩达机器学习课程笔记——Week5_第6张图片

step3, compute δ ( L ) \delta^{(L)} δ(L)
11

step4, compute δ ( L − 1 ) \delta^{(L-1)} δ(L1) and so on,
12
13

step5, compute the ∂ ∂ θ i , j ( l ) J ( θ ) \frac{\partial}{\partial \theta_{i,j} ^{(l)}} J(\theta) θi,j(l)J(θ)
[Machinie Learning] 吴恩达机器学习课程笔记——Week5_第7张图片
16

3.Back-propagation Intuition
[Machinie Learning] 吴恩达机器学习课程笔记——Week5_第8张图片


Back-propagation in Practice

1.Implementation Note: Unrolling Parameters
use gradient checking to assure everything goes well
[Machinie Learning] 吴恩达机器学习课程笔记——Week5_第9张图片
[Machinie Learning] 吴恩达机器学习课程笔记——Week5_第10张图片

2.Gradient Checking
[Machinie Learning] 吴恩达机器学习课程笔记——Week5_第11张图片
[Machinie Learning] 吴恩达机器学习课程笔记——Week5_第12张图片

3.Random Initialization
[Machinie Learning] 吴恩达机器学习课程笔记——Week5_第13张图片

[Machinie Learning] 吴恩达机器学习课程笔记——Week5_第14张图片

[Machinie Learning] 吴恩达机器学习课程笔记——Week5_第15张图片

4.Putting It Together


6 steps to train a network

[Machinie Learning] 吴恩达机器学习课程笔记——Week5_第16张图片


Ideally, we want $h_\theta(x^i) \approx y^i$ But remember that $J(\Theta)$ is not a convex function and thus we can end up in a local minima instead.

[Machinie Learning] 吴恩达机器学习课程笔记——Week5_第17张图片


Application of Neural Networks

1.Autonomous Driving
skip.


Review

skip.

额外阅读

吴恩达机器学习——反向传播算法

你可能感兴趣的:(Machine,Learning,人工智能,python)