コード例 #1
0
        /// <summary>
        /// Creat new index values for the network.
        /// </summary>
        ///
        private void ReindexNetwork()
        {
            FlatNetwork flat = _network.Structure.Flat;

            int neuronCount = 0;
            int weightCount = 0;

            for (int i = 0; i < flat.LayerCounts.Length; i++)
            {
                if (i > 0)
                {
                    int from = flat.LayerFeedCounts[i - 1];
                    int to   = flat.LayerCounts[i];
                    weightCount += from * to;
                }
                flat.LayerIndex[i]  = neuronCount;
                flat.WeightIndex[i] = weightCount;
                neuronCount        += flat.LayerCounts[i];
            }

            flat.LayerOutput = new double[neuronCount];
            flat.LayerSums   = new double[neuronCount];
            flat.ClearContext();

            flat.InputCount  = flat.LayerFeedCounts[flat.LayerCounts.Length - 1];
            flat.OutputCount = flat.LayerFeedCounts[0];
        }