MCPcopy Create free account
hub / github.com/LTH14/mar / __init__

Method __init__

models/diffloss.py:135–142  ·  view source on GitHub ↗
(self, model_channels, out_channels)

Source from the content-addressed store, hash-verified

133 The final layer adopted from DiT.
134 """
135 def __init__(self, model_channels, out_channels):
136 super().__init__()
137 self.norm_final = nn.LayerNorm(model_channels, elementwise_affine=False, eps=1e-6)
138 self.linear = nn.Linear(model_channels, out_channels, bias=True)
139 self.adaLN_modulation = nn.Sequential(
140 nn.SiLU(),
141 nn.Linear(model_channels, 2 * model_channels, bias=True)
142 )
143
144 def forward(self, x, c):
145 shift, scale = self.adaLN_modulation(c).chunk(2, dim=-1)

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected