Project 7: ANN Classifiers

Objectives

Requirements

Backpropogation and "hidden layers" are often a confusing "mystery" to the data mining student. In order to overcome this mystery, there is no better mechanism than building your own ANN.

Consider the following depiction of a relatively simple ANN.

The network for this exercise has three neurons in the input layer, two neurons in a hidden layer, and three neurons in the output layer. While networks are trained with large training sets, for this exercise we will only use one training example: when the inputs are (1, 0.25, -0.5), the outputs should be (1, -1, 0).

Your goal for this assignment is to implement the above ANN (ideally in a semantically meaningful OO manner) and to implement a train method that uses a backpropogate method to adjust the weights such that, after training, the weights of each value are such that the outputs (1, -1, 0) are generated by your ANN. Your implementation should initialize weights using a random approach (eg, between -1 and 1).

There are many ways to accomplish this implementation of backpropogation. You will not necessarily be penalized for strange, elaborate, or ad-hoc implementations of backpropogation -- as long as your ANN can be trained to generate the above output, given the input of (1, 0.25, -0.5). See the grading critera below for more information.

This is a really fun challenge despite your approach (hack-first vs. math-first, etc)! and I think you'll find that in the end, backpropogation (and why we must backpropogate) will be clear.

Hints

Start with the overall OO model and API first. What do you see in the above diagram? A Network. Layers. Neurons (or nodes).

Chapter 4 of Collective Intelligence "Searching and Ranking" has a Python implementation of BP. While you are encouraged to start from a blank slate ("How the heck to I get all my weights right, given the input and desired output?") you should definitely consult Segaran's implementation if you get stuck.

Grading Criteria (1000 points)

You must have committed and pushed a copy of your code, which at minimum demonstrates the creation and supporting API for the ANN defined above.

750 points: Clear, well-defined structure of the ANN and the necessary API. (If not OO, then you'd best use meaningful identifier names and some comments). Demonstrated instantiation / creation of the above network's structure.

1000 points: Successful implementation of a train method.

Due Date(s)

Milestone 1, Friday, Nov. 4: you must push your implementation that contains the overall structure and API for your ANN, with a demonstrated instantiation/creation of the network.

Milestone 2, Monday, Nov. 7: you must push your final work, demonstrating a successful implementation of the network's training (input of 1, 0.25, -0.5 and output of 1, -1, 0).

This assignment is due by midnight on Monday, November 7.