NlpTools API
Class

NlpTools\Optimizers\GradientDescentOptimizer

abstract class GradientDescentOptimizer implements FeatureBasedLinearOptimizerInterface

Implements gradient descent with fixed step.

Leaves the computation of the fprime to the children classes.

Methods

__construct($precision = 0.001, $step = 0.1, $maxiter = -1)

array optimize(array $feature_array)

This function receives an array that contains an array for each document which contains an array of feature identifiers for each class and at the special key '__label__' the actual class of the training document.

reportProgress($itercount)

Details

at line 22
public __construct($precision = 0.001, $step = 0.1, $maxiter = -1)

Parameters

$precision
$step
$maxiter

at line 65
public array optimize(array $feature_array)

This function receives an array that contains an array for each document which contains an array of feature identifiers for each class and at the special key '__label__' the actual class of the training document.

As a result it contains all the information needed to train a
set of weights with any target. Ex.: If we were training a maxent
model we would try to maximize the CLogLik that can be calculated
from this array.

Parameters

array $feature_array All the data known about the training set

Return Value

array The parameters $l[$i] that minimize F

at line 92
public reportProgress($itercount)

Parameters

$itercount