コード例 #1
0
ファイル: NeuroBAM.cs プロジェクト: Dylanjc10/Dylan-Clark
        /// <summary>
        ///     Overridden.Constucts the network topology.
        /// </summary>
        protected override void CreateNetwork()
        {
            nodes = new NeuroNode[NodesCount];
            links = new NeuroLink[LinksCount];
            for (var i = 0; i < InputNodesCount; i++)
            {
                nodes[i] = new BidirectionalAssociativeMemoryInputNode();
            }
            for (var i = InputNodesCount; i < InputNodesCount + OutputNodesCount; i++)
            {
                nodes[i] = new BidirectionalAssociativeMemoryOutputNode();
            }
            for (var i = 0; i < linksCount; i++)
            {
                links[i] = new BidirectionalAssociativeMemoryLink();
            }
            var k = 0;

            for (var i = 0; i < InputNodesCount; i++)
            {
                for (var j = InputNodesCount; j < InputNodesCount + OutputNodesCount; j++)
                {
                    nodes[i].LinkTo(nodes[j], links[k]);
                    k++;
                }
            }
        }
コード例 #2
0
ファイル: NeuroBAM.cs プロジェクト: Dylanjc10/Dylan-Clark
 /// <summary>
 ///     Overridden.Initializes network data after construction.
 /// </summary>
 protected override void CreateNetwork()
 {
     nodes               = new NeuroNode[0];
     links               = new NeuroLink[0];
     networksCount       = 0;
     orthogonalBAMEnergy = -inputLayerNodesCount * outputLayerNodesCount;
     bestError           = double.PositiveInfinity;
 }
コード例 #3
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];
            }
        }
コード例 #4
0
 /// <summary>
 ///     Overridden.Constructs network topology.
 /// </summary>
 /// <remarks>Creates nodes, links and connects nodes using created links.</remarks>
 protected override void CreateNetwork()
 {
     nodes = new NeuroNode[NodesCount];
     links = new NeuroLink[LinksCount];
     for (var i = 0; i < InputNodesCount; i++)
     {
         nodes[i] = new InputNode();
     }
     nodes[NodesCount - 2] = new BiasNode(1);
     nodes[NodesCount - 1] = new AdalineNode(LearningRate);
     for (var i = 0; i < LinksCount; i++)
     {
         links[i] = new AdalineLink();
     }
     for (var i = 0; i < LinksCount; i++)
     {
         nodes[i].LinkTo(nodes[NodesCount - 1], links[i]);
     }
 }
コード例 #5
0
 /// <summary>
 ///     Overridden.Constructs network topology.
 /// </summary>
 /// <remarks>Creates nodes, links and connects nodes using created links.</remarks>
 protected override void CreateNetwork()
 {
     nodes = new NeuroNode[NodesCount];
     links = new NeuroLink[LinksCount];
     for (var i = 0; i < InputNodesCount; i++)
         nodes[i] = new InputNode();
     nodes[NodesCount - 2] = new BiasNode(1);
     nodes[NodesCount - 1] = new AdalineNode(LearningRate);
     for (var i = 0; i < LinksCount; i++)
         links[i] = new AdalineLink();
     for (var i = 0; i < LinksCount; i++)
         nodes[i].LinkTo(nodes[NodesCount - 1], links[i]);
 }
コード例 #6
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];
            }
        }
コード例 #7
0
ファイル: NeuroSon.cs プロジェクト: AlexCherkasov/Neuro.NET
 /// <summary>
 ///     Overridden.Constructs network topology.
 /// </summary>
 protected override void CreateNetwork()
 {
     nodes = new NeuroNode[NodesCount];
     linksCount = NodesCount*rowsCount*columsCount;
     kohonenLayer = new NeuroNode[rowsCount, columsCount];
     links = new NeuroLink[LinksCount];
     for (var i = 0; i < NodesCount; i++)
         nodes[i] = new InputNode();
     var curr = 0;
     for (var row = 0; row < rowsCount; row++)
         for (var col = 0; col < columsCount; col++)
         {
             kohonenLayer[row, col] = new SelfOrganizingNode(learningRate);
             for (var i = 0; i < NodesCount; i++)
             {
                 links[curr] = new SelfOrganizingLink();
                 nodes[i].LinkTo(kohonenLayer[row, col], links[curr]);
                 curr++;
             }
         }
 }
コード例 #8
0
ファイル: NeuroBAM.cs プロジェクト: AlexCherkasov/Neuro.NET
 /// <summary>
 ///     Overridden.Initializes network data after construction.
 /// </summary>
 protected override void CreateNetwork()
 {
     nodes = new NeuroNode[0];
     links = new NeuroLink[0];
     networksCount = 0;
     orthogonalBAMEnergy = -inputLayerNodesCount*outputLayerNodesCount;
     bestError = double.PositiveInfinity;
 }
コード例 #9
0
ファイル: NeuroBAM.cs プロジェクト: AlexCherkasov/Neuro.NET
        /// <summary>
        ///     Overridden.Constucts the network topology.
        /// </summary>
        protected override void CreateNetwork()
        {
            nodes = new NeuroNode[NodesCount];
            links = new NeuroLink[LinksCount];
            for (var i = 0; i < InputNodesCount; i++)
                nodes[i] = new BidirectionalAssociativeMemoryInputNode();
            for (var i = InputNodesCount; i < InputNodesCount + OutputNodesCount; i++)
                nodes[i] = new BidirectionalAssociativeMemoryOutputNode();
            for (var i = 0; i < linksCount; i++)
                links[i] = new BidirectionalAssociativeMemoryLink();
            var k = 0;

            for (var i = 0; i < InputNodesCount; i++)
                for (var j = InputNodesCount; j < InputNodesCount + OutputNodesCount; j++)
                {
                    nodes[i].LinkTo(nodes[j], links[k]);
                    k++;
                }
        }