rate = $rate; } /** * Take a step of gradient descent for a given parameter. * * @internal * * @param \Rubix\ML\NeuralNet\Parameter $param * @param \Tensor\Tensor $gradient * @return \Tensor\Tensor */ public function step(Parameter $param, Tensor $gradient) : Tensor { return $gradient->multiply($this->rate); } /** * Return the string representation of the object. * * @internal * * @return string */ public function __toString() : string { return "Stochastic (rate: {$this->rate})"; } }