Join GitHub today
[MRG+1] Reduce runtime of graph_lasso #9858
What does this implement/fix? Explain your changes.
For a 1288x1288 empirical covariance matrix,
Any other comments?
Just noticed that this may interact with #4787. My dataset is quite dense, so the runtime of
referenced this pull request
Oct 1, 2017
Hi @TomDLT, I think the PEP8 error is now resolved; the tests looked OK on my screen. I've added said comment. It took me a little while to convince myself that this was true, but this short script can also verify it for anyone who is interested:
import numpy as np t = np.random.randint(1, 100, size=(100,100)) indices = np.arange(t.shape) subt = np.ascontiguousarray(t[1:, 1:]) for idx in indices: if idx > 0: subt[idx-1] = t[idx-1][indices != idx] subt[:, idx-1] = t[:, idx-1][indices != idx] else: subt[:] = t[1:, 1:] assert np.all(subt == t[indices != idx].T[indices != idx].T)