Skip to content

make_indices error #69

Description

@ZhaoRunyi

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:

defmake_indices(self, path_lengths, horizon):
''' makes indices for sampling from dataset; each index maps to a datapoint '''indices= []
fori, path_lengthinenumerate(path_lengths):
max_start=min(path_length-1, self.max_path_length-horizon)
ifnotself.use_padding:
max_start=min(max_start, path_length-horizon)
forstartinrange(max_start):
end=start+horizonindices.append((i, start, end))
indices=np.array(indices)
returnindices

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!

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