Пример #1
0
        public unsafe void shw(NeuronDotNet.Core.Backpropagation.BackpropagationNetwork net)
        {
            plat = new Bitmap(Width, Height);
            List <HeatPoint> pt = new List <HeatPoint>();
            int x  = 0;
            int y  = 0;
            int mh = 0;

            while (true)
            {
                mh += 1;
                if (y > Height)
                {
                    break;
                }
                if (x > Width)
                {
                    x  = 0;
                    y += 20;
                    continue;
                }
                double dbl = net.Run(new double[] { (double)x / ((double)Width), (double)y / ((double)Height) })[0];
                if (dbl < 0.5)
                {
                    pt.Add(new HeatPoint(x, y, (byte)(190 + (int)((dbl * 5.00) * 30))));
                }
                x += 20;
            }

            Heatmap hm = new Heatmap();

            hm.CreateIntensityMask(plat, pt);
            plat = Heatmap.Colorize(plat, 255);
            Invalidate();
        }
Пример #2
0
        private void test2d_Load(object sender, EventArgs e)
        {
            SetDoubleBuffered(panel1);
            this.DoubleBuffered = true;
            this.SetStyle(ControlStyles.UserPaint |
                          ControlStyles.AllPaintingInWmPaint |
                          ControlStyles.ResizeRedraw |
                          ControlStyles.ContainerControl |
                          ControlStyles.OptimizedDoubleBuffer |
                          ControlStyles.SupportsTransparentBackColor
                          , true);
            this.UpdateStyles();
            plat = new Bitmap(Width, Height);
            List <HeatPoint> pt = new List <HeatPoint>();
            int x  = 0;
            int y  = 0;
            int mh = 0;

            while (true)
            {
                mh += 1;
                if (y > panel1.Height)
                {
                    break;
                }
                if (x > panel1.Width)
                {
                    x  = 0;
                    y += 9;
                    continue;
                }
                if (network.Run(new double[] { (double)x / (double)Width, (double)y / (double)Height })[0] < 0.5)
                {
                    pt.Add(new HeatPoint(x, y, 70));
                }
                x += 9;
            }

            Heatmap hm = new Heatmap();

            hm.CreateIntensityMask(plat, pt);
            plat = Heatmap.Colorize(plat, 255);
        }