public void Process()
            {
                _batchSize = _batch.Count;
                if (_batch.Count < MinBatchSize)
                {
                    if (_previousBatch.Count == 0)
                    {
                        throw Contracts.Except("The input must contain no less than 12 points.");
                    }
                    _bLen          = _previousBatch.Count - _batch.Count;
                    _previousBatch = _previousBatch.GetRange(_batch.Count, _bLen);
                    _previousBatch.AddRange(_batch);
                    _modeler.Train(_previousBatch.ToArray(), ref _results);

                    // move the values to front
                    for (int i = 0; i < _batch.Count; ++i)
                    {
                        for (int j = 0; j < _outputLength; ++j)
                        {
                            _results[i][j] = _results[_bLen + i][j];
                        }
                    }
                }
                else
                {
                    _modeler.Train(_batch.ToArray(), ref _results);
                }
            }
Exemple #2
0
 public void Process()
 {
     _batchSize = _batch.Count;
     if (_batch.Count < MinBatchSize)
     {
         if (_previousBatch.Count == 0)
         {
             throw Contracts.Except("The input must contain no less than 12 points.");
         }
         _bLen          = _previousBatch.Count - _batch.Count;
         _previousBatch = _previousBatch.GetRange(_batch.Count, _bLen);
         _previousBatch.AddRange(_batch);
         _modeler.Train(_previousBatch.ToArray(), ref _results);
     }
     else
     {
         _modeler.Train(_batch.ToArray(), ref _results);
     }
 }