diff --git a/bilby/core/sampler/dynesty.py b/bilby/core/sampler/dynesty.py index 2360a318214bf537b43f5c25eaeb8b9ffd911be9..e0abc5a0aae826dad991eff044c62a1300d22561 100644 --- a/bilby/core/sampler/dynesty.py +++ b/bilby/core/sampler/dynesty.py @@ -44,7 +44,7 @@ class Dynesty(NestedSampler): Other Parameters ---------------- - npoints: int, (250) + npoints: int, (1000) The number of live points, note this can also equivalently be given as one of [nlive, nlives, n_live_points] bound: {'none', 'single', 'multi', 'balls', 'cubes'}, ('multi') @@ -72,18 +72,18 @@ class Dynesty(NestedSampler): """ default_kwargs = dict(bound='multi', sample='rwalk', verbose=True, periodic=None, - check_point_delta_t=600, nlive=500, - first_update=None, + check_point_delta_t=600, nlive=1000, + first_update=None, walks=None, npdim=None, rstate=None, queue_size=None, pool=None, use_pool=None, live_points=None, logl_args=None, logl_kwargs=None, ptform_args=None, ptform_kwargs=None, enlarge=None, bootstrap=None, vol_dec=0.5, vol_check=2.0, facc=0.5, slices=5, - walks=None, update_interval=None, print_func=None, + update_interval=None, print_func=None, dlogz=0.1, maxiter=None, maxcall=None, logl_max=np.inf, add_live=True, print_progress=True, - save_bounds=True) + save_bounds=False) def __init__(self, likelihood, priors, outdir='outdir', label='label', use_ratio=False, plot=False, skip_import_verification=False, check_point=True, n_check_point=None, check_point_delta_t=600, @@ -135,7 +135,7 @@ class Dynesty(NestedSampler): def _verify_kwargs_against_default_kwargs(self): if not self.kwargs['walks']: - self.kwargs['walks'] = self.ndim * 5 + self.kwargs['walks'] = self.ndim * 10 if not self.kwargs['update_interval']: self.kwargs['update_interval'] = int(0.6 * self.kwargs['nlive']) if not self.kwargs['print_func']: diff --git a/test/sampler_test.py b/test/sampler_test.py index 7ca3feba53b3cd49e30f01038aa34d3d29093939..f299d23476eec3cbf48cec5db6200432caf31677 100644 --- a/test/sampler_test.py +++ b/test/sampler_test.py @@ -147,14 +147,14 @@ class TestDynesty(unittest.TestCase): def test_default_kwargs(self): expected = dict(bound='multi', sample='rwalk', periodic=None, verbose=True, - check_point_delta_t=600, nlive=500, first_update=None, + check_point_delta_t=600, nlive=1000, first_update=None, npdim=None, rstate=None, queue_size=None, pool=None, use_pool=None, live_points=None, logl_args=None, logl_kwargs=None, ptform_args=None, ptform_kwargs=None, enlarge=None, bootstrap=None, vol_dec=0.5, vol_check=2.0, facc=0.5, slices=5, dlogz=0.1, maxiter=None, maxcall=None, - logl_max=np.inf, add_live=True, print_progress=True, save_bounds=True, - walks=10, update_interval=300, print_func='func') + logl_max=np.inf, add_live=True, print_progress=True, save_bounds=False, + walks=20, update_interval=600, print_func='func') self.sampler.kwargs['print_func'] = 'func' # set this manually as this is not testable otherwise self.assertListEqual([0], self.sampler.kwargs['periodic']) # Check this separately self.sampler.kwargs['periodic'] = None # The dict comparison can't handle lists @@ -166,19 +166,19 @@ class TestDynesty(unittest.TestCase): def test_translate_kwargs(self): expected = dict(bound='multi', sample='rwalk', periodic=[0], verbose=True, - check_point_delta_t=600, nlive=250, first_update=None, + check_point_delta_t=600, nlive=1000, first_update=None, npdim=None, rstate=None, queue_size=None, pool=None, use_pool=None, live_points=None, logl_args=None, logl_kwargs=None, ptform_args=None, ptform_kwargs=None, enlarge=None, bootstrap=None, vol_dec=0.5, vol_check=2.0, facc=0.5, slices=5, dlogz=0.1, maxiter=None, maxcall=None, - logl_max=np.inf, add_live=True, print_progress=True, save_bounds=True, - walks=10, update_interval=300, print_func='func') + logl_max=np.inf, add_live=True, print_progress=True, save_bounds=False, + walks=20, update_interval=600, print_func='func') for equiv in bilby.core.sampler.base_sampler.NestedSampler.npoints_equiv_kwargs: new_kwargs = self.sampler.kwargs.copy() del new_kwargs['nlive'] - new_kwargs[equiv] = 250 + new_kwargs[equiv] = 1000 self.sampler.kwargs = new_kwargs self.sampler.kwargs['print_func'] = 'func' # set this manually as this is not testable otherwise self.assertDictEqual(expected, self.sampler.kwargs)