Monday, July 29, 2013

Rat Brain

I've been working on a Neural Network I like to call the Rat Brain.  In the past, I've played with neural networks that used forward propagation and although they work, they require an insane amount of training to properly weight all of the nodes.

I read a book by Jeff Hawkins called On Intelligence and I wanted to see if I could write an AI that learns more like a human than a pre tested neural network.  So, the Rat Brain Project was born.  Not this one, but I thought I would reference it because this is actually a Rat Brain driving a car.

The first test is to have an object (Blue Box) on a rope that is of fixed length.  There is a hunk of cheese (yellow box) on one of the sides of the rope.  The robot brain must learn to go to the cheese.  The interface looks like this:
Inputs: 
  1. Distance to one of the sides.
  2. Hunger (Internal Desire)
  3. Left Vision: (True or False) Can I see the cheese on the left side?
  4. Right Vision: (True or False) Can I see the cheese on the right side?
Output:
  1. 00: Stop
  2. 01: Right
  3. 10: Left
Results
The rat can definitely get the cheese.  Right now I have successfully been able to have the brain map the nodes as designed.  I haven't added any of the other inputs yet, but it will go back and forth forever.  This is the node tree that is generated:
At any time during the test I can hit the pause button and look at the node tree.  I'm also generating extensive logging.

So, this may look like a lot of nodes but there are really only three memory nodes (Orange circles).  The inputs are the first circles on the top, and the single output (O1) is on the bottom.

My future tasks will be to introduce the additional inputs and problem solving.  I'm also missing degradation of the connection strengths and nodes over time.  The system should store sequences into short term memory but release that information if a better path is learned.  There is a lot of work to do still but it is a fun project.  If anyone is interested in talking shop with me let me know and I can start posting the algorithms and node designs.

Happy Coding!
Jason

2 comments:

  1. This is fascinating! I've done a lot of very low level, very low space programming. The Tiny13 CPU is a favorite of mine. 1024 bytes rom, and a few measly bytes of ram.

    What's more exciting as well, we can probably 3d print your rat and give it a brain. It's alive!

    ReplyDelete
  2. Ok, 3 years later and this is still fascinating

    ReplyDelete