コード例 #1
0
        public DataPoint Cut(DataBase db, int offset)
        {
            int dataSize = db.CountVectorElements;
            if (dataSize < offset + forwardStepsToPredict_)
                throw new ArgumentOutOfRangeException();
            if (offset < Helpers.ModifiedFibbonacci(backTicksPerIndicator_ - 1))
                throw new ArgumentOutOfRangeException(String.Format(
                    "offset should be > {0}",
                    Helpers.ModifiedFibbonacci(backTicksPerIndicator_ - 1).ToString()));

            DataPoint outputPoint = new DataPoint();

            //changing loops with their places would speed it up, but this possition will make output more understandable
            foreach(string currIndicator in indicatorsToUseNames_)
            {
                for (int i = 0; i < backTicksPerIndicator_; i++)
                {
                    int currIndex = offset - Helpers.ModifiedFibbonacci(i);

                    outputPoint.input.Add(db[currIndicator][currIndex]);
                }
            }

            outputPoint.output = db[outputName_][offset + forwardStepsToPredict_];

            return outputPoint;
        }
コード例 #2
0
        public List<DataPoint> GenerateSinWaveDataPoints(int pointsNo, double intervalBetwPoints)
        {
            List<DataPoint> dataPoints = new List<DataPoint>();

            for (double i = 0.0d; i < pointsNo; i++)
            {
                double currInput = i*intervalBetwPoints;
                double currOutput = Math.Sin(currInput);

                DataPoint dp = new DataPoint();
                dp.input.Add(currInput);
                dp.input.Add(0.0d);
                dp.output = currOutput;

                dataPoints.Add(dp);
            }

            return dataPoints;
        }
コード例 #3
0
            Assert.AreEqual(0, child3.Outputs.Count);

            dummyNetwork.UTTestingFoo();
        }