(self, in_channels, out_channels, stride=1, path_dropout=0,
drop=0, head_dim=32, mlp_ratio=3)
| 175 | Next Convolution Block |
| 176 | """ |
| 177 | def __init__(self, in_channels, out_channels, stride=1, path_dropout=0, |
| 178 | drop=0, head_dim=32, mlp_ratio=3): |
| 179 | super(NCB, self).__init__() |
| 180 | self.in_channels = in_channels |
| 181 | self.out_channels = out_channels |
| 182 | norm_layer = partial(nn.BatchNorm2d, eps=NORM_EPS) |
| 183 | assert out_channels % head_dim == 0 |
| 184 | |
| 185 | self.patch_embed = PatchEmbed(in_channels, out_channels, stride) |
| 186 | self.mhca = MHCA(out_channels, head_dim) |
| 187 | self.attention_path_dropout = DropPath(path_dropout) |
| 188 | |
| 189 | self.norm = norm_layer(out_channels) |
| 190 | self.mlp = Mlp(out_channels, mlp_ratio=mlp_ratio, drop=drop, bias=True) |
| 191 | self.mlp_path_dropout = DropPath(path_dropout) |
| 192 | self.is_bn_merged = False |
| 193 | |
| 194 | def merge_bn(self): |
| 195 | if not self.is_bn_merged: |
nothing calls this directly
no test coverage detected