Optimal transport for Gaussian distributions
FunctionsReturn OT linear operator between samples.
The function estimates the optimal barycenter of the empirical distributions. This is equivalent to resolving the fixed point
algorithm for multiple Gaussian distributions \(\left{\mathcal{N}(\mu,\Sigma)\right}_{i=1}^n\)
[1].
The barycenter still following a Gaussian distribution \(\mathcal{N}(\mu_b,\Sigma_b)\) where :
\[\mu_b = \sum_{i=1}^n w_i \mu_i\]
And the barycentric covariance is the solution of the following fixed-point algorithm:
\[\Sigma_b = \sum_{i=1}^n w_i \left(\Sigma_b^{1/2}\Sigma_i^{1/2}\Sigma_b^{1/2}\right)^{1/2}\]
m (array-like (k,d)) – mean of k distributions
C (array-like (k,d,d)) – covariance of k distributions
weights (array-like (k), optional) – weights for each distribution
num_iter (int, optional) – number of iteration for the fixed point algorithm
eps (float, optional) – tolerance for the fixed point algorithm
log (bool, optional) – record log if True
mb ((d,) array-like) – mean of the barycenter
Cb ((d, d) array-like) – covariance of the barycenter
log (dict) – log dictionary return only if log==True in parameters
References
ot.gaussian.bures_wasserstein_barycenter
Return Bures Wasserstein distance between samples.
The function estimates the Bures-Wasserstein distance between two empirical distributions source \(\mu_s\) and target \(\mu_t\), discussed in remark 2.31 [1].
The Bures Wasserstein distance between source and target distribution \(\mathcal{W}\)
\[\mathcal{W}(\mu_s, \mu_t)_2^2= \left\lVert \mathbf{m}_s - \mathbf{m}_t \right\rVert^2 + \mathcal{B}(\Sigma_s, \Sigma_t)^{2}\]
where :
\[\mathbf{B}(\Sigma_s, \Sigma_t)^{2} = \text{Tr}\left(\Sigma_s + \Sigma_t - 2 \sqrt{\Sigma_s^{1/2}\Sigma_t\Sigma_s^{1/2}} \right)\]
ms (array-like (d,)) – mean of the source distribution
mt (array-like (d,)) – mean of the target distribution
Cs (array-like (d,d)) – covariance of the source distribution
Ct (array-like (d,d)) – covariance of the target distribution
log (bool, optional) – record log if True
W (float) – Bures Wasserstein distance
log (dict) – log dictionary return only if log==True in parameters
References
Return OT linear operator between samples.
The function estimates the optimal linear operator that aligns the two empirical distributions. This is equivalent to estimating the closed form mapping between two Gaussian distributions \(\mathcal{N}(\mu_s,\Sigma_s)\) and \(\mathcal{N}(\mu_t,\Sigma_t)\) as proposed in [1] and discussed in remark 2.29 in [2].
The linear operator from source to target \(M\)
\[M(\mathbf{x})= \mathbf{A} \mathbf{x} + \mathbf{b}\]
where :
\[ \begin{align}\begin{aligned}\mathbf{A} &= \Sigma_s^{-1/2} \left(\Sigma_s^{1/2}\Sigma_t\Sigma_s^{1/2} \right)^{1/2} \Sigma_s^{-1/2}\\\mathbf{b} &= \mu_t - \mathbf{A} \mu_s\end{aligned}\end{align} \]
ms (array-like (d,)) – mean of the source distribution
mt (array-like (d,)) – mean of the target distribution
Cs (array-like (d,d)) – covariance of the source distribution
Ct (array-like (d,d)) – covariance of the target distribution
log (bool, optional) – record log if True
A ((d, d) array-like) – Linear operator
b ((1, d) array-like) – bias
log (dict) – log dictionary return only if log==True in parameters
References
Return OT linear operator between samples.
The function estimates the optimal barycenter of the empirical distributions. This is equivalent to resolving the fixed point
algorithm for multiple Gaussian distributions \(\left{\mathcal{N}(\mu,\Sigma)\right}_{i=1}^n\)
[1].
The barycenter still following a Gaussian distribution \(\mathcal{N}(\mu_b,\Sigma_b)\) where :
\[\mu_b = \sum_{i=1}^n w_i \mu_i\]
And the barycentric covariance is the solution of the following fixed-point algorithm:
\[\Sigma_b = \sum_{i=1}^n w_i \left(\Sigma_b^{1/2}\Sigma_i^{1/2}\Sigma_b^{1/2}\right)^{1/2}\]
X (list of array-like (n,d)) – samples in each distribution
reg (float,optional) – regularization added to the diagonals of covariances (>0)
weights (array-like (n,), optional) – weights for each distribution
num_iter (int, optional) – number of iteration for the fixed point algorithm
eps (float, optional) – tolerance for the fixed point algorithm
w (list of array-like (n,), optional) – weights for each sample in each distribution
bias (boolean, optional) – estimate bias \(\mathbf{b}\) else \(\mathbf{b} = 0\) (default:True)
log (bool, optional) – record log if True
mb ((d,) array-like) – mean of the barycenter
Cb ((d, d) array-like) – covariance of the barycenter
log (dict) – log dictionary return only if log==True in parameters
References
Return Bures Wasserstein distance from mean and covariance of distribution.
The function estimates the Bures-Wasserstein distance between two empirical distributions source \(\mu_s\) and target \(\mu_t\), discussed in remark 2.31 [1].
The Bures Wasserstein distance between source and target distribution \(\mathcal{W}\)
\[\mathcal{W}(\mu_s, \mu_t)_2^2= \left\lVert \mathbf{m}_s - \mathbf{m}_t \right\rVert^2 + \mathcal{B}(\Sigma_s, \Sigma_t)^{2}\]
where :
\[\mathbf{B}(\Sigma_s, \Sigma_t)^{2} = \text{Tr}\left(\Sigma_s + \Sigma_t - 2 \sqrt{\Sigma_s^{1/2}\Sigma_t\Sigma_s^{1/2}} \right)\]
xs (array-like (ns,d)) – samples in the source domain
xt (array-like (nt,d)) – samples in the target domain
reg (float,optional) – regularization added to the diagonals of covariances (>0)
ws (array-like (ns), optional) – weights for the source samples
wt (array-like (ns), optional) – weights for the target samples
bias (boolean, optional) – estimate bias \(\mathbf{b}\) else \(\mathbf{b} = 0\) (default:True)
log (bool, optional) – record log if True
W (float) – Bures Wasserstein distance
log (dict) – log dictionary return only if log==True in parameters
References
Return OT linear operator between samples.
The function estimates the optimal linear operator that aligns the two empirical distributions. This is equivalent to estimating the closed form mapping between two Gaussian distributions \(\mathcal{N}(\mu_s,\Sigma_s)\) and \(\mathcal{N}(\mu_t,\Sigma_t)\) as proposed in [1] and discussed in remark 2.29 in [2].
The linear operator from source to target \(M\)
\[M(\mathbf{x})= \mathbf{A} \mathbf{x} + \mathbf{b}\]
where :
\[ \begin{align}\begin{aligned}\mathbf{A} &= \Sigma_s^{-1/2} \left(\Sigma_s^{1/2}\Sigma_t\Sigma_s^{1/2} \right)^{1/2} \Sigma_s^{-1/2}\\\mathbf{b} &= \mu_t - \mathbf{A} \mu_s\end{aligned}\end{align} \]
xs (array-like (ns,d)) – samples in the source domain
xt (array-like (nt,d)) – samples in the target domain
reg (float,optional) – regularization added to the diagonals of covariances (>0)
ws (array-like (ns,1), optional) – weights for the source samples
wt (array-like (ns,1), optional) – weights for the target samples
bias (boolean, optional) – estimate bias \(\mathbf{b}\) else \(\mathbf{b} = 0\) (default:True)
log (bool, optional) – record log if True
A ((d, d) array-like) – Linear operator
b ((1, d) array-like) – bias
log (dict) – log dictionary return only if log==True in parameters
References
ot.gaussian.empirical_bures_wasserstein_mapping
Return Gaussian Gromov-Wasserstein distance between samples.
The function estimates the Gaussian Gromov-Wasserstein distance between two Gaussien distributions source \(\mu_s\) and target \(\mu_t\), whose parameters are estimated from the provided samples \(\mathcal{X}_s\) and \(\mathcal{X}_t\). See [57] Theorem 4.1 for more details.
xs (array-like (ns,d)) – samples in the source domain
xt (array-like (nt,d)) – samples in the target domain
ws (array-like (ns,1), optional) – weights for the source samples
wt (array-like (ns,1), optional) – weights for the target samples
log (bool, optional) – record log if True
G – Gaussian Gromov-Wasserstein distance
References
distances between Gaussian distributions. Journal of Applied Probability, 59(4), 1178-1198.
Return Gaussian Gromov-Wasserstein mapping between samples.
The function estimates the Gaussian Gromov-Wasserstein mapping between two Gaussian distributions source \(\mu_s\) and target \(\mu_t\), whose parameters are estimated from the provided samples \(\mathcal{X}_s\) and \(\mathcal{X}_t\). See [57] Theorem 4.1 for more details.
xs (array-like (ns,ds)) – samples in the source domain
xt (array-like (nt,dt)) – samples in the target domain
ws (array-like (ns,1), optional) – weights for the source samples
wt (array-like (ns,1), optional) – weights for the target samples
sign_eigs (array-like (min(ds,dt),) or string, optional) – sign of the eigenvalues of the mapping matrix, by default all signs will be positive. If ‘skewness’ is provided, the sign of the eigenvalues is selected as the product of the sign of the skewness of the projected data.
log (bool, optional) – record log if True
A ((dt, ds) array-like) – Linear operator
b ((1, dt) array-like) – bias
.. _references-empirical_gaussian_gromov_wasserstein_mapping
References
distances between Gaussian distributions. Journal of Applied Probability, 59(4), 1178-1198.
ot.gaussian.empirical_gaussian_gromov_wasserstein_mapping
Return the Gaussian Gromov-Wasserstein value from [57].
This function return the closed form value of the Gaussian Gromov-Wasserstein distance between two Gaussian distributions \(\mathcal{N}(\mu_s,\Sigma_s)\) and \(\mathcal{N}(\mu_t,\Sigma_t)\) when the OT plan is assumed to be also Gaussian. See [57] Theorem 4.1 for more details.
Cov_s (array-like (ds,ds)) – covariance of the source distribution
Cov_t (array-like (dt,dt)) – covariance of the target distribution
G – Gaussian Gromov-Wasserstein distance
References
distances between Gaussian distributions. Journal of Applied Probability, 59(4), 1178-1198.
Return the Gaussian Gromov-Wasserstein mapping from [57].
This function return the closed form value of the Gaussian Gromov-Wasserstein mapping between two Gaussian distributions \(\mathcal{N}(\mu_s,\Sigma_s)\) and \(\mathcal{N}(\mu_t,\Sigma_t)\) when the OT plan is assumed to be also Gaussian. See [57] Theorem 4.1 for more details.
mu_s (array-like (ds,)) – mean of the source distribution
mu_t (array-like (dt,)) – mean of the target distribution
Cov_s (array-like (ds,ds)) – covariance of the source distribution
Cov_t (array-like (dt,dt)) – covariance of the target distribution
log (bool, optional) – record log if True
A ((dt, ds) array-like) – Linear operator
b ((1, dt) array-like) – bias
References
distances between Gaussian distributions. Journal of Applied Probability, 59(4), 1178-1198.
Return OT linear operator between samples.
The function estimates the optimal barycenter of the empirical distributions. This is equivalent to resolving the fixed point
algorithm for multiple Gaussian distributions \(\left{\mathcal{N}(\mu,\Sigma)\right}_{i=1}^n\)
[1].
The barycenter still following a Gaussian distribution \(\mathcal{N}(\mu_b,\Sigma_b)\) where :
\[\mu_b = \sum_{i=1}^n w_i \mu_i\]
And the barycentric covariance is the solution of the following fixed-point algorithm:
\[\Sigma_b = \sum_{i=1}^n w_i \left(\Sigma_b^{1/2}\Sigma_i^{1/2}\Sigma_b^{1/2}\right)^{1/2}\]
m (array-like (k,d)) – mean of k distributions
C (array-like (k,d,d)) – covariance of k distributions
weights (array-like (k), optional) – weights for each distribution
num_iter (int, optional) – number of iteration for the fixed point algorithm
eps (float, optional) – tolerance for the fixed point algorithm
log (bool, optional) – record log if True
mb ((d,) array-like) – mean of the barycenter
Cb ((d, d) array-like) – covariance of the barycenter
log (dict) – log dictionary return only if log==True in parameters
References
Return Bures Wasserstein distance between samples.
The function estimates the Bures-Wasserstein distance between two empirical distributions source \(\mu_s\) and target \(\mu_t\), discussed in remark 2.31 [1].
The Bures Wasserstein distance between source and target distribution \(\mathcal{W}\)
\[\mathcal{W}(\mu_s, \mu_t)_2^2= \left\lVert \mathbf{m}_s - \mathbf{m}_t \right\rVert^2 + \mathcal{B}(\Sigma_s, \Sigma_t)^{2}\]
where :
\[\mathbf{B}(\Sigma_s, \Sigma_t)^{2} = \text{Tr}\left(\Sigma_s + \Sigma_t - 2 \sqrt{\Sigma_s^{1/2}\Sigma_t\Sigma_s^{1/2}} \right)\]
ms (array-like (d,)) – mean of the source distribution
mt (array-like (d,)) – mean of the target distribution
Cs (array-like (d,d)) – covariance of the source distribution
Ct (array-like (d,d)) – covariance of the target distribution
log (bool, optional) – record log if True
W (float) – Bures Wasserstein distance
log (dict) – log dictionary return only if log==True in parameters
References
Return OT linear operator between samples.
The function estimates the optimal linear operator that aligns the two empirical distributions. This is equivalent to estimating the closed form mapping between two Gaussian distributions \(\mathcal{N}(\mu_s,\Sigma_s)\) and \(\mathcal{N}(\mu_t,\Sigma_t)\) as proposed in [1] and discussed in remark 2.29 in [2].
The linear operator from source to target \(M\)
\[M(\mathbf{x})= \mathbf{A} \mathbf{x} + \mathbf{b}\]
where :
\[ \begin{align}\begin{aligned}\mathbf{A} &= \Sigma_s^{-1/2} \left(\Sigma_s^{1/2}\Sigma_t\Sigma_s^{1/2} \right)^{1/2} \Sigma_s^{-1/2}\\\mathbf{b} &= \mu_t - \mathbf{A} \mu_s\end{aligned}\end{align} \]
ms (array-like (d,)) – mean of the source distribution
mt (array-like (d,)) – mean of the target distribution
Cs (array-like (d,d)) – covariance of the source distribution
Ct (array-like (d,d)) – covariance of the target distribution
log (bool, optional) – record log if True
A ((d, d) array-like) – Linear operator
b ((1, d) array-like) – bias
log (dict) – log dictionary return only if log==True in parameters
References
Return OT linear operator between samples.
The function estimates the optimal barycenter of the empirical distributions. This is equivalent to resolving the fixed point
algorithm for multiple Gaussian distributions \(\left{\mathcal{N}(\mu,\Sigma)\right}_{i=1}^n\)
[1].
The barycenter still following a Gaussian distribution \(\mathcal{N}(\mu_b,\Sigma_b)\) where :
\[\mu_b = \sum_{i=1}^n w_i \mu_i\]
And the barycentric covariance is the solution of the following fixed-point algorithm:
\[\Sigma_b = \sum_{i=1}^n w_i \left(\Sigma_b^{1/2}\Sigma_i^{1/2}\Sigma_b^{1/2}\right)^{1/2}\]
X (list of array-like (n,d)) – samples in each distribution
reg (float,optional) – regularization added to the diagonals of covariances (>0)
weights (array-like (n,), optional) – weights for each distribution
num_iter (int, optional) – number of iteration for the fixed point algorithm
eps (float, optional) – tolerance for the fixed point algorithm
w (list of array-like (n,), optional) – weights for each sample in each distribution
bias (boolean, optional) – estimate bias \(\mathbf{b}\) else \(\mathbf{b} = 0\) (default:True)
log (bool, optional) – record log if True
mb ((d,) array-like) – mean of the barycenter
Cb ((d, d) array-like) – covariance of the barycenter
log (dict) – log dictionary return only if log==True in parameters
References
Return Bures Wasserstein distance from mean and covariance of distribution.
The function estimates the Bures-Wasserstein distance between two empirical distributions source \(\mu_s\) and target \(\mu_t\), discussed in remark 2.31 [1].
The Bures Wasserstein distance between source and target distribution \(\mathcal{W}\)
\[\mathcal{W}(\mu_s, \mu_t)_2^2= \left\lVert \mathbf{m}_s - \mathbf{m}_t \right\rVert^2 + \mathcal{B}(\Sigma_s, \Sigma_t)^{2}\]
where :
\[\mathbf{B}(\Sigma_s, \Sigma_t)^{2} = \text{Tr}\left(\Sigma_s + \Sigma_t - 2 \sqrt{\Sigma_s^{1/2}\Sigma_t\Sigma_s^{1/2}} \right)\]
xs (array-like (ns,d)) – samples in the source domain
xt (array-like (nt,d)) – samples in the target domain
reg (float,optional) – regularization added to the diagonals of covariances (>0)
ws (array-like (ns), optional) – weights for the source samples
wt (array-like (ns), optional) – weights for the target samples
bias (boolean, optional) – estimate bias \(\mathbf{b}\) else \(\mathbf{b} = 0\) (default:True)
log (bool, optional) – record log if True
W (float) – Bures Wasserstein distance
log (dict) – log dictionary return only if log==True in parameters
References
Return OT linear operator between samples.
The function estimates the optimal linear operator that aligns the two empirical distributions. This is equivalent to estimating the closed form mapping between two Gaussian distributions \(\mathcal{N}(\mu_s,\Sigma_s)\) and \(\mathcal{N}(\mu_t,\Sigma_t)\) as proposed in [1] and discussed in remark 2.29 in [2].
The linear operator from source to target \(M\)
\[M(\mathbf{x})= \mathbf{A} \mathbf{x} + \mathbf{b}\]
where :
\[ \begin{align}\begin{aligned}\mathbf{A} &= \Sigma_s^{-1/2} \left(\Sigma_s^{1/2}\Sigma_t\Sigma_s^{1/2} \right)^{1/2} \Sigma_s^{-1/2}\\\mathbf{b} &= \mu_t - \mathbf{A} \mu_s\end{aligned}\end{align} \]
xs (array-like (ns,d)) – samples in the source domain
xt (array-like (nt,d)) – samples in the target domain
reg (float,optional) – regularization added to the diagonals of covariances (>0)
ws (array-like (ns,1), optional) – weights for the source samples
wt (array-like (ns,1), optional) – weights for the target samples
bias (boolean, optional) – estimate bias \(\mathbf{b}\) else \(\mathbf{b} = 0\) (default:True)
log (bool, optional) – record log if True
A ((d, d) array-like) – Linear operator
b ((1, d) array-like) – bias
log (dict) – log dictionary return only if log==True in parameters
References
Return Gaussian Gromov-Wasserstein distance between samples.
The function estimates the Gaussian Gromov-Wasserstein distance between two Gaussien distributions source \(\mu_s\) and target \(\mu_t\), whose parameters are estimated from the provided samples \(\mathcal{X}_s\) and \(\mathcal{X}_t\). See [57] Theorem 4.1 for more details.
xs (array-like (ns,d)) – samples in the source domain
xt (array-like (nt,d)) – samples in the target domain
ws (array-like (ns,1), optional) – weights for the source samples
wt (array-like (ns,1), optional) – weights for the target samples
log (bool, optional) – record log if True
G – Gaussian Gromov-Wasserstein distance
References
distances between Gaussian distributions. Journal of Applied Probability, 59(4), 1178-1198.
Return Gaussian Gromov-Wasserstein mapping between samples.
The function estimates the Gaussian Gromov-Wasserstein mapping between two Gaussian distributions source \(\mu_s\) and target \(\mu_t\), whose parameters are estimated from the provided samples \(\mathcal{X}_s\) and \(\mathcal{X}_t\). See [57] Theorem 4.1 for more details.
xs (array-like (ns,ds)) – samples in the source domain
xt (array-like (nt,dt)) – samples in the target domain
ws (array-like (ns,1), optional) – weights for the source samples
wt (array-like (ns,1), optional) – weights for the target samples
sign_eigs (array-like (min(ds,dt),) or string, optional) – sign of the eigenvalues of the mapping matrix, by default all signs will be positive. If ‘skewness’ is provided, the sign of the eigenvalues is selected as the product of the sign of the skewness of the projected data.
log (bool, optional) – record log if True
A ((dt, ds) array-like) – Linear operator
b ((1, dt) array-like) – bias
.. _references-empirical_gaussian_gromov_wasserstein_mapping
References
distances between Gaussian distributions. Journal of Applied Probability, 59(4), 1178-1198.
Return the Gaussian Gromov-Wasserstein value from [57].
This function return the closed form value of the Gaussian Gromov-Wasserstein distance between two Gaussian distributions \(\mathcal{N}(\mu_s,\Sigma_s)\) and \(\mathcal{N}(\mu_t,\Sigma_t)\) when the OT plan is assumed to be also Gaussian. See [57] Theorem 4.1 for more details.
Cov_s (array-like (ds,ds)) – covariance of the source distribution
Cov_t (array-like (dt,dt)) – covariance of the target distribution
G – Gaussian Gromov-Wasserstein distance
References
distances between Gaussian distributions. Journal of Applied Probability, 59(4), 1178-1198.
Return the Gaussian Gromov-Wasserstein mapping from [57].
This function return the closed form value of the Gaussian Gromov-Wasserstein mapping between two Gaussian distributions \(\mathcal{N}(\mu_s,\Sigma_s)\) and \(\mathcal{N}(\mu_t,\Sigma_t)\) when the OT plan is assumed to be also Gaussian. See [57] Theorem 4.1 for more details.
mu_s (array-like (ds,)) – mean of the source distribution
mu_t (array-like (dt,)) – mean of the target distribution
Cov_s (array-like (ds,ds)) – covariance of the source distribution
Cov_t (array-like (dt,dt)) – covariance of the target distribution
log (bool, optional) – record log if True
A ((dt, ds) array-like) – Linear operator
b ((1, dt) array-like) – bias
References
distances between Gaussian distributions. Journal of Applied Probability, 59(4), 1178-1198.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4