Exemplo n.º 1
0
 internal virtual void UninitializeInternal()
 {
     lock (SyncRoot)
     {
         if (initialized)
         {
             UninitializeData();
             sw.Reset();
             currentIteration = 0;
             initialized = false;
             bestResult = currentResult = null;
         }
     }
 }
Exemplo n.º 2
0
        public void Step()
        {
            lock (SyncRoot)
            {
                if (this.currentTest == null) throw new InvalidOperationException("Cannot start epoch. Test is null.");
                if (!initialized)
                {
                    sw.Start();
                    try
                    {
                        InitializeInternal();
                    }
                    finally
                    {
                        sw.Stop();
                    }
                }

                sw.Start();
                try
                {
                    var testResult = Step(this.currentTest);
                    currentResult = new LearningTestResult(this.currentTest, testResult);
                    if (bestResult == null || testResult.MSE < bestResult.MSE)
                    {
                        bestResult = new LearningTestResult(this.currentTest, testResult);
                    }
                }
                finally
                {
                    sw.Stop();
                }
                currentIteration++;
            }
        }
Exemplo n.º 3
0
 internal virtual void InitializeInternal()
 {
     lock (SyncRoot)
     {
         if (!initialized)
         {
             InitializeNewRun();
             sw.Reset();
             currentIteration = 0;
             initialized = true;
             bestResult = currentResult = null;
         }
     }
 }