Perceptron Convergence and the Margin Bound
In questa pagina 5
Question left open in Halfspaces and the Perceptron AlgorithmA perceptron computes h(x) = sign(w^T x) where x includes a constant coordinate x0 = 1 that absorbs the threshold into the bias weight w0; its decision boundary is the hyperplane w^T x = 0 (a line in the plane, x2 = -(w1/w2) x1 - w0/w2). The Perceptron Learning Algorithm scans the data and, on every misclassified point, replaces w by w + y x. A single perceptron cannot separate the exclusive-or pattern; two perceptrons feeding a third give a multilayer network.Halfspaces and the Perceptron Algorithm →: with the update rule , how many steps are needed to find a solution? The handwritten answer is a bound that depends only on the geometry of the data. First the distance from a point to a hyperplane, then the proof.
1. Distance of a point from the hyperplane
Setting of the sketch: the hyperplane , a point off it, the vector (perpendicular to the hyperplane), the point on the hyperplane nearest to , and the vector from to , whose length is the distance between and . Since the shortest segment to a hyperplane is perpendicular to it, , i.e. for some number , and
(Here the bias is written separately: , , hyperplane .)
Find . lies on the hyperplane:
Find the length. With :
Simplifying,
In particular, if the distance is simply ; with the bias absorbed in it is .
2. Statement of the bound
Assumptions (sketch: a circle of radius containing all points, a separating hyperplane with normal , and a band of half-width around it that contains no point):
- the algorithm starts from the initial hypothesis ;
- there is an optimal hyperplane with coefficient vector , (that is ), that classifies everything correctly with margin :
- every point satisfies .
Theorem. The number of updates that PLA performs before finding a solution satisfies
Indexing used in the proof: is the weight vector after updates ( after zero updates).
3. Proof in three steps
Step 1: (induction on ).
- Base : , so , i.e. .
- Step : the update on a misclassified point gives using the induction hypothesis for the first term and the margin assumption for the second.
Step 2: . From the cosine formula, with the angle between and ,
because . With and Step 1:
Step 3: (induction on ).
- Base : .
- Step: The last (cross) term is not positive: the update is performed only when the point is misclassified, i.e. (the handwritten page marks it ""; "" is enough for the argument). Dropping it, The equality holds because ; the next inequality because all points are inside the circle of radius .
Conclusion. Squaring Step 2 (both sides are non-negative) and using Step 3,
4. How to read the bound
- Small margin means many steps. The last sketches of the page contrast a data set whose clouds are far from the separating line (large ) with one where points almost touch it (small , big ).
- The bound does not depend on the number of points or on the number of features, only on and (my remark).
- It counts updates, not passes over the data: each pass over the data of the notebooks is an epoch and may contain many updates or none.
- It assumes the data are linearly separable. For non-separable data (the last sketch of the page, with a curved boundary needed) the algorithm never stops, so the code adds a maximum number of iterations. Many separating lines may exist (the bundle of lines in the sketch): PLA returns one of them, not a particular one.
5. Notation page
The last page of this lecture recalls notation: a column vector and its transpose ; a matrix and its transpose ; the norm . See also Vector Spaces, Scalar Product and NormsReview of geometry for signals: vector spaces over a field, the scalar product and norm in complex vector spaces, p-norms, orthogonality, and the generalized Pythagorean theorem.Vector Spaces, Scalar Product and Norms →.
Versione ripasso
Perceptron Convergence and the Margin Bound
- Distance of from : , obtained with and .
- Assumptions: ; unit with for all ; .
- Theorem: updates, with the weights after updates.
- Step 1: by induction (each update adds ).
- Step 2: (cosine , ).
- Step 3: by induction: ; on a mistake the cross term is , and .
- Conclusion: , so .
- Sketches: a circle of radius containing the points; a separating line with a band of half-width that contains no point; the contrast between large and small .
- Reading: small margin means many updates. The bound depends on and only; it counts updates, not epochs. Non-separable data: never stops, so the code adds a maximum number of iterations.
- Notation page: ; transposes of column and matrix; see Vector Spaces, Scalar Product and NormsReview of geometry for signals: vector spaces over a field, the scalar product and norm in complex vector spaces, p-norms, orthogonality, and the generalized Pythagorean theorem.Vector Spaces, Scalar Product and Norms →.
- Typical errors: forgetting ; dropping the cross term without saying it is on mistakes; confusing with the distance of the farthest point.
- Update rule and mistakes: Halfspaces and the Perceptron AlgorithmA perceptron computes h(x) = sign(w^T x) where x includes a constant coordinate x0 = 1 that absorbs the threshold into the bias weight w0; its decision boundary is the hyperplane w^T x = 0 (a line in the plane, x2 = -(w1/w2) x1 - w0/w2). The Perceptron Learning Algorithm scans the data and, on every misclassified point, replaces w by w + y x. A single perceptron cannot separate the exclusive-or pattern; two perceptrons feeding a third give a multilayer network.Halfspaces and the Perceptron Algorithm →.