Skip to content

Commit af19c44

Browse files
authored
Merge pull request #346 from GeoStat-Framework/emcee_vectorize
emcee: vectorize sampling since all ln_pdfs accept numpy arrays
2 parents 228edf9 + c88f7ba commit af19c44

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/gstools/random/rng.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def sample_ln_pdf(
8686
self.random.rand(nwalkers).reshape((nwalkers, 1)) * sample_around
8787
)
8888
# initialize the sampler
89-
sampler = mc.EnsembleSampler(nwalkers, 1, ln_pdf)
89+
sampler = mc.EnsembleSampler(nwalkers, 1, ln_pdf, vectorize=True)
9090
# burn in phase with saving of last position
9191
initial_state = State(init_guess, copy=True)
9292
initial_state.random_state = self.random.get_state()

0 commit comments

Comments
 (0)