Neural Networks


Due Tuesday April 17 at 11:59pm

This project should be completed individually.

What to submit: Submit neural_net.py and partners.txt under the project name p6.

(10 points total)

Backpropagation. You will need to implement the backpropagation algorithm for training neural networks. Given the network architecture (number of layers and number of nodes at each layer), the initial weights, and the learning rate, your program will iterate through the training examples, incrementally updating the weights.

For this project, the sigmoid function used by the network is g(s) = (exp(s) - exp(-s))/(exp(s) + exp(-s)). This function has a range of [-1,1].

Evaluation. You will also need to implement evaluation of the network. Given a test example, you will need to return the classification predicted by the neural network. In this assignment, we are concerned with two-class problems, so the networks will have a single top layer output node.

Additional details can be found in the framework below.

Files:

neural_net.py

Example Data:

train1.txt
test1.txt

Sample output when running:

python neural_net.py train1.txt test1.txt 2 2 3 1 0.01 200
output1.txt

The above command indicates that the network to be trained has 2 levels (excluding the input) and that the number of nodes in each level are [2 3 1] (2 input nodes, 3 intermediate nodes, and 1 output node). The learning rate is 0.01, and 200 iterations are to be run.