コード例 #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");
 }
コード例 #2
0
        private void RBFbtn_Click(object sender, EventArgs e)
        {
            string DataSetPath              = "A:\\Work\\FCIS\\Years\\4\\Terms\\2\\Neural Networks\\Project\\Dataset\\";
            int    HiddenLayerSize          = 0;
            int    Epochs                   = 0;
            double Eta                      = 0;
            double MeanSquareErrorThreshold = 0;

            try
            {
                HiddenLayerSize          = Convert.ToInt32(HiddenLayerSizetxt.Text);
                Epochs                   = Convert.ToInt32(epochs.Text);
                Eta                      = Convert.ToDouble(eta.Text);
                MeanSquareErrorThreshold = Convert.ToDouble(MeanSquareErrorThresholdtxt.Text);
            }
            catch (Exception Ex)
            {
                MessageBox.Show(Ex.ToString());
            }

            RBF = new RadialBasisFunction(HiddenLayerSize, Epochs, Eta, MeanSquareErrorThreshold, DataSetPath);
            RBF.Train();
            RBF.Test();

            for (int i = 0; i < 4; ++i)
            {
                for (int j = 0; j < 4; ++j)
                {
                    confusionMatrix.Rows[i].Cells[j].Value = RBF.ConfusionMatrix[i][j];
                }
            }

            accuracy.Text = RBF.Accuracy.ToString();

            methodSelected = false;
        }