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

Function rand_log_uniform

k_diffusion/utils.py:340–344  ·  view source on GitHub ↗

Draws samples from an log-uniform distribution.

(shape, min_value, max_value, device='cpu', dtype=torch.float32)

Source from the content-addressed store, hash-verified

338
339
340def rand_log_uniform(shape, min_value, max_value, device='cpu', dtype=torch.float32):
341 """Draws samples from an log-uniform distribution."""
342 min_value = math.log(min_value)
343 max_value = math.log(max_value)
344 return (stratified_with_settings(shape, device=device, dtype=dtype) * (max_value - min_value) + min_value).exp()
345
346
347def rand_v_diffusion(shape, sigma_data=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