You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+35-1Lines changed: 35 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,6 +35,8 @@ You can chose from different neural mass [models](https://github.com/neurolib-de
35
35
36
36
📚 Please read the [gentle introduction](https://caglorithm.github.io/notebooks/neurolib-intro/) to `neurolib` for an overview of the basic functionality and the science behind whole-brain simulations or read the [documentation](https://neurolib-dev.github.io/) for getting started.
37
37
38
+
To browse the source code of `neurolib` visit out [GitHub repository](https://github.com/neurolib-dev/neurolib).
39
+
38
40
📝 <ahref="#how-to-cite">Cite</a> the following paper if you use `neurolib` for your own research:
39
41
40
42
> Cakan, C., Jajcay, N. & Obermayer, K. neurolib: A Simulation Framework for Whole-Brain Neural Mass Modeling. [Cogn. Comput. (2021)](https://journals.plos.org/ploscompbiol/article?id=10.1371/journal.pcbi.1007822).
@@ -95,6 +97,10 @@ neurolib/ # Main module
95
97
├── optimize/ # Optimization submodule
96
98
├── evolution/ # Evolutionary optimization
97
99
└── exploration/ # Parameter exploration
100
+
├── control/optimal_control/ # Optimal control submodule
@@ -120,6 +126,7 @@ Example [IPython Notebooks](examples/) on how to use the library can be found in
120
126
-[Example 0.6](https://mybinder.org/v2/gh/neurolib-dev/neurolib/master?filepath=examples%2Fexample-0.6-custom-model.ipynb) - Minimal example of how to implement your own model in `neurolib`
121
127
-[Example 1.2](https://mybinder.org/v2/gh/neurolib-dev/neurolib/master?filepath=examples%2Fexample-1.2-brain-network-exploration.ipynb) - Parameter exploration of a brain network and fitting to BOLD data
122
128
-[Example 2.0](https://mybinder.org/v2/gh/neurolib-dev/neurolib/master?filepath=examples%2Fexample-2-evolutionary-optimization-minimal.ipynb) - A simple example of the evolutionary optimization framework
129
+
-[Example 5.2](https://mybinder.org/v2/gh/neurolib-dev/neurolib/master?filepath=examples%2Fexample-5.2-oc-wc-model-deterministic.ipynb) - Example of optimal control of the noise-free Wilson-Cowan model
123
130
124
131
A basic overview of the functionality of `neurolib` is also given in the following.
125
132
@@ -282,6 +289,31 @@ This will gives us a summary of the last generation and plots a distribution of
The optimal control module enables to compute efficient stimulation for your neural model. If you know how your output should look like, this module computes the optimal input. Detailes example notebooks can be found in the [example folder](https://github.com/neurolib-dev/neurolib/tree/master/examples) (examples 5.1, 5.2, 5.3, 5.4). In optimal control computations, you trade precision with respect to a target against control strength. You can determine how much each contribution affects the results, by setting weights accordingly.
294
+
295
+
To compute an optimal control signal, you need to create a model (e.g., an FHN model) and define a target state (e.g., a sine curve with period 2).
You can then create a controlled model and run the iterative optimization to find the most efficient control input. The optimal control and the controlled model activity can be taken from the controlled model.
308
+
```python
309
+
model_controlled = oc_fhn.OcFhn(model, target)
310
+
model_controlled.optimize(500) # run 500 iterations
311
+
optimal_control = model_controlled.control
312
+
optimal_state = model_controlled.get_xs()
313
+
```
314
+
315
+
For a comprehensive study on optimal control of the Wilson-Cowan model based on the neurolib optimal control module, see Salfenmoser, L. & Obermayer, K. Optimal control of a Wilson–Cowan model of neural population dynamics. Chaos 33, 043135 (2023). https://doi.org/10.1063/5.0144682.
316
+
285
317
## More information
286
318
287
319
### Built With
@@ -313,9 +345,11 @@ Cakan, C., Jajcay, N. & Obermayer, K. neurolib: A Simulation Framework for Whole
Department of Software Engineering and Theoretical Computer Science, Technische Universität Berlin, Germany
316
-
Bernstein Center for Computational Neuroscience Berlin, Germany
348
+
Bernstein Center for Computational Neuroscience Berlin, Germany
317
349
318
350
### Acknowledgments
319
351
This work was supported by the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) with the project number 327654276 (SFB 1315) and the Research Training Group GRK1589/2.
320
352
353
+
The optimal control module was developed by Lena Salfenmoser and Martin Krück supported by the DFG project 163436311 (SFB 910).
Copy file name to clipboardExpand all lines: examples/example-0.3-fhn-minimal.ipynb
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@
6
6
"source": [
7
7
"# The Fitz-Hugh Nagumo oscillator\n",
8
8
"\n",
9
-
"In this notebook, the basic use of the implementation of the Fitz-Hugh Nagumo (`fhn`) model is presented. Usually, the `fhn` model is used to represent a single neuron (for example in `Cakan et al. (2014)`, \"Heterogeneous delays in neural networks\"). This is due to the difference in timescales of the two equations that define the FHN model: The first equation is often referred to as the \"fast variable\" whereas the second one is the \"slow variable\". This makes it possible to create a model with a very fast spiking mechanism but with a slow refractory period. \n",
9
+
"In this notebook, the basic use of the implementation of the FitzHugh-Nagumo (`fhn`) model is presented. Usually, the `fhn` model is used to represent a single neuron (for example in `Cakan et al. (2014)`, \"Heterogeneous delays in neural networks\"). This is due to the difference in timescales of the two equations that define the FHN model: The first equation is often referred to as the \"fast variable\" whereas the second one is the \"slow variable\". This makes it possible to create a model with a very fast spiking mechanism but with a slow refractory period. \n",
10
10
"\n",
11
11
"In our case, we are using a parameterization of the `fhn` model that is not quite as usual. Inspired by the paper by `Kostova et al. (2004)` \"FitzHugh–Nagumo revisited: Types of bifurcations, periodical forcing and stability regions by a Lyapunov functional.\", the implementation in `neurolib` produces a slowly oscillating dynamics and has the advantage to incorporate an external input term that causes a Hopf bifurcation. This means, that the model roughly approximates the behaviour of the `aln` model: For low input values, there is a low-activity fixed point, for intermediate inputs, there is an oscillatory region, and for high input values, the system is in a high-activity fixed point. Thus, it offers a simple way of exploring the dynamics of a neural mass model with these properties, such as the `aln` model.\n",
Copy file name to clipboardExpand all lines: examples/example-0.5-kuramoto.ipynb
+7-8Lines changed: 7 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -63,7 +63,7 @@
63
63
"source": [
64
64
"# Single node simulation \n",
65
65
"\n",
66
-
"Here we will simulate a signal node with no noise. We then cap the phase values to be between 0 and 2*pi. We also willo plot the phase values over time."
66
+
"Here we will simulate a signal node with no noise. We then cap the phase values to be between 0 and 2*pi. We also will plot the phase values over time."
67
67
]
68
68
},
69
69
{
@@ -117,7 +117,7 @@
117
117
"cell_type": "markdown",
118
118
"metadata": {},
119
119
"source": [
120
-
"Here we simulate networks of oscillators. We will simulate a network of 8 oscillators with a global coupling strength 0.3. Here we initialize a connectivity matrix with all-to-all connectivity. We then simulate the network for 30 miliseconds assuming dt is in ms. We will also plot the phase values over time."
120
+
"Here we simulate networks of oscillators. We will simulate a network of 8 oscillators with a global coupling strength 0.3. Here we initialize a connectivity matrix with all-to-all connectivity. We then simulate the network for 30 milliseconds assuming dt is in ms. We will also plot the phase values over time."
121
121
]
122
122
},
123
123
{
@@ -222,13 +222,13 @@
222
222
"cell_type": "markdown",
223
223
"metadata": {},
224
224
"source": [
225
-
"Now the syncrhonization happens after 7 ms which is faster compared to the previous simulation."
225
+
"Now the synchronization happens after 7 ms which is faster compared to the previous simulation."
0 commit comments