Hi Hans,
Thanks for your explanation. I am going to open a Github issue.
My particular use case is using SelectNodesByMask() as a workaround to reduce the impact of the slow speed of DumpLayerConnections() with whole layers. I have 4 layers around 100x100 nodes every layer. They are connected between them (every node is conencted to around 25x25 nodes). Saving all connections to file it takes around 4-5 hours (using 64 mpi processes). To reduce execution time I tried to select just the nodes around the center of every layer. In fact, we already talked about that in some messages last week and I already opened a Github issue about this slow speed of DumpLayerConnections().
Increasing the speed of DumpLayerConnections() (and GetConnections() -if possible-) would solve my problem and I would not need to use SelectNodesByMask().
Thanks a lot in advance!
Xavier ________________________________ From: Hans Ekkehard Plesser hans.ekkehard.plesser@nmbu.no Sent: Thursday, March 14, 2024 9:16 AM To: NEST User Mailing List users@nest-simulator.org Subject: [NEST Users] Re: SelectNodesByMask() and DumpLayerConnections() combination problem
Hi Xavier,
This is a weakness in the implementation of SelectNodesByMask. It returns a plain NodeCollection without any spatial metadata, so the returned NodeCollection does not represent a layer. Could you create a Github issue about this?
Finding a good solution for this is not entirely trivial. One solution would be to create a NodeCollection that contains copies of the positions of all the nodes that are selected. This is technically straightforward but for large selections, it could lead to noticeable memory overhead, at least if those collections are long-lived. Representing the selection as a collection of sliced connections can become complicated for layers with free node placement where likely each node would be a slice of its own.
We should discuss potential use cases to find out what would be the best solution.
Best,
Hans Ekkehard
--
Prof. Dr. Hans Ekkehard Plesser
Department of Data Science
Faculty of Science and Technology
Norwegian University of Life Sciences
PO Box 5003, 1432 Aas, Norway
Phone +47 6723 1560
Email hans.ekkehard.plesser@nmbu.nomailto:hans.ekkehard.plesser@nmbu.no
Home http://arken.nmbu.no/~plesser
From: Xavier Otazu xotazu@cvc.uab.cat Date: Wednesday, 13 March 2024 at 17:20 To: users@nest-simulator.org users@nest-simulator.org Subject: [NEST Users] SelectNodesByMask() and DumpLayerConnections() combination problem
[Some people who received this message don't often get email from xotazu@cvc.uab.cat. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
Hello,
Looking at the documentation, I understand that the output of SelectNodesByMask() is a NodeCollection, and the 'layer' input parameters of DumpLayerConnections() is also a NodeCollection. Hence, I understand that I can combine these two parameters, but when I do it (see code below) I receive the error: nest.lib.hl_api_exceptions.LayerExpected: LayerExpected in SLI function DumpLayerConnections_os_g_g_l
Am I missing something?
Thanks a lot in advance!
Xavier --------
import nest
# Layers creation
pos = nest.spatial.grid(shape = [100,100] )
input_l = nest.Create('iaf_psc_alpha', positions=pos) layer_0 = nest.Create('iaf_psc_alpha', positions=pos)
conn_neur = {'rule':'pairwise_bernoulli', 'mask': {'grid':{'shape':[10,10]}} } syn_0 = {'synapse_model': 'static_synapse'}
nest.Connect(input_l, layer_0, conn_neur, syn_0)
# GetNodesByMask
mask_specs = {'lower_left':[-0.25,-0.25], 'upper_right':[0.25,0.25]} mask_obj = nest.CreateMask(masktype='rectangular', specs=mask_specs, anchor=[0.0,0.0]) center_neur = nest.SelectNodesByMask(layer_0,[0.0,0.0],mask_obj) nest.DumpLayerConnections(input_l,center_neur, 'static_synapse', 'conn.txt') _______________________________________________ NEST Users mailing list -- users@nest-simulator.org To unsubscribe send an email to users-leave@nest-simulator.org
Computer Vision Centerhttp://www.cvc.uab.cat CONFIDENTIALITY WARNINGhttp://www.cvc.uab.es/?page_id=7475