devices.xylo.syns65302.XyloA3HiddenNeurons
- class devices.xylo.syns65302.XyloA3HiddenNeurons(input_nodes: ~rockpool.graph.graph_base.SetList[GraphNode], output_nodes: ~rockpool.graph.graph_base.SetList[GraphNode], name: str, computational_module: ~typing.Any, hw_ids: int | ~numpy.ndarray | ~torch.Tensor | ~jax._src.numpy.lax_numpy.array | float = <factory>, threshold: int | ~numpy.ndarray | ~torch.Tensor | ~jax._src.numpy.lax_numpy.array | float = <factory>, bias: int | ~numpy.ndarray | ~torch.Tensor | ~jax._src.numpy.lax_numpy.array | float = <factory>, dash_mem: int | ~numpy.ndarray | ~torch.Tensor | ~jax._src.numpy.lax_numpy.array | float = <factory>, dash_syn: int | ~numpy.ndarray | ~torch.Tensor | ~jax._src.numpy.lax_numpy.array | float = <factory>, dt: float | None = None)[source]
Bases:
XyloA3NeuronsA
graph.GraphModuleencapsulating XyloAudio 3 hidden neuronsAttributes overview
The
dttime step used for this neuron moduleThe HW neuron IDs allocated to this graph module
(N,).The threshold parameters for each neuron
(N,)The bias parameters for each neuron
(N,)The membrane decay parameters for each neuron
(N,)The synapse decay parameters for each neuron.
The input nodes attached to this module
The output nodes attached to this module
An arbitrary name attached to this specific
GraphModuleThe computational module that acts as the source for this graph module
Methods overview
__init__(input_nodes, output_nodes, name, ...)add_input(node)Add a
GraphNodeas an input source to this module, and connect itadd_output(node)Add a
GraphNodeas an output of this module, and connect itRemove all
GraphNodes as inputs of this moduleRemove all
GraphNodes as outputs of this moduleremove_input(node)Remove a
GraphNodeas an input of this module, and disconnect itremove_output(node)Remove a
GraphNodeas 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, hw_ids: int | ~numpy.ndarray | ~torch.Tensor | ~jax._src.numpy.lax_numpy.array | float = <factory>, threshold: int | ~numpy.ndarray | ~torch.Tensor | ~jax._src.numpy.lax_numpy.array | float = <factory>, bias: int | ~numpy.ndarray | ~torch.Tensor | ~jax._src.numpy.lax_numpy.array | float = <factory>, dash_mem: int | ~numpy.ndarray | ~torch.Tensor | ~jax._src.numpy.lax_numpy.array | float = <factory>, dash_syn: int | ~numpy.ndarray | ~torch.Tensor | ~jax._src.numpy.lax_numpy.array | float = <factory>, dt: float | None = None) → None
- classmethod _convert_from(mod: GraphModule) → GraphModule
Convert another
GraphModuleto aGraphModuleof this specific subclassYou 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
GraphModulesubclasses to your subclass.- Parameters:
mod (GraphModule) – A
GraphModuleorGraphModulesubclass object to convert to an object of the specific subclass.- Returns:
A converted
GraphModulesubclass object, of the specific subclass on which this method was called.- Return type:
- classmethod _factory(size_in: int, size_out: int, name: str | None = None, computational_module: Any | None = None, *args, **kwargs) → GraphModuleBase
Build a new
GraphModuleorGraphModulesubclass, with new input and outputGraphNodes created automaticallyUse this factory method to construct a new
GraphModulefrom scratch, which needs new input and outputGraphNodes created automatically. This helper method will be inherited by newGraphModulesubclasses, and will act as factory methods also for your customGraphModulesubclass.- Parameters:
size_in (int) – The number of input
GraphNodes to create and attachsize_out (int) – The number of output
GraphNodes to create and attachname (str, optional) – An arbitrary name to attach to this
GraphModule, defaults to Nonecomputational_module (Optional[Module], optional) – A rockpool computational module that forms the “generator” of this graph module, defaults to None
- Returns:
The newly constructed
GraphModuleorGraphModulesubclass- Return type:
- add_input(node: GraphNode) → None
Add a
GraphNodeas an input source to this module, and connect itThe new node will be appended after the last current input node. The node will be connected with this
GraphModuleas a sink.- Parameters:
node (GraphNode) – The node to add as an input source
- add_output(node: GraphNode) → None
Add a
GraphNodeas an output of this module, and connect itThe new node will be appended after the last current output node. The node will be connected with this
GraphModuleas a source.- Parameters:
node (GraphNode) – The node to add as an output
- bias: IntVector | FloatVector
The bias parameters for each neuron
(N,)- Type:
IntVector
- computational_module: Module
The computational module that acts as the source for this graph module
- Type:
- dash_mem: IntVector | FloatVector
The membrane decay parameters for each neuron
(N,)- Type:
IntVector
- dash_syn: IntVector | FloatVector
The synapse decay parameters for each neuron. Either
(N,)if only one synapse is used per neuron, or(2N,)if two synapses are used for each neuron (i.e. syn2). In this case, elementsdash_syn[0:1]refer to the synapses of neuron0, and so on.- Type:
IntVector
- dt: float | None = None
The
dttime step used for this neuron module- Type:
float
- hw_ids: IntVector | FloatVector
The HW neuron IDs allocated to this graph module
(N,). Empty means than no HW IDs have been allocated.- Type:
IntVector
- 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: GraphNode) → None
Remove a
GraphNodeas an input of this module, and disconnect itThe node will be disconnected from this
GraphModuleas 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: GraphNode) → None
Remove a
GraphNodeas an output of this module, and disconnect itThe node will be disconnected from this
GraphModuleas 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.
- threshold: IntVector | FloatVector
The threshold parameters for each neuron
(N,)- Type:
IntVector