public AbstractNeuron(int inputCount, INeuronInitilizer init, Functions.IActivationFunction function) { Inputs = inputCount; Weights = new double[inputCount]; ActivationFunction = function; Initializer = init; Initialize(); }
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]; }
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); } }
public Neuron(int inputs, Functions.IActivationFunction function, INeuronInitilizer initializer) : base(inputs, initializer, function) { }