aihwkit.inference.converter.base module¶
Base conductance converter for the phenomenological noise models for inference.
-
class
aihwkit.inference.converter.base.
BaseConductanceConverter
[source]¶ Bases:
object
Base class for converting DNN weights into conductances.
-
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 of conductance tensors representing a weight matrix
params – param dictionary that was returned from the conversion
- Returns
weight matrix
- Return type
torch.Tensor
-
convert_to_conductances
(weights)[source]¶ Convert a weight matrix into conductances.
Caution
The conversion is assumed deterministic and repeatable.
- Parameters
weights – 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[torch.Tensor], Dict]
-