Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion brainpy/dyn/neurons/reduced_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,7 @@ def __init__(self, size, V_rest=-70., V_reset=-70., V_th_inf=-50., V_th_reset=-6
self.I1 = bm.Variable(bm.zeros(self.num))
self.I2 = bm.Variable(bm.zeros(self.num))
self.V_th = bm.Variable(bm.ones(self.num) * -50.)
self.V = bm.Variable(bm.zeros(self.num))
self.V = bm.Variable(bm.zeros(self.num) - 70.)
self.input = bm.Variable(bm.zeros(self.num))
self.spike = bm.Variable(bm.zeros(self.num, dtype=bool))
self.t_last_spike = bm.Variable(bm.ones(self.num) * -1e7)
Expand Down
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ The code of BrainPy is open-sourced at GitHub:
tutorial_toolbox/synaptic_weights
tutorial_toolbox/optimizers
tutorial_toolbox/runners
tutorial_toolbox/inputs
tutorial_toolbox/monitors
tutorial_toolbox/saving_and_loading

Expand Down
10 changes: 5 additions & 5 deletions docs/quickstart/simulation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@
"id": "43ec39f4",
"metadata": {},
"source": [
"After build a SNN, we can use it for dynamic simulation. To run a simulation, we need first wrap the network model into a runner. Currently BrainPy provides ``DSRunner``, ``StructRunner``, ``ReportRunner`` in ``brainpy.dyn``. They receive inputs with the same structure, and will be expanded in [Running a Simulation](../tutorial_simulation/runner.ipynb). Here we use ``DSRunner`` as an example:"
"After build a SNN, we can use it for dynamic simulation. To run a simulation, we need first wrap the network model into a **runner**. Currently BrainPy provides ``DSRunner`` and ``ReportRunner`` in ``brainpy.dyn``, which will be expanded in the [Runners](../tutorial_simulation/runner.ipynb) tutorial. Here we use ``DSRunner`` as an example:"
]
},
{
Expand All @@ -191,7 +191,7 @@
"id": "11473917",
"metadata": {},
"source": [
"To make dynamic simulation more applicable and powerful, users can [**monitor**](../tutorial_simulation/monitors_and_inputs.ipynb) variable trajectories and give [**inputs**](../tutorial_simulation/monitors_and_inputs.ipynb) to target neuron groups. Here we monitor the ``spike`` variable in the ``E`` and ``I`` LIF model, which refers to the spking status of the neuron group, and give a constant input to both neuron groups. The time interval of numerical integration ``dt`` (with the default value of 0.1) can also be specified.\n",
"To make dynamic simulation more applicable and powerful, users can [**monitor**](../tutorial_toolbox/monitors.ipynb) variable trajectories and give [**inputs**](../tutorial_toolbox/inputs.ipynb) to target neuron groups. Here we monitor the ``spike`` variable in the ``E`` and ``I`` LIF model, which refers to the spking status of the neuron group, and give a constant input to both neuron groups. The time interval of numerical integration ``dt`` (with the default value of 0.1) can also be specified.\n",
"\n",
"After creating the runner, we can run a simulation by calling the runner:"
]
Expand Down Expand Up @@ -290,9 +290,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "brainpy",
"display_name": "Python [conda env:root] *",
"language": "python",
"name": "brainpy"
"name": "conda-root-py"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -304,7 +304,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.11"
"version": "3.8.8"
},
"latex_envs": {
"LaTeX_envs_menu_present": true,
Expand Down
16 changes: 12 additions & 4 deletions docs/tutorial_simulation/network_models.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@
"id": "84449872",
"metadata": {},
"source": [
" All elements are passed as ``**kwargs`` argument can be accessed by the provided keys. This will affect the following dynamics simualtion and will be discussed in greater detail in [tutorial of Monitors and Inputs](../tutorial_simulation/monitors_and_inputs.ipynb)."
"All elements are passed as ``**kwargs`` argument can be accessed by the provided keys. This will affect the following dynamics simualtion and will be discussed in greater detail in tutorial of [Runners](../tutorial_toolbox/runners.ipynb)."
]
},
{
Expand Down Expand Up @@ -466,13 +466,21 @@
"id": "ee0ef0f9",
"metadata": {},
"source": [
"Above are some simulation examples showing the possible application of network models. The detailed description of dynamics simulation is covered in [Dynamics Simulation](../tutorial_simulation/index.rst), where the use of monitors and inputs will be expatiated."
"Above are some simulation examples showing the possible application of network models. The detailed description of dynamics simulation is covered in the toolboxes, where the use of [runners](../tutorial_toolbox/runners.ipynb), [monitors](../tutorial_toolbox/monitors.ipynb), and [inputs](../tutorial_toolbox/inputs.ipynb) will be expatiated."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "d31c4afc",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
Expand All @@ -486,7 +494,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.7"
"version": "3.8.8"
},
"latex_envs": {
"LaTeX_envs_menu_present": true,
Expand Down
8 changes: 4 additions & 4 deletions docs/tutorial_simulation/neuron_models.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@
"id": "f9d2604b",
"metadata": {},
"source": [
"The details of the model simulation will be expanded in the [Dynamics Simulation](../tutorial_simulation/index.rst) section. In brief, running any dynamical system instance should be accomplished with a runner, such like `brianpy.StructRunner` and `brainpy.ReportRunner`. In the runner, the variables want to monitor and the input crrents try to specify can be provided when initializing the runner. The details please see the tutorial of [Monitors and Inputs](../tutorial_simulation/monitors_and_inputs.ipynb). "
"The details of the model simulation will be expanded in the [Runners](../tutorial_toolbox/runners.ipynb) section. In brief, running any dynamical system instance should be accomplished with a runner, such like `brianpy.DSRunner` and `brainpy.ReportRunner`. The variables to be monitored and the input crrents to be applied in the simulation can be provided when initializing the runner. The details are accessible in [Monitors](../tutorial_toolbox/monitors.ipynb) and [Inputs](../tutorial_toolbox/inputs.ipynb). "
]
},
{
Expand Down Expand Up @@ -512,7 +512,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
Expand All @@ -526,7 +526,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.7"
"version": "3.8.8"
},
"latex_envs": {
"LaTeX_envs_menu_present": true,
Expand Down Expand Up @@ -562,4 +562,4 @@
},
"nbformat": 4,
"nbformat_minor": 5
}
}
12 changes: 6 additions & 6 deletions docs/tutorial_simulation/synapse_models.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@
"1. Constructor function ``__init__()``, in which three key arguments are needed. \n",
" - `pre`: the pre-synaptic neural group. It should be an instance of `brainpy.dyn.NeuGroup`.\n",
" - `post`: the post-synaptic neural group. It should be an instance of `brainpy.dyn.NeuGroup`.\n",
" - `conn` (optional): the connection type between these two groups. BrainPy has provided abundant connection types that are described in details in the [Synaptic Connections](./synaptic_connections.ipynb).\n",
" - `conn` (optional): the connection type between these two groups. BrainPy has provided abundant connection types that are described in details in the [Synaptic Connections](../tutorial_toolbox/synaptic_connections.ipynb).\n",
"2. Update function ``update(_t, _dt)`` describes the updating rule from the current time $\\mathrm{\\_t}$ to the next time $\\mathrm{\\_t + \\_dt}$. "
]
},
Expand Down Expand Up @@ -385,7 +385,7 @@
"id": "44fa4941",
"metadata": {},
"source": [
"More details of the connection structures please see the tutorial of [Synaptic Connections](./synaptic_connections.ipynb)."
"More details of the connection structures please see the tutorial of [Synaptic Connections](../tutorial_toolbox/synaptic_connections.ipynb)."
]
},
{
Expand Down Expand Up @@ -953,15 +953,15 @@
"\n",
"Imaging you want to connect 10,000 pre-synaptic neurons to 10,000 post-synaptic neurons with a 10% random connection probability. Using matrix, you need $10^8$ floats to save the synaptic state, and at each update step, you need do computation on $10^8$ floats. Actually, the number of synapses you really connect is only $10^7$. See, there is a huge memory waste and computing resource inefficiency. Moreover, at the given time $\\mathrm{\\_t}$, the number of pre-synaptic neurons in the spiking state is small on average. This means we have made many useless computations when defining synaptic computations with matrix-based connections (zeros dot connection matrix results in zeros).\n",
"\n",
"Therefore, we need new ways to define synapse models. Specifically, we use vectors to store the connected neuron indices, like the ``pre_ids`` and ``post_ids`` (see [Synaptic Connections](./synaptic_connections.ipynb)). "
"Therefore, we need new ways to define synapse models. Specifically, we use vectors to store the connected neuron indices, like the ``pre_ids`` and ``post_ids`` (see [Synaptic Connections](../tutorial_toolbox/synaptic_connections.ipynb)). "
]
},
{
"cell_type": "markdown",
"id": "b67256b8",
"metadata": {},
"source": [
"In the below, we assume you have learned the synaptic connection types detailed in the tutorial of [Synaptic Connections](./synaptic_connections.ipynb)."
"In the below, we assume you have learned the synaptic connection types detailed in the tutorial of [Synaptic Connections](../tutorial_toolbox/synaptic_connections.ipynb)."
]
},
{
Expand Down Expand Up @@ -1233,7 +1233,7 @@
"encoding": "# -*- coding: utf-8 -*-"
},
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
Expand All @@ -1247,7 +1247,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.7"
"version": "3.8.8"
},
"latex_envs": {
"LaTeX_envs_menu_present": true,
Expand Down
Loading