MCPcopy Create free account
hub / github.com/JasonLSC/GSCodec_Studio / __init__

Method __init__

examples/utils.py:56–78  ·  view source on GitHub ↗
(
        self,
        n: int,
        feature_dim: int,
        embed_dim: int = 16,
        sh_degree: int = 3,
        mlp_width: int = 64,
        mlp_depth: int = 2,
    )

Source from the content-addressed store, hash-verified

54 """Appearance optimization module."""
55
56 def __init__(
57 self,
58 n: int,
59 feature_dim: int,
60 embed_dim: int = 16,
61 sh_degree: int = 3,
62 mlp_width: int = 64,
63 mlp_depth: int = 2,
64 ):
65 super().__init__()
66 self.embed_dim = embed_dim
67 self.sh_degree = sh_degree
68 self.embeds = torch.nn.Embedding(n, embed_dim)
69 layers = []
70 layers.append(
71 torch.nn.Linear(embed_dim + feature_dim + (sh_degree + 1) ** 2, mlp_width)
72 )
73 layers.append(torch.nn.ReLU(inplace=True))
74 for _ in range(mlp_depth - 1):
75 layers.append(torch.nn.Linear(mlp_width, mlp_width))
76 layers.append(torch.nn.ReLU(inplace=True))
77 layers.append(torch.nn.Linear(mlp_width, 3))
78 self.color_head = torch.nn.Sequential(*layers)
79
80 def forward(
81 self, features: Tensor, embed_ids: Tensor, dirs: Tensor, sh_degree: int

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected