Outline
Linear model for classification
Perceptrons:感知器是人们成功使用的最简单的神经网络模型:
单个神经元的神经网络
notation
Data:x x∈X
Label:y
如何理解supervised learning 呢?
我们有一堆(data,label),然后根据这个(data,label)我们选择合适的f,然后我们又xnew,我们响应的获得ypredict,这就是监督学习
H:hypothesis class:the set from which we want to draw a classifier(f)
model doesn’t go fully blind,即CV中卷积比较多,这个就相当于hypothesis class了
二分问题encode
- 可以使用+1/-1
exercise inductive bias.
Learning:Perceptron–find the hyperplane
超平面的应用:
- halfspaces
- logistic regression classifier
These are instances of a linear hypothesis class composed with a suitable scalar function
这里scalar function是什么呢?是Sgn/sigmoid
使用超平面概念的linear二分类classifer
超平面相关的数学基础:
定义:θ/w(weight)[vector],θ0[offset/bias]
这个超平面,由所有满足θTx+θ0=0的向量x组成。
x=[x1,x2,…,xd],θ1x1+θ2x2+θ3x3+…+θdxd+θ0=0
这里,向量θ是该超平面的法向量,也即normal vector.
判定给定一个向量v=[v1,v2,…,vd]是否垂直于超平面:即判断该向量是否与该超平面的法向量平行或共线。
求向量在超平面上的投影:
设投影是vp,则
vp·θ+θ0=0(投影属于该超平面) v−vp=vperpendicular=λθ(与法向量共线)如果向量x1,x2都属于该超平面,那么二者的差x1−x2与法向量θ点乘为0,即与该法向量垂直
求向量(point)到超平面的signed distance
规定:
向量x与θ同方向,则sign=+1;
向量x与θ反方向,则sign=-1;
signed distance=|θx+θ0|||θ||
Linear hypothesis class
这里,我们把超平面分类器的θ看成我们在ML中普适性的weightw
Decision boundary
θ·x+θ0=0
ML:perceptron:自动学习如何寻找correct差平面的机器学习模型
核心是错了就correct,不断调参。
How to adjust the hyperplane?
结合二图可以很好的理解perceptron Algorithm
超平面与超平面的linear separability—Proof of convergence
讨论perceptron正确学习所有训练数据所花费的步骤:
Assume:||x(i)||≤R,1≤i≤n,Augment data as (x,1) to absorb the w0 term,即不考虑offset?即wTx/θTx表示了hyperplane.同时,假设存在单位向量u,使得ytrue(uTx(i))≥γ,满足对于所有训练样本都同时满足该条件。
Observe: linear separability assumption gives us such u
and γ
是linear separable 的性质保证我们可以找到u和γ
我们将证明,在这种情况下,我们的perceptron模型只需要(R/γ)2步来正确学习所有训练数据。这里γ表示训练样本vector到达超平面的signed distance.
Convergence i.e. it is gonna be bounded
Convergence theorem:
- 无论训练的次序如何,最终会有convergence的这一天,且在(R/γ)2步以内
- the bound is independent of dimensionality of the feature space.
What if the data is not separable?
this method never stop.
converge to some suboptimal.
More than one “correct hyperplane”–zero error Problem.
Exercise:
The order in which the data and the labels are presented impacts the number of updates it takes for the percptron algorithm to converge.
How we can do to make the perceptron go through every training data point and make an update?(in other words: maximize the error the perceptron makes?)
超平面的另一种形象理解
- 对Feature vector赋予不同权重的线性组合。