Encog.ML.Data.Buffer.BufferedMLDataSet.Close C# (CSharp) 메소드

Close() 공개 메소드

Close the dataset.
public Close ( ) : void
리턴 void
        public void Close()
        {
            Object[] obj = additional.ToArray();

            foreach (var set in obj.Cast<BufferedMLDataSet>())
            {
                set.Close();
            }

            additional.Clear();

            if (_owner != null)
            {
                _owner.RemoveAdditional(this);
            }

            egb.Close();
            egb = null;
        }

Usage Example

예제 #1
0
        /// <summary>
        /// Evaluate disk.
        /// </summary>
        private void EvalBinary()
        {
            FileInfo file = FileUtil.CombinePath( new FileInfo(Path.GetTempPath()), "temp.egb" );

            BasicMLDataSet training = RandomTrainingFactory.Generate(
                1000, 10000, 10, 10, -1, 1);

            // create the binary file

            if (file.Exists)
            {
                file.Delete();
            }

            var training2 = new BufferedMLDataSet(file.ToString());
            training2.Load(training);

            const long stop = (10*Evaluate.Milis);
            int record = 0;

            IMLDataPair pair;

            var watch = new Stopwatch();
            watch.Start();

            int iterations = 0;
            while(true)
            {
                iterations++;
                pair = training[record++];
                if(record >= training.Count)
                    record = 0;

                if((iterations & 0xff) == 0 && watch.ElapsedMilliseconds >= stop)
                    break;
            }

            training2.Close();

            iterations /= 100000;

            _report.Report(Steps, Step3,
                          "Disk(binary) dataset, result: "
                          + Format.FormatInteger(iterations));

            if (file.Exists)
            {
                file.Delete();
            }
            _binaryScore = iterations;
        }
All Usage Examples Of Encog.ML.Data.Buffer.BufferedMLDataSet::Close