Skip to content

Conversation

@LorenzoDido
Copy link
Contributor

missing flag in calling the SDPRLayer with the list of redundant constraints

Copy link
Collaborator

@duembgen duembgen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the edits! I just have one question regarding the rank check.

Hs = [cones.unvec_symm(h, self.n_vars) for h in hs]
#check compilation warnings
for i, H in enumerate(Hs):
H_rank = np.linalg.matrix_rank(Hs, tol=1e-10)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would replace matrix_rank and eigvalsh with one single call to eigvalsh and then checking the number of eigenvalues <= 1e-10. Just to be sure -- is it really necessary to do this check every time? Would it be possible to do it only if necessary (as in the cases below, in a caught exception?)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the late reply, I’ll address each point.
I agree with your suggested modification of using eigvalsh instead of matrix_rank.

As shown in Lemma 5 of the paper, corank(H) = 1 is a sufficient condition for SOSC, which is one of the key assumptions of the main theorem. My intention was to check whether this condition fails before hitting the assertion errors, mainly for diagnostic purposes. If preferred, this check can be moved behind assertion errors or removed entirely.

Regarding all the edits in sdprlayer.py file: they are not required to solve the singular Jacobian issue itself. However, during some runs I sporadically encountered assertion errors, so I added a try–except block to help identify their causes. I’m happy to remove all these changes if you think they’re unnecessary.

- created a function to make them publicly available
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants