/// <summary> /// Program entry point. /// </summary> /// <param name="app">Holds arguments and other info.</param> public void Execute(IExampleInterface app) { BasicNetwork network = CreateNetwork(); IMLTrain train; if (app.Args.Length > 0 && String.Compare(app.Args[0], "anneal", true) == 0) { train = new NeuralSimulatedAnnealing( network, new PilotScore(), 10, 2, 100); } else { train = new NeuralGeneticAlgorithm( network, new NguyenWidrowRandomizer(), new PilotScore(), 500, 0.1, 0.25); } int epoch = 1; for (int i = 0; i < 50; i++) { train.Iteration(); Console.WriteLine(@"Epoch #" + epoch + @" Score:" + train.Error); epoch++; } Console.WriteLine(@"\nHow the winning network landed:"); network = (BasicNetwork)train.Method; var pilot = new NeuralPilot(network, true); Console.WriteLine(pilot.ScorePilot()); EncogFramework.Instance.Shutdown(); }
/// <summary> /// Program entry point. /// </summary> /// <param name="app">Holds arguments and other info.</param> public void Execute(IExampleInterface app) { BasicNetwork network = CreateNetwork(); IMLTrain train; if (app.Args.Length > 0 && String.Compare(app.Args[0], "anneal", true) == 0) { train = new NeuralSimulatedAnnealing( network, new PilotScore(), 10, 2, 100); } else { train = new NeuralGeneticAlgorithm( network, new FanInRandomizer(), new PilotScore(), 500, 0.1, 0.25); } int epoch = 1; for (int i = 0; i < 50; i++) { train.Iteration(); Console.WriteLine(@"Epoch #" + epoch + @" Score:" + train.Error); epoch++; } Console.WriteLine(@"\nHow the winning network landed:"); network = (BasicNetwork) train.Method; var pilot = new NeuralPilot(network, true); Console.WriteLine(pilot.ScorePilot()); EncogFramework.Instance.Shutdown(); }
public double CalculateScore(IMLMethod network) { NeuralPilot pilot = new NeuralPilot((BasicNetwork)network, false); return pilot.ScorePilot(); }
public double CalculateScore(IMLMethod network) { NeuralPilot pilot = new NeuralPilot((BasicNetwork)network, false); return(pilot.ScorePilot()); }