This neural network program models how humans or animals determine the direction of the source of a sound using two ears. The sensory information fed into the network is the intensity of sound in each ear and the time delay between each ear. The model is trained using NEAT (NeuroEvolution of Augmenting Topologies).
The program also provides visualisation of the best performing network in each generation:
Download all the Python files. You should only run the integrate_lab.py which is the main file of the program. A user should only modify the config.py file.
External python modules used are
import random
import copy
import pygame
import json
import shelve
After downloading the files, you can take a look at the config.py file. These can be set by the user to experiment with different variables.
- Download all Python files.
- Run integrate_lab.py to check if the program is running smoothly.
- After training the networks, a report of statistics and animation of the best network will be played.
- Press enter to see through the animation.
- After (default: 6) animations, you will be prompted to save by entering S. Enter S.
- Stop the program.
Then, you should change some of the variables in config.py. For example,
- Change the population_limit to 50.
- Run integrate_lab.py.
- Review if changes are present during the reports after the network training. The field "Current population" should be 30.
- Stop the program.
The program comes with a data logging and retrieval system using shelve module.
- Run integrate_lab.py
- After training the networks and (default: 6) animations, note that the report shows that this is generation 1.
- You will be prompted to save by entering S. Enter S.
- After saving, a new round is started. Stop the program.
- 3 files with the name (default: network_data) of different extensions should be created.
- In config.py, set
load_data=True
. Then save and run integrate_lab.py. - Confirm the prompt to load data.
- The first report after training should be titled generation 2.
You can email me at [email protected] regarding the future of this project.
Currently, this is the first version of the program.
- Chooi Je Qin - Initial work - Stereophonic-hearing
This project is licensed under the MIT License - see the LICENSE.md file for details
This program implements the NEAT algorithm developed by Kenneth O. Stanley and Risto Miikkulainen from the University of Texas.