MCPcopy Create free account
hub / github.com/dome272/Diffusion-Models-pytorch / sample_timesteps

Method sample_timesteps

ddpm.py:36–37  ·  view source on GitHub ↗
(self, n)

Source from the content-addressed store, hash-verified

34 return sqrt_alpha_hat * x + sqrt_one_minus_alpha_hat * Ɛ, Ɛ
35
36 def sample_timesteps(self, n):
37 return torch.randint(low=1, high=self.noise_steps, size=(n,))
38
39 def sample(self, model, n):
40 logging.info(f"Sampling {n} new images....")

Callers 1

trainFunction · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected