Jump to content


Photo

ANNIE


  • Please log in to reply
32 replies to this topic

#21 Eddygp

Eddygp

    Horizhite Games

  • GMC Member
  • 216 posts
  • Version:GM8

Posted 25 June 2011 - 08:27 AM

Neurons, in real life, learn by connecting themselves, not only by being more. They connect to transmit information, so I think a set of neurons could connect to another one and, reading a ds_grid, search for the best answer.

EDIT: Not too much neurons: the best output will be searched in the DS grid and then compared to other values:

1- Input
2- Output
3- Expected value
4- Real value

This would make their learning easier and not too many would be needed. Make scripts to connect the neurons. I thought of some variables that determined the connnection.

Edited by Eddygp, 25 June 2011 - 08:31 AM.

  • 1

#22 margoose

margoose

    GMC Member

  • GMC Member
  • 277 posts

Posted 26 June 2011 - 02:01 AM

Real neurons are able to turn their conections on and off and to change a connection from on neuron to another which would be awesome if one could determine the best algorithm/reasons for a neuron to make that change, with that kind of setup you wouldn't need to worry about how u set the neurons up as much because they would handle it themselves over time. /ut to do this you will need completely different scripts even for the initial setup because the script currently atmatically connects every neuron in a previois layer to every neuron in the next like a layered mesh network.
  • 1

#23 Eddygp

Eddygp

    Horizhite Games

  • GMC Member
  • 216 posts
  • Version:GM8

Posted 26 June 2011 - 08:48 AM

Ah... What about input in ds_queues that can be used for ds_grids? Maybe there could be some variables which, er, triggered some codes!
  • 1

#24 margoose

margoose

    GMC Member

  • GMC Member
  • 277 posts

Posted 27 June 2011 - 03:40 AM

I'm not sure input queues would be necessary as it learns on the fly per input unless ur program requires it for somereason but how the input gets there doesn't matter the only thing that matters is what happens as its processing each input. I'm thinking each neuron needs to determine what connections to alter. Real neurons change their connections to the most used neuronsin their surrounding so each artificial neuron should have a min value for their weight so that if its reached then that connection is destroyed or moved to the highest weighted neuron in that layer
  • 0

#25 Eddygp

Eddygp

    Horizhite Games

  • GMC Member
  • 216 posts
  • Version:GM8

Posted 29 June 2011 - 01:55 PM

But they should have like some arrays to search for information and then give the best answer: experience-like arrays.
  • 1

#26 margoose

margoose

    GMC Member

  • GMC Member
  • 277 posts

Posted 30 June 2011 - 02:56 AM

Ur going to have to elaborate a little I think ur a little to focused on the data structure rather than the process come up with a process the the best data structure can be determined but it currently learns off of the error correction within the learn script
  • 0

#27 Eddygp

Eddygp

    Horizhite Games

  • GMC Member
  • 216 posts
  • Version:GM8

Posted 30 June 2011 - 08:48 PM

But at the moment there is not a way to remember things...
  • 0

#28 margoose

margoose

    GMC Member

  • GMC Member
  • 277 posts

Posted 30 June 2011 - 09:03 PM

It does remember things but not the surface way that we think of as remembering...artificial neural networks are for pattern recognition not for exact answer rememberance the idea is for the computer to determine the closest algorithm it takes to get from input to expected output. Sure you could have it just memorized the right answer but that isn't the goal here. In computing you have to choose whether you want to use memory or processing power...would it be more efficient to memorize an infinite table of infintesimal digits for each output or create an algorithm based on the input and calculate it on the fly. This is much more difficult for a human to do when it comes t something like speech or writing recognition or an on the fly path search algoritm than it is for the computer to determine the algorithm itself. But there are many other uses as well but just think of it as creating a method for the computer to generate many different algorithms on the fly based on expected output...now in game you may not know the expected output so the programmer trains the neural net then wen the customer plays the game without learning. Of course if you can determine a way in game to have it find what the right output should have been after the decision was made then you could teach it that way in game. There really is no limit in theory.
  • 0

#29 Eddygp

Eddygp

    Horizhite Games

  • GMC Member
  • 216 posts
  • Version:GM8

Posted 01 July 2011 - 08:40 AM

Well, but it would be quite difficult, e.g., to modify it to recognise the Fibonacci numbers, which are a pattern.

Edited by Eddygp, 01 July 2011 - 08:40 AM.

  • 0

#30 margoose

margoose

    GMC Member

  • GMC Member
  • 277 posts

Posted 02 July 2011 - 10:28 PM

Not exactly what i meant by pattern recognition, neural nets are fuzzy math for fuzzy patterns not set patterns think different handwriting input from different people and trying to come with the same output. I reread some of the other posts as well and it seems there is a bit of confusion as to how it works currently:

- Each neuron is connected to every neuron in the next layer
- Each neuron sends the same output to each neuron its connected to
- Each neuron calculates its output via an multiplication of an initial number and all its inputs and corrects that number via error detection.


Current Problem: The error detection that I think should be used makes all outputs eventually go to zero so my logic is wrong somewhere. The logic I use is:

error = expected_output - actual_output;

If I set all of the errors to this then the zero problem occurs. This is the major issue with its learning as far as I can tell.


edit: It can be used to learn an exact pattern but the biggest issue with that is that there is no gaurantee that it will be exact with any and every input at any given time due to the nature of the learning progression and curve.

Edited by margoose, 02 July 2011 - 10:51 PM.

  • 0

#31 Eddygp

Eddygp

    Horizhite Games

  • GMC Member
  • 216 posts
  • Version:GM8

Posted 03 July 2011 - 08:42 AM

Are you checking the output in binary? THen, you could make a simple code to check it. I'll see if I have one here...
  • 0

#32 margoose

margoose

    GMC Member

  • GMC Member
  • 277 posts

Posted 04 July 2011 - 02:13 AM

Well each neuron in the output layer always outputs a 1 or a 0 so its really the only way to check it directly so yes. What the example I made using the scripts is supposed to do is learn how to reverse the input so that 111001 outputs 100111. I did this because its a more dfficult algorithm than simply doing a bitwise operation and I wanted to test the waters but I got less than I expected due to the problem listed in my above post. Try using the scripts on an easier algorithm and see if it gets better results.

And remember it learns through back propogation there's a link in the first post. I tried the algorithm that they listed but I don't think I understood it correctly if someone with a better eye for math symbols wants to give it a shot please feel free. Also feel free to add other features as well.

FInally, I WANT TO STRESS THE FOLLOWING: that I am not making much advances to this myself unless I feel like it, I've done what I wanted. I am here to HELP others interested in UNDERSTANDING the code I wrote and the processes involved and I do not want this to turn into a help me solve these issues, this is a ill help you solve these issues if you want to learn. Please do not post general ideas about how it might be fixed and expect me to figure it out because its not gonna happen. If you post general ideas I will give feedback on how the code works and why and how something in that general area will be useful or completely out in left field somewhere and why. The best and most useful posts will be about any advances you've made to it and discussions based on those advances. That is all, thank you!
  • 0

#33 jon sploder

jon sploder

    GMC Member

  • GMC Member
  • 858 posts

Posted 27 August 2011 - 05:12 AM

Alright, I've been talking with margoose over the last few weeks and he's helped me a lot to update ANNIE:

Revisions/Modifications:

Base 10 to Binary conversion script now instead of a switch.
Picked up a irandom(10)-1 bug, irandom starts at 0 now, I think it changed, so this threw out
negative (1) values occasionally.
Added local variable declarations of some forgotten things.
A few additional comments.
Returns correct absolute error of network now, along with more detailed feedback.
Added a graph that displays the gross amount of errors that are in that 'step' of training the
network. 0 errors are ideal, the larger the spike on the graph, the worse it is. The network
should show a trend to graph downwards if it is truly making progress.


Check the game information for extremely important notes.

http://www.box.net/shared/lfypsrue8fy6f38dszmt

If I continue trying to update ANNIE, I'm going to focus on the following:
A bit more visual debugging representation, eg graphing longer results (the graph scripts were poorly written in a short time).
Changing the error threshold problems that margoose and I have recently seen, but of course it's easier said than done.
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users