Git Product home page Git Product logo

ddpm-torch's People

Contributors

tqch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

ddpm-torch's Issues

some checkpoint

HI!Your work is excellent.
I would like to ask if you have pretrained models on the Celeb-HQ dataset or some else at different resolutions, such as 64x64, 128x128, and so on?

Vector-conditioning using classifier-free guidance

I have to implement a conditional diffusion model for synthesizing realistic face images from a feature vector. I found this repo very clarifying. Thank you very much for sharing it!

I made a fork to support conditional sample generation using classifier-free guidance. I have been able to successfully generate class-conditioned samples for the MNIST and CIFAR10 datasets. However, I have not been able to generate CELEBA samples using a feature vector as a condition. I was wondering if these models can be adapted to support not only class-conditioning using classifier-free guidance but also vector-conditioning.

I would greatly appreciate any insights you might have on this matter. Thank you in advance for your time and consideration.

Bug in ddim.py

image

Hi, I found the funciton from_ddpm missing a parameter.

CIFAR 10 config

Can you provide the exact config you used to get those weights which you linked to?

Minor bug in Gaussian Diffusion implementation (q_mean_var)?

Hi, thanks for sharing your code.
I found that q_mean_var function in GaussianDiffusion implementation is strange.

def q_mean_var(self, x_0, t):
mean = self._extract(self.sqrt_alphas_bar, t, x_0) * x_0
var = self._extract(1. - self.alphas_bar, t, x_0)
logvar = self._extract(self.sqrt_one_minus_alphas_bar, t, x_0)
return mean, var, logvar

I think those lines have bug; the logvar variable should literally store log value of var (like torch.log(var)) maybe?
If I am misunderstanding something, I would appreciate your help.
Thanks.

FID for CIFAR10 checkpoint

Hi, I tried generating samples with the example command

python generate.py --dataset cifar10 --chkpt-path ./chkpts/cifar10/cifar10_2040.pt --use-ddim --skip-schedule quadratic --subseq-size 100 --suffix _ddim --num-gpus 4

using the provided checkpoint and calculate the fid using the provided script. The FID I got is only 4.346242031101042 which is different than the reported evaluated metrics table. I'm wondering how to use the checkpoint to achieve the reported number. Thanks!

pretrain

could you display the celebahq 256 size pretrained model

Have you tested the FID for CelebaHQ?

Hi, thanks for your great work for implementing the DDPM baseline. I'm curious about the FID in CelebaHQ, since I have got 21.64 which may be too higher for DDPM. So if possiable, please let me know the correctness of the above results. Thanks!

DDIM sampler training parameters

Hi, thanks for your great work in implementing the DDPM baseline.
I'm curious about the changes in numberOfSteps, betas start and end, when changing the sampler from DDPM to DDIM. could you please provide me with the DDIM sampler training parameters.
Thank you in advance.

KeyError: 'ema'

When I used the following command with your provided checkpoint
python generate.py --dataset cifar10 --chkpt-path cifar10_2040.pt --use-ddim --skip-schedule quadratic --subseq-size 100 --suffix _ddim --num-gpus 2

I receive the following error:
-- Process 1 terminated with the following error:
Traceback (most recent call last):
File "/home/remy/.local/lib/python3.10/site-packages/torch/multiprocessing/spawn.py", line 75, in _wrap
fn(i, *args)
File "/home/remy/ddpm-torch/generate.py", line 72, in generate
state_dict = torch.load(chkpt_path, map_location=device)["ema"]["shadow"]
KeyError: 'ema'

Question about FID calculation

Hi, thanks for your amazing project!
Anyway I was looking through your code and found that while calculating covariance matrix in fid_score.py you set ddof to 0 .

var = np.cov(act, rowvar=False, ddof=0, dtype=np.float64)

But when I look at pytorch-fid library, it seems like they didn't set ddof to 0, which mean they set ddof to None.
https://github.com/mseitzer/pytorch-fid/blob/0a754fb8e66021700478fd365b79c2eaa316e31b/src/pytorch_fid/fid_score.py#L230

Is there any reason you set ddof parameter to 0? It seems like setting ddof to 0 or not makes significant change in FID score. For example, I trained DDPM for cifar10 dataset and tried to calculate FID score. If I set ddof to 0 then resulting FID score was about 8 but when I just use default value for ddof just like pytorch-fid library did it, then resulting FID score was about 11.

Furthermore DDPM library by lucidrains (https://github.com/lucidrains/denoising-diffusion-pytorch), which is one of the most known library implementing DDPM in pytorch, also calculates FID score with ``ddof``` to default value(None)

So I was qurious about the reason you set ddof=0.

Thanks in advance!

FID & Loss diverge on CIFAR10?

Hi,

I used the following command to train the model on CIFAR10
python train.py --dataset cifar10 --num-gpus 4 --use-ema --eval --distributed --rigid-launch

which I was able to achieve the same FID at epoch 2040 as in the performance table.
However, when I keep training it longer, the loss decreases, but FID is worse (picture below). I'm wondering if this is expected or if you have experienced this behavior before?

image

Small details that I'm not sure if they matter is that 1) I change the number of epoch in the config file after training the first 2040 epochs, and 2) I resume the training process on a different machine/GPU.

Thank you for your time!

train my own image datasets

Hello, I am recently learning DDPM, can you tell me how to use your code to train my own image dataset, all images in the same folder?

Meet bugs when adopting the --eval choice for training.

Hi, tqch! Thank you for your excellent work! However, I found the code can not work well if I select the --eval arg for training. As I know, maybe there is something wrong with the sample_fn function. Can you fix this bug? Thank you very much.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.