Cell

class Cell(layer: Layer, connection: Connection, neuron: Neuron, names: tuple[str, str])[source]

Bases: Module, Observable

Pair of a Connection and Neuron produced used for training.

Parameters:
  • layer (Layer) – layer which owns this cell.

  • connection (Connection) – connection for the cell.

  • neuron (Neuron) – neuron for the cell.

  • names (tuple[str, str]) – names used by the layer to uniquely identify this cell.

property connection: Connection

Connection submodule.

Returns:

composed connection.

Return type:

Connection

forward() None[source]

Forward call.

Raises:

RuntimeError – Cell cannot have its forward method called.

local_remap(attr: str) tuple[tuple[Any, ...], dict[str, Any]][source]

Locally remaps an attribute for pooled monitors.

This method should alias any local attributes being referenced as required. The callback realign given on initialization will accept the output of this as positional and keyword arguments.

Parameters:

attr (str) – dot-separated attribute relative to self, to realign.

Returns:

tuple of positional arguments and keyword arguments for realign method specified on initialization.

Return type:

tuple[tuple[Any, …], dict[str, Any]]

property neuron: Neuron

Neuron submodule.

Returns:

composed neuron.

Return type:

Neuron

property postspike: Tensor

Action potentials last generated.

Alias for neuron.spike.

Returns:

membrane voltages.

Return type:

torch.Tensor

property postvoltage: Tensor

Membrane voltages in millivolts.

Alias for neuron.voltage.

Returns:

membrane voltages.

Return type:

torch.Tensor

property precurrent: Tensor

Currents from the synapse at the time last used by the connection.

Alias for connection.syncurrent.

Returns:

delay-offset synaptic currents.

Return type:

torch.Tensor

property prespike: Tensor

Spikes to the synapse at the time last used by the connection.

Alias for connection.synspike.

Returns:

delay-offset synaptic spikes.

Return type:

torch.Tensor

property synapse: Synapse

Synapse submodule.

Alias for connection.synapse.

Returns:

composed synapse.

Return type:

Synapse

property updater: Updater | None

Updater submodule.

Alias for connection.updater.

Returns:

composed updater, if any.

Return type:

Updater | None