示例#1
0
        private void Execute_Epoch(int epoch)
        {
            double k = ComputeLearningFactor(epoch);

            for (int i = 0; i < sourceData.Count; i++)
            {
                // Best match is found attending to Euclidean distance

                int label = lh.getIndex(i);

                int[] bestMatch = FindBestMatch(sourceData[i], label);

                // The cell is labelled and it's neightbours modified

                if (bestMatch[0] == -1)
                {
                    MessageBox.Show("No available cell found");

                    return;
                }

                map[bestMatch[0], bestMatch[1]].setIndex(label);


                ModifyMap(bestMatch, sourceData[i], epoch, k, label);

                Console.WriteLine(epoch + " " + i);
                //Console.WriteLine(bestMatch[0] + " " + bestMatch[1]);
                //Console.WriteLine();
            }
        }