B. Goodwine
Spring, 2000 |
Issued: April 13, 2000 Due: April 20, 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 2000 ITERATIONS
. These parameters are
defined near the top of the code.
Notes:
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 for the network to adequately represent the sine function?
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.