-
Notifications
You must be signed in to change notification settings - Fork 391
Add PyNEST example using ignore_and_fire model for scaling experiments
#3276
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
jessica-mitchell
wants to merge
42
commits into
nest:master
Choose a base branch
from
jessica-mitchell:ignore_example
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
42 commits
Select commit
Hold shift + click to select a range
351d6d7
copy files from pynest examples, add toc
jessica-mitchell 34a0bc5
add ignore_and_fire example files
jessica-mitchell ecf83db
reword text
jessica-mitchell ec4bdf9
update table formats
jessica-mitchell 5ed069c
add network sketch
jessica-mitchell 997b209
add sketck
jessica-mitchell 3ad57d7
move links to admonitions in appropriate section
jessica-mitchell 5f6b656
add LIF to text
jessica-mitchell f58e605
model description moved to doc folder; Snakefile for model sketch gen…
tomtetzlaff 3f4c7bc
files/folder restructured; README file adapted to new file/folder str…
tomtetzlaff 3e39bae
implementation and documentation of ignore_and_fire usecase in snakemake
tomtetzlaff 8908990
revision description of ignore_and_fire usecase
tomtetzlaff 0dc98dd
obsolete file/folder removed
tomtetzlaff 67e113f
revision ignore_and_fire usecase docu
tomtetzlaff b993792
revision ignore_and_fire usecase docu
tomtetzlaff d87245b
revision figures for ignore_and_fire usecase
tomtetzlaff 57f5a2d
revision docu ignore_and_fire usecase
tomtetzlaff a3f84bb
revision docu ignore_and_fire usecase
tomtetzlaff 94f8a3f
revision docu ignore_and_fire usecase
tomtetzlaff 5d30b2d
revision docu ignore_and_fire usecase
tomtetzlaff 4245373
revision docu ignore_and_fire usecase
tomtetzlaff b0c8074
revision docu ignore_and_fire usecase
tomtetzlaff 0073c75
revision docu ignore_and_fire usecase
tomtetzlaff c8c2568
revision docu ignore_and_fire usecase
tomtetzlaff b50a60d
revision docu ignore_and_fire usecase
tomtetzlaff c9fbe12
Merge branch 'master' into ignore_example
jessica-mitchell 3d7db31
Merge remote-tracking branch 'tomtetzlaff/ignore_example_jessica' int…
jessica-mitchell f774eea
minor fixes
jessica-mitchell a92fa20
move images to static/img remove docs on generateing svg
jessica-mitchell 90c84f4
rename py files
jessica-mitchell 9488ce8
modify Snakefile, rename, use python3; update README, model desc and …
jessica-mitchell 71efc97
update conf with snakefile, and use sketch for example index
jessica-mitchell 71a3ccb
fix missing line
jessica-mitchell 2d775d0
Merge branch 'master' into ignore_example
jessica-mitchell d956490
add link to ignore and fire
jessica-mitchell 690f0f9
fix headers
jessica-mitchell 051aba9
header
jessica-mitchell 62f81e9
resolve pylinting issues
jessica-mitchell 9091b09
pylint
jessica-mitchell 6a469dc
lint
jessica-mitchell 9be4969
minor text updates
jessica-mitchell 207793f
Merge branch 'master' into ignore_example
jessica-mitchell File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
335 changes: 335 additions & 0 deletions
335
doc/htmldoc/static/img/NetworkSketch_TwoPopulationNetworkPlastic.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+42.8 KB
...c/static/img/TwoPopulationNetworkPlastic_iaf_psc_alpha_connectivity_postsim.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+37.1 KB
...oc/static/img/TwoPopulationNetworkPlastic_iaf_psc_alpha_connectivity_presim.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.03 MB
doc/htmldoc/static/img/TwoPopulationNetworkPlastic_iaf_psc_alpha_spikes.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+53 KB
...c/static/img/TwoPopulationNetworkPlastic_iaf_psc_alpha_weight_distributions.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+43.5 KB
...static/img/TwoPopulationNetworkPlastic_ignore_and_fire_connectivity_postsim.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+37 KB
.../static/img/TwoPopulationNetworkPlastic_ignore_and_fire_connectivity_presim.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.03 MB
doc/htmldoc/static/img/TwoPopulationNetworkPlastic_ignore_and_fire_spikes.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+52.8 KB
...static/img/TwoPopulationNetworkPlastic_ignore_and_fire_weight_distributions.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,164 @@ | ||
| .. _experiment-ignore: | ||
|
|
||
| Exact scaling experiments using the ``ignore_and_fire`` neuron | ||
| =============================================================== | ||
|
|
||
| Background: (Non-) Scalability of recurrent neuronal networks | ||
| --------------------------------------------------------------- | ||
|
|
||
| The verification and validation of neuronal simulation architectures (soft- and hardware) is typically based on | ||
| models describing networks of neurons. Ideally, such test-case models are scalable with respect to the network size | ||
|
|
||
| - to foster a comparison between different computing architectures with different computational resources, | ||
| - to be able to extrapolate (up-scale) to networks at brain scale, even if data constrained and well tested | ||
| network models at this scale are not yet published or existing, and | ||
| - to be able to study and compare different plasticity mechanisms with slow dynamics (down-scaling). | ||
|
|
||
| Biological neuronal networks are characterized by a high degree of recurrency. As shown in [1]_, scaling the number of nodes or edges in a recurrent neuronal | ||
| networks generally alters the network dynamics, such as the average activity level or the structure of correlations. | ||
| Preserving certain dynamical features by adjusting other parameters can only be achieved in limited ranges or exceptional cases. Recurrent neuronal net | ||
| works are hence not truly scalable. In this example, we demonstrate how the :doc:`ignore_and_fire </models/ignore_and_fire>` neuron can help to perform | ||
| exact scaling experiments with arbitrary types of networks. | ||
|
|
||
|
|
||
| Network model | ||
| ------------- | ||
|
|
||
| In this example, we employ a simple network model describing the dynamics | ||
| of a local cortical circuit at the spatial scale of ~1mm within a single cortical layer. It is derived from the model | ||
| proposed in [2]_, but accounts for the synaptic weight dynamics for connections between excitatory neurons. The weight | ||
| dynamics are described by the spike-timing-dependent plasticity (STDP) model derived in [8]_. The model provides a | ||
| mechanism underlying the formation of broad distributions of synaptic weights in combination with asynchronous | ||
| irregular spiking activity (see figure below). | ||
|
|
||
| A variant of this model, the :doc:`hpc_benchmark </auto_examples/hpc_benchmark>`, has been used in a number of | ||
| benchmarking studies, in particular for weak-scaling experiments ([3]_, [4]_, [5]_, [6]_, [7]_). Due to its random | ||
| homogeneous connectivity, the model represents a hard benchmarking scenario: each neuron projects with equal probability | ||
| to any other neuron in the network. Implementations of this model can therefore not exploit any spatial connectivity | ||
| patterns. In contrast to the model used here, the plasticity dynamics in the ``hpc_benchmark`` is parameterized such | ||
| that it has only a weak effect on the synaptic weights and, hence, the network dynamics. Here, the effect of the | ||
| synaptic plasticity is substantial and leads to a significant broadening of the weight distribution (see figure below). | ||
| Synaptic weights thereby become a sensitive target metric for verification and validation studies. | ||
|
|
||
|
|
||
| Comparison between the networks with ``integrate-and-fire`` and ``ignore-and-fire`` dynamics | ||
| -------------------------------------------------------------------------------------------- | ||
|
|
||
| The model employed here can be configured into a truly scalable mode by replacing the integrate-and-fire neurons by an | ||
| :doc:`ignore_and_fire </models/ignore_and_fire>` dynamics. By doing so, the spike generation dynamics is decoupled | ||
| from the input integration and the plasticity dynamics; the overall network activity, and, hence, the communication | ||
| load, is fully controlled by the user. The firing rates and phases of the :doc:`ignore_and_fire </models/ignore_and_fire>` | ||
| model are randomly drawn from uniform distributions to guarantee asynchronous spiking activity. The plasticity dynamics | ||
| remains intact (see figure below). | ||
|
|
||
| ================== ===================== | ||
| ``iaf_psc_alpha`` ``ignore_and_fire`` | ||
| ================== ===================== | ||
| |iaf_spikes| |ign_spikes| | ||
| |iaf_weight| |ign_weight| | ||
| ================== ===================== | ||
|
|
||
|
|
||
| .. |iaf_spikes| image:: /static/img/TwoPopulationNetworkPlastic_iaf_psc_alpha_spikes.png | ||
| .. |iaf_weight| image:: /static/img/TwoPopulationNetworkPlastic_iaf_psc_alpha_weight_distributions.png | ||
| .. |ign_spikes| image:: /static/img/TwoPopulationNetworkPlastic_ignore_and_fire_spikes.png | ||
| .. |ign_weight| image:: /static/img/TwoPopulationNetworkPlastic_ignore_and_fire_weight_distributions.png | ||
|
|
||
|
|
||
| Spiking activity (top) and distributions of excitatory synaptic weights (bottom) for the network with integrate-and-fire | ||
| (``iaf_psc_alpha_nest``) and :doc:`ignore_and_fire </models/ignore_and_fire>` dynamics (``ignore_and_fire``). Figures | ||
| generated using :doc:`generate_reference_data-ignore_and_fire.py </auto_examples/ignore_and_fire/generate_reference_data-ignore_and_fire>` | ||
| and :doc:`generate_reference_figures-ignore_and_fire.py </auto_examples/ignore_and_fire/generate_reference_figures-ignore_and_fire>`. | ||
|
|
||
|
|
||
| Scaling experiments | ||
| ------------------- | ||
|
|
||
| The ``ignore_and_fire`` variant of the network model permits exact scaling experiments, without the need for any | ||
| parameter tuning when changing the network size (see figure below). We demonstrate this here by simulating the network | ||
| for various network sizes between :math:`N=1250` and :math:`N=13750`. | ||
| The number of incoming connections per neuron, the in-degree, is kept constant at :math:`K=1250`. | ||
| The total number of connections hence scales linearly with :math:`N`. For each simulation, we monitor the simulation | ||
| (wall clock) time, the time and population averaged firing rate, and the mean standard deviation of the excitatory | ||
| synaptic weights at the end of the simulation. | ||
|
|
||
| For the integrate-and-fire variant of the network model, the firing rate and the synaptic-weight distribution depend | ||
| on the network size :math:`N`. In particular for small :math:`N`, the firing rates and the synaptic weights increase | ||
| due to the denser connectivity. For the ignore-and-fire version, in contrast, the dynamics is independent of the | ||
| network size. The average firing rate is --by definition-- constant. As the firing phases of the ignore-and-fire | ||
| neurons are chosen randomly, the spiking activity is asynchronous, irrespective of the connection density. As a | ||
| consequence, the distribution of synaptic weights (which is shaped by cross-correlations in the spiking activity) remains constant, too. | ||
|
|
||
| With the ignore-and-fire version of the model, performance benchmarking studies can thus be performed under better | ||
| defined conditions. For example, the overall communication load, i.e., the total number of spikes that need to be sent | ||
| across the network within each time interval, is fully controlled by the user. | ||
|
|
||
|
|
||
| .. figure:: /static/img/scaling_ignore_and_fire.png | ||
| :scale: 50% | ||
|
|
||
| Dependence of the simulation time (top), the time and population averaged firing rate (middle) and the excitatory | ||
| synaptic weights (bottom) on the network size :math:`N` for the\ ``integrate-and-fire`` (black) and the | ||
| ``ignore-and-fire`` variant of the network model (gray). The in-degree :math:`K=1250` is fixed. Figure generated using | ||
| :doc:`scaling.py </auto_examples/ignore_and_fire/scaling>`. | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This link is not working. |
||
|
|
||
| Run the simulations | ||
| ------------------- | ||
|
|
||
| You can run the simulations by using the provided Snakefile: | ||
|
|
||
| * :doc:`Snakefile </auto_examples/ignore_and_fire/workflow>`: Run simulation workflow | ||
|
|
||
| .. seealso:: | ||
|
|
||
| * :doc:`Detailed description of the network model and parameters <twopop_stdp_network_model>` | ||
| * :doc:`NEST simulation details <simulation_details>` | ||
| * :doc:`model-ignore_and_fire.py </auto_examples/ignore_and_fire/model-ignore_and_fire>`: NEST implementation of the network model | ||
| * :doc:`parameter_dicts-ignore_and_fire.py <parameter_dict-ignore_and_fire>`: parameter setting | ||
| * :doc:`ignore_and_fire model documentation </models/ignore_and_fire>` | ||
|
|
||
|
|
||
| References | ||
| ---------- | ||
|
|
||
| .. [1] Van Albada S J, Helias M, Diesmann M (2015). Scalability of asynchronous | ||
| networks is limited by one-to-one mapping between effective connectivity | ||
| and correlations. PLoS computational biology, 11(9), e1004490. | ||
| <https://doi.org/10.1371/journal.pcbi.1004490> | ||
|
|
||
| .. [2] Brunel N (2000). Dynamics of networks of randomly connected excitatory | ||
| and inhibitory spiking neurons. Journal of Physiology-Paris | ||
| 94(5-6):445-463. <https://doi.org/10.1023/A:1008925309027> | ||
|
|
||
| .. [3] Helias M, Kunkel S, Masumoto G, Igarashi J, Eppler JM, Ishii S, Fukai | ||
| T, Morrison A, Diesmann M (2012). Supercomputers ready for use as | ||
| discovery machines for neuroscience. Frontiers in Neuroinformatics | ||
| 6:26. <https://doi.org/10.3389/fninf.2012.00026 | ||
|
|
||
| .. [4] Ippen T, Eppler JM, Plesser HE, Diesmann M (2017). Constructing | ||
| neuronal network models in massively parallel environments. Frontiers in | ||
| Neuroinformatics 11:30. <https://doi.org/10.3389/fninf.2017.00030 | ||
|
|
||
| .. [5] Jordan J, Ippen T, Helias M, Kitayama I, Sato M, Igarashi J, Diesmann | ||
| M, Kunkel S (2018). Extremely scalable spiking neuronal network | ||
| simulation code: from laptops to exascale computers. Frontiers in | ||
| Neuroinformatics 12:2. <https://doi.org/10.3389/fninf.2018.00002 | ||
|
|
||
| .. [6] Kunkel S, Potjans TC, Eppler JM, Plesser HE, Morrison A, Diesmann M | ||
| (2012). Meeting the memory challenges of brain-scale simulation. | ||
| Frontiers in Neuroinformatics 5:35. <https://doi.org/10.3389/fninf.2011.00035 | ||
|
|
||
| .. [7] Kunkel S, Schenck W (2017). The NEST dry-run mode: Efficient dynamic | ||
| analysis of neuronal network simulation code. Frontiers in | ||
| Neuroinformatics 11:40. <https://doi.org/10.3389/fninf.2017.00040 | ||
| .. [8] Morrison A, Aertsen A, Diesmann M (2007). Spike-timing-dependent | ||
| plasticity in balanced random networks. Neural Computation | ||
| 19(6):1437-1467. <https://doi.org/10.1162/neco.2007.19.6.1437 | ||
|
|
||
|
|
||
|
|
||
| .. toctree:: | ||
| :hidden: | ||
| :glob: | ||
|
|
||
| * | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,98 @@ | ||
|
|
||
| rule all: | ||
| """ | ||
| Runs simulations and creates all figures for the ignore-and-fire usecase documentation. | ||
| """ | ||
| input: | ||
| 'figures/TwoPopulationNetworkPlastic_iaf_psc_alpha_spikes.png', | ||
| 'figures/TwoPopulationNetworkPlastic_iaf_psc_alpha_weight_distributions.png', | ||
| 'figures/TwoPopulationNetworkPlastic_iaf_psc_alpha_connectivity_presim.png', | ||
| 'figures/TwoPopulationNetworkPlastic_iaf_psc_alpha_connectivity_postsim.png', | ||
| 'figures/TwoPopulationNetworkPlastic_ignore_and_fire_spikes.png', | ||
| 'figures/TwoPopulationNetworkPlastic_ignore_and_fire_weight_distributions.png', | ||
| 'figures/TwoPopulationNetworkPlastic_ignore_and_fire_connectivity_presim.png', | ||
| 'figures/TwoPopulationNetworkPlastic_ignore_and_fire_connectivity_postsim.png', | ||
| 'figures/scaling.png' | ||
|
|
||
| rule generate_reference_data_LIF: | ||
| """ | ||
| Simulates network with LIF neurons, and stores spikes and synaptic weights. | ||
| """ | ||
| input: | ||
| 'model-ignore_and_fire.py', | ||
| 'parameter_dicts-ignore_and_fire.py', | ||
| 'generate_reference_data-ignore_and_fire.py' | ||
| output: | ||
| temp('.LIF_simulation_done') | ||
| run: | ||
| shell('python3 generate_reference_data-ignore_and_fire.py iaf_psc_alpha; touch {output}') | ||
|
|
||
| rule generate_reference_data_IgAF: | ||
| """ | ||
| Simulates network with ignore-and-fire neurons, and stores spikes and synaptic weights. | ||
| """ | ||
| input: | ||
| 'model-ignore_and_fire.py', | ||
| 'parameter_dicts-ignore_and_fire.py', | ||
| 'generate_reference_data-ignore_and_fire.py' | ||
| output: | ||
| temp('.IgAF_simulation_done') | ||
| run: | ||
| shell('python3 generate_reference_data-ignore_and_fire.py ignore_and_fire; touch {output}') | ||
|
|
||
| rule generate_reference_figures_LIF: | ||
| """ | ||
| Creates figures showing spiking activity, weight matrices and weight distributions | ||
| before and after simulations from data obtained by simulating the model | ||
| with LIF neurons. | ||
| """ | ||
| input: | ||
| 'model-ignore_and_fire.py', | ||
| 'parameter_dicts-ignore_and_fire.py', | ||
| 'generate_reference_figures-ignore_and_fire.py', | ||
| '.LIF_simulation_done' | ||
| output: | ||
| 'figures/TwoPopulationNetworkPlastic_iaf_psc_alpha_spikes.png', | ||
| 'figures/TwoPopulationNetworkPlastic_iaf_psc_alpha_weight_distributions.png', | ||
| 'figures/TwoPopulationNetworkPlastic_iaf_psc_alpha_connectivity_presim.png', | ||
| 'figures/TwoPopulationNetworkPlastic_iaf_psc_alpha_connectivity_postsim.png', | ||
| run: | ||
| shell('python3 generate_reference_figures-ignore_and_fire.py iaf_psc_alpha') | ||
|
|
||
| rule generate_reference_figures_IgAF: | ||
| """ | ||
| Creates figures showing spiking activity, weight matrices and weight distributions | ||
| before and after simulations from data obtained by simulating the model | ||
| with ignore_and_fire neurons. | ||
| """ | ||
| input: | ||
| 'model-ignore_and_fire.py', | ||
| 'parameter_dicts-ignore_and_fire.py', | ||
| 'generate_reference_figures-ignore_and_fire.py', | ||
| '.IgAF_simulation_done' | ||
| output: | ||
| 'figures/TwoPopulationNetworkPlastic_ignore_and_fire_spikes.png', | ||
| 'figures/TwoPopulationNetworkPlastic_ignore_and_fire_weight_distributions.png', | ||
| 'figures/TwoPopulationNetworkPlastic_ignore_and_fire_connectivity_presim.png', | ||
| 'figures/TwoPopulationNetworkPlastic_ignore_and_fire_connectivity_postsim.png', | ||
| run: | ||
| shell('python3 generate_reference_figures-ignore_and_fire.py ignore_and_fire') | ||
|
|
||
| rule scaling_experiment: | ||
| """ | ||
| Performs scaling experiments with LIF and ignore-and-fire neurons, | ||
| and creates figure showing the simulation times, average firing rates, | ||
| and synaptic weights for a range of network sizes. | ||
| """ | ||
| input: | ||
| 'model-ignore_and_fire.py', | ||
| 'parameter_dicts-ignore_and_fire.py', | ||
| 'scaling-ignore_and_fire.py' | ||
| output: | ||
| 'figures/scaling.png' | ||
| run: | ||
| shell('python3 scaling-ignore_and_fire.py') | ||
| rule clean: | ||
| run: | ||
| shell("rm figures/*") | ||
| shell("rm -rf data/*") |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: "mean and standard deviation"