原文:https://pytorch.org/tutorials/beginner/blitz/neural_networks_tutorial.html
NEURAL NETWORKS
Neural networks can be constructed using the torch.nn
package.
Now that you had a glimpse of autograd
, nn
depends on autograd
to define models and differentiate them. An nn.Module
contains layers, and a method forward(input)
that returns the output
.
For example, look at this network that classifies digit images:
convnet
It is a simple feed-forward network. It takes the input, feeds it through several layers one after the other, and then finally gives the output.
上面这张图的C1 S2 C3的维度不正确。正确的如下: