From c88f7bab0e309f7a32c1a61786ba340245d215a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20M=C3=BCller?= Date: Tue, 16 Apr 2024 19:01:35 +0200 Subject: [PATCH] emcee: vectorize sampling since all ln_pdfs accept numpy arrays --- src/gstools/random/rng.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gstools/random/rng.py b/src/gstools/random/rng.py index ad78a0c6..ad07c6aa 100644 --- a/src/gstools/random/rng.py +++ b/src/gstools/random/rng.py @@ -86,7 +86,7 @@ def sample_ln_pdf( self.random.rand(nwalkers).reshape((nwalkers, 1)) * sample_around ) # initialize the sampler - sampler = mc.EnsembleSampler(nwalkers, 1, ln_pdf) + sampler = mc.EnsembleSampler(nwalkers, 1, ln_pdf, vectorize=True) # burn in phase with saving of last position initial_state = State(init_guess, copy=True) initial_state.random_state = self.random.get_state()