Skip to content

Releases: neurolib-dev/neurolib

v0.7.0

02 Apr 13:08
6be0d37
Compare
Choose a tag to compare

This new release introduces a new optimal control framework by @lenasal, new AAL2 lead-field matrices by @orabe and @Wirkungstreffer, and many small fixes by @1b15.

What's Changed

New Contributors

Full Changelog: v0.6.2...v0.7.0

v0.6.2

07 Dec 12:02
a66836f
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v0.6.1...v0.6.2

Fixes and Improvements

22 Mar 22:32
714eef4
Compare
Choose a tag to compare

This is a minor release with various bug fixes and improvements.

What's Changed

Full Changelog: v0.6...v0.6.1

Introducing heterogeneous modeling with MultiModel: rise and shine ๐ŸŒˆ. Zap your models with the new Stimulusโšก๏ธ class

05 Aug 10:46
696b099
Compare
Choose a tag to compare

In this new release, we introduce the MultiModel๐ŸŒˆ framework and the Stimulusโšก๏ธ class.

MultiModel ๐ŸŒˆ

  • MultiModel is a framework for constructing neural mass models and combining them with others into one neurolib model (example notebooks here, here, and here)

Here is a short summary of how MultiModel works:

Models in MultiModel are implemented and simulated in an hierarchical fashion with three different levels: The first level is a neural mass, representing a single homogeneous neural population which is defined by a set of differential equations. An example of this is the excitatory subpopulation of the ALNModel. The second level is a node, defined as a collection of neural masses. The subpopulations of a node are coupled via a local connectivity matrix. An example of this is a single node of the ALNModel with excitatory and inhibitory subpopulations. Finally, in the third level, a collection of nodes is represented as a network, in which nodes are connected according to a global connectivity matrix. In the case of a brain network, these are the fiber count and fiber length matrices from DTI. The dynamical equations within all levels in the hierarchy can be implemented by the user, and, more importantly, once defined, can be reused and "plugged together" with other models. MultiModel integrates the equations of each neural mass on the lowest level, and handles the synchronization and coupling of all relevant variables according to the predefined local and global coupling schemes on all higher levels.

Building MultiModel brings us closer to simulating truly heterogeneous neural mass models. What it allows us to do right now is, for example, to simulate a thalamocortical network, with the thalamus being represented by a ThalamicMassModel and the cortex by the ALNModel.
image

A block of pseudocode says more than a picture:

from neurolib.models.multimodel import MultiModel
		
from neurolib.models.multimodel.builder.base.network import Network	
from neurolib.models.multimodel.builder.aln import ALNNode
from neurolib.models.multimodel.builder.thalamus import ThalamicNode

class ThalamoCorticalNetwork(Network):
    def __init__(self):
    	cortex = ALNNode()
    	thalamus = ThalamicNode()
    	connectivity = np.array([0, 1], [1, 0])
    	super().__init__([aln_node, thalamus], connectivity)
    def _sync(self):
    	""" define which variables to couple """
    
model = MultiModel(ThalamoCorticalNetwork())

As you can see, here we have created a new model called ThalamoCorticalNetwork that consists of an ALNNode and a ThalamicNode. We have coupled them according to connectivity. In the real world, we would also have to define the _sync method, that tells neurolib which variables to couple to which, across models. We refer to the example notebooks for more details on how to implement a full model.

Our vision for this framework is adding more specialized models for different brain areas with the ultimate goal of heterogeneous whole-brain modeling, such as combining a cortical model with models of thalamic or hippocampal neural populations. This will enable us to model different brain rhythms generated in specialized neural circuits and study their whole-brain interactions.

Stimulus โšก๏ธ

  • The Stimulusโšก๏ธ class allows you to easily construct external stimuli that you can apply to neural mass models (example notebook here)

Stimuli are created by calling the appropriate classes that we've implemented:

# let's create some basic inputs
ou = stim.OrnsteinUhlenbeckProcess(mu=0.1, sigma=0.04, tau=2.0, n=2)
sq = stim.SquareInput(amplitude=0.2, frequency=1.7, n=2)
sin = stim.SinusoidalInput(amplitude=0.7, frequency=1.0, n=2)

image

You can now use the operators + and & to sum up stimuli and concatenate them. By combining different stimuli, this allows you to build a wide range of different stimuli. Here is an example of concatenation:

# same lengths - use &
conc = ou & sq & sin
plt.plot(conc.as_array(duration, dt).T);

image

Coupling a stimulus to a model couldn't be easier:

model.params["ext_exc_current"] = stimulus.to_model(model)

Special thanks for this release goes to @jajcayn who has been working hard to make this happen. We also want to thank all users who open Issues to report bugs, ask us questions, and let us learn more how neurolib is used in practice. Please feel free to contact us with your ideas and thoughts, we appreciate it a lot to know that there are researchers using neurolib out there.

๐Ÿ›  Minor fix: exploration and evolution support for lists

31 Mar 10:18
3517cfc
Compare
Choose a tag to compare

๐Ÿ›  In this minor update, exploration and evolution now support for list outputs. Previously, they could only handle scalars and numpy.ndarray's.

๐Ÿ”ฅ Hotfix: BOLD model variable scope

15 Feb 16:40
8b6e509
Compare
Choose a tag to compare

Bugfix:

  • Bold model respects global variable scopes and can supports newer numba versions

Improvements:

New neural mass model: Wong-Wang

05 Feb 14:58
73288ed
Compare
Choose a tag to compare
  • ๐Ÿš€ We implemented a new model, namely the famous Wong-Wang neural mass model!
  • ๐Ÿ›  Bug fix concerning the input variables of the Wilson-Cowan model. See #129 for more info.

Minimal custom models

20 Jan 17:42
4145f71
Compare
Choose a tag to compare

๐Ÿ›  We've stripped off some of the requirements for running models, so implementing custom models is easier than ever.

Please have a look at the example notebook on our GitHub repo or directly launch the example in Binder to see how to implement your own model in a couple of minutes.

Subsampling and subject delay matrices

10 Nov 11:50
ae1d089
Compare
Choose a tag to compare

This small update includes the following changes:

  • ๐Ÿ”จ Models now have the parameter model.params["sampling_dt"] which will downsample the model.output to a specified step size (in ms).
  • ๐Ÿง  LoadData: add subject-wise length matrices ds.Dmats

Thalamus model supports autochunk

27 Oct 13:16
38b26be
Compare
Choose a tag to compare

Update paving the way for a very big update soon.

๐Ÿš€ Improvements:

  • ALN model added to the multimodel framework

๐Ÿ”จ Fix:

  • 'ThalamicMassModel` now works with autochunk for very long simulations with minimal RAM usage!