Releases: neurolib-dev/neurolib
v0.7.0
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
- fixed bug in fhn, hopf, wc, ww models: copy params by @lenasal in #232
- removed Dmat_ndt as param set in timeIntegration file by @lenasal in #234
- moved computedelaymatrix function to /utils/model_utils by @lenasal in #235
- Fix numpy new version errors by @jajcayn in #238
- corrected index of rates_exc in computation of IA_rhs by @lenasal in #237
- Kuramoto dev by @bramantyois in #239
- aln: fix index of input from i to i-1 by @caglorithm in #240
- Simplify kuramoto time integration by @lenasal in #244
- aln input_vars by @lenasal in #243
- Differentiale static and time-dependent inputs in WC and WW model by @lenasal in #241
- Minor Docs Fixes by @1b15 in #251
- Optimal Control extension by @lenasal in #247
- Bug Fix: Setting value of tau_inh in timeIntegration by @Andrew-Clappison in #260
- Revise control tests by @lenasal in #258
- Added control interval by @lenasal in #256
- Fix bug in fhn and hopf OC by @lenasal in #255
- Directional sparsity cost functional by @lenasal in #259
- Lead field matrix by @Wirkungstreffer in #249
- feat: Adding Lead-Field Matrix for AAL2 Atlas by @orabe in #248
- spring cleaning: removing bugs and code smells by @1b15 in #261
New Contributors
- @bramantyois made their first contribution in #239
- @1b15 made their first contribution in #251
- @Andrew-Clappison made their first contribution in #260
- @Wirkungstreffer made their first contribution in #249
- @orabe made their first contribution in #248
Full Changelog: v0.6.2...v0.7.0
v0.6.2
What's Changed
- Multiplicative network coupling by @jajcayn in #202
- Minor fixes: setting seed + avoiding index out of bounds for noise array by @mattiasJohnson in #210
- ParameterSpace: fix kind assumption & fix documentation by @caglorithm in #212
- Time dependent inputs for FHN, WC, Hopf by @lenasal in #211
- Examples: rename models by @caglorithm in #214
- Fix tests by @jajcayn in #228
- Seed default parameter by @lenasal in #225
- Hopefully fix docs CI errors by @jajcayn in #229
- Fix spelling Example 0.0 by @StevenGeysen in #230
New Contributors
- @mattiasJohnson made their first contribution in #210
- @StevenGeysen made their first contribution in #230
Full Changelog: v0.6.1...v0.6.2
Fixes and Improvements
This is a minor release with various bug fixes and improvements.
What's Changed
- MultiModel continue run by @jajcayn in #182
- QFix: Rescaling connectivity in ALN MultiModel by @jajcayn in #184
- How to cite by @jajcayn in #186
- Readme add paper by @caglorithm in #188
- fix link by @caglorithm in #190
- Quick fixes for BoxSearch xr() when exploring MultiModel by @jajcayn in #189
- More explore options by @jajcayn in #191
- Evolution: fix filename by @caglorithm in #187
- Better error catching in evolution by @jajcayn in #193
- bump version by @caglorithm in #194
Full Changelog: v0.6...v0.6.1
Introducing heterogeneous modeling with MultiModel: rise and shine ๐. Zap your models with the new Stimulusโก๏ธ class
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 oneneurolib
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 theALNModel
. 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 theALNModel
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
.
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)
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);
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
๐ 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
Bugfix:
- Bold model respects global variable scopes and can supports newer
numba
versions
Improvements:
neurolib
now has a documentation page
New neural mass model: Wong-Wang
- ๐ 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
๐ 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
This small update includes the following changes:
- ๐จ Models now have the parameter
model.params["sampling_dt"]
which will downsample themodel.output
to a specified step size (in ms). - ๐ง LoadData: add subject-wise length matrices
ds.Dmats
Thalamus model supports autochunk
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!