DeepGraphLearning / DeepGraphLearning/PerturbDiff

Question for DDIM sampling configuration

Đang mở
#9 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Ngôn ngữ chính
Python
Star
63
Fork
10
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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.

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

So sánh configs/model/base.yaml và configs/rawdata_diffusion_sampling.yaml, sau đó lần theo resolve_sampling_runner đến src/models/diffusion/diffusion_sampling.py. Tái hiện chuỗi timestep đã cấu hình và kiểm tra cách alphas_cumprod_prev được sử dụng. Được xem là hoàn tất khi ngữ nghĩa thời điểm bắt đầu dự định được xác nhận hoặc một respaced schedule được đặc tả, triển khai và bao phủ bằng một test phù hợp.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
python
Lĩnh vực
machine-learning
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Sôi nổi
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
45/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.