Dear Aadhar,

Enable and Disable functions for structural plasticity apply to the whole network. What I do to disable subnetworks is to set their growth rate to 0 and back to the original value when you want to activate them. This is possible because you can assign different growth rules to each subnetwork and/or to each synapse type which can grow between specific synaptic elements.
Below you can see an example for NEST 2.20.

All the best,
Sandra


**********
       # At network definition
        growth_curve = {'growth_curve': "gaussian",
            'growth_rate': 0.0000, # (elements/ms)
            'continuous': False,
            'eta': -0.005,# Ca2+
            'eps': 0.075, # Ca2+
        }
        synaptic_elements_e = {'Den_ex': growth_curve, 'Axon_ex': growth_curve}

        neurons = nest.Create('iaf_psc_alpha', 2,{'synaptic_elements': synaptic_elements_e})
        ps = nest.Create('poisson_generator_ps', params={'rate': 1000.})
       
        nest.Connect(ps, neurons)
        nest.Connect(neurons, neurons)
       
       
        nest.SetKernelStatus({'structural_plasticity_synapses':
           {'exsynapse':
           {'model': 'static_synapse',
            'post_synaptic_element': 'Den_ex',
            'pre_synaptic_element': 'Axon_ex',
           }}})

        # Make SP ON
        growth_curve_on = {
            'growth_rate': 0.005,
            'eta': -0.005,
            'eps': 0.03,
        }
        synaptic_elements_on = {'Den_ex': growth_curve_on, 'Axon_ex': growth_curve_on}
        nest.SetStatus(neurons, 'synaptic_elements_param', synaptic_elements_on)

        nest.Simulate(300)
        print("SP ON: {}\n".format(nest.GetStatus(neurons, 'synaptic_elements')))


        # Make SP OFF
        growth_curve_off = { 'growth_rate': 0.0, }
        synaptic_elements_off = {'Den_ex': growth_curve_off, 'Axon_ex': growth_curve_off}
        nest.SetStatus(neurons, 'synaptic_elements_param', synaptic_elements_off)

        nest.Simulate(300)
        print("SP OFF: {}\n".format(nest.GetStatus(neurons, 'synaptic_elements')))

**********

On 09.11.21 20:43, Aadhar Sharma wrote:

Hi all,

I want to bring my previous mail to notice. As I mentioned, I wish to enable/disable structural plasticity at neuron (sub-population) level rather than at the kernel level. I have tried a bunch of stuff (as mentioned in the previous email), but nothing seems to really work as desired.

I would really appreciate if anyone can suggest potential solutions.
Many thanks!

Best,
Aadhar


On Wed, 03 Nov 2021 01:20:46 +0100 "Aadhar Sharma" wrote:

Hi all,

I am trying to simulate networks where two (or more) sub-populations are structurally plastic (structural plasticity module). My simulation protocol requires that I enable/disable structural plasticity on a sub-population level rather than at kernel level (nest.EnableStructuralPlasticity() / nest.DisableStructuralPlasticity()).

[Q1] Is anyone aware of a way to do this at the sub-population level?

One workaround that I have tried is setting the growth_rate parameter of synaptic elements to 0 and restoring it to the original value at the desired simulation time

SP_OFF_dict = {'growth_rate': 0., 'eps': eps}
nest.SetStatus(neurons, {"synaptic_elements":{"Den_exc": SP_OFF_dict, "Axon_exc":SP_OFF_dict}}
)

However, this crashes the Kernel with the following error:

terminate called after throwing an instance of 'nest::KernelException' what(): Last update of the calcium concentration does not match the last update of the synaptic element.

I don't fully know why the Kernel does not like this SetStatus() call.

[Q2] Is there something that I may be doing wrong? Can anyone please recommend a solution?

I am currently using NESTv2.20 for all my simulations on HPC. But, I am happy to move to NESTv3.1 too.
Many thanks for the support!

Best, Aadhar



_______________________________________________
NEST Users mailing list -- users@nest-simulator.org
To unsubscribe send an email to users-leave@nest-simulator.org