f-dangel / backpack

BackPACK - a backpropagation package built on top of PyTorch which efficiently computes quantities other than the gradient.
https://backpack.pt/
MIT License
555 stars 55 forks source link

Update examples on website #261

Closed Niccolo-Ajroldi closed 1 year ago

Niccolo-Ajroldi commented 1 year ago

I have seen that the examples on the official website (https://backpack.pt/), are not up to date with the current configuration of the library.

from backpack import extend, backpack, Variance

should be substituted with

from backpack import extend, backpack from backpack.extensions import Variance

And the same for the other examples. It's an easy thing, but I was struggling with ImportErrors when trying to run the example codes.

f-dangel commented 1 year ago

Hi,

thanks for expressing this inconsistency. I pushed an improvement that fixes the incorrect imports from BackPACK on the website once it is merged to master.

For the correct import, replace:

Note that the examples still won't run out of the box, as the data loading function is pseudocode.