private void button1_Click(object sender, EventArgs e) { { var data = new PatternsCollection(PatternsCount, InputsCount, OutputsCount); var checkedItem = GetCheckedIndex(); if (checkedItem > 6) { switch (checkedItem) { case 7: { PatternStyles.BuildEvenSquare(data); break; } case 8: { PatternStyles.BuildEvenCircle(data); break; } } } else { for (var i = 1; i <= PatternsCount; i++) { double x = 0; double y = 0; switch (checkedItem) { case 0: { PatternStyles.BuildSquare(out x, out y); break; } case 1: { PatternStyles.BuildDimond(out x, out y); break; } case 2: { PatternStyles.BuildPlus(out x, out y); break; } case 3: { PatternStyles.BuildRing(out x, out y); break; } case 4: { PatternStyles.BuildCircle(out x, out y); break; } case 5: { PatternStyles.BuildTwoCircles(out x, out y); break; } case 6: { PatternStyles.ChessBoard(out x, out y); break; } default: throw new ApplicationException("Please select pattern styly!"); } SetPattern(data, i, x, y); } } var LearningRateStart = 0.7; var LearningRateEnds = 0.05; var InitialNeighborhoodSize = 5; var NeighborhoodDecrRate = 5; var Iterations = 2000; var a = new MySelfOrganizingNetwork(InputsCount, MapSize, MapSize, LearningRateStart, LearningRateEnds, InitialNeighborhoodSize, Iterations / NeighborhoodDecrRate, Iterations); a.control = panel1; a.Train(data); data = null; a = null; } }
private void button1_Click(object sender, EventArgs e) { { var data = new PatternsCollection(PatternsCount, InputsCount, OutputsCount); var checkedItem = GetCheckedIndex(); if (checkedItem > 6) switch (checkedItem) { case 7: { PatternStyles.BuildEvenSquare(data); break; } case 8: { PatternStyles.BuildEvenCircle(data); break; } } else { for (var i = 1; i <= PatternsCount; i++) { double x = 0; double y = 0; switch (checkedItem) { case 0: { PatternStyles.BuildSquare(out x, out y); break; } case 1: { PatternStyles.BuildDimond(out x, out y); break; } case 2: { PatternStyles.BuildPlus(out x, out y); break; } case 3: { PatternStyles.BuildRing(out x, out y); break; } case 4: { PatternStyles.BuildCircle(out x, out y); break; } case 5: { PatternStyles.BuildTwoCircles(out x, out y); break; } case 6: { PatternStyles.ChessBoard(out x, out y); break; } default: throw new ApplicationException("Please select pattern styly!"); } SetPattern(data, i, x, y); } } var LearningRateStart = 0.7; var LearningRateEnds = 0.05; var InitialNeighborhoodSize = 5; var NeighborhoodDecrRate = 5; var Iterations = 2000; var a = new MySelfOrganizingNetwork(InputsCount, MapSize, MapSize, LearningRateStart, LearningRateEnds, InitialNeighborhoodSize, Iterations/NeighborhoodDecrRate, Iterations); a.control = panel1; a.Train(data); data = null; a = null; } }