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

Function rand_log_normal

k_diffusion/utils.py:324–327  ·  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

322
323
324def rand_log_normal(shape, loc=0., scale=1., device='cpu', dtype=torch.float32):
325 """Draws samples from an lognormal distribution."""
326 u = stratified_with_settings(shape, device=device, dtype=dtype) * (1 - 2e-7) + 1e-7
327 return torch.distributions.Normal(loc, scale).icdf(u).exp()
328
329
330def rand_log_logistic(shape, loc=0., scale=1., min_value=0., max_value=float('inf'), device='cpu', dtype=torch.float32):

Callers

nothing calls this directly

Calls 1

stratified_with_settingsFunction · 0.85

Tested by

no test coverage detected