jaxsnn.event.hardware.transforms
Functions
-
jaxsnn.event.hardware.transforms.linear_saturating(weight: jax.Array, scale: float, min_weight: float = - 63.0, max_weight: float = 63.0, as_int: bool = True) → jax.Array Scale all weights according to:
w <- clip(scale * w, min_weight, max_weight)
- Parameters
weight – The weight array to be transformed.
scale – A constant the weight array is scaled with.
min_weight – The minimum value, smaller values are clipped to after scaling.
max_weight – The maximum value, bigger values are clipped to after scaling.
as_int – Round to nearest int and return as int type.
- Returns
The transformed weight tensor.