jeanfeydy / geomloss

Geometric loss functions between point clouds, images and volumes
MIT License
599 stars 60 forks source link

Enforce 0.0 * inf = 0.0 #47

Open martenlienen opened 3 years ago

martenlienen commented 3 years ago

In unbalanced OT with small reach, f can become inf in some cases which should not matter because it is multiplied by 0 (alpha is 0 in the cases where f is inf in my experience). But without this fix, we multiply 0.0 * inf which is NaN in floating point numbers instead of 0.

mvinyard commented 2 years ago

Thanks @martenlienen - I found this patch quite useful.