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.

Work in Progress / i_Constants

Author
Message
RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 16th Feb 2009 02:54
First, I am not sure about the name. The principle lands right on the line between constants and variables. Variables, in fact - change their values, while constants do not. According to this, the name is misleading. However, you cannot assign a value to a constant (except initially) and variables can have values assigned to them. Given this principle, the name is accurate. So, I chose the name that fit the principle of how "i_Constants" should be used instead of the fact that the values change. I am wide open for suggestions on the name. Oh, and the "i" is for Intelligent.

This is a branch off of the ANNE project. It is the core Evolution Engine that the ANNE project needs in order to create a neural net that improves over time. However, I can see there is a lot of other uses for i_Constants. Basically, they can be used anywhere in place of a Constant in which the "best" value is not determined by the coder or some formula (like pi).

Using i_Constants will make creating a Neural Net a snap. This has been the single most challenging part of the Neural Net. The cool thing is that i_Constants learn independently. In previous versions of ANNE, the teaching process was complicated, slow, and very limited. i_Constants add speed, simplicity, and removes restrictions.

The attached code is the i_Constants in action. The code tries to determine the three values that when combined in the following formula (a*b+c) arrive at a given result. To randomly or sequentially try to arrive at these values would take a very long time: O(10,000^10,000^10,000)!!!

The actual math seems to be a bit off, but that is due to the expected float inaccuracies inherent in a binary math system.

This code is i_Constant Floats. I will be working on i_Constant Integers and probably DWords later, as well as other really cool demos.


Open MMORPG: It's your game!

Attachments

Login to view attachments
Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 17th Feb 2009 02:09
This is very interesting. I'm not sure how it works, but I am quite suprised by the results. I told it to find a way to get 100, and it got 100.0004. Very nice job, I'm sure there are several AI breakthroughs that could be made with this concept .

RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 17th Feb 2009 07:41 Edited at: 17th Feb 2009 07:50
Thanks for the reply and the test Sixty Squares.

Quote: "I'm sure there are several AI breakthroughs that could be made with this concept."


That's the idea. Now to implement them.



Here is the next demo. The idea is to allow the AI to "learn" how to navigate the maze. Each of 50 moves and 50 turns is an i_Constant Float that discovers through trial-and-error the best value to have until the AI can successfully navigate the maze.

For a quick preview, view the movie (I know, high-tech taken with my cell phone ).

http://s180.photobucket.com/albums/x58/riidii/?action=view¤t=VIDEO0014.flv


Open MMORPG: It's your game!

Attachments

Login to view attachments
calcyman
17
Years of Service
User Offline
Joined: 31st Aug 2007
Location: The Uncertainty Principle
Posted: 18th Feb 2009 16:45
Could you explain how your method works? I can only think of a few ways to find the optimum solution to a problem; does your method use any of these?

A) The Newton-Raphson method for locating zeros in equations
B) Using maxima and minima in conjunction with calculus
C) Using a multi-layer neural network
D) Altering the values with a genetic algorithm
E) Modelling the equation as a landscape, and locating maxima and minima by 'rolling' down it

A and B are instant solutions, but unfortunately they are only applicable to one variable (or two, by using complex numbers). C is not so accurate, and D takes too long to compute. E works well, but can get stuck in local minima and maxima.

You've discovered something revolutionary if you can overcome all of these problems!

The optimist's right, The pessimist's right.
RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 18th Feb 2009 20:38 Edited at: 18th Feb 2009 20:39
D is the closest answer. It comes to the answer pretty darn quick too.

Here's how it works.

The test problem;

i_Constants a, b, & c.
n = rnd(10000)
a * b + c = n

At first, a,b,c randomly select test values and are scored better the closer the result is to n. These values are locked in and the score is retained for future comparison - typical genetic algorithm.

As the Epochs progress, the probability that any given i_Constant (a,b,or c) will attempt a new test value. So, for example:
Start...
a= test
b= test
c= test

next...
a= test
b= best
c= test

and then soon..
a= best
b= best
c= test

eventually...
a= best
b= best
c= best

and that should be the solution (or as close as the algorithm will come). Of course, the above is an example, the process happens many-many times and which i_Constant is tested is random (individually determined, not based on other selections, only probability).

This is, however, intended to be the background work for C - a multi-layer neural network.

In the case of the path determination, the solution is similar, just longer.

The problem; In 50 moves & 50 turns, navigate the maze without touching the walls and arrive at the top-right corner.

i_Constants(1-50) = Moves
i_Constants(51-100) = Turns

The score is based on how close the AI moves to the destination (cumulative for the entire journey), and points are deducted for every collision.

At first, all 50 moves and turns are randomly selected. As the Epochs progress, fewer moves and turns are altered until a "best" solution is arrived at.

The probability chance that a given i_Constant is ever changed is calculated as If Rnd(Epochs^P)<2 where P is a value 0> and <1.


Open MMORPG: It's your game!
RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 19th Feb 2009 03:21
Here's the i_Constant DWord's. The demo also shows a larger scale use of the i_Constants. In demo 3, the i_Constants are trying to match the image, which is a decent use for DWords. This demo is (admittedly) cheating since each i_Constant is trying to match each pixel individually instead of the whole picture trying to match the whole picture.

While I am sure it will work, the shear size of the picture slows down the process to about 5 frames per second. Also, the size of the image dictates that a large amount of Epochs i necessary to even start getting close to the image. So, for the sake of demonstrating that the i_Constant DWords works, I simplified the process to a single pixel at a time.

Even "cheating," this is still fairly impressive. If you compare this to the first demo, where a*b+c=n, this is similar. Basically, each i_Constant is trying to guess at a value between 0 and RGB(255,255,255), which it does fairly fast.


Open MMORPG: It's your game!

Attachments

Login to view attachments

Login to post a reply

Server time is: 2024-11-24 08:27:21
Your offset time is: 2024-11-24 08:27:21