Merged
Merged
Conversation
| return Popt, proj | ||
|
|
||
|
|
||
| def prw(X, Y, a, b, tau, U0=None, reg=0.1, k=2, stopThr=1e-3, maxiter=100, verbose=0): |
|
|
||
| def prw(X, Y, a, b, tau, U0=None, reg=0.1, k=2, stopThr=1e-3, maxiter=100, verbose=0): | ||
| r""" | ||
| Projection Robust Wasserstein Distance _[12],[13] |
| Samples from measure \mu | ||
| Y : ndarray, shape (n, d) | ||
| Samples from measure \nu | ||
| a : ndarray, shape (n, 1) |
| k : int | ||
| Subspace dimension | ||
| stopThr : float, optional | ||
| Accuracy |
| U = np.random.randn(d, k) | ||
| U, _ = np.linalg.qr(U) | ||
| else: | ||
| U = U0 |
rflamary
changed the title
ot.dr: PRW code; text.text_dr: PRW test code.
[WIP] Projection Robust Wasserstein
| The function solves the following optimization problem: | ||
|
|
||
| .. math:: | ||
| max_{U \in St(d, k)} min_{\pi \in \Pi(\mu,\nu)} \sum_{i,j} \pi_{i,j}*||U^T(x_i - y_j)||^2 - reg * H(\pi) |
|
|
||
| - :math:`U` is a linear projection operator in the Stiefel(d, k) manifold | ||
| - :math:`H(\pi)` is entropy regularizer | ||
| - :math:`x_i`, `y_j` are samples of measures \mu and \nu respectively |
rflamary
changed the title
[WIP] Projection Robust Wasserstein
[MRG] Projection Robust Wasserstein
Labels
None yet