Pytorch残差网络ResNet
完整训练代码见 >>Github链接,泛化结果有一点点问题,之后有时间再改
ResNet结构
class Residual(nn.Module):
def __init__(self,input_channels,num_channels,use_1x1conv=False,strides=1):
super().__init__()
self.conv1 = nn.Conv2d(input_channels,num_channels,
kernel_size=3,padding=1,stride=strides)
self.conv2 = nn.Conv2d(num_channels,num_channels,
kernel_size=3,padding=1)
if use_1x1conv:
self.conv3 = nn.</