示例#1
0
 /// <summary>
 /// Creates forward connection pattern between specified layers
 /// </summary>
 /// <param name="fromLayer">
 ///            layer to connect </param>
 /// <param name="toLayer">
 ///            layer to connect to </param>
 public static void forwardConnect(Layer fromLayer, Layer toLayer)
 {
     for (int i = 0; i < fromLayer.NeuronsCount; i++)
     {
         Neuron fromNeuron = fromLayer.getNeuronAt(i);
         Neuron toNeuron   = toLayer.getNeuronAt(i);
         createConnection(fromNeuron, toNeuron, 1);
     }
 }
示例#2
0
        /// <summary>
        /// Creates full connectivity within layer - each neuron with all other
        /// within the same layer with the specified weight and delay values for all
        /// conections.
        /// </summary>
        public static void fullConnect(Layer layer, double weightVal, int delay)
        {
            int neuronNum = layer.NeuronsCount;

            for (int i = 0; i < neuronNum; i++)
            {
                for (int j = 0; j < neuronNum; j++)
                {
                    if (j == i)
                    {
                        continue;
                    }
                    Neuron from = layer.getNeuronAt(i);
                    Neuron to   = layer.getNeuronAt(j);
                    createConnection(from, to, weightVal, delay);
                }         // j
            }             // i
        }