Introduction to Artificial Inteligence

Assignment 5


Programming assignment - learning with artificial neural networks


In this assignment, you will implement neural networks and training neural
networks with genetic algorithms. The program will include two modules:
the neural network itself, and the training module, that modifies the
network weights so as to achieve optimal peformance on a given function.

The neural network structure is feed-forward, specified by the number of units per layer. Assume that the output of each unit at level k is connected to the input of each unit at level k+1. Specification will be by an ASCII file, where the first line will contain just the number of layers, and following lines will contain (one per line) the number of units at layer 1 (input), then layer 2, etc. For example, the following specifies a network with 3 input units, 1 intermediate (hidden) unit, and 2 output units.

3
3
1
2

The TASK for a neural network is an ASCII file containing a TRUTH TABLE for some BINARY VALUED function. Each line in the file specifies the outputs for each combination of input values. For example, a TASK file for the above network might be:

F F F   F T
F F T   T T
F T F   F F
F T T   T F
T F F   T T
T F T   T T
T T F   T F
T T T   T F

The program that trains the network uses a single vector to represent all the weights in the neural network (a single genotype). A genetic algorithm is run in order to find the weights that optimize performance - the fitness function is the reciprocal of the (number of errors + 1), taken over the entire truth table.

Deadline: June 11.