Auxillary objects for Sinkhorn solvers
This section includes auxillary classes that are needed to fully define a Sinkhorn transport problem, such as cost functions, schedule for the entropic regularization parameter (aka epsilon scaling), and minor parameters.
Transport cost functions
- class MultiScaleOT.THierarchicalCostFunctionProvider
Abstract base class of cost function object. Does not expose a constructor.
- getCost(self: MultiScaleOT.THierarchicalCostFunctionProvider, layer: int, xId: int, yId: int) float
Computes lower bound on cost between points with numbers <xId> and <yId> at layer <layer>.
- getCostAsym(self: MultiScaleOT.THierarchicalCostFunctionProvider, xLayer: int, xId: int, yLayer: int, yId: int) float
Computes lower bound on cost between points with numbers <xId> at layer <xLayer> and <yId> at layer <yLayer>.
- getCostEff(self: MultiScaleOT.THierarchicalCostFunctionProvider, layer: int, xId: int, yId: int) float
Computes lower bound on effective cost (i.e. cost reduced by dual variables) between points with numbers <xId> and <yId> at layer <layer>.
- getCostEffAsym(self: MultiScaleOT.THierarchicalCostFunctionProvider, xLayer: int, xId: int, yLayer: int, yId: int) float
Computes lower bound on effective cost (i.e. cost reduced by dual variables) between points with numbers <xId> at layer <xLayer> and <yId> at layer <yLayer>.
- setLayerBottom(self: MultiScaleOT.THierarchicalCostFunctionProvider, layerBottom: int) None
Sets number of layer which should be considered as finest level.
- class MultiScaleOT.THierarchicalCostFunctionProvider_SquaredEuclidean
Represents the squared Euclidean distance cost function.
- __init__(self: MultiScaleOT.THierarchicalCostFunctionProvider_SquaredEuclidean, MultiScaleSetupX: MultiScaleOT.TMultiScaleSetup, MultiScaleSetupY: MultiScaleOT.TMultiScaleSetup, HKmode: bool = False, HKscale: float = 1.0) None
- Parameters:
MultiScaleSetupX – TMultiScaleSetup instance describing first marginal
MultiScaleSetupY – TMultiScaleSetup instance describing second marginal
HKmode – whether Hellinger–Kantorovich mode should be activated
HKscale – trade-off weight between transport and mass change. Maximal transport distance is HKscale*pi/2.
- setHKscale(self: MultiScaleOT.THierarchicalCostFunctionProvider_SquaredEuclidean, arg0: float) None
- setScale(self: MultiScaleOT.THierarchicalCostFunctionProvider_SquaredEuclidean, arg0: float) None
- class MultiScaleOT.THierarchicalCostFunctionProvider_PEuclidean
Represents the Euclidean distance cost function to power p.
- __init__(self: MultiScaleOT.THierarchicalCostFunctionProvider_PEuclidean, MultiScaleSetupX: MultiScaleOT.TMultiScaleSetup, MultiScaleSetupY: MultiScaleOT.TMultiScaleSetup, p: float = 2.0) None
- Parameters:
MultiScaleSetupX – TMultiScaleSetup instance describing first marginal
MultiScaleSetupY – TMultiScaleSetup instance describing second marginal
p – exponent for distance
Epsilon scaling
- class MultiScaleOT.TEpsScalingHandler
Class for setting up and managing a schedule for epsilon scaling.
- get(self: MultiScaleOT.TEpsScalingHandler) list
- setupExplicit(self: MultiScaleOT.TEpsScalingHandler, epsLists: list) None
- setupGeometricMultiLayerA(self: MultiScaleOT.TEpsScalingHandler, nLayers: int, epsStart: float, epsTarget: float, epsSteps: int, boxScale: float, layerExponent: float, layerCoarsest: int, overlap: bool) int
- setupGeometricMultiLayerB(self: MultiScaleOT.TEpsScalingHandler, nLayers: int, epsBase: float, layerFactor: float, layerSteps: int, stepsFinal: int) int
- setupGeometricSingleLayer(self: MultiScaleOT.TEpsScalingHandler, nLayers: int, epsStart: float, epsTarget: float, epsSteps: int) int
Minor parameters of Sinkhorn algorithm
- class MultiScaleOT.TSinkhornSolverParameters
Bundle all smaller parameters of the Sinkhorn solver objects.
- __init__(self: MultiScaleOT.TSinkhornSolverParameters, maxIterations: int = 100000, innerIterations: int = 100, maxAbsorptionLoops: int = 100, absorption_scalingBound: float = 1000.0, absorption_scalingLowerBound: float = 1000.0, truncation_thresh: float = 1e-20, refineKernel: bool = False, generateFinalKernel: bool = True) None