예제 #1
0
        static void Main(string[] args)
        {
            double[] steps = new double[4];
            steps[0] = 0.1 * 1 / (double)KWTA.N;
            steps[1] = 0.5 * 1 / (double)KWTA.N;
            steps[2] = 1.0 * 1 / (double)KWTA.N;
            steps[3] = 2.0 * 1 / (double)KWTA.N;
            double[] ext       = { 0.5, 1.5, 2.5, 3.5 };
            double   threshold = 0.1;

            for (int stepNum = 0; stepNum < 4; stepNum++)
            {
                for (int extNum = 2; extNum < 3; extNum++)
                {
                    KWTA c1 = new KWTA(ext[extNum], steps[stepNum], threshold);
                    Console.Out.WriteLine("Input:");
                    c1.printInput();
                    Console.Out.WriteLine("Initial Activations:");
                    c1.printActivations();
                    Console.Out.WriteLine("Output: ");
                    //int numIterations = c1.cool();
                    int numIterations = c1.converge();
                    c1.printActivations();
                    Console.Out.WriteLine("step: " + steps[stepNum] +
                                          " input: " + ext[extNum] +
                                          " energy: " + c1.energy() +
                                          " iterations: " + numIterations);
                    Console.Out.WriteLine();
                    Console.Out.WriteLine();
                }
                Console.Out.WriteLine();
            }
        }
예제 #2
0
        public GraphDisplay()
        {
            InitializeComponent();

            const int N = 20;

            double[] steps = new double[4];
            steps[0] = 0.1 * 1 / (double)N;
            steps[1] = 0.5 * 1 / (double)N;
            steps[2] = 1.0 * 1 / (double)N;
            steps[3] = 2.0 * 1 / (double)N;

            double[] ext = { 0.5, 1.5, 2.5, 3.5 };

            for (int stepNum = 0; stepNum < 4; stepNum++)
            {
                for (int extNum = 2; extNum < 3; extNum++)
                {
                    KWTA c1            = new KWTA(ext[extNum], steps[stepNum], 0.01);
                    int  numIterations = c1.converge();
                    energyHistories.Add(c1.getEnergyHistory());
                    numIterationsList.Enqueue(numIterations);
                }
            }
        }
예제 #3
0
파일: TextDriver.cs 프로젝트: croeder/Misc
        static void Main(string[] args)
        {
            double[] steps = new double[4];
            steps[0] = 0.1 * 1/(double) KWTA.N;
            steps[1] = 0.5 * 1/(double) KWTA.N;
            steps[2] = 1.0 * 1/(double) KWTA.N;
            steps[3] = 2.0 * 1/(double) KWTA.N;
            double[] ext = { 0.5, 1.5, 2.5, 3.5};
            double threshold=0.1;

            for (int stepNum=0; stepNum<4; stepNum++)
            {
                for (int extNum=2; extNum<3; extNum++)
                {
                    KWTA c1 = new KWTA(ext[extNum], steps[stepNum], threshold);
                    Console.Out.WriteLine("Input:");
                    c1.printInput();
                    Console.Out.WriteLine("Initial Activations:");
                    c1.printActivations();
                    Console.Out.WriteLine("Output: ");
                    //int numIterations = c1.cool();
                    int numIterations = c1.converge();
                    c1.printActivations();
                    Console.Out.WriteLine("step: "        + steps[stepNum] +
                        " input: "      + ext[extNum] +
                        " energy: "     + c1.energy() +
                        " iterations: " + numIterations);
                    Console.Out.WriteLine();
                    Console.Out.WriteLine();
                }
                Console.Out.WriteLine();
            }
        }
예제 #4
0
        public GraphDisplay()
        {
            InitializeComponent();

            const int N=20;
            double[] steps = new double[4];
            steps[0] = 0.1 * 1/(double) N;
            steps[1] = 0.5 * 1/(double) N;
            steps[2] = 1.0 * 1/(double) N;
            steps[3] = 2.0 * 1/(double) N;

            double[] ext = { 0.5, 1.5, 2.5, 3.5};

            for (int stepNum=0; stepNum<4; stepNum++)
            {
                for (int extNum=2; extNum<3; extNum++)
                {
                    KWTA c1 = new KWTA(ext[extNum], steps[stepNum], 0.01);
                    int numIterations = c1.converge();
                    energyHistories.Add(c1.getEnergyHistory());
                    numIterationsList.Enqueue(numIterations);
                }
            }
        }