Skip to content

Commit

Permalink
Enh: SBI example description
Browse files Browse the repository at this point in the history
Signed-off-by: samadpls <[email protected]>
  • Loading branch information
samadpls committed Aug 17, 2024
1 parent ca2c2da commit 1e02e23
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions examples/howto/sbi_hnncore_tutorial.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,12 @@ def extract_dipole_data(sim_results):
density_estimator = inference.append_simulations(thetas, xs).train()
posterior = inference.build_posterior(density_estimator)

###############################################################################
# The prior distribution represents our initial guess about the range of
# possible values for `weight_pyr`. The SBI algorithm will use this prior,
# along with the simulated data, to build a posterior distribution, which
# represents our updated belief about `weight_pyr` after seeing the data.

###############################################################################
#
# This function allows us to simulate data for a single parameter value.


Expand Down Expand Up @@ -165,12 +165,12 @@ def simulator_batch(param):
plt.xlim([-4, -1])
plt.show()

###############################################################################
# This plot shows the posterior distribution of the inferred parameter values.
# If the inferred posterior distribution is centered around the true parameter
# value, it suggests that the SBI method is accurately capturing the underlying
# parameter. The red dashed line represents the true parameter value.

###############################################################################
#
# Finally, we'll evaluate the performance of our SBI method on multiple
# unseen parameter values.

Expand All @@ -189,6 +189,7 @@ def simulator_batch(param):
plt.xlim(-4.1, -0.9)
plt.show()

###############################################################################
# This boxplot visualizes the distribution of inferred parameters for each
# unseen true parameter value. The true parameters are shown on the x-axis,
# and the boxes represent the spread of inferred values. If the inferred
Expand Down

0 comments on commit 1e02e23

Please sign in to comment.