Browse Source

optimize

master
scruel 7 years ago
parent
commit
751ebd13ce
3 changed files with 13 additions and 11 deletions
  1. +4
    -3
      index.html
  2. +4
    -3
      week5.html
  3. +5
    -5
      week5.md

+ 4
- 3
index.html View File

@@ -2,7 +2,7 @@
<html>
<head>
<meta charset='UTF-8'><meta name='viewport' content='width=device-width initial-scale=1'>
<title>index.md</title><link href='http://fonts.googleapis.com/css?family=Open+Sans:400italic,700italic,700,400&subset=latin,latin-ext' rel='stylesheet' type='text/css' /><style type='text/css'>html {overflow-x: initial !important;}:root { --bg-color: #ffffff; --text-color: #333333; --code-block-bg-color: inherit; }
<title>index.md</title><link href='https://fonts.googleapis.com/css?family=Open+Sans:400italic,700italic,700,400&subset=latin,latin-ext' rel='stylesheet' type='text/css' /><style type='text/css'>html {overflow-x: initial !important;}:root { --bg-color: #ffffff; --text-color: #333333; --code-block-bg-color: inherit; }
html { font-size: 14px; background-color: var(--bg-color); color: var(--text-color); font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; -webkit-font-smoothing: antialiased; }
body { margin: 0px; padding: 0px; height: auto; bottom: 0px; top: 0px; left: 0px; right: 0px; font-size: 1rem; line-height: 1.42857; overflow-x: hidden; background: inherit; }
a:active, a:hover { outline: 0px; }
@@ -38,7 +38,8 @@ p { -webkit-margin-before: 1rem; -webkit-margin-after: 1rem; -webkit-margin-star
a { cursor: pointer; }
sup.md-footnote { padding: 2px 4px; background-color: rgba(238, 238, 238, 0.7); color: rgb(85, 85, 85); border-radius: 4px; }
#write input[type="checkbox"] { cursor: pointer; width: inherit; height: inherit; margin: 4px 0px 0px; }
figure { max-width: 100%; overflow-x: auto; margin: 0px; }
#write > figure:first-child { margin-top: 16px; }
figure { overflow-x: auto; margin: -8px 0px 0px -8px; max-width: calc(100% + 16px); padding: 8px; }
tr { break-inside: avoid; break-after: auto; }
thead { display: table-header-group; }
table { border-collapse: collapse; border-spacing: 0px; width: 100%; overflow: auto; break-inside: auto; text-align: left; }
@@ -220,7 +221,7 @@ header, .context-menu, .megamenu-content, footer { font-family: "Segoe UI", Aria
</style>
</head>
<body class='typora-export' >
<div id='write' class = 'is-node show-fences-line-number'><h1><a name='header-n135' class='md-header-anchor '></a>吴恩达(Andrew Ng)机器学习公开课中文笔记</h1><p>电子版笔记基于手写笔记,时间有限再加上为了追求清晰精确,更新较慢请大佬们谅解😭。</p><p>码的很辛苦,大佬们如果觉得笔记整理的还不错,记得保持关注,也欢迎分享哦。</p><p>感谢支持(*^_^*)。</p><p><a href='https://github.com/scruel/ML-AndrewNg-Notes/'>GitHub 项目首页</a> | <a href='https://zhuanlan.zhihu.com/p/32781741'>知乎文章</a></p><p>&nbsp;</p><p><a href='./week1.html'>week1</a></p><ol start='' ><li>引言(Introduction)</li><li>单变量线性回归(Linear Regression with One Variable)</li></ol><p><a href='./week2.html'>week2</a></p><ol start='3' ><li>线性代数回顾(Linear Algebra Review)</li><li>多变量线性回归(Linear Regression with Multiple Variables)</li><li>Octave/Matlab 指南(Octave/Matlab Tutorial)</li></ol><p><a href='./week3.html'>week3</a></p><ol start='6' ><li>逻辑回归(Logistic Regression)</li><li>正则化(Regularization)</li></ol><p><a href='./week4.html'>week4</a></p><ol start='8' ><li>神经网络:表达(Neural Networks: Representation)</li></ol><p><a href='./week5.html'>week5</a></p><ol start='9' ><li>神经网络:学习(Neural Networks: Learning)</li></ol><p><a href='./week6.html'>week6</a></p><ol start='10' ><li>机器学习应用的建议(Advice for Applying Machine Learning)</li><li>机器学习系统设计(Machine Learning System Design)</li></ol><p><a href='./week7.html'>week7</a></p><ol start='12' ><li>支持向量机(Support Vector Machines)</li></ol><p><a href='./week8.html'>week8</a></p><ol start='13' ><li>无监督学习(Unsupervised Learning)</li><li>降维(Dimensionality Reduction)</li></ol><p><a href='./week9.html'>week9</a></p><ol start='15' ><li>异常检测(Anomaly Detection)</li><li>推荐系统(Recommender Systems)</li></ol><p><a href='./week10.html'>week10</a></p><ol start='17' ><li>大规模机器学习(Large Scale Machine Learning)</li></ol><p><a href='./week11.html'>week11</a></p><ol start='18' ><li>实战:图像光学识别(Application Example: Photo OCR)</li></ol><p>&nbsp;</p><p>&nbsp;</p><h2><a name='header-n238' class='md-header-anchor '></a>License</h2><p><a href='http://creativecommons.org/licenses/by-nc/4.0/' target='_blank'><img src='https://i.creativecommons.org/l/by-nc/4.0/88x31.png' alt='Creative Commons License' /></a></p><p>This work is licensed under a <a href='http://creativecommons.org/licenses/by-nc/4.0/' target='_blank'>Creative Commons Attribution-NonCommercial 4.0 International License</a>.</p><p>&nbsp;</p><p>By: Scruel</p><p>&nbsp;</p><p><div style="display:none">
<div id='write' class = 'is-node show-fences-line-number'><h1><a name='header-n0' class='md-header-anchor '></a>吴恩达(Andrew Ng)机器学习公开课中文笔记</h1><p>电子版笔记基于手写笔记,时间有限再加上为了追求清晰精确,更新较慢请大佬们谅解😭。</p><p>码的很辛苦,大佬们如果觉得笔记整理的还不错,记得保持关注,也欢迎分享哦。</p><p>感谢支持(*^_^*)。</p><p>有打赏需求的大佬们,<del>支付宝账号即为 GitHub 主页邮箱--</del>,嗯……应该没有吧。</p><p><a href='https://github.com/scruel/ML-AndrewNg-Notes/'>GitHub 项目首页</a> | <a href='https://zhuanlan.zhihu.com/p/32781741'>知乎文章</a></p><p>&nbsp;</p><p><a href='./week1.html'>week1</a></p><ol start='' ><li>引言(Introduction)</li><li>单变量线性回归(Linear Regression with One Variable)</li></ol><p><a href='./week2.html'>week2</a></p><ol start='3' ><li>线性代数回顾(Linear Algebra Review)</li><li>多变量线性回归(Linear Regression with Multiple Variables)</li><li>Octave/Matlab 指南(Octave/Matlab Tutorial)</li></ol><p><a href='./week3.html'>week3</a></p><ol start='6' ><li>逻辑回归(Logistic Regression)</li><li>正则化(Regularization)</li></ol><p><a href='./week4.html'>week4</a></p><ol start='8' ><li>神经网络:表达(Neural Networks: Representation)</li></ol><p><a href='./week5.html'>week5</a></p><ol start='9' ><li>神经网络:学习(Neural Networks: Learning)</li></ol><p><a href='./week6.html'>week6</a></p><ol start='10' ><li>机器学习应用的建议(Advice for Applying Machine Learning)</li><li>机器学习系统设计(Machine Learning System Design)</li></ol><p><a href='./week7.html'>week7</a></p><ol start='12' ><li>支持向量机(Support Vector Machines)</li></ol><p><a href='./week8.html'>week8</a></p><ol start='13' ><li>无监督学习(Unsupervised Learning)</li><li>降维(Dimensionality Reduction)</li></ol><p><a href='./week9.html'>week9</a></p><ol start='15' ><li>异常检测(Anomaly Detection)</li><li>推荐系统(Recommender Systems)</li></ol><p><a href='./week10.html'>week10</a></p><ol start='17' ><li>大规模机器学习(Large Scale Machine Learning)</li></ol><p><a href='./week11.html'>week11</a></p><ol start='18' ><li>实战:图像光学识别(Application Example: Photo OCR)</li></ol><p>&nbsp;</p><p>&nbsp;</p><h2><a name='header-n103' class='md-header-anchor '></a>License</h2><p><a href='http://creativecommons.org/licenses/by-nc/4.0/' target='_blank'><img src='https://i.creativecommons.org/l/by-nc/4.0/88x31.png' alt='Creative Commons License' /></a></p><p>This work is licensed under a <a href='http://creativecommons.org/licenses/by-nc/4.0/' target='_blank'>Creative Commons Attribution-NonCommercial 4.0 International License</a>.</p><p>&nbsp;</p><p>By: Scruel</p><p>&nbsp;</p><p><div style="display:none">
<script>document.title = document.body.firstElementChild.firstElementChild.innerText</script>
<script src="https://s19.cnzz.com/z_stat.php?id=1272117433&web_id=1272117433" language="JavaScript"></script>
</div></p></div>


+ 4
- 3
week5.html
File diff suppressed because it is too large
View File


+ 5
- 5
week5.md View File

@@ -67,7 +67,7 @@ $J(\theta) = - \frac{1}{m} \sum_{i=1}^m [ y^{(i)}\ \log (h_\theta (x^{(i)})) + (

1. 运行前向传播算法,得到初始预测 $a^{(L)}=h_\Theta(x)$ 。

2. 接下来则应用反向传播算法,从输出层开始计算每一层预测的**误差**(error),以此来求取偏导。
2. 运行反向传播算法,从输出层开始计算每一层预测的**误差**(error),以此来求取偏导。

![](image/20180120_105744.png)

@@ -91,7 +91,7 @@ $J(\theta) = - \frac{1}{m} \sum_{i=1}^m [ y^{(i)}\ \log (h_\theta (x^{(i)})) + (

根据以上公式计算依次每一层的误差 $\delta^{(L)}, \delta^{(L-1)},\dots,\delta^{(2)}$。

3. 然后依次求解累加误差 $\Delta^{(l)}_{i,j} := \Delta^{(l)}_{i,j} + a_j^{(l)} \delta_i^{(l+1)}$,向量化实现即 $\Delta^{(l)} := \Delta^{(l)} + \delta^{(l+1)}(a^{(l)})^T$
3. 依次求解累加误差 $\Delta^{(l)}_{i,j} := \Delta^{(l)}_{i,j} + a_j^{(l)} \delta_i^{(l+1)}$,向量化实现即 $\Delta^{(l)} := \Delta^{(l)} + \delta^{(l+1)}(a^{(l)})^T$

3. 遍历全部样本实例,求解完 $\Delta$ 后,最后则求得偏导 $\frac \partial {\partial \Theta_{i,j}^{(l)}} J(\Theta)=D_{i,j}^{(l)}$

@@ -209,11 +209,11 @@ $g'(z) =\frac{e^{-z}}{(1+e^{-z})^2}=\frac{(1+e^{-z})-1}{(1+e^{-z})^2}=\frac{1}{1

即证得 $\delta^{(3)}=(\Theta^{(3)})^T\delta^{(4)}.*(a^{(3)})'=(\Theta^{(3)})^T\delta^{(4)}.*\ a^{(3)} .*\ (1-a^{(3)})$

对于任意的隐藏层 $l + 1$ 及 $\Theta^{(l)}$,有 $J(\Theta)\rightarrow a^{(L)} \rightarrow z^{(L)} \rightarrow \dots \rightarrow a^{(l+1)} \rightarrow z^{(l+1)} \rightarrow\Theta^{(l)}$ 关系不变,故证得:
对于任意的隐藏层 $l + 1$ 及权重矩阵 $\Theta^{(l)}$,有 $J(\Theta)\rightarrow a^{(L)} \rightarrow z^{(L)} \rightarrow \dots \rightarrow a^{(l+1)} \rightarrow z^{(l+1)} \rightarrow\Theta^{(l)}$ 关系不变,故证得:
$$
\frac{\partial}{\partial\Theta^{(l)}} J(\Theta) = a^{(l)}\delta^{(l+1)}, \ \ \delta^{(l)} = (\Theta^{(l)})^T\delta^{(l+1)}.*\ a^{(l)} .*\ (1-a^{(l)})\; \; \; \; \; \text{for }l := L-1, L-2,\dots,2.
$$
再添回为了计算方便去掉的 $\frac{1}{m}$和正则化项(时刻记住偏置单元不正则化),即为上节中 $J(\Theta)$ 的偏导。
再添回为了计算方便去掉的 $\frac{1}{m}$ 和正则化项(时刻记住偏置单元不正则化)等,即可得上节中 $J(\Theta)$ 的偏导。



@@ -331,4 +331,4 @@ Theta3 = rand(1,11) * (2 * INIT_EPSILON) - INIT_EPSILON;

![](image/20180125_195029.png)

描述了神经网络应用于[自动驾驶](https://www.coursera.org/learn/machine-learning/lecture/zYS8T/autonomous-driving)的一个实例,用于打鸡血,笔记略。
描述了神经网络在于[自动驾驶](https://www.coursera.org/learn/machine-learning/lecture/zYS8T/autonomous-driving)领域的应用实例,用于打鸡血,笔记略。

Loading…
Cancel
Save