MCPcopy Create free account
hub / github.com/deepbrainai-research/float / NoiseInjection

Class NoiseInjection

models/float/styledecoder.py:271–282  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

269
270
271class NoiseInjection(nn.Module):
272 def __init__(self):
273 super().__init__()
274
275 self.weight = nn.Parameter(torch.zeros(1))
276
277 def forward(self, image, noise=None):
278
279 if noise is None:
280 return image
281 else:
282 return image + self.weight * noise
283
284
285class ConstantInput(nn.Module):

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected