MCPcopy Create free account
hub / github.com/MoonInTheRiver/DiffSinger / noise_like

Function noise_like

usr/diff/shallow_diffusion_tts.py:161–164  ·  view source on GitHub ↗
(shape, device, repeat=False)

Source from the content-addressed store, hash-verified

159
160
161def noise_like(shape, device, repeat=False):
162 repeat_noise = lambda: torch.randn((1, *shape[1:]), device=device).repeat(shape[0], *((1,) * (len(shape) - 1)))
163 noise = lambda: torch.randn(shape, device=device)
164 return repeat_noise() if repeat else noise()
165
166
167def linear_beta_schedule(timesteps, max_beta=hparams.get('max_beta', 0.01)):

Callers 1

p_sampleMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected