Update diffusion.py
Browse files- diffusion.py +3 -3
diffusion.py
CHANGED
@@ -49,9 +49,9 @@ class Diffusion_cond:
|
|
49 |
for i in tqdm(reversed(range(1, self.noise_steps)), position=0): # reverse loop from T to 1
|
50 |
t = (torch.ones(n) * i).long().to(self.device) # create timesteps tensor of length n
|
51 |
predicted_noise = model(x, y, labels, t)
|
52 |
-
if cfg_scale > 0:
|
53 |
-
|
54 |
-
|
55 |
|
56 |
|
57 |
alpha = self.alpha[t][:, None, None, None]
|
|
|
49 |
for i in tqdm(reversed(range(1, self.noise_steps)), position=0): # reverse loop from T to 1
|
50 |
t = (torch.ones(n) * i).long().to(self.device) # create timesteps tensor of length n
|
51 |
predicted_noise = model(x, y, labels, t)
|
52 |
+
# if cfg_scale > 0:
|
53 |
+
# uncond_predicted_noise = model(x, y, None, t)
|
54 |
+
# predicted_noise = torch.lerp(uncond_predicted_noise, predicted_noise, cfg_scale)
|
55 |
|
56 |
|
57 |
alpha = self.alpha[t][:, None, None, None]
|