ANNarchy 5.0.0
  • ANNarchy
  • Installation
  • Tutorial
  • Manual
  • Notebooks
  • Reference

  • ANNarchy
  • Core components
    • Network
    • Population
    • Projection
    • Monitor
    • PopulationView
    • Dendrite
  • Neuron and Synapse models
    • Neuron
    • Synapse
    • Parameter
    • Variable
    • Creating
    • Pruning
    • Constant
  • Neuron models
    • LeakyIntegrator
    • Izhikevich
    • IF_curr_exp
    • IF_cond_exp
    • IF_curr_alpha
    • IF_cond_alpha
    • HH_cond_exp
    • EIF_cond_alpha_isfa_ista
    • EIF_cond_exp_isfa_ista
  • Synapse models
    • Hebb
    • Oja
    • IBCM
    • STP
    • STDP
  • Inputs
    • InputArray
    • TimedArray
    • PoissonPopulation
    • TimedPoissonPopulation
    • SpikeSourceArray
    • HomogeneousCorrelatedSpikeTrains
    • CurrentInjection
    • DecodingProjection
    • ImagePopulation
    • VideoPopulation
  • Random Distributions
    • Uniform
    • DiscreteUniform
    • Normal
    • LogNormal
    • Exponential
    • Gamma
    • Binomial
  • Functions
    • add_function
    • functions
  • Callbacks
    • every
  • Utilities
    • report
    • timeit
    • sparse_random_matrix
    • sparse_delays_from_weights
    • magic_network
  • Convolution
    • Convolution
    • Pooling
    • Transpose
    • Copy
  • BOLD monitoring
    • BoldMonitor
    • BoldModel
    • balloon_RN
    • balloon_RL
    • balloon_CN
    • balloon_CL
    • balloon_maith2021
    • balloon_two_inputs
  • Tensorboard logging
    • Logger
  • ANN-to-SNN conversion
    • ANNtoSNNConverter
  • DEPRECATED Top-level API
    • setup
    • compile
    • clear
    • reset
    • set_seed
    • get_population
    • get_projection
    • populations
    • projections
    • monitors
    • simulate
    • simulate_until
    • step
    • enable_learning
    • disable_learning
    • get_time
    • set_time
    • get_current_step
    • set_current_step
    • dt
    • save
    • load
    • save_parameters
    • load_parameters
    • callbacks_enabled
    • disable_callbacks
    • enable_callbacks
    • clear_all_callbacks

On this page

  • PopulationView
    • Parameters
    • Attributes
    • Methods
      • rank_from_coordinates
      • coordinates_from_rank
      • get
      • set
      • sum

PopulationView

PopulationView(self, population, ranks, geometry=None)

Subset of a Population.

A list of ranks can be passed, but population views are usually created through slicing:

pop = net.create(1000, neuron)

E = pop[:800] # ann.PopulationView(pop, range(800))
I = pop[800:] # ann.PopulationView(pop, range(800, 1000))

Parameters

Name Type Description Default
population population object required
ranks list or numpy array containing the ranks of the selected neurons. required
geometry a geometry for the Populationview (optional) None

Attributes

Name Description
population Original population.
ranks Array of ranks in the PopulationView.
geometry Geometry of the PopulationView (optional).
size Size of the PopulationView (number of neurons).
targets List of targets connected to the population.
name Name of the original population.
attributes Äist of attributes of the original population.
variables List of variables of the original population.
parameters List of constants of the original population.

Methods

Name Description
rank_from_coordinates Returns the rank of a neuron based on coordinates.
coordinates_from_rank Returns the coordinates of a neuron based on its rank.
get Returns the parameter/variable value.
set Updates the neurons’ parameter/variable values.
sum Returns the array of weighted sums corresponding to the target:

rank_from_coordinates

rank_from_coordinates(coord, local=False)

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 tuple coordinate tuple, can be multidimensional. required
local bool whether the coordinates are local to the PopulationView or not. False

coordinates_from_rank

coordinates_from_rank(rank, local=False)

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 int rank of the neuron in the original population. required
local bool whether the coordinates are local to the PopulationView or not. False

get

get(name)

Returns the parameter/variable value.

Parameters

Name Type Description Default
name name of the parameter/variable. required

set

set(value)

Updates the neurons’ parameter/variable values.

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.

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. required

sum

sum(target)

Returns the array of weighted sums corresponding to the target:

excitatory = pop[:50].sum('exc')

For spiking networks, this is equivalent to accessing the conductances directly::

excitatory = pop[:50].g_exc

If no incoming projection has the given target, the method returns zeros.

Parameters

Name Type Description Default
target str the target. required
Monitor
Dendrite
 

Copyright Julien Vitay, Helge Ülo Dinkelbach, Fred Hamker