Table of Contents
- A perceptron needs to be inspected and evaluated.
- A perceptron needs to be tested with real values.
Check your library
Create new unknown points and test whether your perceptron can correctly predict the answer:
For example:
// Test Against Unknown Data const counter = 500; for (let i = 0; i < counter; i++) { let x = Math.random() * xMax; let y = Math.random() * yMax; let guess = ptron.activate([x, y, ptron.bias]); let color = "black"; if (guess == 0) color = "blue"; plotter.plotPoint(x, y, color); }
Error counting
Add a tool to count the number of errors:
For example:
// Test Against Unknown Data const counter = 500; let errors = 0; for (let i = 0; i < counter; i++) { let x = Math.random() * xMax; let y = Math.random() * yMax; let guess = ptron.activate([x, y, ptron.bias]); let color = "black"; if (guess == 0) color = "blue"; plotter.plotPoint(x, y, color); if ((y > f(x) && guess == 0) || (y < f(x) && guess == 1)) {errors++} }
Perceptron adjustment
How do you tune a Perceptron? Here are some suggestions:
- Adjust the learning pace.
- Increase the amount of training data.
- Increase the number of training repetitions.
4.5 ★ | 2 Vote