-
Notifications
You must be signed in to change notification settings - Fork 160
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
[WIP] Decoding from the categorical posterior distribution #38
base: master
Are you sure you want to change the base?
Conversation
…rom a categorical distribution.
@maxrmorrison would it be possible to carve out the relevant viterbi code only, so as to avoid having the entirety of librosa as a (heavy) dependency? |
I wouldn't mind adding librosa as a dependency |
@jongwook what's your justification? The greater the dependency chain, the greater the technical debt (=more maintenance), and the greater the chances of users running into issues during installation. It also inflates the storage space requires and limits deployment on less standard/embedded platforms if some dependencies don't support these. It seems like all the sequence modelling code is concentrated in one source file, why not extract only what we need? |
@justinsalamon we can further narrow the dependency requirement to just two functions (librosa.sequence.viterbi and librosa.sequence._viterbi) and a custom error class (librosa.util.exceptions.ParameterError). Those 3 have no other dependencies within librosa. I would be okay with extracting them. Where would be the best place to give the proper attribution that those functions and exceptions had come from librosa? |
@justinsalamon Justifications: Since we already depend on resampy, I don't think adding librosa would be a substantial roadblock anywhere especially when we require the whole TensorFlow and Keras too. TensorFlow itself is ~500MB while a In less standard/embedded platforms, it'll require special treatment of dealing with TensorFlow anyway, and I don't think there is a platform where librosa can't run while TensorFlow runs without modification. Since librosa is a de-facto standard library of audio analysis in Python, I expect many "customers" of crepe would already have librosa. In terms of maintenance, by duplicating librosa code we take the responsibility of backporting any future issues of librosa's Viterbi code. So it's debatable which creates more "technical debt". |
I'd be in favor of carving out only the needed functionality, but @jongwook it's your final call. |
It appears that llvmlite inherited via numba sometimes can be an issue on ARM and Windows hosts. I personally had no problem installing librosa on Windows and a Raspberry Pi, so I suspect those issues are isolated ones. Meanwhile, we rely on numba via resampy anyway, and easy alternatives like Scipy's resampling methods have many drawbacks. Also, because of my intentional choice of not using librosa, we used scipy.wavfile and supported WAV files only because of that. So using librosa we can just use So I'd like to keep the current PR which calls @maxrmorrison Thanks for the PR! The code looks good to me, but let me confirm that it definitely improves on the RWC-synth dataset compared to hmmlearn. |
Implements the proposed alternative to posterior decoding of the network output as suggested in #37.
Remaining tasks: