stopThr (float, optional) – Stop threshold on error (>0)
verbose (int, optional) – Print information along iterations.
random_state (int, RandomState instance or None, default=None) – Determines random number generation for initial value of projection
operator when U0 is not given.
Returns:
pi (ndarray, shape (n, n)) – Optimal transportation matrix for the given parameters
The function solves the following optimization problem:
\[\mathbf{P} = \mathop{\arg \min}_\mathbf{P} \quad
\frac{\sum\limits_i W(P \mathbf{X}^i, P \mathbf{X}^i)}{\sum\limits_{i, j \neq i} W(P \mathbf{X}^i, P \mathbf{X}^j)}\]
where :
\(P\) is a linear projection operator in the Stiefel(p, d) manifold
\(W\) is entropic regularized Wasserstein distances
\(\mathbf{X}^i\) are samples in the dataset corresponding to class i
Choosing a Sinkhorn solver
By default and when using a regularization parameter that is not too small
the default sinkhorn solver should be enough. If you need to use a small
regularization to get sparse cost matrices, you should use the
ot.dr.sinkhorn_log() solver that will avoid numerical
errors, but can be slow in practice.
Parameters:
X (ndarray, shape (n, d)) – Training samples.
y (ndarray, shape (n,)) – Labels for training samples.
p (int, optional) – Size of dimensionality reduction.
reg (float, optional) – Regularization term >0 (entropic regularization)
solver (None | str, optional) – None for steepest descent or ‘TrustRegions’ for trust regions algorithm
else should be a pymanopt.solvers
sinkhorn_method (str) – method used for the Sinkhorn solver, either ‘sinkhorn’ or ‘sinkhorn_log’
P0 (ndarray, shape (d, p)) – Initial starting point for projection.
normalize (bool, optional) – Normalize the Wasserstaiun distance by the average distance on P0 (default : False)
verbose (int, optional) – Print information along iterations.
Returns:
P (ndarray, shape (d, p)) – Optimal transportation matrix for the given parameters
proj (callable) – Projection function including mean centering.
stopThr (float, optional) – Stop threshold on error (>0)
verbose (int, optional) – Print information along iterations.
random_state (int, RandomState instance or None, default=None) – Determines random number generation for initial value of projection
operator when U0 is not given.
Returns:
pi (ndarray, shape (n, n)) – Optimal transportation matrix for the given parameters
The function solves the following optimization problem:
\[\mathbf{P} = \mathop{\arg \min}_\mathbf{P} \quad
\frac{\sum\limits_i W(P \mathbf{X}^i, P \mathbf{X}^i)}{\sum\limits_{i, j \neq i} W(P \mathbf{X}^i, P \mathbf{X}^j)}\]
where :
\(P\) is a linear projection operator in the Stiefel(p, d) manifold
\(W\) is entropic regularized Wasserstein distances
\(\mathbf{X}^i\) are samples in the dataset corresponding to class i
Choosing a Sinkhorn solver
By default and when using a regularization parameter that is not too small
the default sinkhorn solver should be enough. If you need to use a small
regularization to get sparse cost matrices, you should use the
ot.dr.sinkhorn_log() solver that will avoid numerical
errors, but can be slow in practice.
Parameters:
X (ndarray, shape (n, d)) – Training samples.
y (ndarray, shape (n,)) – Labels for training samples.
p (int, optional) – Size of dimensionality reduction.
reg (float, optional) – Regularization term >0 (entropic regularization)
solver (None | str, optional) – None for steepest descent or ‘TrustRegions’ for trust regions algorithm
else should be a pymanopt.solvers
sinkhorn_method (str) – method used for the Sinkhorn solver, either ‘sinkhorn’ or ‘sinkhorn_log’
P0 (ndarray, shape (d, p)) – Initial starting point for projection.
normalize (bool, optional) – Normalize the Wasserstaiun distance by the average distance on P0 (default : False)
verbose (int, optional) – Print information along iterations.
Returns:
P (ndarray, shape (d, p)) – Optimal transportation matrix for the given parameters
proj (callable) – Projection function including mean centering.