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: _PrintableMixin

Parameter that clip the weights during hardware-aware training.

Important

A clipping type has to be set before any of the parameter changes take any effect.

Parameters:
sigma: float = -1.0

Sigma value for clipping for the LayerGaussian type.

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: _PrintableMixin

Parameter that modify the forward/backward weights during hardware-aware training.

Parameters:
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.

res is only used in the modifier types Discretize and DiscretizeAddNormal.

std_dev: float = 0.0

Standard deviation of the added noise to the weight matrix.

This parameter affects the modifier types AddNormal, MultNormal and DiscretizeAddNormal.

Note

If the parameter rel_to_actual_wmax is set then the std_dev is 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 by assumed_wmax.

type: WeightModifierType

Type of the weight modification. Deprecated.