Exploring Intelligent Adaptive Curiosity

Introduction

Run update81 to copy the IAC files into your directory (cs81/class/iac/).

IAC was developed with the goal of providing a robot with an intrinsic motivation system that pushes it to focus on situations that maximize its learning progress. IAC contains a memory that is sub-divided into sensorimotor regions. Each region contains:

In the original description, IAC's memory is organized hierarchically as a tree. Initially all exemplars are members of a single region. When the region grows too large it is split into two new regions. The split is made based on a feature of the SM(t) component of the exemplars such that the sum of the variances of the S(t+1) component, weighted by the number of exemplars in that new region, is minimized. This process continues recursively on any region that grows too large.

The main processing loop of IAC works as follows:


A simple experiment

In their paper Intrinsic motivation systems for autonomous mental development, Oudeyer, Kaplan, and Hafner describe an experiment that is designed to test the effectiveness of IAC's goal of maximizing learning progress. One part of the domain is easy to learn, one part of the domain is more complex, and another part is unlearnable. We should expect to see IAC first focus on the easy portion, then focus on the more complex portion, while ignoring the unlearnable portion.

We will do a similar experiment to the one they described. The robot is placed in an environment with a smart toy. The robot can translate forward or backward and also emit a frequency that makes the toy move. When the translation amount is:

When the frequency is: The robot then senses its distance from the toy (with some added noise).

The toy starts at a fixed position in front of the robot. If the robot emits the first frequency, then the distance to the toy is unpredictable. If the robot emits the second frequency and moves forward, then it will decrease the distance from the toy. If the robot emits the second frequency and moves backward, then it will increase the distance from the toy. Thus the second frequency is predictable, but the resulting distance depends on the direction of motion. Finally, if the robot emits the third frequency, then the distance to the toy will be close to 0. This is the most predictable case.

In this setup, SM(t) consists of three items:

  1. currentDistance
  2. translation
  3. frequency
and S(t+1) consists of one item:
  1. nextDistance

The paper describes an experiment that lasts for 5000 steps. In the first 250 steps, the robot emits all three frequencies equally. This is when the initial region first splits, and the robot begins focusing on the third frequency. From then until about time step 3000, the robot emits the third frequency (the easiest one to predict) about 90% of the time. From that point on it focuses on emitting the second frequency (the more complex one to predict) about 85% of the time. It never spends more that 10% of the time on the first frequency, which is unlearnable.

Running IAC

Let's begin with a short experiment that will last only 500 steps. To start the experiment do:

python iac.py

Near the end of the iac.py file, an IACBrain is constructed and passed a number of arguments including the maximum region size, the motor vector size, the sensor vector size, the maximum number of steps in the experiment, and the probability of a random action. This is where you can modify the parameter settings for additional experiments.

Running iac.py will generate a number of data files recording the percentage of time the robot emits each of the three frequencies during every 50 time steps. These data files are updated continuously and can be viewed while the experiment is running. The following will produce a graph similar to Figure 4 on page 274 of the IAC paper:

xgraph -ly 0,1 -P *.data

After the experiment is completed, additional data files will be written. One called log will contain a description of all of the regions formed during the experiment. Others with a .err extension summarize the mean error of each region over time. The following will produce a graph similar to Figure 5 on page 274 of the IAC paper:

xgraph -P *.err

Based on the information in the log file, draw a tree representation of the regions formed by IAC. Include the cut points at each branching point. When IAC makes a split, exemplars containing values less than the cut point will be placed in the left branch, and exemplars containing values greater than the cut point will be placed in the right branch. Based on these cut points, which regions should be predictable?

Now look at the error graphs. Is the error dropping for predictable regions? What do the error graphs look like for the unpredictable regions?

Now look graphs showing how often the robot emits each frequency. Do these graphs show similar trends as in the original experiment?

Next try running a longer experiment of 2000 steps. When the experiment ends repeat the analysis that you did for the shorter experiment. Does the robot actually switch focus from one frequency to another?

While the longer experiment is running look through the IAC code. First look in the file iac.py at the step method of the class IACBrain. This runs the main loop of the program. Make sure you understand each method that is being called. Next look in the file knnRegion.py at the method findCutPoint which is the key to how IAC subdivides regions.