Skip to content

Commit

Permalink
Update 4-autograd-model.mdx
Browse files Browse the repository at this point in the history
Use BinaryCrossEntropy for classification instead of MSE Regression
  • Loading branch information
henrique-borba authored Jun 13, 2024
1 parent 1a33838 commit fbfee04
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 @@ -90,8 +90,8 @@ public function forward(Tensor $x, Tensor $y): array
$x = $x->matmul($this->weights_output_layer) + $this->output_bias;
$x = activation::sigmoid($x); // Sigmoid Activation

// Mean Squared Error
$loss = loss::MeanSquaredError($x, $y, name: 'loss');
// Binary Cross Entropy Loss
$loss = loss::BinaryCrossEntropy($x, $y, name: 'loss');
return [$x, $loss];
}
```
Expand Down

0 comments on commit fbfee04

Please sign in to comment.