Create() 공개 메소드

Create a new RGB file.
public Create ( int inputCount, int idealCount ) : void
inputCount int The input count.
idealCount int The ideal count.
리턴 void
        /// <summary>
        /// Convert an external file format, such as CSV, to the Encog binary
        /// training format.
        /// </summary>
        /// <param name="binaryFile">The binary file to create.</param>
        public void External2Binary(String binaryFile)
        {
            Status.Report(0, 0, "Importing to binary file: "
                          + binaryFile);

            var egb = new EncogEGBFile(binaryFile);

            egb.Create(_codec.InputSize, _codec.IdealSize);

            var input = new double[_codec.InputSize];
            var ideal = new double[_codec.IdealSize];

            _codec.PrepareRead();

            int    currentRecord = 0;
            int    lastUpdate    = 0;
            double significance  = 0;

            while (_codec.Read(input, ideal, ref significance))
            {
                egb.Write(input);
                egb.Write(ideal);

                currentRecord++;
                lastUpdate++;
                if (lastUpdate >= 10000)
                {
                    lastUpdate = 0;
                    Status.Report(0, currentRecord, "Importing...");
                }
                egb.Write(significance);
            }

            egb.Close();
            _codec.Close();
            Status.Report(0, 0, "Done importing to binary file: "
                          + binaryFile);
        }
예제 #2
0
        /// <summary>
        /// Convert an external file format, such as CSV, to the Encog binary
        /// training format. 
        /// </summary>
        /// <param name="binaryFile">The binary file to create.</param>
        public void External2Binary(String binaryFile)
        {
            Status.Report(0, 0, "Importing to binary file: "
                                + binaryFile);

            var egb = new EncogEGBFile(binaryFile);

            egb.Create(_codec.InputSize, _codec.IdealSize);

            var input = new double[_codec.InputSize];
            var ideal = new double[_codec.IdealSize];

            _codec.PrepareRead();

            int currentRecord = 0;
            int lastUpdate = 0;
            double significance = 0;

            while (_codec.Read(input, ideal, ref significance))
            {
                egb.Write(input);
                egb.Write(ideal);

                currentRecord++;
                lastUpdate++;
                if (lastUpdate >= 10000)
                {
                    lastUpdate = 0;
                    Status.Report(0, currentRecord, "Importing...");
                }
                egb.Write(significance);
            }

            egb.Close();
            _codec.Close();
            Status.Report(0, 0, "Done importing to binary file: "
                                + binaryFile);
        }
예제 #3
0
 /// <summary>
 /// Begin loading to the binary file. After calling this method the add
 /// methods may be called.
 /// </summary>
 /// <param name="inputSize">The input size.</param>
 /// <param name="idealSize">The ideal size.</param>
 public void BeginLoad(int inputSize, int idealSize)
 {
     _egb.Create(inputSize, idealSize);
     _loading = true;
 }
예제 #4
0
 public void External2Binary(string binaryFile)
 {
     EncogEGBFile file;
     double[] numArray;
     double[] numArray2;
     int num;
     int num2;
     double num3;
     this.Status.Report(0, 0, "Importing to binary file: " + binaryFile);
     goto Label_0106;
     Label_0038:
     file.Write(num3);
     Label_0040:
     if (this._x75d376891c19d365.Read(numArray, numArray2, ref num3))
     {
         file.Write(numArray);
         file.Write(numArray2);
         num++;
         num2++;
     }
     else
     {
         file.Close();
         this._x75d376891c19d365.Close();
         this.Status.Report(0, 0, "Done importing to binary file: " + binaryFile);
         return;
     }
     Label_0082:
     if (num2 >= 0x2710)
     {
         do
         {
             num2 = 0;
         }
         while (0 != 0);
         this.Status.Report(0, num, "Importing...");
         if (((uint) num) > uint.MaxValue)
         {
             goto Label_0082;
         }
     }
     else
     {
         goto Label_0038;
     }
     if ((((uint) num) + ((uint) num2)) > uint.MaxValue)
     {
         goto Label_010D;
     }
     goto Label_0038;
     Label_0106:
     file = new EncogEGBFile(binaryFile);
     Label_010D:
     file.Create(this._x75d376891c19d365.InputSize, this._x75d376891c19d365.IdealSize);
     numArray = new double[this._x75d376891c19d365.InputSize];
     numArray2 = new double[this._x75d376891c19d365.IdealSize];
     this._x75d376891c19d365.PrepareRead();
     num = 0;
     num2 = 0;
     if ((((uint) num2) + ((uint) num2)) >= 0)
     {
         num3 = 0.0;
         goto Label_0040;
     }
     goto Label_0106;
 }