See Release Notes
Long Term Support Release
Differences Between: [Versions 310 and 401] [Versions 311 and 401] [Versions 39 and 401]
(no description)
File Size: | 264 lines (7 kb) |
Included or required: | 0 times |
Referenced: | 0 times |
Includes or requires: | 0 files |
Perceptron:: (13 methods):
__construct()
partialTrain()
trainBinary()
setEarlyStop()
getCostValues()
resetBinary()
runTraining()
runGradientDescent()
checkNormalizedSample()
output()
outputClass()
predictProbability()
predictSampleBinary()
Class: Perceptron - X-Ref
__construct(float $learningRate = 0.001, int $maxIterations = 1000, bool $normalizeInputs = true) X-Ref |
Initalize a perceptron classifier with given learning rate and maximum number of iterations used while training the perceptron param: float $learningRate Value between 0.0(exclusive) and 1.0(inclusive) param: int $maxIterations Must be at least 1 |
partialTrain(array $samples, array $targets, array $labels = []) X-Ref |
No description |
trainBinary(array $samples, array $targets, array $labels) X-Ref |
No description |
setEarlyStop(bool $enable = true) X-Ref |
Normally enabling early stopping for the optimization procedure may help saving processing time while in some cases it may result in premature convergence.<br> If "false" is given, the optimization procedure will always be executed for $maxIterations times return: $this |
getCostValues() X-Ref |
Returns the cost values obtained during the training. |
resetBinary() X-Ref |
No description |
runTraining(array $samples, array $targets) X-Ref |
Trains the perceptron model with Stochastic Gradient Descent optimization to get the correct set of weights |
runGradientDescent(array $samples, array $targets, Closure $gradientFunc, bool $isBatch = false) X-Ref |
Executes a Gradient Descent algorithm for the given cost function |
checkNormalizedSample(array $sample) X-Ref |
Checks if the sample should be normalized and if so, returns the normalized sample |
output(array $sample) X-Ref |
Calculates net output of the network as a float value for the given input return: int|float |
outputClass(array $sample) X-Ref |
Returns the class value (either -1 or 1) for the given input |
predictProbability(array $sample, $label) X-Ref |
Returns the probability of the sample of belonging to the given label. The probability is simply taken as the distance of the sample to the decision plane. param: mixed $label |
predictSampleBinary(array $sample) X-Ref |
return: mixed |