Logistic Classification
来源:互联网 发布:数据下载网站 编辑:程序博客网 时间:2024/06/07 02:16
Logistic Classification
About
simple but important classifier
- Train your first simple model entirely end to end
- 下载、预处理一些图片以分类
- Run an actual logistic classifier on images data
- Connect bit of math and code
Detail
Linear Classifier
之所以这样建模,是因为线性公式是最简单的数学模型,仅此而已。
- Input: X (e.g. the pixels in an image)
- Apply a linear function to X
- Giant matrix multiply
- Take inputs as a big vector
- Multiply input vector with a matrix, W means weights
- b means biased term
- Machine learning adjust weights and bias for the best prediction
- Output: Y, predictions for per output class
- Y is a vector, represents the probability of each label
- 好的预测中,正确的label的概率应当更接近1
- 往往得到的Y一开始不是概率,而是一些具体值(scores/logits),所以需要转换,by:
Softmax回归模型:Wikipedia
Softmax
- 代码 soft_max.py:Softmax实现与应用
- input的score差异越大(可以全部乘10试试),则输出的各项label概率差异越大,反之差异越小
- Softmax只关心几个label之间的概率,不关心具体值
- 机器学习是一个让预测成功率升高的事情,因此是一个让score之间差异增大的过程
One hot encoding
正确预测结果应当是只有一个label成立,其他label不成立。这种情况下,预测概率最大的则是最可能的结果。
Example: take this test
- one hot encoding在label很多的情况下not work well,因为output vector到处都是0,很稀疏,因此效率低
- solved by embeddings
- 好处:可以measure我们与理想情况之间的距离(compare two vectors)
分类器输出:[0.7 0.2 0.1] \<=> 与label对应的真实情况:[1 0 0]
Compare two vectors: cross-entropy
D(S, L) != D(L, S)
Remember: Label don't log, for label zero
小结
找到合适的W和b,使得S和L的距离D的平均值,在整个数据集n中最小。
最小化cross-entropy
D的平均值即是Training loss,求和和矩阵相乘是个大数据的活。
两个参数的误差导致一个呈圆形的loss,所以我们要做的就是找到尽量靠近圆心的weight
机器学习问题变成了一个数值优化
- 解决方法之一:Gradient descent,求导
修改参数,检查误差是否变大,往变小的方向修改,直到抵达bottom。
图中weight是二维的,但事实上可能有极多的weight
0 0
- Logistic Classification
- Classification and logistic regression
- Logistic Regression & linear classification
- MachineLearning_note:Logistic Regression(Classification)
- Logistic regression -binary classification
- Logistic Regression求解classification问题
- Machine Learning—Classification and logistic regression
- Logistic Regression to do Binary Classification
- Machine Learning - Logistic Regression - Two-class Classification
- Machine Learning - Logistic Regression - Multi-class Classification
- Google深度学习笔记 Logistic Classification
- TensorFlow深度学习笔记 Logistic Classification
- classification problems——logistic regression
- 【Machine Learning实验2】 Logistic Regression求解classification问题
- 网易公开课讲义2 Classification and logistic regression 笔记
- [机器学习]逻辑回归,Logistic regression |分类,Classification
- 2、Logistic Regression求解classification问题 c代码
- 【Machine Learning实验2】 Logistic Regression求解classification问题
- 微信支付java版本之关闭订单
- This application is modifying the autolayout engine from a background thread after the engine was ac
- Android 开发:Translucent System Bar 的最佳实践
- 有关于cocos js的碰撞方法记录
- Android ComponentName的用法
- Logistic Classification
- 使用MVC模型的用户登录及注册(注册验证)
- freeswitch debug
- canvas.translate(x,y)使用
- TimeUnit用法
- Python中的List:一种数据结构
- php导出csv文件,可导出前导0实例
- shell 快捷键
- 3. Longest Substring Without Repeating Characters