Skip to content

Commit

Permalink
Explore changing interim prior and impact on calibration (#22)
Browse files Browse the repository at this point in the history
* add option to run pipelien with sigma_e_int

* results with varying sigma

* more ignore

* be explicit with argument names

* more results
  • Loading branch information
ismael-mendoza authored Oct 21, 2024
1 parent eb82bd2 commit 6e974dc
Show file tree
Hide file tree
Showing 4 changed files with 440 additions and 116 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -164,5 +164,6 @@ cython_debug/
experiments/samples/*.hdf5
**/slurm-*.out
**/bash/*.sh
**/bash/**/*.sh
**/logs/**
**log**.txt
6 changes: 3 additions & 3 deletions bpd/pipelines/toy_ellips.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def do_inference(
init_positions: Array,
e_obs: Array,
sigma_m: float,
sigma_e: float,
initial_step_size: float,
interim_prior: Callable,
k: int,
):
Expand All @@ -51,7 +51,7 @@ def do_inference(
progress_bar=False,
is_mass_matrix_diagonal=True,
max_num_doublings=2,
initial_step_size=sigma_e,
initial_step_size=initial_step_size,
target_acceptance_rate=0.80,
)

Expand Down Expand Up @@ -86,8 +86,8 @@ def pipeline_toy_ellips_samples(
_do_inference_jitted = jjit(
partial(
do_inference,
sigma_e=sigma_e,
sigma_m=sigma_m,
initial_step_size=sigma_e,
interim_prior=interim_prior,
k=k,
)
Expand Down
543 changes: 432 additions & 111 deletions notebooks/summary-results1.ipynb

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions scripts/vect_toy_shear_gpu.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
@click.option("--n-samples-shear", type=int, default=3000, help="shear samples")
@click.option("--k", type=int, default=100, help="# int. posterior samples per galaxy.")
@click.option("--shape-noise", type=float, default=1e-3)
@click.option("--sigma-e-int", type=float, default=2e-3)
@click.option("--obs-noise", type=float, default=1e-4)
@click.option("--trim", type=int, default=1)
def main(
Expand All @@ -37,6 +38,7 @@ def main(
n_samples_shear: int,
k: int,
shape_noise: float,
sigma_e_int: float,
obs_noise: float,
trim: int,
):
Expand All @@ -57,7 +59,7 @@ def main(
g1=g1,
g2=g2,
sigma_e=shape_noise,
sigma_e_int=shape_noise * 2,
sigma_e_int=sigma_e_int,
sigma_m=obs_noise,
n_samples=n_samples_gals,
k=k,
Expand All @@ -66,7 +68,7 @@ def main(
pipeline_shear_inference,
true_g=jnp.array([g1, g2]),
sigma_e=shape_noise,
sigma_e_int=shape_noise * 2,
sigma_e_int=sigma_e_int,
n_samples=n_samples_shear,
)
vpipe1 = vmap(pipe1, in_axes=(0,))
Expand Down

0 comments on commit 6e974dc

Please sign in to comment.