GaParmar / clean-fid

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

Updated square root computation for sparse matrices #51

Open dv-fenix opened 8 months ago

dv-fenix commented 8 months 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.