MCPcopy Create free account
hub / github.com/Meshcapade/difflocks / __init__

Method __init__

k_diffusion/layers.py:300–307  ·  view source on GitHub ↗
(self, feats_in, c_out, num_groups, eps=1e-5, cond_key='cond')

Source from the content-addressed store, hash-verified

298
299class AdaGN(ConditionedModule):
300 def __init__(self, feats_in, c_out, num_groups, eps=1e-5, cond_key='cond'):
301 super().__init__()
302 self.num_groups = num_groups
303 self.eps = eps
304 self.cond_key = cond_key
305 self.mapper = nn.Linear(feats_in, c_out * 2)
306 nn.init.zeros_(self.mapper.weight)
307 nn.init.zeros_(self.mapper.bias)
308
309 def forward(self, input, cond):
310 weight, bias = self.mapper(cond[self.cond_key]).chunk(2, dim=-1)

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected