Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compute KFAC matrix on big network #53

Closed
fmaaf opened this issue Oct 18, 2022 · 3 comments
Closed

compute KFAC matrix on big network #53

fmaaf opened this issue Oct 18, 2022 · 3 comments

Comments

@fmaaf
Copy link

fmaaf commented Oct 18, 2022

hi, have you tried to compute the KFAC matrix on a little big networks such as resnet18? I tried to replace the network by resnet18 in your examples Continual_learning_EWC.ipynb , however it seems that the KFAC matrix is too big to be computed.
this is the error:
File "/nngeometry/nngeometry/metrics.py", line 171, in FIM
return representation(generator=generator, examples=loader)
File "/nngeometry_/nngeometry/object/pspace.py", line 439, in init
self.data = generator.get_kfac_blocks(examples)
File "/nngeometry_/nngeometry/generator/jacobian/init.py", line 247, in get_kfac_blocks
output = self.function(*d).view(bs, self.n_output).sum(dim=0)
RuntimeError: shape '[50, 30]' is invalid for input of size 50000_

@tfjgeorge
Copy link
Owner

tfjgeorge commented Oct 18, 2022 via email

@fmaaf
Copy link
Author

fmaaf commented Oct 18, 2022

ok, I will send by email.

@tfjgeorge
Copy link
Owner

It looks like you are using a 1000-fold output layer but you task requires only 30 classes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants