Exemple #1
0
 public void RBFNetType(object sender, EventArgs e)
 {
     loadSaveTasksForm.Net = net = new RBFNeuralNet();
     type     = NeuronNetType.RBF;
     this.Net = net;
     Refresh();
 }
Exemple #2
0
 public void ShuffleNetType(object sender, EventArgs e)
 {
     loadSaveTasksForm.Net = net = new LinearSystemTask();
     type     = NeuronNetType.SHUFFLE;
     this.Net = net;
     Refresh();
 }
Exemple #3
0
 public void HopfieldType(object sender, EventArgs e)
 {
     loadSaveTasksForm.Net = net = new HopfieldNeuronNet();
     type     = NeuronNetType.HOPFIELD;
     this.Net = net;
     Refresh();
 }
Exemple #4
0
 public void KohonenType(object sender, EventArgs e)
 {
     loadSaveTasksForm.Net = net = new KohonenNeuronNet();
     type     = NeuronNetType.KOHONEN;
     this.Net = net;
     Refresh();
 }
Exemple #5
0
 public void LinearNetType(object sender, EventArgs e)
 {
     loadSaveTasksForm.Net = net = new LinearNeuronNet();
     type     = NeuronNetType.LINEAR;
     this.Net = net;
     Refresh();
 }
Exemple #6
0
        private void ExportExcel(object sender, EventArgs e)
        {
            OpenFileDialog openDlg = new OpenFileDialog();

            openDlg.Filter = "CSV Files (.csv)| *.csv|All files (.)| *.";
            if (openDlg.ShowDialog() == DialogResult.OK)
            {
                File.Delete(@"NodeJS\test.json");
                Process.Start("cmd", @"/C cd " + Application.StartupPath + "/NodeJS & node ./csvtojson " + openDlg.FileName);
                Thread.Sleep(3000);
                string                 json        = File.ReadAllText(@"NodeJS\test.json");
                ITraceWriter           writer      = new MemoryTraceWriter();
                JsonSerializerSettings serSettings = new JsonSerializerSettings();
                serSettings.ReferenceLoopHandling = ReferenceLoopHandling.Ignore;
                serSettings.ContractResolver      = new CamelCasePropertyNamesContractResolver();
                serSettings.TraceWriter           = writer;

                //var neuronNet = JsonConvert.DeserializeObject<List<string>>(json.ToString(), serSettings);
                //var neuronNet = JsonConvert.DeserializeObject<List<NeuronNet>>(json.ToString(), serSettings);
                var test = JsonConvert.DeserializeObject <List <Root2> >(json.ToString(), serSettings);
                net = AcceptJson(test[0]);
                net.AccessChangeNet = true;
                //Console.WriteLine(writer);
            }
        }
Exemple #7
0
        public StudyPairModifier(List <StudyPair> pairs, NeuronNet net)
        {
            InitializeComponent();
            studyPairs = pairs;
            neuronNet  = net;

            ShowStudyPairs();
        }
Exemple #8
0
 public StudyFunctionForm(NeuronNet net)
 {
     InitializeComponent();
     this.net             = net;
     drawer               = new Drawer(pictureBox1, pictureBox1.ClientRectangle);
     drawer.GraphicBounds = new PointF(0, net.EraCount);
     drawer.AddGraphic(1, net.StudyFunction, "Расписание обучения", typeView.Line);
     drawer.Redraw();
 }
Exemple #9
0
 public NetOptions(NeuronNet Net)
 {
     InitializeComponent();
     net = Net;
     inputsCount.Value  = Net.InputsCount;
     groupsCount.Value  = Net.NeuronGroupsCount;
     groupNumber.Value  = 1;
     neuronsCount.Value = Net.NeuronGroups[0].Neurons.Count;
 }
Exemple #10
0
 //public RegressionForm(FunctionType type , LinearNeuronNet net)
 public RegressionForm(FunctionType type, NeuronNet net)
 {
     InitializeComponent();
     this.net     = net;
     this.type    = type;
     mainFunction = new Graphics3D.Function3D(1, Function3D);
     missFunction = new Graphics3D.Function3D(2, Function3DWithMiss);
     netFunction  = new Graphics3D.Function3D(3, Function3DNet);
     CreateVisualisationControl();
 }
Exemple #11
0
        private void DeserializeNet(object sender, EventArgs e)
        {
            BinaryFormatter bf      = new BinaryFormatter();
            OpenFileDialog  openDlg = new OpenFileDialog();

            if (openDlg.ShowDialog() == DialogResult.OK)
            {
                FileStream fs = new FileStream(openDlg.FileName, FileMode.Open, FileAccess.Read);
                Net = (NeuronNet)bf.Deserialize(fs);
                net.AccessChangeNet = true;
                fs.Close();
            }
        }
Exemple #12
0
        //Загрузка
        private void DeserializeNet(object sender, EventArgs e)
        {
            BinaryFormatter bf = new BinaryFormatter();
            //OpenFileDialog openDlg = new OpenFileDialog();
            LoadMenu loadMenu = new LoadMenu();

            loadMenu.indexSave = 0;
            loadMenu.ShowDialog();
            if (loadMenu.fileName != null)
            {
                string query = "select File from SaveFiles where Name=" + "\"" + loadMenu.fileName + "\"";
                databaseSQLite.OpenConnection();
                SQLiteCommand    myCommand = new SQLiteCommand(query, databaseSQLite.myConnection);
                List <SaveFiles> list      = new List <SaveFiles>();

                using (SQLiteDataReader reader = myCommand.ExecuteReader())
                {
                    if (reader.HasRows)       // если есть данные
                    {
                        while (reader.Read()) // построчно считываем данные
                        {
                            byte[]    data      = (byte[])reader.GetValue(0);
                            SaveFiles saveFile1 = new SaveFiles(data);
                            list.Add(saveFile1);
                        }
                    }
                }
                databaseSQLite.CloseConnection();
                using (FileStream fd = new FileStream("temp.dat", FileMode.OpenOrCreate))
                {
                    fd.Write(list[0].File, 0, list[0].File.Length);
                }

                FileStream fs = new FileStream("temp.dat", FileMode.Open, FileAccess.Read);
                Net = (NeuronNet)bf.Deserialize(fs);
                net.AccessChangeNet = true;
                fs.Close();
            }
        }
Exemple #13
0
 public ParameterListForm(NeuronNet net)
 {
     InitializeComponent();
     this.net = net;
     FillParameterGrid();
 }
Exemple #14
0
        private NeuronNet AcceptJson(Root2 root2)
        {
            NeuronNet net = new NeuronNet();

            for (int i = 0; i < root2.inputss.Count; i++)
            {
                PointF pointF = new PointF();
                pointF.X = (float)root2.inputss[i].Position.X;
                pointF.Y = (float)root2.inputss[i].Position.Y;
                NeuronInput neuron = new NeuronInput((float)root2.inputss[i].value, root2.inputss[i].Name, pointF);
                neuron.positionChanged = root2.inputss[i].positionChanged;
                neuron.wasPainted      = root2.inputss[i].wasPainted;
                net.inputss.Add(neuron);
            }
            for (int i = 0; i < root2.NeuronGroups.Count; i++)
            {
                NeuronGroup neurongroup = new NeuronGroup();
                neurongroup.Neurons              = root2.NeuronGroups[i].Neurons;
                neurongroup.SecondActivate       = root2.NeuronGroups[i].SecondActivate;
                neurongroup.SumForSoftMax        = (float)root2.NeuronGroups[i].SumForSoftMax;
                neurongroup.allNeuronsWasPainted = root2.NeuronGroups[i].allNeuronsWasPainted;
                net.NeuronGroups.Add(neurongroup);
            }
            for (int i = 0; i < root2.studyPairss.Count; i++)
            {
                StudyPair studyPair = new StudyPair();
                for (int j = 0; j < root2.studyPairss[i].inputs.Count; j++)
                {
                    studyPair.inputs.Add((float)root2.studyPairss[i].inputs[j]);
                }
                for (int j = 0; j < root2.studyPairss[i].quits.Count; j++)
                {
                    studyPair.quits.Add((float)root2.studyPairss[i].quits[j]);
                }
                for (int j = 0; j < root2.studyPairss[i].realQuits.Count; j++)
                {
                    studyPair.realQuits.Add((float)root2.studyPairss[i].realQuits[j]);
                }
                net.studyPairss.Add(studyPair);
            }
            net.E      = (float)root2.E;
            net.moment = (float)root2.moment;
            for (int i = 0; i < root2.errors.Count; i++)
            {
                PointF pointF = new PointF();
                pointF.X = (float)root2.errors[i].X;
                pointF.Y = (float)root2.errors[i].Y;
                net.errors.Add(pointF);
            }
            for (int i = 0; i < root2.normalizedErrors.Count; i++)
            {
                PointF pointF = new PointF();
                pointF.X = (float)root2.normalizedErrors[i].X;
                pointF.Y = (float)root2.normalizedErrors[i].Y;
                net.normalizedErrors.Add(pointF);
            }
            net.EraCount             = root2.EraCount;
            net.currentSelection     = new NeuronGroup(0);
            net.recognitionResults   = new List <RecognitionResult>();
            net.StudyPairsLoaded     = root2.StudyPairsLoaded;
            net.InputsSum            = (float)root2.InputsSum;
            net.allInputsWasPainted  = root2.allInputsWasPainted;
            net.minError             = (float)root2.minError;
            net.NormalizeOutputValue = (float)root2.NormalizeOutputValue;
            net.biasX           = (float[])root2.biasX;
            net.biasY           = (float[])root2.biasY;
            net.scaleX          = (float[])root2.scaleX;
            net.scaleY          = (float[])root2.scaleY;
            net.StudyLimit      = (float)root2.StudyLimit;
            net.AccessChangeNet = root2.AccessChangeNet;
            return(net);
        }