hxtorch.spiking.modules.SparseSynapse
-
class
hxtorch.spiking.modules.SparseSynapse(connections: torch.SparseTensor, experiment: Experiment, chip_coordinate: Optional[Tuple[grenade.common.ChipOnConnection, grenade.common.ConnectionOnExecutor]] = None, device: str = None, dtype: Type = None, transform: Callable = <function linear_saturating>) Bases:
hxtorch.spiking.modules.types.projection.ProjectionSparse synapse layer
Caveat: For execution on hardware, this module can only be used in conjuction with a subsequent Neuron module.
-
__init__(connections: torch.SparseTensor, experiment: Experiment, chip_coordinate: Optional[Tuple[grenade.common.ChipOnConnection, grenade.common.ConnectionOnExecutor]] = None, device: str = None, dtype: Type = None, transform: Callable = <function linear_saturating>) → None A sparse projection, with connections defined by non-zero entries in connections, represented sparsely on hardware.
- Parameters
connections – A tensor of shape (in_features, out_features) defining existing connections by one-entries. Can be sparse or non-sparse.
experiment – Experiment to append layer to.
chip_coordinate – Chip coordinate this module is placed on.
device – Device to execute on. Only considered in mock-mode.
dtype – Data type of weight tensor.
transform – A function taking the modules weight tensor and transforms it into weights mappable to hardware.
Methods
__init__(connections, experiment[, …])A sparse projection, with connections defined by non-zero entries in connections, represented sparsely on hardware.
Add additional information
forward_func(input)Resets the synapses weights by reinitialization using torch.nn.kaiming_uniform_.
Attributes
-
changed_input_data: bool
-
changed_topology: bool
-
connections: torch.Tensor
-
extra_repr() → str Add additional information
-
forward_func(input: types.Handle_current_membrane_cadc_membrane_madc_spikes) → types.Handle_graded_spikes
-
get_connections() → List[grenade.network.Connection]
-
in_features: int
-
out_features: int
-
output_type alias of
types.Handle_graded_spikes
-
reset_parameters() → None Resets the synapses weights by reinitialization using torch.nn.kaiming_uniform_.
-
training: bool
-
weight: torch.Tensor
-