This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2009-11-07 23:03:12

blaman
Scratcher
Registered: 2008-06-27
Posts: 2

A.N.N. Style AI

Well, for about a week now I've been researching and playing around with the idea of A.N.N. style AI's, A.N.N. meaning Artificial Neural Network.
Today I finally got around to writing one in Scratch. It took about two hours, and about a half hour of fixing out a few little kinks.

This is a very, very simple version of an A.N.N. So simple infact that if you didn't really take apart everything, you wouldn't know or think it was.
This AI has two inputs, two "hidden nodes" and four outputs. Although these numbers don't really agree with how many hidden nodes it's supposed to have, it still works.

http://scratch.mit.edu/projects/blaman/750221

The AI works using a simple feed-forward system to correct mistakes it makes each time the AI spawns. It's only goal is to get to the yellow coin and it does this by first heading in what it thinks is the general direction of the coin, then when it eventually hits it or the wall, it updates it's random-factor weights which ultimatly teaches the AI what's right and wrong. You should eventually see the AI always making it to the target rather quickly. Also, when it's running if the bot seems to stop or get stuck, don't worry. This just means the AI is confused and it will soon be corrected in a variety of ways because I've implemented a few features to correct such problems.
One last thing: The two variables at the top of the screen could be called the AI's brain content. Those two numbers tell it just what to do, incase you are wondering what they are. That just goes to show how simple it is.  smile

I will be continuing work on this AI, hoping to eventually include it in a game of some sort. It takes a lot of work to create an AI like this one, even though it looks rather limited right now, so I ask you not to use it unless you give me credit where credit is due.

Offline

 

Board footer