Minimum not attained in graphical lasso #30768
Replies: 1 comment
|
The two functions are not minimizing the same objective. Scikit-learn's graphical lasso applies the L1 penalty to the off-diagonal entries of the precision matrix; the diagonal is not penalized. Your Use an explicit off-diagonal penalty: off_diag = Theta - torch.diag(torch.diagonal(Theta))
sign, logabsdet = torch.linalg.slogdet(Theta)
objective = -logabsdet + torch.trace(S @ Theta) + alpha * off_diag.abs().sum()Then evaluate both solutions with that same function. There are two more caveats in the Torch solver. Parameterizing For large |
Uh oh!
There was an error while loading. Please reload this page.
Hello,
I am trying to use the graphical lasso in torch, as my backend uses GPU.
I am comparing my implementation with the one of scikit-learn.covariance.graphical_lasso, but I find that my implementation gets a better minimum, and that the output are quite different concerning the support of the precision matrix.
Here is my implementation:
wich outputs on my machine:
Results are even more strange with greater values of
alpha, for example 7. There is no warning when calling GL so that it seems it has converged, and using much more iteration (max_iter = 3000with 0 tolerance) does not help.Note that I use Theta = [email protected] to make sure the output matrix is symmetric.
Is there something I am missing here ?
All reactions