Skip to content

Commit

Permalink
add update back
Browse files Browse the repository at this point in the history
  • Loading branch information
WuShichao committed Feb 21, 2024
1 parent 8421326 commit 622a7b5
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions pycbc/inference/models/hierarchical.py
Original file line number Diff line number Diff line change
Expand Up @@ -734,12 +734,12 @@ def others_lognl(self):
return total_others_lognl

def _loglikelihood(self):
# update parameters in primary_model,
# other_models will be updated in total_loglr,
# because other_models need to handle margin_params
self.primary_model.update(
**{p.subname: self.current_params[p.fullname]
for p in self.param_map[self.primary_lbl]})
for lbl, model in self.submodels.items():
# update the model with the current params. This is done here
# instead of in `update` because waveform transforms are not
# applied until the loglikelihood function is called
model.update(**{p.subname: self.current_params[p.fullname]
for p in self.param_map[lbl]})

# calculate the combined loglikelihood
logl = self.total_loglr() + self.primary_model.lognl + \
Expand Down Expand Up @@ -930,7 +930,7 @@ def get_loglr():
# other_models will be updated in total_loglr,
# because other_models need to handle margin_params
p = {param.subname: self.current_params[param.fullname]
for param in self.param_map[self.primary_lbl]}
for param in self.param_map[self.primary_lbl]}
p.update(rec)
self.primary_model.update(**p)
return self.total_loglr()
Expand Down

0 comments on commit 622a7b5

Please sign in to comment.