How to use ViViT

Preliminaries

ViViT’s computational tricks are performed during a backward pass with BackPACK. Hence, you must first extend your model and loss function.

Integration with BackPACK

Starting from a working backward pass with BackPACK, you can integrate ViViT as follows:

  1. Instantiate the ...Computations object for your quantity of interest (see available computations).

  2. Use that object to create the extension and extension hook for BackPACK. Pass them as arguments to your with backpack(...) context.

  3. Request the results from the ...Computations object after the backward pass.

For examples see Code samples.