Return the (Bures-)Wasserstein barycenter between centered Gaussian distributions.
The function estimates the (Bures)-Wasserstein barycenter between centered Gaussian distributions \(\big(\mathcal{N}(0,\Sigma_i)\big)_{i=1}^n\)[16] by solving
The barycenter still follows a Gaussian distribution \(\mathcal{N}(0,\Sigma_b)\)
where \(\Sigma_b\) is solution of the following fixed-point algorithm:
Return the (Bures-)Wasserstein barycenter between centered Gaussian distributions.
The function estimates the (Bures)-Wasserstein barycenter between centered Gaussian distributions \(\big(\mathcal{N}(0,\Sigma_i)\big)_{i=1}^n\)
by using a gradient descent in the Wasserstein space [74, 75]
on the objective
The function computes the Bures distance between \(\mu_s=\mathcal{N}(0,\Sigma_s)\) and \(\mu_t=\mathcal{N}(0,\Sigma_t)\),
given by (see e.g. Remark 2.31 [15]):
nx (module, optional) – The numerical backend module to use. If not provided, the backend will
be fetched from the input matrices Cs, Ct.
Returns:
W (float if Cs and Cd of shape (d,d), array-like (n,m) if Cs of shape (n,d,d) and Ct of shape (m,d,d), array-like (n,) if Cs and Ct of shape (n, d, d) and paired is True) – Bures Wasserstein distance
log (dict) – log dictionary return only if log==True in parameters
Return the (Bures-)Wasserstein barycenter between Gaussian distributions.
The function estimates the (Bures)-Wasserstein barycenter between Gaussian distributions \(\big(\mathcal{N}(\mu_i,\Sigma_i)\big)_{i=1}^n\)[16, 74, 75] by solving
We propose two solvers: one based on solving the previous fixed-point problem [16]. Another based on
gradient descent in the Bures-Wasserstein space [74,75].
Parameters:
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
method (str) – method used for the solver, either ‘fixed_point’, ‘gradient_descent’, ‘stochastic_gradient_descent’ or
‘averaged_stochastic_gradient_descent’
num_iter (int, optional) – number of iteration for the fixed point algorithm
eps (float, optional) – tolerance for the fixed point algorithm
Return Bures Wasserstein distance between samples.
The function computes the Bures-Wasserstein distance between \(\mu_s=\mathcal{N}(m_s,\Sigma_s)\) and \(\mu_t=\mathcal{N}(m_t,\Sigma_t)\),
as discussed in remark 2.31 [15].
W (float if ms and md of shape (d,), array-like (n,m) if ms of shape (n,d) and mt of shape (m,d), array-like (n,) if ms and mt of shape (n,d) and paired is True) – Bures Wasserstein distance
log (dict) – log dictionary return only if log==True in parameters
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 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:
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}\)
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].
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.
Parameters:
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
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.
Parameters:
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.
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.
Parameters:
Cov_s (array-like (ds,ds)) – covariance of the source distribution
Cov_t (array-like (dt,dt)) – covariance of the target distribution
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.
Parameters:
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
Return the (Bures-)Wasserstein barycenter between centered Gaussian distributions.
The function estimates the (Bures)-Wasserstein barycenter between centered Gaussian distributions \(\big(\mathcal{N}(0,\Sigma_i)\big)_{i=1}^n\)[16] by solving
The barycenter still follows a Gaussian distribution \(\mathcal{N}(0,\Sigma_b)\)
where \(\Sigma_b\) is solution of the following fixed-point algorithm:
Return the (Bures-)Wasserstein barycenter between centered Gaussian distributions.
The function estimates the (Bures)-Wasserstein barycenter between centered Gaussian distributions \(\big(\mathcal{N}(0,\Sigma_i)\big)_{i=1}^n\)
by using a gradient descent in the Wasserstein space [74, 75]
on the objective
The function computes the Bures distance between \(\mu_s=\mathcal{N}(0,\Sigma_s)\) and \(\mu_t=\mathcal{N}(0,\Sigma_t)\),
given by (see e.g. Remark 2.31 [15]):
nx (module, optional) – The numerical backend module to use. If not provided, the backend will
be fetched from the input matrices Cs, Ct.
Returns:
W (float if Cs and Cd of shape (d,d), array-like (n,m) if Cs of shape (n,d,d) and Ct of shape (m,d,d), array-like (n,) if Cs and Ct of shape (n, d, d) and paired is True) – Bures Wasserstein distance
log (dict) – log dictionary return only if log==True in parameters
Return the (Bures-)Wasserstein barycenter between Gaussian distributions.
The function estimates the (Bures)-Wasserstein barycenter between Gaussian distributions \(\big(\mathcal{N}(\mu_i,\Sigma_i)\big)_{i=1}^n\)[16, 74, 75] by solving
We propose two solvers: one based on solving the previous fixed-point problem [16]. Another based on
gradient descent in the Bures-Wasserstein space [74,75].
Parameters:
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
method (str) – method used for the solver, either ‘fixed_point’, ‘gradient_descent’, ‘stochastic_gradient_descent’ or
‘averaged_stochastic_gradient_descent’
num_iter (int, optional) – number of iteration for the fixed point algorithm
eps (float, optional) – tolerance for the fixed point algorithm
Return Bures Wasserstein distance between samples.
The function computes the Bures-Wasserstein distance between \(\mu_s=\mathcal{N}(m_s,\Sigma_s)\) and \(\mu_t=\mathcal{N}(m_t,\Sigma_t)\),
as discussed in remark 2.31 [15].
W (float if ms and md of shape (d,), array-like (n,m) if ms of shape (n,d) and mt of shape (m,d), array-like (n,) if ms and mt of shape (n,d) and paired is True) – Bures Wasserstein distance
log (dict) – log dictionary return only if log==True in parameters
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 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:
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}\)
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].
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.
Parameters:
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
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.
Parameters:
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.
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.
Parameters:
Cov_s (array-like (ds,ds)) – covariance of the source distribution
Cov_t (array-like (dt,dt)) – covariance of the target distribution
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.
Parameters:
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