|
using System;
using ANN.Perceptron.ArchiveSerialization;
using ANN.Perceptron.Common;
using ANN.Perceptron.Connections;
namespace ANN.Perceptron.Neurons
{
// Neuron class
public class Neuron : NetworkProvider
{
public string label;
public double output;
public Connection[] Connections;
int connectionCount;
public int ConnectionCount
{
get
{
return connectionCount;
}
set
{
if (connectionCount == value)
return;
connectionCount = value;
}
}
public Neuron():base()
{
Initialize();
label = "";
output = 0.0;
Connections= null;
}
public Neuron(string str):this()
{
label = str;
output = 0.0;
Connections = null;
Initialize();
}
public Neuron(string str,int icount)
{
label = str;
output = 0.0;
Connections = new Connection[icount];
connectionCount = icount;
Initialize();
}
public void AddConnection(uint iNeuron, uint iWeight,int connID)
{
Connection conn = new Connection(iNeuron, iWeight);
Connections[connID]=conn;
}
public void AddConnection(Connection conn, int connID)
{
Connections[connID]=conn;
}
private void Initialize()
{
}
public override void Serialize(Archive ar)
{
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.