Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
3e57340
??
marcogenni May 13, 2026
4dcd41b
bug corrigé à la ligne 193
marcogenni May 18, 2026
2d672d1
First draft of make_gauss_hd after some issues with pre-commit
marcogenni May 19, 2026
f163035
test bures wasserstein hd
marcogenni May 19, 2026
cc74058
Merge branch 'master' into my-feature
rflamary May 22, 2026
2456ed0
empirical_bures_wasserstein_mapping_hd
marcogenni May 26, 2026
12a31e8
Merge branch 'master' into my-feature
rflamary May 27, 2026
56951e5
test_empirical_bures_wasserstein_mapping_hd
marcogenni May 28, 2026
21ff174
lined removed in test_.._hd
marcogenni May 28, 2026
9a8cae7
Merge branch 'master' into my-feature
rflamary May 29, 2026
af3ece9
Merge branch 'master' into my-feature
rflamary May 29, 2026
cab5d48
Writing Wasserstein distance between HD Gaussians
marcogenni Jun 1, 2026
5577c0b
Merge branch 'master' into my-feature
rflamary Jun 1, 2026
8a3a9e9
ot bures-wass dist hd with tests
marcogenni Jun 1, 2026
9a0221a
Merge branch 'master' into my-feature
rflamary Jun 2, 2026
121ef24
Merge branch 'master' into my-feature
rflamary Jun 2, 2026
2bef39e
Merge branch 'master' into my-feature
rflamary Jun 3, 2026
8409a07
Last method in gaussian.py, relative tests and references added to th…
marcogenni Jun 3, 2026
759ec12
more bug fixes in the reference number
marcogenni Jun 3, 2026
d3b75ef
New features in town
marcogenni Jun 3, 2026
59ae74f
Merge branch 'master' into my-feature
rflamary Jun 16, 2026
5c93c94
Removed \diag from everywhere
marcogenni Jun 18, 2026
a5dd2fd
d_intrinsic reformatted (no more ds and dt array(1,)
marcogenni Jun 18, 2026
e425493
ot.utils.list_to_array removed from my methods
marcogenni Jun 18, 2026
1a3557d
smaller samples in test functions
marcogenni Jun 18, 2026
49a00c5
nx.from_numpy everywhere in test
marcogenni Jun 19, 2026
6b388db
citation.cff
marcogenni Jun 19, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ authors:
- given-names: David
family-names: Coeurjolly
affiliation: CNRS, LIRIS
- given-names: Marco
family-names: Corneli
affiliation: Université Côte d'Azur

identifiers:
- type: url
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -464,3 +464,7 @@ Artificial Intelligence.
[86] Tanguy, E., Chapel, L., Delon, J. (2025). [Sliced Transport Plans](https://arxiv.org/abs/2508.01243) arXiv preprint 2506.03661.

[87] Liu, X., Diaz Martin, R., Bai Y., Shahbazi A., Thorpe M., Aldroubi A., Kolouri, S. (2024). [Expected Sliced Transport Plans](https://openreview.net/forum?id=P7O1Vt1BdU). International Conference on Learning Representations.

[88] Bouveyron, C. & Corneli, M. (2026). [Scaling optimal transport to high-dimensional Gaussian distributions with application to domain adaptation](https://hal.science/hal-04930868v4/file/Article-OT-HDGauss-v4.pdf). Statistics and Computing 36.2 (2026): 88.

[89] Tipping, M.E. & Bishop, C.M. (1999). [Probabilistic principal component analysis]. Journal of the Royal Statistical Society Series B: Statistical Methodology 61.3 (1999): 611-622.
2 changes: 2 additions & 0 deletions RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ This new release adds support for sparse cost matrices and a new lazy EMD solver
- Add a numerically stable log-domain solver for entropic partial Wasserstein, selectable via the new `method` parameter of `entropic_partial_wasserstein` (`method='sinkhorn_log'`) or directly through `entropic_partial_wasserstein_logscale` (Issue #723)
- Add cost functions between linear operators following [A Spectral-Grassmann Wasserstein metric for operator representations of dynamical systems](https://arxiv.org/pdf/2509.24920), implemented in `ot.sgot` (PR #792)
- Build wheels on ubuntu ARM to avoid QEMU emulation (PR #818)
- Add new methods to compute the linear transport map and the related 2-Wasserstein distance betweeen high-dimensional (HD) Gaussian distributions as described in [88], implemented in `ot.gaussian.bures_wasserstein_mapping_hd` and `ot.gaussian.bures_wasserstein_distance_hd`, respectively. Two additional methods estimate the same quantities from the source and destination observed data and are implemented in `ot.gaussian.empirical_bures_wasserstein_mapping_hd` and `ot.gaussian.empirical_bures_wasserstein_distance_hd`, respectively (PR #814)


#### Closed issues

Expand Down
95 changes: 95 additions & 0 deletions ot/datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import numpy as np
import scipy as sp
from scipy.stats import ortho_group, multivariate_normal
from .utils import check_random_state, deprecated


Expand Down Expand Up @@ -180,3 +181,97 @@ def make_data_classif(dataset, n, nz=0.5, theta=0, p=0.5, random_state=None, **k
def get_data_classif(dataset, n, nz=0.5, theta=0, random_state=None, **kwargs):
"""Deprecated see make_data_classif"""
return make_data_classif(dataset, n, nz=0.5, theta=0, random_state=None, **kwargs)


def make_gauss_hd(
ns, nt, p=100, dim=5, m_diff=3.0, a=(10.0, 15.0), b=(3.0, 3.0), sub_the_same=False
):
"""Generation of source and target domains from Gaussian HD distributions

Parameters
----------
ns : int
number of samples (source)
nt : int
number of samples (target)
p : int
dimension of the ambient space the data live in
dim : (int,int) or int
the intrinsic dimensions of the source and target Gaussian HD distriutions. If a single int the intrinsic dimension is assumed to be the same
m_diff : float
the shift in the first coordinate of the means of the Gaussian HD distributions, i.e. ms_0 and mt_0, respectively (see code)
a : (float, float)
positive floating numbers corresponding to the isotropic variances in the principal subspace, for the source and target distributions, respectively. The same as \delta in :ref:`[1] <references-make_gauss-hd>`, Proposition 2.2
b : (float, float)
positive floating numbers corresponding to the isotropic variance outside the principal subspace for the source and target distributions, respectively.
sub_the_same : bool
should the source/target Gaussian HD distributions live in the same principal subspace?

Returns
-------
Xs : ndarray, shape (ns, p)
`ns` observations of size `p` (source)
Xt : ndarray, shape (nt, p)
`nt` observations of size `p` (destination)
pmts : list
a list containing the parameters of the Gaussian HD distributions

.. _references-make_gauss_hd:
References
----------

.. [1] Bouveyron, C. & Corneli, M. ("Scaling Optimal Transport to High-Dimensional Gaussian Distributions")

"""
d = (dim, dim) if isinstance(dim, int) else dim
mu = np.zeros((2, p))
S = []
mu[1, 0] = m_diff
Q = [ortho_group.rvs(p) for _ in range(2)]

if sub_the_same:
Q[1] = Q[0]

S.append(
Q[0]
@ np.diag(np.hstack((np.full(d[0], a[0]), np.full(p - d[0], b[0]))))
@ Q[0].T
)
S.append(
Q[1]
@ np.diag(np.hstack((np.full(d[1], a[1]), np.full(p - d[1], b[1]))))
@ Q[1].T
)

Xs = multivariate_normal.rvs(mean=mu[0], cov=S[0], size=ns)
Xt = multivariate_normal.rvs(mean=mu[1], cov=S[1], size=ns)

ms = mu[0]
mt = mu[1]
ds = d[0]
dt = d[1]
sigma2_s = np.array(b[0])
sigma2_t = np.array(b[1])
ls = np.repeat(a[0], ds) - sigma2_s
lt = np.repeat(a[1], dt) - sigma2_t
Us = Q[0][:, :ds]
Ut = Q[1][:, :dt]
ds = np.array([ds])
dt = np.array([dt])

prmts = {
"ms": ms,
"mt": mt,
"sigma2_s": sigma2_s,
"sigma2_t": sigma2_t,
"ls": ls,
"lt": lt,
"Us": Us,
"Ut": Ut,
"ds": ds,
"dt": dt,
"Cs": S[0],
"Ct": S[1],
}

return Xs, Xt, prmts
Loading
Loading