MCPcopy Create free account
hub / github.com/MotrixLab/ViMoGen / sample_t_and_sigma

Method sample_t_and_sigma

trainer/sd3_scheduler.py:30–46  ·  view source on GitHub ↗
(
        self,
        batch_size: int,
        frames: int,
        height: int,
        width: int,
        sample_type: str = 'logitnorm',
        device=None,
    )

Source from the content-addressed store, hash-verified

28 self.base_scale = base_scale
29
30 def sample_t_and_sigma(
31 self,
32 batch_size: int,
33 frames: int,
34 height: int,
35 width: int,
36 sample_type: str = 'logitnorm',
37 device=None,
38 ):
39 if sample_type == 'logitnorm':
40 t = self.logitnorm_sample_t(
41 batch_size, self.logit_mean, self.logid_std, device=device)
42 elif sample_type == 'uniform':
43 t = torch.rand((batch_size, ), device=device)
44 sigma = self.sigma_shift(t, frames, height, width)
45 # NOTE in the training process, the t is also shifted according to resolution
46 return sigma
47
48 @staticmethod
49 def logitnorm_sample_t(

Callers

nothing calls this directly

Calls 2

logitnorm_sample_tMethod · 0.95
sigma_shiftMethod · 0.95

Tested by

no test coverage detected