DeepGraphLearning / DeepGraphLearning/PerturbDiff

Question for DDIM sampling configuration

Ouverte
#9 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Langage dominant
Python
Étoiles
63
Forks
10
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

Hi, thank you for releasing the PerturbDiff implementation. I noticed a possible mismatch between the DDIM sampling configuration and the training diffusion schedule.

The model is configured with a 1000-step diffusion process:

However, the default sampling configuration uses:

In [resolve_sampling_runner](https://github.com/DeepGraphLearning/PerturbDiff/blob/main/src/apps/sampling/sampling_generation_helpers.py#L23-L34), this value is passed directly to ddim_sample_loop as start_time. The DDIM loop then:

  1. Initializes the state from standard Gaussian noise:
img = noise if noise is not None else th.randn(*shape, device=device)
  1. Constructs consecutive timestep indices:
indices = list(range(start_time))[::-1]

Therefore, with the default configuration, sampling starts from pure Gaussian noise at timestep 99 and performs 100 consecutive updates:

99 -> 98 -> ... -> 1 -> 0

This behavior is implemented in [ddim_sample_loop_progressive](https://github.com/DeepGraphLearning/PerturbDiff/blob/main/src/models/diffusion/diffusion_sampling.py#L559-L590). Each DDIM update also uses alphas_cumprod_prev[t], so it specifically transitions from timestep t to the adjacent timestep t-1, rather than between respaced timesteps:

My concern is that, under the default 1000-step linear schedule, timestep 99 is not close to the terminal Gaussian distribution. The configured beta schedule gives approximately:

alpha_bar[99] = 0.897
sqrt(alpha_bar[99]) = 0.947
sqrt(1 - alpha_bar[99]) = 0.321

Therefore, the forward-process state at timestep 99 is approximately:

x_99 = 0.947 * x_0 + 0.321 * noise

In other words, the training distribution at timestep 99 still contains a strong contribution from the clean sample. The sampler instead initializes:

x_99 ~ Normal(0, I)

If the intended goal is accelerated DDIM sampling with 100 model evaluations, I would expect the sampler to select approximately 100 respaced timesteps spanning the full training horizon from 999 to 0, and to calculate each update using the previous selected timestep. The current implementation instead appears to treat start_time as both the desired number of sampling steps and the actual starting diffusion timestep.

Could you please explain the rationale for initializing pure Gaussian noise at timestep 99? Is this behavior intentional, or should the 100-step DDIM sampler use a respaced timestep sequence covering the full 1000-step training schedule?

Thank you for your time and clarification.

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Piste de recherche

Comparez configs/model/base.yaml et configs/rawdata_diffusion_sampling.yaml, puis suivez resolve_sampling_runner jusqu’à src/models/diffusion/diffusion_sampling.py. Reproduisez la séquence de pas de temps configurée et examinez comment alphas_cumprod_prev est utilisé. Le travail est terminé lorsque la sémantique prévue du temps de début est confirmée, ou qu’un schedule respaced est spécifié, implémenté et couvert par un test approprié.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
python
Domaine
machine-learning
Type d'issue
Bug
Difficulté
4/5
Temps estimé
3-5 jours
Activité
Active
Clarté
Plutôt claire
Accessibilité débutants
45/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.