Exercise 10: Implementation of a Backpropagation Network
Date: Summer Term 2006
Now, its time to implement a backpropagation network. The maintenance of the units and con- nections is already taken care of (filenn.c/nn.h). The other parts, such as the conversion of given arguments, is done in the same way as in exercise 5. First of all, you are strongly advised to read the API documentation, which can be found at
http://www-md.e-technik.uni-rostock.de/ma/rs/lv/nn.zip.
Unit 1: Download the prepared material and read the API documentation.
Unit 2: Implement the main functions in the filebp.cof a simple backpropagation network.
Please note that the given code material does not provide any backpropagation func- tionality but demonstrates how to use the network functions. You might want to start with a simple 1-1-1 network that should be realizing an inverter. How many training patterns do you need? This unit is to make sure that your backpropagation code is working well, and the prt-functions are mainly for debugging purposes ;-) Save this program version for later usage.
Unit 3: Classification is a typical application area for neural networks. To this end, im- plement a 4-2-4 encoder that maps the four possible input patterns ‘1000’, ‘0100’,
‘0010’, and ‘0001’ onto identical outputs. You will be using this program in the next exercise.
Unit 4: Another application area is known as approximation. The network should learn to approximate the two-dimensional functionf(x, y) = cos(x) + cos(y)in the range (x, y)∈[−π..π]. Please, take into account the following two demands:
1. Your program has to generate both the training and the test patterns. Allow (by implementing an option) for generating these patterns at random as well as systematically.
2. The two parameters l pats (learning) and t pats (testing) should specify the number of patterns per dimensions, i.e., generatingl pats2plust pats2 in total.
You will be using this program in the next exercise as well.
Hint: How to directly callgnuplotfrom your own program, is shown in the doc- umentation.
Have fun, Hagen and Ralf.
1