aihwkit_lightning.simulator.parameters.inference module
Inference related parameters for resistive processing units.
- class aihwkit_lightning.simulator.parameters.inference.WeightClipParameter(sigma=-1.0, type=<factory>)[source]
Bases:
_PrintableMixinParameter that clip the weights during hardware-aware training.
Important
A clipping
typehas to be set before any of the parameter changes take any effect.- Parameters:
sigma (float) –
type (WeightClipType) –
- sigma: float = -1.0
Sigma value for clipping for the
LayerGaussiantype.
- type: WeightClipType
Type of clipping.
- class aihwkit_lightning.simulator.parameters.inference.WeightModifierParameter(std_dev=0.0, res=0.0, enable_during_test=False, type=<factory>, noise_type=<factory>, quantization_type=<factory>)[source]
Bases:
_PrintableMixinParameter that modify the forward/backward weights during hardware-aware training.
- Parameters:
std_dev (float) –
res (float) –
enable_during_test (bool) –
type (WeightModifierType) –
noise_type (WeightNoiseInjectionType) –
quantization_type (WeightQuantizationType) –
- enable_during_test: bool = False
Deprecated.
- noise_type: WeightNoiseInjectionType
Type of the weight modification.
- quantization_type: WeightQuantizationType
Type of the weight quantizer.
- res: float = 0.0
Resolution of the discretization.
For example, for 8 bits specify as 2**8-2 or the inverse.
resis only used in the modifier typesDiscretizeandDiscretizeAddNormal.
- std_dev: float = 0.0
Standard deviation of the added noise to the weight matrix.
This parameter affects the modifier types
AddNormal,MultNormalandDiscretizeAddNormal.Note
If the parameter
rel_to_actual_wmaxis set then thestd_devis computed in relative terms to the abs max of the given weight matrix, otherwise it in relative terms to the assumed max, which is set byassumed_wmax.
- type: WeightModifierType
Type of the weight modification. Deprecated.