Jump to content

PyTorch: Difference between revisions

94 bytes added ,  12 July 2023
Line 73: Line 73:
* In your class include all other modules you need during init.
* In your class include all other modules you need during init.
** If you have a list of modules, make sure to wrap them in <code>nn.ModuleList</code> or <code>nn.Sequential</code> so they are properly recognized.
** If you have a list of modules, make sure to wrap them in <code>nn.ModuleList</code> or <code>nn.Sequential</code> so they are properly recognized.
* Wrap any parameters for you model in <code>nn.Parameter(weight, requires_grad=True)</code>.
* Write a forward pass for your model.
* Write a forward pass for your model.