-
Notifications
You must be signed in to change notification settings - Fork 95
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
Diamond cond with OrConjunction #219
Conversation
Codecov Report
@@ Coverage Diff @@
## master #219 +/- ##
=======================================
Coverage 67.15% 67.15%
=======================================
Files 17 17
Lines 1629 1629
=======================================
Hits 1094 1094
Misses 535 535 Continue to review full report at Codecov.
|
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.
Just need to ask about the odd ==
thing. Otherwise a rough understanding of the code and the test seem to be correct.
@@ -315,6 +322,16 @@ cpdef np.ndarray change_hp_value( | |||
active = False | |||
break | |||
|
|||
if active: | |||
hps_to_be_activate.add(current_idx) | |||
if current_value == current_value: |
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.
This seems odd? current_value == current_value
, is this not always true?
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.
Not really, if current_value is deactivated, then this equation does not hold (Similar code can be found under line 335 and 344)
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.
No, two NaNs
compare as unequal, see https://en.wikipedia.org/wiki/NaN#Comparison_with_NaN. This is the fastest way to check for NaN values because it does not require any additional function calls.
This PR works on solving a potential error that might occur for a hierarchy configuration space with OrConjunction:
Suppose that an HP
top
has two choicesA
andB
and an HPbottom
that is conditioned onA
orB
:(bottom | top == A || top == B)
. Then iftop
switches fromA
toB
,bottom
should remain to activate (A more concrete example could be found under test/test_util.py::UtilTest::test_check_neighbouring_config_diamond_or_conjunction).An additional check is attached under
change_hp_value
. However, this might make the check slower: we need to check all the children conditions and not skip them as before