Пример #1
0
        /// <summary>
        /// Constructs a new AnnDialog.
        /// </summary>
        public AnnDialog(ref Klu Klu)
        {
            InitializeComponent();

            _Klu = Klu;

            #region Initialize ANN stuff
            _ANN = new ANN();
            _ANN.NumLayers = 3;
            _ANN.SetNumNeurons(0, 38);
            _ANN.SetNumNeurons(1, 6);
            _ANN.SetNumNeurons(2, 7);

            // Bind certain labels to ANN stuff
            AnnNumLayers.DataContext = _ANN;

            // Bind DataGrid to ANN-DataSet now
            _DataSet = new DataSet("HiddenLayer");
            _DataSet.Tables.Add("HiddenLayerTable");
            uint tmp = 0;
            _DataSet.Tables[0].Columns.Add("Neurons", tmp.GetType());
            tmp = 6;
            _DataSet.Tables[0].Rows.Add(tmp);
            HiddenLayerDataGrid.DataContext = _DataSet.Tables[0];
            #endregion
        }
        public TrainingDialog(ref TrainingDataSet dataSet)
        {
            InitializeComponent();

            _BackgroundWorker = new BackgroundWorker();
            _BackgroundWorker.WorkerReportsProgress = true;
            _BackgroundWorker.WorkerSupportsCancellation = true;
            _BackgroundWorker.DoWork += new DoWorkEventHandler(DoWork);
            _BackgroundWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(RunWorkerCompleted);
            _BackgroundWorker.ProgressChanged += new ProgressChangedEventHandler(ProgressChanged);        

            _DataSet = dataSet;

             _Chart = new Chart();
            windowsFormsHost1.Child = _Chart;

            _Series = 0;

            StopButton.IsEnabled = false;
        
            _Network = new ActivationNetwork(
                new SigmoidFunction(),
                _NumInputNeurons,
                9,
                _NumOutputNeurons
            );

            #region Initialize ANN stuff
            _ANN = new ANN();
            _ANN.NumLayers = 3;
            _ANN.SetNumNeurons(0, _NumInputNeurons);
            _ANN.SetNumNeurons(1, 9);
            _ANN.SetNumNeurons(2, _NumOutputNeurons);

            // Bind DataGrid to ANN-DataSet now
            _DataSetANN = new DataSet("HiddenLayer");
            _DataSetANN.Tables.Add("HiddenLayerTable");
            uint tmp = 9;
            _DataSetANN.Tables[0].Columns.Add("Neurons", tmp.GetType());
            _DataSetANN.Tables[0].Rows.Add(tmp);
            HiddenLayerDataGrid.DataContext = _DataSetANN.Tables[0];
            #endregion
        }