public GradientDescent()
        {
            // NOTE: Newest training set at index 0
            _trainingSets = new TrainingSet[Constants.MaxNumberOfTrainingSets];
            _hypothesis   = new Hypothesis(new Parameters(0f, 0f));

            for (int i = 0; i < Constants.MaxNumberOfTrainingSets; i++)
            {
                _trainingSets[i] = new TrainingSet(0f, 0f);
            }
        }
Beispiel #2
0
        public GradientDescent(int numberOfTrainingSetsUsedForGD, int numberOfUpdateCycles, float alpha)
        {
            // NOTE: Newest training set at index 0
            _trainingSets = new TrainingSet[Constants.MaxNumberOfTrainingSets];
            _hypothesis   = new Hypothesis(new Parameters(0f, 0f), numberOfTrainingSetsUsedForGD, alpha);
            _numberOfTrainingSetsUsedForGD = numberOfTrainingSetsUsedForGD;
            _numberOfUpdateCycles          = numberOfUpdateCycles;

            for (int i = 0; i < Constants.MaxNumberOfTrainingSets; i++)
            {
                _trainingSets[i] = new TrainingSet(0f, 0f);
            }
        }