torch.nn.functional
该包提供了很多网络函数
convoludion functions
conv2d
1 | import torch |
输出
torch.Size([64, 16, 30, 30])
torch.Size([64, 16, 32, 32])
relu functions
pooling functions
dropout functions
例子
1 | import torch |
注意$2$中说的问题,不过可能已经被改正了,注意一些就是了。
linear functions
loss functions
参考文献
1.https://pytorch.org/docs/stable/nn.html#torch-nn-functional
2.https://pytorch.org/docs/stable/nn.html#torch-nn-functional