nest / nest-simulator

The NEST simulator
http://www.nest-simulator.org
GNU General Public License v2.0
534 stars 361 forks source link

Calling nest.Disconnect #786

Closed DaWelter closed 6 years ago

DaWelter commented 7 years ago

To my understanding it should be possible to call the Disconnect function as follows

import nest
nodes = nest.Create("iaf_psc_alpha", 5)
nest.Connect(nodes,
             nodes,
             { 'rule': 'all_to_all' })
#nest.Disconnect(nodes, nodes) # TypeError: Disconnect() takes exactly 4 arguments (2 given)
#nest.Disconnect(nodes, nodes, "all_to_all") # TypeError: Disconnect() takes exactly 4 arguments (3 given)
#nest.Disconnect(nodes, nodes, "all_to_all", {})  # pynestkernel.NESTError: TypeMismatch in Disconnect_g_g_D_D: The expected datatype is unknown in the current context.
nest.Disconnect(nodes, nodes, {'rule':  "all_to_all"}, {}) # pynestkernel.NESTError: BadProperty in Disconnect_g_g_D_D: Synapse spec must contain synapse model.

However each of these attempts gives the error appended in the comment.

In particular the last attempt appears odd to me because regarding the synapse spec, the documentation states "All parameters are optional and if not specified will use the default values determined by the current synapse model." (http://www.nest-simulator.org/pynest-api/)

Master branch - commit bbcdd91eb9eb0df6c74bb8074fb01864e73cba78

Silmathoron commented 7 years ago

This is indeed a bug and a test for the Disconnect function should be added to pynest/nest/tests/test_sp/test_disconnect.py once it's solved. In the meantime, you can have a look at the DisconnectOneToOne function, though this is only a temporary and not very satisfactory patch... I'm afraid not many people use Disconnect, which is why it stayed undetected. Could you tell us your use case?

DaWelter commented 7 years ago

Thanks for your help. I want to experiment with SNN control and machine learning. I connected a multimeter to output neurons in order to measure their membrane potential over a brief simulation period. I found no way to "clear" the data in the multimeter for the next period. So I figured I might just disconnect the old meter and create a new one. (I don't really know what I am doing ...) Now I guess a better alternative is to use a IAF neuron with a very high threshold as an integrator.

abigailm commented 7 years ago

I don't know if this helps your particular case, but you wouldn't need to disconnect and create a new one. You can create multiple recorders at the outset, and use differing values for 'start' and 'stop' to record different segments of the simulation.

On 07/08/2017 10:32, DaWelter wrote:

Thanks for your help. I want to experiment with SNN control and machine learning. I connected a multimeter to output neurons in order to measure their membrane potential over a brief simulation period. I found no way to "clear" the data in the multimeter for the next period. So I figured I might just disconnect the old meter and create a new one. (I don't really know what I am doing ...) Now I guess a better alternative is to use a IAF neuron with a very high threshold as an integrator.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/nest/nest-simulator/issues/786#issuecomment-320603133, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AKBtpW8GedXS0cKW7EE2PseJfdhj1QNPks5sVsuxgaJpZM4OaNAg.

-- Prof. Dr. Abigail Morrison

IAS-6 / INM-6 / SimLab Neuroscience Jülich Research Center

&

Institute of Cognitive Neuroscience Ruhr-University Bochum

http://www.fz-juelich.de/inm/inm-6 http://www.fz-juelich.de/ias/jsc/slns http://www.ikn.psy.ruhr-uni-bochum.de

Office: +49 2461 61-9805 Fax # : +49 2461 61-9460



Forschungszentrum Juelich GmbH 52425 Juelich Sitz der Gesellschaft: Juelich Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498 Vorsitzender des Aufsichtsrats: MinDir Dr. Karl Eugen Huthmacher Geschaeftsfuehrung: Prof. Dr.-Ing. Wolfgang Marquardt (Vorsitzender), Karsten Beneke (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt, Prof. Dr. Sebastian M. Schmidt


DaWelter commented 7 years ago

Hi, I'll keep your suggestion in mind. I suppose it will work. But first I will try the idea with the integrator neuron. ;-) Properly configured it could act as a low pass filter I believe. Anyway, I think I'm good. Thanks again. Best regards.

terhorstd commented 6 years ago

issue resolved.