Can you provide a code example of a neural network and how it works on some sample inputs? [closed]

StackOverflow https://stackoverflow.com/questions/2217128

  •  19-09-2019
  •  | 
  •  

Question

Could you give a sample of NN ?

I mean something like implemented ORC but easier.

And could you explain how does it work with examples.

Was it helpful?

Solution

Check out this site:

http://www.ai-junkie.com/ann/evolved/nnt1.html

It has an excellent explanation of Neural Networks in addition to a minesweeper program that is built using it. The original code is in C++, but there are links to ports of the code to VB.Net and Delphi.

Also check out the main page

http://www.ai-junkie.com/

to find excellent articles on genetic algorithms and Self Organizing Maps - this one is found under the Neural Network button.

Hope this helps.

OTHER TIPS

I have a feeling this is not what you're actually asking but here is a simpile neural net in C#:

public class NeuralNode {
  double _threshold;
  double _signalReceived;
  public NeuralNode(double threshold) {
    _threshold = threshold;
    Reset();
  }
  public void Reset() { _signalReceived = 0; }
  public event Action<double> Fires = delegate {};
  public void Signal(double strength) {    
    if((_signalReceived += strength) >= _threshold)
      Fires(.5);
  }
}

var n1 = new NerualNode(1);
var n2 = new NerualNode(1);
var n3 = new NerualNode(1);
n1.Fires += n3.Signal
n2.Fires += n3.Signal

n1 and n2 feed into n3. n3 will only Fire if n1 and n2 fire.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top