Skip to content
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

Fix third-factor plasticity buffering and add third factor plasticity tutorial #1027

Merged
merged 98 commits into from
Sep 26, 2024

Conversation

clinssen
Copy link
Contributor

@clinssen clinssen commented Apr 19, 2024

Extend and fix issue with third factor plasticity test: it should also be using a buffer for postsynaptic values, alike to the Clopath neuron's buffer for postsynaptic V_m (and derived) values

C.A.P. Linssen added 30 commits May 10, 2023 16:01
@clinssen clinssen requested a review from pnbabu June 19, 2024 09:07
@clinssen clinssen marked this pull request as ready for review June 19, 2024 09:07
Copy link
Contributor

@pnbabu pnbabu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comments on the jupyter notebook:

  • The NESTML neuron model name is iaf_psc_exp_active_dendrite_neuron, but the kernel used is an alpha kernel. Should the neuron model be renamed?
  • Why is I_syn = 0 pA on the last line of the model? Should the value of I_syn be reset when a spike is emitted?
  • The run_synapse_test function says the simulation is run for two neurons of type neuron_model_name, but the pre-neuron is a parrot neuron and the post-neuron is neuron_model_name. In principle, the pre-neuron can also be of type neuron_model_name, right?
  • Isn't running the simulation for each timestep costly? Can we use the step_current_generator for setting the I_dAP currents instead?
  • The y-axis for the weight plot in Case 2 is cluttered. Could you fix that?


In the neuron, no special output port is required; all state variables are accessible for the third factor rules.

NESTML needs to be invoked so that it generates code for neuron and synapse together. Additionally, specify the ``"post_ports"`` entry to connect the input port on the synapse with the right variable of the neuron (see :ref:`Generating code`).
NESTML needs to be invoked so that it generates code for neuron and synapse together. Additionally, specify the ``"post_ports"`` entry to connect the input port on the synapse with the right variable of the neuron (see :ref:`Generating code`). Passing this as a code generator option facilitates combining models from different sources, where the naming conventions can be different between the neuron and synapse model.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:ref:Generating code points to the Generating code section in the Spinnaker target page. Please fix that.

doc/running/running_nest.rst Show resolved Hide resolved
pynestml/utils/ast_utils.py Show resolved Hide resolved
pynestml/transformers/synapse_post_neuron_transformer.py Outdated Show resolved Hide resolved
@clinssen
Copy link
Contributor Author

clinssen commented Aug 1, 2024

Thanks for the detailed review! The new commits should address all of your comments.

Why is I_syn = 0 pA on the last line of the model? Should the value of I_syn be reset when a spike is emitted?

Indeed, I added this because I thought it would make it simpler to make a neuron spike by generating a spike event with a very large weight.

Isn't running the simulation for each timestep costly? Can we use the step_current_generator for setting the I_dAP currents instead?

I don´t think it can set the value of the state variable directly. This is just for demonstration purposes on a 2-neuron network, so performance is not so important.

Copy link
Contributor

@pnbabu pnbabu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you generate readthedocs and post the link?

@clinssen
Copy link
Contributor Author

clinssen commented Sep 4, 2024

Could you generate readthedocs and post the link?

Please see: https://nestml--1027.org.readthedocs.build/en/1027/


The implementation corresponds to the event-based update scheme in Fig. 4b of [Stapmanns2021]_. There, the authors observe that the storage and management of such a buffer can be expensive in terms of memory and runtime. In each time step, the value of the current dendritic current (or membrane potential, or other third factor) is appended to the buffer. The maximum length of the buffer depends on the maximum inter-spike interval of any of the presynaptic neurons.

To generate code for synapses with a (postsynaptic) plasticity factor, NESTML needs to be invoked so that it generates code for neuron and synapse together (as described in :ref:`Generating code for plastic synapses`). Additionally, specify the ``"post_ports"`` entry to connect the input port on the synapse with the right variable of the neuron (see :ref:`Generating code`). Passing this as a code generator option facilitates combining models from different sources, where the naming conventions can be different between the neuron and synapse model.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The link to Generating code here points to SpiNNaker. Could you fix that?

@pnbabu
Copy link
Contributor

pnbabu commented Sep 17, 2024

Could you also resolve the merge conflicts?

Copy link
Contributor

@pnbabu pnbabu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for adding this feature!

@clinssen clinssen merged commit 8766ee2 into nest:master Sep 26, 2024
9 checks passed
@clinssen
Copy link
Contributor Author

Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants