CS30 -- Introduction to Computer Science II
Fall, 2005
Assignment 4
(updated 9/20/2005)


Exercises:
From the text (Budd's Classic Data Structures in Java), Chapter 4, pg 92:
Do number 4 in the Exercises.

Programming Projects: (Chapter 4, pgs 94-95)
1. (from the Budd text) Programming project 4.  (isPrime)
2. (from the Budd text) Programming project 7.  (More with Fibonacci numbers)
3. More with Neural Networks.  This week, you will write a class, NeuralNet, that implements the NeuralNetI interface and will use your LTU class from last week.  The important characteristics of a NeuralNet include the number of input units, number of hidden units and number of output units.  Typically, neural networks have an input layer of primitive units, a single hidden layer of units, and an output layer.  Usually (and for our purposes), the network is fully connected between layers; that is, every input unit provides a signal to every hidden unit, and every hidden unit provides an input to every output unit.  When initializing your NeuralNet, you may set weights randomly.  The NeuralNetI interface mandates a method to set inputs and determine outputs.  Naturally, determining outputs should perform a cascaded computation of the inputs to the hidden layer units, then the hidden layer outputs to the output layer's inputs, and finally the output layer's outputs. 

Since the input layer units are a bit different from the hidden and output layer units, we will modify our NeuralNetUnit interface to work with both types.  Inputs to a single LTU will not be Objects and we will assume that input layer Objects are Integer wrapper instances, and hidden and output layer Objects are other LTU instances.  Your constructor for the LTU should consume an argument for the number of inputs to the unit (if it does not already do so).

Modify your implementation of the LTU and write an implementation of the NeuralNet.


Submission Instructions:
On your machine where you are doing your homework, create a folder called <your email name> followed by "A4".  For example, someone with email address "cjones" would create a folder called "cjonesA4".  Inside that folder, place plain text file(s) containing your answers to any exercises.  Also, place whatever Java files are necessary for your Programming Projects in the same folder.  Finally, either tar or zip the folder so that when I extract it, the folder "<emailname>A4" will be created.  Submit your archived file via Eureka.