DeepGraphLearning / DeepGraphLearning/PerturbDiff

Question for DDIM sampling configuration

オープン
#9 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
Python
スター
63
フォーク
10
PR マージ指標
30日以内にマージされた PR はありません

説明

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.

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

configs/model/base.yaml と configs/rawdata_diffusion_sampling.yaml を比較し、次に resolve_sampling_runner を src/models/diffusion/diffusion_sampling.py まで追跡します。設定された timestep のシーケンスを再現し、alphas_cumprod_prev がどのように使用されているかを調べます。開始時刻の意図したセマンティクスが確認されるか、respaced schedule が仕様化、実装され、適切なテストでカバーされれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python
領域
machine-learning
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
活発
明瞭さ
おおむね明確
初心者へのやさしさ
45/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。