# Rosenblatt's Perceptron Learning Algorithm

Below is a Java program which implements Rosenblatt's Perceptron
Learning Algorithm (PLA). The PLA is a method which can determine a
weight vector which is normal to the plane which divides vectors of
two classes if the two classes are linearly separable. In simple
terms, if there are two clusters of points of different "types", then
this algorithm can learn to find the line which separates the two
clusters.

## Instructions

- Use the first mouse button to place points of class 1.
- Use the third mouse button to place points of class 2 (or on
computers with only one mouse button - e.g. Macs - hold down the
Meta key - Apple key - while pushing the mouse button).
- (Optional) Adjust the threshold step size, learning rate, and number of
iterations.
- Click on "Go!" to allow the learning to go through the number of
iterations specified.
- Status messages are shown at the bottom of the applet.

## Comments

The threshold step size affects the rate at which the third component
of the weight vector, the threshold, is updated. A value of 25.0 is
good in most cases, though larger values can speed learning if the
separating line is far from the origin, and slow it down if the line
is closer. This was added just because the other components of the
input vector were much larger than 1.
The learning rate is the traditional learning rate which scales the
training vector before being added to the weight vector during
updates. Try different values if you like, larger values will affect
the convergence rate, but not the convergence itself. (i.e. pick a
large value and it'll still converge).

The number of iterations is put in so that the algorithm won't run
forever if the input vectors are non-separable. Keep clicking on
"Go!" until the status line says that learning is complete, or you are
convinced the input vectors are non-separable.

**NOTE:** If you do not see anything above, make sure you have Java
enabled in your browser. For Netscape that means, click on Options in
the menubar, and select Network Preferences. Then click on the
Languages tab and from there click on Enable Java. Then hit Ok and
then click on Reload. You might want to save your options for the
next time you run Netscape (Options->Save Options).

Last updated: *Tue Sep 10 17:27:23 EDT 1996,
jesse@mit.edu*

© 1996 - W. Hong, Massachusetts Institute of Technology

All Rights Reserved