/// <summary> /// Load learning result into interface /// </summary> /// <param name="lr">LearnResult</param> private void loadIntoInterface(LearnResult lr) { try { status.Text = ""; int trial = 1; weightsList.Items.Clear(); chart.Series.Clear(); foreach (var weights in lr.ResultWeights) { String name = LearnByError.Internazional.Resource.Inst.Get("r53") + trial.ToString(); weightsList.Items.Add(name); for (int i = 0; i < weights.Length; i++) { weightsList.Items.Add(weights[i].ToString()); } weightsList.Items.Add(""); if (lr.Info.np == 0) { throw new Exception(LearnByError.Internazional.Resource.Inst.Get("r54")); } int jj = 1; foreach (var rmse in lr.RMSE) { for (int j = 0; j < rmse.Length; j++) { SetChart(LearnByError.Internazional.Resource.Inst.Get("r53") + jj.ToString(), j + 1, rmse[j]); } jj++; } trial++; } chart.Update(); status.Text = LearnByError.Internazional.Resource.Inst.Get("r55"); learnRMSE.Text = string.Format(LearnByError.Internazional.Resource.Inst.Get("r230"), result.AverageLearnRMSE); testRMSE.Text = string.Format(LearnByError.Internazional.Resource.Inst.Get("r231"), result.AverageTestRMSE); times.Text = string.Format(LearnByError.Internazional.Resource.Inst.Get("r232"), result.AverageLearnTime, result.AverageTestTime); neuronNumber.Text = string.Format(LearnByError.Internazional.Resource.Inst.Get("r233"), result.Filename, result.Info != null ? result.Info.nn : 0); } catch (Exception ex) { ex.ToLog(); status.Text = ex.Message; } finally { this.Text = String.Format(LearnByError.Internazional.Resource.Inst.Get("r229"), history.Items.Count); } }
/// <summary> /// Selection action - selecting learning result /// </summary> /// <param name="sender">who</param> /// <param name="e">arguments</param> private void list_SelectedIndexChanged(object sender, EventArgs e) { try { History h = new History(); h.Id = items[history.SelectedIndex]; h.Read(); result = marekbar.Xml.Deserialize <LearnResult>(h.Data); loadIntoInterface(result); } catch (Exception ex) { ex.ToLog(); } }