Exemplo n.º 1
0
        public void AddLayer(int nodeCount)
        {
            int index = -1;

            //if index is not set then add a layer to the end then set index to the recently added layer
            neuralNodeTree.Add(new NeuralNode[nodeCount]);
            index = neuralNodeTree.Count - 1;


            layers += 1;

            //sets each node in the tree
            for (int i = 0; i < nodeCount; i++)
            {
                neuralNodeTree[index][i] = new NeuralNode(threshold, bias);
            }

            //if it is not the first layer added to the network
            //then add links to the previous node
            if (index != 0)
            {
                //first it calls addLinks which creates connections between 2 layers
                //then adds the list of links into the links container.
                foreach (NeuralNode node in neuralNodeTree[index - 1])
                {
                    links.AddRange(node.addLinks(neuralNodeTree[index]));
                }
            }
        }
Exemplo n.º 2
0
 public NeuralLink(NeuralNode node)
 {
     neuralNode = node;
 }