A backpack for PyTorch that extends the backward pass of feedforward networks to compute quantities beyond the gradient.
Check out the examples on how to use the code.
pip install backpack-for-pytorch
Alternative: Clone the repository and run setup.py
git clone https://github.com/f-dangel/backpack.git ~/backpack
cd ~/backpack
python setup.py install