Set a default value for @MapSpikeSource


#1

Hello,

is it possible to set a default value for all elements of a @MapSpikeSource variable array? For example, how would I do, if I wanted the variable array below to be set, if created, to only zeros?

@MapSpikeSource(“BoundarySegmentationSignalOn”, nrp.map_neurons(range((nrp.config.brain_root.numSegmentationLayers-1) * nrp.config.brain_root.ImageNumPixelRows * nrp.config.brain_root.ImageNumPixelColumns), lambda i: nrp.brain.BoundarySegmentationOn[i]), nrp.dc_source)

The problem is that the default initial value for nrp.dc_source.amplitude is 1.0, and I would want it to 0.0 !

Many thanks,
Alban


#2

Hi Alban,

Since I was responding to your other issue, I’m not sure if this is possible, but you may be able to set it in the TF body initially with a simple:

 if t == 0:
  <set the values to 0>

but I’ll pass this along to someone else who would probably know better.

Kenny


#3

Hi Alban,

yes, it is possible, though I am afraid it is currently not documented at all. Decorators such as MapSpikeSource accept additional parameters, though it is close to impossible for you (I guess) to find out which parameters there are.

The following code should do the trick. Note that you just add the parameter “amplitude = 0.0” at the end of the device. Since you are effectively creating a device group, you should be able to assign either a constant value (like 0) or an array to that property. In the latter case, the CLE picks the value for each device.

@MapSpikeSource("BoundarySegmentationSignalOn",
 nrp.map_neurons(range((nrp.config.brain_root.numSegmentationLayers-1) *
 nrp.config.brain_root.ImageNumPixelRows * 
nrp.config.brain_root.ImageNumPixelColumns), lambda i: 
nrp.brain.BoundarySegmentationOn[i]), nrp.dc_source, amplitude = 0.0)

Since there is no complete reference as far as I am aware (and I probably should), these are the possible configurations and their default values for each device type:

ACSource

"amplitude": 1.0,
"offset": 0.0,
"frequency": 10.0,
"phase": 0.0,
"start": 0.0,
"stop": float("inf")

DCSource

"amplitude": 1.0,
"start": 0.0,
"stop": float("inf")

FixedSpikeGenerator

'initial_rate': 0.0,
'cm': 1.0,
'tau_m': 1000.0,
'tau_refrac': sim.state.dt,
'v_thresh': -50.0,
'v_reset': -100.0,
'v_rest': -100.0,
'connector': None,
'weight': None,
'delay': None,
'source': None,
'receptor_type': 'excitatory',
'synapse_type': None,
'label': None

LeakyIntegratorAlpha

'v_thresh': float('inf'),
'cm': 1.0,
'tau_m': 10.0,
'tau_syn_E': 2.,
'tau_syn_I': 2.,
'v_rest': 0.0,
'v_reset': 0.0,
'tau_refrac': 0.1,
'i_offset': 0.0,
'connector': None,
'weight': None,
'delay': 0.1,
'source': None,
'receptor_type': 'excitatory',
'synapse_type': None,
'label': None,
'rng': None

LeakyIntegratorExp

'v_thresh': float('inf'),
'cm': 1.0,
'tau_m': 20.0,
'tau_syn_E': .5,
'tau_syn_I': .5,
'v_rest': 0.0,
'v_reset': 0.0,
'tau_refrac': 0.1,
'i_offset': 0.0,
'connector': None,
'weight': None,
'delay': RandomDistribution('uniform', [0.1, 2.0]),
'source': None,
'receptor_type': 'excitatory',
'synapse_type': None,
'label': None,
'rng': None

NCSource

'mean': 0.0,
'stdev': 1.0,
"dt": sim.state.dt,
"start": 0.0,
"stop": float("inf")

PoissonGenerator

"duration": float("inf"),
"start": 0.0,
"rate": 0.0,
"connector": None,
"weight": 0.00015,
"delay": 0.1,
"source": None,
"receptor_type": "excitatory",
"synapse_type": None,
"label": None,
"rng": None

PopulationRate

'tau_fall': 20.0,
'tau_rise': 10.0    

SpikeRecorder

The spike recorder is not configurable.


#4

Thank you!

Since you are effectively creating a device group, you should be able to assign either a constant value (like 0) or an array to that property.

I tried to add the initial value in the parameters and it works for both a list and a single value.

Since there is no complete reference as far as I am aware (and I probably should), these are the possible configurations and their default values for each device type

Cool! I think this list of parameters could be really helpful in the documentation.

Thanks again,
Alban