Skip to content

Manipulation of cost matrix and infinite cost #165

@PaulArthurM

Description

@PaulArthurM

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)?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions