BackPACK
BackPACK is a library built on top of PyTorch to extract more information from a backward pass.
pip install backpack-for-pytorch
For a quick overview of the features, check backpack.pt. The code lives on Github.
- Supported models
- Available Extensions
- First order extensions
BatchGrad()
BatchL2Grad()
SumGradSquared()
Variance()
- Second order extensions
DiagGGNMC()
DiagGGNExact()
BatchDiagGGNMC()
BatchDiagGGNExact()
KFAC()
KFLR()
KFRA()
DiagHessian()
BatchDiagHessian()
SqrtGGNExact()
SqrtGGNMC()
- Block-diagonal curvature products
HMP()
GGNMP()
PCHMP()
- Good to know
- Code examples and use cases