Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Utilities] add distance_to_set for SecondOrderCone #2060

Merged
merged 5 commits into from
Feb 4, 2023
Merged

Conversation

odow
Copy link
Member

@odow odow commented Dec 9, 2022

Part of #2033.

We'll need to decide what sets we use exact methods for, and what we make up.

Boyd's book is: https://web.stanford.edu/~boyd/papers/pdf/prox_algs.pdf

@matbesancon
Copy link
Contributor

matbesancon commented Dec 12, 2022

we need to be very careful with distance to set with exponentials. We corrected it several times with @tjdiamandis because it is still ongoing research due to its numerical instability

@tjdiamandis
Copy link

A great reference for this is https://docs.mosek.com/whitepapers/expcone-proj.pdf (Section 5 and Lemma 5.1, specifically).

@odow
Copy link
Member Author

odow commented Dec 12, 2022

it is still ongoing research due to its numerical instability

We could just convert to BigFloat. Performance likely isn't a big concern.

@odow
Copy link
Member Author

odow commented Dec 12, 2022

I added a test for an Inf distance to the exponential cone. I don't know what else we should do.

# Parikh, N., & Boyd, S. (2014). Proximal algorithms. Foundations and
# trends in Optimization, page 184, section 6.3.2.
t, rhs = x[1], LinearAlgebra.norm(@views x[2:end])
if rhs <= -t # Projection to the point (0, [0])
Copy link
Member

Choose a reason for hiding this comment

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

You mean (t, [0]) ?

Copy link
Member Author

Choose a reason for hiding this comment

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

No, I think I mean (0, [0])? I just followed Section 6.3.2 here: https://web.stanford.edu/~boyd/papers/pdf/prox_algs.pdf

# trends in Optimization, page 184, section 6.3.2.
t, rhs = x[1], LinearAlgebra.norm(@views x[2:end])
if rhs <= -t # Projection to the point (0, [0])
return LinearAlgebra.norm(x)
Copy link
Member

Choose a reason for hiding this comment

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

Why don't we also do sqrt(2)/2 abs(t - rhs) ?

t, rhs = x[1], LinearAlgebra.norm(@views x[2:end])
if rhs <= -t # Projection to the point (0, [0])
return LinearAlgebra.norm(x)
elseif t >= rhs # Projection to the point (t, x)
Copy link
Member

Choose a reason for hiding this comment

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

I would simply do abs(t) >= rhs

Copy link
Member Author

Choose a reason for hiding this comment

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

Why?

@odow odow changed the title [Utilities] add distance_to_set for SecondOrderCone and ExponentialCone [Utilities] add distance_to_set for SecondOrderCone Feb 4, 2023
@odow odow merged commit 79081f0 into master Feb 4, 2023
@odow odow deleted the od/distances branch February 4, 2023 01:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants