コード例 #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            Bitmap bitmap = new Bitmap(@"data\\mnist\\2_58.bmp");

            this.pictureBox1.Image = bitmap;


            BoltzmannPattern pattern = new BoltzmannPattern();

            pattern.InputNeurons = bitmap.Width * bitmap.Height;
            BasicNetwork   network = pattern.Generate();
            BoltzmannLogic logic   = (BoltzmannLogic)network.Logic;

            //CreateCities();
            CalculateWeights(network);
        }
コード例 #2
0
        public void Execute(IExampleInterface app)
        {
            this.app = app;
            var pattern = new BoltzmannPattern();

            pattern.InputNeurons = NEURON_COUNT;
            var network = (BoltzmannMachine)pattern.Generate();

            CreateCities();
            CalculateWeights(network);

            network.Temperature = 100;
            do
            {
                network.EstablishEquilibrium();
                app.WriteLine(network.Temperature + " : " + DisplayTour(network.CurrentState));
                network.DecreaseTemperature(0.99);
            } while (!IsValidTour(network.CurrentState));

            app.WriteLine("Final Length: " + LengthOfTour(network.CurrentState));
        }