Exemplo n.º 1
0
        /// <summary>
        /// Function for Network Manipulation
        /// connect each hidden neuron with each input neuron
        /// and each output neuron with each hidden neuron
        /// </summary>
        public void CreateFullMesh()
        {
            //connect each hidden neuron to each input neuron
            for (int l = layers.Count - 1; l > 0; --l)
            {
                foreach (Neuron n in layers.ElementAt(l))
                {
                    WorkingNeuron wn = n as WorkingNeuron;

                    if (wn != null)
                    {
                        foreach (Neuron itIn in layers.ElementAt(l - 1))
                        {
                            wn.AddConnection(itIn, 1.0);
                        }
                    }
                }
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Function for Network Manipulation
        /// connect each hidden neuron with each input neuron
        /// and each output neuron with each hidden neuron
        /// </summary>
        public void CreateFullMesh()
        {
            //Connect each output neuron to each hidden layer neuron
            foreach (Neuron itOut in outputLayer)
            {
                foreach (Neuron itHid in hiddenLayer)
                {
                    ((WorkingNeuron)(itOut)).AddConnection(itHid, 1.0);
                }
            }

            //connect each hidden neuron to each input neuron
            foreach (Neuron itHid in hiddenLayer)
            {
                WorkingNeuron wn = itHid as WorkingNeuron;
                if (wn != null)
                {
                    foreach (Neuron itIn in inputLayer)
                    {
                        wn.AddConnection(itIn, 1.0);
                    }
                }
            }
        }