hxtorch.spiking.functional.mock
Modules
Define dataclass that holds data needed to mock bounds (e.g. |
|
Define torch.autograd.Function to mock discretization (e.g. |
|
Define dataclass and torch.autograd.Function to mock random noise |
|
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
|
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. |
|
Discretize values of a tensor. |
|
Class defining gaussian random noise to mock the random noise of the membrane and adaptation state on hardware along the time axis. |
|
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.