aihwkit.inference.converter.fusion module
Conductance converter for the fusion chip.
- class aihwkit.inference.converter.fusion.FusionConductanceConverter(g_max=40)[source]
Bases:
BaseConductanceConverter
Fusion chip conductance converter
Here a single pair of devices per cross-point is assumed, taking positive and negative weights, respectively, where one device is always at 0. However, the zero device will not be explicitly programmed, as the reset conductance value is assumed to be negligible.
- Parameters:
g_max (int) – In \(\mu S\), the maximal conductance, ie the value the absolute max of the weights will be mapped to. The valid g_max value fusion chip is between 10 and 40. If no value is specified, the default value 40 is used.
- Returns:
None
- Raises:
ArgumentError – in case g_max is not in the range of 10 to 40.
- 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]