示例#1
0
 public AbstractNeuron(int inputCount, INeuronInitilizer init, Functions.IActivationFunction function)
 {
     Inputs             = inputCount;
     Weights            = new double[inputCount];
     ActivationFunction = function;
     Initializer        = init;
     Initialize();
 }
示例#2
0
 public Layer(int inputsCount, int neuronsCount, Functions.IActivationFunction function, INeuronInitilizer initializer)
 {
     Inputs  = inputsCount;
     neurons = new Neuron[neuronsCount];
     for (int i = 0; i < neuronsCount; ++i)
     {
         neurons[i] = new Neuron(inputsCount, function, initializer);
     }
     Output = new double[neuronsCount];
 }
示例#3
0
 public Network(int inputsCount, int layersCount, List <int> neuronsCountInHiddenLayers,
                Functions.IActivationFunction function, Neurons.INeuronInitilizer initializer)
 {
     NetworkInit(inputsCount, layersCount);
     if (neuronsCountInHiddenLayers.Count != layersCount)
     {
         throw new ApplicationException("Number of layers and provided layer's neuron count do not match!");
     }
     layers[0] = new Layer(inputsCount, inputsCount, function, initializer);
     for (int i = 1; i < layers.Length; i++)
     {
         layers[i] = new Layer(neuronsCountInHiddenLayers[i - 1], neuronsCountInHiddenLayers[i], function, initializer);
     }
 }
示例#4
0
 public Neuron(int inputs, Functions.IActivationFunction function, INeuronInitilizer initializer)
     : base(inputs, initializer, function)
 {
 }