University of Notre Dame
Aerospace and Mechanical Engineering

ME 469: Introduction to Robotics
Homework 7

B. Goodwine
Spring, 2000
Issued: April 13, 2000
Due: April 20, 1999


Note: do either

  1. problems 1 through 6, or
  2. problems 1,2 and 7 only.


  1. (10 points) Write a computer program to implement the edge detection algorithm (using the 3x3 Prewitt mask) outlined in class. Run the code on one of the airplane images from the last homework and submit the code as well as the image that results from the edge detection routine.
  2. (0 points) Download and compile the sample neural network code which is like what was distributed in class. To compile it, type
       gcc -o neural neural.c -lm
    and 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:

  3. 10 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).

    1. What is the effect of reducing the number of hidden nodes?
    2. Does there appear to be a minimum number of hidden nodes for the network to satisfactorily approximate the sine function?
    3. What, if any, appears to be the relationship between the number of hidden nodes and the amount of training (i.e. the number of ITERATIONS, required for the network to adequately represent the sine function?
    4. What seems to be the optimal number of HIDDEN nodes, i.e. the smallest number that adequately approximates the function and does not require a very long time to train?
  4. (5 points) Near the end of the code is a section that prints the output of the neural network and the sine function to a file called "network.m." Change the range of the 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.
  5. (25 points) Modify the network, and training data points, if necessary, so that the network adequately approximates the sine function for at least one and a half or two complete periods.
  6. (20 points) Determine the minimum number of data points needed to train the network to adequately approximate the sine function for at least two complete periods. Note that the location of the data points may have a substantial effect.
  7. (90 points) Use the sample code as a skeleton to create a neural network to approximate an unknown function. Possible examples include:
    1. predicting the weather,
    2. predicting the stock market,
    3. predicting the outcome of sporting events,
    4. etc.
    If you choose this problem, you must receive prior approval from the instructor. Also, be careful to pick a problem for which you can obtain data that is easily quantifiable. (Some stock market data is available from the instructor).


Last updated: April 14, 1999.
B. Goodwine (jgoodwin@nd.edu)