Skip to content

Instantly share code, notes, and snippets.

@caglorithm
Last active April 18, 2020 00:40
Show Gist options
  • Save caglorithm/948ab6ccf322da4f5f17dd42df6881f1 to your computer and use it in GitHub Desktop.
Save caglorithm/948ab6ccf322da4f5f17dd42df6881f1 to your computer and use it in GitHub Desktop.
Example brain network parameter exploration: tune global coupling strength
from neurolib.models.aln import ALNModel
from neurolib.utils.loadData import Dataset
from neurolib.optimize.exploration import BoxSearch
from neurolib.utils.parameterSpace import ParameterSpace
# load brain scan dataset
ds = Dataset("hcp")
# initialize brain network model
model = ALNModel(Cmat = ds.Cmat, Dmat = ds.Dmat)
# 5 minute simulation
model.params['duration'] = 5 * 60 * 1000 #ms
# define parameter range to search,
# Ke_gl is global coupling strength between nodes
parameters = ParameterSpace({"Ke_gl" : np.linspace(150, 500, 8)})
# initialize search
search = BoxSearch(model, parameters)
# start exploration, run chunkwise to save RAM, simulate bold
search.run(chunkwise=True, bold=True)
# ...
# load the results
search.loadResults()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment