######################################################################## # TODO: "Implement the forward function for the Resnet specified" # # above. HINT: You might need to create a helper class to # # define a Resnet block and then use that block here to create # # the resnet layers i.e. conv2_x, conv3_x, conv4_x and conv5_x # ######################################################################## # *****START OF YOUR CODE (DO NOT DELETE/MODIFY THIS LINE)***** class ResNet(nn.Module): def __init__(self): super(ResNet, self).__init__() in_channels = 64 out_channels = 64 stride = 1 self.conv1 = nn.Conv2d(3, 64, kernel_size=7, stride=2, padding=3, bias=False) self.bn1 = nn.BatchNorm2d(64) nn.ReLU() self.maxpool = nn.MaxPool2d(kernel_size = 3, stride = 2, padding = 1) pass def forward(self): pass ######################################################################## # END OF YOUR CODE # ########################################################################
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter