B. Goodwine
Spring, 1999 |
Issued: April 14, 1999 Due: April 21, 1999 |
Note: do either
gcc -o neural neural.c -lmand the resulting executable will be called
neural
.
When run, neural
will train a neural network to
approximate the sine function, and plot a comparison of the
network output and the actual sine function values. The
program should automatically display a graph that looks like
this:
The default values are for the network to have 10
HIDDEN
nodes in one hidden layer, and to train
for 20000 ITERATIONS
. These parameters are
defined near the top of the code.
Notes:
MAX_RAND
, and replace every other occurrence of
MAX_RAND
with RAND_MAX
.
HIDDEN
nodes is actually too many. Reduce the
number of hidden nodes to try to determine the effect of
having fewer nodes.
In particular, answer the following questions (10 points each).
ITERATIONS
,
required?
HIDDEN
nodes, i.e. the smallest number that
adequately approximates the function and does not require
a very long time to train?
for
loop so that several periods of the sine
function are plotted to verify that the network only
approximates the function well around the points on which it was
trained.