Skip to content

Commit

Permalink
Update likelihood.py
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasckng committed Sep 16, 2024
1 parent 354b28e commit aa1274e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/jimgw/single_event/likelihood.py
Original file line number Diff line number Diff line change
Expand Up @@ -558,14 +558,14 @@ def maximize_likelihood(
):
parameter_names = prior.parameter_names
for transform in sample_transforms:
parameter_names = transform.propagate_name(parameter_names)
parameter_names = jax.vmap(transform.propagate_name)(parameter_names)

def y(x):
named_params = dict(zip(parameter_names, x))
for transform in reversed(sample_transforms):
named_params = transform.backward(named_params)
named_params = jax.vmap(transform.backward)(named_params)
for transform in likelihood_transforms:
named_params = transform.forward(named_params)
named_params = jax.vmap(transform.forward)(named_params)
return -self.evaluate_original(named_params, {})

print("Starting the optimizer")
Expand Down Expand Up @@ -605,9 +605,9 @@ def y(x):

named_params = dict(zip(parameter_names, best_fit))
for transform in reversed(sample_transforms):
named_params = transform.backward(named_params)
named_params = jax.vmap(transform.backward)(named_params)
for transform in likelihood_transforms:
named_params = transform.forward(named_params)
named_params = jax.vmap(transform.forward)(named_params)
return named_params


Expand Down

0 comments on commit aa1274e

Please sign in to comment.