MCordingley\Regression\Algorithm\GradientDescent\Schedule\RmsProp::update PHP Метод

update() публичный Метод

public update ( array $gradient )
$gradient array
    public function update(array $gradient)
    {
        foreach ($gradient as $i => $slope) {
            $history = isset($this->history[$i]) ? $this->history[$i] : pow($slope, 2);
            $this->history[$i] = $history * $this->rate + (1.0 - $this->rate) * pow($slope, 2);
        }
    }

Usage Example

Пример #1
0
 public function testStep()
 {
     $schedule = new RmsProp(0.9, 0.01, 1.0E-6);
     $schedule->update([1.0]);
     static::assertEquals(0.00999999500000375, $schedule->step(0));
 }