alan-turing-institute / cloudcasting

Cloud modelling (Manchester Prize)
MIT License
0 stars 0 forks source link

Consider options for SSIM working with NaNs #11

Closed dfulu closed 2 days ago

dfulu commented 1 month ago

The function used to create SSIM is relatively slow compared to other metrics. We currently use the structural_similarity() function from skimage, this results in a nested native python loop over sample, time, and channel. We could likely speed up the calculation of SSIM by rewriting this to avoid nested loops. One implementation might be to lift this: https://github.com/google-deepmind/dm_pix/blob/d60144e7c648e73c9349a5926fbb4cbd20045cea/dm_pix/_src/metrics.py#L139-L256

dfulu commented 1 month ago

Also the current function does not work with NaNs

phinate commented 2 days ago

I'm going to close this via #52, and open a broader issue about metric speed.