We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexDiscussionExhibition › Neural Network
Page Index Toggle Pages: 1
Neural Network (Read 1798 times)
Neural Network
Nov 10th, 2006, 11:37pm
 
Hello folks,

I've been working on some Neural Network Processing/Java examples.  I recently built a simple multi-layered network, two inputs, one hidden layer, and one output that solves XOR.   It works most of the time, but sometimes get stuck trying to solve for optimal weights.  With 4 neurons in the hidden layer (instead of 2), it seems to work perfectly (as far as I can tell).

If any of you neural network masters are curious, take a look. . . perhaps I missed something in my implementation?

http://www.shiffman.net/2006/11/10/multi-layered-neural-network/
Re: Neural Network
Reply #1 - Nov 11th, 2006, 5:07pm
 
Some guy called Patol has a BPN you might try instead of yours to act as control data, seeing as it can solve XOR. It's a pity the XOR code is missing but the BPN is there and it's quite small reading.

http://www.patol.com/java/NN/index.html

Interestingly he doesn't use classes at all. Just a bunch of arrays. An interesting approach, does one need to wrap everything in an object Is it really Christmas yet

Regarding one of your comments on layers. I read somewhere that you're not going to get any noticeable improvement from using more layers.

Unfortunately I've yet to start work on the BPN library, and I never tackled XOR. I've a list of NN related links with my paper but nothing concrete.
Re: Neural Network
Reply #2 - Nov 13th, 2006, 5:18pm
 
Thanks for all these links!  I'll check it out.  

Yes, neural networks seem to lend themselves well to a library since they are nice little modular systems of connected parts.  I could imagine it working something like:

Code:

// 3 inputs, 1 hidden layer, 2 outputs
NeuralNetwork nn = new NeuralNetwork(3,1,2);

float inputs[] = {1,1,1};
float outputs[] = {0,1};
nn.train(inputs,outputs);

float inputs2[] = {1,1,1};
float[] outputs2 = nn.guess(inputs2);


Hmmmm. . .maybe I'll have to set this up!

Dan
Page Index Toggle Pages: 1