MCPcopy Create free account
hub / github.com/CompVis/diff2flow / __init__

Method __init__

diff2flow/flow.py:378–385  ·  view source on GitHub ↗

Logit-Normal sampler from the paper 'Scaling Rectified Flow Transformers for High-Resolution Image Synthesis' - Esser et al. (ICML 2024)

(self, loc: float = 0.0, scale: float = 1.0)

Source from the content-addressed store, hash-verified

376
377class LogitNormalSampler:
378 def __init__(self, loc: float = 0.0, scale: float = 1.0):
379 """
380 Logit-Normal sampler from the paper 'Scaling Rectified
381 Flow Transformers for High-Resolution Image Synthesis'
382 - Esser et al. (ICML 2024)
383 """
384 self.loc = loc
385 self.scale = scale
386
387 def __call__(self, n, device='cpu', dtype=torch.float32):
388 return torch.sigmoid(self.loc + self.scale * torch.randn(n)).to(device).to(dtype)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected