hxtorch.spiking.modules.hx_module.HXHardwareEntityMixin
-
class
hxtorch.spiking.modules.hx_module.
HXHardwareEntityMixin
(execution_instance: Optional[ExecutionInstance] = None) Bases:
object
-
__init__
(execution_instance: Optional[ExecutionInstance] = None) → None - Parameters
execution_instance – Execution instance to place to.
Methods
__init__
([execution_instance])- param execution_instance
Execution instance to place to.
add_to_input_generator
(input, builder)Add the input to an input module to grenades input generator.
configure_hw_entity
(neuron_id, neuron_block, …)Configures a neuron in the given layer with its specific properties.
Add additional information
post_process
(hw_data, runtime)This methods needs to be overridden for every derived module that demands hardware observables and is intended to translated hardware- affine datatypes returned by grenade into PyTorch tensors.
Register Module in member Experiment
Reset changed_since_last_run.
Attributes
Getter for changed_since_last_run.
-
add_to_input_generator
(input: NeuronHandle, builder: grenade.network.InputGenerator) → None Add the input to an input module to grenades input generator.
- Parameters
module – The module to add the input for.
builder – Grenade’s logical network builder.
-
property
changed_since_last_run
Getter for changed_since_last_run.
- Returns
Boolean indicating wether module changed since last run.
-
configure_hw_entity
(neuron_id: int, neuron_block: pylola_vx_v3.NeuronBlock, coord: pyhalco_hicann_dls_vx_v3.LogicalNeuronOnDLS) → pylola_vx_v3.NeuronBlock Configures a neuron in the given layer with its specific properties. The neurons digital event outputs are enabled according to the given spiking mask.
- Parameters
neuron_id – In-population neuron index.
neuron_block – The neuron block hardware entity.
coord – Coordinate of neuron on hardware.
- Returns
Configured neuron block.
-
extra_repr
() → str Add additional information
-
post_process
(hw_data: HardwareObservables, runtime: float) → Tuple[Optional[torch.Tensor], …] This methods needs to be overridden for every derived module that demands hardware observables and is intended to translated hardware- affine datatypes returned by grenade into PyTorch tensors.
- Parameters
hw_data – A
HardwareObservables
instance holding the hardware data assigned to this module.runtime – The requested runtime of the experiment on hardware in s.
dt – The expected temporal resolution in hxtorch.
- Returns
Hardware data represented as torch.Tensors. Note that torch.Tensors are required here to enable gradient flow.
-
register_hw_entity
() → None Register Module in member Experiment
-
reset_changed_since_last_run
() → None Reset changed_since_last_run. Sets the corresponding flag to false.
-