Open
Description
Hi~
Your work inspire me a lot and I'm really appreciate for such meaningful and excellent work. However I fail to generate meaningful images on cifar10.. Could you help me find out what's wrong in my code?
I think it's might be easy to generate images without classifier's gradient, so I first try to generate images only by the gradient from diffusion model. Here is my code:
x = torch.randn(1, *img_shape, device=self.device)
x = x * 0.5 + 0.5
x.requires_grad = True
optimizer = torch.optim.Adam([x], lr=2e-2)
for _ in tqdm(range(iter_each_sample)): # iterate for 1000 times
optimizer.zero_grad()
print(self.partial(x, class_id)) # get the gradient of
optimizer.step()
x.grad = None
x.requires_grad = False
x = torch.clamp(x, min=0, max=1)
Here, class_id is None, and self.partial is a function that get the gradient of :
I use NCSNpp architecture and model weight from Yang Song's official code.
But finally, images generated by this code is like this:
It's not meaningful... Could you help find what's wrong here?
Metadata
Assignees
Labels
No labels
Activity