Task to Complete
Create a program that uses a single perceptron to find a line to separate two “half-moons” of randomly generated data (see image).
April 11th, 2017
- I spent this class reading through and understanding the graphics code Dr. Delgado provided. I made some minor modifications to certain parts to suit my personal programming style and habits.
April 13th, 2017
- I copied over the Perceptron and Trainer classes from the previous Double Moon project.
- I wrote the method to generate the test data by, for each number, putting it on one of the digit panels, adding noise, and saving the digit array. I decided to store this data in a .csv file format because this made it easy to read from and write to.
- I also began writing the training method. I completed the part of the method for reading in from the .csv file.
April 17th, 2017
- Today I finished up the training method. The rest of the code was relatively simple because the Perceptron and Trainer classes were already written and work.
- I also wrote the classify method, which tests each of the ten perceptrons (one for every digit) until the digit matches one of them.
- At this point, the basics of the program are pretty much complete.
April 19th, 2017
- I spent this class adding some more features to the program.
- For example, I allowed the user to manually add noise and change the input through using the mouse to click on the grid.
- I also enlarged the grid from 5×7 to a 9×11. Changing the code for this was relatively simple. However, rewriting the hard-coded digit arrays was extremely tedious and took up most of the time.
- I also experimented with translation of the digits. I wrote a method to translate a digit array left or write; I then modified the generate method to also store these translated arrays (with noise added) as training data. However, I found that it is extremely difficult for a single perceptron to classify such a non-linear training set, and on the contrary, it had a negative effect on the ability of the perceptron to discern regular non-translated digits. Hence, I abandoned this idea and reverted the code back to its original state.