Represents an output node in backpropagation network.
Inheritance: BackPropagationNode
コード例 #1
0
        /// <summary>
        ///     Overridden.Method that constructs network topology.
        /// </summary>
        protected override void CreateNetwork()
        {
            nodes = new NeuroNode[NodesCount];
            links = new NeuroLink[LinksCount];
            var cnt = 0;

            for (var i = 0; i < InputNodesCount; i++)
            {
                nodes[cnt] = new InputNode();
                cnt++;
            }

            firstMiddleNode = cnt;

            for (var i = 1; i < (layersCount - 1); i++)
            {
                for (var j = 0; j < nodesInLayer[i]; j++)
                {
                    nodes[cnt] = new BackPropagationMiddleNode(LearningRate, momentum);
                    cnt++;
                }
            }

            firstOutputNode = cnt;
            for (var i = 0; i < OutputNodesCount; i++)
            {
                nodes[cnt] = new BackPropagationOutputNode(LearningRate, momentum);
                cnt++;
            }

            for (var i = 0; i < LinksCount; i++)
            {
                links[i] = CreateLink();
            }
            cnt = 0;
            var l1 = 0;
            var l2 = firstMiddleNode;

            for (var i = 0; i < (layersCount - 1); i++)
            {
                for (var j = 0; j < nodesInLayer[i + 1]; j++)
                {
                    for (var k = 0; k < nodesInLayer[i]; k++)
                    {
                        nodes[l1 + k].LinkTo(nodes[l2 + j], links[cnt]);
                        cnt++;
                    }
                }
                l1  = l2;
                l2 += nodesInLayer[i + 1];
            }
        }
コード例 #2
0
        /// <summary>
        ///     Overridden.Method that constructs network topology.
        /// </summary>
        protected override void CreateNetwork()
        {
            nodes = new NeuroNode[NodesCount];
            links = new NeuroLink[LinksCount];
            var cnt = 0;
            for (var i = 0; i < InputNodesCount; i++)
            {
                nodes[cnt] = new InputNode();
                cnt++;
            }

            firstMiddleNode = cnt;

            for (var i = 1; i < (layersCount - 1); i++)
                for (var j = 0; j < nodesInLayer[i]; j++)
                {
                    nodes[cnt] = new BackPropagationMiddleNode(LearningRate, momentum);
                    cnt++;
                }

            firstOutputNode = cnt;
            for (var i = 0; i < OutputNodesCount; i++)
            {
                nodes[cnt] = new BackPropagationOutputNode(LearningRate, momentum);
                cnt++;
            }

            for (var i = 0; i < LinksCount; i++)
                links[i] = CreateLink();
            cnt = 0;
            var l1 = 0;
            var l2 = firstMiddleNode;
            for (var i = 0; i < (layersCount - 1); i++)
            {
                for (var j = 0; j < nodesInLayer[i + 1]; j++)
                    for (var k = 0; k < nodesInLayer[i]; k++)
                    {
                        nodes[l1 + k].LinkTo(nodes[l2 + j], links[cnt]);
                        cnt++;
                    }
                l1 = l2;
                l2 += nodesInLayer[i + 1];
            }
        }