例子来源于官网60分钟教程中网络搭建部分:
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
class Net(nn.Module):
def __init__(self):
super(Net, self).__init__()
# 1 input image channel, 6 output channels, 5x5 square convolution
# kernel
self.conv1 = nn.Conv2d(1, 6, 5)
self.conv2 = nn.Conv2d(6, 16, 5)
# an affine operation: y = Wx + b
self.fc1 =

该博客详细解析了PyTorch官方60分钟教程中的网络构建部分,通过实例介绍了如何在PyTorch中搭建神经网络,涵盖了基本操作和关键概念。
最低0.47元/天 解锁文章
1141

被折叠的 条评论
为什么被折叠?



