Parameter
self, value, locality='local', type='float') Parameter(
Dataclass to represent a parameter in a Neuron or Synapse definition.
= ann.Neuron(
neuron = dict(
parameters
# Global parameter
= 10.0 # or ann.Parameter(value=10.0, locality='global')
tau
# Local parameter
= ann.Parameter(value=ann.Uniform(-1., 1.)),
baseline
# Boolean global parameter
= ann.Parameter(value=True, locality='global', type=bool),
activated
) )
In a neuron or synapse model, parameters are global and use the float type if the Parameter
class is not used.
If you need a local parameter (one value per neuron or synapse), the Parameter
class allows to specify it. Note that you can also define global parameters by passing locality='global'
.
Semi-global synaptic parameters (one value per post-synaptic neuron) can be defined using locality='semiglobalglobal'
.
If the parameter is an int or a bool, pass it to the type
attribute.
Parameters
Name | Type | Description | Default |
---|---|---|---|
value | float | int | bool | RandomDistribution | Initial value of the parameter. It can be defined as a RandomDistribution, which will be sampled with the correct shape when the population/projection is created, or a float/int/bool, depending on type . |
required |
locality | str | Locality of the parameter. Must be in [‘global’, ‘semiglobal’, ‘local’]. | 'local' |
type | str | Data type of the parameter. Must be in [float, int, bool] (or [‘float’, ‘int’, ‘bool’]). | 'float' |