private void learn_button_Click(object sender, RoutedEventArgs e) { if (learnFilePath != "") { tr = new TrainMachine(canvasRowsAndColumns * canvasRowsAndColumns, sliderhiddenval); double[,] todata = new double[canvasRowsAndColumns, canvasRowsAndColumns]; double[,] alldata = new double[lines.Count(), canvasRowsAndColumns *canvasRowsAndColumns]; int pom; for (int i = 0; i < lines.Count(); i++) { pom = 0; for (int z = 0; z < canvasRowsAndColumns; z++) { for (int y = 0; y < canvasRowsAndColumns; y++) { todata[z, y] = Convert.ToDouble(lines.ElementAt(i).ElementAt(pom).ToString()); alldata[i, pom] = todata[z, y]; pom++; } } } data = DenseMatrix.OfArray(alldata); tr.train(data, sliderrepeat, sliderspeed); click_pom = 1; MessageBox.Show("Nauczono"); } else { MessageBox.Show("Wybierz plik uczący"); } }
private static void Train() { AddrSet addrset = AddrSet.GetInstance(); TrainMachine t = new TrainMachine(addrset); List <InsertElement> list = new List <InsertElement>(); Random rnd = new Random(); list.Add(new InsertElement(rnd.Next().ToString("0.00"), LEVEL.City, InsertMode.AutoPlace | InsertMode.ExactlyLevel)); t.Train(list, true); MatchHelper.rwLockDashboard(addrset); }
public void Train() { //start AddrSet addrset = AddrSet.GetInstance(); TrainMachine m = new TrainMachine(addrset); List <InsertElement> list = new List <InsertElement>(); list.Add(new InsertElement("武汉", LEVEL.City, InsertMode.AutoPlace | InsertMode.ExactlyLevel)); list.Add(new InsertElement("理工大", LEVEL.Other, InsertMode.AutoPlace | InsertMode.ExactlyLevel)); list.Add(new InsertElement("屋檐下", LEVEL.Uncertainty, InsertMode.AutoPlace | InsertMode.ExactlyLevel)); m.Train(list, true); //close //addrset.Dump(); }