![]() ![]() I switched to using eig, and the algorithm made it through the sketchy parts of town with no problem, and always arrived safely at the nicest section of town. ![]() Even raising opt.maxit to 3000 and decreasing opt.tol to 1e6 or greater times the default value, eigs often failed at some point. When I ran a nonlinear optimization, such as some type of Quasi-Newton, even when starting in a “nice section of town”, and with an optimum which might be in the nicest section of town, it was quite frequently the case that the algorithm, if not venturing to the wrong side of the tracks, would at least get real close, on its way to the nicest section of town. Regarding eigs: Back in the “olden” days, I used to use eigs, when for instance doing something with spectral gap in the objective function or a constraint, so only needing the 2 largest eigenvalues of a matrix. What is the basis for your assertion that the SVD calculation you propose is more reliable than eig? If it is just that on examples in which eig fails, the SVD approach succeeds, that wouldn’t convince me in general, because there may be cases in which the SVD approach fails but eig would succeed. In that case, I don’t think it’s a TFOCS issue but some deep issue, and maybe people at stackexchange will have an idea.Ĭan you capture and post matrices on which eig fails? it’s not that I don’t believe you, but i would like to see and play around with them for the sake of learning. If it is from eig, then the returned solution could be catastrophically different than the true solution, and that’d be an issue, so I would follow Mark’s suggestion and try to record the matrix when that happens, and then we can help troubleshoot. If the error is actually from eigs, then I’d say ignore it, because if it is occasional, we can tolerate the small errors. We use propack to do our iterative svd’s, and you could use this to do eigenvalues (asymptotically, the cost is no different, but you’d probably be 4x slower). Finding good tolerances in eigs is not easy you have to re-orthogonalize appropriately. Both implementations that Matlab uses are standard, using LAPACK and ARPACK. Larger than that, and eig is just too slow smaller, and eigs is less accurate and slower. I wouldn’t necessarily go with eig over eigs in all cases though, since I don’t view them as competing except in very small “overlap” regime (matrices about 500 x 500 to 2000 x 2000, say). If the starting vector opts.vo is not provided, eigs is NOT deterministic, i.e…, the solution depends on random numbers which are drawn. If eig is failing, perhaps you could capture one or more matrices on which it is failing and post them in a mat file? I’m willing to change my mind about the reliability of eig, and if it fails, perhaps that should be brought to the attention of the MATLAB developers, although there are apparently some examples of this happening, but I have never seen the matrices in question.Īs far as I know, eig is deterministic, i.e., will produce exactly the same solution given the exact same input, and this is true even if parallel threads are employed. If indeed the error message refers to line 69, and it is this same version of prox_trace.m, that does sound damning of eig rather than eigs, but my advice to avoid eigs still stands. ![]() I learned my lesson and stopped using it for evaluation of objective function, gradient, Hessian, constraints, Jacobiian, etc. I.e., my recommendation is to call eig rather than eigs regardless of the value of largescale. You can increase opts.maxit, but my suggestion is to call eig instead of eigs. If you look at the code, you can see some finagling with opts.tol, but opts.maxit is left at its default value of 300. You can increase opts.,maxit or opts.tol, but it still can not be relied on to converge at all points in the middle of an optimization. If largescale is true and K <= min(M,N)/2, eigs is called in line 100, which is: = eigs( X, K, SIGMA, opts ) Įigs is very unreliable in my experience. <-Įig is called in line 67 or 69 of TFOCS version 1.3.1 of prox_trace.m if largescale is false. –> EDIT: However, googling shows me that this error message does occasionally occur with eig. Are you sure it’s not eigs which is the culprit? ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |