Esempio n. 1
0
        private void загрузитьОбучающиеДанныеToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (openImageDialog.ShowDialog() == DialogResult.OK)
            {
                string path = openImageDialog.FileName;
                path = path.Replace("\\" + openImageDialog.SafeFileName, "");
                path = path.Replace("\\" + path.Split('\\').Last(), "");

                NetworkData.train = new BitmapCatEnumerator(path, NetworkData.image_size);

                var pair = NetworkData.train.GetRandom(ref NetworkData.network);
                pictureBox1.Image = ImageDataConverter.GetImage(pair.Key.ConvertToRGD());
            }
        }
Esempio n. 2
0
        private void начатьToolStripMenuItem_Click(object sender, EventArgs e)
        {
            train_index = 0;
            if (NetworkData.optimizer == null)
            {
                MessageBox.Show("Не выбран оптимизатор", "Ошибка");
                return;
            }

            var pair = NetworkData.train.GetRandom(ref NetworkData.network);

            pictureBox1.Image = ImageDataConverter.GetImage(pair.Key.ConvertToRGD());
            test_arr          = pair.Key;
            test_res          = pair.Value;

            NetworkData.optimizer.TrainBatch(NetworkData.train, 16, 1);
            StartTrain();
            timer1.Start();
        }
        public PretrainMaster()
        {
            InitializeComponent();

            Network network = NetworkData.network;

            for (int i = 0; i < network.layers.Count; i++)
            {
                listBox1.Items.Add(network.layers[i].GetType().Name + " {" + network.layers[i].output_size[0] + ","
                                   + network.layers[i].output_size[1] + "," + network.layers[i].output_size[2] + "}");
            }

            test_arr = NetworkData.train.GetRandom(ref network).Key;
            base_arr = test_arr;
            testImg  = ImageDataConverter.GetImage(test_arr.ConvertToRGD());
            //pictureBox1.Image = testImg;

            pretrain = new FullConPretrain(ref NetworkData.network);
        }