jeanfeydy / geomloss

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

Support for half/single floating point numbers #60

Open gabrielfougeron opened 2 years ago

gabrielfougeron commented 2 years ago

Hi,

It looks to me as though the different algorithms for computing OT losses in Geomloss do not have support for float16/float32 dtypes. Is this correct? Would it even make sense? (I'm thinking about the impact it might have on the stability of the algorithms) Are there any plans to add this in the future?

Best,

jeanfeydy commented 2 years ago

Hi @gabrielfougeron,

Thanks for your interest in the library!

To answer your questions:

Best regards, Jean

gabrielfougeron commented 2 years ago

Dear Jean,

Thank you very much for your detailled answer.

The library supports float32 by default. It is by far the most relevant numerical type for optimal transport computations: it is well supported by both CPU and GPU and provides the necessary precision without being “overkill” like float64.

Mmh ... I guess I'll have to check my code for errors then ^^

Best, Gabriel

jeanfeydy commented 2 years ago

You’re very welcome!

If you see a strange behavior, please let me know about it with an issue: I don’t have the necessary bandwidth to fix them “on-the-fly”, but I will certainly try to solve all the reported problems for the next major release :-)

Have a good day, Jean