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 fbfee04 commit 12859c3
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions tensor/intro/4-autograd-model.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,15 @@ class SimpleModel
}
}
```
For each weight and bias of our layers, we will initialize a Variable using a random
For each weight and bias of our layers, we will initialize a Tensor using a random
uniform algorithm from the NumPower extension.

## Forward pass function
The forward pass in a neural network is the process where the input data is passed through the network's
layers to produce an output. This involves several key operations, including linear transformations
(matrix multiplications), adding biases, and applying activation functions to introduce non-linearity.

The forward function in the CustomModel class is responsible for computing the predictions of the neural network
The forward function in the SimpleModel class is responsible for computing the predictions of the neural network
as well as the loss.

```php
Expand Down Expand Up @@ -171,7 +171,6 @@ $y = new Tensor(nd::array([[0], [1], [0], [1]]), name: 'y');

$model = new SimpleModel();

$start = microtime(true);
for ($current_epoch = 0; $current_epoch < $num_epochs; $current_epoch++) {
// Forward Pass
[$prediction, $loss] = $model->forward($x, $y);
Expand Down

0 comments on commit 12859c3

Please sign in to comment.