Advertisement

How do you train an NN?

Started by December 04, 2001 10:18 AM
12 comments, last by smart_idiot 22 years, 10 months ago
I am planning on mutating it, and using the offspring that does the best job. If I wanted to get it to learn by watching me do a simple task, would I mutate it a bunch of times and use the one that best matches the input to the output, or what?
Chess is played by three people. Two people play the game; the third provides moral support for the pawns. The object of the game is to kill your opponent by flinging captured pieces at his head. Since the only piece that can be killed is a pawn, the two armies agree to meet in a pawn-infested area (or even a pawn shop) and kill as many pawns as possible in the crossfire. If the game goes on for an hour, one player may legally attempt to gouge out the other player's eyes with his King.
You don''t "mutate" a NN : that would be genetic programming.
What you do is define an error function to quantify how good a match the NN output is with the desired output. Then you use a function minimization algorithm (e.g. gradient descent), acting on the NN cell weights to reduce the error to zero (+/- epsilon).
The easiest, if not most efficient, way to do that is to modify each individual weight proportionally to the partial derivative of the error function with respect to the weight you are modifying. Adding an inertia factor can help too.

Given that, you should be able to whip up an implementation
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
Advertisement
You can use genetic algorithms to evolve your network. My website may be of some use to you there. I have a tutorial which very clearly shows you how this is done.

www.btinternet.com/~fup/Stimulate.html

or you can use a type of backpropogation as the previous poster suggested. Which one you use depends very much on what you want your ANN to do.
What the hell is a NN?
A neural network. Something like your brain.
Kill mages first!
Sorry for going off topic, but:

quote: A neural network. Something like your brain.


If it was anything other than a neural network, then that would be a pretty funny childish put down

quote: A cheese grater. Something like your brain.


I couldn''t resist

Trying is the first step towards failure.
Trying is the first step towards failure.
Advertisement
hey fup:
good article! thanks, you gave me the "primer" i needed to figure out what the hell all these neural network things on the internet are talking about.

--- krez (krezisback@aol.com)
--- krez ([email="krez_AT_optonline_DOT_net"]krez_AT_optonline_DOT_net[/email])
smart_idiot,
To answer your original question, the training of a neural network generall involves "training data." What this means is that you give it a set of inputs for which you already know the correct output, and then judge the network based on these known quantities. This is where Fruny''s "error function" comes in... the error function determines how well the network performed for training input, and then adjusts the network accordingly. This is usually an iterative process that happens many (hundreds or thousands) times. The more training data you have, the better your network should perform.

Granted, that is a very simplistic explanation, but does that give you the generally idea?
It just came to me: Could one not make a NN that recognizes black/white faces???
Say we feed it with eigth faces, and have it loop until it can recognize all of them...
Of course this would only work for those pictures specifically(perhaps we could make minor changes to them), but if we have anough resolution, wouldn''t it be possible to have a webcam, and the computer recognizes the user, so one does not have to inpu any passwords and so on???

Anyonw got any idea if it is possible(which i think it is), and how long time would it take to train the NN to recognise...say...twenty faces with todays computers?

An hour? A day? A month? A year?

However, it would be sweet to have a program, that recognizes you, and it pops up a messagebox like: "Hello Tjoppen, what do you want to do today?"

hehe...
delete this;
quote: Original post by Tjoppen
However, it would be sweet to have a program, that recognizes you, and it pops up a messagebox like: "Hello Tjoppen, what do you want to do today?"

i''d have mine say "Hello Dave" even though my name''s not Dave.

--- krez (krezisback@aol.com)
--- krez ([email="krez_AT_optonline_DOT_net"]krez_AT_optonline_DOT_net[/email])

This topic is closed to new replies.

Advertisement