GaParmar / clean-fid

PyTorch - FID calculation with proper image resizing and quantization steps [CVPR 2022]
https://www.cs.cmu.edu/~clean-fid/
MIT License
971 stars 74 forks source link

Updated square root computation for sparse matrices #51

Open dv-fenix opened 1 year ago

dv-fenix commented 1 year ago

Replaced linalg.sqrtm with linalg.fractional_matrix_power to prevent numerical errors when computing the square root of sparse matrices. The previous method was causing very large complex values, especially when dealing with sparse matrices, leading to inaccuracies. The fractional_matrix_power method effectively resolves this issue, ensuring accurate computations without generating large complex values.