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 / Artificial Neural Net Engine (ANNE)

Author
Message
y2ksw
19
Years of Service
User Offline
Joined: 13th Nov 2005
Location:
Posted: 1st Nov 2008 13:26
Quote: "Basically, think of this concept as Code that can re-write itself and evolves by reducing code and/or arrangements that do not perform well and retaining code and/or arrangements that do perform well. The code is limited to the function-list.

Now the obstacle is; what would these functions be?"

Yeah, I know the quest ... I've gone through it during the development of an intelligent Operatiing System. Eventually it worked out to think as objects, and three "classes": competence, priority and limits. The "competence class" would define the number of functions, the "priority class" the order of execution and weight of domain, and the "limits class" would avoid overlapping into other object's competence classes.

When thinking about a game, its core functions have the major importance anywhere, and all other operations besides rendering are branches with more or less priority. An object with low priority will update less often, but it does not mean it uses inferior intelligence.

If you would use an AI in order to rewrite code and/or reuse functions, you must possess a huge core, and allow the AI to access most of them. Once you have established the competence of each object, it becomes pretty clear what each need. The question however is, do they really need to change their behaviour by "implementing" functions in their logic, or would it be sufficient to change some parameters of their own?
wind27382
18
Years of Service
User Offline
Joined: 10th Feb 2006
Location:
Posted: 1st Nov 2008 16:34
good to see u'r still working. this project has been most impressive.

wind
wh1sp3r
21
Years of Service
User Offline
Joined: 28th Sep 2003
Location: Czech republic
Posted: 1st Nov 2008 22:09
looking forward to trying new demo

PS: Real programmers aren't afraid of math!.

AMD 64x 3500+, 6GB RAM, GeForce 8800 GTS 320MB, HD 500GB, X-fi xtreme audio, Internet 10/1 Mbit
RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 9th Feb 2009 21:37 Edited at: 9th Feb 2009 21:39
I am re-approaching this project from the bottom up. The ANNE engine was designed from the top-down, and it worked fine. But there was always a little mess about the learning. Also, the network was simply thrown together semi-randomly with hope for the best.

This is phase one of the new design. I am currently calling this project i_Constants (for "Intelligent Constants"). I am certainly open to better names for it. The "Intelligent" part is pretty obvious; they are supposed to be intelligent after all. But the "Constant" part might be a little confusing.

Variables are intended to be altered within the code by the program, or by the user. Variables fit nicely into for-next loops and coordinates, and so on. Constants on the other hand are to be set and will not change as the code executes. Constants are intended for fixed values that should not change, like Pi, the speed of light, or perhaps the border of a zone. i_Constants are more like constants than variables. While it is true that these i_Constants will change, they should also eventually settle into a "perfect" state from which they will not change. From that point on, they act as constants.

It would also be ill-advised to use i_Constants in place of variables. For example, a coder cannot set an i_Constant to a particular value (i.e. a=b+c*d or for i=1 to 10). Instead, the i_Constant is given a range in which it is allowed to select its own value from. This range represents the parameters in which the i_Constant can operate within. It can never go below the lowest parameter, or above the highest parameter.

Given the above arguments, the term Constant seemed to be more appropriate than the term Variable. As stated earlier, though, I am open to suggestions. Think of i_Constants as constants that are not set by the coder so much as they are constants that are best determined by a trial-and-error evolutionary process.

Here's the demo. It is based off of the old ANNE demo in which the AI must navigate through a randomized obstacle course and arrive at a "best" destination. Like the previous ANNE demo, the starting point is in the lower left corner, and the "best" destination is in the upper right corner.

The AI Entity gains points as it gets closer to the upper right corner. The AI loses points for colliding with an obstacle and gains points for each move that there is no collision.

The AI is a series of 20 paired "genes" - each pair determines a move and a turn. Basically, in 20 moves, the AI should be able to reach it's "best" destination once the combination of genes is set to a pattern that can navigate the obstacle course. Once your AI reaches MegaEpoch 400 (40k Epochs!!) or so, it should be well trained to reach the upper right corner while avoiding obstacles.

Each Cycle allows the AI to test a given patter over and over. Since this is a static course, there is no real need to re-test a pattern multiple times - only once (in this case, I chose twice to amplify the score). There needs to be at least two cycles in each epoch since a score cannot be obtained until at least one cycle has passed and the score is stored on the second cycle.

Each Epoch allows the i_Constants to "mutate" or select new values that will be used. The number of i_Constants that are "mutated" is determined by how many MegaEpochs have passed. The more MegaEpochs that have passed, the fewer mutations.

The program runs extremely fast in order to execute as many Epochs in a short amount of time as possible. In order to slow down the frame rate, press the space key. Press the space key again to speed things up.

Edit: Oh, this might require IanM's Matrix Utilities. I don't think so, but something might have slipped in.


Open MMORPG: It's your game!

Attachments

Login to view attachments
Neuro Fuzzy
17
Years of Service
User Offline
Joined: 11th Jun 2007
Location:
Posted: 10th Feb 2009 06:34 Edited at: 10th Feb 2009 07:35
yup, it does require IanM's matrix utilities

But anyways... this is so cool!

I was thinking about doing this a couple years ago, but i really didn't know enough to actually do it... i might start looking into neural networks again. My idea was the same with the sensors on each side of the cube, but also sight, which would be an 8x8 image. I think i might spend a couple hours looking through your code.

[edit]
after installing ianm's matrix utilities, i got an error whenever i was compiling your code that "cannot use reserved variable rand" after removing the plugin with random commands, it compiled a bit, but crashed with an error saying "variable name 'max' is not valid at line 1232"
so i removed the plugin with the min/max commands... then i got an error saying some long message about "openfilebox"... so after some looking around, i downloaded "Goga's Free DBP Plugin 0.1", and after trying a couple versions of that, got nowhere...

err, could you upload a .exe version?
RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 10th Feb 2009 16:35
That really sounds like you might be downloading the older versions.
This link here is the older version with an executable enclosed:
https://forumfiles.thegamecreators.com/download/1403031

The fix for the code is all in the generic_functions file. Do a search for "max" and change it to "_max". I think there are only two. Then do a search for "Rand" and just delete that function completely. That is an old generic_functions library file. If you download the file from my post right before yours, you can copy that generic functions file over and that should work fine as well.


The new version (my previous post) is really an evolution engine that guide the i_Constants to be their "best" values within the given range. I will be working on the neural net next, but it seems to be more of an art than coding skills. Trying to get the right range of values that ignite, or not ignite, portions of the neural net. Once I get close, I can let the i_Constants evolve into the best-fit neural net values.


Open MMORPG: It's your game!

Login to post a reply

Server time is: 2024-11-24 11:57:56
Your offset time is: 2024-11-24 11:57:56