iosr-surrey / untwist Goto Github PK
View Code? Open in Web Editor NEWLicense: Other
License: Other
In the following block of code found in file mlp_examples.py, lines 38-40
Xtrain = X[:,train_frames:].magnitude().T
Xtest = ds.standardize_points(Xtest)
pred = sgd.predict(Xtest)
I believe there is a typo-o, where in the middle code line above, Xtest is used before it is defined.
It seems to me that it is actually a type-o, and that the 2nd line of code should pass in Xtrain instead.
So the corrected lines of code would look like this
Xtrain = X[:,train_frames:].magnitude().T
Xtest = ds.standardize_points(Xtrain)
pred = sgd.predict(Xtest)
audio_path = '/Users/kwang/Desktop/untwist-master/dataset/chuncks_gj'
save_path = '/Users/kwang/Desktop/untwist-master/result/rpca'
files = [y for y in os.listdir(audio_path) if '.wav' in y]
files[0] # result 'jxscsgTyGB410.wav'
for i in files:
x = Wave.read(audio_path + '/' + i)
X = stft.process(x)
(L, S) = rpca.process(X.magnitude()) # issue is happened!
M = RatioMask(np.abs(S), np.abs(L))
v = istft.process(X * M)
v.write(os.path.join(save_path, i))
ArpackNoConvergence Traceback (most recent call last)
in
2 x = Wave.read(audio_path + '/' + i)
3 X = stft.process(x)
----> 4 (L, S) = rpca.process(X.magnitude())
5 M = RatioMask(np.abs(S), np.abs(L))
6 v = istft.process(X * M)
~/Desktop/untwist-master/untwist/factorizations/rpca.py in process(self, X)
56 sparse_svd = self.choosvd( n, sv)
57 if sparse_svd:
---> 58 U, S, V = svds(X - E + (1 / mu) * Y, sv, which= "LM")
59 else:
60 U, S, V = svd(X - E + (1 / mu) * Y, full_matrices = False)
/anaconda3/lib/python3.6/site-packages/scipy/sparse/linalg/eigen/arpack/arpack.py in svds(A, k, ncv, tol, which, v0, maxiter, return_singular_vectors)
1808 # This is not a stable way to approach the problem.
1809 eigvals, eigvec = eigsh(XH_X, k=k, tol=tol ** 2, maxiter=maxiter,
-> 1810 ncv=ncv, which=which, v0=v0)
1811
1812 # In 'LM' mode try to be clever about small eigenvalues.
/anaconda3/lib/python3.6/site-packages/scipy/sparse/linalg/eigen/arpack/arpack.py in eigsh(A, k, M, sigma, which, v0, ncv, maxiter, tol, return_eigenvectors, Minv, OPinv, mode)
1649 with _ARPACK_LOCK:
1650 while not params.converged:
-> 1651 params.iterate()
1652
1653 return params.extract(return_eigenvectors)
/anaconda3/lib/python3.6/site-packages/scipy/sparse/linalg/eigen/arpack/arpack.py in iterate(self)
568 pass
569 elif self.info == 1:
--> 570 self._raise_no_convergence()
571 else:
572 raise ArpackError(self.info, infodict=self.iterate_infodict)
/anaconda3/lib/python3.6/site-packages/scipy/sparse/linalg/eigen/arpack/arpack.py in _raise_no_convergence(self)
374 vec = np.zeros((self.n, 0))
375 k_ok = 0
--> 376 raise ArpackNoConvergence(msg % (num_iter, k_ok, self.k), ev, vec)
377
378
ArpackNoConvergence: ARPACK error -1: No convergence (5131 iterations, 0/1 eigenvectors converged)
Hi,
Is the given RPCA code able to do single source separation ?
If so, then how is it performing this task?
All it gives as a result is the estimated vocal result which is almost identical to the input?
How can this code be used for separation of singing voices.
Running the following code produces a vocal_estimate.wav file that includes the background music as well.
import numpy as np
import matplotlib.pyplot as plt
from untwist.data import Wave, RatioMask
from untwist.transforms import STFT, ISTFT
from untwist.factorizations import RPCA
stft = STFT()
istft = ISTFT()
rpca = RPCA(iterations = 100)
x = Wave.read("/home/usama/mix5.wav")
X = stft.process(x[:,0])
(L,S) = rpca.process(X.magnitude())
M = RatioMask(S, L)
v = istft.process(X * M)
v.write("vocal_estimate.wav")
plt.subplot(4,1,1)
X.plot(label_x = False, title = "mixture")
plt.subplot(4,1,2)
L.plot(label_x = False, title = "L")
plt.subplot(4,1,3)
S.plot(label_x = False, title = "S")
plt.subplot(4,1,4)
M.plot(title="estimated mask")
plt.show()
Greetings,
I am trying to follow your rpca_example.py and at
M = RatioMask(np.abs(S),np.abs(L))
or
M = RatioMask(S,L)
I get:
421 def __new__(cls, target, background, p = 1):
422 tm = target.magnitude() + eps
--> 423 bm = background.magnitude() + eps
424 mask = (tm**p / (tm + bm)**p).astype(types.float)
425 instance = TFMask.new(cls, mask)
AttributeError: 'numpy.ndarray' object has no attribute 'magnitude'
Installed untwist via conda, on MacOS Sierra 10.12.4.
The error above I do not get, since the previous line
(L,S) = rpca.process(X.magnitude())
run fine?
Any help is greatly appreciated
I am unable to understand from documentation. Can someone send me whole project implementation ....
I tried running the first example but got this error. My utils package is up-to-date and I can't find this 'get_stems' in the documentation.
At present, stft does not allow for zero-padding, i.e. the size of the analysis window is fixed to fft_size
.
Goal: Allow for (preferably zero-phase) zero-padding of the windowed data.
Hi,
I would like to test mlp_example with stereo files.
Do you have some mlp_example for stereo format?
Thanks a lot,
XL
I have not been able to handle the meddis.pyx file. Im using python 2.7. Could you help me with that?
I'm trying to run your RPCA example and I'm getting the following error after
x =
Wave.read("mix3.wav")`
/Users/mact/anaconda/envs/bss/lib/python3.6/site-packages/scipy/io/wavfile.py:273: WavFileWarning: Chunk (non-data) not understood, skipping it.
WavFileWarning)
Can you help me finding the error? (environment, type of wav, other)
Thx in advance
Hi!
Is it possible to conda install untwist? From what channel?
Thx in advance.
You likely already know this, but within the CUDA 7.5 framework for the GPU (specifically cuda-repo-ubuntu1404-7-5-local_7.5-18_amd64.deb, and theano 0.9.0rc2 ), the call to pred = sgd.predict(Xtest) will crash due to float64 being typecasted to float32.
I am not sure exactly why only on that specifically call to sgd.predict(), since an eariler call sgd.train(ds) does not crash.
That said, fix is simple:
Code block mlp_examples.py before the fix:
Xtrain = X[:,train_frames:].magnitude().T
Xtest = ds.standardize_points(Xtest)
pred = sgd.predict(Xtest)
Code block after the fix:
Xtrain = (X[:,train_frames:].magnitude().T).astype(np.float32)
Xtest = ds.standardize_points(Xtest)
pred = sgd.predict(Xtest)
float64 and complex128 are also mentioned elsewhere in the code (types.py and qerbt.py), but I think the simple above chage fixes the problem (as changing the rest did not make a differance for me).
The command line to run on the GPU was:
THEANO_FLAGS=mode=FAST_RUN,device=gpu,floatX=float32 python -u -i mlp_example.py
FYI that if floatX=float64, then, the execution will on the CPU only.
filters.LowPass(100, sample_rate=44100)
yields
Traceback (most recent call last):
File "test_measure.py", line 21, in <module>
est_vox = filters.LowPass(100, sample_rate=44100)
File "/home/dominic/git/perceptual-study-source-separation/venvs/env/lib/python3.6/site-packages/untwist-0.1.dev1-py3.6-linux-x86_64.egg/untwist/filters/biquad.py", line 34, in __init__
super(LowPass, self).__init__(sample_rate)
File "/home/dominic/git/perceptual-study-source-separation/venvs/env/lib/python3.6/site-packages/untwist-0.1.dev1-py3.6-linux-x86_64.egg/untwist/filters/biquad.py", line 9, in __init__
super(Biquad, self).__init__(np.zeros((1, 3)), self.sample_rate)
AttributeError: 'LowPass' object has no attribute 'sample_rate'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.