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

Universal constraint sampler #328

Merged
merged 15 commits into from
Jan 10, 2024

Conversation

Osburg
Copy link
Collaborator

@Osburg Osburg commented Dec 21, 2023

This PR adds a new sampler that supports nonlinear/linear equality/inequality constraints and NChooseKConstraints as discussed in #314. This only works for continuous inputs. In principle also batch constraints (and all other constraints you can compute a jacobian for) are supported, but since the returned sample is sampled from a larger set of candidates, the batch structure is no longer respected. By adapting the sampling logic in this last step this method can be made available for batch constraints. Closes #314.

@jduerholt jduerholt self-requested a review December 21, 2023 14:25
@jduerholt
Copy link
Contributor

Hi @Osburg,

Thanks for the PR, I will have a look over the Christmas days. Sorry for the delay.

Best,

Johannes

Copy link
Contributor

@jduerholt jduerholt left a comment

Choose a reason for hiding this comment

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

Looks overall good to me, just one question: is it on purpose that you inherit from the SamplerStrategy, because then you also inherit from their the handling of NChooseKs, which is totally fine for me, but I just wanted to ask ;)

Co-authored-by: Johannes P. Dürholt <johannespeter.duerholt@evonik.com>
@Osburg
Copy link
Collaborator Author

Osburg commented Dec 26, 2023

is it on purpose that you inherit from the SamplerStrategy, because then you also inherit from their the handling of NChooseKs, which is totally fine for me, but I just wanted to ask ;)

Thanks for pointing this out :) This was not my intention, I did not pay attention apparently. So I guess I should let UniversalConstraintSampler inherit from Strategy instead?

@jduerholt
Copy link
Contributor

Yep, I would then recommend to inherit from Strategy.

Copy link
Contributor

@jduerholt jduerholt left a comment

Choose a reason for hiding this comment

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

Hi @Osburg,

thanks for the update, only some minor issues remain. We could also implement the pending_candidates at a later point in time. But this should not be too complicated. We can do it as you want.

Best,

Johannes

Copy link
Contributor

@jduerholt jduerholt left a comment

Choose a reason for hiding this comment

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

Looks good to me! Thank you very much!

@jduerholt jduerholt merged commit 33a2053 into experimental-design:main Jan 10, 2024
10 checks passed
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.

Sampling under nonlinear equality constraints
2 participants