(no description)
File Size: | 278 lines (7 kb) |
Included or required: | 0 times |
Referenced: | 0 times |
Includes or requires: | 0 files |
StochasticGD:: (11 methods):
__construct()
setTheta()
setChangeThreshold()
setEarlyStop()
setLearningRate()
setMaxIterations()
runOptimization()
getCostValues()
updateTheta()
earlyStop()
clear()
Class: StochasticGD - X-Ref
Stochastic Gradient Descent optimization method__construct(int $dimensions) X-Ref |
Initializes the SGD optimizer for the given number of dimensions |
setTheta(array $theta) X-Ref |
No description |
setChangeThreshold(float $threshold = 1e-5) X-Ref |
Sets minimum value for the change in the theta values between iterations to continue the iterations.<br> If change in the theta is less than given value then the algorithm will stop training return: $this |
setEarlyStop(bool $enable = true) X-Ref |
Enable/Disable early stopping by checking at each iteration whether changes in theta or cost value are not large enough return: $this |
setLearningRate(float $learningRate) X-Ref |
return: $this |
setMaxIterations(int $maxIterations) X-Ref |
return: $this |
runOptimization(array $samples, array $targets, Closure $gradientCb) X-Ref |
Optimization procedure finds the unknow variables for the equation A.ϴ = y for the given samples (A) and targets (y).<br> The cost function to minimize and the gradient of the function are to be handled by the callback function provided as the third parameter of the method. |
getCostValues() X-Ref |
Returns the list of cost values for each iteration executed in last run of the optimization |
updateTheta() X-Ref |
No description |
earlyStop(array $oldTheta) X-Ref |
Checks if the optimization is not effective enough and can be stopped in case large enough changes in the solution do not happen |
clear() X-Ref |
No description |