graph.LIFNeuronWithSynsRealValue

class graph.LIFNeuronWithSynsRealValue(input_nodes: rockpool.graph.graph_base.SetList[GraphNode], output_nodes: rockpool.graph.graph_base.SetList[GraphNode], name: str, computational_module: typing.Any, tau_mem: typing.Union[float, numpy.ndarray, torch.Tensor] = <factory>, tau_syn: typing.Union[float, numpy.ndarray, torch.Tensor] = <factory>, threshold: typing.Union[float, numpy.ndarray, torch.Tensor] = <factory>, bias: typing.Union[float, numpy.ndarray, torch.Tensor] = <factory>, dt: typing.Optional[float] = None)[source]

Bases: graph.graph_modules.GenericNeurons

A GraphModule that encapsulates a set of LIF spiking neurons with synaptic and membrane dynamics, and with real-valued parameters

__init__(input_nodes: rockpool.graph.graph_base.SetList[GraphNode], output_nodes: rockpool.graph.graph_base.SetList[GraphNode], name: str, computational_module: typing.Any, tau_mem: typing.Union[float, numpy.ndarray, torch.Tensor] = <factory>, tau_syn: typing.Union[float, numpy.ndarray, torch.Tensor] = <factory>, threshold: typing.Union[float, numpy.ndarray, torch.Tensor] = <factory>, bias: typing.Union[float, numpy.ndarray, torch.Tensor] = <factory>, dt: typing.Optional[float] = None) None

Attributes overview

dt

The time-step used for these neurons in seconds, if present

tau_mem

The membrane time constants of these neurons, in seconds (Nout,)

tau_syn

The synaptic time constants of these neurons, in seconds (Nin,)

threshold

The firing threshold parameters of these neurons (Nout,)

bias

The bias parameters of these neurons, if present (Nout,)

Methods overview

__init__(input_nodes,Β output_nodes,Β name,Β ...)

add_input(node)

Add a GraphNode as an input source to this module, and connect it

add_output(node)

Add a GraphNode as an output of this module, and connect it

clear_inputs()

Remove all GraphNode s as inputs of this module

clear_outputs()

Remove all GraphNode s as outputs of this module

remove_input(node)

Remove a GraphNode as an input of this module, and disconnect it

remove_output(node)

Remove a GraphNode as an output of this module, and disconnect it

__init__(input_nodes: rockpool.graph.graph_base.SetList[GraphNode], output_nodes: rockpool.graph.graph_base.SetList[GraphNode], name: str, computational_module: typing.Any, tau_mem: typing.Union[float, numpy.ndarray, torch.Tensor] = <factory>, tau_syn: typing.Union[float, numpy.ndarray, torch.Tensor] = <factory>, threshold: typing.Union[float, numpy.ndarray, torch.Tensor] = <factory>, bias: typing.Union[float, numpy.ndarray, torch.Tensor] = <factory>, dt: typing.Optional[float] = None) None
classmethod _convert_from(mod: rockpool.graph.graph_base.GraphModuleBase) rockpool.graph.graph_base.GraphModuleBase

Convert another GraphModule to a GraphModule of this specific subclass

You should override this method in your subclass, to include conversion rules from other graph module classes to your specific subclass.

If you do not provide conversion rules to your specific subclass then it will not be possible to map other GraphModule subclasses to your subclass.

Parameters

mod (GraphModule) – A GraphModule or GraphModule subclass object to convert to an object of the specific subclass.

Returns

A converted GraphModule subclass object, of the specific subclass on which this method was called.

Return type

GraphModule

classmethod _factory(size_in: int, size_out: int, name: Optional[str] = None, computational_module: Optional[Any] = None, *args, **kwargs) rockpool.graph.graph_base.GraphModuleBase

Build a new GraphModule or GraphModule subclass, with new input and output GraphNode s created automatically

Use this factory method to construct a new GraphModule from scratch, which needs new input and output GraphNode s created automatically. This helper method will be inherited by new GraphModule subclasses, and will act as factory methods also for your custom GraphModule subclass.

Parameters
  • size_in (int) – The number of input GraphNode s to create and attach

  • size_out (int) – The number of output GraphNode s to create and attach

  • name (str) – An arbitrary name to attach to this GraphModule

  • computational_module (Module) – A rockpool computational module that forms the β€œgenerator” of this graph module

  • *args – Any additional arguments to pass to the specific subclass constructor

  • **kwargs –

    Any additional arguments to pass to the specific subclass constructor

Returns

The newly constructed GraphModule or GraphModule subclass

Return type

GraphModule

add_input(node: rockpool.graph.graph_base.GraphNode) None

Add a GraphNode as an input source to this module, and connect it

The new node will be appended after the last current input node. The node will be connected with this GraphModule as a sink.

Parameters

node (GraphNode) – The node to add as an input source

add_output(node: rockpool.graph.graph_base.GraphNode) None

Add a GraphNode as an output of this module, and connect it

The new node will be appended after the last current output node. The node will be connected with this GraphModule as a source.

Parameters

node (GraphNode) – The node to add as an output

bias: Union[float, numpy.ndarray, torch.Tensor]

The bias parameters of these neurons, if present (Nout,)

Type

Floatvector

clear_inputs() None

Remove all GraphNode s as inputs of this module

clear_outputs() None

Remove all GraphNode s as outputs of this module

computational_module: Module

The computational module that acts as the source for this graph module

Type

Module

dt: Optional[float] = None

The time-step used for these neurons in seconds, if present

Type

float

input_nodes: SetList['GraphNode']

The input nodes attached to this module

Type

SetList[GraphNode]

name: str

An arbitrary name attached to this specific GraphModule

Type

str

output_nodes: SetList['GraphNode']

The output nodes attached to this module

Type

SetList[GraphNode]

remove_input(node: rockpool.graph.graph_base.GraphNode) None

Remove a GraphNode as an input of this module, and disconnect it

The node will be disconnected from this GraphModule as a sink, and will be removed from the module.

Parameters

node (GraphNode) – The node to remove. If this node exists as an input to the module, it will be removed.

remove_output(node: rockpool.graph.graph_base.GraphNode) None

Remove a GraphNode as an output of this module, and disconnect it

The node will be disconnected from this GraphModule as a source, and will be removed from the module.

Parameters

node (GraphNode) – The node to remove. If this node exists as an output to the module, it will be removed.

tau_mem: Union[float, numpy.ndarray, torch.Tensor]

The membrane time constants of these neurons, in seconds (Nout,)

Type

Floatvector

tau_syn: Union[float, numpy.ndarray, torch.Tensor]

The synaptic time constants of these neurons, in seconds (Nin,)

Type

Floatvector

threshold: Union[float, numpy.ndarray, torch.Tensor]

The firing threshold parameters of these neurons (Nout,)

Type

Floatvector