CS81 Lab1: Neural Network Brains for Robots

Due by noon next Wednesday

In this lab you will familiarize yourself a python library called conx for creating and experimenting with neural networks that is part of pyrobot.

You will go over an extended example demonstrating how you collect data for a robot task, train a neural 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 write a robot controller. Then 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.

Let's use this approach to train a neural network brain for a robot to do wall following.

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.