コード例 #1
0
        /// <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);
            }
        }
コード例 #2
0
        public override Neuron Copy()
        {
            BiasNeuron n = new BiasNeuron();

            return(n);
        }
コード例 #3
0
 public BiasNeuron(BiasNeuron n)
 {
     value = n.value;
 }