MCPcopy Create free account
hub / github.com/Francis-Rings/StableAnimator / rand_log_normal

Function rand_log_normal

train.py:212–215  ·  view source on GitHub ↗

Draws samples from an lognormal distribution.

(shape, loc=0., scale=1., device='cpu', dtype=torch.float32)

Source from the content-addressed store, hash-verified

210 return torch.exp(-logsnr / 2) * sigma_data
211
212def rand_log_normal(shape, loc=0., scale=1., device='cpu', dtype=torch.float32):
213 """Draws samples from an lognormal distribution."""
214 u = torch.rand(shape, dtype=dtype, device=device) * (1 - 2e-7) + 1e-7
215 return torch.distributions.Normal(loc, scale).icdf(u).exp()
216
217min_value = 0.002
218max_value = 700

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected