예제 #1
0
 private void buttonClassify_Click(object sender, EventArgs e)
 {
     if (textBoxPath.Text != null)
     {
         ReadData.readUserData(textBoxPath.Text, Convert.ToInt32(outputNumText.Text), Convert.ToDouble(textBoxLearningRate.Text));
         MessageBox.Show("Data has been compressed in 'Compressed User images.txt'\n PCA weights has also been stored in PCA User weights in release folder. ");
     }
 }
예제 #2
0
 private void buttonClassify_Click(object sender, EventArgs e)
 {
     if (image != null)
     {
         Neural_Network pretrainedNN = new Neural_Network();
         image           = new Bitmap(image, 50, 50);
         double[,] input = ImageProcessing.imageToGrayscale(image);
         ReadData.normalizeImage(ref input);
         PCA pca = new PCA();
         pca.readPretrainedWeights();
         input = Utilities.addBias(pca.compress(input));
         textBoxClassification.Text = pretrainedNN.classify(input);
     }
     else
     {
         MessageBox.Show("Enter picture first");
     }
 }
        private void buttonTrain_Click(object sender, EventArgs e)
        {
            if (radioButtonAll.Checked)
            {
                ReadData.readCompressedData();
            }
            else
            {
                ReadData.readSmallCompressedData();
            }
            RadialBasisNet             RB = new RadialBasisNet();
            Tuple <double, double[, ]> t  = RB.train(Convert.ToInt32(textBoxLayers.Text), Convert.ToInt32(textBoxNum_Iteraions.Text), Convert.ToDouble(textBoxEta.Text));
            ConfusionMatrix            CM = new ConfusionMatrix();

            CM.fillMatrix(t.Item2);
            textBoxAccuracy.Text = t.Item1.ToString() + '%';
            CM.Show();
        }