Skip to content

Commit

Permalink
Merge pull request #93 from xuyuon/fix-nan
Browse files Browse the repository at this point in the history
Handling nan output from Adam optimizer when generating reference parameters
  • Loading branch information
kazewong authored Jul 16, 2024
2 parents 94c34db + bd71684 commit fe0e767
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/jimgw/single_event/likelihood.py
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ def y(x):
rng_key, optimized_positions, summary = optimizer.optimize(
jax.random.PRNGKey(12094), y, initial_position
)
best_fit = optimized_positions[summary["final_log_prob"].argmin()]
best_fit = optimized_positions[jnp.nanargmin(summary["final_log_prob"])]
return prior.transform(prior.add_name(best_fit))


Expand Down

0 comments on commit fe0e767

Please sign in to comment.