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

Asking for samples that are the same duration as the data fails #82

Closed
justinsalamon opened this issue Jul 19, 2017 · 0 comments
Closed

Comments

@justinsalamon
Copy link
Contributor

If your data has n_frames and you ask for samples that are n_frames long:

pump.sampler(max_samples, n_frames, random_state=seed)

It will crash, because of this line: since you can't call randint(0,0).
Beyond crashing, I think there's an off-by-one error here: if the data is of size D and you ask for samples of N frames, then the range of valid start indices is [0, D-N] (including D-N), not [0, D-N).

Suggested fix: update line 139 in sample.py as such:

yield self.rng.randint(0, duration - self.duration + 1)
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