Skip to content

Commit

Permalink
added efficiency comment for ESS GaussianMove
Browse files Browse the repository at this point in the history
  • Loading branch information
amifalk committed Dec 2, 2023
1 parent f3b62d2 commit 6fff927
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions numpyro/infer/ensemble.py
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,14 @@ def GaussianMove():
When this Move is used the walkers move along directions defined by random vectors sampled from the Gaussian
approximation of the walkers of the complementary ensemble.
"""

# In high dimensional regimes with sufficiently small n_active_chains,
# it is more efficient to sample without computing the Cholesky
# decomposition of the covariance matrix:

# eps = dist.Normal(0, 1).sample(rng_key, (n_active_chains, n_params))
# return 2.0 * mu * (eps @ (inactive - jnp.mean(inactive, axis=0)) / jnp.sqrt(n_active_chains))

def gaussian_move(rng_key, inactive, mu):
n_active_chains, n_params = inactive.shape
cov = jnp.cov(inactive, rowvar=False)
Expand Down

0 comments on commit 6fff927

Please sign in to comment.