Skip to content

Commit

Permalink
updated example/plot_batch_simulate
Browse files Browse the repository at this point in the history
  • Loading branch information
samadpls committed Jul 5, 2024
1 parent 7ba6e2a commit 6e1a650
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion doc/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ Parallel backends (:py:mod:`hnn_core.parallel_backends`):
JoblibBackend

Batch Simulation (:py:mod:`hnn_core.batch_simulate`):
---------------------------------------------------------
-----------------------------------------------------
.. currentmodule:: hnn_core.batch_simulate

.. autosummary::
Expand Down
11 changes: 7 additions & 4 deletions examples/howto/plot_batch_simulate.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# Ryan Thorpe <[email protected]>
# Mainak Jas <[email protected]>

#############################################################################
###############################################################################
# Let us import hnn_core.

import hnn_core
Expand All @@ -23,7 +23,7 @@

# The number of cores may need modifying depending on your current machine.
n_jobs = 10
###########################################################################
###############################################################################


def set_params(param_values, net=None):
Expand Down Expand Up @@ -57,8 +57,8 @@ def set_params(param_values, net=None):
weights_ampa=weights_ampa,
synaptic_delays=synaptic_delays)

###########################################################################

###############################################################################
# Define a parameter grid for the batch simulation.

param_grid = {
'weight_basket': np.logspace(-4 - 1, 5),
Expand All @@ -67,6 +67,9 @@ def set_params(param_values, net=None):
'sigma': np.linspace(1, 20, 5)
}

###############################################################################
# Run the batch simulation and collect the results.

batch_simulation = BatchSimulate(set_params=set_params)
simulation_results = batch_simulation.run(param_grid,
n_jobs=n_jobs,
Expand Down

0 comments on commit 6e1a650

Please sign in to comment.