CSc 8810 CI

Assignment 2 (Neural Networks)

Due 10/6 Monday

1. (100 points) Please use the given BP (back-propagation learning algorithm) program

(Please download

either bpPC.exe

or bpLinux.exe

or bpUnix.exe

from the class Web site.)

To train a neural network to learn a past bank market trend using past bank data (click on then please choose your own bank data from Banking Data on the left side), then use the trained neural network to predict bank trend in the future 7 days (or 7 months, 7 years, etc.). Please enter real bank values and the predicted ones in the future 7 days (or 7 months, 7 years, etc.) in a table, and draw an entire bank curve including real past and future data and another prediction curve in the same 2-dimesional space, and the prediction error curve (Matlab may be helpful).

[Note: you need to choose your own bank data (number of past data, structure of a neural network (inputs, hidden neurons and output neurons), etc.]

(1) Train a neural network command:

bpPC LEARN pastbank.dat pastbank.net 0.45 0.9 0.001 100 3 10 1

Or

bpLinux LEARN pastbank.dat pastbank.net 0.45 0.9 0.001 100 3 10 1,

where, bpPC, bpLinux : program name

LEARN: to train a neural network

pastbank.dat: past bank data file

pastbank.net: neural network parameter file

0.45, 0.9: parameters (you don’t need to change them)

0.001: training error, you may change it

100: the interval loop number (between two displays on the computer screen)

3: number of inputs (input neurons)

10: number of hidden neurons

1: number of outputs (output neurons)

(2) Use the trained neural network to predict future values

bpPC RUN futurebank.dat pastbank.net,

or

bpLinux RUN futurebank.dat pastbank.net.

where,

RUN: run the trained neural network to generate new outputs based on futurebank.dat

futurebank.dat: just contain 7 different input values used to generate 7 future values like from Monday to Sunday.

How to Use the Neural Network Software

CSc 8810 CI

The XOR problem is solved by the BP learning algorithm.

(1) Train a neural network command:

bpPC LEARN olddata.dat weight.net 0.45 0.9 0.001 100 2 4 1

Or

bpLinux LEARN olddata.dat weight.net 0.45 0.9 0.001 100 2 4 1,

where, bpPC, bpLinux : program name

LEARN: to train a neural network

olddata.dat: past bank data file

weight.net: neural network parameter file

0.45, 0.9: parameters (you don’t need to change them)

0.001: training error, you may change it

100: training cycles

2: number of inputs (input neurons)

4: number of hidden neurons

1: number of outputs (output neurons)

For example:

bpPC LEARN xor.dat weight.net 0.45 0.9 0.001 100 2 4 1

xor.dat is

1 0.1 0.1 0.1

2 0.1 0.9 0.9

3 0.9 0.1 0.9

4 0.9 0.9 0.1

The 1st column is sequential number, then 2 input columns and one output column.

Note: input and output values are normalized into [0, 1] from original data like back data. You may modify the bp c++ code to do it.

(2) Use the trained neural network to predict future values

bpPC RUN newdata.dat weight.net,

or

bpLinux RUN newdata.dat weight.net.

where,

RUN: run the trained neural network to generate new outputs based on newdata.dat

futurebank.dat: just contain 7 different input values used to generate 7 future values.

For example:

BpPC RUN xor.dat weight.net.