/// <inheritdoc/>
        public void PostIteration()
        {
            _lastCheck++;
            _trainingError = _train.Error;

            _stripOpt    = Math.Min(_stripOpt, _trainingError);
            _stripTotal += _trainingError;

            if (_lastCheck > _stripLength)
            {
                _validationError = _calc.CalculateError(_validationSet);
                _testError       = _calc.CalculateError(_testSet);
                _eOpt            = Math.Min(_validationError, _eOpt);
                _gl = 100.0 * ((_validationError / _eOpt) - 1.0);

                _stripEfficiency = (_stripTotal)
                                   / (_stripLength * _stripOpt);

                //System.out.println("eff=" + this.stripEfficiency + ", gl=" + this.gl);

                // setup for next time
                _stripTotal = 0;
                _lastCheck  = 0;

                // should we stop?
                _stop = (_gl > _alpha) ||
                        (_stripEfficiency < _minEfficiency);
            }
        }
Ejemplo n.º 2
0
 /// <inheritdoc />
 public void Init(IMLTrain theTrain)
 {
     _train               = theTrain;
     _calc                = (IMLError)_train.Method;
     _stop                = false;
     _lastCheck           = 0;
     _lastValidationError = _calc.CalculateError(_validationSet);
 }
Ejemplo n.º 3
0
        /// <inheritdoc />
        public void PostIteration()
        {
            _lastCheck++;
            _trainingError = _train.Error;

            if (_lastCheck > _checkFrequency || Double.IsInfinity(_lastValidationError))
            {
                _lastCheck = 0;

                double currentValidationError = _calc.CalculateError(_validationSet);

                if (currentValidationError >= _lastValidationError)
                {
                    _stop = true;
                }

                _lastValidationError = currentValidationError;
            }
        }
 /// <inheritdoc />
 public void Init(IMLTrain theTrain)
 {
     _train = theTrain;
     _calc = (IMLError) _train.Method;
     _stop = false;
     _lastCheck = 0;
     _lastValidationError = _calc.CalculateError(_validationSet);
 }