MCPcopy Create free account
hub / github.com/SooLab/CGFormer / __init__

Method __init__

model/layers.py:87–102  ·  view source on GitHub ↗
(self, text_dim=512, in_dim=512, kernel_size=1)

Source from the content-addressed store, hash-verified

85
86class DProjector(nn.Module):
87 def __init__(self, text_dim=512, in_dim=512, kernel_size=1):
88 super().__init__()
89 self.in_dim = in_dim
90 self.kernel_size = kernel_size
91 # visual projector
92
93 self.vis = nn.Sequential( # os16 -> os4
94 nn.Upsample(scale_factor=2, mode='bilinear'),
95 conv_layer(in_dim, in_dim, 3, padding=1),
96 nn.Upsample(scale_factor=2, mode='bilinear'),
97 conv_layer(in_dim, in_dim, 3, padding=1),
98 nn.Conv2d(in_dim, in_dim, 1))
99
100 # textual projector
101 out_dim = 1 * in_dim * kernel_size * kernel_size + 1
102 self.txt = nn.Linear(text_dim, out_dim)
103
104 def forward(self, x, text):
105 '''

Callers

nothing calls this directly

Calls 2

conv_layerFunction · 0.85
__init__Method · 0.45

Tested by

no test coverage detected