Professional Documents
Culture Documents
Lecture 3: Perceptron
Princeton University COS 495
Instructor: Yingyu Liang
Perceptron
Overview
Previous lectures: (Principle for loss function) MLE to derive loss
Example: linear regression; some linear classification models
Task
( ) = 0
( ) > 0
Class +1
( ) < 0
Class -1
Attempt
Given training data , : 1 i.i.d. from distribution
Hypothesis =
= +1 if > 0
= 1 if < 0
Perceptron Algorithm
Assume for simplicity: all has length 1
+1
= + = + = + 1
+1
= = = 1
1 2
mistakes
1 2
mistakes
Do not depend on , the
length of the data sequence!
Analysis
First look at the quantity
Claim 1: +1
+
Proof: If mistake on a positive example
+1
= + = + +
+1
= = +
Analysis
Negative since we made a
mistake on x
Claim 2: +1 + 1
Proof: If mistake on a positive example
+1
= +
+ 2
Claim 1: +1
+
Claim 2: +1
+1
After mistakes:
+1
+1
+1
+1
So , and thus
1 2
Intuition
Claim 1: +1
+
Claim 2: +1
+1
History
Connectionism example
Neuron/perceptron
Figure from
Pattern Recognition
and machine learning,
Bishop
, : 1 , typically i.i.d.
Gradient descent
Minimize loss , where the hypothesis is parametrized by
Gradient descent
Initialize 0
+1 =
, , =
that minimizes = =1
+1 = , , =
= log( ) log[1 ]
=1
=1
1
= log( )
, ,
1
=
log( )
1
=
log( )
+1 = , , = +
Where =
()
Example 3: Perceptron
Hypothesis: = sign( )
Define hinge loss
, , = [mistake on ]
= [mistake on ]
+1 = , , = + [mistake on ]
Example 3: Perceptron
Hypothesis: = sign( )
+1 = , , = + [mistake on ]
Set = 1. If mistake on a positive example
+1 = + = +
If mistake on a negative example
+1 = + =
Mini-batch
Instead of one data point, work with a small batch of points
(+1, +1 ),, (+, + )
Update rule
+1
1
=
, + , +
Homework
Homework 1
Assignment online
Course website:
http://www.cs.princeton.edu/courses/archive/spring16/cos495/
Piazza: https://piazza.com/princeton/spring2016/cos495
Homework 1
Grading policy: every late day reduces the attainable credit for the
exercise by 10%.
Collaboration:
Discussion on the problem sets is allowed
Students are expected to finish the homework by himself/herself
The people you discussed with on assignments should be clearly detailed:
before the solution to each question, list all people that you discussed with on
that particular question.