Due Friday, 2009-05-01
Download
these eleven Python modules and one data file.
You will edit network.py, adding a new class.
In addition, you will make a minor edit to thing.py.
Unless you make other changes to other modules, you only need to submit network.py
and thing.py.
The world this time is populated by four instances each of the classes MWren (purple) and FWren (dark green).
The MWrens are like male birds; they sit in one place and sing a constant song that's hard-wired into them.
The FWrens are the female birds that move around as they listen to and learn to recognize the songs.
Each of the two songs consists of a sequence of sounds (instances of the class Sound), which are repeated over and over again.
There are four different sounds, represented by different methods in the MWren class and different text on the screen.
The FWrens hear any song that is sung within their hearing radius (which you can see if you select "Show senses"). Their hearing sensor represents a sound input locally; that is, there is a separate input unit for each of the four different sounds.
The goal of the FWrens is to learn to predict the next sound they will hear. They do this using their built-in simple recurrent networks, which you have to implement.
FWren.set_network.
Network.initialize to accomplish this.
Network.pre_stuff.
FWren.set_network. You can see what an FWren's network looks like by clicking on it.
The targets for each output unit (when these are provided) appear above the horizontal line.
FWren.step to train the SRN, using the method Critter.run_network.
You will have to pass a target to this method.
Note that Critter.run_network returns the error, and if you increment the FWren's error attribute with this value and also increment the trials attribute,
you will see statistics about how well the FWren is learning after each run.