-
Notifications
You must be signed in to change notification settings - Fork 343
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
add acceleration option to JointPrimaryMarginalizedModel likelihood #4688
base: master
Are you sure you want to change the base?
Conversation
@ahnitz As you suggested, I have made this PR a general one. The specific LISA multiband one will be in another PR. |
@@ -723,24 +733,43 @@ def total_loglr(self): | |||
# not using self.primary_model.current_params, because others_model | |||
# may have its own static parameters | |||
current_params_other = other_model.current_params.copy() | |||
for i in range(nums): | |||
if not self.accelerate_loglr: |
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.
Can you choose a more descriptive name to what the option does (e.g. how does it make the likelihood faster than than just the fact that it does)
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.
Is self.static_margin_params_in_other_models
better?
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.
@ahnitz In this PR, we don't apply any amplitude and phase correction (as general as possible), so I will not include these in the option name.
@@ -640,6 +626,11 @@ def __init__(self, variable_params, submodels, **kwargs): | |||
self.other_models.pop(kwargs['primary_lbl'][0]) | |||
self.other_models = list(self.other_models.values()) | |||
|
|||
# determine whether to accelerate total_loglr | |||
from pycbc.inference.models.tools import str_to_bool | |||
self.static_margin_params_in_other_models = \ |
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 still has the old name in the config file. Also, why not just do
self.static_margin_params = 'static_margin_params' in kwargs
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.
@ahnitz OK, I have updated.
sh_others = sh_others[0] | ||
hh_others = hh_others[0] | ||
sh_total = sh_primary + sh_others | ||
hh_total = hh_primary + hh_others | ||
|
||
# calculate marginalize_vector_weights | ||
self.primary_model.marginalize_vector_weights = \ |
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 line shouldn't be here.
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.
OK, removed.
@ahnitz This PR adds an acceleration option to JointPrimaryMarginalizedModel likelihood by assuming all extrinsic parameters can be fixed.