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

Padding features instead of audio in OnTheFlyFeatures #352

Merged
merged 1 commit into from
Aug 3, 2021

Conversation

pzelasko
Copy link
Collaborator

@pzelasko pzelasko commented Aug 3, 2021

Resolves #349 @csukuangfj

I haven't tested it yet besides running tests locally. I'll need to double-check on real data that there are no substantial differences besides the last frame thing.

@pzelasko pzelasko added this to the v0.8 milestone Aug 3, 2021
@pzelasko
Copy link
Collaborator Author

pzelasko commented Aug 3, 2021

I think it's OK, the only difference is in the padding values: when we feed zeroes into the feature extractor, the features have log energy values of -15.9424; when we pad directly, the default value in Lhotse is log(1e-10) (-23.0259). I thought that the feature extractor would also use log(1e-10) given energy_floor=1e-10, but it turns out that's only true for the extra feature dimension you get with use_energy=True. I'm not sure if this discrepancy would really affect anything, so I'm going to merge, and we can always adjust that later if needed.

@pzelasko pzelasko changed the title WIP: padding features instead of audio in OnTheFlyFeatures Padding features instead of audio in OnTheFlyFeatures Aug 3, 2021
@pzelasko
Copy link
Collaborator Author

pzelasko commented Aug 3, 2021

Also: on a random single batch (~44 cuts / ~300s of speech) from librispeech, the speedup is about 3x: ~800ms (old version) vs ~280ms (new version), which is pretty cool. Probably with bucketing there would be less difference, but without it it's very useful.

@pzelasko pzelasko merged commit a91e30b into master Aug 3, 2021
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

Successfully merging this pull request may close these issues.

Unnecessary padding to audio samples in OnTheFlyFeatures
1 participant