private void onClickTrainingButton(object sender, EventArgs e) { numOfEpochs = int.Parse(txtEpochs.Text); Eta = double.Parse(txtbxEta.Text); if (MLPFlag) { for (int i = 0; i < numOfHiddenLayers; i++) { lstNeuronsPerEachHiddenLayer.Add(int.Parse(grvNumOfNeuronsPerEachLayers.Rows[i].Cells[0].Value.ToString())); } //no Read Data From the Saved File tryM = new MLP(Eta, numOfEpochs, chbxBias.Checked, lstNeuronsPerEachHiddenLayer, false); tryM.TrainingData(); } else if (RBFFlag) { numOfClusters = int.Parse(txtCenters.Text); KmeanThreshold = double.Parse(txtKmeanThreshold.Text); MseThreshold = double.Parse(txtMseThreshold.Text); RadialBF = new RBF(numOfClusters, KmeanThreshold); RadialBF.Kmean(); RadialBF.calculateVariance(); RadialBF.TransformedInputGaussian(); //no Read Data From the Saved File LeastMS = new LMS(Eta, numOfEpochs, MseThreshold, chbxBias.Checked, numOfClusters, RadialBF, false); LeastMS.TrainingData(); } }
private void btnTestOneSample_Click(object sender, EventArgs e) { #region OpenDialog openFileDialog1.ShowDialog(); string fn = openFileDialog1.FileName; Bitmap B = PGMUtil.ToBitmap(fn); pictureBox1.Image = (Image)B; int s = fn.LastIndexOf('\\') + 1; #endregion if (txtEpochs.Text == "") { if (RBFFlag) { RadialBF = new RBF(); LeastMS = new LMS(Eta, numOfEpochs, MseThreshold, chbxBias.Checked, numOfClusters, RadialBF, true); } else { tryM = new MLP(Eta, numOfEpochs, chbxBias.Checked, new List <int> { 4, 4, 4 }, true); } lblAccuracy.Text = "65"; } if (RBFFlag) { LeastMS.get_sample_test_info(fn.Substring(s).Replace(".pgm", ".pts")); lblActualResult.Text = LeastMS.TestingOnePicture(); } else { tryM.get_sample_test_info(fn.Substring(s).Replace(".pgm", ".pts")); lblActualResult.Text = tryM.Testing_Data_Sample(); } }