Barycenters
Implementations for optimal transport barycenters are still particularly experimental. They work in principle but they do not yet provide mathematically sound sub-optimality control for truncation. Also the setup of such problems is considerably more complex.
- class MultiScaleOT.TMultiScaleSetupBarycenterContainer
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: MultiScaleOT.TMultiScaleSetupBarycenterContainer) -> None
__init__(self: MultiScaleOT.TMultiScaleSetupBarycenterContainer, nMarginals: int) -> None
- getAlpha(self: MultiScaleOT.TMultiScaleSetupBarycenterContainer, nMarginal: int, nLayer: int) numpy.ndarray[numpy.float64]
- getBeta(self: MultiScaleOT.TMultiScaleSetupBarycenterContainer, nMarginal: int, nLayer: int) numpy.ndarray[numpy.float64]
- setAlpha(self: MultiScaleOT.TMultiScaleSetupBarycenterContainer, alpha: numpy.ndarray[numpy.float64], nMarginal: int, nLayer: int) None
Set dual variable alpha of marginal nMarginal at layer nLayer to alpha and then propagates values to all coarser layers by maximization over child nodes.
- Parameters:
alpha – 1d double array with new values for dual variable. Size needs to equal number of cells in that layer.
nMarginal – id of marginal on which dual variable is to be set.
nLayer – id of layer on which dual variable is to be set.
- setBeta(self: MultiScaleOT.TMultiScaleSetupBarycenterContainer, beta: numpy.ndarray[numpy.float64], nMarginal: int, nLayer: int) None
Set dual variable beta of marginal nMarginal at layer nLayer to beta and then propagates values to all coarser layers by maximization over child nodes.
- Parameters:
beta – 1d double array with new values for dual variable. Size needs to equal number of cells in that layer.
nMarginal – id of marginal on which dual variable is to be set.
nLayer – id of layer on which dual variable is to be set.
- setCenterMarginal(self: MultiScaleOT.TMultiScaleSetupBarycenterContainer, arg0: MultiScaleOT.TMultiScaleSetup) None
- setCostFunctionProvider(self: MultiScaleOT.TMultiScaleSetupBarycenterContainer, nMarginal: int, costFunctionProvider: THierarchicalCostFunctionProvider) None
Set nMarginal-th cost function in barycenter problem to costFunctionProvider.
- setMarginal(self: MultiScaleOT.TMultiScaleSetupBarycenterContainer, nMarginal: int, MultiScaleSetup: MultiScaleOT.TMultiScaleSetup, weight: float) None
Set nMarginal-th marginal in barycenter problem to MultiScaleSetup with weight-coefficient weight.
- setupDuals(self: MultiScaleOT.TMultiScaleSetupBarycenterContainer) None
- class MultiScaleOT.TSinkhornSolverBarycenter
Solver for optimal transport barycenter.
- __init__(self: MultiScaleOT.TSinkhornSolverBarycenter, epsScalingHandler: MultiScaleOT.TEpsScalingHandler, layerCoarsest: int, layerFinest: int, errorGoal: float, MultiScaleSetupBarycenterContainer: MultiScaleOT.TMultiScaleSetupBarycenterContainer, cfg: MultiScaleOT.TSinkhornSolverParameters = <MultiScaleOT.TSinkhornSolverParameters object at 0x7aa40bf8aff0>) None
- findKernelLine(self: MultiScaleOT.TSinkhornSolverBarycenter, nMarginal: int, layerFinest: int, a: int, mode: int, slack: float) tuple
- Parameters:
nMarginal – index of reference marginal
layerFinest – index of desired layer
a – index of kernel line to be determined
mode – 0: rows, 1: columns
slack – threshold below maximal value up to which entries are included
- getCostFunctionProvider(self: MultiScaleOT.TSinkhornSolverBarycenter, arg0: int) MultiScaleOT.THierarchicalCostFunctionProvider
- getKernel(self: MultiScaleOT.TSinkhornSolverBarycenter, arg0: int) MultiScaleOT.TKernelMatrix
- getKernelCSRData(self: MultiScaleOT.TSinkhornSolverBarycenter, arg0: int) MultiScaleOT.TSparseCSRContainer
- getKernelCSRDataTuple(self: MultiScaleOT.TSinkhornSolverBarycenter, arg0: int) tuple
- getKernelPosData(self: MultiScaleOT.TSinkhornSolverBarycenter, arg0: int) MultiScaleOT.TSparsePosContainer
- getKernelPosDataTuple(self: MultiScaleOT.TSinkhornSolverBarycenter, arg0: int) tuple
- getMarginalX(self: MultiScaleOT.TSinkhornSolverBarycenter, arg0: int) numpy.ndarray[numpy.float64]
Return 1st marginal of current coupling between nMarginal-th reference measure and current barycenter candidate.
- getMarginalY(self: MultiScaleOT.TSinkhornSolverBarycenter, arg0: int) numpy.ndarray[numpy.float64]
Return 2nd marginal of current coupling between nMarginal-th reference measure and current barycenter candidate.
- getU(self: MultiScaleOT.TSinkhornSolverBarycenter, arg0: int) numpy.ndarray[numpy.float64]
- getV(self: MultiScaleOT.TSinkhornSolverBarycenter, arg0: int) numpy.ndarray[numpy.float64]
- class MultiScaleOT.TSinkhornSolverBarycenterKLMarginals
Solver for optimal transport barycenter with KL soft marginals.
- __init__(self: MultiScaleOT.TSinkhornSolverBarycenterKLMarginals, epsScalingHandler: MultiScaleOT.TEpsScalingHandler, layerCoarsest: int, layerFinest: int, errorGoal: float, MultiScaleSetupBarycenterContainer: MultiScaleOT.TMultiScaleSetupBarycenterContainer, kappa: float, cfg: MultiScaleOT.TSinkhornSolverParameters = <MultiScaleOT.TSinkhornSolverParameters object at 0x7aa42075f970>) None
- getScorePrimal(self: MultiScaleOT.TSinkhornSolverBarycenterKLMarginals) float