Exemple #1
0
 private void SetPlottingMethod(PartIIProblemType problemType)
 {
     if (problemType == PartIIProblemType.CTS)
     {
         plotAgainstInput = true;
     }
     else
     {
         plotAgainstInput = false;
     }
 }
Exemple #2
0
        private void StartButtonClick(object sender, RoutedEventArgs e)
        {
            ToggleSensitiveGUIParts(false);
            SetResultsLink(false, null);
            ToggleAutomationRelatedSettings(true); // user can prepare params for the next run

            runsPerSettings = int.Parse(RunsTextBox.Text);

            bool bias = (YesNo)BiasCombobox.SelectedItem == YesNo.Yes;

            int pcaDimensions = 0;

            int.TryParse(PCA.Text, out pcaDimensions); // TODO: test

            float       trainSetPercentage = float.Parse(TrainSetPercentage.Text, CultureInfo.InvariantCulture);
            int         outputCount        = int.Parse(OutputCount.Text);
            NetworkType networkType        = (NetworkType)NetworkTypeCombobox.SelectedItem;

            PartIIProblemType problemType      = csvLines[0].Count == 1 ? PartIIProblemType.CTS : PartIIProblemType.Stock;
            ReportingOptions  reportingOptions = GetReportingOptions();

            if (settingsToRun.Count == 0)
            {
                settingsToRun = GetLearningSettingsFromUI();
            }

            SetPlottingMethod(problemType);

            eid = new EngineInitData();

            eid.ErrorScale         = ERROR_SCALE;
            eid.DiscardWorstFactor = DISCARD_FACTOR;
            eid.TrainSetPercentage = trainSetPercentage;

            eid.CtsPrevValuesCount = 1; // always 1
            eid.OutputCount        = outputCount;
            eid.InputCount         = problemType == PartIIProblemType.CTS ? 1 : csvLines[0].Count - outputCount;
            if (pcaDimensions > 0)
            {
                eid.InputCount = Math.Min(pcaDimensions, eid.InputCount);
            }

            eid.PcaDimensions   = pcaDimensions;
            eid.RunsPerSettings = runsPerSettings;

            eid.UseBiases        = bias;
            eid.PlotAgainstInput = plotAgainstInput;

            eid.NetworkType = networkType;
            eid.ProblemType = problemType;

            eid.ReportingOptions = reportingOptions;

            eid.CsvLines      = csvLines;
            eid.SettingsToRun = settingsToRun;

            eid.DataSetName        = dataSetPath;
            eid.ParametersFileName = paramsFileName;

            ConfirmReportingSettings();
            CreateResultDirectories(DateTime.Now);

            worker                     = new BackgroundWorker();
            worker.DoWork             += worker_DoWork;
            worker.RunWorkerCompleted += worker_RunWorkerCompleted;

            worker.RunWorkerAsync();
        }