Problem:
While trying to reproduce the codes from the Single-cell genomics page on my own data, I wondered if it was possible to manipulate the cost matrix before using the sinkhorn function.
If we know that some couplings are impossible, independently of their distance between the x and y arrays, is it possible to define these costs as infinite to penalize them when running the sinkhorn function ? Is it theoretically acceptable to have infinite costs when using OT with the sinkhorn function or others OT algorithms? Are there alternatives to penalize couplings that do not involve infinite values? Should i just run sinkhorn function for several separated PointCloud objects with only possible coupling observations (no infinite values then)?
Solutions considered:
In case infinite values is acceptable, how should I create this new cost matrix?
- Replacing the cost matrix with
geom.cost_matrix = new_cost_matrix returns an error (AttributeError).
- Create a custom
CostFn that performs this step directly, in a custom pairwise method for example?
- Or a new PointCloud method/parameter to multiply by elements the cost matrix by a matrix of 1.0 or infinite values (something similar to
scale_cost but for matrix multiplication)?
Problem:
While trying to reproduce the codes from the Single-cell genomics page on my own data, I wondered if it was possible to manipulate the cost matrix before using the
sinkhornfunction.If we know that some couplings are impossible, independently of their distance between the
xandyarrays, is it possible to define these costs as infinite to penalize them when running thesinkhornfunction ? Is it theoretically acceptable to have infinite costs when using OT with thesinkhornfunction or others OT algorithms? Are there alternatives to penalize couplings that do not involve infinite values? Should i just runsinkhornfunction for several separatedPointCloudobjects with only possible coupling observations (no infinite values then)?Solutions considered:
In case infinite values is acceptable, how should I create this new cost matrix?
geom.cost_matrix = new_cost_matrixreturns an error (AttributeError).CostFnthat performs this step directly, in a custompairwisemethod for example?scale_costbut for matrix multiplication)?