コード例 #1
0
 /// <summary>
 /// Construct a simulated annleaing trainer for a feedforward neural network.
 /// </summary>
 ///
 /// <param name="network">The neural network to be trained.</param>
 /// <param name="calculateScore">Used to calculate the score for a neural network.</param>
 /// <param name="startTemp">The starting temperature.</param>
 /// <param name="stopTemp">The ending temperature.</param>
 /// <param name="cycles">The number of cycles in a training iteration.</param>
 public NeuralSimulatedAnnealing(IMLEncodable network,
                                 ICalculateScore calculateScore, double startTemp,
                                 double stopTemp, int cycles) : base(TrainingImplementationType.Iterative)
 {
     _network        = network;
     _calculateScore = calculateScore;
     _anneal         = new NeuralSimulatedAnnealingHelper(this)
     {
         Temperature      = startTemp,
         StartTemperature = startTemp,
         StopTemperature  = stopTemp,
         Cycles           = cycles
     };
 }
コード例 #2
0
 /// <summary>
 /// Construct a simulated annleaing trainer for a feedforward neural network.
 /// </summary>
 /// <param name="network">The neural network to be trained.</param>
 /// <param name="calculateScore">Used to calculate the score for a neural network.</param>
 /// <param name="startTemp">The starting temperature.</param>
 /// <param name="stopTemp">The ending temperature.</param>
 /// <param name="cycles">The number of cycles in a training iteration.</param>
 public NeuralSimulatedAnnealing(BasicNetwork network,
                                 ICalculateScore calculateScore,
                                 double startTemp,
                                 double stopTemp,
                                 int cycles)
 {
     this.network                 = network;
     this.calculateScore          = calculateScore;
     this.anneal                  = new NeuralSimulatedAnnealingHelper(this);
     this.anneal.Temperature      = startTemp;
     this.anneal.StartTemperature = startTemp;
     this.anneal.StopTemperature  = stopTemp;
     this.anneal.Cycles           = cycles;
 }