hxtorch.spiking.functional.mock

Modules

hxtorch.spiking.functional.mock.bounds

Define dataclass that holds data needed to mock bounds (e.g.

hxtorch.spiking.functional.mock.discrete

Define torch.autograd.Function to mock discretization (e.g.

hxtorch.spiking.functional.mock.noise

Define dataclass and torch.autograd.Function to mock random noise

hxtorch.spiking.functional.mock.saturate(…)

Applies thresholds. :param input: Tensor, to which the thresholds are applied to. :param bounds: Bounds object containing thesholds and the function, which is used to apply the thresholds.

Classes

Bounds(lower, torch.Tensor]] =, upper, …)

Class defining bounds of a finite value range and how to deal with the bounds in simulation. :param lower: The lower bound. :param upper: The upper bound. :param device: The device, the tensors containing the bounds are transfered to. :param hardware_aware: When set to True, the saturation effect is considered in the backward pass of the simulation; Else, the backward function is set to be the identity function and torch.clamp() is used instead of a surrogate. :param surrogate: Callable that implements a surrogate function for the clamp function. Is needed in case of of a hardware aware backpropagation.

Discrete(*args, **kwargs)

Discretize values of a tensor.

RandomNoise(std, torch.Tensor]] = None, …)

Class defining gaussian random noise to mock the random noise of the membrane and adaptation state on hardware along the time axis.

RandomNoiseAdd(*args, **kwargs)

Add random noise to a tensor

Functions

hxtorch.spiking.functional.mock.saturate(input: torch.Tensor, bounds: hxtorch.spiking.functional.mock.bounds.Bounds)torch.Tensor

Applies thresholds. :param input: Tensor, to which the thresholds are applied to. :param bounds: Bounds object containing thesholds and the function, which

is used to apply the thresholds.