CS63 HW5: Back-propagation

Due by noon Friday, Nov. 9

You may work with a partner on this assignment. Be sure to add both names to the top of every file. Only one of the partners needs to turn in the code.

Before you begin do an update63 to get a copy of the starting point file, backprop.py, which you'll need to complete this homework. It should appear in the directory cs63/homework/05.

Implementing back-propagation

Take some time to read and understand the starting point code. It uses three classes: Unit, Connection, and Network. You will need to complete several methods of the Network class that are involved in:

Follow the comments provided in the file when implementing these methods. Feel free to create additional methods within the other classes in order to complete the Network class.

Your completed code should be able to successfully learn the two examples provided at the end of the file. The XOR problem may take several thousand iterations to find a solution (and in some cases, it may even fail after 10,000 iterations). If you'd like to improve learning speed, read about how to include momentum in the back-propagation algorithm.

Common mistakes


Thanks to Jim Marshall at Sarah Lawrence College for the idea for this assignment.


Once you are satisfied with your program, hand it in by typing handin63 at the unix prompt.