Draws samples from an lognormal distribution.
(shape, loc=0., scale=1., device='cpu', dtype=torch.float32)
| 213 | |
| 214 | |
| 215 | def 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 | |
| 221 | min_value = 0.002 |
nothing calls this directly
no outgoing calls
no test coverage detected