hxtorch.spiking.Synapse

class hxtorch.spiking.Synapse(in_features: int, out_features: int, experiment: Experiment, chip_coordinate: Optional[Tuple[grenade.common.ChipOnConnection, grenade.common.ConnectionOnExecutor]] = None, device: str = None, dtype: Type = None, transform: Callable = <function linear_saturating>, plasticity_rule: PlasticityRule | None = None, receptor: Literal['excitatory', 'inhibitory'] | List[str] | Tuple[str, ...] | None = None)

Bases: hxtorch.spiking.modules.types.projection.Projection

Synapse layer

Caveat: For execution on hardware, this module can only be used in conjunction with a subsequent Neuron module.

__init__(in_features: int, out_features: int, experiment: Experiment, chip_coordinate: Optional[Tuple[grenade.common.ChipOnConnection, grenade.common.ConnectionOnExecutor]] = None, device: str = None, dtype: Type = None, transform: Callable = <function linear_saturating>, plasticity_rule: PlasticityRule | None = None, receptor: Literal['excitatory', 'inhibitory'] | List[str] | Tuple[str, ...] | None = None)None

TODO: Think about what to do with device here.

Parameters
  • in_features – Size of input dimension.

  • out_features – Size of output dimension.

  • 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.

  • plasticity_rule – Plasticity rule adjusting this synapse.

Param

receptor: Receptor type of the synapse. Can be ‘excitatory’, ‘inhibitory’ or (‘excitatory’, inhibitory’) for a signed synapse.

Methods

__init__(in_features, out_features, experiment)

TODO: Think about what to do with device here.

forward_func(input)

get_connections()

reset_parameters()

Resets the synapses weights by reinitialization using torch.nn.kaiming_uniform_.

Attributes

changed_input_data

Getter for changed_since_last_run.

property changed_input_data

Getter for changed_since_last_run.

Returns

Boolean indicating wether module changed since last run.

forward_func(input: types.Handle_current_membrane_cadc_membrane_madc_spikes)types.Handle_graded_spikes
get_connections()List[Tuple[int, int, float]]
output_type

alias of types.Handle_graded_spikes

reset_parameters()None

Resets the synapses weights by reinitialization using torch.nn.kaiming_uniform_.