Skip to content

Commit

Permalink
Update 4-autograd-model.mdx
Browse files Browse the repository at this point in the history
  • Loading branch information
henrique-borba authored Jun 19, 2024
1 parent 12859c3 commit fa860a7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tensor/intro/4-autograd-model.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public function backward(Tensor $loss)
$this->weights_output_layer -= ($db_dLoss * $this->learningRate);
$this->weights_output_layer->resetGradients();

$this->output_bias -= $this->output_bias - ($this->output_bias->grad() * $this->learningRate);
$this->output_bias -= $this->output_bias->grad() * $this->learningRate;
$this->output_bias->resetGradients();
}
```
Expand Down Expand Up @@ -320,7 +320,7 @@ class SimpleModel
$this->weights_output_layer -= ($db_dLoss * $this->learningRate);
$this->weights_output_layer->resetGradients();

$this->output_bias -= $this->output_bias - ($this->output_bias->grad() * $this->learningRate);
$this->output_bias -= ($this->output_bias->grad() * $this->learningRate);
$this->output_bias->resetGradients();
}
}
Expand Down

0 comments on commit fa860a7

Please sign in to comment.