mirror of
https://github.com/Richard-Sti/csiborgtools_public.git
synced 2025-07-03 21:11:11 +00:00
More flow preparation & Olympics (#143)
* Add more comments * Add flow paths * Simplify paths * Update default arguemnts * Update paths * Update param names * Update some of scipts for reading files * Add the Mike method option * Update plotting * Update fnames * Simplify things * Make more default options * Add print * Update * Downsample CF4 * Update numpyro selection * Add selection fitting nb * Add coeffs * Update script * Add nb * Add label * Increase number of steps * Update default params * Add more labels * Improve file name * Update nb * Fix little bug * Remove import * Update scales * Update labels * Add script * Update script * Add more * Add more labels * Add script * Add submit * Update spacing * Update submit scrips * Update script * Update defaults * Update defaults * Update nb * Update test * Update imports * Add script * Add support for Indranil void * Add a dipole * Update nb * Update submit * Update Om0 * Add final * Update default params * Fix bug * Add option to fix to LG frame * Add Vext label * Add Vext label * Update script * Rm fixed LG * rm LG stuff * Update script * Update bulk flow plotting * Update nb * Add no field option * Update defaults * Update nb * Update script * Update nb * Update nb * Add names to plots * Update nb * Update plot * Add more latex names * Update default * Update nb * Update np * Add plane slicing * Add nb with slices * Update nb * Update script * Upddate nb * Update nb
This commit is contained in:
parent
3d1e1c0ae3
commit
2b938c112c
20 changed files with 3106 additions and 379 deletions
|
@ -1,4 +1,4 @@
|
|||
from argparse import ArgumentParser, ArgumentTypeError
|
||||
from argparse import ArgumentParser
|
||||
|
||||
|
||||
def parse_args():
|
||||
|
@ -10,7 +10,7 @@ def parse_args():
|
|||
|
||||
ARGS = parse_args()
|
||||
# This must be done before we import JAX etc.
|
||||
from numpyro import set_host_device_count, set_platform # noqa
|
||||
from numpyro import set_platform # noqa
|
||||
|
||||
set_platform(ARGS.device) # noqa
|
||||
|
||||
|
@ -30,8 +30,8 @@ def get_harmonic_evidence(samples, log_posterior, nchains_harmonic, epoch_num):
|
|||
data, log_posterior, return_flow_samples=False, epochs_num=epoch_num)
|
||||
|
||||
|
||||
ndim = 250
|
||||
nsamples = 100_000
|
||||
ndim = 150
|
||||
nsamples = 50_000
|
||||
nchains_split = 10
|
||||
loc = jnp.zeros(ndim)
|
||||
cov = jnp.eye(ndim)
|
||||
|
@ -42,10 +42,6 @@ X = gen.multivariate_normal(loc, cov, size=nsamples)
|
|||
samples = {f"x_{i}": X[:, i] for i in range(ndim)}
|
||||
logprob = multivariate_normal(loc, cov).logpdf(X)
|
||||
|
||||
neg_lnZ_laplace, neg_lnZ_laplace_error = csiborgtools.laplace_evidence(
|
||||
samples, logprob, nchains_split)
|
||||
print(f"neg_lnZ_laplace: {neg_lnZ_laplace} +/- {neg_lnZ_laplace_error}")
|
||||
|
||||
|
||||
neg_lnZ_harmonic, neg_lnZ_harmonic_error = get_harmonic_evidence(
|
||||
samples, logprob, nchains_split, epoch_num=30)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue