A Bayesian nonparametric extension of Nonnegative Matrix Factorization (NMF) as described in the paper: Beta Process Sparse Nonnegative Matrix Factorization for Music.
Note: BP-NMF uses L-BFGS-B solver from scipy.optimize to jointly optimize multiple univariate functions, which may lead to numerically-unstable result. For more stable result (but much slower), one can replace L-BFGS-B with a univariate solver on each nonconjugate variable.
Note of Note: Since for all the nonconjugate variables update, we are essentially solving an numerical optimization problem with L-BFGS (and haven't figured out a way to do multiplicative-type of update yet), BP-NMF can take quite a while if the input matrix is large (> 2 minutes of 22.05 kHz signals with 1024-point DFT and 50% overlap). Try not to process a huge recording.
Contains the code for inference, utils, the experiments. Note: All the files with the name exp_*.py
are meant to run with IPython Notebook. Also, librosa is required for all the signal processing components in the experiments sciprts.
There is also a Python translation of the gamma process NMF (GaP-NMF) where the original MATLAB code is developed by Matt Hoffman.
A detailed derivation of the full variational inference.
- numpy
- scipy
- librosa (for signal processing components in the experiments)
- python-midi (for blind source separation experiments)