python_models8.connectors package

Submodules

python_models8.connectors.my_connector module

class python_models8.connectors.my_connector.MyConnector(weights=0.0, delays=1, allow_self_connections=True)[source]

Bases: AbstractConnector, AbstractGenerateConnectorOnHost

Connects two vertices with some thing.

Creates a new MyConnector

Parameters:
  • weights (float or iterable(float)) – The weight of the connector.

  • delays (float or iterable(float)) – The inherent delay of the connector, in ms.

  • allow_self_connections (bool) – Whether this connector allows a vertex to connect to itself.

create_synaptic_block(post_slices: Sequence[Slice], post_vertex_slice: Slice, synapse_type: int, synapse_info: SynapseInformation) ndarray[tuple[int, ...], dtype[_ScalarType_co]][source]

Create a synaptic block from the data.

Parameters:
  • post_slices (list(Slice))

  • post_vertex_slice (Slice)

  • synapse_type (AbstractSynapseType)

  • synapse_info (SynapseInformation)

Returns:

The synaptic matrix data to go to the machine, as a Numpy array

Return type:

ndarray

get_delay_maximum(synapse_info: SynapseInformation) float[source]

Get the maximum delay specified by the user in ms,.

Parameters:

synapse_info (SynapseInformation) – the synapse info

get_delay_minimum(synapse_info: SynapseInformation) float | None[source]

Get the minimum delay specified by the user in ms, or None if unbounded.

Parameters:

synapse_info (SynapseInformation)

Return type:

int or None

get_n_connections_from_pre_vertex_maximum(n_post_atoms: int, synapse_info: SynapseInformation, min_delay: float | None = None, max_delay: float | None = None) int[source]

Get the maximum number of connections from any neuron in the pre vertex to the neurons in the post_vertex_slice, for connections with a delay between min_delay and max_delay (inclusive) if both specified (otherwise all connections).

Not all concrete connectors support omitting the delay range.

Parameters:
Return type:

int

get_n_connections_to_post_vertex_maximum(synapse_info: SynapseInformation) int[source]

Get the maximum number of connections to any neuron in the post vertex from neurons in the pre vertex.

Parameters:

synapse_info (SynapseInformation)

Return type:

int

get_weight_maximum(synapse_info: SynapseInformation) float[source]

Get the maximum of the weights for this connection.

Parameters:

synapse_info (SynapseInformation)

Return type:

float

get_weight_variance(weights: float | str | RandomDistribution | ndarray[tuple[int, ...], dtype[float64]] | None, synapse_info: SynapseInformation) float[source]

Get the variance of the weights.

Parameters:

weights (RandomDistribution or int or float or str)

Return type:

float

Module contents