Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / I have created life mwahahaha!

Author
Message
Libervurto
17
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 25th Apr 2010 05:16 Edited at: 25th Apr 2010 08:35
I want to make some programs that learn, and here is my first one: an AI rat.
The rat has been placed in a box with three levers inside; one of the levers releases a food pellet when pressed, the other two do nothing. The challenge is to make the rat learn which lever to press.

I will keep a short log of changes made to the program as it becomes more advanced. (I will write it like I am studying the rat, for fun )

Experiment 1.0: The rat has a primitive brain which stores a value for each lever; the higher the value the more likely it is to be chosen. When the correct lever is pressed and the rat receives food it increments that lever's value, when an incorrect lever is pressed the rat decrements that lever's value. The rat quickly learnt which lever to press.

Experiment 2.0: For this experiment I switched the lever that dispenses food pellets after every ten presses (correct or incorrect). The rat did not respond well, he continued to press the old lever many times before giving up on it and trying another.

Experiment 2.1: Continuing with this experiment, the rat has shown much progress. Now when it finds the correct lever it not only increments the value for that lever, it completely disregards the others and resets their values to zero.
When choosing the wrong lever the rat - in addition to finding the chosen lever less desirable - now finds the other two levers more desirable.
Both these advancements are producing faster learning speeds.

If any budding AI psychologists would like to repeat my experiments I have included the code below.
Here are some variables you can play around with, they can all be found before the MAIN.
"max_presses" - sets how many presses to run in the experiment.
"display_interval" - sets how often to update the display, set as 1 to update after every press.
"lever_change" - sets the interval at which the levers are switched around.


Link102
19
Years of Service
User Offline
Joined: 1st Dec 2004
Location: On your head, weeeeee!
Posted: 25th Apr 2010 12:43
you need to look into artificial neural networks. Your method is almost the same as you set a "weight" to each lever.

Libervurto
17
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 25th Apr 2010 14:50
Thanks link.
I wanted to keep the AI rat as simple as possible because I have never done AI before but that video and the ones related to it are very interesting. This will definitely help when I get onto more advanced AI.

Digger412
16
Years of Service
User Offline
Joined: 12th Jun 2007
Location:
Posted: 25th Apr 2010 18:03 Edited at: 25th Apr 2010 18:04
Here's something that I did that is similar to that, it's a genetic algorithm to find out what sequence of number>operator>number... would calculate to make a given number. I wrote it in DBP, but I don't see why it wouldn't work in DBC. I'm attaching a .exe anyways, I hope that it's useful.

Attachments

Login to view attachments
Libervurto
17
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 25th Apr 2010 22:22
Thanks dig, I'll have a look at that

I made it so when the rat picks the wrong lever it immediately disregards it even if that lever has given it a lot of food. This shoots his accuracy up to above 80% but it's not natural behaviour, this would be a result of conditioning. How would I get the rat to learn that the levers change? Could I make him pre-empt the change?
Would that require a neural network?


pictionaryjr
15
Years of Service
User Offline
Joined: 12th Mar 2009
Location:
Posted: 26th Apr 2010 02:00
u should make it so he gets used to how many times it takes for the levers to switch.

Digger412
16
Years of Service
User Offline
Joined: 12th Jun 2007
Location:
Posted: 26th Apr 2010 15:12
@pictionaryjr

What would be best would be if it came up with that kind of behavior on its own..otherwise, you're biasing it one way or another.
Sinani201
17
Years of Service
User Offline
Joined: 16th Apr 2007
Location: Aperture Science Enrichment Center
Posted: 27th Apr 2010 06:34 Edited at: 27th Apr 2010 06:35
Quote: "I made it so when the rat picks the wrong lever it immediately disregards it even if that lever has given it a lot of food. This shoots his accuracy up to above 80% but it's not natural behaviour"


I think it is natural behaviour. The rat thinks that if the lever is not giving it food then it is not good. If after a while that lever happens to give it food, then it would probably forget the time when it did not.

Here's an idea: why not make a second rat that pushes levers as well? If one rat sees another one pushing a lever without food coming out then both would disregard that lever. Or does that make it too easy?
BN2 Productions
20
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 27th Apr 2010 09:00
Bouncing off of sinani here, have the level that releases the pellet change regularly in a preset pattern that repeats. The 2 rats observe the results of their choice and the results of the other's choice and figure out the pattern.

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
Dark Dragon
16
Years of Service
User Offline
Joined: 22nd Jun 2007
Location: In the ring, Kickin\' *donkeybutt*.
Posted: 11th May 2010 04:46
Interesting, just the other day i was playing with someone's Neural Net prog..........

kaedroho
16
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 19th May 2010 20:27
Don't use neural networks. Your program will turn out just like everyone elses. Try and create something new.

Login to post a reply

Server time is: 2024-04-23 15:11:10
Your offset time is: 2024-04-23 15:11:10