For this lab you will create a set of training data from a simulated robot performing some task. As an example, I have created starting point files that are applied to a wall following task. You will then train a cascade correlation network to mimic this behavior. As a point of comparison, you will also train a back-propagation network on the same data. Finally you will test the resulting weights of each network back in the simulator and contrast the results.
You may work with a partner on this lab.
rm -fr cascorOnce you have removed this directory, then do update81. This will copy over the updated version, as well as a new directory to store the work you do in this lab.
Notice that the program generates data in the range [0.0,1.0]. For sensor values this involves scaling and for motor values this involves shifting (and scaling if you use motor values with absolute value greater than 0.5). You can use the already collected data in the file wall.data, or you can create a new data file by doing:
pyrobot -s PyrobotSimulator -w Tutorial.py -r PyrobotRobot60000.py -b wallCollect.pyTo start the data collection, press the Run button. You can end it after the robot has made two complete circles of the environment (one for training data and the other for testing data). Press the Stop button and then exit from Pyro.
./cascor wall.data > outputCurrently the cascor program is limited to generating only 10 new hidden nodes, so it generally stops before reaching complete correctness. In a robot learning task, you typically do not want to be training until complete correctness. Sensors data is noisy and overtraining should be avoided. To see if you have trained enough, look at the listing of errors during training that have been saved in the output file:
grep error outputThis will return a listing similar to the following:
Error index: 0.558 True error: 22.844 Sum squared error: 2.440 Error index: 0.453 True error: 15.047 Sum squared error: 1.613 Error index: 0.380 True error: 10.590 Sum squared error: 1.123 Error index: 0.344 True error: 8.667 Sum squared error: 0.910 Error index: 0.331 True error: 8.019 Sum squared error: 0.831 Error index: 0.298 True error: 6.505 Sum squared error: 0.659 Error index: 0.278 True error: 5.655 Sum squared error: 0.572 Error index: 0.262 True error: 5.028 Sum squared error: 0.495 Error index: 0.246 True error: 4.456 Sum squared error: 0.447 Error index: 0.238 True error: 4.168 Sum squared error: 0.420 Test results: True error: 2.254 Sum squared error: 0.224 Ave true error: 2.254 Ave sum squared error: 0.224 Ave error index: 0.3In the final line of the training error (before "Test results"), if the sum squared error is less than 0.5, then you have probably trained enough. However, if this error is still above 1.0, and if error still seems to be dropping rapidly, then you should edit the cascor.c file to allow more candidate units to be created, and re-train.
cp weights-1.net wallCC.wts
pyrobot -s PyrobotSimulator -w Tutorial.py -r PyrobotRobot60000.py -b wallCCTest.pyThis will load in the weights from the file wallCC.wts and generate the appropriate network architecture. To start the test, press the Run button. The overall average error will be printed after each step.
python wallBPTrain.pyThis will train for a maximum of 1500 epochs on the same data used in the cascade correlation test. It will end training early if the training data is learned to complete correctness or if the learning stagnates for at least 12 epochs in a row.
pyrobot -s PyrobotSimulator -w Tutorial.py -r PyrobotRobot60000.py -b wallBPTest.pyThis will load in the weights from the file wallBP.wts and generate the appropriate network architecture. To start the test, press the Run button. Again, the overall average error will be printed after each step.
Use handin81 to turn in your results.