You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: pytorch_tutorial/convolutional_neural_network/README.md
+11
Original file line number
Diff line number
Diff line change
@@ -197,6 +197,17 @@ print(model)
197
197
198
198
### Parameter count
199
199
200
+
The total number of parameters for this model is obtained by summing the parameter counts for each of its layers:
201
+
202
+
-[Linear](https://pytorch.org/docs/stable/generated/torch.nn.Linear.html) and [LazyLinear](https://pytorch.org/docs/stable/generated/torch.nn.LazyLinear.html) layers have `(in_features + 1) * out_features` parameters (the `+1` accounts for bias).
203
+
- For [Conv2d](https://pytorch.org/docs/stable/generated/torch.nn.Conv2d.html) layers, each kernel has `in_channels * kernel_size * kernel_size + 1` parameters.
204
+
-[MaxPool2d](https://pytorch.org/docs/stable/generated/torch.nn.MaxPool2d.html) and [Flatten](https://pytorch.org/docs/stable/generated/torch.nn.Flatten.html) layers have no parameters.
205
+
206
+
> [!NOTE]
207
+
> The `get_parameter_count()` utility function was defined in a [previous example](../linear_regression/README.md#parameter-count).
0 commit comments