peal.global_utils.get_intermediate_output¶
- peal.global_utils.get_intermediate_output(model, x, distance_from_last_layer=None, layer_name=None)[source]¶
Runs the model on input x and returns the activation tensor. Can specify distance from end or a specific layer name.
- Parameters:
model (torch.nn.Module)
x (torch.Tensor)
distance_from_last_layer (int)
layer_name (str)