ott.geometry.semidiscrete_pointcloud.SemidiscretePointCloud#
- class ott.geometry.semidiscrete_pointcloud.SemidiscretePointCloud(sampler, y, cost_fn=None, epsilon=None, relative_epsilon=None, scale_cost=1.0, relative_epsilon_seed=0, relative_epsilon_num_samples=1024)[source]#
Semidiscrete point cloud geometry.
Instances of this geometry can be sampled using the
sample()method.- Parameters:
sampler (
Callable[[Array,Tuple[int,...],Optional[dtype]],Array]) – Function with a signature(rng, shape, dtype) -> arraycorresponding to the source distribution.y (
Array) – Array of shape[m, ...]corresponding to the target distribution.cost_fn (
Optional[CostFn]) – Cost function. IfNone, useSqEuclidean.epsilon (
Union[float,Array,None]) – Regularization parameter. Can be set to \(0\) to solve the unregularized semidiscrete problem.relative_epsilon (
Optional[Literal['mean','std']]) – Whetherepsilonrefers to a fraction of themean_cost_matrixorstd_cost_matrix.scale_cost (
Union[float,Literal['mean','max_norm','max_bound','max_cost','median']]) – Option to rescale the cost matrix.relative_epsilon_seed (
int) – Random seed when estimating theepsilon.relative_epsilon_num_samples (
int) – Number of samples when estimating theepsilon.
Methods
sample(rng, num_samples, *[, epsilon])Sample a point cloud.
Attributes
The data type.
Epsilon regularization value.
Whether
epsilon > 0.Shape of the geometry.