qualia_plugin_snn.learningmodel.pytorch.layers package
Subpackages
- qualia_plugin_snn.learningmodel.pytorch.layers.spikingjelly package
- Submodules
- qualia_plugin_snn.learningmodel.pytorch.layers.spikingjelly.Add module
- qualia_plugin_snn.learningmodel.pytorch.layers.spikingjelly.GlobalSumPool1d module
- qualia_plugin_snn.learningmodel.pytorch.layers.spikingjelly.GlobalSumPool2d module
- qualia_plugin_snn.learningmodel.pytorch.layers.spikingjelly.QuantizedAdd module
- qualia_plugin_snn.learningmodel.pytorch.layers.spikingjelly.QuantizedGlobalSumPool1d module
- qualia_plugin_snn.learningmodel.pytorch.layers.spikingjelly.QuantizedGlobalSumPool2d module
- qualia_plugin_snn.learningmodel.pytorch.layers.spikingjelly.layers1d module
- qualia_plugin_snn.learningmodel.pytorch.layers.spikingjelly.layers2d module
- qualia_plugin_snn.learningmodel.pytorch.layers.spikingjelly.quantized_layers module
- qualia_plugin_snn.learningmodel.pytorch.layers.spikingjelly.quantized_layers1d module
- qualia_plugin_snn.learningmodel.pytorch.layers.spikingjelly.quantized_layers2d module
- Module contents
- Submodules
Submodules
- qualia_plugin_snn.learningmodel.pytorch.layers.CustomNode module
- qualia_plugin_snn.learningmodel.pytorch.layers.quantized_SNN_layers module
QuantizedLIFNodeQuantizedLIFNode.vQuantizedLIFNode.v_thresholdQuantizedLIFNode.v_resetQuantizedLIFNode.tauQuantizedLIFNode.__init__()QuantizedLIFNode.supported_backendsQuantizedLIFNode.neuronal_charge()QuantizedLIFNode.single_step_forward()QuantizedLIFNode.multi_step_forward()QuantizedLIFNode.reciprocal_tauQuantizedLIFNode.quantize_v_and_hyperparams()QuantizedLIFNode.get_hyperparams_tensor()QuantizedLIFNode.weights_bitsQuantizedLIFNode.weights_qQuantizedLIFNode.weights_round_mode
QuantizedIFNodeQuantizedIFNode.vQuantizedIFNode.v_thresholdQuantizedIFNode.v_resetQuantizedIFNode.__init__()QuantizedIFNode.supported_backendsQuantizedIFNode.neuronal_charge()QuantizedIFNode.single_step_forward()QuantizedIFNode.multi_step_forward()QuantizedIFNode.quantize_v_and_hyperparams()QuantizedIFNode.get_hyperparams_tensor()QuantizedIFNode.weights_bitsQuantizedIFNode.weights_qQuantizedIFNode.weights_round_mode
QuantizedATIF
Module contents
Contains implementation for custom or quantized layers for spiking neural networks.
- class qualia_plugin_snn.learningmodel.pytorch.layers.ATIF[source]
Bases:
BaseNodeIFSRLSJ: Integrate and Fire soft-reset with learnable Vth and activation scaling, based on spikingjelly.
- __init__(v_threshold: float = 1.0, vth_init_l: float = 0.8, vth_init_h: float = 1.0, alpha: float = 1.0, device: str = 'cpu') None[source]
Construct
ATIF.- Parameters:
v_threshold (float) – Factor to apply to the uniform initialization bounds
vth_init_l (float) – Lower bound for uniform initialization of threshold Tensor
vth_init_h (float) – Higher bound for uniform initialization of threshold Tensor
alpha (float) – Sigmoig surrogate scale factor
device (str) – Device to run the computation on
- Return type:
None
- property supported_backends: tuple[Literal['torch']]
Supported step_mode and backend.
Only single-step mode with torch backend is supported.
- Returns:
Tuple of
'torch'ifstep_modeis's'- Raises:
ValueError – When
step_modeis not's'
- get_coeffs() Tensor[source]
Return the Tensor of threshold
v_threshold.- Returns:
Tensor of threshold
v_threshold- Return type:
- set_coeffs(v_threshold: Tensor) None[source]
Replace the Tensor of threshold
v_threshold.- Parameters:
v_threshold (Tensor) – New Tensor of threshold to replace
v_threshold- Return type:
None
- class qualia_plugin_snn.learningmodel.pytorch.layers.IFSRL[source]
Bases:
ModuleIFSRL: Integrate and Fire soft-reset with learnable Vth and activation scaling.
- __init__(v_threshold: float = 1.0, vth_init_l: float = 0.8, vth_init_h: float = 1.0, alpha: float = 1.0, device: str = 'cpu') None[source]
Construct
IFSRL.- Parameters:
v_threshold (float) – Factor to apply to the uniform initialization bounds
vth_init_l (float) – Lower bound for uniform initialization of threshold Tensor
vth_init_h (float) – Higher bound for uniform initialization of threshold Tensor
alpha (float) – Sigmoig surrogate scale factor
device (str) – Device to run the computation on
- Return type:
None
- get_coeffs() Tensor[source]
Return the Tensor of threshold
vp_th.- Returns:
Tensor of threshold
vp_th- Return type:
- set_coeffs(vp_th: Tensor) None[source]
Replace the Tensor of threshold
vp_th.- Parameters:
vp_th (Tensor) – New Tensor of threshold to replace
vp_th- Return type:
None