This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
cs501r_f2016:lab2 [2016/09/02 04:45] wingated |
cs501r_f2016:lab2 [2021/06/30 23:42] (current) |
||
---|---|---|---|
Line 10: | Line 10: | ||
You should turn in an iPython notebook that implements the perceptron algorithm on two different datasets: the Iris dataset, and the CIFAR-10 dataset. Because the perceptron is a binary classifier, we will preprocess the data and "squash" it to create two classes. | You should turn in an iPython notebook that implements the perceptron algorithm on two different datasets: the Iris dataset, and the CIFAR-10 dataset. Because the perceptron is a binary classifier, we will preprocess the data and "squash" it to create two classes. | ||
- | Your notebook should also generate a visualization that shows classification accuracy at each iteration, along with the log of the l2 norm of the weight vector, for two different values of the perceptron's step size. Examples of both are shown at the right. Since there are two datasets, and there are two visualizations per dataset, your notebook should produce a total of 4 plots. | + | Your notebook should also generate a visualization that shows classification accuracy at each iteration, along with the log of the l2 norm of the weight vector, for two different values of the perceptron's step size. Examples of both are shown at the right (for the CIFAR-10 dataset). Since there are two datasets, and there are two visualizations per dataset, your notebook should produce a total of 4 plots. |
**Please cleanly label your axes!** | **Please cleanly label your axes!** | ||
Line 32: | Line 32: | ||
* 70% Correct implementation of perceptron algorithm | * 70% Correct implementation of perceptron algorithm | ||
- | * 20% Tidy and legible visualization of loss function | + | * 20% Tidy and legible visualization of weight norm |
* 10% Tidy and legible plot of classification accuracy over time | * 10% Tidy and legible plot of classification accuracy over time | ||
Line 93: | Line 93: | ||
In the wikipedia description of the perceptron algorithm, notice the function ''f''. That's the Heaviside step function. What does it do? | In the wikipedia description of the perceptron algorithm, notice the function ''f''. That's the Heaviside step function. What does it do? | ||
- | You should run the perceptron for at least 100 steps. | + | You should run the perceptron for at least 100 steps. Note that your perceptron will probably converge in much fewer on the Iris dataset! |
You should also test different step sizes. Wikipedia doesn't discuss how to do this, but it should be straightforward for you to figure out; the algorithm description in the lecture notes includes the step size. (But try to figure it out: consider the update equation for a weight, and ask yourself: where should I put a stepsize parameter, to be able to adjust the magnitude of the weight update?) | You should also test different step sizes. Wikipedia doesn't discuss how to do this, but it should be straightforward for you to figure out; the algorithm description in the lecture notes includes the step size. (But try to figure it out: consider the update equation for a weight, and ask yourself: where should I put a stepsize parameter, to be able to adjust the magnitude of the weight update?) |