Ejemplo n.º 1
0
 public Test(MultilayerPerceptron MLP, RadialBasisFunction RBF, bool MethodSelected)
 {
     InitializeComponent();
     this.MLP            = MLP;
     this.RBF            = RBF;
     this.MethodSelected = MethodSelected;
     Output     = new Dictionary <int, string>();
     Output[0]  = "Closing";
     Output[1]  = "Down";
     Output[2]  = "Front";
     Output[3]  = "Left";
     theProcess = new ProcessStartInfo("mspaint.exe");
 }
Ejemplo n.º 2
0
        private void mlpButton_Click(object sender, EventArgs e)
        {
            string DataSetPath = "A:\\Work\\FCIS\\Years\\4\\Terms\\2\\Neural Networks\\Project\\Dataset\\";
            int    Epochs      = 0;
            double Eta         = 0;

            try
            {
                Epochs = Convert.ToInt32(epochs.Text);
                Eta    = Convert.ToDouble(eta.Text);
            }
            catch (Exception Ex)
            {
                MessageBox.Show(Ex.ToString());
            }
            BLP = new MultilayerPerceptron(Epochs, Eta, DataSetPath);
            BLP.Train();
            double Accuracy = BLP.Test();

            accuracy.Text = Accuracy.ToString();

            for (int i = 0; i < 4; i++)
            {
                confusionMatrix.Rows[0].Cells[i].Value = BLP.ClosingCount[i];
            }
            for (int i = 0; i < 4; i++)
            {
                confusionMatrix.Rows[1].Cells[i].Value = BLP.DownCount[i];
            }
            for (int i = 0; i < 4; i++)
            {
                confusionMatrix.Rows[2].Cells[i].Value = BLP.FrontCount[i];
            }
            for (int i = 0; i < 4; i++)
            {
                confusionMatrix.Rows[3].Cells[i].Value = BLP.LeftCount[i];
            }

            methodSelected = true;
        }