sns_toolbox.connections

Connections are the mechanisms for data transmission between neurons. They can either define an individual conductance- based synapse, or a pattern of synapses which is tiled between two populations.

Classes

Connection

Base class of all connections. Initializes a dictionary of parameters which is modified by classes which inherit

ElectricalSynapse

Base class of all connections. Initializes a dictionary of parameters which is modified by classes which inherit

NonSpikingConnection

Base class of all non-spiking connections. Initializes a dictionary of parameters which is modified by classes

SpikingConnection

Base class of all spiking connections. Initializes a dictionary of parameters which is modified by classes

NonSpikingSynapse

An individual non-spiking synapse, where the conductance is defined as Conductance = max_conductance * max(0,

SpikingSynapse

An individual spiking synapse, where the conductance is reset to max_conductance whenever the pre-synaptic

NonSpikingMatrixConnection

A connection matrix of non-spiking synapses, with matrices representing the maximum conductance and reversal

SpikingMatrixConnection

A connection matrix of spiking synapses, with matrices representing the maximum conductance, reversal potential, time

NonSpikingPatternConnection

A pattern of non-spiking synapses, with kernel matrices representing the maximum conductance and reversal potential

SpikingPatternConnection

A pattern of spiking synapses, with kernel matrices representing the maximum conductance, reversal potential, time

NonSpikingTransmissionSynapse

A non-spiking transmission synapse, where (given some integration_gain) the maximum conductance is

NonSpikingModulationSynapse

A non-spiking modulation synapse, where the reversal_potential is set to 0.

SpikingTransmissionSynapse

A spiking version of the non-spiking transmission synapse.

Module Contents

class sns_toolbox.connections.Connection(max_conductance, name: str = 'Connection')

Base class of all connections. Initializes a dictionary of parameters which is modified by classes which inherit from it.

Parameters:
  • max_conductance (Number, np.ndarray, or torch.Tensor) – All connections have a maximum synaptic conductance. It can be a single value or a matrix, but it must be defined.

  • name (str, optional) – Name of this connection preset, defaults to ‘Connection’.

params: Dict[str, Any]
class sns_toolbox.connections.ElectricalSynapse(conductance, name: str = 'Electrical Synapse', rect: bool = False)

Bases: Connection

Base class of all connections. Initializes a dictionary of parameters which is modified by classes which inherit from it.

Parameters:
  • max_conductance (Number, np.ndarray, or torch.Tensor) – All connections have a maximum synaptic conductance. It can be a single value or a matrix, but it must be defined.

  • name (str, optional) – Name of this connection preset, defaults to ‘Connection’.

class sns_toolbox.connections.NonSpikingConnection(max_conductance, reversal_potential, e_lo, e_hi, name: str = 'Non-Spiking Connection')

Bases: Connection

Base class of all non-spiking connections. Initializes a dictionary of parameters which is modified by classes which inherit from it.

Parameters:
  • max_conductance (Number, np.ndarray, or torch.Tensor) – All connections have a maximum synaptic conductance. It can be a single value or a matrix, but it must be defined.

  • reversal_potential (Number, np.ndarray, or torch.Tensor) – All chemical connections have a relative synaptic reversal potential. It can be a single value or a matrix, but it must be defined.

  • e_lo (Number, np.ndarray, or torch.Tensor) – Synaptic activation threshold.

  • e_hi (Number, np.ndarray, or torch.Tensor) – Synaptic maximum activation limit.

  • name (str, optional) – Name of this connection preset, defaults to ‘Non-Spiking Connection’.

class sns_toolbox.connections.SpikingConnection(max_conductance, reversal_potential, time_constant, transmission_delay, name: str = 'Spiking Connection')

Bases: Connection

Base class of all spiking connections. Initializes a dictionary of parameters which is modified by classes which inherit from it.

Parameters:
  • max_conductance (Number, np.ndarray, or torch.Tensor) – All connections have a maximum synaptic conductance. It can be a single value or a matrix, but it must be defined.

  • reversal_potential (Number, np.ndarray, or torch.Tensor) – All chemical connections have a relative synaptic reversal potential. It can be a single value or a matrix, but it must be defined.

  • name (str, optional) – Name of this connection preset, defaults to ‘Spiking Connection’.

class sns_toolbox.connections.NonSpikingSynapse(max_conductance: float = 1.0, reversal_potential: float = 40.0, e_lo: float = 0.0, e_hi: float = 20.0, **kwargs: Any)

Bases: NonSpikingConnection

An individual non-spiking synapse, where the conductance is defined as Conductance = max_conductance * max(0, min(1, Upre/R)), and the synaptic current is i_syn = Conductance*(reversal_potential - Upost).

Parameters:
  • max_conductance (float, optional) – Maximum synaptic conductance, defaults to 1.0. Units are micro-siemens (uS).

  • reversal_potential (float, optional) – Synaptic reversal potential, defaults to 40.0. Units are millivolts (mV).

  • e_lo (float) – Synaptic activation threshold.

  • e_hi (float) – Synaptic maximum activation limit.

class sns_toolbox.connections.SpikingSynapse(max_conductance: float = 1.0, reversal_potential: float = 194.0, time_constant: float = 1.0, transmission_delay: int = 0, conductance_increment: float = None, **kwargs: Any)

Bases: SpikingConnection

An individual spiking synapse, where the conductance is reset to max_conductance whenever the pre-synaptic neuron spikes, and otherwise decays to zero according to the time constant. Synaptic current is i_syn = Conductance*(reversal_potential - Upost). Synaptic propagation can be delayed by a set number of timesteps.

Parameters:
  • max_conductance (float, optional) – Maximum synaptic conductance, defaults to 1.0. Units are micro-siemens (uS).

  • reversal_potential (float, optional) – Synaptic reversal potential, defaults to 194.0. Units are millivolts (mV).

  • time_constant (float, optional) – Time constant of synaptic decay, defaults to 1.0. Units are milliseconds (ms).

  • transmission_delay (int, optional) – Number of timesteps to delay synaptic activity, defaults to 0. Units are timesteps (dt).

  • conductance_increment – Amount that the conductance is incremented at every presynaptic spiking, defaults to

max_conductance. Units are millivolts (mV). :type conductance_increment: Number, optional

class sns_toolbox.connections.NonSpikingMatrixConnection(max_conductance, reversal_potential, e_lo, e_hi, **kwargs: Any)

Bases: NonSpikingConnection

A connection matrix of non-spiking synapses, with matrices representing the maximum conductance and reversal potential of each synapse in the pattern.

Parameters:
  • max_conductance (np.ndarray or torch.Tensor) – Matrix of conductance values. Units are micro-siemens (uS).

  • reversal_potential (np.ndarray or torch.Tensor) – Kernel matrix of reversal potential values. Units are millivolts (mV).

  • e_lo (np.ndarray, or torch.Tensor) – Synaptic activation threshold kernel matrix. Units are millivolts (mV)

  • e_hi (np.ndarray, or torch.Tensor) – Synaptic maximum activation limit kernel matrix. Units are millivolts (mV)

class sns_toolbox.connections.SpikingMatrixConnection(max_conductance, reversal_potential, time_constant, transmission_delay, **kwargs: Any)

Bases: SpikingConnection

A connection matrix of spiking synapses, with matrices representing the maximum conductance, reversal potential, time constant, and transmission delay of each synapse in the pattern.

Parameters:
  • max_conductance (np.ndarray or torch.Tensor) – Matrix of conductance values. Units are micro-siemens (uS).

  • reversal_potential (np.ndarray or torch.Tensor) – Kernel matrix of reversal potential values. Units are millivolts (mV).

  • time_constant (np.ndarray or torch.tensor) – Matrix of time constant values. Units are milliseconds (ms).

  • transmission_delay (np.ndarray or torch.tensor) – Matrix of transmission delays. Units are timesteps (dt).

class sns_toolbox.connections.NonSpikingPatternConnection(max_conductance_kernel, reversal_potential_kernel, e_lo_kernel, e_hi_kernel, **kwargs: Any)

Bases: NonSpikingConnection

A pattern of non-spiking synapses, with kernel matrices representing the maximum conductance and reversal potential of each synapse in the pattern.

Parameters:
  • max_conductance_kernel (np.ndarray or torch.Tensor) – Kernel matrix of conductance values. Units are micro-siemens (uS).

  • reversal_potential_kernel (np.ndarray or torch.Tensor) – Kernel matrix of reversal potential values. Units are millivolts (mV).

  • e_lo_kernel (np.ndarray, or torch.Tensor) – Synaptic activation threshold kernel matrix. Units are millivolts (mV)

  • e_hi_kernel (np.ndarray, or torch.Tensor) – Synaptic maximum activation limit kernel matrix. Units are millivolts (mV)

class sns_toolbox.connections.SpikingPatternConnection(max_conductance_kernel, reversal_potential_kernel, time_constant_kernel, transmission_delay_kernel, **kwargs: Any)

Bases: SpikingConnection

A pattern of spiking synapses, with kernel matrices representing the maximum conductance, reversal potential, time constant, and transmission delay of each synapse in the pattern.

Parameters:
  • max_conductance_kernel (np.ndarray or torch.tensor) – Kernel matrix of conductance values. Units are micro-siemens (uS).

  • reversal_potential_kernel (np.ndarray or torch.tensor) – Kernel matrix of reversal potential values. Units are millivolts (mV).

  • time_constant_kernel (np.ndarray or torch.tensor) – Kernel matrix of time constant values. Units are milliseconds (ms).

  • transmission_delay_kernel (np.ndarray or torch.tensor) – Kernel matrix of transmission delays. Units are timesteps (dt).

class sns_toolbox.connections.NonSpikingTransmissionSynapse(gain: float = 1.0, name: str = 'Transmit', R: float = 20.0, **kwargs)

Bases: NonSpikingSynapse

A non-spiking transmission synapse, where (given some integration_gain) the maximum conductance is max_conductance = (integration_gain*R)/(reversal_potential - integration_gain*R).

Parameters:
  • gain (Number, optional) – Transmission integration gain, defaults to 1.0.

  • name (str, optional) – Name of this synapse preset, defaults to ‘Transmit’

  • R (Number) – Range of neural voltage activity, defaults to 20.0. Units are millivolts (mV).

class sns_toolbox.connections.NonSpikingModulationSynapse(ratio, name: str = 'Modulate', **kwargs)

Bases: NonSpikingSynapse

A non-spiking modulation synapse, where the reversal_potential is set to 0.

Parameters:
  • ratio (Number) – The desired ratio Upost/Upre when Upre is at max activity (R mV).

  • name (str, optional) – Name of this synapse preset, defaults to ‘Modulate’.

class sns_toolbox.connections.SpikingTransmissionSynapse(gain: float = 1.0, name: str = 'Transmit', max_frequency: float = 10.0, non_linearity: float = 0.1, **kwargs)

Bases: SpikingSynapse

A spiking version of the non-spiking transmission synapse.

Parameters:
  • gain (Number, optional) – Transmission frequency gain, defaults to 1.0.

  • name (str, optional) – Name of this preset, defaults to ‘Transmit’.

  • max_frequency (Number, optional) – Maximum spiking frequency, defaults to 10.0. Units are kilohertz (kHz).

  • non_linearity (Number, optional) – A constant between 0 and 1 which limits the synaptic non-linearity. Values closer to 0 improve linearity.