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

Function rand_log_normal

train_single.py:215–218  ·  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

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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected