コード例 #1
0
        /// <summary>
        /// Method connected to LEARN button command. It invokes method train from services.
        /// </summary>
        /// <param name="obj">Not used</param>
        private void LearnNetwork(object obj)
        {
            bool correctGetPath  = CheckGetSamplePath(LoadSamples);
            bool correntSavePath = CheckSaveAnnPath(SaveAnn);

            if (correctGetPath && correntSavePath)
            {
                _trainService.GetPathOfLanguageSample(loadSamples);
                _trainService.SetPathToSaveAnn(saveAnn);

                try
                {
                    Task.Run(() => _trainService.TrainNetwork());
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message, "Train ANN issue", MessageBoxButton.OK, MessageBoxImage.Exclamation);
                }
            }
        }