Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ddim中对于time生成的程序语句似乎不对? #118

Open
yuanqianguang opened this issue Jul 22, 2024 · 0 comments
Open

ddim中对于time生成的程序语句似乎不对? #118

yuanqianguang opened this issue Jul 22, 2024 · 0 comments

Comments

@yuanqianguang
Copy link

yuanqianguang commented Jul 22, 2024

作者您好:
以下是我遇到的问题,望能得到解答。

def ddim_sample(self, batched_inputs, backbone_feats, images_whwh, images, clip_denoised=True, do_postprocess=True):
    batch = images_whwh.shape[0]
    shape = (batch, self.num_proposals, 4)
    total_timesteps, sampling_timesteps, eta, objective = self.num_timesteps, self.sampling_timesteps, self.ddim_sampling_eta, self.objective

    # [-1, 0, 1, 2, ..., T-1] when sampling_timesteps == total_timesteps
    times = torch.linspace(-1, total_timesteps - 1, steps=sampling_timesteps + 1)
    times = list(reversed(times.int().tolist()))
    time_pairs = list(zip(times[:-1], times[1:]))  # [(T-1, T-2), (T-2, T-3), ..., (1, 0), (0, -1)]

这段程序中关于sampling_timesteps设置为1之后,所生成的times似乎是(999,-1)这样的结果,这样的话在下面的for循环中好像就无法实现逐步去噪的作用,循环语句中的内容只会执行一次。按我的理解是,生成#语句中那样的时间步序列,然后循环很多次以达到一个逐步去噪的作用。
是我的理解错误么?望百忙之中回复,谢谢~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant