private void ApplicationFinished() { mStopWatch.Stop(); ResultsAddItemsCaller res = new ResultsAddItemsCaller(ResultsAddItems); lbResults.Invoke(res, "Application finished"); lbResults.Invoke(res, "Време за изпълнение: " + mStopWatch.Elapsed.ToString()); lbResults.Invoke(res, String.Format("Най-добрата мрежа е с {0} неврона в скрития слой", mBestActivationNetwork[0].NeuronsCount)); lbResults.Invoke(res, String.Format("Най-добрата тестова мрежа е с {0} неврона в скрития слой", mBestTestActivationNetwork[0].NeuronsCount)); this.IsRunning = false; }
private void ThreadFinished(GThread th) { // double min = Double.MaxValue; // double mintest = Double.MaxValue; double min_local = Double.MaxValue; double mintest_local = Double.MaxValue; lock (this) { foreach (double d in (th as SingleNNTraining).Errors) { if (d < min_local) { min_local = d; } } if (min_local < min) { min = min_local; mBestActivationNetwork = (th as SingleNNTraining).Network; } if (mintest > (th as SingleNNTraining).MinTestError) { mintest = (th as SingleNNTraining).MinTestError; mBestTestActivationNetwork = (th as SingleNNTraining).TestBestNetwork; } } NNResultSet single_result = new NNResultSet(); single_result.Error = min_local; results.Add(single_result); ResultsAddItemsCaller res = new ResultsAddItemsCaller(ResultsAddItems); lbResults.Invoke(res, String.Format("{0} {1}", min_local, (th as SingleNNTraining).MinTestError)); RefreshVisualStatus refresh_status = new RefreshVisualStatus(DoRefreshVisualStatus); this.Invoke(refresh_status); ReinitsFinished++; }