nngt.
GroupProperty
(size, constraints={}, neuron_model=None, neuron_param={}, syn_model=None, syn_param={})[source]#Class defining the properties needed to create groups of neurons from an
existing GraphClass
or one of its subclasses.
Variables: |
|
---|
Create a new instance of GroupProperties.
Notes
int
) to constrain the
total degree of the nodesdouble
) to constrain the betweenness
centralitynngt.geometry.Shape
) to chose neurons inside
a given spatial regionExamples
>>> di_constrain = { "avg_deg": 10, "min_betw": 0.001 }
>>> group_prop = GroupProperties(200, constraints=di_constrain)
nngt.
NeuralGroup
(nodes=None, ntype=1, neuron_model=None, neuron_param=None, name=None)[source]#Class defining groups of neurons.
Variables: |
|
---|
Note
By default, synapses are registered as "static_synapse"
in NEST;
because of this, only the neuron_model
attribute is checked by the
has_model
function.
Warning
Equality between NeuralGroup`s only compares
the size and neuronal ``model`
and param
attributes. This means
that groups differing only by their ids
will register as equal.
Create a group of neurons (empty group is default, but it is not a valid object for most use cases).
Changed in version 0.8: Removed syn_model and syn_param.
Parameters: |
|
---|---|
Returns: | A new |
has_model
#ids
#is_valid
()[source]#Whether the group can be used in a population: i.e. if it has either a size or some ids associated to it.
New in version 1.0.
name
#nest_gids
#neuron_model
#neuron_param
#properties
#size
#nngt.
NeuralPop
(size=None, parent=None, with_models=True, *args, **kwargs)[source]#The basic class that contains groups of neurons and their properties.
Variables: |
|
---|
Initialize NeuralPop instance
Parameters: |
|
---|---|
Returns: | pop ( |
add_to_group
(group_name, ids)[source]#Add neurons to a specific group.
Parameters: |
|
---|
create_group
(name, neurons, ntype=1, neuron_model=None, neuron_param=None)[source]#Create a new groupe from given properties.
Changed in version 0.8: Removed syn_model and syn_param.
Changed in version 1.0: neurons can be an int to signify a desired size for the group without actually setting the indices.
Parameters: |
|
---|
exc_and_inhib
(size, iratio=0.2, en_model='aeif_cond_alpha', en_param=None, in_model='aeif_cond_alpha', in_param=None, syn_spec=None, parent=None)[source]#Make a NeuralPop with a given ratio of inhibitory and excitatory neurons.
Changed in version 0.8: Added syn_spec parameter.
Parameters: |
|
---|
See also
nest.Connect()
, as()
from_groups
(groups, names=None, syn_spec=None, parent=None, with_models=True)[source]#Make a NeuralPop object from a (list of) NeuralGroup
object(s).
Changed in version 0.8: Added syn_spec parameter.
Parameters: |
|
---|
Example
For synaptic properties, if provided in syn_spec, all connections between groups will be set according to the values. Keys can be either group names or types (1 for excitatory, -1 for inhibitory). Because of this, several combination can be available for the connections between two groups. Because of this, priority is given to source (presynaptic properties), i.e. NNGT will look for the entry matching the first group name as source before looking for entries matching the second group name as target.
# we created groups `g1`, `g2`, and `g3`
prop = {
('g1', 'g2'): {'model': 'tsodyks2_synapse', 'tau_fac': 50.},
('g1', g3'): {'weight': 100.},
...
}
pop = NeuronalPop.from_groups(
[g1, g2, g3], names=['g1', 'g2', 'g3'], syn_spec=prop)
Note
If the population is not generated from an existing
Graph
and the groups do not contain explicit ids, then
the ids will be generated upon population creation: the first group, of
size N0, will be associated the indices 0 to N0 - 1, the second group
(size N1), will get N0 to N0 + N1 - 1, etc.
from_network
(graph, *args)[source]#Make a NeuralPop object from a network. The groups of neurons are
determined using instructions from an arbitrary number of
GroupProperties
.
get_group
(neurons, numbers=False)[source]#Return the group of the neurons.
Parameters: |
|
---|
get_param
(groups=None, neurons=None, element='neuron')[source]#Return the element (neuron or synapse) parameters for neurons or groups of neurons in the population.
Parameters: |
|
---|---|
Returns: | param ( |
has_models
#is_valid
#Whether the population can be used to create a NEST network.
set_model
(model, group=None)[source]#Set the groups’ models.
Parameters: |
|
---|
Note
By default, synapses are registered as “static_synapse”s in NEST;
because of this, only the neuron_model
attribute is checked by
the has_models
function: it will answer True
if all groups
have a ‘non-None’ neuron_model
attribute.
Warning
No check is performed on the validity of the models, which means that errors will only be detected when building the graph in NEST.
set_neuron_param
(params, neurons=None, group=None)[source]#Set the parameters of specific neurons or of a whole group.
New in version 1.0.
Parameters: |
|
---|
Note
If both neurons and group are None, all neurons will be modified.
Warning
No check is performed on the validity of the parameters, which means that errors will only be detected when building the graph in NEST.
size
#Number of neurons in this population.
syn_spec
#The properties of the synaptic connections between groups.
Returns a dict
containing tuples as keys and dicts of parameters
as values.
The keys are tuples containing the names of the groups in the population, with the projecting group first (presynaptic neurons) and the receiving group last (post-synaptic neurons).
Example
For a population of excitatory (“exc”) and inhibitory (“inh”) neurons.
syn_spec = {
("exc", "exc"): {'model': 'stdp_synapse', 'weight': 2.5},
("exc", "inh"): {'model': 'static_synapse'},
("exc", "inh"): {'model': 'stdp_synapse', 'delay': 5.},
("inh", "inh"): {
'model': 'stdp_synapse', 'weight': 5.,
'delay': ('normal', 5., 2.)}
}
}
New in version 0.8.