amirgholami / PyHessian

PyHessian is a Pytorch library for second-order based analysis and training of Neural Networks
MIT License
694 stars 119 forks source link

torch.eig deprecated please use torch.linalg.eig for line 261 of hessian.py #17

Open dsm-72 opened 1 year ago

amkmpro commented 1 year ago

Hello, you must change these codes in 'hessian.py' line 275:

 a_, b_ = torch.linalg.eig(T)

            eigen_list = a_.real
            weight_list = b_.real**2
ybdai7 commented 1 year ago

I think more proper modification would be:

  a_, b_ = torch.linalg.eig(T)
  eigen_list = a_.real
  weight_list = b_.real[0,:]**2

according to the source code. It would be nice if the author can fix this. But i think this repo is no longer maintained.