public Neuron(List <double> weights, double bias, mathFunction activationFunction) { this.activationFunction = activationFunction; this.init(weights.Count); this.weights = weights; this.bias = bias; }
public Neuron(List<double> weights, double bias, mathFunction activationFunction) { this.activationFunction = activationFunction; this.init(weights.Count); this.weights = weights; this.bias = bias; }
/*Constructors*/ public Neuron(int numOfinput, mathFunction activationFunction,bool LMS) { this.activationFunction = activationFunction; if (!LMS) this.init(numOfinput); else this.initLMS(numOfinput); }
// least mean square public void LMSsetLayer(int layerIndex, mathFunction activationFunction) { if (layerIndex == 0) throw new Exception("Can't set Input Layer"); for (int i = 0; i < this.numOfNeuronsPerLayer[layerIndex]; ++i) { Neuron neuron = new Neuron(this.numOfNeuronsPerLayer[layerIndex - 1], activationFunction,true); this.network[layerIndex - 1].Add(neuron); } }
/*Constructors*/ public Neuron(int numOfinput, mathFunction activationFunction, bool LMS) { this.activationFunction = activationFunction; if (!LMS) { this.init(numOfinput); } else { this.initLMS(numOfinput); } }
// least mean square public void LMSsetLayer(int layerIndex, mathFunction activationFunction) { if (layerIndex == 0) { throw new Exception("Can't set Input Layer"); } for (int i = 0; i < this.numOfNeuronsPerLayer[layerIndex]; ++i) { Neuron neuron = new Neuron(this.numOfNeuronsPerLayer[layerIndex - 1], activationFunction, true); this.network[layerIndex - 1].Add(neuron); } }