private void MainForm_Load(object sender, EventArgs e) { loading = true; Brain = new Brain(28 * 28, 10, 3, 16, -0.5F, 0.5F, false, Neuron.ReLU); Brain = new Brain(new FileStream(@"network.brainStream", FileMode.Open), Neuron.ReLU);//new Brain(File.ReadAllText(@"network.brain"),28 * 28, 10, 3, 16); Thread loadThread = new Thread(new ThreadStart(loadData)); loadThread.Start(); trainingActive = true; void loadData() { if (trainingActive) { trainingAmount = 60000; Images = ParseDatabase.ParseImages(@"train-images.idx3-ubyte", trainingAmount); Labels = ParseDatabase.ParseLabels(@"train-labels.idx1-ubyte", trainingAmount); } else { trainingAmount = 10000; Images = ParseDatabase.ParseImages(@"t10k-images.idx3-ubyte", trainingAmount); Labels = ParseDatabase.ParseLabels(@"t10k-labels.idx1-ubyte", trainingAmount); } loading = false; } }
private void MainForm_Load(object sender, EventArgs e) { loading = true; Brain = new Brain(28 * 28, 10, 2, 16); Thread loadThread = new Thread(new ThreadStart(loadData)); loadThread.Start(); void loadData() { Images = ParseDatabase.ParseImages(@"train-images-idx3-ubyte"); Labels = ParseDatabase.ParseLabels(@"train-labels-idx1-ubyte"); loading = false; } }