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

add acceleration option to JointPrimaryMarginalizedModel likelihood #4688

Open
wants to merge 38 commits into
base: master
Choose a base branch
from

Conversation

WuShichao
Copy link
Contributor

@WuShichao WuShichao commented Apr 7, 2024

@ahnitz This PR adds an acceleration option to JointPrimaryMarginalizedModel likelihood by assuming all extrinsic parameters can be fixed.

@WuShichao
Copy link
Contributor Author

@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:
Copy link
Member

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)

Copy link
Contributor Author

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?

Copy link
Contributor Author

@WuShichao WuShichao Jun 28, 2024

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.

@WuShichao WuShichao requested a review from ahnitz June 28, 2024 20:11
@@ -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 = \
Copy link
Member

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

Copy link
Contributor Author

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.

@WuShichao WuShichao requested a review from ahnitz June 28, 2024 20:23
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 = \
Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK, removed.

@WuShichao WuShichao requested a review from ahnitz July 4, 2024 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
LISA Support
Awaiting triage
Development

Successfully merging this pull request may close these issues.

None yet

2 participants