MCPcopy Index your code
hub / github.com/VisionXLab/OF-Diff / __init__

Method __init__

cldm/fet.py:61–75  ·  view source on GitHub ↗
(self, hint_channels, dim=2)

Source from the content-addressed store, hash-verified

59
60class FeatureExtractor(nn.Module):
61 def __init__(self, hint_channels, dim=2):
62 super(FeatureExtractor, self).__init__()
63 self.initial_conv = conv_nd(dim, hint_channels, 16, kernel_size=3, stride=1, padding=1)
64 self.layer1 = ResidualBlock(dim, 16, 16)
65 self.conv_before_res2 = conv_nd(dim, 16, 32, kernel_size=3, stride=1, padding=1)
66 self.layer2 = ResidualBlock(dim, 32, 32)
67 self.patch_merge1 = PatchMerging(patch_dim=32)
68 self.conv_before_res3 = conv_nd(dim, 64, 64, kernel_size=3, stride=1, padding=1)
69 self.layer3 = ResidualBlock(dim, 64, 64)
70 self.patch_merge2 = PatchMerging(patch_dim=64)
71 self.conv_before_res4 = conv_nd(dim, 128, 128, kernel_size=3, stride=1, padding=1)
72 self.layer4 = ResidualBlock(dim, 128, 128)
73 self.patch_merge3 = PatchMerging(patch_dim=128)
74 self.conv_before_res5 = conv_nd(dim, 256, 256, kernel_size=3, stride=1, padding=1)
75 self.layer5 = ResidualBlock(dim, 256, 256)
76
77 def forward(self, x):
78 x = self.initial_conv(x)

Callers

nothing calls this directly

Calls 4

conv_ndFunction · 0.90
ResidualBlockClass · 0.85
PatchMergingClass · 0.85
__init__Method · 0.45

Tested by

no test coverage detected