Skip to content

Commit

Permalink
slightly cleaned up typo changes
Browse files Browse the repository at this point in the history
  • Loading branch information
1b15 committed Oct 27, 2023
1 parent 9ac8a78 commit 386f8c7
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 49 deletions.
42 changes: 1 addition & 41 deletions examples/example-0-aln-minimal.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"cells": [
{
"cell_type": "markdown",
"id": "8a6f2b8c",
"metadata": {},
"source": [
"# The neural mass model\n",
Expand All @@ -21,7 +20,6 @@
{
"cell_type": "code",
"execution_count": 2,
"id": "a4609576",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -38,7 +36,6 @@
{
"cell_type": "code",
"execution_count": 3,
"id": "164aa090",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -64,7 +61,6 @@
},
{
"cell_type": "markdown",
"id": "323ff10d",
"metadata": {},
"source": [
"## Simulating a single `aln` node\n",
Expand All @@ -76,7 +72,6 @@
{
"cell_type": "code",
"execution_count": 4,
"id": "d825eec0",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -103,15 +98,13 @@
},
{
"cell_type": "markdown",
"id": "68096e88",
"metadata": {},
"source": [
"### Accessing the outputs"
]
},
{
"cell_type": "markdown",
"id": "a74a32f8",
"metadata": {},
"source": [
"Accessing the outputs is straight-forward. Every model's outputs\n",
Expand All @@ -123,7 +116,6 @@
{
"cell_type": "code",
"execution_count": 5,
"id": "1f388c85",
"metadata": {},
"outputs": [
{
Expand All @@ -149,7 +141,6 @@
{
"cell_type": "code",
"execution_count": 6,
"id": "36d72689",
"metadata": {},
"outputs": [
{
Expand All @@ -171,31 +162,27 @@
},
{
"cell_type": "markdown",
"id": "cc193389",
"metadata": {},
"source": [
"### Bifurcation diagram"
]
},
{
"cell_type": "markdown",
"id": "52e418f5",
"metadata": {},
"source": [
"Bifurcation diagrams can give us an overview of how different parameters of the model affect its dynamics. The simplest method for drawing a bifurcation diagram is to simply change relevant parameters step by step and record the model's behavior in response to these changes. In this example, we want to see how the model's dynamics changes with respect to the **external input currents** to the excitatory population. These input currents could be due to couplings with other nodes in a brain network or we could model other factors like external electrical stimulation. "
]
},
{
"cell_type": "markdown",
"id": "1df220a9",
"metadata": {},
"source": [
"Below, you can see a schematic of the `aln` model. As you can see, a single node consists of one excitatory (red) and one inhibitory population (blue). The parameter that controls the mean input to the excitatory population is $\\mu_{E}$ or `model.params[\"mue_ext_mean\"]` ."
]
},
{
"cell_type": "markdown",
"id": "3f814ff4",
"metadata": {},
"source": [
"<p align=\"center\">\n",
Expand All @@ -205,7 +192,6 @@
},
{
"cell_type": "markdown",
"id": "9f8f42aa",
"metadata": {},
"source": [
"Let's first decrease the duration of a single run so we can scan the parameter space a bit faster and let's also disable the noisy input."
Expand All @@ -214,7 +200,6 @@
{
"cell_type": "code",
"execution_count": 15,
"id": "44575a43",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -224,7 +209,6 @@
},
{
"cell_type": "markdown",
"id": "3dde7b42",
"metadata": {},
"source": [
"Let's fix the input to the inhibitory population:"
Expand All @@ -233,7 +217,6 @@
{
"cell_type": "code",
"execution_count": 19,
"id": "88428765",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -242,7 +225,6 @@
},
{
"cell_type": "markdown",
"id": "5ee59bc2",
"metadata": {},
"source": [
"We draw a one-dimensional bifurcation diagram, so it is enough to loop through different values of `mue_ext_mean` and record the minimum and maximum of the rate for each parameter."
Expand All @@ -251,7 +233,6 @@
{
"cell_type": "code",
"execution_count": 22,
"id": "42255714",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -272,7 +253,6 @@
},
{
"cell_type": "markdown",
"id": "0761e4a0",
"metadata": {},
"source": [
"Let's plot the results!"
Expand All @@ -281,7 +261,6 @@
{
"cell_type": "code",
"execution_count": 24,
"id": "e780c6db",
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -317,15 +296,13 @@
},
{
"cell_type": "markdown",
"id": "c9190800",
"metadata": {},
"source": [
"## Whole-brain model"
]
},
{
"cell_type": "markdown",
"id": "5886011d",
"metadata": {},
"source": [
"`neurolib` comes with some example datasets for exploring its functionality. Please be aware that these datasets are not tested and should not be used for your research, only for experimentation with the software.\n",
Expand All @@ -342,7 +319,6 @@
{
"cell_type": "code",
"execution_count": 13,
"id": "4423eef3",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -352,7 +328,6 @@
},
{
"cell_type": "markdown",
"id": "b832d140",
"metadata": {},
"source": [
"We now create the `aln` model with a structural connectivity matrix and a delay matrix. In order to achieve a good fit of the BOLD activity to the empirical data, the model has to run for quite a while. A a rule of thumb, a simulation of resting-state BOLD activity should not be shorter than 3 minutes and preferably longer than 5 minutes real time. If the empirical recordings are for example 10 minutes long, ideally, a simulation of 10 minutes would be used to compare the output of the model to the resting state recording."
Expand All @@ -361,7 +336,6 @@
{
"cell_type": "code",
"execution_count": 14,
"id": "7c332d0e",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -374,7 +348,6 @@
},
{
"cell_type": "markdown",
"id": "191451ce",
"metadata": {},
"source": [
"After some optimization to the resting-state fMRI data of the dataset, we \n",
Expand All @@ -386,7 +359,6 @@
{
"cell_type": "code",
"execution_count": 5,
"id": "1067e858",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -400,7 +372,6 @@
},
{
"cell_type": "markdown",
"id": "dc7dfb9c",
"metadata": {},
"source": [
"Let's have a look what the data looks like. We can access the\n",
Expand All @@ -417,7 +388,6 @@
{
"cell_type": "code",
"execution_count": 16,
"id": "7f7cfb8b",
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -461,15 +431,13 @@
},
{
"cell_type": "markdown",
"id": "19f47f6e",
"metadata": {},
"source": [
"### Run model"
]
},
{
"cell_type": "markdown",
"id": "b0fa5eb3",
"metadata": {},
"source": [
"We run the model with bold simulation by using `bold=True`. \n",
Expand All @@ -491,7 +459,6 @@
{
"cell_type": "code",
"execution_count": 15,
"id": "89402454",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -500,7 +467,6 @@
},
{
"cell_type": "markdown",
"id": "0bcfd006",
"metadata": {},
"source": [
"## Results\n",
Expand All @@ -511,7 +477,6 @@
{
"cell_type": "code",
"execution_count": 9,
"id": "abc29f91",
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -543,7 +508,6 @@
},
{
"cell_type": "markdown",
"id": "e1902483",
"metadata": {},
"source": [
"For convenience, they can also be accessed directly using attributes of the model with the outputs name, like `model.rates_exc`. The outputs are also available as xr DataArrays as `model.xr()`.\n",
Expand All @@ -553,7 +517,6 @@
},
{
"cell_type": "markdown",
"id": "c5586afd",
"metadata": {},
"source": [
"### Plot simulated activity"
Expand All @@ -562,7 +525,6 @@
{
"cell_type": "code",
"execution_count": 25,
"id": "5f45b272",
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -608,7 +570,6 @@
},
{
"cell_type": "markdown",
"id": "0d3f4d1f",
"metadata": {},
"source": [
"### Correlation of simulated BOLD to empirical data\n",
Expand All @@ -619,7 +580,6 @@
{
"cell_type": "code",
"execution_count": 26,
"id": "9185692e",
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -655,7 +615,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.8"
"version": "3.8.13"
}
},
"nbformat": 4,
Expand Down
8 changes: 4 additions & 4 deletions examples/example-0.2-basic_analysis.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
"# optional description\n",
"fr.description = \"Output of the ALN model with default SC and fiber lengths\"\n",
"\n",
"# Create Signal out of BOLD simulated time series\n",
"# Create Signal out of BOLD simulated timeseries\n",
"bold = BOLDSignal.from_model_output(aln, group=\"BOLD\", time_in_ms=True)\n",
"bold.description = \"Simulated BOLD of the ALN model with default SC and fiber lengths\""
]
Expand Down Expand Up @@ -918,7 +918,7 @@
],
"source": [
"# apply 1D function - Signal supports applying 1D function per temporal slice\n",
"# both are supported: function that reduces temporal dimension (e.g. mean which reduces time series of length N to one number),\n",
"# both are supported: function that reduces temporal dimension (e.g. mean which reduces timeseries of length N to one number),\n",
"# and functions that preserve shape\n",
"\n",
"# reduce\n",
Expand All @@ -939,7 +939,7 @@
"## Functional connectivity\n",
"\n",
"Lot of modelling effort actually goes to fitting the experimental functional connectivity with the modelled one.\n",
"That's why `Signal` class supports functional connectivity computation and with other methods (like filtering and iterating over temporal windows) we can even do time series of FC or band-specific FC very easily within the couple of lines."
"That's why `Signal` class supports functional connectivity computation and with other methods (like filtering and iterating over temporal windows) we can even do timeseries of FC or band-specific FC very easily within the couple of lines."
]
},
{
Expand Down Expand Up @@ -1194,7 +1194,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.8"
"version": "3.8.13"
}
},
"nbformat": 4,
Expand Down
2 changes: 1 addition & 1 deletion examples/example-0.3-fhn-minimal.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.8"
"version": "3.8.13"
}
},
"nbformat": 4,
Expand Down
2 changes: 1 addition & 1 deletion examples/example-0.4-wc-minimal.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.8"
"version": "3.8.13"
}
},
"nbformat": 4,
Expand Down
2 changes: 1 addition & 1 deletion examples/example-0.5-kuramoto.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.8"
"version": "3.8.13"
}
},
"nbformat": 4,
Expand Down
Loading

0 comments on commit 386f8c7

Please sign in to comment.