public static void UpdateInfo(ILPanel panel, Label currentIter, Label totalError, NeuralNetwork ann)
 {
     DrawFunctions(panel, ann);
     totalError.Invoke((Action) delegate
     {
         totalError.Text = ann.TotalError.ToString(CultureInfo.InvariantCulture);
         totalError.Update();
     });
     currentIter.Invoke((Action) delegate
     {
         currentIter.Text = ann.Iter.ToString(CultureInfo.InvariantCulture);
         currentIter.Update();
     });
 }
        private static void SetFuzzySets(Panel panel, NeuralNetwork ann)
        {
            foreach (TableLayoutPanel item in panel.Controls.OfType <TableLayoutPanel>())
            {
                panel.Controls.Remove(item);
            }

            panel.AutoScroll = true;
            panel.AutoSize   = false;

            TableLayoutPanel table = new TableLayoutPanel
            {
                Dock         = DockStyle.None,
                AutoSize     = true,
                AutoSizeMode = AutoSizeMode.GrowAndShrink,
                AutoScroll   = false
            };
            int numVariables = ann.Instance.NumVariables;
            int numRules     = ann.NumberOfRules;
            var columnCount  = numRules;
            int rowCount     = numVariables;

            IActivationFunction[] func = ann.GetFunctions <IActivationFunction>(0);
            double[] xValues           = new double[50];
            double[] yValues           = new double[50];
            for (int i = 0; i < 50; i++)
            {
                xValues[i] = -10 + (10.0 + 10.0) / 50.0 * i;
            }
            ILArray <float> xs = (double[])xValues.Clone();

            for (var i = 0; i < rowCount; i++)
            {
                table.RowCount++;
                table.RowStyles.Add(new RowStyle(SizeType.AutoSize));
                for (int j = 0; j < columnCount; j++)
                {
                    int     ruleId     = j + 1;
                    int     variableId = i + 1;
                    string  label      = "Rule " + ruleId + ", variable " + variableId;
                    ILPanel newPanel   = new ILPanel();
                    for (int k = 0; k < 50; k++)
                    {
                        yValues[k] = func[i * columnCount + j].ValueAt(xValues[k]);
                    }
                    ILArray <float> ys = (double[])yValues.Clone();
                    newPanel.Scene.Remove(newPanel.Scene.First <ILPlotCube>());
                    newPanel.Scene.Add(new ILPlotCube {
                        Children =
                        {
                            new ILLinePlot(xs, ys, lineWidth:2, lineColor:Color.Black)
                        }
                    });
                    newPanel.Scene.Screen.Add(new ILLabel(label)
                    {
                        Position = new Vector3(1, 0, 0),
                        Anchor   = new PointF(1, 0)
                    });
                    newPanel.Refresh();
                    table.ColumnCount++;
                    table.ColumnStyles.Add(new ColumnStyle(SizeType.AutoSize));
                    table.Controls.Add(newPanel, j, i);
                }
            }
            panel.Controls.Add(table);
            panel.Refresh();
        }
 public static void FillTrainChoices(ILPanel panel, Label currentIteration, Label totalError, TextBox rules, ComboBox backpropagationType, TextBox eta, TextBox desiredError, NeuralNetwork ann)
 {
     InitPanel(panel, ann);
     totalError.Text       = ann.TotalError.ToString(CultureInfo.InvariantCulture);
     rules.Text            = RulesDefault.ToString(CultureInfo.InvariantCulture);
     currentIteration.Text = ann.Iter.ToString(CultureInfo.InvariantCulture);
     FillTypeChoices(backpropagationType);
     eta.Text          = EtaDefault.ToString(CultureInfo.InvariantCulture);
     desiredError.Text = DesiredErrorDefault.ToString(CultureInfo.InvariantCulture);
 }