MCPcopy Create free account
hub / github.com/Sin3DM/Sin3DM / __init__

Method __init__

src/encoding/networks.py:22–46  ·  view source on GitHub ↗
(self, geo_feat_channels, tex_feat_channels, feat_channel_up, mlp_hidden_channels, mlp_hidden_layers, use_tex=True, tex_channels=3, posenc=0)

Source from the content-addressed store, hash-verified

20
21class AutoEncoderGroupV3(nn.Module):
22 def __init__(self, geo_feat_channels, tex_feat_channels, feat_channel_up, mlp_hidden_channels, mlp_hidden_layers, use_tex=True, tex_channels=3, posenc=0) -> None:
23 super().__init__()
24 self.use_tex = use_tex
25
26 self.geo_encoder = nn.Conv3d(1, geo_feat_channels, kernel_size=4, stride=2, padding=1, bias=True)
27 if use_tex:
28 self.tex_encoder = nn.Conv3d(tex_channels + 1, tex_feat_channels, kernel_size=4, stride=2, padding=1, bias=True)
29 out_channels = geo_feat_channels + tex_feat_channels if use_tex else geo_feat_channels
30 self.norm = nn.InstanceNorm2d(out_channels)
31
32 self.geo_feat_dim = geo_feat_channels
33 self.tex_feat_dim = tex_feat_channels
34
35 self.geo_convs = TriplaneGroupResnetBlock(
36 geo_feat_channels, feat_channel_up, ks=5, input_norm=False, input_act=False
37 )
38 self.geo_decoder = DecoderMLP(feat_channel_up, 1, mlp_hidden_channels, mlp_hidden_layers)
39
40 if use_tex:
41 self.tex_convs = TriplaneGroupResnetBlock(
42 tex_feat_channels, feat_channel_up, ks=5, input_norm=False, input_act=False
43 )
44 self.tex_decoder = DecoderMLP(feat_channel_up, tex_channels, mlp_hidden_channels, mlp_hidden_layers, posenc=posenc)
45
46 self.register_buffer("aabb", torch.tensor([-1, -1, -1, 1, 1, 1], dtype=torch.float32))
47
48 def geo_parameters(self):
49 return list(self.geo_encoder.parameters()) + list(self.geo_convs.parameters()) + list(self.geo_decoder.parameters())

Callers 2

__init__Method · 0.45
__init__Method · 0.45

Calls 2

DecoderMLPClass · 0.85

Tested by

no test coverage detected