-
Notifications
You must be signed in to change notification settings - Fork 56
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
Bugfix forced germs #292
Merged
Merged
Bugfix forced germs #292
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Patches a problem that arises sometimes when using a user-specified list of germs together with deduping. The code expects that the user specified list will be included in the list of available candidates, which after deduping isn't always the case. This can also fail if the settings used to construct the candidate germ set are incompatible with the properties of the forced germ set (either because they are too short or maybe only a random subset of a particular length were initially included etc.) This patches that be adding a check for whether all of the forced germs are in the candidate set and if not appends the requisite ones.
This commit adds support for starting the greedy search from scratch as is required when the 'force' argument is set to None (as opposed to 'singletons' or a user-specified list. In this case we now iterate through the candidate germ list and select the best germ according the the composite score.
Previously the first outer iteration of the greedy search would mistakenly report that the initial germ set amplified only a single parameter (which is incorrect in general). This is because the number of amplified parameters is only available following the initial outer iteration. We could add in a calculation to get the correct number for the initial germ set at the start of the search, but this is computationally expensive, so I went with the cheap route and added a flag so that we simply don't report the number of amplified parameters until we've done at least one outer-iteration of the greedy search.
Revert a change that was added to help patch the issue with the lack of support for initializing the greedy search from scratch. Now that this is fully supported these lines are no longer needed.
Adds a test (along with a flag for disabling this for expediency) that checks the initially constructed germ set, either from the argument passed in for 'force' or as greedily selected when force is None, for amplificational completeness using the test_germs_list_completeness function. If it is already AC then we short-circuit the search and simply return the initial list and print logging information to that effect.
Adds a bugfix for the initial number of eigenvalues. See comment for more details.
Adds additional unit test covering the case where force=None and the initial germ set is selected greedily. Also adds a test covering the case where a germ in a user specified list of forced germs is outside the candidate set, either because it is outside of the specs (i.e. longer, not sampled randomly etc.) or because it may have been originally but dropped during the de-duping.
sserita
requested changes
Jan 19, 2023
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.
All looks good, except we can make the kwarg match fidsel for the pretest.
sserita
approved these changes
Jan 19, 2023
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 this bugfix!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds bugfixes related to the handling of the 'force' argument in the germ selection algorithms. Three different issues were identified and have been patched:
Finally, there are a couple extra unit tests to cover cases 1 and 2 above.