[SOLVED] Changing the rates of a device group


#1

Hello,
I wrote a transfer function that creates 5 Poisson generators and connects each of them to subsequent neurons from the bursters population. I wanted to activate them using a numpy array (as described in https://neurorobotics.net/Documentation/latest/nrp/modules/CLE/hbp_nrp_cle/tutorials/deviceGroups.html). My code looks more or less like that:

@nrp.MapSpikeSource("input_burst",
                    nrp.brain.bursters[slice(0,5,1)],
                    nrp.poisson,
                    weight=-1000,
                    receptor_type="inhibitory",
                    n=5,
                    connector='one_to_one')
@nrp.Robot2Neuron()
def input_neurons(t, input_burst):
    rates = numpy.array([500., 500., 0., 0., 500.])
    input_burst.rate = rates

I get an error while trying to run the simulation:

(‘TypeMismatch in SetStatus_id: Expected datatype: doubletype\nProvided datatype: doublevectortype’, ‘TypeMismatch’, <SLILiteral: SetStatus_id>, ‘: Expected datatype: doubletype\nProvided datatype: doublevectortype’) (Runtime)

How can I assign the rates?

I use NRP 3.2.0 docker installation on Ubuntu 20.04.

Best regards,
Mikołaj Miękus


#2

It looks like you’re not really using device groups. Slicing is not enough, you need to use NRP’s custom mechanisms

@nrp.MapSpikeSource("neurons", nrp.map_neurons(range(5), lambda i: nrp.brain.bursters[i]), nrp.poisson)

#3

Thank you, this seems to work.
Best regards,
Mikołaj