/// <summary> /// De/activate the bias neuron in layers /// </summary> /// <param name="layerNumber">layer number in wich the bias neuron should be modified</param> /// <param name="active">new mode for the bias neuron</param> public void SetBiasNeurons(int layerNumber, bool active) { List <Neuron> l = layers.ElementAt(layerNumber); Neuron bn = null; foreach (Neuron it in l) { //search for the BiasNeuron if ((bn = it as BiasNeuron) != null) { if (!active) { l.Remove(it); } } } if (bn == null && active) { BiasNeuron biasNeuron = new BiasNeuron(this); l.Add(biasNeuron); } }
public override Neuron Copy() { BiasNeuron n = new BiasNeuron(); return(n); }
public BiasNeuron(BiasNeuron n) { value = n.value; }