Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds Kaldi Pitch Feature detailed in "A pitch extraction algorithm tuned for automatic speech recognition".
The interface is mostly same as
compute-kaldi-pitch-feats
CLI. Batch support is added viaat::parallel_for
function.As the function binds the custom built
libkaldi
, it only supports CPU (andfloat32
) at the moment.About the custom built Kaldi
Since kaldi is a large library, I choose to use only a subset of it by adding custom build process. In addition to that, to reduce the dependencies and make the build process, I reused the BLAS package PyTorch uses. For this, I added custom interface of Kaldi's matrix libraries. Therefor the algorithm runs on
torch::Tensor
class. However, some parts of the algorithms requires direct access to memory, so the resulting function is not differentiable. Also the resulting code is very slow (60x) at the moment due to the overhead of slicing operation. (Kaldi's feature implementations work element-wise, while PyTorch operates faster when operations are vectorized.)Supersedes #1063