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

Method loss

k_diffusion/layers.py:244–248  ·  view source on GitHub ↗
(self, input, noise, sigma, **kwargs)

Source from the content-addressed store, hash-verified

242 """L_simple with the Karras et al. preconditioner."""
243
244 def loss(self, input, noise, sigma, **kwargs):
245 noised_input = input + noise * utils.append_dims(sigma, input.ndim)
246 denoised = self(noised_input, sigma, **kwargs)
247 eps = sampling.to_d(noised_input, sigma, denoised)
248 return (eps - noise).pow(2).flatten(1).mean(1)
249
250
251# Residual blocks

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected