Example #1
0
 /// <summary>
 /// Perform the gradient calculation for the specified index range.
 /// </summary>
 ///
 public void Run()
 {
     try
     {
         _errorCalculation.Reset();
         for (int i = _low; i <= _high; i++)
         {
             var pair = _training[i];
             Process(pair);
         }
         double error = _errorCalculation.Calculate();
         _owner.Report(_gradients, error, null);
         EngineArray.Fill(_gradients, 0);
     }
     catch (Exception ex)
     {
         _owner.Report(null, 0, ex);
     }
 }
 /// <summary>
 /// Perform the gradient calculation for the specified index range.
 /// </summary>
 ///
 public void Run()
 {
     try
     {
         _errorCalculation.Reset();
         for (int i = _low; i <= _high; i++)
         {
             _training.GetRecord(i, _pair);
             Process(_pair.InputArray, _pair.IdealArray, _pair.Significance);
         }
         double error = _errorCalculation.Calculate();
         _owner.Report(_gradients, error, null);
         EngineArray.Fill(_gradients, 0);
     }
     catch (Exception ex)
     {
         _owner.Report(null, 0, ex);
     }
 }