Skip to content

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

Description

@yuanqianguang

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

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循环中好像就无法实现逐步去噪的作用,循环语句中的内容只会执行一次。按我的理解是,生成#语句中那样的时间步序列,然后循环很多次以达到一个逐步去噪的作用。
是我的理解错误么?望百忙之中回复,谢谢~

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions