PopulationView
self, population, ranks, geometry=None) core.PopulationView.PopulationView(
Container representing a subset of neurons of a Population.
Attributes
Name | Description |
---|---|
attributes | Returns a list of attributes of the original population. |
geometry | Geometry of the PopulationView (optional). |
name | Returns the name of the original population. |
parameters | Returns a list of constants of the original population. |
population | Original (full) population. |
ranks | Array of ranks in the PopulationView. |
size | Size of the PopulationView. |
targets | List of targets connected to the population. |
variables | Returns a list of variables of the original population. |
Methods
Name | Description |
---|---|
coordinates_from_rank | Returns the coordinates of a neuron based on its rank. |
get | Returns current variable/parameter value. |
rank_from_coordinates | Returns the rank of a neuron based on coordinates. |
set | Updates the neurons’ variable/parameter values. |
sum | Returns the array of weighted sums corresponding to the target:: |
coordinates_from_rank
=False) core.PopulationView.PopulationView.coordinates_from_rank(rank, local
Returns the coordinates of a neuron based on its rank.
When local is False (default), the coordinates are relative to the ORIGINAL population, not the PopulationView.
When local is True, the coordinates are interpreted relative to the geometry of the PopulationView if available. When you add two population views, the geometry is lost and the method will return an error.
The rank is relative to the original population. Iterate over len(pop) otherwise.
Parameters
Name | Type | Description | Default |
---|---|---|---|
rank | rank of the neuron in the original population | required | |
local | whether the coordinates are local to the PopulationView or not (default: False). | False |
get
core.PopulationView.PopulationView.get(name)
Returns current variable/parameter value.
Parameters
Name | Type | Description | Default |
---|---|---|---|
name | name of the parameter/variable. | required |
rank_from_coordinates
=False) core.PopulationView.PopulationView.rank_from_coordinates(coord, local
Returns the rank of a neuron based on coordinates.
When local is False (default), the coordinates are relative to the ORIGINAL population, not the PopulationView.
When local is True, the coordinates are interpreted relative to the geometry of the PopulationView if available. When you add two population views, the geometry is lost and the method will return an error.
The rank is relative to the original population. Iterate over len(pop) otherwise.
Parameters
Name | Type | Description | Default |
---|---|---|---|
coord | coordinate tuple, can be multidimensional. | required | |
local | whther the coordinates are local to the PopulationView or not (default: False). | False |
set
set(value) core.PopulationView.PopulationView.
Updates the neurons’ variable/parameter values.
Parameters
Name | Type | Description | Default |
---|---|---|---|
value | dict | dictionary of parameters/variables to be updated for the corresponding subset of neurons. It can be a single value or a list/1D array of the same size as the PopulationView. .. code-block:: python >>> subpop = pop[0:5] >>> subpop.set( {‘tau’ : 20, ‘r’= np.random.rand(subpop.size) } ) .. warning:: If you modify the value of a global parameter, this will be the case for ALL neurons of the population, not only the subset. | required |
sum
sum(target) core.PopulationView.PopulationView.
Returns the array of weighted sums corresponding to the target::
excitatory = pop.sum('exc')
For spiking networks, this is equivalent to accessing the conductances directly::
excitatory = pop.g_exc
If no incoming projection has the given target, the method returns zeros.
Parameters
Name | Type | Description | Default |
---|---|---|---|
target | the desired projection target. Note: it is not possible to distinguish the original population when the same target is used. | required |