コード例 #1
0
ファイル: TNeuralData.cs プロジェクト: heber/FreeOQ
 public TNeuralData(TNeuralData Data)
 {
   this.mqxB9tafd = Data.mqxB9tafd;
   this.XkLVodNhF = Data.mqxB9tafd;
   this.dRXrjBaeW = this.mqxB9tafd == 0 ? (double[]) null : new double[this.mqxB9tafd];
   this.s9P8N17Q3 = this.XkLVodNhF == 0 ? (double[]) null : new double[this.XkLVodNhF];
   for (int index = 0; index < this.mqxB9tafd; ++index)
     this.dRXrjBaeW[index] = Data.dRXrjBaeW[index];
   for (int index = 0; index < this.XkLVodNhF; ++index)
     this.s9P8N17Q3[index] = Data.s9P8N17Q3[index];
 }
コード例 #2
0
ファイル: TPerceptron.cs プロジェクト: zhuzhenping/FreeOQ
        public void TrainPerceptron()
        {
            this.x1tDaZE2v = false;
            int num1 = 0;
            int num2 = 0;
            int num3 = 0;

label_1:
            do
            {
                do
                {
                    for (int index = 0; index < this.fNBatch; ++index)
                    {
                        TNeuralData data = this.tD5M1LlFx.GetData();
                        this.fInput  = data.Input;
                        this.fTarget = data.Output;
                        this.FeedForward();
                        this.ComputeError();
                        this.FeedBackward();
                    }
                    this.Update(0);
                    TPerceptron tperceptron = this;
                    int         num4        = tperceptron.fNPattern + this.fNBatch;
                    tperceptron.fNPattern = num4;
                    num1 += this.fNBatch;
                    num2 += this.fNBatch;
                    if (this.x1tDaZE2v)
                    {
                        Console.WriteLine("");
                        return;
                    }
                    else if (this.fSMethod == EStoppingMethod.PatternNumber && (double)num1 >= this.fSParameter)
                    {
                        Console.WriteLine("", this.fSParameter);
                        return;
                    }
                }while (num2 < this.fNGraphUpdate);
                num2           = 0;
                this.wm8s050QY = this.GetTrainingSetError();
                this.V8laR9xb7.Add((double)num3, this.wm8s050QY);
                if (this.WKl1lduPx != null)
                {
                    this.MSg9cpEpW = this.GetValidationSetError();
                    this.XOwvCEen2.Add((double)num3, this.MSg9cpEpW);
                }
                ++num3;
            }while (this.fViewMode != EViewMode.OnLine);
            goto label_1;
        }
コード例 #3
0
 public void Renormalize()
 {
     for (int Col = 0; Col < this.fNInput; ++Col)
     {
         double storedMean = this.GetStoredMean(Col);
         double num1       = Math.Sqrt(this.GetStoredVariance(Col));
         for (int Seek = 0; Seek < this.fData.Count; ++Seek)
         {
             TNeuralData data = this.GetData(Seek);
             double      num2 = data.Input[Col];
             data.Input[Col] = num2 * num1 + storedMean;
         }
     }
 }
コード例 #4
0
ファイル: TNeuralData.cs プロジェクト: zhuzhenping/FreeOQ
 public TNeuralData(TNeuralData Data)
 {
     this.mqxB9tafd = Data.mqxB9tafd;
     this.XkLVodNhF = Data.mqxB9tafd;
     this.dRXrjBaeW = this.mqxB9tafd == 0 ? (double[])null : new double[this.mqxB9tafd];
     this.s9P8N17Q3 = this.XkLVodNhF == 0 ? (double[])null : new double[this.XkLVodNhF];
     for (int index = 0; index < this.mqxB9tafd; ++index)
     {
         this.dRXrjBaeW[index] = Data.dRXrjBaeW[index];
     }
     for (int index = 0; index < this.XkLVodNhF; ++index)
     {
         this.s9P8N17Q3[index] = Data.s9P8N17Q3[index];
     }
 }
コード例 #5
0
ファイル: TPerceptron.cs プロジェクト: zhuzhenping/FreeOQ
        public void PrintTrainingSetError()
        {
            int    ndata = this.tD5M1LlFx.GetNData();
            double num   = 0.0;

            for (int Seek = 0; Seek < ndata; ++Seek)
            {
                TNeuralData data = this.tD5M1LlFx.GetData(Seek);
                this.fInput  = data.Input;
                this.fTarget = data.Output;
                this.FeedForward();
                this.ComputeError();
                num += this.GetError();
                this.PrintError();
            }
        }
コード例 #6
0
ファイル: TPerceptron.cs プロジェクト: zhuzhenping/FreeOQ
        public double GetTrainingSetError(int Option)
        {
            if (Option != 0)
            {
                return(this.wm8s050QY);
            }
            int    ndata = this.tD5M1LlFx.GetNData();
            double num   = 0.0;

            for (int Seek = 0; Seek < ndata; ++Seek)
            {
                TNeuralData data = this.tD5M1LlFx.GetData(Seek);
                this.fInput  = data.Input;
                this.fTarget = data.Output;
                this.FeedForward();
                this.ComputeError();
                num += this.GetError();
            }
            return(num / (double)ndata);
        }
コード例 #7
0
ファイル: TPerceptron.cs プロジェクト: zhuzhenping/FreeOQ
        public double GetValidationSetError(int Option)
        {
            if (Option != 0)
            {
                return(this.MSg9cpEpW);
            }
            if (this.WKl1lduPx == null)
            {
                return(0.0);
            }
            int    ndata = this.WKl1lduPx.GetNData();
            double num   = 0.0;

            for (int Seek = 0; Seek < ndata; ++Seek)
            {
                TNeuralData data = this.WKl1lduPx.GetData(Seek);
                this.fInput  = data.Input;
                this.fTarget = data.Output;
                this.FeedForward();
                this.ComputeError();
                num += this.GetError();
            }
            return(num / (double)ndata);
        }
コード例 #8
0
ファイル: TNeuralDataSet.cs プロジェクト: heber/FreeOQ
 public void AddData(TNeuralData NeuralData)
 {
   this.fData.Add((object) NeuralData);
   ++this.fNData;
 }
コード例 #9
0
 public void AddData(TNeuralData NeuralData)
 {
     this.fData.Add((object)NeuralData);
     ++this.fNData;
 }