The `__init__` method of any subclass should also contain these arguments. Args: dim_in (int): the channel dimension of the input. Normally 3 is used for rgb input, and 2 or 3 is used for optical flow input. dim_out (int): the output dimensio
(
self,
dim_in,
dim_out,
kernel,
stride,
padding,
inplace_relu=True,
eps=1e-5,
bn_mmt=0.1,
norm_module=nn.BatchNorm3d,
)
| 130 | """ |
| 131 | |
| 132 | def __init__( |
| 133 | self, |
| 134 | dim_in, |
| 135 | dim_out, |
| 136 | kernel, |
| 137 | stride, |
| 138 | padding, |
| 139 | inplace_relu=True, |
| 140 | eps=1e-5, |
| 141 | bn_mmt=0.1, |
| 142 | norm_module=nn.BatchNorm3d, |
| 143 | ): |
| 144 | """ |
| 145 | The `__init__` method of any subclass should also contain these arguments. |
| 146 | |
| 147 | Args: |
| 148 | dim_in (int): the channel dimension of the input. Normally 3 is used |
| 149 | for rgb input, and 2 or 3 is used for optical flow input. |
| 150 | dim_out (int): the output dimension of the convolution in the stem |
| 151 | layer. |
| 152 | kernel (list): the kernel size of the convolution in the stem layer. |
| 153 | temporal kernel size, height kernel size, width kernel size in |
| 154 | order. |
| 155 | stride (list): the stride size of the convolution in the stem layer. |
| 156 | temporal kernel stride, height kernel size, width kernel size in |
| 157 | order. |
| 158 | padding (int): the padding size of the convolution in the stem |
| 159 | layer, temporal padding size, height padding size, width |
| 160 | padding size in order. |
| 161 | inplace_relu (bool): calculate the relu on the original input |
| 162 | without allocating new memory. |
| 163 | eps (float): epsilon for batch norm. |
| 164 | bn_mmt (float): momentum for batch norm. Noted that BN momentum in |
| 165 | PyTorch = 1 - BN momentum in Caffe2. |
| 166 | norm_module (nn.Module): nn.Module for the normalization layer. The |
| 167 | default is nn.BatchNorm3d. |
| 168 | """ |
| 169 | super(ResNetBasicStem, self).__init__() |
| 170 | self.kernel = kernel |
| 171 | self.stride = stride |
| 172 | self.padding = padding |
| 173 | self.inplace_relu = inplace_relu |
| 174 | self.eps = eps |
| 175 | self.bn_mmt = bn_mmt |
| 176 | # Construct the stem layer. |
| 177 | self._construct_stem(dim_in, dim_out, norm_module) |
| 178 | |
| 179 | def _construct_stem(self, dim_in, dim_out, norm_module): |
| 180 | self.conv = nn.Conv3d( |
nothing calls this directly
no test coverage detected