赞
踩
Resnet的构成
代码
import torch import torch.nn as nn from torch.nn import ( Module, Conv2d, MaxPool2d, AvgPool2d, Linear, Softmax, ReLU, BatchNorm2d, Sequential ) def Conv1(in_channel=3, out_channel=64, kernel_size=(7, 7), stride=2, padding=3): return Sequential( Conv2d(in_channels=in_channel, out_channels=out_channel, kernel_size=kernel_size, stride=stride, padding=padding), MaxPool2d(kernel_size=(3, 3), stride=2, padding=1) ) class BottleNeck(Module): def __init__(self, in_channel, out_channel, stride=1, downsampling=False, expansion=4): super(BottleNeck, self).__init__() self
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。