-
Notifications
You must be signed in to change notification settings - Fork 29
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
Interpoint Constraints #313
Conversation
I think without a call method we also do not need a jacobian, right? :D but a call method for BatchConstraints / Interpoint constraints would not be less well-defined than for the NChooseK constraint (and there we also have a call method). In fact I think there is a relatively natural way to define a call and jacobian method for batch constraints (have not thought about other types of interpoint constraints): For each batch we evaluate all
On the other hand, if we don't really need it, we can also just drop it ... :D |
@Osburg : thanks, I do not think that we acutally need it, but as you have it here already, let us add it or? I would finalize this PR here without the implmentation and just raising |
Sure, this is fine! :) |
@dlinzner-bcs: should be fine now from my side and ready for review. |
@dlinzner-bcs @KappatC : Polytope sampler should now also work, I just need to fix some edge cases ;) I tell you once it is finished ... |
I just close this PR and reopen as there are some github problems ... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good otherwise. Excuse my naive questions :).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the code. Looks pretty good to me. Here some minor understanding questions.
all_indices = torch.arange( | ||
i * multiplicity, min((i + 1) * multiplicity, n_candidates) | ||
) | ||
for k in range(len(all_indices) - 1): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One more thing, could you please explain to me why we need a pair of indices each time and not assign the feat_idx to each k entry, with k in range(len(all_indices))? thanks in advance
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I am not sure that I understand you correct. We always need a pair of indices as we have several equalities of the form feat_in_row_0 - feat-in_col_k == 0
. This makes two indices. And each index is by itself a pair because we have to index both the correct row and column index.
Is this helping?
As discussed here, this adds the first interpoint constraint data model to BoFire.
From my perspective, a call method on interpoint constraints is somehow ill defined and not needed. What do you think about the
jacobian
method?The integration in the
Constraints
data model is not yet complete, as the return value of the is_fulfilled method is now a bool and not a series of bools as in the case of the intrapoints. Will fix this later.@Osburg @dlinzner-bcs @KappatC