public function step(int $featureIndex) : float
{
$correctedMean = $this->means[$featureIndex] / (1.0 - pow($this->meanBeta, $this->iteration));
$correctedVariance = $this->variances[$featureIndex] / (1.0 - pow($this->varianceBeta, $this->iteration));
/*
* Need to put the gradient in the denominator here to counter the one in GradientDescent, since Adam takes
* the unusual approach of not having it at all in the coefficient update step.
*/
return $this->gradient[$featureIndex] ? $this->stepSize * $correctedMean / ((sqrt($correctedVariance) + $this->eta) * $this->gradient[$featureIndex]) : 0;
}