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

make_indices error #69

Open
ZhaoRunyi opened this issue Aug 30, 2024 · 0 comments
Open

make_indices error #69

ZhaoRunyi opened this issue Aug 30, 2024 · 0 comments

Comments

@ZhaoRunyi
Copy link

ZhaoRunyi commented Aug 30, 2024

Hi, all respect to your fantastic work,. However, it seems that there is a bug in your code, specifically, in /diffuser/diffuser/datasets/sequence.py line 57, the definition of function make_indices:

def make_indices(self, path_lengths, horizon):
        '''
            makes indices for sampling from dataset;
            each index maps to a datapoint
        '''
        indices = []
        for i, path_length in enumerate(path_lengths):
            max_start = min(path_length - 1, self.max_path_length - horizon)
            if not self.use_padding:
                max_start = min(max_start, path_length - horizon)
            for start in range(max_start):
                end = start + horizon
                indices.append((i, start, end))
        indices = np.array(indices)
        return indices

say we have a path with path_length = 34 and path_length - 1 < self.max_path_length - horizon, the max_start would be 33 so as for for start in range(max_start), the start would be in [0, 32], which means that the final timestep with index 33 can't be reached.

Hope you can fix it, and thanks a lot.

Best Regards!

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