[go: up one dir, main page]

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

WIP: Approximate convex hulls #114

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Conversation

cgranade
Copy link
Collaborator
@cgranade cgranade commented Mar 8, 2017

This work in progress PR aims to produce ε-apporixmate convex hulls using the algorithm of 1603.04422, with CVXOPT being used to solve the quadratic program at the innermost loop. Unfortunately, this approach results in CVXOPT taking up a truly absurd ratio of the runtime, so the current implementation is far too slow to be useful at the moment. That said, it seems to work reasonably well in local testing, even if its too slow to be usable.

@coveralls
Copy link

Coverage Status

Coverage decreased (-1.0%) to 66.722% when pulling 1c6be1e on feature-approx-chull into ddac821 on master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage decreased (-1.0%) to 66.722% when pulling 1c6be1e on feature-approx-chull into ddac821 on master.

try:
import cvxopt
import cvxopt.solvers
except:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should only catch on ImportError

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Probably, though I don't want any error in importing CVXOPT to affect functions which don't require it. Perhaps silently ignoring ImportError and raising a warning on other exceptions would be good?

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 catch on ImportError and let all others raise an issue. This is important because if you have code that can use cvxopt, and the package is installed, but something goes wrong (maybe an environment issue, or windows being stupid, etc) that it should halt.

If you want more rigorous separation you'll either need to use separate files (one for functions that use cvxopt and one for those that don't), or if the number of functions that require this package is low (but those functions in turn do require them) you can lazy-load the package by doing your import statement in the function itself. Keep in mind though that that will be called every time the function is called, and while it is fast, its not free.


n_partial, dimension = partial_hull.shape
n_candidates, dimension_check = candidate_points.shape
assert dimension == dimension_check
Copy link
Collaborator

Choose a reason for hiding this comment

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

This should probably raise something instead of just blind asserting

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Absolutely. Given that this is still a first stab, I didn't yet take the care to validate inputs and all that will go into the final PR.

@@ -0,0 +1,279 @@
#!/usr/bin/python
Copy link
Collaborator

Choose a reason for hiding this comment

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

#!/usr/bin/env python

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good catch, this is what I get from copying a older header template, heh.

@coveralls
Copy link
coveralls commented Mar 20, 2017

Coverage Status

Coverage decreased (-1.2%) to 66.556% when pulling 9aa4394 on feature-approx-chull into ddac821 on master.

@cgranade cgranade added the wip label Mar 31, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants