public ClassifyForm() { ReadData.readData(); pretrainedNN = new Neural_Network(); int[] layers = new int[4]; layers[0] = 4; layers[1] = 3; layers[2] = 4; layers[3] = 3; pretrainedNN.train(layers, 1000, 0.1); InitializeComponent(); }
private void buttonTrain_Click(object sender, EventArgs e) { char[] delimiterChars = { ' ' }; string[] words = textBoxLayers.Text.Split(delimiterChars); List <int> layersList = new List <int>(); layersList.Add(4); for (int i = 0; i < words.Length; i++) { if (words[i] != "") { layersList.Add(Convert.ToInt32(words[i])); } } layersList.Add(3); int[] layers = layersList.ToArray(); Neural_Network NN = new Neural_Network(); Tuple <double, double[, ]> t = NN.train(layers, Convert.ToInt32(textBoxNum_Iteraions.Text), Convert.ToDouble(textBoxEta.Text)); ConfusionMatrix CM = new ConfusionMatrix(); CM.fillMatrix(t.Item2); textBoxAccuracy.Text = t.Item1.ToString() + '%'; CM.Show(); }