Critique my Neural Network (And what are good resources?)

This topic is 2898 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

I've hand-coded an AND NOT neural network based on a webpage I found. I'm looking for ways to develop it further, such as, of course, not having to hand-code it. Unfortunately, too many websites are either not for beginners or only a brief introduction. I do not, at the moment, have the money for a programming book, although I may be able to spend some in a ~week. Now, on to the source:
    class Program
{
static void Main(string[] args)
{
Neuron[][] neurons = new Neuron[3][];
neurons[2] = new Neuron[] { new Neuron(1.0, NeuronType.Output) };
neurons[1] = new Neuron[] { new Neuron(0.5, new NeuronLink[] { new NeuronLink(neurons[2][0], 1.0) }) };
neurons[0] = new Neuron[]
{
};

foreach (Neuron[] neuronsIn in neurons)
{
foreach (Neuron neuron in neuronsIn)
{
neuron.Activate();
}
}

}
}

class Neuron
{
public Neuron(Double threshhold)
{
this.Threshhold = threshhold;
}

{
this.Threshhold = threshhold;
}

public Neuron(Double threshhold, NeuronType type)
{
this.Type = type;
this.Threshhold = threshhold;
}

{
this.Type = type;
this.Threshhold = threshhold;
}

public NeuronType Type = NeuronType.Hidden;
public Double Threshhold;
public Double Input = 0;

{
if (input)
this.Input += 1;
else
this.Input += -1;
}

{
this.Input += input;
}

public void Activate()
{
if (this.Type != NeuronType.Output)
{
if (this.Input >= this.Threshhold ||
this.Type == NeuronType.Input)
{
{
}
}
this.Input = 0;
}
}

{
return this.Input >= this.Threshhold;
}
}

enum NeuronType
{
Input,
Hidden,
Output,
}

{
{
this.Weight = weight;
}

public Double Weight;

public void Fire(Double input)
{
}
}


[Edited by - Narf the Mouse on March 16, 2010 1:42:07 PM]

Share on other sites
Well, my Neural Network can feed forward and back propagate. I can train it on any AND operation (AFAIK), but it doesn't quite get OR operations.

I'm using two inputs (The first and second booleans), two "hidden" neurons and one output neuron. (Three layers)

I can post source code, but it's a bit of a mess and uncommented.

Share on other sites
Re: Neural networks

Quote:
 Original post by Narf the MouseI do not, at the moment, have the money for a programming book, although I may be able to spend some in a ~week.

You might try the Usenet comp.ai.neural-nets FAQ, at least as a start:

http://www.faqs.org/faqs/ai-faq/neural-nets/part1/

[Edited by - Predictor on March 17, 2010 10:14:04 AM]

Share on other sites
Thanks for the link. I've stuck it in a tab.

Share on other sites
That Faq seems very technical; is there anything that's more for beginners?