MCPcopy Create free account
hub / github.com/thygate/stable-diffusion-webui-depthmap-script / __init__

Method __init__

dmidas/backbones/next_vit.py:177–192  ·  view source on GitHub ↗
(self, in_channels, out_channels, stride=1, path_dropout=0,
                 drop=0, head_dim=32, mlp_ratio=3)

Source from the content-addressed store, hash-verified

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:

Callers

nothing calls this directly

Calls 6

DropPathClass · 0.90
MHCAClass · 0.85
norm_layerFunction · 0.85
PatchEmbedClass · 0.70
MlpClass · 0.70
__init__Method · 0.45

Tested by

no test coverage detected