PythonOT/POT

DA methods to perform barycentric mapping when input is close enough rather than exactly equal to source

Opened this issue ยท 0 comments

๐Ÿš€ Feature

Some DA transports provide a barycentric mapping "shortcut" when performing transformation of the input that is equal to the original set of source samples used for fitting. See BaseTransport (here) and MappingTransport (here) as examples.

The proposal is to use allclose instead of array_equal. In fact, it's already done this way for JCPOTTransport.

Motivation

Equality is a rather strong when working with floats. It seems like checking if two arrays are element-wise equal within a tolerance fits the use case. We could also make tolerance into optional parameter for the corresponding transport constructor.