Skip to content

Commit 53ab44f

Browse files
author
Jason Andrews
committed
spelling
1 parent 5176d8f commit 53ab44f

File tree

1 file changed

+1
-1
lines changed
  • content/learning-paths/cross-platform/pytorch-digit-classification-arch-training

1 file changed

+1
-1
lines changed

content/learning-paths/cross-platform/pytorch-digit-classification-arch-training/model-opt.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class NeuralNetwork(nn.Module):
5757
return x # Outputs raw logits
5858
```
5959

60-
This code defines a neural network in PyTorch for digit classification, consisting of three linear layers with ReLU activations and optional dropout layers for regularization. The network first flattens the input, that is a 28x28 image, and passes it through two linear layers, each followed by a ReLU activation and if enbaled, a dropout layer. The final layer produces raw logits as the output. Notably, the softmax layer has been removed to enable quantization and layer fusion during model optimization, allowing better performance when deploying the model on mobile or edge devices.
60+
This code defines a neural network in PyTorch for digit classification, consisting of three linear layers with ReLU activations and optional dropout layers for regularization. The network first flattens the input, that is a 28x28 image, and passes it through two linear layers, each followed by a ReLU activation and if enabled, a dropout layer. The final layer produces raw logits as the output. Notably, the softmax layer has been removed to enable quantization and layer fusion during model optimization, allowing better performance when deploying the model on mobile or edge devices.
6161

6262
The output is left as logits, and the softmax function can be applied during post-processing, particularly during inference.
6363

0 commit comments

Comments
 (0)