aihwkit.inference.converter.conductance module
Conductance converters for the phenomenological noise models for inference.
- class aihwkit.inference.converter.conductance.SinglePairConductanceConverter(g_max=None, g_min=None)[source]
Bases:
BaseConductanceConverter
Single pair of devices.
Assuming a single pair of devices per cross-point, taking positive and negative weights, respectively, where one device is always at 0.
- Parameters:
g_max (float | None) – In \(\mu S\), the maximal conductance, ie the value the absolute max of the weights will be mapped to.
g_min (float | None) – In \(\mu S\), the minimal conductance, ie the value the logical zero of the weights will be mapped to.
- convert_back_to_weights(conductances, params)[source]
Convert a matrix of conductances into weights.
Caution
The conversion is assumed deterministic and repeatable.
- Parameters:
conductances (List[Tensor]) – list of conductance tensors representing a weight matrix
params (Dict) – param dictionary that was returned from the conversion
- Returns:
weight matrix
- Return type:
Tensor
- convert_to_conductances(weights)[source]
Convert a weight matrix into conductances.
Caution
The conversion is assumed deterministic and repeatable.
- Parameters:
weights (Tensor) – weight matrix tensor.
- Returns:
Tuple of the list of conductance tensors and a params dictionary that is used for the reverse conversion.
- Return type:
Tuple[List[Tensor], Dict]