Skip to content

Commit

Permalink
Added pip command to install SBI
Browse files Browse the repository at this point in the history
Signed-off-by: samadpls <[email protected]>
  • Loading branch information
samadpls committed Aug 10, 2024
1 parent e39ca37 commit eab05b9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions examples/howto/sbi_hnn_core_parameter_inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
# Mainak Jas <[email protected]>

###############################################################################
# First, we need to import the necessary packages. The Simulation-Based
# Inference (SBI) package can be installed with ``pip install sbi``.
# Let us import ``hnn_core`` and all the necessary libraries.

import numpy as np
Expand Down Expand Up @@ -62,7 +64,7 @@ def set_params(param_values, net=None):
'weight_pyr': val.tolist()
}

net = jones_2009_model(mesh_shape=(1, 1))
net = jones_2009_model(mesh_shape=(3, 3))
batch_simulator = BatchSimulate(set_params=set_params,
net=net,
tstop=170)
Expand Down Expand Up @@ -140,7 +142,6 @@ def simulator_batch(param):
plt.axvline(unknown_param.item(), color='r', linestyle='dashed',
linewidth=2, label='True Parameter')
plt.legend()
plt.savefig('posterior_distribution_log.png')
plt.show()

###############################################################################
Expand All @@ -158,7 +159,6 @@ def simulator_batch(param):
plt.xlabel('True Parameter')
plt.ylabel('Inferred Parameter')
plt.title('SBI Performance on Unseen Data')
plt.savefig('sbi_performance_unseen.png')
plt.show()

###############################################################################
Expand Down

0 comments on commit eab05b9

Please sign in to comment.