CS81 Lab1: Neural Network Brains for Robots

Due by noon next Friday

In this lab you will familiarize yourself with pyrobot, a tool for controlling both simulated and physical robots, that is written in python. You will also learn how to use the conx library for experimenting with neural networks.

You will go over an extended example demonstrating how you collect data for a robot task, train a network, and then test the resulting weights on the robot. You will then create a robot with a neural network brain and train it to do phototaxis (moving in response to light).

1. Getting started
2. Using neural networks to control robots

One method for teaching a neural network to control a robot is called offline training and involves the following steps. First hand code a robot controller. Use this controller to collect data to be used to train a neural network. Next train a neural network with the collected data. Finally use the trained network to control the robot and test its performance. Follow the steps below to train a neural network to control a robot to do a wall following task.

3. Training a robot to do phototaxis

You will go through the same series of steps as above, but this time using your own hand-coded program for teaching a robot to orient and approach a light source.

You should use the Braitenberg.py world as the basis for your task. When collecting data be sure to start the robot from many different initial conditions (with the light straight ahead, to the right, to the left, behind the robot). You can use the Simulation device, which is discussed in the pyrobot overview, to programmatically reposition the robot after it has successfully reached the light source.


Put all of the files you created in the cs81/labs/1 directory. In the SUMMARY file provided, describe what your teacher program does, how you trained the network, and your results.

When you are done, run handin81 to turn in your completed lab work.