A UGMENTED S LICED W ASSERSTEIN D ISTANCES
A BSTRACT
While theoretically appealing, the application of the Wasserstein distance to large-scale machine learning problems has been hampered by its prohibitive computational cost.
The sliced Wasserstein distance and its variants improve the computational efﬁciency through the random projection, yet they suffer from low accuracy if the number of projections is not sufﬁciently large, because the majority of projections result in trivially small values.
In this work, we propose a new family of distance metrics, called augmented sliced Wasserstein distances (ASWDs), constructed by ﬁrst mapping samples to higher-dimensional hypersurfaces parameterized by neural networks.
It is derived from a key observation that (random) linear projections of samples residing on these hypersurfaces would translate to much more ﬂexible nonlinear projections in the original sample space, so they can capture complex structures of the data distribution.
We show that the hypersurfaces can be optimized by gradient ascent efﬁciently.
We provide the condition under which the ASWD is a valid metric and show that this can be obtained by an injective neural network architecture.
Numerical results demonstrate that the ASWD signiﬁcantly outperforms other Wasserstein variants for both synthetic and real-world problems.
I NTRODUCTION
Comparing samples from two probability distributions is a fundamental problem in statistics and machine learning.
The optimal transport (OT) theory (Villani, 2008) provides a powerful and ﬂexible theoretical tool to compare degenerative distributions by accounting for the metric in the underlying spaces.
The Wasserstein distance, which arises from the optimal transport theory, has become an increasingly popular choice in various machine learning domains ranging from generative models to transfer learning (Gulrajani et al., 2017; Arjovsky et al., 2017; Kolouri et al., 2019b; Cuturi and
Doucet, 2014; Courty et al., 2016).
Despiteitsfavorableproperties, suchasrobustnesstodisjointsupportsandnumericalstability(Arjovsky et al., 2017), the Wasserstein distance suffers from high computational complexity especially when the sample size is large.
Besides, the Wasserstein distance itself is the result of an optimization problem — it is non-trivial to be integrated into an end-to-end training pipeline of deep neural networks, unless one can make the solver for the optimization problem differentiable.
Recent advances in computational optimal transport methods focus on alternative OT-based metrics that are computationally efﬁcient and solvable via a differentiable optimizer (Peyré and Cuturi, 2019).
Entropy regularization is introduced in the Sinkhorn distance (Cuturi, 2013) and its variants (Altschuler et al., 2017; Dessein et al., 2018) to smooth the optimal transport problem; as a result, iterative matrix scaling algorithms can be applied to provide signiﬁcantly faster solutions with improved sample complexity (Genevay et al., 2019).
An alternative approach is to approximate the Wasserstein distance through slicing , i.e. linearly projecting, the distributions to be compared.
The sliced Wasserstein distance (SWD) (Bonneel et al., 2015) is deﬁned as the expected value of Wasserstein distances between one-dimensional random projections of high-dimensional distributions.
The SWD shares similar theoretical properties with the
Wasserstein distance (Bonnotte, 2013) and is computationally efﬁcient since the Wasserstein distance in one-dimensional space has a closed-form solution based on sorting.
(Deshpande et al., 2019) extends the sliced Wasserstein distance to the max-sliced Wasserstein distance (Max-SWD), by ﬁnding a single projection direction with the maximal distance between projected samples.
The subspace robust
Wasserstein distance extends the idea of slicing to projecting distributions on linear subspaces (Paty and [Figure] Y
[Figure]
Z (b)    80 Distance between [Figure] projections F r e q u e n c y (c)
ASWD    4 Distance between 1-d projections
[Figure]
F r e q u e n c y (d)
[Figure]
Cuturi, 2019).
However, the linear nature of these projections usually leads to low projection efﬁciency of the resulted metrics in high-dimensional spaces (Deshpande et al., 2019; Kolouri et al., 2019a).
Different variants of the SWD have been proposed to improve the projection efﬁciency of the SWD, either by introducing nonlinear projections or by optimizing the distribution of random projections.
Speciﬁcally, (Kolouri et al., 2019a) extends the connection between the sliced Wasserstein distance and the Radon transform (Radon, 1917) to introduce generalized sliced Wasserstein distances (GSWDs) by utilizing generalized Radon transforms (GRTs), which are deﬁned by nonlinear deﬁning functions and lead to nonlinear projections.
A variant named the GSWD-NN was proposed in (Kolouri et al., 2019a) to generate nonlinear projections directly with neural network outputs, but it does not ﬁt into the theoretical framework of the GSWD and does not guarantee a valid metric.
In contrast, the distributional sliced Wasserstein distance (DSWD) and its nonlinear version, the distributional generalized sliced
Wasserstein distance (DGSWD), improve their projection efﬁciency by ﬁnding a distribution of projections that maximizes the expected distances over these projections.
The GSWD and the DGSWD exhibit higher projection efﬁciency than the SWD in the experiment evaluation, yet they require the speciﬁcation of the particular form of deﬁning functions from a limited class of candidates.
However, the selection of deﬁning functions is usually a task-dependent problem and requires domain knowledge, and the impact on performance from different deﬁning functions is still unclear.
In this paper, we present the augmented sliced Wasserstein distance (ASWD), a distance metric constructed by ﬁrst mapping samples to hypersurfaces in an augmented space, which enables ﬂexible nonlinear slicing of data distributions for improved projection efﬁciency (See Figure 1).
Our main contributions include: (i) We exploit the capacity of nonlinear projections employed in the ASWD by constructing injective mapping with arbitrary neural networks; (ii) We prove that the ASWD is a valid distance metric; (iii) We provide a mechanism in which the hypersurface where high-dimensional distributions are projected onto can be optimized and show that the optimization of hypersurfaces can help improve the projection efﬁciency of slice-based Wasserstein distances.
Hence, the ASWD is data-adaptive, i.e. the hypersurfaces can be learned from data.
This implies one does not need to manually design a function from the limited class of candidates; (iv) We demonstrate superior performance of the ASWD in numerical experiments for both synthetic and real-world datasets.
The remainder of the paper is organized as follows.
Section 2 reviews the necessary background.
We present the proposed method and its numerical implementation in Section 3.
Related work are discussed in Section 4.
Numerical experiment results are presented and discussed in Section 5.
We conclude the paper in Section 6.
B ACKGROUND
In this section, we provide a brief review of concepts related to the proposed work, including the
Wasserstein distance, (generalized) Radon transform and (generalized) sliced Wasserstein distances.
Wasserstein distance: Let P k (Ω) be a set of Borel probability measures with ﬁnite k -th moment on a Polish metric space (Ω ,d ) (Villani, 2008).
Given two probability measures µ , ν ∈ P k (Ω) , the
Wasserstein distance of order k ∈ [1 , + ∞ ) between µ and ν is deﬁned as:
[Equation]
where d ( · , · ) k is the cost function, Γ( µ,ν ) represents the set of all transportation plans γ , i.e. joint distributions whose marginals are µ and ν , respectively.
While the Wasserstein distance is generally intractable for high-dimensional distributions, there are several favorable cases where the optimal transport problem can be efﬁciently solved.
If µ and ν are continuous one-dimensional measures deﬁned on a linear space equipped with the L k norm,
the
Wasserstein distance between µ and ν has a closed-form solution (Peyré and Cuturi, 2019):
[Equation]
where F − 1 µ and F − 1 ν are inverse cumulative distribution functions (CDFs) of µ and ν , respectively.
In practice, Wasserstein distances W k (˜ µ, ˜ ν ) between one-dimensional empirical distributions ˜ µ = 1 N (cid:80)
Nn =
δ x n and ˜ ν
= 1 N (cid:80) Nn =1 δ y n can be computed by sorting one-dimensional samples from empirical distributions, and evaluating the distances between sorted samples (Kolouri et al., 2019b):
[Equation]
where N is the number of samples, I x [ n ] and I y [ n ] are the indices of sorted samples satisfying x I x [ n ] ≤ x I x [ n +1] and
y I y
[ n ] ≤ y I y
[ n +1] , respectively.
Radon transform and generalized Radon transform: The Radon transform (Radon, 1917) maps a function f ( · ) ∈ L 1 ( R d ) to the space of functions deﬁned over spaces of hyperplanes in R d .
The Radon transform of f ( · ) is deﬁned by line integrals of f ( · ) along all possible hyperplanes in R d :
[Equation]
where t ∈ R and θ ∈ S
d − 1 represent the parameters of hyperplanes { x ∈ R d | (cid:104)
x,θ (cid:105)
=
t }, δ ( · ) is the one-dimensional Dirac delta function, and (cid:104)· , ·(cid:105) refers to the Euclidean inner product.
By replacing the inner product (cid:104) x,θ (cid:105) in Equation (4) with β ( x,θ ) , a speciﬁc family of functions named as deﬁning function in (Kolouri et al., 2019a), the generalized Radon transform (GRT) (Beylkin, 1984) is deﬁned as integrals of f ( · ) along hypersurfaces deﬁned by { x ∈ R d | β ( x,θ )
= t }:
[Equation] [Equation]
where t ∈ R , θ ∈ Ω θ and Ω θ is a compact set of all feasible θ , e.g. Ω θ = S
d − 1 for β ( x,θ )
= (cid:104) x,θ (cid:105) .
In particular, a function β ( x,θ ) deﬁned on X × ( R d \{ 0 } ) with X ⊆ R d is called a deﬁning function of
GRTs if it satisﬁes conditions H.1 – H.4 given in (Kolouri et al., 2019a).
For probability measures µ ∈ P k ( R d ) , the Radon transform and the GRT can be employed as push-forward operators, and the generated push-forward measures R µ = R # µ , G µ = G # µ are deﬁned as follows (Bonneel et al., 2015):
[Equation]
Notably, the Radon transform is a linear bijection (Helgason, 1980), and the sufﬁcient conditions for
GRTs to be bijective are provided in (Homan and Zhou, 2017).
Sliced Wasserstein distance and generalized sliced Wasserstein distance:
By applying the Radon transform to µ and ν to obtain multiple projections, the sliced Wasserstein distance (SWD) decomposes the high-dimensional Wasserstein distance into multiple one-dimensional Wasserstein distances which can be efﬁciently evaluated (Bonneel et al., 2015).
The k -SWD between µ and ν is deﬁned by:
[Equation]
where the Radon transform R deﬁned by Equation (6) is adopted as the measure push-forward operator.
The GSWD generalizes the idea of SWD by slicing distributions with hypersurfaces rather than hyperplanes (Kolouri et al., 2019a).
The GSWD is deﬁned as:
[Equation]
where the GRT G deﬁned by Equation (7) is used as the measure push-forward operator.
From
Equation (3), with L random projections and N samples, the SWD and GSWD between µ and ν can be approximated by:
[Equation]
where I lx and I ly are sequences consisting of the indices of sorted samples which satisfy (cid:104) x
I lx [ n ] ,θ l (cid:105)≤ (cid:104) x
I lx [ n +1] , θ l (cid:105) , (cid:104)
y
I ly [ n ] , θ l (cid:105) ≤ (cid:104)
y
I ly [ n +1] , θ l (cid:105) in the SWD, and β ( x I lx [ n ] , θ l ) ≤ β ( x I lx [ n +1] , θ l ) , β ( y I ly [ n ] ,θ l ) ≤ β
( y I ly [ n +1] ,θ l ) in the GSWD.
The approximation error in estimating SWDs using
Equation (10) is derived in (Nadjahi et al., 2020).
It is proved in (Bonnotte, 2013) that the SWD is a valid distance metric.
The GSWD is a valid metric except for its neural network variant (Kolouri et al., 2019a).
A UGMENTED SLICED W ASSERSTEIN DISTANCES
In this section, we propose a new distance metric called the augmented sliced Wasserstein distance (ASWD), which embeds ﬂexible nonlinear projections in its construction.
We also provide an implementation recipe for the ASWD.
3. S PATIAL R ADON TRANSFORM AND AUGMENTED SLICED W ASSERSTEIN DISTANCE
In the deﬁnitions of the SWD and GSWD, the Radon transform (Radon, 1917) and the generalized
Radon transform (GRT) (Beylkin, 1984) are used as the push-forward operator for projecting distributions to a one-dimensional space.
However, it is not straightforward to design deﬁning functions β ( x,θ ) for the GRT, since one needs to ﬁrst check if β ( x,θ ) satisﬁes the conditions to be a deﬁning function (Kolouri et al., 2019a; Beylkin, 1984), and then whether the corresponding GRT is bijective or not (Homan and Zhou, 2017).
In practice, the assumption of the transform can be relaxed, as Theorem 1 shows that as long as the transform is injective, the corresponding ASWD metric is a valid distance metric.
To help us deﬁne the augmented sliced Wasserstein distance, we ﬁrst introduce the spatial Radon transform which includes the Radon transform and the polynomial GRT as special cases (See Remark 5).
Deﬁnition 1.
Given a measurable injective mapping g ( · ): R d → R d θ and a function f
( · ) ∈ L 1 ( R d ) , the spatial Radon transform of f ( · ) is deﬁned as
[Equation]
(12) where t ∈ R and θ ∈ S
d θ − 1 are the parameters of hypersurfaces { x ∈ R d | (cid:104) g
( x ) ,θ (cid:105) = t } .
Similar to the Radon transform and the GRT, the spatial Radon transform can also be used to generate push-forward measure H µ =
H # µ for µ ∈ P k ( R d ) as in Equations (6) and (7):
[Equation]
Remark 1.
Note that the spatial Radon transform can be interpreted as applying the vanilla Radon transform to ˆ µ g , where ˆ µ g refers to the push-forward measure g # µ , i.e given a measurable injective mapping g ( · ): R d → R d θ , the spatial Radon transform deﬁned by Equation (13) can be rewritten as:
[Equation]
Hence the spatial Radon transform inherits the theoretical properties of the Radon transform and incorporates nonlinear projections through g ( · ) .
In what follows, we use µ ≡ ν to denote probability measures
µ,ν ∈ P k ( R d ) that satisfy µ ( X )=
ν ( X ) for ∀X ⊆ R d .
Lemma 1.
Given an injective mapping g ( · ): R d → R d θ and two probability measures µ,ν ∈ P ( R d ) , for all t ∈ R and θ ∈ S d θ − 1 , H µ ( t,θ ; g ) ≡H ν ( t,θ ; g ) if and only if µ ≡ ν , i.e. the spatial Radon transform is an injection on P k ( R d ) .
Moreover, the spatial Radon transform is an injection on P k ( R d ) if and only if the mapping g ( · ) is an injection.
See Appendix A for the proof of Lemma 1.
We now introduce the augmented sliced Wasserstein distance, by utilizing the spatial Radon transform as the measure push-forward operator:
Deﬁnition 2.
Given two probability measures µ,ν ∈ P k
( R d ) and an injective mapping g ( · ): R d → R d θ , the augmented sliced Wasserstein distance (ASWD) of order k ∈ [1 , + ∞ ) is deﬁned as:
[Equation]
where θ ∈ S d θ − 1 , W k is the k -Wasserstein distance deﬁned by Equation (1), and H refers to the spatial
Radon transform deﬁned by Equation (13).
Remark 2.
Following the connection between the spatial Radon transform and the vanilla Radon transform as shown in Equation (14), the ASWD can be rewritten as:
[Equation]
where ˆ µ g and ˆ ν g are probability measures on R d θ which satisfy g ( x ) ∼ ˆ µ g for x ∼ µ and g ( y ) ∼ ˆ ν g for y ∼ ν .
Theorem 1.
The augmented sliced Wasserstein distance (ASWD) of order k ∈ [1 , + ∞ ) deﬁned by
Equation (15) with a mapping g ( · ): R d → R d θ is a metric on P k
( R d ) if and only if g ( · ) is injective.
The proof of Theorem 1 is provided in Appendix C. Theorem 1 shows that the ASWD is a metric given a ﬁxed injective mapping g ( · ) .
In practical applications, the mapping g ( · ) needs to be optimized to project samples onto discriminating hypersurfaces.
We show in Corollary 1.1 that the ASWD between µ and ν with the optimized g ( · ) is also a metric under mild conditions.
Corollary 1.1.
The augmented sliced Wasserstein distance (ASWD) of order k ∈ [1 , + ∞ ) between two probability measures µ,ν ∈ P k
( R d ) deﬁned by Equation (15) with the optimal mapping
[Equation]
is a metric on P k
( R d ) , where L
[Equation]
[Equation]
for λ
[Equation]
The proof of Corollary 1.1 is provided in Appendix D.
Remark 3.
Corollary 1.1 shows that given measures µ 1 ,µ 2 ,µ 3 ∈ P k ( R d ) , the triangle inequality holds for the ASWD when g ( · ) is optimized for each pair of measures, as shown in Appendix D.
It is worth noting that λ> 1 is a sufﬁcient condition for the ASWD to be a metric – as further discussed in Remark 6, 0 <λ ≤ 1 can also lead to ﬁnite
|| g ( x )
|| 2 in various scenarios, resulting in valid metrics.
The discussion on the impact of λ on the performance of the ASWD in practice can be found in Appendix G.2.
3. N UMERICAL IMPLEMENTATION
We discuss in this section how to realize injective mapping g ( · ) with neural networks due to their expressiveness and optimize it with gradient based methods.
Injective neural networks: As stated in Lemma 1 and Theorem 1, the injectivity of g ( · ) is the sufﬁcient and necessary condition for the ASWD being a valid metric.
Thus we need speciﬁc architecture designs on implementing g ( · ) by neural networks.
One option is the family of invertible neural networks (Behrmann et al., 2019; Karami et al., 2019), which are both injective and surjective.
However, the running cost of those models is usually much higher than that of vanilla neural networks.
We propose an alternative approach by concatenating the input x of an arbitrary neural network to its output φ ω ( x ) : g [Equation]
[Equation]
It is trivial to show that g ω ( x ) is injective, since different inputs will lead to different outputs.
Although embarrassingly simple, this idea of concatenating the input and output of neural networks has found success in preserving information with dense blocks in the DenseNet (Huang et al., 2017), where the input of each layer is injective to the output of all preceding layers.
Optimization objective: We aim to slice distributions with maximally discriminating hypersurfaces between two distributions while avoiding the projected samples being arbitrarily large, so that the projected samples between the compared distributions are ﬁnite and most dissimilar regarding the
ASWD, as shown in Figure 1.
Similar ideas have been employed to identify important projection directions (Deshpande et al., 2019; Kolouri et al., 2019a; Paty and Cuturi, 2019) or a discriminative ground metric (Salimans et al., 2018) in optimal transport metrics.
For the ASWD, the parameterized injective neural network g ω ( · ) is optimized by maximizing the following objective:
[Equation]
where λ> 0 and the regularization term L ( µ,ν,λ
[Equation]
g ω
[Equation]
y )
|| k
[Equation]
) on the magnitude of the neural network’s output is used, otherwise the projections may be arbitrarily large.
Remark 4.
The regularization coefﬁcient λ adjusts the introduced non-linearity in the evaluation of the ASWD by controlling the norm of φ ω ( · ) in Equation (18).
In particular, when λ →∞ , the nonlinear term φ ω ( · ) shrinks to 0 .
The intrinsic dimension of the augmented space, i.e. the number of non-zero dimensions in the augmented space, is hence explicitly controlled by the ﬂexible choice of φ ω ( · ) and implicitly regularized by L ( µ,ν,λ ; g ω ) .
By plugging the optimized g ∗ ω,λ ( · ) = argmax g ω
( L ( µ, ν ; g ω , λ )) into Equation (15), we obtain the empirical version of the ASWD.
Pseudocode is provided in Appendix E.
R ELATED WORK
Recent work on slice-based Wasserstein distances mainly focused on improving their projection efﬁciency, leading to a reduced number of projections needed to capture the structure of data distributions (Kolouri et al., 2019a; Nguyen et al., 2021).
The GSWD proposes using nonlinear projections to achieve this goal, and it has been proved to be a valid distance metric
if
and only if they adopt injective GRTs, which only include the circular functions and a ﬁnite number of harmonic polynomial functions with odd degrees as their feasible deﬁning functions (Ehrenpreis, 2003).
While the GSWD has shown impressive performance in various applications (Kolouri et al., 2019a), its deﬁning function is restricted to the aforementioned limited class of candidates.
In addition, the selection of deﬁning function is usually task-dependent and needs domain knowledge, and the impact on performance from different deﬁning functions is still unclear.
To tackle those limitations, (Kolouri et al., 2019a) proposed the GSWD-NN, which directly takes the outputs of a neural network as its projection results without using the standard Radon transform or GRTs.
However, this brings three side effects: 1)
The number of projections, which equals the number of nodes in the neural network’s output layer, is ﬁxed, thus new neural networks are needed if one wants to change the number of projections.
There is no random projections involved in the
GSWD-NN, as the projection results are determined by the inputs and weights of the neural network.
The GSWD-NN is a pseudo-metric since it uses a vanilla neural network, rather than Radon transform or GRTs, as its push-forward operator.
Therefore, the GSWD-NN does not ﬁt into the theoretical framework of GSWD and does not inherit its geometric properties.
Another notable variant of the SWD is the distributional sliced Wasserstein distance (DSWD)
(Nguyen et al., 2021).
By ﬁnding a distribution of projections that maximizes the expected distances over these projections, the DSWD can slice distributions from multiple directions while having high projection efﬁciency.
Injective GRTs are also used to extend the DSWD to the distributional generalized sliced
Wasserstein distance (DGSWD) (Nguyen et al., 2021).
Experiment results show that the DSWD and the DGSWD have superior performance in generative modelling tasks (Nguyen et al., 2021).
However, neither the DSWD nor the DGSWD have solved the problem with the GSWD, i.e. they are still not able to produce nonlinear projections adaptively.
Ourcontributiondiffersfrompreviousworkinthreeways: 1)TheASWDisdata-adaptive, i.e. thehypersurfaces where high-dimensional distributions are projected onto can be learned from data.
This implies one does not need to specify a deﬁning function from limited choices.
Unlike GSWD-NN, the ASWD takes a novel direction to incorporate neural networks into the framework of sliced-based Wasserstein distanceswhilemaintainingthepropertiesofslicedWassersteindistances.
3)Previousworkonintroducing nonlinear projections into Radon transform either is restricted to only a few candidates of deﬁning functions (GRTs) or breaks the framework of Radon transforms (neural networks in GSWD-NN), in contrast, the spatial Radon transform provides a novel way of deﬁning nonlinear Radon-type transforms.
E XPERIMENTS
In this section, we describe the experiments that we have conducted to evaluate performance of the proposed distance metric.
The GSWD leads to the best performance in a sliced Wasserstein ﬂow problem reported in (Kolouri et al., 2019a) and the DSWD outperforms the compared methods in the generative modeling task examined in (Nguyen et al., 2021) on CIFAR 10 (Krizhevsky, 2009),
CelebA (Liu et al., 2015), and MNIST (LeCun et al., 1998) datasets (Appendix H.2).
Hence, we compare performance of the ASWD with the state-of-the-art distance metrics in the same examples and report results as below 1 .
We provide additional experiment results in the appendices, including a sliced Wasserstein autoencoder (SWAE)
(Kolouri et al., 2019b) using the ASWD (Appendix I), image color transferring (Appendix J) and sliced Wasserstein barycenters (Appendix K).
To examine the robustness of the ASWD, throughout the experiments, we adopt the injective network architecture given in Equation (18) and set φ ω to be a single fully-connected layer neural network whose output dimension equals its input dimension, with a ReLU layer as its activation function.
The order k is set to be 2 in all experiments.
5. S LICED W ASSERSTEIN FLOWS
We ﬁrst consider the problem of evolving a source distribution µ to a target distribution ν by minimizing slice-based Wasserstein distances between µ and ν in the sliced Wasserstein ﬂow task reported in (Kolouri et al., 2019a).
[Equation]
where µ t refers to the updated source distribution at each iteration t .
The SWD in Equation (20) can be replaced by other sliced-Wasserstein distances to be evaluated.
As in (Kolouri et al., 2019a), the 2-Wasserstein distance was used as the metric for evaluating performance of different distance metrics in this task.
The set of hyperparameter values used in this experiment can be found in Appendix F.1.
Without loss of generality, we initialize µ 0 to be the standard normal distribution N (0 ,I ) .
We repeat each experiment 50 times and record the 2-Wasserstein distance between µ and ν at every iteration.
In
Figure 2, we plot the 2 -Wasserstein distances between the source and target distributions as a function of the training epochs and the 8-Gaussian, the Knot, the Moon, and the Swiss roll distributions are respective target distributions.
For clarity, Figure 2 displays the experiment results from the 6 best performing distance metrics, including the ASWD, the DSWD, the SWD, the GSWD-NN 1, which directly generates projections through a one layer MLP, as well as the GSWD with the polynomial of degree 3, circular deﬁning functions, out of the 12 distance metrics we compared.
We observe from Figure 2 that the ASWD not only leads to smaller 2-Wasserstein distances, but also converges faster by achieving better results with fewer iterations than the other methods in these four target distributions.
A complete set of experimental results with 12 compared distance metrics and 8 target distributions are included in Appendix G.1.
The ASWD outperforms the compared state-of-the-art sliced-based Wasserstein distance metrics with 7 out of the 8 target distributions except for the 25-Gaussian.
This is achieved through the simple injective network architecture given in
Equation (18) and a one layer fully-connected neural network with equal input and output dimensions throughout the experiments.
In addition, ablation study is conducted to study the effect of injective neural networks, the regularization coefﬁcient λ , the choice of the dimensionality d θ of the augmented space, and the optimization of hypersurfaces in the ASWD.
Details can be found in Appendix G.2.
5. G ENERATIVE MODELING
In this experiment, we use sliced-based Wasserstein distances for a generative modeling task described in (Nguyen et al., 2021).
The task is to generate images using generative adversarial networks (GANs) (Goodfellow et al., 2014) trained on either the CIFAR10 dataset (64 × 64 resolution)
(Krizhevsky, 2009) or the CelebA dataset (64 × 64 resolution) (Liu et al., 2015).
Denote the hidden layer and the output layer of the discriminator by h ψ and D Ψ , and the generator by G Φ , we train GAN models with the following objectives:
[Equation]
where p z is the prior of latent variable z and p r is the distribution of real data.
The SWD in Equation (21) is replaced by the ASWD and other variants of the SWD to compare their performance.
The
[Table]
GSWD with the polynomial deﬁning function and the DGSWD is not included in this experiment due to its excessively high computational cost in high-dimensional space.
The Fréchet Inception Distance (FID score) (Heusel et al., 2017) is used to assess the quality of generated images.
More details on the network structures and the parameter setup used in this experiment are available in Appendix F.2.
We run 200 and 100 training epochs to train the GAN models on the CIFAR10 and the CelebA dataset, respectively.
Each experiment is repeated for 10 times and results are reported in Table 1.
With the same number of projections and a similar computation cost, the ASWD leads to signiﬁcantly improved FID scores among all evaluated distances metrics on both datasets, which implies that images generated with the ASWD are of higher qualities.
Figure 3 plots the FID scores recorded during the training process.
The GAN model trained with the ASWD exhibits a faster convergence as it reaches smaller FID scores with fewer epochs.
Randomly selected samples of generated images are presented in Appendix H.1.
C ONCLUSION
We proposed a novel variant of the sliced Wasserstein distance, namely the augmented sliced
Wasserstein distance (ASWD), which is ﬂexible, has a high projection efﬁciency, and generalizes well.
The ASWD adaptively updates the hypersurfaces used to slice compared distributions by learning from data.
We proved that the ASWD is a valid distance metric and presented its numerical implementation.
We reported empirical performance of the ASWD over state-of-the-art sliced Wasserstein metrics in various numerical experiments.
We showed that ASWD with a simple injective neural network architecture can lead to the smallest distance errors over the majority of datasets in a sliced Wasserstein ﬂow task and superior performance in generative modeling tasks involving GANs and VAEs.
We have also evaluated the applications of the ASWD in downstream tasks including color transferring and Wasserstein barycenters.
What remains to be explored includes the topological properties of the
ASWD.
We leave this topic as an interesting future research direction.
A PPENDIX A P ROOF OF THE L EMMA
We prove that the spatial Radon transform deﬁned with a measurable mapping g ( · ): R d → R d θ is an injection on P k
( R d ) if and only if g ( · ) is injective.
In the following contents, we use P k ( R d ) to denote a set of Borel probability measures with ﬁnite k -th moment on R d , and f 1 ≡ f 2 is used to denote functions
f 1 ( · ): X → R and f 2 ( · ): X → R that satisfy f 1 ( x )= f 2 ( x ) for ∀ x ∈ X , and f 1 (cid:54)≡ f 2 is used to denote functions
f 1 ( · ) :
X → R and f 2 ( · ) :
X → R that satisfy f 1 ( x ) (cid:54) =
f 2 ( x ) for certain x ∈ X .
In addition, for probability measures µ and ν , we use µ ≡ ν to denote
µ,ν ∈ P k
( R d ) that satisfy µ ( X )=
ν ( X ) for ∀X ⊆ R d , and µ (cid:54)≡ ν to denote
µ,ν ∈ P k
( R d ) that satisfy µ ( X ) (cid:54) =
ν ( X ) for certain X ⊆ R d .
Proof.
By using proof by contradiction, we ﬁrst prove that if g ( · ) is injective, the corresponding spatial Radon transform is injective.
If the spatial Radon transform deﬁned with an injective mapping g ( · ) : R d → R d θ is not injective, there exist µ , ν ∈ P k ( R d ) , µ (cid:54)≡ ν ,
such that H µ ( t,θ ; g ) ≡ H ν
( t,θ ; g ) for ∀ t ∈ R and ∀ θ
∈ S d θ − 1 .
From Equation (14), for ∀ t ∈ R and ∀ θ ∈ S d θ − 1 , the spatial Radon transform of µ can be written as:
[Equation]
[Equation]
[Equation]
where ˆ µ g and ˆ ν g refer to the push-forward measures g # µ and g # ν , respectively.
From the assumption
H µ ( t,θ ; g ) ≡ H ν ( t,θ ; g ) and Equations (23) and (24), we know R ˆ µ g ( t,θ )
≡ R ˆ ν g ( t,θ ) for ∀ t ∈ R and ∀ θ ∈ S
d θ − 1 , which implies ˆ µ g ≡ ˆ ν g since the Radon transform is injective.
Since g ( · ) is injective, for all measurable X ⊆ R d , x ∈X if and only if ˆ x = g ( x ) ∈ g ( X ) , which implies
P ( x ∈X )=
P (ˆ x ∈ g
( X )) , P ( y ∈X )=
P (ˆ y ∈ g
( X )) .
Therefore,
[Equation]
Since ˆ µ g ≡ ˆ ν g , from Equations (25) and (26) we have: (cid:82) X dµ = (cid:82) X dν for ∀X ⊆ R d .
Hence, for ∀X ⊆ R d : (cid:90)
X d ( µ − ν )
=0 , (27) which implies µ ≡ ν , contradicting with the assumption µ (cid:54)≡ ν .
Therefore, if H µ ≡ H ν , µ ≡ ν .
In addition, from the deﬁnition of the spatial Radon transform in Equation (13), it is trivial to show that if µ ≡ ν , H µ ( t,θ ; g ) ≡ H ν ( t,θ ; g ) .
Therefore, H µ ≡ H ν
if and only if µ ≡ ν , i.e. the spatial Radon transform H deﬁned with an injective mapping g ( · ): R d → R d θ is injective.
We now prove that if the spatial Radon transform deﬁned with a mapping g ( · ) : R d → R d θ is injective, g ( · ) must be injective.
Again, we use proof by contradiction.
If g ( · ) is not injective, there exist x 0 ,y
∈ R
d such that x 0 (cid:54) =
y 0 and g ( x 0 ) =
g ( y 0 ) .
For Dirac measures µ 1 and ν 1 deﬁned by µ 1 ( X )= (cid:82) X δ ( x − x 0 ) dx and ν 1 ( Y )
= (cid:82) Y δ
( y − y 0 ) dy , where X , Y ⊆
R d , we know µ 1 (cid:54)≡ ν 1 as x 0 (cid:54) =
y 0 .
We deﬁne variables x ∼ µ 1 and y ∼ ν 1 .
Then for variables ˆ x = g ( x ) ∼ µ
and ˆ y = g ( y ) ∼ ν 2 , where µ 2 and ν 2 are push-forward measures g # µ 1 and g
# ν 1 , it is trivial to derive for ∀X , Y ⊆
R d
[Equation] [Equation]
29) which implies µ 2 ≡ ν 2 as g ( x 0 )=
g ( y 0 ) .
From Equations (23), (24), (28) and (29), for ∀ t ∈ R and ∀ θ ∈ S
d
θ − 1 :
[Equation]
contradicting with the assumption that the spatial Radon transform is injective.
Therefore, if the spatial
Radon transform is injective, g ( · ) must be injective.
We conclude that the spatial Radon transform is injective if and only if the mapping g ( · ) is an injection on P k ( R d ) .
A PPENDIX B S PECIAL CASES OF SPATIAL R ADON TRANSFORMS
Remark 5.
The spatial Radon transform degenerates to the vanilla Radon transform when the mapping g ( · ) is an identity mapping.
In addition, the spatial Radon transform is equivalent to the polynomial
GRT (Ehrenpreis, 2003) when g ( x )=( x
α 1 ,...,x α dα ) , where α is multi-indices α i =( η i, 1 ,...,η i,d ) ∈ N d satisfying | α i | = (cid:80) dj
=
1 η i,j = m .
m is the degree of the polynomial function, x α i =
(cid:81)
dj
=1 x η i,j j given an input x =( x 1 ,...,x d ) ∈ R d , and d α is the number of all possible multi-indices α i that satisﬁes | α i | = m .
We provide a proof for the claim in Remark 5.
Proof.
Given a probability measure µ ∈ P ( R d ) , the spatial Radon transform of µ is deﬁned as:
[Equation]
(31) where t ∈ R and θ ∈ S
d θ − 1 are the parameters of hypersurfaces in R d .
When the mapping g ( · ) is an identity mapping, i.e. g ( x ) =
x for ∀ x ∈ R d , the spatial Radon transform degenerates to the vanilla
Radon transform:
[Equation]
For GRTs, (Ehrenpreis, 2003) provides a class of injective GRTs named polynomial GRTs by adopting homogeneous polynomial functions with an odd degree m as the deﬁning function:
[Equation]
(33) where α i =( η i, 1 ,...,η i,d ) ∈ N d , | α i | = (cid:80) dj
=
1 η i,j , x α i = (cid:81) dj
=1 x η i,j j for x =( x 1 ,...,x d ) ∈ R d , d α is the number of all possible multi-indices α i that satisﬁes | α i | = m , and θ =( θ 1 ,...,θ d α ) ∈
S d α − 1 .
In spatial Radon transform, for ∀ x ∈ R d , when the mapping g ( · ) is deﬁned as:
[Equation]
34) the spatial Radon transform is equivalent to the polynomial GRT deﬁned in Equation (33):
[Equation]
A PPENDIX C P ROOF OF T HEOREM
We provide a proof that the ASWD deﬁned with a mapping g ( · ): R d → R d θ is a metric on P k
( R d ) , if and only if g ( · ) is injective.
In what follows, we denote a set of Borel probability measures with ﬁnite k -th moment on R d by P k
( R d ) , and use µ,ν ∈ P k ( R d ) to refer to two probability measures deﬁned on R d .
Proof.
Symmetry:
Since the k -Wasserstein distance is a metric thus symmetric (Villani, 2008):
[Equation]
Therefore,
[Equation]
Triangle inequality: Given an injective mapping g ( · ) :
R d → R d θ and probability measures µ 1 , µ 2 , µ 3 ∈ P k
( R d ) , since the k -Wasserstein distance satisﬁes the triangle inequality (Villani, 2008)
[Equation]
the following inequality holds:
[Equation]
where the second inequality is due to the Minkowski inequality in L k ( S d θ − 1 )
[Equation]
Identity of indiscernibles: Since W k ( µ,µ )=
for ∀ µ ∈ P k
( R d ) ,we have
[Equation]
for ∀ µ ∈ P k ( R d ) .
Conversely, for ∀ µ,ν ∈ P k
( R d ) , if ASWD k ( µ,ν ; g ) = 0 , from the deﬁnition of the
ASWD:
[Equation]
k =0 , (38)
Due to the non-negativity of k -th Wasserstein distance as it is a metric on P k
( R d ) and the continuity of W k ( · , · ) on P k
( R d ) (Villani, 2008), W k (cid:0) H µ ( · ,θ ; g ) , H ν ( · ,θ ; g ) (cid:1) =0 holds for ∀ θ ∈
S
d θ − 1 if and only if H µ ( · ,θ ; g ) ≡H ν ( · ,θ ; g ) .
Again, given the spatial Radon transform is injective when g ( · ) is injective (see the proof in Appendix A), H µ ( · ,θ ; g ) ≡H ν
( · ,θ ; g ) implies µ ≡ ν if g ( · ) is injective.
In addition, if g ( · ) is not injective, the spatial Radon transform is not injective (see the proof in Appendix
A), then ∃ µ, ν ∈ P k ( R d ) , µ (cid:54)≡ ν such that H µ ( · ,θ ; g ) ≡H ν ( · ,θ ; g ) , which implies ASWD k ( µ,ν ; g )=
for µ (cid:54)≡ ν .
Therefore, the ASWD satisﬁes the identity of indiscernibles if and only if g ( · ) is injective.
Non-negativity: The three axioms of a distance metric, i.e. symmetry, triangle inequality, and identity of indiscernibles imply the non-negativity of the ASWD.
Since the Wasserstein distance is non-negative, for ∀ µ ,ν ∈ P k ( R d ) , it can also be straightforwardly proved the ASWD between µ and ν is non-negative:
[Equation]
Therefore, the ASWD is a metric on P k
( R d ) if and only if g ( · ) is injective.
A PPENDIX D P ROOF OF C OROLLARY 1.
We ﬁrst introduce Lemma 2 to support the proof of Corollary 1.1.
Lemma 2.
For λ ∈ (1 , + ∞ ) , the optimal mapping g ∗ ( · ) deﬁned by Equation (17) satisﬁes || g ∗ ( x ) || 2 < ∞ for ∀ x ∈ R
d ∼ µ and ∀ x ∈ R d ∼ ν .
Proof.
Recall that in Equation (16) the ASWD can be rewritten as:
[Equation]
where transformed variables ˆ x = g ( x ) ∼ ˆ µ g for x ∼ µ and ˆ y =
g ( y ) ∼ ˆ ν g for y ∼ ν , respectively.
Combining the equation above with Equation (2):
[Equation]
where # denotes the push forward operator, P θ : x ∈ R d θ →(cid:104)
x,θ (cid:105)∈ R , and R θ (ˆ µ g )=
P θ #ˆ µ g , R θ (ˆ ν g )=
P θ #ˆ ν g refer to one-dimensional measures obtained by slicing ˆ µ g , ˆ ν g with a unit vector θ , F − 1 R θ (ˆ µ g ) and
F − 1 R θ (ˆ ν g ) are inverse cumulative distribution functions (CDFs) of R θ (ˆ µ g ) and R θ
(ˆ ν g ) , respectively.
By repeatedly applying the Minkowski’s inequality to Equation (41), we obtain the following inequalities:
[Equation]
Let s = (cid:104)
ˆ x,θ (cid:105) , then z = F R θ (ˆ µ g ) ( s ) , dz
[Equation]
where the last two equations are obtained through the deﬁnitions of the push-forward operators
[Equation]
Therefore
[Equation]
the following inequalities hold:
[Equation]
Then we obtain the following inequalities for the optimization objective:
[Equation]
When we set λ ∈ (1 , + ∞ ) , if ∃ x ∈ R d ∼ µ or y ∈ R
d ∼ ν such that || g ( x ) || 2 → ∞ or || g ( y ) || 2 → ∞ , the optimization objective approaches negative inﬁnity, implying g ( · ) is not the optimal mapping.
Therefore, by adopting Equation (17) as the optimization objective, the optimal mapping g ∗ ( · ) satisﬁes || g ∗ ( x ) || 2 < ∞ for ∀ x ∈ R d ∼ µ and ∀ x ∈ R d ∼ ν .
Remark 6.
It is worth noting that λ> 1 in Corollary 1.1 is a sufﬁcient condition for the supremum of the optimization objective to be non-positive and || g ∗ ( x ) || 2 < ∞ for ∀ x ∈ R d ∼ µ and ∀ x ∈ R d ∼ ν .
0 < λ ≤ 1 can also lead to ﬁnite
|| g ( x )
|| 2 in various scenarios.
Speciﬁcally, the upper bound of the optimization objective given in Equation (44) is obtained by applying:
[Equation]
where α is the angle between θ and g ( x ) .
In high-dimensional spaces, Equation (46) gives a very loose bound since in high-dimensional spaces the majority of sampled θ would be nearly orthogonal to g ( x ) and cos( α ) is nearly zero with high probability (Kolouri et al., 2019a).
Empirically we found that across all the experiment results, λ in a candidate set of { 0 . 01 , 0 . 05 , 0 . 1 , 0 . 5 , 1 , 10 , 100 } all lead to ﬁnite g ∗ ( · ) .
We now prove Corollary 1.1, i.e ASWD k ( µ,ν ; g ∗ ) is a metric on P k
( R d ) , where g ∗ ( · ) is the optimal mapping deﬁned by Equation (17) for λ ∈ (1 , + ∞ ) .
Proof.
Symmetry:
Since the k -Wasserstein distance is a metric thus symmetric (Villani, 2008):
[Equation] [Equation]
Therefore,
[Equation]
Triangle inequality: From Lemma 2, when λ ∈ (1 , + ∞ ) , the optimal mapping g ∗ ( · ) satisﬁes || g ∗ ( x ) || 2 < ∞ for ∀ x ∈ R
d ∼ µ and ∀ x ∈ R d ∼ ν , hence ASWD k ( ν,µ ; g ∗ ) is ﬁnite due to Equation (16).
We then prove that ASWD k ( ν,µ ; g ∗ ) satisﬁes the triangle inequality.
Denote by g ∗ 1 , g ∗ 2 , and g ∗ 3 optimal mappings that result in the supremum of Equation (19) between µ 1 and µ 2 , µ 1 and µ 3 , µ 2 and µ 3 , respectively, since ASWD k ( µ 1 ,µ 2 ; g ∗ 1 ) , ASWD k ( µ 1 ,µ 3 ; g ∗ 2 ) , and
ASWD k ( µ 2 ,µ 3 ; g ∗ 3 ) are ﬁnite, the following equations hold:
[Equation]
where the ﬁrst inequality are from the metric property of the ASWD.
Identity of indiscernibles: Since W k ( µ,µ )=
for ∀ µ ∈ P k
( R d ) ,we have
[Equation]
for ∀ µ ∈ P k ( R d ) .
Conversely, for ∀ µ,ν ∈ P k
( R d ) , if ASWD k ( µ,ν ; g ∗ )
=0 , from Equation (15):
[Equation]
Due to the non-negativity of k -th Wasserstein distance as it is a metric on P k
( R d ) and the continuity of W k ( · , · ) on P k
( R d ) (Villani, 2008), W k (cid:0) H µ ( · ,θ ; g ∗ ) , H ν ( · ,θ ; g ∗ ) (cid:1)
=0 holds for ∀ θ ∈
S
d θ − 1 , which implies H µ ( · ,θ ; g ∗ ) ≡ H ν ( · ,θ ; g ∗ ) for ∀ θ
∈ S d θ − 1 .
Therefore, given the spatial Radon transform is injective when g ∗ ( · ) is injective, H µ ( · ,θ ; g ∗ ) ≡H ν
( · ,θ ; g ∗ ) implies µ ≡ ν .
Non-negativity: Since the Wasserstein distance is non-negative, for ∀ µ ,
ν ∈ P k ( R d ) , the ASWD deﬁned with optimal mappings g ( · ) between µ and ν is also non-negative:
[Equation]
Therefore, the ASWD deﬁned with the optimal mapping g ∗ ( · ) is non-negative, symmetric, and satisﬁes the triangle inequality and the identity of indiscernibles, i.e. the ASWD deﬁned with optimal mappings g ∗ ( · ) is also a metric.
A PPENDIX E P SEUDOCODE FOR THE EMPIRICAL VERSION OF THE ASWD
Require:
Sets of samples { x n ∈ R d } Nn =1 , { y n ∈ R d } Nn =1 ;
Require: Randomly initialized injective neural network g ω ( · ): R d → R d θ ;
Require: Number of projections L , hyperparameter λ , learning rate (cid:15) , number of iterations M ; 1: Initialize D =0 ,L λ =0 ,m =1 ; 2: while ω has not converged and m ≤ M do 3:
Draw a set of samples { θ l } Ll =1 from ∈ S d θ − 1 ; 4: for n =1 to N do 5:
Compute g ω ( x n ) and g ω ( y n ) ; 6:
Calculate the regularization term L λ ← L λ + λ (cid:2) ( || g ω ( x n ) || k 2 N ) 1 k +( || g ω ( y n ) || k 2 N ) 1 k (cid:3) ; 7: end for 8: for l =1 to L do 9:
Compute β ( x n ,θ l )=
(cid:104) g ω ( x n ) ,θ l (cid:105) , β ( y n ,θ l )=
(cid:104)
g ω ( y n ) ,θ l (cid:105) for each n ; 10:
Sort β ( x n ,θ l ) and β ( y n ,θ l ) in ascending order s.t. β
( x I lx [ n ] ,θ l ) ≤ β ( x I lx [ n +1] ,θ l ) and β ( y I ly [ n ] ,θ l ) ≤ β ( y I ly [ n +1] ,θ l ) ; 11:
Calculate the ASWD: D ← D +( 1 L (cid:80) Nn =1 | β ( x I lx [ n ] ,θ l ) − β ( y I ly [ n ] ,θ l ) | k
In Algorithm 1, Equation (17) is used as the optimization objective, where the regularization term
L ( µ,ν,λ ; g ω )
=
λ ( E 1 k x ∼ µ (cid:2)
|| g ω
x ) || k 2 (cid:3) + E 1 k y ∼ ν (cid:2)
||
g ω
( y ) ||
k 2 (cid:3) ) is used.
This particular choice of the regularization term facilitates the proofs to Lemma 2 and subsequently to Corollary 1.1 with details in Appendix D.
In fact, we have also examined other types of regularization terms such as the L 2 norm of the output of g ( · ) , and empirically they produce similar numerical results as the current regularization term.
A PPENDIX F E XPERIMENTAL SETUPS F. H YPERPARAMETERS IN THE SLICED W ASSERSTEIN FLOW EXPERIMENT
We randomly generate 500 samples both for target distributions and source distributions.
We initialize the source distributions µ 0 as standard normal distributions N (0 ,I ) , where I is a 2-dimensional identity matrix.
We update source distributions using Adam optimizer, and set the learning rate=0.002.
For all methods, we set the order k = 2 .
When testing the ASWD, the number of iterations M in
Algorithm 1 is set to 10.
In the sliced Wasserstein ﬂow experiment the mapping g ∗ ( · ) optimized by maximizing Equation (17) was found to be ﬁnite for all values of λ in the set of {0.01, 0.05, 0.1, 0.5, 1, 10, 100}, which is a sufﬁcient condition for the ASWD to be a valid metric as shown in the proof of corollary 1.1 provided in Appendix D.
In addition, numerical results presented in Appendix G.2 indicate that empirical errors in the experiment are not sensitive to the choice of λ in the candidate set {0.01, 0.05, 0.1, 0.5}.
The reported results in the main paper are produced with λ =0 .
F. N ETWORK ARCHITECTURE IN THE GENERATIVE MODELING EXPERIMENT
Denote a convolutional layer whose kernel size is s with C kernels by Conv C ( s × s ) , and a fully-connected layer whose input and output layer have s 1 and s 2 neurons by FC ( s 1 × s 2 ) .
The network structure used in the generative modeling experiment is conﬁgured to be the same as described in (Nguyen et al., 2021):
h ψ :(64 × 64 × 3) → Conv 64 (4 × 4) → LeakyReLU (0 . 2)
→ Conv 128 (4 × 4)
→ BatchNormalization → LeakyReLU (0 . 2) → Conv 256 (4 × 4) →
BatchNormalization → LeakyReLU (0 . 2) → Conv 512 (4 × 4)
→ BatchNormalization → Tanh Output −−−→ (512 × 4 × 4) D Ψ : Conv 1 (4 × 4) → Sigmoid Output −−−→ (1 × 1 × 1) G Φ : z ∈ R 100 → ConvTranspose 512 (4 × 4) →
BatchNormalization → ReLU → ConvTranspose 256 (4 × 4) → BatchNormalization → ReLU → ConvTranspose 128 (4 × 4) →
BatchNormalization → ReLU → ConvTranspose 64 (4 × 4) →
BatchNormalization → ConvTranspose 3 (4 × 4) → Tanh Ouput −−−→ (64 × 64 × 3) φ : FC (8192 × 8192)
Output −−−→ (8192) -dimensional
vector
We train the models with the Adam optimizer, and set the batch size to 512 .
Following the setup in (Nguyen et al., 2021), the learning rate is set to 0 . 0005 and beta=(0.5, 0.999) for both CIFAR dataset and CelebA dataset.
For all methods, we set the order k to 2 .
For the ASWD, the number of iterations M in Algorithm 1 is set to 5.
The hyperparameter λ is set to 1.01 to guarantee that
the
ASWD being a valid metric and introduce slightly larger regularization of the optimization objective due to the small output values from the feature layer h ψ .
A PPENDIX G A DDITIONAL RESULTS IN THE SLICED W ASSERSTEIN FLOW EXPERIMENT G. F ULL EXPERIMENTAL RESULTS ON THE SLICED W ASSERSTEIN EXPERIMENT
Figure 4 shows the full experimental results on the sliced Wasserstein ﬂow experiment.
G. A BLATION STUDY Impact of the injectivity and optimization of the mapping
In this ablation study, we compare ASWDs constructed by different mappings to GSWDs with different predeﬁned deﬁning functions, and investigate the effects of the optimization and injectivity of the adopted mapping g ω ( · ) used in the ASWDs.
In what follows, “ASWD-vanilla" is used to denote
ASWDs that employ randomly initialized neural network φ ω ( · ) to parameterize the injective mapping g ω ( · ) =
[ · ,φ ω ( · )] , i.e. the mapping g ω ( · ) is not optimized in the ASWD-vanilla and the results of
ASWD-vanilla reported in Figure 5 are obtained by slicing with random hypersurfaces.
Furthermore, the “ASWD-non-injective" refers to ASWDs that do not use the injectivity trick, i.e. the mapping g ω ( · )=
φ ω ( · ) is not guaranteed to be injective.
In addition, the “ASWD-vanilla-non-injective" adopts both setups in the “ASWD-vanilla" and "ASWD-non-injective", resulting in a random non-injective mapping g ω ( · ) .
The reported experiment results in this ablation study is calculated over 50 runs, and the neural network φ ω ( · ) is reinitialized randomly in each run.
From Figure 5, it can be observed that the ASWD-vanilla shows comparable performance to GSWDs deﬁned by polynomial and circular deﬁning functions, which implies GSWDs with predeﬁned deﬁning functions are as uninformative as slicing distributions with random hypersurfaces constructed by the
ASWD.
In GSWDs, the hypersurfaces are predeﬁned and cannot be optimized since they are determined by the functional forms of the deﬁning functions.
On the contrary, we found that the optimization of hypersurfaces in the ASWD framework can help improve the performance of the slice-based
Wasserstein distance.
As in Figure 5, the ASWD and the ASWD-non-injective present signiﬁcantly better performance than methods that do not optimize their hypersurfaces (ASWD-vanilla, ASWDvanilla-non-injective, and GSWDs).
In terms of the impact of the injectivity of the mapping g ω , in this experiment, the ASWD-vanilla exhibits smaller 2-Wasserstein distances than the ASWD-vanilla-noninjective in all tested distributions, and the ASWD leads to more stable training than the ASWD-noninjective.
Therefore, theinjectivityofthemapping g ω ( · ) doesnotonlyguaranteetheASWDtobeavalid distance metric as proved in Section 3, but also better empirical performance in this experiment setup.
Impact of the regularization coefﬁcient
We also evaluated the sensitivity of performance of the ASWD with respect to the regularization coefﬁcient λ .
The ASWD is evaluated with different values of λ and compared with other slice-based
Wasserstein metrics in this ablation study.
The numerical results presented in Figure 6 indicates that different values of λ in the candidate set {0.01, 0.05, 0.1, 0.5} lead similar performance of the ASWD, i.e the performance of the ASWD is not sensitive to λ .
Additionally, the ASWDs with different values of λ in the candidate set outperform the other evaluated slice-based Wasserstein metrics.
We have also evaluated the performance of the ASWD when the range of λ is much larger than in the candidate set.
Speciﬁcally, as presented in Figure 7, when λ is set to be large values, e.g 10 or 100, the resulted ASWD leads to decreased performance on par with the SWD.
This is consistent with our expectation that excessive regularization will eliminate nonlinearity as discussed in Remark 2, leading to similar performance with the SWD.
In addition, the effect of the regularization term on the performance of Max-GSWD-NN was also investigated in this ablation study.
The performance of the Max-GSWD-NN and the Max-GSWD-NN trained with the regularization term used in the ASWD are compared in Figure 8.
From the numerical results presented in Figure 8, the Max-GSWD-NN 1 with regularization leads to performance similar to the Max-GSWD-NN 1 without regularization, implying that the performance gap between the
ASWD and the Max-GSWD-NN is not due to the introduction of the regularization term.
Choice of injective mapping
We reported in Figure 9 the performance of the ASWD deﬁned with other types of injective mappings other than Equation (18).
In particular, we examined two invertible mappings, including the planar ﬂow and radial ﬂow (Rezende and Mohamed, 2015), as alternatives to the injective mapping deﬁned by
Equation(18).
ThenumericalresultspresentedinFigure9showthattheASWDdeﬁnedwithplanarﬂow and radial ﬂow produced better performance than GSWD variants in most setups.
They exhibit slightly worse performance compared with the ASWD with injective mapping deﬁned in Equation (18), possibly due to the additional restriction in invertible mapping imposed by the planar ﬂow and radial ﬂow.
Choice of the dimensionality d θ of the augmented space
To investigate how the dimensionality d θ of the augmented space affects the performance of the
ASWD, different choices of d θ are employed in the ASWD.
Speciﬁcally, the injective network architecture g ω ( x ) =
[ x,φ ω ( x )] : R d → R d θ given in Equation (18) is adopted and φ ω is set to be single fully-connected neural networks whose output dimension equals {1, 2, 3, 4} times its input dimension, i.e d θ = { 2 d, 3 d, 4 d, 5 d } , respectively, where d is the dimensionality of x .
The numerical results are presented in Figure 10, and it can be found that the ASWDs present similar results across different choices of d θ .
It can also be observed in Figure 10 that the ASWDs with different choices of d θ consistently produce better performance than the other evaluated slice-based Wasserstein metrics.
A PPENDIX H A DDITIONAL RESULTS IN THE GENERATIVE MODELING EXPERIMENT H. S AMPLES OF GENERATED IMAGES OF CIFAR10 AND C ELEB A DATASETS
[Figure]
H. E XPERIMENT RESULTS ON MNIST DATASET
In the generative modelling experiment on the MNIST dataset, we train a generator by minimizing different slice-based Wasserstein metrics, including the ASWD, the DSWD, the GSWD (circular), and the SWD.
Denote by G Φ the generator, the training objective of the experiment can be formulated as (Bernton et al., 2019):
[Equation]
(54) where p z and p r are the prior of latent variable z and the real data distribution, respectively.
In other words, the SWD, or other slice-based Wasserstein metrics, can be considered as a discriminator in this framework.
By replacing the SWD with the ASWD, the DSWD, and the GSWD, we compare the performance of learned generative models trained with different metrics.
In this experiment, different methods are compared using different number of projections L = { 10 , 1000 } .
The 2-Wasserstein distance and the SWD between generated images and real images are used as metrics for evaluating performances of different generative models.
The experiment results are presented in Figure 12.
Quality of generated images and convergence rate: It can be observed from Figure 12 that the ASWD outperforms all the other methods regarding both the 2-Wasserstein distance and the SWD between generated and real images.
In particular, the generative model trained with the ASWD produces smaller 2-Wasserstein distances within less iteration, which implies the generated images are of higher quality and the ASWD leads to higher convergence rates of generative models.
In addition, the ASWD shows that it is able to generate higher quality images than the SWD and the GSWD with 1000 projections using only as less
[Figure]
as 10 projections.
In other words, the ASWD has higher projection efﬁciency than the other slice-based
Wasserstein metrics.
The ASWD also has the smallest SWD distance as shown in Figure 12.
Although the SWD converges slightly faster than the ASWD in terms of the SWD between fake and real images, this is due to the training objective and the evaluated metric are the same for the SWD.
Randomly selected images generated by different slice-based Wasserstein metrics are presented in Figure 13.
Computation cost of the ASWD: The execution time per mini-batch (512 samples) of different methods are compared in Figure 14a.
We evaluate the SWD by varying the number of projections in the set {10, 1000, 10000} and all the other methods in the set {10, 1000}.
We found that although the SWD requires much fewer computational time than the DSWD and the ASWD, the quality of generated data is poor even when the number of projections L increases to 10000.
The GSWD is also computationally efﬁcient when using a 10 projections, but it requires the highest execution time and generates the highest 2-Wasserstein distance among all compared methods when the number of projections increases to 1000.
The huge difference in the execution time of the GSWD withand 1000 projections is due to the GSWD needs to calculate distance matrices of shape N × L , where
N and L are the number of samples and projections respectively, which is more computationally expensive than calculating inner products when the number of projections L increases.
The DSWD requires a similar computational time as the ASWD in this example, while the ASWD generates higher quality images in terms of 2-Wasserstein distances.
Besides, we have also evaluated the effect of batch size on the computation cost of different slice-based
Wasserstein metrics.
Due to the out-of-memory error caused by the excessively high computation cost of the GSWDs in high-dimensional space, the GSWD is not included in this comparison.
Speciﬁcally, the ASWD, the DSWD, and the SWD are compared in this experiment, and the computation time of the evaluated methods with L = 10 , 1000 projections and N = { 2 13 , 2 14 , 2 15 , 2 16 } samples are reported in Figure 14b.
From the results presented in Figure 14b, it can be observed that, similar to the computational complexity of the DSWD and the SWD, the computational complexity of the ASWD empirically tends to scale in O ( N log N ) .
[Figure]
[Figure]
A PPENDIX I S LICED W ASSERSTEIN AUTOENCODERS
We train an autoencoder using the framework proposed in (Kolouri et al., 2019b), where an encoder and a decoder are jointly trained by minimizing the following objective:
[Equation]
where φ is the encoder, ψ is the decoder, p z is the prior distribution of latent variable, BCE( · , · ) is the binary cross entropy loss between reconstructed images and real images, and L 1 ( · , · ) is the L loss between reconstructed images and real images.
We train this model using different slice-based
Wasserstein metrics, including the ASWD, the DSWD, the SWD, and the GSWD.
Here we use the ring distribution as the prior distribution as shown in Figure 16.
We report the binary cross entropy loss during test time and the 2-Wasserstein distance between prior and the encoded latent variable φ ( x ) in Figure 15.
The slice-based Wasserstein metrics used as the third term in Equation (55) is also recorded at each iteration and presented in Figure 15 in order to analyze the factors that causes the differences in the performance of models trained with different slice-based Wasserstein metrics.
It can be observed from the ﬁrst two columns of Figure 15 that while the model trained with the
ASWD, SWD, and DSWD lead to similar 2-Wassertein distance between the encoded latent variable distribution and the prior distribution, which implies that they have similar coverage of the prior distribution as shown in Figure 16, the model trained with the ASWD converges slightly faster to smaller binary cross entropy loss than the others.
As shown in Figure 15(b) and 15(c), since the obtained
GSWDs are trivially small compared with the other metrics, models trained with GSWDs only focuses on the reconstruction loss and therefore produce reconstructed images of higher qualities in terms of the binary cross entropy.
However, although models trained with the GSWD polynomial and the GSWD circular lead to smaller binary cross entropy loss than the ASWD, their latent distributions present very different data structures from the speciﬁed prior distribution, which can be problematic in certain applications where the support of the latent distribution is required to be within a particular range.
Some MNIST images randomly generated by SWAEs trained with different metrics are given in Figure 17.
[Figure] [Figure]
[Figure]
A PPENDIX J C OLOR TRANSFERRING
Color transferring can be formulated as an optimal transport problem (Bonneel et al., 2015; Radon, 1917).
In this task, the color palette of a source image is transferred to that of a target image, while keeping the content of source image unchanged.
To achieve this, the optimal transport can be used to ﬁnd the alignment between image pixels by calculating the optimal mapping of color palettes.
In this experiment, instead of solving the optimal mapping in the original space, we ﬁrst project the distribution onto one-dimensional spaces and average the alignment between one-dimensional samples as an approximation of the optimal mapping in the original space.
After obtaining the approximation, we replace pixels of the source image with the averaged corresponding pixels in the target image.
To reduce the computational cost, we utilize the approach proposed in (Muzellec and Cuturi, 2019), where the K-means algorithm is used to cluster the pixels of both source and target images, and then we implement color transfer for the quantized images whose pixels are consist of the centers ofclusters rather than the original source and target images.
We present the results of color transferring in Figure 18.
It can be observed that the ASWD and the
DSWD produce sharper images than the SWD and the GSWD (polynomial), we conjecture that is because the ASWD and the DSWD can generate better alignment of pixels.
The GSWD (circular) tends to generate high contrast images, but sometimes produces images with low color diversity as in Figure 18(a).The Max-SWD has the highest contrast among all methods, but this is due to it only uses a single projection to obtain the transport mapping, thus there is no need to average different pixels from the target image.
A disadvantage of the Max-SWD is that the transferred images generated by Max-SWD is not smooth enough and do not look realistic.
The ASWD can generate smooth and realistic images than the SWD and the Max-SWD, even when the number of projections is as small as 10.
Transferred images obtained by transferring colors from the source to target using standard optimal transport maps is also presented in Figure 18 for reference (Ferradans et al., 2014).
[Figure]
A PPENDIX K S LICED W ASSERSTEIN BARYCENTER
Sliced Wasserstein distances can also be applied in the barycenter calculation and shape interpolation (Bonneel et al., 2015).
Here we compare barycenters produced by different slice-based
Wasserstein metrics, including the GSWD (circular and polynomial), the ASWD, the SWD, and the
DSWD.
Speciﬁcally, we compute barycenters of different shapes consisting of point clouds, as shown in Figure 19.
Each object in Figure 19 corresponds to a speciﬁc barycenter with different weights.
The Wasserstein barycenters are also presented in Figure 19 for reference, which provide geometrically meaningful barycenters at the expense of signiﬁcantly higher computational cost .
Formally, a sliced-Wasserstein barycenter of objects µ = { µ 1 ,µ 2 , ··· ,µ N ∈ P k ( R d ) } assigned with weights w =[ w 1 ,w 2 , ··· ,w N ∈ R ] is deﬁned as:
[Equation]
In this experiment, we set N =3 and compute barycenters corresponding to different weights.
The results are given in Figure 19.
From Figure 19, it can be observed that the ASWD produces similar barycenters as that of the SWD, which are sharper than the DSWD, and more meaningful than the GSWD (polynomial).
The ﬂexibility of the injective neural networks g ( · ) and its optimization in the ASWD can be potentially combined with speciﬁc requirements in particular tasks to generate calibrated barycenters - we leave this as a future research direction.
[Figure]