add_hidden_perturbation_from_minfo

add_hidden_perturbation_from_minfo#

class braintrace.add_hidden_perturbation_from_minfo(minfo)[source]#

Add hidden-state perturbations from a ModuleInfo.

Adds perturbations to the hidden states in the module jaxpr and replaces the hidden states with the perturbed states.

Parameters:

minfo (ModuleInfo) – The model information.

Returns:

The hidden-perturbation information.

Return type:

HiddenPerturbation

See also

add_hidden_perturbation_in_module

Equivalent helper starting from a model.