Esempio n. 1
0
 public void Bind(NeuronNetwork nn)
 {
     _nn = nn;
 }
Esempio n. 2
0
        private void OpenClick(object sender, EventArgs e)
        {
            var openFileDialog1 = new OpenFileDialog();

            openFileDialog1.InitialDirectory = Utilities.NeuronNetworkDirectory;
            openFileDialog1.Filter = @"nn files (*.xml)|*.xml";
            openFileDialog1.FilterIndex = 2;
            openFileDialog1.RestoreDirectory = true;

            if (openFileDialog1.ShowDialog() == DialogResult.OK)
            {
                try
                {
                    ClearDisplay();
                    _nn = NeuronNetwork.MakeFromXmlFile(openFileDialog1.FileName) ;
                    _tbNumberOfSynapses.Text = _nn.NumberOfSynapses.ToString();
                    _tbEpoch.Text = "";
                    _tbErrorFactor.Text = "";
                    _tbMinErrorSoFar.Text = "";
                    LoadRaces();
                    UpdateScreen();
                    _neuralNetworkCtrl.Invalidate();
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }
        }
Esempio n. 3
0
 private void CreateNeuralNetworkForImprovementSelection()
 {
     const int pps = 4;
     _nn = NeuronNetwork.Make(new ChooseBetweenFirstAndSecondFavoriteNeuronNetworkConstructor() {NumberOfPastPerformances = pps}) as DetectImprovementNeuronNetwork;
     _nn.AddHiddenLayer(_nn.Layers.ToList()[0].Neurons.Count()/2);
        // _nn.AddHiddenLayer(5);
     _nn.AddOutputLayer();
     _neuralNetworkCtrl.Bind(_nn);
     LoadRacesForImprovementSelection();
     _neuralNetworkCtrl.Invalidate();
     ClearDisplay();
     UpdateScreen();
 }
Esempio n. 4
0
 private void CreateNeuralNetworkForWinnerSelection()
 {
     const int fieldSize =6;
     const int numberOfPP =3;
     _nn = NeuronNetwork.Make(new DetectWinnerNeuronNetworkConstructor() { FieldSize = fieldSize, NumberOfPastPerformancesToUse = numberOfPP }) as DetectWinnerNeuronNetwork;
     _nn.AddHiddenLayer(8);
     _nn.AddOutputLayer();
     _neuralNetworkCtrl.Bind(_nn);
     LoadRaces();
     _neuralNetworkCtrl.Invalidate();
     ClearDisplay();
     UpdateScreen();
 }
Esempio n. 5
0
        private void ChooseBetweenFirstAndSecondFavorite()
        {
            _nn = NeuronNetwork.Make(new ChooseBetweenFirstAndSecondFavoriteNeuronNetworkConstructor() { NumberOfPastPerformances = 3 }) as ChooseBetweenFirstAndSecondFavoriteNeuronNetwork;
            //_nn.AddHiddenLayer(2*_nn.Layers.ToList()[0].Neurons.Count() +1);

            _nn.AddHiddenLayer(_nn.Layers.ToList()[0].Neurons.Count() /2);

            _nn.AddOutputLayer();
            _neuralNetworkCtrl.Bind(_nn);
            ChooseBetweenFirstAndSecondFavoriteSelection();
            _neuralNetworkCtrl.Invalidate();
            ClearDisplay();
            UpdateScreen();
        }