Esempio n. 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            Settings settings = new Settings();

            if (mlp == null)
            {
                mlp = new Network.MLP(settings);
            }
            else
            {
                mlp.Epoch = 0; // trong trường hợp đã có mạng sẵn và nạp lại từ file FileSave.data -- mục đích để cho huấn luyện tiếp nếu Sai số của mạng chưa nhỏ hơn sai số cho phép
                //mlp.CreateNew_errorEachEpoch_errorOnValidation();
                //private List<double> _errorEachEpoch;
                //private List<double> _errorOnValidation;
                // còn 2 cái này thì tôi thấy nên cho khởi tạo lại (new List) -- do khi đọc từ file thì _errorEachEpoch _errorOnValidation đc nạp lại => xóa đi để lưu lại cái mới khi cho huấn luyện tiếp

            }
            s = new Stopwatch();
            Thread thr = new Thread(new ThreadStart(MLPExecute));
            thr.IsBackground = true;
            thr.Start();

            System.Windows.Forms.Timer tm = new System.Windows.Forms.Timer();
            tm.Interval = 10;
            tm.Tick += (o, ev) => { UpdateUI(mlp.Error, mlp.Epoch,0/*mlp.ValidationError*/); };
            tm.Start();
        }
 private void fStatistical_Load(object sender, EventArgs e)
 {
     try
     {
         FileStream fs = new FileStream("TrainedData.bin", FileMode.OpenOrCreate, FileAccess.ReadWrite);
         BinaryFormatter bf = new BinaryFormatter();
         mlp = (MLP.Network.MLP)bf.Deserialize(fs);
         fs.Close();
         MessageBox.Show("Loaded MLP");
     }
     catch (Exception ex) { MessageBox.Show("Error"); }
 }
 private void Training()
 {
     MLP.Network.MLP mlp = new MLP.Network.MLP(settings);
     //mlp.Training()
 }
Esempio n. 4
0
 private void loadToolStripMenuItem_Click(object sender, EventArgs e)
 {
     try
     {
         FileStream fs = new FileStream("TrainedData.bin", FileMode.OpenOrCreate, FileAccess.ReadWrite);
         BinaryFormatter bf = new BinaryFormatter();
         mlp = (MLP.Network.MLP)bf.Deserialize(fs);
         fs.Close();
         MessageBox.Show("Loaded");
     }
     catch (Exception ex) { }
 }