MCPcopy Create free account
hub / github.com/VisionXLab/OF-Diff / sample_log

Method sample_log

ldm/models/diffusion/ddpm.py:1118–1129  ·  view source on GitHub ↗
(self, cond, batch_size, ddim, ddim_steps, **kwargs)

Source from the content-addressed store, hash-verified

1116
1117 @torch.no_grad()
1118 def sample_log(self, cond, batch_size, ddim, ddim_steps, **kwargs):
1119 if ddim:
1120 ddim_sampler = DDIMSampler(self)
1121 shape = (self.channels, self.image_size, self.image_size)
1122 samples, intermediates = ddim_sampler.sample(ddim_steps, batch_size,
1123 shape, cond, verbose=False, **kwargs)
1124
1125 else:
1126 samples, intermediates = self.sample(cond=cond, batch_size=batch_size,
1127 return_intermediates=True, **kwargs)
1128
1129 return samples, intermediates
1130
1131 @torch.no_grad()
1132 def get_unconditional_conditioning(self, batch_size, null_label=None):

Callers 3

log_imagesMethod · 0.95
log_imagesMethod · 0.45
log_imagesMethod · 0.45

Calls 3

sampleMethod · 0.95
sampleMethod · 0.95
DDIMSamplerClass · 0.90

Tested by

no test coverage detected