Connectome models

This package provides connectome models.

class connectome.model.bases.NetworkModelMixin

Mixin class for network models.

Every network models derives from this class.

Parameters
  • p_inh – float in [0, 1] The inhibitory connectivity.

  • p_exc – float in [0, 1] The excitatory connectivity.

  • nr_neurons – integer >= 1 The total number of neurons.

  • inh_ratio – float im [0, 1] The fraction of inhibitory neurons.

The output of this object is a Network

property nr_exc

Number of excitatory neurons.

property nr_inh

Number of inhibitory neurons.

class connectome.model.network.Network(adjacency_matrix=None, nr_exc=None, nr_inh=None, blocks=None)

A thin wrapper around a numpy.ndarray.

Supports excitatory and inhibitory neurons and performs additional sanity checks.

Note: Diagonal entries are allowed.

Network objects support views of the form network[start, end] where start, end are “E” or “I”.

If called with nr_exc and nr_inh a zeros filled adjacency matrix is created.

Parameters
  • adjacency_matrix (array) – The adjacency matrix.

  • nr_exc (optional int) – Number excitatory neurons.

  • nr_inh (optional int) – Number excitatory neurons.

  • blocks (optional BlockStructure) – The block structure of the network.

property adjacency_matrix

A view on the underlying adjacency matrix.

binarize()

Set any nonzero excitatory weight to 1 and any nonzero inhibitory weight to -1.

copy()
Returns

A copy of the network.

Return type

Network

get_block(*, target_ix, source_ix)

Return a view on a block.

Parameters
  • target_ix (int) – Target block number.

  • source_ix (int) – Source block number.

Returns

view_on_subarray – The view on the subarray.

Return type

ndarray

normalize(in_out='in', exc=1, inh=1)

Normalize incoming or outgoing weights.

Parameters
  • n_out (str, "in" or "out") – Whether to normalize the incoming or outgoing weights.

  • exc (float) – The weight to which to normalize excitatory neurons.

  • inh (float) – The weight to which to normalize inhibitory neurons.

property nr_exc

Number of excitatory neurons.

property nr_inh

Number of inhibitory neurons.

property nr_neurons

Total number of neurons in the network.

random_relabel_neurons()

Randomly relabel all neurons.

remove_neurons(neuron_numbers)

Remove neurons from the network.

Parameters

neuron_numbers (list) – A list of the neuron indices which to remove.

class connectome.model.block.BlockStructure(initlist=None)
property nr_exc

Number of excitatory blocks.

property nr_inh

Number of inhibitory blocks.

start_end(index)
Parameters

index (int) – The number of the block.

Returns

start, end – Start and end neuron index of the block.

Return type

int, int

class connectome.model.er.ER(**kwargs)

Inputs: p_inh, p_exc, nr_neurons, inh_ratio

Directed Erdős–Rényi network with excitatory and inhibitory subpopulations.

class connectome.model.exp.EXP(**kwargs)

Inputs: decay, p_inh, p_exc, nr_neurons, inh_ratio

Network with exponentially decaying connectivity (liquid state machine).

Parameters

decay – Float in [0, 1]. If set to 1, the decay is strongest. If set to 0 there is no decay at all.

static p_0(decay, target_connectivity)

Connectivty \(p_0\) for zero distance as function of the decay strengh and the target connectivity. The connectivity interpolates \(p_0\) linearly between the target connectivity and 1, according to decay_strength.

Parameters
  • decay (float in [0,1]) – How fast the connection probability should decay with distance. A value of 1 indicates fastest decay, 0 indicates no decay et all.

  • target_connectivity (float in [0, 1]) – Desired overall target connectivity.

Returns

p_0 – Connectivity for zero distance.

Return type

float in [0, 1]

class connectome.model.ll.LL(**kwargs)

Inputs: nr_exc_subpopulations, reciprocity_exc, p_inh, p_exc, nr_neurons, inh_ratio

Layered recurrent network.

It has the additional parameters

Parameters
  • nr_exc_subpopulations – int Number of layers. Only the excitatory neurons are layered.

  • reciprocity_exc – float in [0, 1] Excitatory reciprocity of the network. Note that the connectivity and the number of layers constrain the reciprocity.

class connectome.model.syn.SYN(**kwargs)

Inputs: pool_size, p_inh, p_exc, nr_neurons, inh_ratio

Recurrently embedded synfire chain.

It has the additional parameters

Parameters

pool_size – int Size of the excitatory pools.

class connectome.model.api.API(**kwargs)

Inputs: n_pow, feature_space_dimension, p_inh, p_exc, nr_neurons, inh_ratio

The antiphase inhibition network.

It has the additional parameters

Parameters
  • n_pow – float Determines how correlations are converted to connection probabilities.

  • feature_space_dimension – int Dimension of the underlying feature space.

signed_to_positive_correlations(signed_correlations)

Modify according to (correlation + 1) / 2.

class connectome.model.sorn.SORN(**kwargs)

Inputs: eta_stdp, eta_intrinsic, nr_patterns, p_inh, p_exc, nr_neurons, inh_ratio

Self-organizing recurrent neural network.

It has the additional parameters

Parameters
  • eta_stdp – float Learning rate for STDP.

  • eta_intrinsic – float Learning rate for intrinsic plasticity.

  • nr_patterns – int For nr_patterns == -1, the number of patterns is infinite.

Notes

This implementation is efficiently realized in Cython and parallelized with OpenMP.

class connectome.model.fever.ERFEVER(**kwargs)

Inputs: feverization_ratio, feature_space_dimension, p_inh, p_exc, nr_neurons, inh_ratio

FEVER network.

Apart of the standard parameters of each network model it has the following additional parameters:

Parameters
  • feature_space_dimension – int Dimension of the underlying feature space.

  • feverization_ratio – float in the inverval [0,1] Determines to which degree the network interpolates between ER and FEVER. A value of feverization_ratio=0 produces an ER graph. A value of 1, however, does not produce the original FEVER model. Instead, it produces a maximally feverized network, as determined by the connectivity and feature space dimension.

FEVERInitialConnectivity

alias of connectome.model.fever.ERFEVERInitialConnectivity