B UNDLE N ETWORKS : F IBER B UNDLES , L OCAL T RIVIALIZATIONS , AND A G ENERATIVE A PPROACH TO E XPLORING M ANY - TO - ONE M APS
Anonymous authors
Paper under double-blind review
A BSTRACT
Many-to-one maps are ubiquitous in machine learning, from the image recognition model that assigns a multitude of distinct images to the concept of “cat” to the time series forecasting model which assigns a range of distinct time-series to a single scalar regression value.
While the primary use of such models is naturally to associate correct output to each input, in many problems it is also useful to be able to explore, understand, and sample from a model’s ﬁbers, which are the set of input values x such that f ( x ) =
y , for ﬁxed y in the output space.
In this paper we show that popular generative architectures are ill-suited to such tasks.
Motivated by this we introduce a novel generative architecture, a Bundle Network, based on the concept of a ﬁber bundle from (differential) topology.
BundleNets exploit the idea of a local trivialization wherein a space can be locally decomposed into a product space that cleanly encodes the many-to-one nature of the map.
By enforcing this decomposition in BundleNets and by utilizing state-of-the-art invertible components, investigating a network’s ﬁbers becomes natural.
I NTRODUCTION
In the last decade, generative methods have made remarkable strides toward the goal of faithfully modeling complex data distributions.
Families of model architectures such as generative adversarial networks (GANs) (Goodfellow et al., 2014), variational autoencoders (VAEs) (Kingma & Welling, 2013), and normalizing ﬂows (Rezende & Mohamed, 2015) have enabled a range of tasks that were previously thought to be unachievable for complex (and often high-dimensional) distributions such as those representing natural images.
Applications include image to image translation (Mao et al., 2019; Lee et al., 2018), music generation (Mogren, 2016), image super-resolution (Ledig et al., 2017), and density estimation (Dinh et al., 2016).
In this work we introduce a new task in machine learning which revolves around the problem of modeling the structure of many-to-one maps.
The majority of classiﬁcation and regression tasks in machine learning involve many-to-one maps.
That is, maps that send a range of distinct inputs to the same output.
For example, most image recognition tasks are many-to-one since they send an inﬁnite set of natural images to a ﬁnite number of classes.
Of course, there is no reason that a model’s target space needs to be discrete—consider, for instance, a sentiment analysis task where sentiment is naturally represented by a continuum.
There are likely a range of distinct expressions that result in the same sentiment value.
This paper was inspired by a problem in materials science wherein one wishes to explore all the processing conditions that will result in a material with a speciﬁc ﬁxed property (e.g., strength).
Understanding all such processing conditions allows the materials scientist to choose among a range of options that will all produce a material achieving their desired performance metrics.
While the focus of most research on classiﬁcation and regression tasks is training models that give correct predictions, it can also be useful to be able to ﬁx an output value y and explore, quantify, or sample from all those x which map to y .
Such an exercise allows one to understand different modes of variation that a model collapses in the process of making its predictions.
If function π : X → Y is the ground truth pairing between input space X and output space Y , this amounts to calculating the inverse image π − 1 ( y ) , or ﬁber of π at y .
Our goal in the present work is to (1) formalize this problem and (2) describe a deep learning framework which readily enables this kind of analysis.
We take as our inspiration the notion of a ﬁber bundle from topology (Seifert, 1933; Whitney, 1935).
Consider the projection map on X =
Y × Z , π : Y × Z → Y , which sends π ( y, z ) =
y .
For any y ∈ Y , the inverse image π − 1 ( y ) is easily calculated as { y } × Z ∼ =
Z .
Interpreted in terms of the machine learning task, Y is the component of X that we want to predict and Z encodes the remaining variation occurring among all x that map to y .
Unfortunately, in our nonlinear world data distributions can rarely be decomposed into a product space on a global level like this.
Instead, it is more realistic to hope that for each sufﬁciently small neighborhood U of Y , we can ﬁnd a data distribution preserving homeomorphism
U × Z ∼ −→ π − 1 ( U ) .
This informally summarizes the idea of a ﬁber bundle, where locally the space
X is the product of a base space (some subset of Y ) and a ﬁber Z .
Following the mathematical literature, we call this task local trivialization of X .
A local trivialization is useful since it allows us to understand and explore the ﬁbers of π .
In our experiments we show that popular generative models including Wasserstein GANs (Wu et al., 2018) and conditional GANs (Mirza & Osindero, 2014), are unable to accurately model the ﬁber structure of a machine learning task.
To address this, we describe a new deep learning architecture called a Bundle Network which is designed to produce local trivializations of an input space X and thus enable one to model ﬁbers of a task.
Bundle Networks uses a clustering algorithm to divide up the output space Y into neighborhoods { U i } and then learn a conditioned, invertible mapping that decomposes the inverse image of each of these neighborhoods π − 1 ( U i ) into a product U
i × Z that preserves the distributions induced by the data.
We show that Bundle Networks can effectively model ﬁbers for a range of datasets and tasks, from synthetic datasets that represent classic examples of ﬁber bundles, to the Wine Quality (Cortez et al., 2009) and
Airfoil Noise (Brooks et al., 1989) datasets from (Dua & Graff, 2017).
In summary, our contributions in this paper include the following.
• We identify and formalize the problem of learning the ﬁbers of a machine learning task.
• We describe one approach to solving this problem, using a ﬁber bundle framework to learn how to locally decompose the input space of the task into a product of label space and a ﬁber space that parametrizes all additional variation in the data.
• We introduce a new family of deep generative models called Bundle Networks and show via empirical experiments that, while other popular architectures struggle to model the ﬁbers of a machine learning task, Bundle Networks yield strong results.
R ELATED WORK
Conditional and manifold-based generative models: The local trivialization task that we describe in Section 3.1 can be interpreted as a special type of conditional generative task.
That is, a task where data generation is conditioned on some additional variables.
Common models within this framework are the various ﬂavors of conditional variational autoencoders (VAE) (Sohn et al., 2015) and conditional generative adversarial networks (GAN) (Mirza & Osindero, 2014).
While our approach utilizes conditional components to capture differences in model behavior at different locations in input space, additional aspects of the task, such as the local decomposition of input space into ﬁber and label space, mean that standard generative models do not give strong results.
This paper also shares similarities to other work at the intersection of generative modeling and manifold theory.
In Kalatzis et al.
(2021) for example, the authors propose a new method, multichart ﬂows (MCFs), for learning distributions on topologically nontrivial manifolds.
Similar to the present work, the authors use coordinate charts to learn non-Euclidean distributions using otherwise
Euclidean machinery.
Unlike our work, MCFs are designed to learn general distributions on manifolds and do not have the specialized architectural adaptations or novel training routine designed for modeling many-to-one problems.
Invertible neural networks: Invertible neural networks have recently become a topic of interest within the deep learning community.
Some of the ﬁrst network layers that were both invertible and learnable were suggested in (Dinh et al., 2015; 2016) and are in essence afﬁne transformations followed by orthogonal transformations.
Ardizzone et al.
and Sorrenson et al.
(2020) are among the works that have used invertible networks to solve problems of distribution approximation with the latter introducing general incompressible-ﬂow networks (GINs) which are volume-preserving versions of invertible neural networks.
The most common instance of invertible neural networks are normalizing ﬂows, which were popularized by (Rezende & Mohamed, 2015).
Feature disentanglement: Distribution disentanglement is (roughly) the task of learning a latent space for a distribution such that orthogonal directions capture independent and uncorrelated modes of variation in the data.
Many recent methods of solving this problem leverage popular generative models such as generative adversarial networks (GANs) and variational autoencoders (VAEs) (Chen et al., 2018;
Kim & Mnih, 2018; Dupont, 2018; Chen et al., 2016; Lin et al., 2020).
Like disentanglement, the local trivialization task described in this paper involves factoring a data distribution.
Unlike the problem of feature disentanglement, which generally seeks to decompose a distribution into all independent modes of variation, we only seek to distinguish between those modes of variation deﬁned by the classes or targets of the supervised task and all other variation.
The local nature of our factorization further sets us apart from work on feature disentanglement.
F IBER BUNDLES AND LOCAL TRIVIALIZATIONS
[Figure]
has a two-point ﬁber.
One way to understand complicated geometric spaces is to decompose them into simpler components.
For example, topologically a torus T can be understood to be the product of two circles
T ∼ = S 1 × S 1 .
Such decompositions into product spaces are particularly useful in applications since many algorithms on the entire space can then be reduced to independent, component-wise calculations.
However, even in situations where local neighborhoods look like a product, such decompositions may not be possible globally because of “twists” that occur in a space (for example in the M¨obius band, see Figure 1).
First developed in the work of Seifert (1933) and Whitney (1935), ﬁber bundles are a geometric structure designed to capture the locally product-like nature of such spaces.
Formally, a ﬁber bundle is a triple ( E, B, Z ) of topological spaces along with a (surjective) continuous map π : E → B and a collection of local trivializations T =
{ ( U i , ϕ i ) } i ∈I subject to the conditions that ( i ) { U i } i ∈I is an open cover of B and ( ii ) for each i ∈
I , ϕ i gives an homeomorphism ϕ
i : U i × Z (cid:39) −→ π − 1 ( U i ) such that the obvious projection from U i ×
Z to U i agrees with the map π restricted from π − 1 ( U i ) to U i .
This last condition is equivalent to saying that for all i ∈
I , the following diagram commutes.
[Equation]
The space E is generally called the total space , B is called the base space , and Z is called the ﬁber .
One can think of this deﬁnition as rigorously capturing the idea that for small enough neighborhoods,
E looks like the product of a subset of B and Z .
Some standard ﬁber bundles are found in ﬁgure 1.
3. T HE LOCAL TRIVIALIZATION OF A MACHINE LEARNING TASK AND MODELING DATA ON A FIBER
Suppose that T is a supervised machine learning task that involves taking data from X and predicting a correspond element of Y .
Let D X be the data distribution on X and let measurable function π : supp( D X ) → Y , deﬁne a ground truth label for each x in the support of D X .
Then for any measurable open set U ⊆ Y , D X induces a conditional distribution, D π − 1 ( U ) on π − 1 ( U ) .
In a similar fashion, via the pushforward of D X using π , we get a label distribution D Y on Y .
Finally, each measurable subset U ⊆
Y inherits a conditional distribution D U from D Y .
We call the sets π − 1 ( U ) with distribution D π − 1 ( U ) the trivializable neighborhoods of task T .
A local trivialization of X with respect to π , involves:
A choice of open cover U =
{ U i } of Y such that
∪ i U i
= Y .
A choice of ﬁber space Z with associated ﬁber distribution D Z . 3.
Learning an invertible, trivializing map
ϕ i : U i × Z
→
π − 1 ( U i ) for each U i ∈ U , such that (a) ϕ
i maps distribution D U
i ⊗ D Z to D π − 1 ( U i ) and (b) ϕ −
i
makes Diagram 1 commute.
Note that in the above formulation, the space X takes the role of the total space E from sectionand Y takes the role of the base space B .
Though good choices of ﬁber Z and measure ν can occasionally be guessed based on the nature of the data, they generally must be arrived at through experimentation.
Further, the use of local trivializations should be seen as a convenient framework that enables the input space to be locally approximated as the product of two subspaces: one corresponding to the label and one capturing variation unrelated to the label.
One should not expect that a task and its ﬁbers are literally a ﬁber bundle “on the nose.”
The trivializing maps { ϕ i } i allow one to explore the ﬁbers of π , which includes sampling from them.
For example, if we choose some y ∈ Y then we can sample from the ﬁber π − 1 ( y ) by (1) identifying the neighborhood
U
i that y belongs to, (2) sampling a collection of points { z 1 , . .
, z (cid:96) } using D Z , and (3) applying the map ϕ
i to ( y, z i ) for each z ∈ { z 1 , . . .
, z (cid:96) } .
B UNDLE N ETWORKS
We introduce a new model called Bundle Network (or BundleNet for short) to address the problem described in section 3.1.
A BundleNet (sketched out in ﬁgure 2) combines an invertible architecture with the ability to condition on elements of R which are in bijective correspondence with the neighborhoods U of Y .
Speciﬁcally, BundleNet is a function Φ : X × R
→ Y × Z , such that given a speciﬁc choice of conditioning vector r ∈ R , Φ i :=
Φ( − , r i ) :
X → Y × Z is an invertible neural network.
Φ i and Φ − 1 i are meant to model ϕ − 1 i and ϕ i (respectively).
Moving from forward to back, the ﬁrst layer of Φ is an afﬁne transformation conditioned (solely) on elements from R .
After this layer, the model consists of alternating RNVP blocks and coordinate permutations.
As noted in section 3.1, a number of choices need to be made before a model is trained.
Let D t ⊆
X × Y be the training set and p X : X × Y → X and p Y :
X × Y → Y be the standard projections of
X × Y onto its components.
Firstly, the collection of neighborhoods U in Y needs to be chosen.
In the case of regression, where p Y ( D t ) can contain an arbitrary number of distinct elements, we found that using k -means was an efﬁcient and effective way to cluster these points into neighborhoods.
The set of cluster centroids are then exactly the vectors R = { r 1 , . . .
, r q } that will be used to condition
[Figure]
𝑥
Conditional Affine
Transformation 𝑟 )
[Figure]
𝑎𝑟𝑔𝑚𝑖𝑛 *
[Figure]
|
[Figure]
𝑦 |
RNVP
RNVP RNVP
SHUFF
LE
SHUFF
LE … (𝑦,𝑧) 𝑥
[Figure]
𝒟 !
[Figure]
the network.
The number of clusters, q , is a hyperparameter that can be explored during training (we discuss the robustness of BundleNet to different choices of q in section A.3.1).
In the case where the output values are discrete (i.e. p Y ( D t ) can only take a ﬁnite number of values C
= { c 1 , . . .
, c q } ), one can simply set U i
= { c i } .
After selecting neighborhoods U in the base space, the neighborhoods in X are deﬁned automatically by taking an inverse image with respect to π .
The ﬁber Z and ﬁber distribution D z also need to be chosen.
These choices are discussed in the ﬁrst part of Section 6.
We call application of the model in the direction X
→ Y × Z forward operation and application of the model in the direction Y ×
Z → X reverse operation in accordance with the ground truth association function π : X → Y .
As depicted in Figure 2, to apply Φ to a training point ( x
, y ) ∈
D t in the “forward direction” we solve r i = arg min r ∈R || r − y
|| , ﬁnding the representative r i in R that is closest to label y .
Then we apply Φ i =
Φ( − , r i ) to x .
To run Φ in reverse on training example ( x, y ) we invert Φ i to Φ − 1 i , sample some z from D Z , and compute Φ − 1 i ( y, z ) .
To ease notation we write Φ( x ) (respectively, Φ − 1 ( y, z ) ) to denote the process of ﬁrst computing r i and then applying Φ i to x (
resp.
Φ − 1 i to ( y, z ) ).
Since we are primarily interested in generating and sampling from task ﬁbers via their local trivialization, at inference time we only run Φ in reverse, applying Φ − 1 i to a collection of points ( y, z ) sampled from D U i ⊗ D Z .
We evaluate this mapping by measuring the discrepancy of the resulting image in X against the distribution D π − 1 ( U i ) .
One could conceivably also use Φ for classiﬁcation, but in that case one would need to develop a strategy for identifying the proper r i ∈ R to use to condition Φ in the absence of a label associated with x ∈ X .
One could likely use a nearest neighbor approach using points that are known to belong to each π − 1 ( U i ) , but we leave this for future work.
The loss we choose for our model consists of two main parts, L fwd and L bwd , corresponding to loss from the forward and backward directions.
Since Φ is invertible, these can be trained simultaneously and updated with a uniﬁed gradient step.
Together, our ﬁnal loss is then L bundlenet =
L bwd + L fwd .
The forward loss L fwd is the simpler of the pair.
Given ( x, y ) ∈
D t , we ﬁnd i such that y ∈
U i and compute L fwd ( x, y )
= (cid:107) p Y
(Φ i ( x )) − y (cid:107) 2 , where p Y denotes the projection from Y × Z to Y .
This term ensures that in the forward direction Φ accurately maps elements from X to base space
Y .
The backward loss is comprised of several terms: L bwd =
L KL − fwd + L KL − bwd + L MSMD (where MSMD is mean squared minimum distance).
Choosing some U i ∈
U , we sample points from D U i and pair each with a point that we sample from our priors (that is, from D z ) to get a set
S .
S is passed through Φ − 1 i to generate points in X .
Then the MSMD, KL-fwd, and KL-bwd losses (cf. section A.2) are used to compute a loss term by comparing Φ − 1 i ( S ) and points sampled from
D π − 1 ( U i ) .
The KL-divergence terms act to ensure that the point clouds Φ − 1 i ( S ) and π − 1 ( U i ) cover one another and the MSMD term ensures that no point in Φ − 1 i ( S ) is too far from some point in π − 1 ( U i ) .
E XPERIMENTS
We evaluate Bundle Networks on four datasets.
Two of them are synthetic and represent classic examples of ﬁber bundles: the M¨obius band and the torus, both embedded in R 3 .
The other datasets are Wine Quality (Cortez et al., 2009) and Airfoil Noise (Brooks et al., 1989), both of which are available in the UC Irvine Machine Learning Repository (Dua & Graff, 2017).
The Wine Quality task (as we have structured it) involves predicting wine quality and color (white vs. red) frommeasured quantities.
The Airfoil Noise task has 5 real-valued input parameters and one predicted output (scaled sound pressure level).
Further information can be found in section A.1.
For the invertible layers in BundleNet we used the FrEIA package (Ardizzone et al., 2021).
We chose
Wine Quality and Airfoil Noise because they represent low-dimensional, many-to-one relationships with several continuous variables making each a good ﬁrst test case for the local trivialization task.
In selecting models against which to compare our BundleNets, we chose modern yet general-purpose models that have proven effective at many generative tasks.
This includes Wasserstein divergence
GANs (WGAN) developed as an improvement on traditional Wasserstein GANs by Wu et al.
and conditional GANs (CGANs) from Mirza & Osindero (2014).
While WGAN directly learns to approximate the global distribution of data using Wasserstein distance, it doesn’t include a conditional aspect that allows a user to specify a ﬁber to sample from so it is excluded from our ﬁberwise metrics.
We also implement a version of a CGAN that we call CGAN-local that conditions on a concatenated vector consisting both of the base point and a neighborhood representative, chosen in a manner analogous to BundleNet.
We developed this model to identify whether a CGAN could perform on par or better than BundleNet when it is provided with the exact same locality information during training and testing.
As we describe in section 5.2, we take CGAN-local’s failure to reach
BundleNet’s level of performance as evidence that the specialized architecture and loss functions
BundleNet uses makes it better equipped for the task of ﬁber modeling.
5. T RAINING AND EVALUATION PROCEDURE
Each model was trained on a single GPU (Nvidia Tesla p100 @ 16GB) for a period of 2000 epochs using an initial learning rate of 10 − 4 which was halved every 70 epochs.
The weights that were used for evaluation were the ﬁnal weights that were saved after the ﬁnal epoch, even if the model converged long before.
A table of hyperparameters used for these results (including ﬁber distributions
D Z ) can be found in Appendix section A.3 along with a discussion of their impact on performance.
The aim of our evaluation is to understand how well BundleNet models can reconstruct ﬁbers in the total space X .
We use a number of different metrics to do this including: MSMD, KL-divergence,
Wassertein metrics ( W 1 and W 2 ), and maximum mean discrepancy (MMD).
We perform such measurements in two modes: the global and ﬁberwise regimes.
In the global regime, the trained model is asked to generate 4000 points from the global distribution D X (using points sampled from Y and
Z ) and these are compared against 4000 points from either the true data distribution (in the synthetic datasets when this is known) or from a held-out test set (when we don’t have access to the underlying distribution).
Then these two point clouds are evaluated using each of our metrics.
The process is repeated 10 times and the output values are bootstrapped to compute sample mean with 95% conﬁdence intervals.
In the ﬁberwise regime, 15 points are sampled from Y and for each such y , we use the model to generate 200 points lying in π − 1 ( y ) .
We compare this against 200 points we have sampled from either the true ﬁber (when this is known) or the points lying over the base point in our combined train & test sets.
Each metric is evaluated 10 times and bootstrapped as above.
5. R ESULTS
For the results described in this section we mostly focus on the Wasserstein-1 metric W 1 as our evaluation statistic.
The full suite of results (MSMD, MMD, KL-fwd, KL-bwd, W 1 , and W 2 ) can be found in Appendix section A.5.
With a few exceptions, performance patterns we see for the
Wasserstein-1 metric are largely repeated when we apply other metrics.
As can be seen in tables 1 and 2, with the exception of CGAN-local’s performance on Airfoil Noise in the ﬁberwise regime, BundleNet outperforms all the other models, sometimes by a very wide margin, in both the global and ﬁberwise data generation regimes.
In fact, the only dataset where other models are competitive with BundleNet is Airfoil Noise and that is again only in the ﬁberwise
[Table] [Table]
regime (table 10, bottom).
Here BundleNet achieves better performance than CGAN and CGANlocal on 4 out of 6 metrics (though on 2 of these BundleNet’s 95% conﬁdence interval intersects another model’s).
Overall, CGAN-local is the model that is most competitive with BundleNet.
Within the global data generation regime, BundleNet easily outperforms the other three models on all four datasets.
CGAN-local comes in second on three datasets (Torus, Wine Quality, and Airfoil
Noise) while CGAN comes in second on one (M ¨ obius band).
We were surprised to ﬁnd that though
BundleNet is speciﬁcally designed for the purpose of sampling from ﬁbers, it also achieves high accuracy when reconstructing the whole distribution.
Visualizations of each model’s reconstruction of the Torus and M ¨ obius band can be found in ﬁgure 6 in the appendix with further commentary.
As remarked above, we developed CGAN-local so that we would have a GAN-based benchmark that receives the exact same input as BundleNet.
We hoped to be able to ascertain whether or not
BundleNet’s specialized invertible architecture and loss function combination is critical to better model performance.
The results above suggest that BundleNet is indeed better adapted to solving the problem posed in this paper.
On the other hand, the fact that CGAN-local achieves the second best performance on a majority of datasets and metrics suggests that even without the BundleNet framework, there is value to partitioning a distribution into neighborhoods and conditioning on each.
We believe our results suggest that existing generative architectures cannot satisfactorily solve the problem of learning ﬁbers.
D ISCUSSION
Topological priors on ﬁbers: As mentioned in section 4, BundleNet requires one to choose an underlying ﬁber distribution D Z .
The natural choice would be to use Gaussian distributions since they are tractable computationally and to some degree universal in statistics.
A natural question is: how well can a Gaussian prior capture more topologically diverse ﬁbers—for example, circular ﬁbers that arise in tasks that involve periodic systems or invariance to 1 -dimensional rotations?
To test this, we trained an invertible neural network to map a 1 -dimensional Gaussian, a 2dimensional Gaussian, and a uniform distribution on a circle to a distribution on an oval in the plane.
In each case the model was the same deep invertible architecture with RNVP blocks trained with (forward and backward) KL-divergence.
Visualizations of the result can be found in ﬁgure 3.
As expected the circular distribution quickly converges to the target oval while neither the 1 - nor 2 -dimensional Gaussian converges to a distribution that is visually similar to the oval.
This aligns with the basic fact from topology that there is no continuous bijective map from the interval [0 , 1] to the circle S 1 (Lee, 2010).
Based on this observation and the fact that up to homeomorphism the circle and R are the only two real, connected, 1 -dimensional manifolds, we investigated which prior would give better results on our synthetic datasets.
[Figure]
Using different priors
[Figure]
[Table]
One might expect that the model with Gaussian prior would perform better on the M ¨ obius band, whose ﬁbers are intervals while the circle prior would lead to better performance on the torus whose ﬁbers are circles.
Surprisingly, the circle prior resulted in better performance on both the torus and M ¨ obius band.
A possible explanation for this is that the circle prior is a uniform distribution supported on a compact set.
The same is true for the ﬁbers in the M ¨ obius band and it is possible that the model has a harder time concentrating the density of a Gaussian distribution than collapsing the shape of a circle to (approximately) a line segment.
On the other hand, data collected in Appendix section A.3.2 shows that in some cases the effect of prior choice is negligible.
In the end, all of our experiments reinforce the conclusion that while speciﬁc prior choices may be important to achieving optimal behavior, our model is relatively robust to this hyperparameter.
Fiber topology need not be uniform: While the theory of ﬁber bundles is rich and well-studied in math, it is perhaps restrictive to have to assume that the data that arises in the real world has this very particular and highly-structured form.
Our results on the non-synthetic datasets shown in tables 1 and 2, however suggest that the neighborhood-based approach allows BundleNet to be more ﬂexible.
To test whether BundleNets can perform well on datasets whose ﬁbers are not all the same (speciﬁcally homeomorphic) we train and test it on a new dataset called the sliced torus that is identical to our torus dataset except that the ﬁber varies continuously from a point to a full circle and back as we traverse the ring.
The quantitative results of our experiments can be found in table 4 and visualizations can be found in ﬁgure 4.
We note that WGAN and CGAN both struggle to even produce the general shape of the torus, while CGAN-local gets the torus shape mostly right but clumps points from each neighborhood together.
Both BundleNet and CGAN-local have trouble with the singularity where the ﬁber becomes a point (though BundleNet appears to handle this better).
For reference, each ﬁber consists of 100 points.
In most cases we see that generative metrics are comparable to those we saw on the torus dataset and almost all cases (except global W 2 and ﬁberwise MSMD)
the results on the sliced torus are better than the next best model we tested on the torus dataset.
This, coupled with our superior performance on real-world data that is unlikely to take the form of a true
[Figure]
[Table]
ﬁber bundle, suggest that although our architecture is formulated to deal with situations where the ﬁbers are topologically homogeneous, BundleNets retains sufﬁcient expressivity to allow for more complicated relationships in the data.
Both this section and the previous one investigate topological effects on model performance.
It is hard to extrapolate too broadly from such small synthetic experiments
[Table]
but our results do suggest that exploring latent space topology might be an interesting direction for further research
[Table]
6. L IMITATIONS
While the generative results shown above suggest that BundleNet is a powerful way to learn ﬁbers, it has some drawbacks compared to other models we tested.
The most glaring of these is (1) slow training speed, which arises from our implementation of KL-divergence, which has computational complexity O ( n 2 ) where n is the size of a typical neighborhood and (2) memory considerations when the data is high dimensional, since the default implementation attempts to compute loss terms using the entire neighborhood.
A potential solution to both of these problems, would be to subsample from a neighborhood.
We also found that, in its current form, BundleNet was not particularly wellsuited to image data (partially because of dimensionality considerations).
We believe adapting the BundleNet framework to high dimensional data should be the top priority for future work.
C ONCLUSION
Fibers are a useful lens through which to understand a machine learning task.
However, they have been little explored in the deep learning literature so far.
In this paper we showed that several promising, existing, candidate models struggled to consistently model ﬁbers for both real and synthetic datasets.
Drawing on deep ideas from topology, we introduced a new model architecture, the
Bundle Network, which by design can model the ﬁbers of a task by breaking the input space into neighborhoods and learning a function on each that decomposes input into a product of its label and all additional variation in the data.
We hope this opens a door, both for applying methods from differential topology to machine learning and for further explorations into methods that can help data scientist better model and understand the ﬁbers of their datasets.
R EPRODUCIBILITY STATEMENT
In the interest of making our results reproducible and able to be easily expanded upon we make our codebase available to the public, including our implementations of BundleNet as well as the
WGAN, CGAN and CGAN-local models we used.
We also include training scripts for different models with sensible defaults as well as an evaluation script and examples.
Finally, we provide the data used throughout this paper including our speciﬁc splits.
This entire collection will be available on a public GitHub repository once the anonymous review period has completed.
A A PPENDIX A. D ATASETS
In this section we document our method for either generating or modifying datasets used in this work.
Torus:
This is a purely synthetic dataset that uses an embedding of a torus (a 2 -dimensional surface/manifold) in R 3 .
Given two radii r and R , the torus parameterization is given by:
[Equation]
φ, θ < 2 π } .
Our data uses R = 8 and r = 2 and consists of 1000 points generated by uniformly sampling parameters φ and θ from [0 , 2 π ) .
Notice that this does not represent a uniform sampling from the surface itself since it more heavily represents the inner ring of the torus.
When we evaluate, we use rejection sampling to sample uniformly from the surface.
The base space Y is given by a circle of radius 4 . 5 .
M¨obius band: This is our second synthetic data and another surface in R 3 .
This one is given by the parameterization:
[Equation]
where A θ is the rotation matrix around the z -axis through the angle θ and B θ is the rotation matrix around the x axis through the angle θ .
Our data (both for training and evaluation) consists ofpoints with r = 2 and R = 8 which are sampled uniformly over the parameters θ and s .
The base space Y is a radius 4 .
5 circle.
The two real-world datasets, Wine Quality (Cortez et al., 2009) and Airfoil Noise (Brooks et al., 1989), are described more completely on their pages in the UCI ML repository (Dua & Graff, 2017).
The Wine Quality dataset is provided as two ﬁles (for red and white wine) with the intention of predicting quality from 11 measured quantities.
We combine these two sets into one so that we have 11 inputs and two (both categorical) outputs: color and quality.
The Airfoil Noise dataset hasinput parameters and one output parameter (scaled sound pressure level), which we left unaltered.
As a pre-processing step we normalized all parameters in each datasets to span the range 0 to 10 by applying x (cid:55)→ 10 M ( x − m ) where m and M are the minimum and maximum values of each parameter.
We made an 80/20% train/test split for each.
A. L OSS FUNCTIONS AND EVALUATION METRICS
There has been much work in the world of GANs to establish metrics that can quantify the quality of a generative model.
This includes the widely-used Inception Score (Salimans et al., 2016) and
Fr´echet Inception Distance (Heusel et al., 2017).
Many of these metrics, however, rely on the assumption that the data has the structure of an image.
For instance, in both the methods mentioned above one computes these metrics by using a pretrained Inception v.3 model (Szegedy et al., 2015) to extract latent features from generated images.
One then uses methods from statistics/optimal transport like the Wasserstein distance or Kullback-Leibler divergence to evaluate similarity under the assumption that data in these latent spaces follow Gaussian distributions.
Since the data we are using are not images, and since the assumption that our data follows some
Gaussian distribution is catastrophically restrictive, we choose some standard two-sample tests to quantitatively compare the performance of different models.
One could make the argument that with the blessing of low-dimensionality we are able to more directly access the metrics that are only being approximated in methods such as those for images that rely on a pretrained classiﬁer model.
Mean squared minimum distance: The simplest of our metrics, the mean squared minimum distance (MSMD) takes two samples S 1 and S 2 and computes
[Equation]
This na ¨ ıve approach is not as robust to different distributions as the methods that follow, but in the case that S 2 is a collection of points uniformly distributed on some known space (e.g. a circle in space corresponding to the true ﬁber over a point), this number is more readily interpretable as an approximate measure of how “realistic” the points in S 1 are, given the region containing S 2 .
Kullback-Leibler divergence: The KL-divergence, or relative entropy was a test introduced by
Kullback & Leibler (1951) to apply an information-theoretic approach to the problem of detecting divergence of two samples by attempting to quantify the amount of signal (or information) that one could use to distinguish between the two.
For instance, given two distributions P and Q on R with densities p and q , this quantity is given by
[Equation]
A problem that needs to be solved to apply the KL-divergence to our samples is to ﬁx a method of density estimation.
A suggestion by Wang et al.
(2009) is to (for some integer hyperparameter k ) approximate the density using the k th nearest neighbor of a point in each population.
This approximation is fast and easily made to be differentiable and for this reason we use it both in our loss function and as an evaluation metric.
Note that the KL-divergence is not an honest metric and in particular is not symmetric.
The forward divergence (KL-fwd) is D KL ( P || Q ) where P is the true/target distribution and the backward divergence (KL-bwd) is D KL ( Q || P ) .
One way of thinking of this difference is that D KL ( P || Q ) measures how well Q covers P and vice versa.
We include both separately in our results to give a holistic view of the performance.
Wasserstein metric: The Wasserstein family of metrics discovered in many works including (Kantorovich, 1940) and (Vaserstein, 1969) are based on the idea of measuring the amount of work that would need to be done to transport the (probability) mass of one distribution to another.
Let ( X , d X ) be a metric space and µ, ν probability measures on X .
For any p > 0 , one deﬁnes the p -Wasserstein distance between these two distributions to be
[Equation]
where Γ( µ, ν ) denotes the space of probability measures on X × X with margins µ and ν .
To implement this, we piggyback off the work of (Feydy et al., 2019), who provide a wonderful library geomloss of differentiable PyTorch implementations of many two-sample distances.
Maximum mean discrepancy: First introduced in (Gretton et al., 2012), the maximum mean discrepancy (MMD) between two samples is computed by appealing to a dual problem: consider a collection of functions F from our probability space X to R .
Then the MMD can be thought of as an expression of how “different” two distributions can look under different choices of f ∈ F .
More concretely,
[Equation]
An implementation of MMD can be found in geomloss (Feydy et al., 2019) using a single Gaussian kernel.
A. H YPERPARAMETERS
Below we document our choices of hyperparameters for our models.
‘Neural net depth/width’ describes the structure of the MLP that is used in each model (although in subtly different ways).
For our model, these parameters describe the neural nets that predict the weights and biases for our
RNVP blocks.
For the GAN models, these parameters control the size/shape of the generator and discriminator.
‘Num. neighborhoods’ is only applicable in models that compute neighborhoods to condition upon (i.e. BundleNet and CGAN-nbhd).
‘Num. invertible blocks’ gives the number of
RNVP blocks and only applies to our architecture.
‘Num. circular priors’ again only applies to our model and implicitly deﬁnes the number of Gaussian priors we use as well.
The formula is
B + 2 C + G = D where C is the number of circles, B the dimension of the output data, G the number of Gaussian priors, and D the total/latent dimension.
Mathematically, the combination of one-dimensional priors represents a (tensor) product of distributions, but in practice this has a simple form.
For each neighborhood, data from the bundle is pushed forward through the encoder to get sample statistics including the coordinate-wise means and standard deviations as well as the mean and standard deviation of the magnitudes for each circular prior.
These sample statistics are used to pick a radius for each circular prior and to reparameterize a standard normal distribution for the Gaussian priors.
Every circle is encoded in two parameters as a circle with the radius determined above and every Gaussian (again, formed using sample statistics) occupies a single parameter.
The values are sampled independently from their respective distributions and then concatenated into a vector in latent space representing a sample from D Z .
[Table]
A.3. E FFECT OF NUMBER OF NEIGHBORHOODS ON GENERATION
In this section we explore how the number of neighborhoods used to partition Y affects the (global and ﬁberwise) generative performance of BundleNet.
We note that for both synthetic datasets the topological character of the inverse images of neighborhoods in input space X changes dramatically as one moves from a single neighborhood (corresponding to a global trivialization) to two or more open neighborhoods.
When we use a single neighborhood U
=
Y
[Table]
then π − 1 ( U ) is of course a torus or M¨obius band respectively.
When we use two or more neighborhoods, π − 1 ( U ) admits a deformation retraction onto the circle S 1 in the case of the torus
[Table]
and is contractible in the case of the M¨obius band.
Under the assumption that a space becomes easier to model as its topological complexity decreases, we hypothesized that we would see a signiﬁcant improvement in performance when moving from 1 to 2 neighborhoods, but would not see substantial improvements afterwards.
[Table] [Table]
The results of our tests (found in table 6) ﬁt well with our observations about topological complexity.
We ﬁnd that global generative performance seems not to be strongly tied to the number of neighborhoods but that ﬁberwise performance increases dramatically as one moves from 1 toneighborhoods.
For any number of neighborhoods greater than 2 we do not see a particular improvement to either global or ﬁberwise performance.
These results suggest that the use of local trivializations is mainly helpful for the task of modeling ﬁbers themselves, but may not be as critical to modeling the distribution as a whole.
Note that this is somewhat in contrast to the improved performance of CGAN-local over CGAN, which indicated that at least within the GAN framework, use of local neighborhoods was helpful for both global and ﬁberwise metrics.
A.3. E FFECT OF TOPOLOGICAL PRIOR CHOICE ON MODEL PERFORMANCE
In this section we examine how the choice of topology for the priors (circles
Gaussians) affects generative performance in the wild.
Recall that we found a slight advantage to using circles when exploring our synthetic datasets in section 6.
We trained BundleNet using a 18-dimensional latent space with different numbers of circular priors (with the rest of the parameters one-dimensional
Gaussians).
The results can be found in table 7 and ﬁgure 5.
For the most part, these results show that
Airfoil Noise generative capacity is not strongly affected by the number of circular priors chosen.
We hypothesize that this is due to two factors: ﬁrst, this dataset is a difﬁcult one (for instance, we see that the margins between different models are very slim) and second, there are no parameters in this dataset that are naturally modeled as a circle.
The fact that we saw better performance on our synthetic datasets suggests that there is still value to tuning this hyperparameter depending on the data under consideration.
We believe that the relative invariance BundleNet shows to choice of priors speaks to the robustness of our model to a wide array of hyperparameter choices.
A IRFOIL GENERATION
[Table]
[Figure]
A COMPARISON B UNDLE N ET AND OTHER MODELS
[Figure]
We begin this section with a visual and qualitative analysis of the performance of BundleNet,
WGAN, CGAN and CGAN-local models on our synthetic datasets.
The images in this section are restricted by being 2D projections of 3D point clouds, but they should serve to help illustrate why the tables in section 5.2 and section A.5 appear as they do.
Perhaps the most immediate observation that can be made is that CGAN suffers a complete collapse on the torus dataset.
This corresponds to high loss in both the global and ﬁberwise regimes (it is the worst-performing model on this dataset).
CGAN does considerably better on the M¨obius band dataset (it is the second-best performing according to the Wasserstein-1 metric, c.f. table 1).
Even in the case of good global generation metrics, however, CGAN fails to capture ﬁber structure, as can be seen in the way that different colors which should be localized to speciﬁc sections of the band, are distributed throughout the reconstruction.
We discuss this failure more carefully below in section A.4.1.
We also discuss how we attempted to train CGAN in different ways so as to make it more amenable to ﬁber discovery.
Of all the GAN architectures, the reconstructions generated by CGAN-local appear to be the most faithful to the true distribution.
Nevertheless, one can detect ways that CGAN-local’s reconstructions deviate from the torus and M¨obius band respectively.
In both reconstructions, CGAN-local tends to cluster neighborhoods together giving the resulting visualization a “banded” quality.
Note that the bands in the Bundlenet torus are not due to a similar failing, but are actually visible indi- vidual ﬁbers (100 evenly-distributed ﬁbers around the base circle).
This behavior could account for
CGAN-local’s (relatively) poor global generative performance in the main results.
We also see an intriguing failure in CGAN-local’s reconstruction of the M¨obius band where some of the ﬁbers are smeared outside of the band’s bounds.
We speculate that this smearing occurs because CGAN-local struggles to capture the twist in the band.
This can also be seen in the sliced torus in ﬁgure 4, which we analogously hypothesized was related to the singularity present where the ﬁber becomes a point.
An interesting avenue for further research is how topology affects the ability of a generative model to approximate a distribution.
WGAN is somewhat unique among tested architectures in that it does not incorporate a conditional aspect to learn ﬁbers over a point.
As such, the point clouds generated by WGAN map basepoints uniformly throughout the generated data.
WGAN has a difﬁcult time recreating the circular ﬁbers for the torus dataset
[Table]
but gives a reasonable reconstruction of the M¨obius band.
Again, these visualizations align with our quantitative results.
A.4. CGAN, FIBERS , AND TRAINING
[Table]
In this section we focus on CGAN and its failure modes on our synthetic data.
We show how we can improve CGAN by leveraging some of the same methods developed for BundleNets.
To this end, we document our attempt to explore two different training strategies for CGAN, which we designate
CGAN-local-mixed and CGAN-local.
In both incarnations, we compute neighborhoods of Y and their representatives and then use these representatives to condition upon.
During training, one of two natural choices can be made: constrain each batch to points from a single neighborhood or sample each batch from across all neighborhoods.
We call the former CGAN-local and the latter
CGAN-local-mixed.
We view the progression from CGAN to CGAN-local-mixed to CGAN-local as capturing the development of a conditional generative architecture that is better suited to the ﬁber task.
Furthermore, we see the poor performance of CGAN-local-mixed as evidence that BundleNet’s performance cannot be attributed simply to reducing the conditioning set from a continuum to a ﬁnite number of neighborhood representatives.
The results in table 8 document the relative performance of these models on the torus dataset.
We see that the na¨ıve CGAN is poorly suited to the task and that switching to neighborhood conditioning with CGAN-local-mixed degrades performance across several metrics.
On the other hand, restricting each batch to a single neighborhood (CGAN-local) results in a model that performs much more reasonably (but still inferior to) BundleNet.
We view CGAN-local as our best effort to equip a GAN with the power to perform the ﬁber generation task without fundamentally altering the architecture.
Thus this serves as our primary point of comparison in the main paper.
A. F ULL RESULTS
Below we recreate the full table of results with all metrics tested.
[Table]
[Table] [Table]