跟新图片链接
This commit is contained in:
parent
635ca681e1
commit
66b0bdb832
@ -7,28 +7,29 @@
|
||||
#### 1. sigmoid函数
|
||||
函数的定义$$ f(x) = \frac{1}{1 + e^{-x}} $$,其值域为 $$ (0,1) $$。 函数图像
|
||||
|
||||
![图像](https://raw.githubusercontent.com/deel-learn/DeepLearning-500-questions/master/ch3_%E6%B7%B1%E5%BA%A6%E5%AD%A6%E4%B9%A0%E5%9F%BA%E7%A1%80/img/ch3/3-26.png)
|
||||
![图像](https://img.zeekling.cn/images/2020/04/25/13354d2c03c7a7c775dd1e0acbf0c9df.png)
|
||||
|
||||
#### 2. tanh激活函数
|
||||
函数的定义为:$$ f(x) = tanh(x) = \frac{e^x - e^{-x}}{e^x + e^{-x}} $$,值域为 $$ (-1,1) $$。函数图像
|
||||
|
||||
![pic](https://raw.githubusercontent.com/deel-learn/DeepLearning-500-questions/master/ch3_%E6%B7%B1%E5%BA%A6%E5%AD%A6%E4%B9%A0%E5%9F%BA%E7%A1%80/img/ch3/3-27.png)
|
||||
![pic](https://img.zeekling.cn/images/2020/04/25/79c22aa14fb2b336696b6658fff87708.png)
|
||||
|
||||
#### 3. Relu激活函数
|
||||
函数的定义为:$$ f(x) = max(0, x) $$ ,值域为 $$ [0,+∞) $$;函数图像
|
||||
|
||||
![pic](https://raw.githubusercontent.com/deel-learn/DeepLearning-500-questions/master/ch3_%E6%B7%B1%E5%BA%A6%E5%AD%A6%E4%B9%A0%E5%9F%BA%E7%A1%80/img/ch3/3-28.png)
|
||||
![pic](https://img.zeekling.cn/images/2020/04/25/2ba84d3c3a88ae72d8d0c9221c30ff01.png)
|
||||
|
||||
#### 4. Leak Relu激活函数
|
||||
函数定义为: $$ f(x) = \left{ \begin{aligned} ax, \quad x<0 \ x, \quad x>0 \end{aligned} \right. $$,值域为 $$ (-∞,+∞) $$。图像如下($$ a = 0.5 $$):
|
||||
|
||||
![pic](https://raw.githubusercontent.com/deel-learn/DeepLearning-500-questions/master/ch3_%E6%B7%B1%E5%BA%A6%E5%AD%A6%E4%B9%A0%E5%9F%BA%E7%A1%80/img/ch3/3-29.png)
|
||||
![pic](https://img.zeekling.cn/images/2020/04/25/545a4a82b1d5096578f13a0df355543c.png)
|
||||
|
||||
#### 5. SolftPlus 激活函数
|
||||
函数的定义为:$$ f(x) = ln( 1 + e^x) $$,值域为 $$ (0,+∞) $$。图像如下
|
||||
|
||||
![pic](https://raw.githubusercontent.com/deel-learn/DeepLearning-500-questions/master/ch3_%E6%B7%B1%E5%BA%A6%E5%AD%A6%E4%B9%A0%E5%9F%BA%E7%A1%80/img/ch3/3-30.png)
|
||||
![pic](https://img.zeekling.cn/images/2020/04/25/4e7a0cc8ce6550b3adcf6c235d6da2e4.png)
|
||||
|
||||
#### 6. softmax激活函数
|
||||
函数定义为: $$ \sigma(z)j = \frac{e^{z_j}}{\sum{k=1}^K e^{z_k}} $$。
|
||||
Softmax 多用于多分类神经网络输出。
|
||||
|
||||
|
@ -18,7 +18,7 @@
|
||||
在人类看来,对图片进行局部调整可能并会不影响对图的判断。然而,深度网络不仅对标准对抗攻击敏感,而且对环境的变化也会敏感。
|
||||
下图显示了在一张丛林猴子的照片中PS上一把吉他的效果。这导致深度网络将猴子误认为人类,同时将吉他误认为鸟,大概是因为它认为
|
||||
人类比猴子更可能携带吉他,而鸟类比吉他更可能出现在附近的丛林中。
|
||||
![pic](http://dynamic-image.yesky.com/1200x-/uploadImages/2019/051/59/GVLL362E78A2.png)
|
||||
![pic](https://img.zeekling.cn/images/2020/04/25/a51ff542ca0f7d820483548d774509f6.png)
|
||||
|
||||
图:添加遮蔽体会导致深度网络失效。左:用摩托车进行遮挡后,猴子被识别为人类。中:用自行车进行遮挡后,猴子被识别为人类,同
|
||||
时丛林背景导致自行车把手被误认为是鸟。右:用吉他进行遮挡后,猴子被识别为人类,而丛林把吉他变成了鸟.
|
||||
|
@ -8,14 +8,14 @@
|
||||
交叉验证法(cross validation)先将数据集D划分为k个大小相似的互斥子集。即有:$$D=D1∪D2∪...∪Dk,Di∩Dj=∅$$
|
||||
每个子集Di都尽可能保持数据分布的一致性,即从D中通过分层采样得到。然后,每次用k-1个子集的并集作为训练集,余下的那个子集
|
||||
作为测试集,这样就可以获得k组训练/测试集。从而可以进行k次训练与测试,最终返回的是这k个测试结果的均值。<br>
|
||||
![交叉验证法](http://index.zeekling.cn/gogsPics/ml/basic/20161109110731469.png) <br>
|
||||
![交叉验证法](https://img.zeekling.cn/images/2020/04/25/4f02df31de0364f1c9340d0dffab13ea.png) <br>
|
||||
缺陷:数据集较大时,计算开销。同时留一法的估计结果也未必比其他评估方法准确。
|
||||
|
||||
## 自助法
|
||||
简单的说,它从数据集D中每次随机取出一个样本,将其拷贝一份放入新的采样数据集D′,样本放回原数据集中,重复这个过程m次,就得
|
||||
到了同样包含m个样本的数据集D′,显然D中会有一部分数据会在D′中重复出现。样本在m次采样中始终不被采样到的概率是
|
||||
![概率](http://index.zeekling.cn/gogsPics/ml/basic/2018-12-08_23-13.png),取极限得到:<br>
|
||||
![自助法](http://index.zeekling.cn/gogsPics/ml/basic/2018-12-08_23-02.png) <br>
|
||||
![概率](https://img.zeekling.cn/images/2020/04/25/5a38dfeac11eec9b6f702e520f48e8c2.png),取极限得到:<br>
|
||||
![自助法](https://img.zeekling.cn/images/2020/04/25/c0adf2b44a747e3b3656219e7ef78112.png) <br>
|
||||
即通过自助法,初始数据集中约有36.8%样本未出现在采样数据集D′中。可将D′作为训练集,D\D′作为测试集,(\表示集合的减法)。保
|
||||
证了实际评估的模型与期望评估的模型都是用m个训练样本,而有数据总量约1/3的、没在训练集中出过的样本用于测试,这样的测试结
|
||||
果,也叫做”包外估计”(out-of-bagestimate).
|
||||
@ -29,45 +29,45 @@
|
||||
|
||||
# 性能度量
|
||||
在预测任务中,给定样本集
|
||||
![样本集](http://index.zeekling.cn/gogsPics/ml/basic/v2-ec2cf40da68b421eaa9fd3161c3c6aae_hd.jpg)
|
||||
![样本集](https://img.zeekling.cn/images/2020/04/25/356599b3bb2a6e02b0d56f15327e46b0.jpg)
|
||||
其中,yi是示例xi的真实标记。回归任务中最常用的性能度量是均方误差(mean squeared error),f(x)是机器学习预测结果<br>
|
||||
![均方误差](http://index.zeekling.cn/gogsPics/ml/basic/20170728160012970.png)<br>
|
||||
![均方误差](https://img.zeekling.cn/images/2020/04/25/4f138effdae759513764bfc7d3c33713.png)<br>
|
||||
更一般的形式(数据分布D,概率密度函数p(x))<br>
|
||||
![均方误差](http://index.zeekling.cn/gogsPics/ml/basic/20170728160030374.png)
|
||||
![均方误差](https://img.zeekling.cn/images/2020/04/25/df5933f0b3aec4c93ccac1a67001e466.png)
|
||||
|
||||
## 错误率和精度
|
||||
错误率的定义:<br>
|
||||
![错误率](http://index.zeekling.cn/gogsPics/ml/basic/20170728160111980.png)<br>
|
||||
![错误率](https://img.zeekling.cn/images/2020/04/25/a6d785b9b95f854a1dd6229f18978283.png)<br>
|
||||
更一般的定义:<br>
|
||||
![错误率](http://index.zeekling.cn/gogsPics/ml/basic/20170728160154325.png)<br>
|
||||
![错误率](https://img.zeekling.cn/images/2020/04/25/ed0f470faf5604e4a7615acbafac6434.png)<br>
|
||||
精度的定义:<br>
|
||||
![精度](http://index.zeekling.cn/gogsPics/ml/basic/20170728160235638.png)<br>
|
||||
![精度](https://img.zeekling.cn/images/2020/04/25/f6ad23b157393bd01debfb50c70451e9.png)<br>
|
||||
更一般的定义:<br>
|
||||
![精度](http://index.zeekling.cn/gogsPics/ml/basic/20170728160341707.png)
|
||||
![精度](https://img.zeekling.cn/images/2020/04/25/cd861ef96f53a9f74f424fbe99c4cbfe.png)
|
||||
|
||||
## 查准率、查全率与F1
|
||||
下表是二分类结果混淆矩阵,将判断结果分为四个类别,真正例(TP)、假正例(FP)、假反例(FN)、真反例(TN)。<br>
|
||||
![二分类问题](http://index.zeekling.cn/gogsPics/ml/basic/v2-d86bd2ab359674615166d641c0a290b3_hd.jpg) <br>
|
||||
![二分类问题](https://img.zeekling.cn/images/2020/04/25/9643db5e5887b74c4573a7a3c1e668e7.jpg) <br>
|
||||
查准率:【真正例样本数】与【预测结果是正例的样本数】的比值。<br>
|
||||
查全率:【真正例样本数】与【真实情况是正例的样本数】的比值。 <br>
|
||||
![P-R曲线](http://index.zeekling.cn/gogsPics/ml/basic/v2-c2eb73c67a9c3ced1cb0167363ab8971_hd.png) <br>
|
||||
![P-R曲线](https://img.zeekling.cn/images/2020/04/25/5c078520ffcd259bbe498b5676af6ea7.png) <br>
|
||||
- 当曲线没有交叉的时候:外侧曲线的学习器性能优于内侧;
|
||||
- 当曲线有交叉的时候:
|
||||
- 第一种方法是比较曲线下面积,但值不太容易估算;
|
||||
- 第二种方法是比较两条曲线的平衡点,平衡点是“查准率=查全率”时的取值,在图中表示为曲线和对角线的交点。平衡点在外侧的
|
||||
曲线的学习器性能优于内侧。
|
||||
- 第三种方法是F1度量和Fβ度量。F1是基于查准率与查全率的调和平均定义的,Fβ则是加权调和平均。<br>
|
||||
![F1](http://index.zeekling.cn/gogsPics/ml/basic/v2-8767d0e40027a80c9dfbb4e67c415562_hd.png)<br>
|
||||
![Fb](http://index.zeekling.cn/gogsPics/ml/basic/v2-b1957f27cd827f658c44e09f25950676_hd.png)<br>
|
||||
![F1](https://img.zeekling.cn/images/2020/04/25/41703aab28291f37557a7742e636c5ee.png)<br>
|
||||
![Fb](https://img.zeekling.cn/images/2020/04/25/9f9b83f34cd9a96a33695020f5646af1.png)<br>
|
||||
|
||||
|
||||
## ROC与AUC
|
||||
ROC曲线便是从这个角度出发来研究学习器泛化性能的有力工具。<br>
|
||||
与P-R曲线使用查准率、查全率为横纵轴不同,ROC的纵轴是”真正样例(True Positive Rate,简称TPR)”,横轴是“假正例率(False
|
||||
Positive Rate,简称FPR),两者分别定义为<br>
|
||||
![ROC](http://index.zeekling.cn/gogsPics/ml/basic/v2-4c7d54020323bbf3b04e57be62bb29dc_hd.jpg) <br>
|
||||
![ROC](https://img.zeekling.cn/images/2020/04/25/7d7a43d6d5d1aa6c60c627e5656ff1cc.jpg) <br>
|
||||
显示ROC的曲线图称为“ROC图”<br>
|
||||
![pic](http://index.zeekling.cn/gogsPics/ml/basic/v2-688e036b40e5fae2ffa0fa54b77cb5a4_hd.jpg)<br>
|
||||
![pic](https://img.zeekling.cn/images/2020/04/25/80ba85a56d336856ac19c5bb9ef0cf8b.jpg)<br>
|
||||
进行学习器比较时,与P-R如相似,若一个学习器的ROC曲线被另一个学习器的曲线“包住”,则可断言后者的性能优于前者;若两个学习
|
||||
器的ROC曲线发生交叉,则难以一般性的断言两者孰优孰劣。此时如果一定要进行比较,则较为合理的判断是比较ROC曲线下的面积,
|
||||
即AUC(Area Under ROC Curve)。
|
||||
@ -77,14 +77,13 @@ Positive Rate,简称FPR),两者分别定义为<br>
|
||||
## 代价敏感错误率与代价曲线
|
||||
在现实任务中会遇到这样的情况:不同类型错误所造成的后果不同。以二分类任务为例,我们可根据任务领域知识设定一个“代价矩阵”,
|
||||
如下图所示,<br>
|
||||
![代价矩阵](http://index.zeekling.cn/gogsPics/ml/basic/v2-85d636c2cc2078f7a38134f4dceb2019_hd.jpg) <br>
|
||||
![代价矩阵](https://img.zeekling.cn/images/2020/04/25/7678f5fbd82759a4e54e40ac946ed795.jpg) <br>
|
||||
在非均等代价下,ROC曲线不能直接反映出学习器的期望总体代价,而“代价曲线(cost curve)”则可达到目的。代价曲线图的横轴是取
|
||||
值为[0,1]的正例概率代价,<br>
|
||||
![正概率代价](http://index.zeekling.cn/gogsPics/ml/basic/v2-33493342b0a90d67276250573aea107e_hd.jpg) <br>
|
||||
![正概率代价](https://img.zeekling.cn/images/2020/04/25/3252090d68a565a5e37789cba5f5ab6e.jpg) <br>
|
||||
纵轴是取值为[0,1]的归一化代价<br>
|
||||
![归一化代价](http://index.zeekling.cn/gogsPics/ml/basic/v2-e02dbd62fa02979d958291d56fbaae0b_hd.jpg) <br>
|
||||
![归一化代价](https://img.zeekling.cn/images/2020/04/25/0a30530fec90a584a1449e3373dff3a3.jpg) <br>
|
||||
画图表示如下图所示 <br>
|
||||
![图](http://index.zeekling.cn/gogsPics/ml/basic/v2-3d72a25b2a326afa1ccebed64f41f2ce_hd.jpg) <br>
|
||||
![图](https://img.zeekling.cn/images/2020/04/25/b309cc398dd5a3c7b6d730be973c17a3.jpg) <br>
|
||||
|
||||
# 比较检验
|
||||
|
||||
|
@ -18,13 +18,13 @@
|
||||
[https://zhuanlan.zhihu.com/p/26306568 ](https://zhuanlan.zhihu.com/p/26306568)
|
||||
|
||||
## 常见概率分布
|
||||
![常见概率分布](http://index.zeekling.cn/gogsPics/ml/basic/20170728160341708.png)
|
||||
![常见概率分布](http://index.zeekling.cn/gogsPics/ml/basic/20170728160341709.png)
|
||||
![常见概率分布](http://index.zeekling.cn/gogsPics/ml/basic/20170728160341710.png)
|
||||
![常见概率分布](http://index.zeekling.cn/gogsPics/ml/basic/20170728160341711.png)
|
||||
![常见概率分布](http://index.zeekling.cn/gogsPics/ml/basic/20170728160341712.png)
|
||||
![常见概率分布](http://index.zeekling.cn/gogsPics/ml/basic/20170728160341713.png)
|
||||
![常见概率分布](http://index.zeekling.cn/gogsPics/ml/basic/20170728160341714.png)
|
||||
![常见概率分布](https://img.zeekling.cn/images/2020/04/25/5f6f8c95bdecc086500b90e39d2b479d.png)
|
||||
![常见概率分布](https://img.zeekling.cn/images/2020/04/25/fa3a7f002c8d031b28ce383a4c363879.png)
|
||||
![常见概率分布](https://img.zeekling.cn/images/2020/04/25/7767f2670cd0028712fbcf3a7a7f8747.png)
|
||||
![常见概率分布](https://img.zeekling.cn/images/2020/04/25/577205d522151d05e787dc27d11175c5.png)
|
||||
![常见概率分布](https://img.zeekling.cn/images/2020/04/25/c1ce02f81d94b127aed88a2bf9273c6d.png)
|
||||
![常见概率分布](https://img.zeekling.cn/images/2020/04/25/65355920993d954d648d2c270d4687fe.png)
|
||||
![常见概率分布](https://img.zeekling.cn/images/2020/04/25/04fb3fdf74d80e908a9224d4e6ecaf1a.png)
|
||||
|
||||
## 数值计算
|
||||
|
||||
@ -40,4 +40,3 @@
|
||||
1. [https://www.jiqizhixin.com/articles/2018-01-09-6 ](https://www.jiqizhixin.com/articles/2018-01-09-6)
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user