From 7cc4843b817cea19810aa7d1c81d5e77eb3f49e1 Mon Sep 17 00:00:00 2001 From: ThibeauWouters Date: Mon, 27 Nov 2023 11:33:28 -0800 Subject: [PATCH] renamed walkers to popsize --- src/jimgw/likelihood.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/jimgw/likelihood.py b/src/jimgw/likelihood.py index 507cbb40..3320c7a2 100644 --- a/src/jimgw/likelihood.py +++ b/src/jimgw/likelihood.py @@ -143,7 +143,7 @@ def __init__( trigger_time: float = 0, duration: float = 4, post_trigger_duration: float = 2, - n_walkers: int = 100, + popsize: int = 100, n_loops: int = 2000, ) -> None: super().__init__( @@ -157,7 +157,7 @@ def __init__( self.freq_grid_low = freq_grid[:-1] self.ref_params = self.maximize_likelihood( - bounds=bounds, prior=prior, set_nwalkers=n_walkers, n_loops=n_loops + bounds=bounds, prior=prior, popsize=popsize, n_loops=n_loops ) self.ref_params["gmst"] = self.gmst @@ -366,11 +366,11 @@ def maximize_likelihood( self, bounds: tuple[Array, Array], prior: Prior, - set_nwalkers: int = 100, + popsize: int = 100, n_loops: int = 2000, ): bounds = jnp.array(bounds).T - set_nwalkers = set_nwalkers # TODO remove this? + popsize = popsize # TODO remove this? y = lambda x: -self.evaluate_original( prior.add_name(x, transform_name=True, transform_value=True), None @@ -378,7 +378,7 @@ def maximize_likelihood( y = jax.jit(jax.vmap(y)) print("Starting the optimizer") - optimizer = EvolutionaryOptimizer(len(bounds), popsize=set_nwalkers, verbose=True) + optimizer = EvolutionaryOptimizer(len(bounds), popsize=popsize, verbose=True) state = optimizer.optimize(y, bounds, n_loops=n_loops) best_fit = optimizer.get_result()[0] return prior.add_name(best_fit, transform_name=True, transform_value=True)