コード例 #1
0
        public NeuroNetSolvingWindow(NeuroNet net)
        {
            InitializeComponent();

            currentNet = net;

            inputs = new List<Tuple<Label, TextBox>>();
            outputs = new List<Tuple<Label, TextBox>>();
            for (int i = 0; i < net.InputNeuronsCount; i++)
            {
                Label lb = new Label();
                lb.Text = "x[" + i + "]=";
                lb.Location = new Point(15, 17 + i * 25);
                lb.Size = new Size(lb.Text.Length * 8, 20);
                gbInputs.Controls.Add(lb);

                TextBox tb = new TextBox();
                tb.Text = "0,0";
                tb.Location = new Point(lb.Text.Length * 10 + 5, 15 + i * 25);
                tb.Size = new Size(100, 20);
                gbInputs.Controls.Add(tb);

                inputs.Add(new Tuple<Label, TextBox>(lb, tb));
            }
            for (int i = 0; i < net.OutputNeuronsCount; i++)
            {
                Label lb = new Label();
                lb.Text = "y[" + i + "]=";
                lb.Location = new Point(15, 17 + i * 25);
                lb.Size = new Size(lb.Text.Length * 8, 20);
                gbOutputs.Controls.Add(lb);

                TextBox tb = new TextBox();
                tb.Text = "0,0";
                tb.Location = new Point(lb.Text.Length * 10 + 5, 15 + i * 25);
                tb.Size = new Size(100, 20);
                gbOutputs.Controls.Add(tb);

                outputs.Add(new Tuple<Label, TextBox>(lb, tb));
            }
        }
コード例 #2
0
        private void btnUse_Click(object sender, EventArgs e)
        {
            int countInputNeurons = dbHandler.SelectCountInputParametersInTask(lbTaskSelected.Text);
            int countOutputNeurons = 1;
            ActivateFunction af = LibraryOfActivateFunctions.
                GetActivateFunction(dbHandler.SelectActivateFunctionTypeByNeuroNet(lbNetSelected.Text),
                LibraryOfActivateFunctions.GetterParameter.TypeOfActivateFunctionName);
            List<double> valuesOfParametersAF = dbHandler.SelectValuesOfParametersOfAF(lbNetSelected.Text);
            int k = 0;
            foreach (double item in valuesOfParametersAF)
            {
                af.SetValueOfParameter(k, item);
                k++;
            }

            int countNeurons = dbHandler.SelectCountNeuronsInNet(lbNetSelected.Text);
            bool[,] connections = new bool[countNeurons, countNeurons];
            double[,] weights = new double[countNeurons, countNeurons];
            List<Tuple<int, int, double>> ls = dbHandler.SelectLearnedTopology(lbNetSelected.Text,
                lbSelSelected.Text, LearningAlgorithmsLibrary.GetNameOfTypeOfAlgoritm(lbLASelected.Text));
            for (int i = 0; i < countNeurons; i++)
            {
                for (int j = 0; j < countNeurons; j++)
                {
                    connections[i, j] = false;
                    weights[i, j] = 0.0;
                }
            }
            foreach (Tuple<int, int, double> item in ls)
            {
                connections[item.Item2, item.Item1] = true;
                weights[item.Item2, item.Item1] = item.Item3;
            }
            int[] neuronsInLayers = dbHandler.SelectNeuronsInLayers(lbNetSelected.Text);
            NeuroNet net = new NeuroNet(countInputNeurons, countOutputNeurons, neuronsInLayers, connections, weights, af);

            NeuroNetSolvingWindow solvingWnd = new NeuroNetSolvingWindow(net);
            solvingWnd.Show();
        }
コード例 #3
0
 public NeuroNetLearningInterface(NeuroNet net, string _neuroNetName, string _selectionName)
 {
     learned_net   = net;
     netName       = _neuroNetName;
     selectionName = _selectionName;
 }
コード例 #4
0
 public NeuroNetLearningInterface(NeuroNet net, string _neuroNetName, string _selectionName)
 {
     learned_net = net;
     netName = _neuroNetName;
     selectionName = _selectionName;
 }