Skip to content
Snippets Groups Projects
Commit 7c9d2080 authored by Gregory Ashton's avatar Gregory Ashton
Browse files

Changes the default number of walks to 30x ndim (previously 10x ndims).

parent 961875ca
No related branches found
No related tags found
No related merge requests found
......@@ -5,7 +5,9 @@
### Added
-
### Changed
-
- Dynesty default settings changed: by default, now uses 30xndim walks. This was
shown (!564) to provide better convergence for the long-duration high-spin tests.
### Removed
-
......
......@@ -55,7 +55,7 @@ class Dynesty(NestedSampler):
Method used to sample uniformly within the likelihood constraints,
conditioned on the provided bounds
walks: int
Number of walks taken if using `sample='rwalk'`, defaults to `ndim * 5`
Number of walks taken if using `sample='rwalk'`, defaults to `ndim * 30`
dlogz: float, (0.1)
Stopping criteria
verbose: Bool
......@@ -156,7 +156,7 @@ class Dynesty(NestedSampler):
def _verify_kwargs_against_default_kwargs(self):
if not self.kwargs['walks']:
self.kwargs['walks'] = self.ndim * 10
self.kwargs['walks'] = self.ndim * 30
if not self.kwargs['update_interval']:
self.kwargs['update_interval'] = int(0.6 * self.kwargs['nlive'])
if not self.kwargs['print_func']:
......
......@@ -5,7 +5,6 @@ import unittest
from mock import MagicMock
import numpy as np
import os
import sys
import shutil
import copy
......@@ -154,14 +153,13 @@ class TestDynesty(unittest.TestCase):
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=False,
walks=20, update_interval=600, print_func='func')
walks=60, update_interval=600, print_func='func')
self.sampler.kwargs['print_func'] = 'func' # set this manually as this is not testable otherwise
self.assertListEqual([0, 1], self.sampler.kwargs['periodic']) # Check this separately
self.sampler.kwargs['periodic'] = None # The dict comparison can't handle lists
for key in self.sampler.kwargs.keys():
print(key)
print(expected[key])
print(self.sampler.kwargs[key])
print("key={}, expected={}, actual={}"
.format(key, expected[key], self.sampler.kwargs[key]))
self.assertDictEqual(expected, self.sampler.kwargs)
def test_translate_kwargs(self):
......@@ -173,7 +171,7 @@ class TestDynesty(unittest.TestCase):
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=False,
walks=20, update_interval=600, print_func='func')
walks=60, update_interval=600, print_func='func')
for equiv in bilby.core.sampler.base_sampler.NestedSampler.npoints_equiv_kwargs:
new_kwargs = self.sampler.kwargs.copy()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment