class_docstr: 注意：原论文中，在虚线残差结构的主分支上，第一个1x1卷积层的步距是2，第二个3x3卷积层步距是1。
  但在pytorch官方实现过程中是第一个1x1卷积层的步距是1，第二个3x3卷积层步距是2，
  这么做的好处是能够在top1上提升大概0.5%的准确率。
  可参考Resnet v1.5 https://ngc.nvidia.com/catalog/model-scripts/nvidia:resnet_50_v1_5_for_pytorch
class_docstr_tok: ["\u6ce8\u610f\uff1a\u539f\u8bba\u6587\u4e2d\uff0c\u5728\u865a\u7ebf\u6b8b\u5dee\u7ed3\u6784\u7684\u4e3b\u5206\u652f\u4e0a\uff0c\u7b2c\u4e00\u4e2a1x1\u5377\u79ef\u5c42\u7684\u6b65\u8ddd\u662f2\uff0c\u7b2c\u4e8c\u4e2a3x3\u5377\u79ef\u5c42\u6b65\u8ddd\u662f1\u3002","\u4f46\u5728pytorch\u5b98\u65b9\u5b9e\u73b0\u8fc7\u7a0b\u4e2d\u662f\u7b2c\u4e00\u4e2a1x1\u5377\u79ef\u5c42\u7684\u6b65\u8ddd\u662f1\uff0c\u7b2c\u4e8c\u4e2a3x3\u5377\u79ef\u5c42\u6b65\u8ddd\u662f2\uff0c","\u8fd9\u4e48\u505a\u7684\u597d\u5904\u662f\u80fd\u591f\u5728top1\u4e0a\u63d0\u5347\u5927\u69820.5","%","\u7684\u51c6\u786e\u7387\u3002","\u53ef\u53c2\u8003Resnet","v1.5","https",":","\/\/ngc.nvidia.com\/catalog\/model-scripts\/nvidia",":","resnet_50_v1_5_for_pytorch"]
code: def __init__(
      self,
      in_channel,
      out_channel,
      stride=1,
      downsample=None,
      groups=1,
      width_per_group=64,
  ):
      super(Bottleneck, self).__init__()
  
      width = int(out_channel * (width_per_group / 64.0)) * groups
  
      self.conv1 = nn.Conv2d(
          in_channels=in_channel,
          out_channels=width,
          kernel_size=1,
          stride=1,
          bias=False,
      )  # squeeze channels
      self.bn1 = nn.BatchNorm2d(width)
      # -----------------------------------------
      self.conv2 = nn.Conv2d(
          in_channels=width,
          out_channels=width,
          groups=groups,
          kernel_size=3,
          stride=stride,
          bias=False,
          padding=1,
      )
      self.bn2 = nn.BatchNorm2d(width)
      # -----------------------------------------
      self.conv3 = nn.Conv2d(
          in_channels=width,
          out_channels=out_channel * self.expansion,
          kernel_size=1,
          stride=1,
          bias=False,
      )  # unsqueeze channels
      self.bn3 = nn.BatchNorm2d(out_channel * self.expansion)
      self.relu = nn.ReLU(inplace=True)
      self.downsample = downsample
  
file_path: deep-learning-for-image-processing/pytorch_classification/Test5_resnet/model.py
imports: import torch.nn
  import torch
label_desc: Use image node_id 1 to create a new Bottleneck object from inherited base classes: nn with example: obj = Bottleneck(in_channel, out_channel, stride, downsample, groups, width_per_group)