G ENERATIVE M ODELING WITH O PTIMAL T RANSPORT M APS
Anonymous authors
Paper under double-blind review
A BSTRACT
With the discovery of Wasserstein GANs, Optimal Transport (OT) has become a powerful tool for large-scale generative modeling tasks.
In these tasks, OT cost is typically used as the loss for training GANs.
In contrast to this approach, we show that the OT map itself can be used as a generative model, providing comparable performance.
Previous analogous approaches consider OT maps as generative models only in the latent spaces due to their poor performance in the original high-dimensional ambient space. In contrast, we apply OT maps directly in the ambient space, e.g., a space of high-dimensional images.
First, we derive a minmax optimization algorithm to efﬁciently compute OT maps for the quadratic cost (Wasserstein-2 distance).
Next, we extend the approach to the case when the input and output distributions are located in the spaces of different dimensions and derive error bounds for the computed OT map.
We evaluate the algorithm on image generation and unpaired image restoration tasks.
In particular, we consider denoising, colorization, and inpainting, where the optimality of the restoration map is a desired attribute, since the output (restored) image is expected to be close to the input (degraded) one.
I NTRODUCTION
Since the discovery of Generative Adversarial Networks (GANs, Goodfellow et al.
, there has been a surge in generative modeling (Radford et al., 2016; Arjovsky et al., 2017; Brock et al., 2019;
Karras et al., 2019).
In the past few years, Optimal Transport (OT, Villani (2008)) theory has been pivotal in addressing important issues of generative models.
In particular, the usage of Wasserstein distance has improved diversity (Arjovsky et al., 2017;
Gulrajani et al., 2017), convergence (Sanjabi et al., 2018), and stability (Miyato et al., 2018;
Kim et al., 2021) of GANs.
Generative models based on OT can be split into two classes depending on what OT is used for.
First, the optimal transport cost serves as the loss for generative models, see Figure 1a.
This is the most prevalent class of methods which includes WGAN (Arjovsky et al., 2017) and its modiﬁcations: WGAN-GP (Gulrajani et al., 2017), WGAN-LP (Petzka et al., 2018), and WGAN-QC (Liu et al., 2019).
Second, the optimal transport map is used as a generative model itself, see Figure 1b.
Such approaches include LSOT (Seguy et al., 2018),
AE-OT (An et al., 2020a), ICNN-OT (Makkuva et al., 2020), W2GN (Korotin et al., 2021a).
Models of the ﬁrst class have been wellstudied, but limited attention has been paid to the second class.
Existing approaches of the second class primarily consider OT maps in latent spaces of pre-trained autoencoders (AE), see Figure 3. The performance of such generative models depends on the underlying AEs, in which decoding transformations are often not accurate; as a result this deﬁciency limits practical applications in high-dimensional ambient spaces.
For this reason, using OT in the latent space does not necessarily guarantee superior performance in generative modeling.
The focus of our paper is the second class of OT-based models using OT map as the generative map.
Finding an optimal mapping is motivated by its ability to preserve speciﬁc attributes of the input samples, a desired property in unpaired learning.
For example, in unpaired image-to-image translation, the learner has to ﬁt a map between two data distributions which preserves the image content.
CycleGAN-based models (Zhu et al., 2017) are widely used for this purpose.
However, they typically have complex optimization objectives consisting of several losses (Amodio & Krishnaswamy, 2019; Lu et al., 2019) in order to make the ﬁtted map preserve the required attributes. [Figure]
The main contributions of this paper are as follows:
We propose an end-to-end algorithm ( (cid:77) 4.3) to ﬁt OT maps for the quadratic cost (Wassersteindistance) between distributions located on the spaces of equal dimensions ( (cid:77) 4.1) and extend the method to unequal dimensions as well ( (cid:77) 4.2).
We prove error bounds for the method ( (cid:77) 4.4).
We demonstrate large-scale applications of OT maps in popular computer vision tasks.
We consider image generation ( (cid:77) 5.1) and unpaired image restoration ( (cid:77) 5.2) tasks.
Our strict OT-based framework allows the theoretical analysis of the recovered transport map. The OT map obtained by our method can be directly used in large-scale computer vision problems which is in high contrast to previous related methods relying on autoencoders and OT maps in the latent space.
Importantly, the performance and computational complexity of our method is comparable to OT-based generative models using OT cost as the loss.
Notations.
In what follows, X and Y are two complete metric spaces, µ ( x ) and ν ( y ) are probability distributions on X and Y , respectively.
For a measurable map T : X → Y , T # µ denotes the pushforward distribution of µ , i.e., the distribution for which any measurable set E ⊂ Y satisﬁes T # µ ( E ) =
µ ( T − 1 ( E )) .
For a vector x , (cid:107) x (cid:107) denotes its Euclidean norm.
We use (cid:104) x, y (cid:105) to denote the inner product of vectors x and y .
We use Π( µ, ν ) to denote the set of joint probability distributions on X × Y whose marginals are µ and ν , respectively (couplings).
For a function f : R D → R ∪ {±∞} its Legendre–Fenchel transform (the convex conjugate) is f ( y )
=
sup x ∈ R D {(cid:104) x, y (cid:105) − f ( x ) } .
It is convex, even if f is not.
B ACKGROUND ON O PTIMAL T RANSPORT
Consider a cost of transportation, c : X × Y → R deﬁned over the product space of X and Y .
Monge’s Formulation.
The optimal transport cost between µ and ν for ground cost c ( · , · ) is
[Equation]
where the inﬁmum is taken over all measurable maps
T : X → Y pushing µ to ν , see Figure 2.
The map T ∗ on which the inﬁmum in (1) is attained is called the optimal transport map .
Monge’s formulation does not allow splitting.
For example, when µ is a Dirac distribution and ν is a non-Dirac distribution, the feasible set of equation (1) is empty.
Kantorovich’s Relaxation.
Instead of asking to which particular point y ∈ Y should all the probability mass of x be moved, Kantorovich (1948) asks how the mass of x should be distributed among all y ∈ Y .
Formally, a transport coupling replaces a transport map; the OT cost is given by:
[Equation]
where the inﬁmum is taken over all couplings π ∈ Π( µ, ν ) of µ and ν .
The coupling π ∗ attaining the inﬁmum of (2) is called the optimal transport plan .
Unlike the formulation of (1), the formulation of (2) is well-posed, and with mild assumptions on spaces
X , Y and ground cost c ( · , · ) , the minimizer π ∗ of (2) always exists (Villani, 2008, Theorem 4.1).
In particular, if π ∗ is deterministic, i.e., π ∗ =
[ id X , T ∗ ] # µ for some T ∗ :
X → Y , then T ∗ minimizes (1).
Duality.
The dual form of (2) is given by (Kantorovich, 1948):
[Equation]
with u ∈ L 1 ( µ ) , v ∈ L 1 ( ν ) called Kantorovich potentials .
For u : X → R and v : Y → R deﬁne their c -transforms by u c ( x ) = inf x ∈X { c ( x, y ) − u ( x ) } and v c ( x ) = inf y ∈Y { c ( x, y ) − v ( y ) } respectively.
Using c -transform, (3) is reformulated as (Villani, 2008, [Equation] Cost
[Equation]
Primal-dual relationship.
For certain ground costs c ( · , · ) , the primal solution T ∗ of (1) can be recovered from the dual solution u ∗ of (3).
For example, if X = Y = R D , c ( x, y )
=
h ( x − y ) with strictly convex h : R D
→ R and µ is absolutely continuous supported on the compact set, then
[Equation]
5) see (Santambrogio, 2015, Theorem 1.17).
For general costs, see (Villani, 2008, Theorem 10.28).
O PTIMAL T RANSPORT IN G ENERATIVE M ODELS
O PTIMAL TRANSPORT COST AS THE LOSS (Figure 1a).
Starting with the works of Arjovsky &
Bottou (2017); Arjovsky et al.
(2017), the usage of OT cost as the loss has become a major way to apply OT for generative modeling.
In this setting, given data distribution ν and fake distribution µ θ , the goal is to minimize Cost ( µ θ , ν ) w.r.t.
the parameters θ .
Typically, µ θ is a pushforward distribution of some given distribution, e.g., N (0 , I ) , via generator network G θ .
The Wasserstein-1 distance ( W 1 ), i.e., the transport cost for ground cost c ( x, y ) =
(cid:107) x − y (cid:107) , is the most practically prevalent example of such a loss.
Models based on this loss are known as
Wasserstein GANs (WGANs).
They estimate W 1 ( µ θ , ν ) based on the dual form as given by (4).
For
W 1 , the optimal potentials u ∗ , v ∗ of (4) satisfy u ∗ = − v ∗ where u ∗ is a 1 -Lipschitz function (Villani, 2008, Case 5.16).
As a result, to compute W 1 , one needs to optimize the following simpliﬁed form:
[Equation]
In WGANs, the potential u is called the discriminator .
Optimization of (6) reduces constrained optimization of (4) with two potentials u, v to optimization of only one discriminator u .
In practice, enforcing the Lipschitz constraint on u is challenging.
Most methods to do this are regularizationbased, e.g., they use gradient penalty (Gulrajani et al., 2017, WGAN-GP) and Lipschitz penalty (Petzka et al., 2018, WGAN-LP).
Other methods enforce Lipschitz property via incorporating certain hard restrictions on the discriminator’s architecture (Anil et al., 2019; Tanielian & Biau, 2021).
General transport costs (other than W 1 ) can also be used as the loss for generative models.
They are less popular since they do not have a dual form reducing to a single potential function similar to (6) for W 1 .
Consequently, the challenging estimation of the c -transform u c is needed.
To avoid this, Sanjabi et al.
(2018) consider the dual form of (3) with two potentials u, v instead form (4) with one u and softly enforce the condition u ( x ) + v ( y ) ≤ c ( x, y ) via entropy or quadratic regularization.
Nhan Dam et al.
(2019) use the dual form of (4) and amortized optimization to compute u c via an additional neural network.
Both methods work for general c ( · , · ) , though the authors test them for c ( x, y )
= (cid:107) x − y (cid:107) only, i.e., W 1 distance.
Mallasto et al.
(2019) propose a fast way to approximate the c -transform and test the approach (WGAN- ( q, p ) ) with several costs, in particular, the Wasserstein-2 distance ( W 2 ), i.e., the transport cost for the quadratic ground cost c ( x,
A fruitful branch of OT-based losses for generative models comes from modiﬁed versions of OT cost, such as Sinkhorn (Genevay et al., 2018), sliced (Deshpande et al., 2018) and minibatch (Fatras et al., 2019)
OT distances.
They typically have lower sample complexity than usual OT and can be accurately estimated from random mini-batches without using dual forms such as (3).
In practice, these approaches usually learn the ground OT cost c ( · , · ) . The aforementioned methods use OT cost in the ambient space to train GANs. There also exist approaches using OT cost in the latent space. For example, Tolstikhin et al.
; Patrini et al.
(2020) use OT cost between encoded data and a given distribution as an additional term to reconstruction loss for training an AE.
As the result, AE’s latent distribution becomes close to the given one. O PTIMAL TRANSPORT MAP AS THE GENERATIVE MAP (Figure 1b).
Methods to compute the
OT map (plan) are less common in comparison to those computing the cost.
Recovering the map from the primal form (1) or (2) usually yields complex optimization objectives containing several adversarial terms (Xie et al., 2019; Liu et al., 2021; Lu et al., 2020).
Such procedures require careful hyperparameter choice.
This needs to be addressed before using these methods in practice.
Primal-dual relationship ( (cid:77) 2) makes it possible to recover the OT map via solving the dual form (3).
Dual-form based methods primarily consider W 2 cost due to its nice theoretical properties and relation to convex functions (Brenier, 1991).
In the semi-discrete case ( µ is continuous, ν is discrete),
An et al. (2020a) and Lei et al.
(2019) compute the dual potential and the OT map by using the Alexandroff theory and convex geometry.
For the continuous case, Seguy et al.
(2018) use the entropy (quadratic) regularization to recover the dual potentials and extract OT map from them via the barycenteric projection.
Taghvaei & Jalali (2019), Makkuva et al.
(2020), Korotin et al.
(2021a) employ input-convex neural networks (ICNNs, see Amos et al.
(2017)) to parametrize potentials in the dual problem and recover OT maps by using their gradients.
The aforementioned dual form methods compute OT maps in LATENT SPACES for problems such as domain adaptation and latent space mass transport, see Figure 3.
OT maps in high-dimensional ambient spaces, e.g., natural images, are usually not considered.
Recent evaluation of continuous
OT methods for W 2 (Korotin et al., 2021b) reveals their crucial limitations, which negatively affect their scalability, such as poor expressiveness of ICNN architectures or bias due to regularization.
E ND - TO - END S OLUTION TO L EARN O PTIMAL M APS 4. E QUAL D IMENSIONS OF I NPUT AND O UTPUT D ISTRIBUTIONS
In this section, we use X = Y =
R D and consider the Wasserstein-2 distance ( W 2 ), i.e., the optimal transport for the quadratic ground cost c ( x, y )
= 12 (cid:107) x − y (cid:107) 2 .
We consider distributions µ, ν with ﬁnite second moments.
We assume that for distributions µ, ν in view there exists a unique OT plan π ∗ minimizing (3) and it is deterministic, i.e., π ∗ =
[ id R D , T ∗ ] # µ .
Here T ∗ is an OT map which minimizes (1).
Previous related works (Makkuva et al., 2020; Korotin et al., 2021a) assumed the absolute continuity of µ , which implied the existence and uniqueness of T ∗ (Brenier, 1991).
Let ψ ( y ) def = 12 (cid:107) y (cid:107) 2 − v ( y ) , where v is the potential of (4).
Note that
[Equation]
Therefore
[Equation]
(4) is equivalent to
[Equation]
[Equation]
where between lines (10) and (11) we replace the optimization over y ∈ R D with the equivalent optimization over functions T : R D
→ R D .
Lemma 4.1.
Let T ∗ be the OT map from µ to ν .
Then, for every optimal potential ψ ∗ , T ∗ ∈ arg sup T
[Equation]
We prove Lemma 4.1 in Appendix A.1.
Thanks to the lemma, we may solve saddle point problem (11) and obtain the OT map T ∗ from its solution ( ψ ∗ , T ∗ ) .
For general µ, ν the arg sup T set for optimal ψ ∗ might contain not only OT map T ∗ , but other functions as well.
Working with real-world data in experiments ( (cid:77) 5.2), we observe that despite this issue, optimization (11) still recovers T ∗ .
Relation to previous works.
The use of the function T to approximate the c -transform was proposed by Nhan Dam et al.
(2019) to estimate the Wasserstein loss in WGANs.
For W 2 , the fact that T ∗ is an OT map was used by Makkuva et al.
Korotin et al.
(2021a) who primarily assumed continuous µ, ν and reduced (11) to convex ψ and T =
∇ φ for convex φ .
Issues with nonuniqueness of solution of (12) were softened, but using ICNNs to parametrize ψ became necessary.
Korotin et al.
(2021b) demonstrated that ICNNs negatively affect practical performance of OT and tested an unconstrained formulation similar to (11).
As per the evaluation, it provided the best empirical performance (Korotin et al., 2021b, (cid:77) 4.5).
The method (cid:98) MM:R (cid:101) they consider parametrizes 12 (cid:107) · (cid:107) 2 − ψ ( · ) by a neural network, while we directly parametrize ψ ( · ) by a neural network ( (cid:77) 4.3).
Recent work by Fan et al.
(2021) exploits formulation similar to (11) for general costs c ( · , · ) .
While their formulation leads to a max-min scheme with general costs (Fan et al., 2021, Theorem 3), our approach gives rise to a min-max method for quadratic cost.
In particular, we extend the formulation to learn OT maps between distributions in spaces with unequal dimensions, see the next subsection.
4. U NEQUAL D IMENSIONS OF I NPUT AND O UTPUT D ISTRIBUTIONS
Consider the case when X = R H and Y =
R D have different dimensions, i.e., H (cid:54) =
D .
In order to map the probability distribution µ to ν , a straightforward solution is to embed X to Y via some
Q : X → Y and then to ﬁt the OT map between Q # µ and ν for the quadratic cost on Y = R D .
In this case, the optimization objective becomes
[Equation]
with the optimal T ∗ recovering the OT map from Q # µ to ν .
For equal dimensions H = D and the identity embedding Q ( x ) ≡ x , expression (13) reduces to optimization (11) up to a constant.
Instead of optimizing (13) over functions T : Q ( X ) → Y [Equation] we propose to consider optimization directly over generative mappings G : X → Y :
[Equation]
Our following lemma establishes connections between (14) and OT with unequal dimensions:
Lemma 4.2.
Assume that exists a unique OT plan between Q # µ and ν and it is deterministic, i
[Equation] e., [ id R D , T ∗ ] # ( Q # µ ) .
Then G ∗ ( x ) =
T ∗ (cid:0) Q ( x ) (cid:1) is the OT map between µ and ν for the Q - embedded quadratic cost c ( x, y )
= 12 (cid:107) Q ( x ) − y (cid:107) 2 .
Moreover, for every optimal potential ψ ∗ of problem (14),
[Equation]
G ( x ) (cid:1)(cid:9) dµ ( x ) .
We prove Lemma 4.2 in Appendix A.2.
Analogously to Lemma 4.1, it provides a way to compute the OT map G ∗ for Q -embedded quadratic cost between distributions µ and ν by solving the saddle point problem (14).
Note the situation with non-uniqueness of arg sup G is similar to that used in (cid:77) 4.1.
Relation to previous works.
In practice, learning OT maps directly between spaces of unequal dimensions was considered in the work by (Fan et al., 2021, (cid:77) 5.2) but only on toy examples.
We demonstrate that our method works well in large-scale generative modeling tasks ( (cid:77) 5.1).
Theoretical properties of OT maps for embedded costs are studied, e.g., in (Pass, 2010; McCann & Pass, 2020).
4. P RACTICAL A SPECTS AND O PTIMIZATION P ROCEDURE
To optimize functional (14), we approximate G : R H → R D and ψ : R D
→ R with neural networks
G θ , ψ ω and optimize their parameters via stochastic gradient descent-ascent (SGDA) by using minibatches from µ, ν .
The practical optimization procedure is given in Algorithm 1 below.
Following the usual practice in GANs, we add small gradient penalty (Gulrajani et al., 2017) on potential ψ ω for better stability.
The penalty in not included in Algorithm 1 to keep it simple.
Relation to previous works.
WGAN by Arjovsky & Bottou (2017) uses W 1 as the loss to update the generator while we solve a diferent task — we ﬁt the generator G to be the OT map for Q -embedded quadratic cost.
Despite this, our Algorithm 1 has similarities with WGAN’s training.
The update of ψ (line 4) coincides with discriminator’s update in WGAN.
The update of generator G (line 8) differs from WGAN’s update by the term −(cid:104) Q ( · ) , G θ ( · ) (cid:105) .
Besides, in WGAN the optimization is inf G sup D . We have inf ψ sup G , i.e., the generator in our case is the solution of the inner problem.
4. E RROR A NALYSIS
Given a pair ( ˆ ψ, ˆ G ) approximately solving (14), a natural question to ask is how good is the recovered OT map ˆ G .
In this subsection, we provide a bound on the difference between G ∗ and ˆ G based on the duality gaps for solving outer and inner optimization problems.
In (8), and, as the result, in (10), (11), (13), (14), it is enough to consider optimization over convex functions ψ , see (Villani, 2008, Case 5.17).
Our theorem below assumes the convexity of ˆ ψ although it might not hold in practice since in practice ˆ ψ is a neural network.
Theorem 4.3.
Assume that exists a unique deterministic OT plan for Q -embedded quadratic cost between µ and ν , i.e., π ∗ =
[ id R H , G ∗ ] # µ for G ∗ : R H → R D . Assume that ˆ ψ is β -strongly convex ( β > 0 ) and ˆ G : R H → R D .
Deﬁne
[Equation]
and
[Equation]
Then the following bound holds true for the OT map G ∗ from µ to ν :
[Equation]
where FID is the Fr´echet inception distance (Heusel et al., 2017) and L is the Lipschitz constant of the feature extractor of the pre-trained InceptionV3 neural network (Szegedy et al., 2016).
We prove Theorem 4.3 in Appendix A.3.
The duality gaps upper bound L 2 ( µ ) norm between computed ˆ G and true G ∗ maps, and the W 22 between true ν and generated (fake) distribution ˆ G # µ . Consequently, they upper bound FID between data ν and fake (generated) ˆ G # µ distributions.
Relation to previous works.
Makkuva et al.
Korotin et al.
(2021a) prove related bounds for
W 2 with µ, ν located on the spaces of the same dimension.
Our result holds for different dimensions.
E XPERIMENTS
We evaluate our algorithm in generative modeling of the data distribution from a noise ( (cid:77) 5.1) and unpaired image restoration task ( (cid:77) 5.2).
Technical details are given in Appendix B. Additionally, in
Appendix B.2 we test our method on a toy 2D dataset.
The code is in the supplementary material.
5. M ODELING D ATA DISTRIBUTION FROM N OISE D ISTRIBUTION
In this subsection, µ is a 128 -dimensional normal noise and ν the high-dimensional data distribution.
Let the images from ν be of size w × h with c channels.
As the embedding Q : X → Y we use a naive upscaling of a noise.
For x ∈ R 128 we represent it as 1 -channel 16 × 8 image, stack c copies over channel dimension and bicubically upscale it to the size w × h of data images from ν .
We test our method on MNIST (LeCun et al., 1998), CIFAR10 (Krizhevsky et al., 2009), and CelebA (Liu et al., 2015) image datasets.
In Figure 4, we show random samples generated by our approach, namely Optimal Transport Modeling (OTM).
To quantify the results, in Tables 1 and 2 we give the inception (Salimans et al., 2016) and FID (Heusel et al., 2017) scores of generated samples.
Similar to (Song & Ermon, 2019, Appendix B.2), we compute them on 50K real and generated samples.
[Figure]
For comparison, we include the scores of existing generative models of three types: (1) OT map as the generative model; (2) OT cost as the loss; (3) not OT-based.
Note that models of the ﬁrst type compute OT in the latent space of an autoencoder in contrast to our approach.
According to our evaluation, the performance of our method is better or comparable to existing alternatives.
5. U NPAIRED I MAGE R ESTORATION
In this subsection, we consider unpaired image restoration tasks on CelebA faces dataset.
In this case, the input distribution µ consists of degraded images, while ν are clean images.
In all the cases, embedding Q is a straightforward identity embedding Q ( x ) ≡ x . [Table] [Table]
In image restoration, optimality of the restoration map is desired since the output (restored) image is expected to be close to the input (degraded)
one minimizing the transport cost.
Note that GANs do not seek for an optimal mapping.
However, in practice, due to implicit inductive biases such as convolutional architectures, GANs still tend to ﬁt low transport cost mappings (B´ezenac et al., 2021).
The experimental setup is shown in Figure 5.
We split the dataset in 3 parts A, B, C containing 90K, 90K, 22K samples respectively.
To each image we apply the degradation transform (decolorization, noising or occlusion) and obtain the degraded dataset containing of 3 respective parts A, B, C. For unpaired training we use part A of degraded and part B of clean images.
For testing, we use parts C.
To quantify the results we compute FID of restored images w.r.t.
clean images of part C. The scores for denoising, inpainting and colorization are given in Table 3, details of each experiment and qualitative results are given below.
[Table]
As the baseline, we include WGAN-GP.
For a fair comparison, we ﬁt it using exactly the same hyperparameters as in our method.
This is possible due to the similarities between our method and
WGAN-GP’s training procedure, see discussion in (cid:77) 4.3.
Denoising .
To create noisy images, we add white normal noise with σ = 0 .
3 to each pixel.
Figure 6 illustrates image denoising using our OTM approach on the test part of the dataset.
We show additional qualitative results for varying σ in Figure 13 of (cid:77) (B.2).
Colorization.
To create grayscale images, we average the RGB values of each pixel.
Figureillustrates image colorization using OTM on the test part of the dataset.
Inpainting .
To create incomplete images, we replace the right half of each clean image with zeros.
Figure 8 illustrates image inpainting using OTM on the test part of the dataset.
C ONCLUSION
Our method ﬁts OT maps for the embedded quadratic transport cost between probability distributions.
Unlike predecessors, it scales well to high dimensions producing applications of OT maps directly in ambient spaces, such as spaces of images.
The performance is comparable to other existing generative models while the complexity of training is similar to that of popular WGANs. [Figure] [Figure] [Figure]
Limitations.
For distributions µ, ν we assume the existence of the OT map between them.
In practice, this might not hold for all real-world µ, ν .
Working with equal dimensions, we focus on the quadratic ground cost 12 (cid:107) x − y (cid:107) 2 .
Nevertheless, our approach extends to other costs c ( · , · ) , see Fan et al.
When the dimensions are unequal, we restrict our analysis to embedded quadratic cost 12 (cid:107) Q ( x ) − y (cid:107) 2 where Q equalizes dimensions.
Choosing the embedding Q might not be straightforward in some practical problems, but our evaluation ( (cid:77) 5.1) shows that even naive choices of Q work well.
Potential impact and ethics.
Real-world image restoration problems often do not have paired datasets limiting the application of supervised techniques.
In these practical unpaired learning problems, we expect our optimal transport approach to improve the performance of the existing models. However, biases in data might lead to biases in the pushforward samples. This should be taken into account when using our method in practical problems. Reproducibility.
The PyTorch source code is provided in the supplementary material.
The instructions to use the code are included in the README.md ﬁle.
A P ROOFS A. P ROOF OF L EMMA 4.
Proof.
It is enough to prove that ψ ∗ ( x ) =
(cid:104) T ∗ ( x ) , x (cid:105) − ψ ∗ (cid:0) T ( x ) (cid:1) holds µ -almost everywhere,
i
[Equation]
e.,
T ∗ ( x ) ∈ arg sup y ∈ R D {(cid:104) x, y (cid:105) − ψ ∗ ( y ) } .
Since ν = T ∗ # µ , we use (9) with ψ ← ψ ∗ to derive
[Equation]
As a result, inequality (17) becomes the equality, in particular, ψ ∗ ( x ) + ψ ∗ (cid:0) T ∗ ( x ) (cid:1)
= (cid:104) T ∗ ( x ) , x (cid:105) holds µ -almost everywhere.
A. P ROOF OF L EMMA 4.
Proof.
Let Q W 22 denote the Q -embedded quadratic cost.
We use the change of variables formula to derive
[Equation]
i.e., computing the OT plan for Q W 22 ( µ, ν ) boils down to computing the OT plan for W 22 ( Q # µ, ν ) .
It follows that [ id R H , T ∗ (cid:0) Q ( x ) (cid:1) ] # µ =
[ id R H , G ∗ ] # µ is an OT plan for Q W 22 ( µ, ν ) , and G ∗ is the
OT map.
Inclusion (15) now follows from Lemma 4.1.
A. P ROOF OF T HEOREM 4.
Proof.
Pick any
[Equation]
ˆ ψ (cid:0) G ( x ) (cid:1) (cid:111) dµ ( x ) or, equivalently, for all x ∈ R H , G (cid:48)
( x ) ∈ arg sup y (cid:110) (cid:104) Q ( x ) , y (cid:105) − ˆ ψ ( y ) (cid:111) .
Consequently, for all y ∈ R D (cid:104) Q ( x ) , G (cid:48) ( x ) (cid:105) − ˆ ψ (cid:0) G (cid:48)
( x ) (cid:1) ≥ (cid:104) Q ( x ) , y (cid:105) − ˆ ψ ( y ) , which after regrouping the terms yields
[Equation]
This means that Q ( x ) is contained in the subgradient ∂ ˆ ψ at G (cid:48)
( x ) for a convex ˆ ψ .
Since ˆ ψ is β -strongly convex, for points G ( x ) , G (cid:48)
( x ) ∈ R D and Q ( x ) ∈ ∂
ˆ ψ (cid:0) G (cid:48) ( x ) (cid:1) we derive ˆ ψ (cid:0) G ( x ) (cid:1) ≥ ˆ ψ (cid:0) G (cid:48)
( x ) (cid:1) + (cid:104) Q
( x ) , G ( x ) − G (cid:48)
( x ) (cid:105) + β 2 (cid:107) G (cid:48)
( x ) − G ( x ) (cid:107) 2 .
Regrouping the terms, this gives (cid:2)
[Equation]
Q
[Equation]
, G
[Equation]
x
[Equation]
−
[Equation]
ψ
[Equation]
−
[Equation]
[Equation]
[Equation]
[Table]
Integrating w.r
[Equation]
t. x ∼ µ yields
[Equation]
Let G ∗ be the OT map from µ to ν .
We use G ∗ # µ = ν to derive
[Equation]
Let ψ ∗ be an optimal potential in (14).
Thanks to Lemma 4.2, we have
[Equation]
By combining (20) with (21), we obtain
[Equation]
[Equation]
The right-hand inequality of (16) follows from the triangle inequality combined with (19) and (22).
The middle inequality of (16) follows from (Korotin et al., 2021a, Lemma A.2) and G ∗ # µ = ν .
Now we prove the left-hand inequality of (16).
Let I be the feature extractor of the pre-trained
InceptionV3 neural networks.
FID score between generated (fake) ˆ G # µ and data distribution ν is
[Equation]
where FD ( · , · ) is the Fr´echet distance which lower bounds 2 · W 22 , see (Dowson & Landau, 1982).
Finally, from (Korotin et al., 2021a, Lemma A.1) it follows that
[Equation]
Here L is the Lipschitz constant of I .
We combine (23) and (24) to get the left-hand inequality in (16).
B E XPERIMENTAL D ETAILS
We use the PyTorch framework.
All the experiments are conducted on 2 × V100 GPUs.
We compute inception and FID scores with the ofﬁcial implementation from OpenAI 1 and TTUR 2 .
The compared results are taken from the respective papers or publicly available source codes.
B. G ENERAL T RAINING D ETAILS
MNIST (LeCun et al., 1998).
On MNIST, we use x ∈ R 128 and y ∈ R 28 × 28 .
The batch size is 64 , learning rate 2 · 10 − 4 , optimizer Adam (Kingma & Ba, 2014) with betas (0 . 5 , 0 . 999) , gradient penalty coefﬁcient λ = 10 , and the number of training epochs T = 200 .
We observe stable training while updating G once in multiple ψ updates, i.e., k G = 1 and k ψ = 5 .
CIFAR10 (Krizhevsky et al., 2009).
We use all 50000 samples while training.
The latent vector x ∈ R 128 and y ∈ R 32 × 32 × 3 , batch size 64, λ = 10 , k G = 1 , k ψ = 5 , T = 1000 , Adam optimizer with betas (0 , 0 . 99) , and learning rate 2 · 10 − 4 .
CelebA (Liu et al., 2015).
We use x ∈ R 128 and y ∈ R 64 × 64 × 3 .
The images are ﬁrst cropped at the center with size 140 and then resized to 64 × 64 .
We consider all 202599 samples.
We use Adam with betas (0 . 5 , 0 . 999) , T = 200 , and learning rate 1 · 10 − 4 .
Other hyper-parameters are same as
CIFAR10.
Image restoration.
In the unpaired image restoration experiments, we use Adam optimizer with betas (0 , 0 . 9) , learning rate 1 · 10 − 3 and train for T = 200 epochs.
Other hyper-parameters are same as the image generation experiment on CelebA.
G2MoG (Makkuva et al., 2020) .
We use toy Gaussian to mixture of 8 Gaussians 3 dataset.
The dimension is D = H
= 2 , total number of samples is 10000 .
We use the batchsize 128 , λ = 1 ,
K ψ = 1 , K G = 16 , and T = 100 .
The optimizer is Adam with betas (0 . 5 , 0 . 99) and learning rate 1 ·
[Table]
B. A DDITIONAL E XPERIMENTAL R ESULTS
The extended qualitative results on MNIST , CIFAR10 , and CelebA are shown in Figure 9, Figure 10, and Figure 11 respectively.
The samples are generated randomly (uncurated) by ﬁtted optimal transport maps between noise and ambient space, e.g., spaces of high-dimensional images.
Figure 12 illustrates latent space interpolation between the generated samples.
Figure 13 shows denoising of images with varying levels of σ = 0 .
4 by the model trained with σ = 0 .
G2MoG. Figure 14 shows the results of our method and related approaches ( (cid:77) 3) on a toy 2D dataset.
B. N EURAL N ETWORK A RCHITECTURES
{+This section contains architectures on MNIST (Table 4), CIFAR
+}
(Table 5), and CelebA (Table 6) generation and image restoration tasks (Table 7) and on the toy 2D dataset.
The transport map G on MNIST is the generator of DCGAN (Radford et al., 2016).
In the ResNet architectures, we use the ResidualBlock of NCSN (Song & Ermon, 2019).
In the unpaired restoration tasks ( (cid:77) 5.2), we use UNet architecture for transport map G and convolutional architecture for potential ψ .
Similarly to (Song & Ermon, 2019), we use BatchNormaliation (BN) and InstanceNormalization+ (INorm+) layers.
In the toy 2D example, we use a simple multi-layer perceptron with 3 hidden layers consisting of 128 neurons each and LeakyReLU activation.
The ﬁnal layer is linear without any activation.
[Table]
[Table]
[Table]
ConvTranspose, BN, LeakyReLU, output shape: [256 × 1 × 1]
ConvTranspose, BN, LeakyReLU, output shape: [512 × 4 × 4]
Conv, PixelShufﬂe, BN, LeakyReLU, output shape: [512 × 8 × 8]
Conv, PixelShufﬂe, BN, LeakyReLU, output shape: [512 × 16 × 16]
Conv, PixelShufﬂe, BN, LeakyReLU, output shape: [512 × 32 × 32]
ConvTranspose, Tanh, output shape: [3 × 64 × 64]
[Table]
Target: y ∈ R 3 ×
[Table]
Conv, output shape: [128 × 64 × 64]
ResidualBlock Down, output shape: [256 × 32 × 32]
ResidualBlock Down, output shape: [256 × 16 × 16]
ResidualBlock Down, output shape: [256 × 8 × 8]
ResidualBlock Down, output shape: [128 × 4 × 4]
Conv, output shape: [1]
[Figure]
[Figure]
(Seguy et al.,
[Figure]
[Figure]
[Figure]
(Jacob et al., 2018)
[Figure]
[Figure]
-LP (Petzka et al., 2018)
[Figure]
al
[Figure]
[Table]
[Table]
Conv, LeakyReLU, AvgPool, output shape: [256 × 32 × 32] , x
Conv, LeakyReLU, AvgPool, output shape: [256 × 16 × 16] , x
Conv, LeakyReLU, AvgPool, output shape: [256 × 8 × 8] , x
Conv, LeakyReLU, AvgPool, output shape: [256 × 4 × 4] , x
Nearest Neighbour Upsample, Conv, BN, ReLU, output shape: [256 × 8 × 8] , y
Add (y3, x3), output shape: [256 × 8 × 8] , y
Nearest Neighbour Upsample, Conv, BN, ReLU, output shape: [256 × 16 × 16] , y
Add (y2, x2), output shape: [256 × 16 × 16] , y
Nearest Neighbour Upsample, Conv, BN, ReLU, output shape: [256 × 32 × 32] , y
Add (y1, x1), output shape: [256 × 32 × 32] , y
Nearest Neighbour Upsample, Conv, BN, ReLU, output shape: [256 × 64 × 64] , y
Add (y, x), output shape: [256 × 64 × 64] , y
ConvTranspose, Tanh, output shape: [3 × 64 × 64] ψ ( . )
Target: y ∈ R 3 × 64 ×
Conv, LeakyReLU, AvgPool, output shape: [256 × 32 × 32]
Conv, LeakyReLU, AvgPool, output shape: [256 × 16 × 16]
Conv, LeakyReLU, AvgPool, output shape: [256 × 8 × 8]
Conv, LeakyReLU, AvgPool, output shape: [256 × 4 × 4]
Linear, output shape: [1]