Beispiel #1
0
        void DrawNetwork()
        {
            int hidden_layers = NN.HiddenLayers.Count;

            panelNetwork.Size = new Size((hidden_layers + 4) * 100 + (hidden_layers + 1) * 50, 100);

            Point P = new Point(0, 0);

            panelNetwork.Controls.Clear();
            PictureBox picInput = new PictureBox();

            picInput.Size  = new System.Drawing.Size(100, 100);
            picInput.Image = global::BackPropagationNetwork.Properties.Resources.Input;
            panelNetwork.Controls.Add(picInput);
            picInput.Location = P;
            P.X += 100;
            Layer        current = NN.InputLayer;
            LayerControl lcInput = new LayerControl();

            lcInput.Layer = NN.InputLayer;
            panelNetwork.Controls.Add(lcInput);
            lcInput.Location = P;
            P.X += 100;
            SynapsesControl sc1 = new SynapsesControl(NN, current, current.NextLayer);

            panelNetwork.Controls.Add(sc1);
            sc1.Location = P;
            P.X         += 50;
            current      = current.NextLayer;
            for (int i = 0; i < hidden_layers; i++)
            {
                LayerControl lc = new LayerControl();
                lc.Layer = NN.HiddenLayers[i];
                panelNetwork.Controls.Add(lc);
                lc.Location = P;
                P.X        += 100;

                SynapsesControl sc = new SynapsesControl(NN, current, current.NextLayer);
                panelNetwork.Controls.Add(sc);
                sc.Location = P;
                P.X        += 50;
                current     = current.NextLayer;
            }

            LayerControl lcOutput = new LayerControl();

            lcOutput.Layer = NN.OutputLayer;
            panelNetwork.Controls.Add(lcOutput);
            lcOutput.Location = P;
            P.X += 100;

            PictureBox picOutput = new PictureBox();

            picOutput.Size  = new Size(100, 100);
            picOutput.Image = global::BackPropagationNetwork.Properties.Resources.Output;
            panelNetwork.Controls.Add(picOutput);
            picOutput.Location = P;
        }
Beispiel #2
0
        void DrawNetwork()
        {
            int hidden_layers = NN.HiddenLayers.Count;
            panelNetwork.Size = new Size((hidden_layers + 4) * 100 + (hidden_layers + 1) * 50, 100);

            Point P = new Point(0, 0);
            panelNetwork.Controls.Clear();
            PictureBox picInput = new PictureBox();
            picInput.Size = new System.Drawing.Size(100, 100);
            picInput.Image = global::BackPropagationNetwork.Properties.Resources.Input;
            panelNetwork.Controls.Add(picInput);
            picInput.Location = P;
            P.X += 100;
            Layer current = NN.InputLayer;
            LayerControl lcInput = new LayerControl();
            lcInput.Layer = NN.InputLayer;
            panelNetwork.Controls.Add(lcInput);
            lcInput.Location = P;
            P.X += 100;
            SynapsesControl sc1 = new SynapsesControl(NN, current, current.NextLayer);
            panelNetwork.Controls.Add(sc1);
            sc1.Location = P;
            P.X += 50;
            current = current.NextLayer;
            for (int i = 0; i < hidden_layers; i++)
            {
                LayerControl lc = new LayerControl();
                lc.Layer = NN.HiddenLayers[i];
                panelNetwork.Controls.Add(lc);
                lc.Location = P;
                P.X += 100;

                SynapsesControl sc = new SynapsesControl(NN, current, current.NextLayer);
                panelNetwork.Controls.Add(sc);
                sc.Location = P;
                P.X += 50;
                current = current.NextLayer;
            }

            LayerControl lcOutput = new LayerControl();
            lcOutput.Layer = NN.OutputLayer;
            panelNetwork.Controls.Add(lcOutput);
            lcOutput.Location = P;
            P.X += 100;

            PictureBox picOutput = new PictureBox();
            picOutput.Size = new Size(100, 100);
            picOutput.Image = global::BackPropagationNetwork.Properties.Resources.Output;
            panelNetwork.Controls.Add(picOutput);
            picOutput.Location = P;
        }