Full text
Topological Expressiveness of Neural Networks Topology of Learning António Leitão Dissertation submitted in partial fulfillment of the requirements for the degree of Master of Science in Data Science and Advanced Analytics
Information Management School Universidade Nova de Lisboa Topological Expressiveness Of Neural Networks António Leitão Dissertation submitted in partial fulfillment of the requirements for the degree of Master of Science in Advanced Analytics. February, 2021
This work was done under the supervision of: Giovanni Petri Senior Research Scientist ISI Foundation, Turin, Italy [email protected] Flávio Pinheiro Assistant Professor NOVA IMS, Lisbon, Portugal [email protected] Peer-reviewed publications resulting from this work: Giovanni Petri and António Leitão . "On the Topological Expressive Power of Neural Networks" In: NeurIPS 2020 Workshop on Topological Data Analysis and Beyond. 2020 https: //openreview.net/forum?id=I44kJPuvqPD António Leitão and Giovanni Petri, "On the Topological Complexity of Decision Boundaries", 50th Scientific Meeting of the Italian Statistical Society, 2020, pp. 588-594 v
Acknowledgements First and foremost to my family, in particular my brother Zé and my wonderful girlfriend Giulia. All have enthusiastically supported me even though their collective insight about my academic life is a vague memory of my high-school graduation. Except you dad, of course, because tuitions are a thing. To Giovanni Petri in particular, for teaching me basically everything that is in here. For patiently putting up with my strange ideas: the many that failed and the some that almost didn’t. I believe that this work is as much his as it is mine. I thank not just him but also his whole Topological Data Analysis group at ISI Foundation in Turin: Jacob, André, Alan, Chiara, Paolo and Rossano. Who were very welcoming during my period there, however brief. Lastly I would like to thank Flávio Pinheiro for his supportive and insightfull comments as well as Nuno Alpalhão and Daniel Alcântara for their useless ones. All illustrations where done by the author. vii
Abstract Given a neural network, how many different problems can it solve? This important and open question in deep learning is usually referred to as the problem of the expressive power of a neural network. Previous research has tackled this issue through statistical and geometrical methods. This work proposes a new method based on a topological perspective. Topology is the field of mathematics aimed at describing spaces and functions through robust characterizing features. Topological Data Analysis is the young field developed to extract topological insight from data. We first show that topological features of the decision boundary describe the closest notion of the intrinsic complexity of a classification problem. These topological features divide classification problems into several equivalence classes. Linear-separability is an example of such a class. We establish the topological expressive power of a network architecture as the number of different topological classes it is able to express. Being a novel work in a young research field, most of the thesis is devoted to developing this perspective and creating the tools required. The main objective of this thesis is to tackle neural network’s understanding in general and architecture selection in particular, through a novel approach. Our results show that topological expressiveness has a complex correlation with many features in a neural network’s architecture depending weakly on the total number of parameters. Some of our results recapitulate previous research on geometrical properties, while others are unique to this novel topological point of view, sometimes challenging previous research. Keywords: Topological Data Analysis, Neural Networks, Machine Learning, Decision Boundary, Persistent Homology, Voronoi Diagram. ix
LIST OF FIGURES 3.9 Common pipeline of topological data analysis. Consider that data comes from an underlying manifold (left), create a filtration of simplicial complexes (center). Compute persistent homology of filtration and other topological summaries such as the persistence diagram (right). .......................... 27 4.1 Two different classification problems where classes have the same topology however (b) is linearly separable while (a) is not. .................... 31 4.2 Illustration of a Voronoi diagram (dotted line) along with the decision boundary (solid line) of two classes (black and white). ..................... 31 4.3 Example of the algorithm with just one sampled point (black), orange and green represent points of different classes. The Voronoi Diagram represented in grey. It first finds it closest neighbours of different classes and then projects the point to the orthogonal hyperplane. .............................. 33 4.4 Example of the decision boundary sampling algorithm over 3 epochs. First we sample N points uniformly distributed (black) (a). Each point is then pushed to the hyperplane orthogonal to the closest neighbours of each class (orange and green). The process is repeated 3times (a)→(b), (b)→(c), (c)→(d). ........ 33 4.5 Sampled points in the decision boundary (black). Along with the Voronoi diagram. Note that all points lie on the edges of the Voronoi cells belonging to points of different classes (orange and green). ......................... 34 4.6 Comparison of the time complexity of our proposed sampling method and the common calculation of the Voronoi diagram for varying dimensions (a) and number of points (b). For comparison there are also the time complexities of the standard SVM algorithm O(n2d+n3) and Linear Regression O(nd2+d3) . Note the logarithmic scale on both axes. ......................... 35 4.7 Left: Sampling 20,50,100 and 200 points (black) in the decision boundary of two classes (orange and green). Center: The persistence diagrams associated to each set of sampled points (from the decision boundary). Right: The Wasserstein Distance matrix of the H1 persistence diagrams of decision boundaries sampled from 10 to 1000 points. ................................... 36 4.8 Illustration of decision boundary with trivial homology and decision boundaries with increasing H0and H1homology groups. ................... 36 4.9 Illustration of topological complexity measure. ................... 37 4.10 (a) Average (30 runs) number of epochs to reach 95% accuracy on binary classification problems of different complexity, for different architectures. (b) Example problem H0=H1= 4.................................. 38 4.11 Comparison of two persistence diagrams, a) has one very persistent homology class, while b) has many but with non-relevant persistence, normally regarded as noise. .......................................... 39 xvi
LIST OF FIGURES 4.12 Topological complexity of a series of persistence diagrams with increasing noise- to-data ratio. (a) compares the stability for different p values of the p− Wasserstein distance used to compute topological complexity. (b) is a sample of the persistence diagrams corresponding to the noise-to-data ratios: 0, 1, 20 and 100 ....... 39 5.1 Comparison of persistence diagrams of a metric space (a) and the same but scaled by a factor of 3. The persistence diagrams are calculated using standard Vietoris- Rips filtration, and also using the presented novel approach UDiPH (Uniform). . 44 5.2 Illustration of a standard Vietoris-Rips filtration (a) where the filtration parameter is the ambient metric, or (b) the metric constructed using UDiPH. ........ 45 5.3 Example of the assumption of uniform distribution. In both scenarios the balls represent have all radius one. with respect to the ambient dimension a), or to a Riemannian metric b). ................................. 47 5.4 Illustration of different local metric spaces (grey circles) resulting in non symmetric distances between points (dotted lines) since both circles have the same radius. ......................................... 48 5.5 Persistence diagrams before and after a similarity transformation, using standard Vietoris-Rips filtration (top), and UDiPH (bottom). ................. 50 5.6 Persistence diagrams before and after an affine transformation, using standard Vietoris-Rips filtration (top), and UDiPH (bottom). ................. 50 5.7 Persistence diagrams before and after an continuous transformation (Hyperbolic Tangent), using standard Vietoris-Rips filtration (top), and UDiPH (bottom). . . 51 5.8 Wasserstein distance matrix of persistence diagrams computed using UDiPH for H0(left) and H1(right). ................................ 52 5.9 A (shallow) Neural Network learning a linearly separable embedding of the input space. Images courtesy of Olah [80]. ......................... 53 5.10 The Neural Network learning an embedding that separates two entangled manifolds (classes). Image from Naitzat et al. [78] .................... 54 5.11 Topological complexity H1 of the decision boundary in different layers of Neural Networks of different architectures (each row). The number of neurons in each layer is represented by the grey bars. Each orange line corresponds a Neural Network trained to 95% accuracy on the MNIST dataset, the black line represents the median of 30 runs. Note that when using standard Vietoris-Rips filtration, the persistence homology depends on the metric, as such persistence values are higher in higher dimensional spaces. This explains why the number of neurons heavily influences the persistence values ( left ). UDiPH creates a metric-invariant simplicial filtration allowing us to safely observe the correct trend. (right). . . . 55 5.12 Topological complexity (y-axis) of the decision boundary of two classification problems: MNIST (circles), Fashion-MNIST (squares). Each color represents one different activation function. ............................. 56 xvii
LIST OF FIGURES 5.13 A family of functions that can only represent a straight line can solve any permutation of 3 points (a), but fail at 4 points (b). It’s VC-Dimension is equal to 3. ............................................ 56 5.14 Illustration of increase of linear regions defined by successive layers of a Neural Network as described by Montúfar et al. [74], along with an illustration of the trajectory growth on of a circle along successive layers (bottom). Images from Poole et al. [86]. .................................... 57 5.15 The decision boundaries of two paths in the parameter space of two different architectures. A very simple one F0 (top row) and one with one hidden layer (bottom row). ...................................... 58 5.16 Illustration of the pipeline to obtain the persistence diagram of the decision boundary of one element belonging to some architecture F............... 59 5.17 Illustration of the pipeline for evaluating the topological expressive power of an architecture. We sample parameter vectors w,u,v . From the resulting Neural Networks fw,fu and fv we compute the persistence diagram of their decision boundaries and create a metric space. ........................ 59 5.18 Embedding of the metric space (P ,W2) corresponding to a specific architecture. The metric space is composed ofthe persistent diagrams ofthe decision boundaries of a Neural Network along with the Wasserstein distance. The architecture has two hidden relu-activated layers of 10 neurons. The spread of this metric space is our measure of the topological expressive power of this architecture. ...... 60 5.19 Spread of two metric spaces corresponding to a shallow and wide architecture and a deep one. The x-axis represents the number of points sampled and used to calculate the spread. .................................. 61 5.20 Spread values for Neural Networks as a function of their width (number of neurons) and depth (number of layers). ......................... 62 5.21 Comparison with previous measures of expressive power. a) The VC-Dimension of the previous architectures as computed by Bartlett et al. [7]. b) The upper bound of the number of linear regions expressed by the same architectures as computed by Montúfar et al. [74] and Poole et al. [86], note the logarithm scale on the y-axis ...................................... 62 5.22 Average topological complexity over the 2000 sampled decision boundaries for each architecture. Notice the correlation with the spread values in Fig. 5.20 . . . 63 5.23 Average topological complexity versus spread. (Pearson’s correlation value in the legend) ......................................... 63 5.24 How the spread (y-axis) changes with respect to the total number of parameters (x-axis). Each line represents architectures of 2 - 10 layers of 10, 20, 50 and 100 neurons each (colors). Note the logarithm scale on the x-axis. The grey line highlights the fact that there are Neural Networks with the same spread but vastly different number of parameters. ........................... 64 xviii
LIST OF FIGURES 5.25 Spread values for 200 architectures with the same number of parameters (5000) along with their depth (color of each point) and width (size of each point). . . . 64 5.26 Pearson correlation values between the depth of a network (a) and width (b) with both H0and H1spread, where total spread is equal to qH2 0+H2 1......... 65 5.27 Effect of input dimension on the total number of homology classes H1 and H2 . For each dimension we generated 100 samples of 1000 randomly generated points. (b) show the number for each value of the filtration parameter, while (a) shows the sum over all values. ................................ 65 5.28 (a) Influence of number of homology classes on topological complexity. (b) How the behaviour ofthe Euclidean metric influences the spreadfor different dimensions. 66 5.29 Spread values for Neural Networks with different input dimensions. Both Neural Networks have 5 layers of 5 and 10 neurons each. The persistence diagrams were computed using UDiPH so that the spread values are comparable. ........ 66 B.1 Logarithm of totalnumberofpossible architectures (y-axis logNp ) of p -parameters (x-axis) compared with the upper bound (red) ................... 92 xix
List of Tables 5.1 Wasserstein distance between X and Y for different homeomorphic functions f:X→Y . We compare the H0 and H1 homology as the functions always had input domain R2 . For affine transformations random matrixes were used and such the result is the mean of 20 runs and along is the standard deviation. ....... 51 xxi
Chapter 1 Introduction I do things like get in a taxi and say, "The library, and step on it.” -David Foster Wallace (Infinite Jest) 1.1 An Oncoming Plateau In August 31st 1955, leading information theorists John McCarthy, Marvin Minsky, Nathaniel, Rochester, and the father of information theory himself, Claude Shannon proposed the Dartmouth Summer Research Project on Artificial Intelligence. Their objective was "Thatevery aspect of learning can be principled so precisely that a machine can be made to simulate it". In other words, to create Artificial Intelligence1. To say they have failed would be inaccurate. Having witnessed the explosive progress of machine learning at the time, such as the first chess playing program and the self-taught checkers program. (Schaeffer [92]) their optimism was not unjustified. Not much later, disappointment and cynicism led to funding costs and loss of interest in the A.I. field. In the late 1970s renewed interest fuelled new funding and research in the area, prompting the creation the American Association of Artificial Intelligence. In 1984 the hype had spiraled out of control, and the funding cutbacks and the downfall in research led to the collapse of the A.I. industry in 1987 (Crevier [33]). At the expense of being mediatic, data science has accepted several captivating terms that fuel misconceptions. Pseudo-scientific buzzwords such as Big Data and Curse of Dimensionality symbolize existing dilemmas yet are misleading because they place the blame on the data, when in fact these are symptoms of outdated methodologies. Big Data conveys the idea that data is immense, when in fact it is our existing methods that cannot handle its complexity. Curse of Dimensionality misleads one into thinking that 1This was the first instance the term Artificial Intelligence was used. 1
CHAPTER 1. INTRODUCTION high dimensional data behaves abnormally, when it should instead lead one to question: why care so much about dimensions after all? The hype coming from past results has created a stubbornness in the methods of Data Analysis. Holding back to previous achievements, existing approaches are not being updated to keep up with the exponential increase in data complexity. The inevitable shortcomings of these same approaches have been blamed on the data (using terms previously discussed) making one believe that our ability for analytical insight is somehow asymptomatic. This inevitably leads to cynicism and loss of interest, so much that there is now talk of a third "A. I. winter". This is disheartening since, historically, mathematics has always been ahead of the curve, solving problems years before their applications have been found (such as ellipses). The restrictions that standard data analysis poses on data (such as the assumption of linearity) have not been relaxed from their early insights. Yet what we come to expect from these same models has increased in complexity by orders of magnitude e.g. predicting the market price of a house versus expecting autonomous driving. There are those who question if the mathematical formalisms of geometry and statistics are sufficient. It might happen that the nature of the data cannot be expressed as a summary of pairwise interactions, in this case geometry which is the study of distance functions, captures only accidents on the data. There are many arguments to believe in that insufficiency of purely geometrical methods: 1. Quantitative characterization is insufficient. The most recurrent problem with big amounts of data is that one does not know what to look for. Data has knowledge but the way it is presented assumes many forms. As such the first insight must be to extract a robust characterization of the data. For example Carlsson [20] presents the example of studying diabetes data. Before developing qualitative insights, the necessary first step is to understand that the disease has 2 very different types. 2. Metrics are not theoretically justified. A metric completely governs the behaviour of a whole space. It makes no distinction between local and global scales. Real world scenarios rarely display the same rules, specially when human interactions are involved. More often than not, in areas such as biology or economics, the global structure is defined by a juxtaposition of local behaviours (for example Adam Smith’s Invisible Hand) and not necessarily by pairwise interactions. 3. Coordinates are not natural. Although data is arranged into vectors, it does not indicate that coordinates are always meaningful, orthat these emerge naturally. The idea that coordinates carry intrinsic meaning is sometimes hindering since itis to be expected that fundamental properties resist coordinate changes. The superior performance of Convolutional Neural Networks (CNNs) can be attributed to this. Before CNNs a 28×28 pixel image was handled as a vector of 756 dimensions. 4. Intrinsic properties should not depend on extrinsic factors. In geometry, a sphere does not exist in of itself, only lying in an Euclidean space. Geometry considers objects 2
1.2. THE ADVENT OF TOPOLOGY always within a bigger space and never as a space of theirown. This extrinsic view, while more intuitive, is not natural for the object in question, since its intrinsic properties are defined depending on the surrounding space that it is laying on. 1.2 The Advent of Topology Topology is a recent field in Mathematics, going back less than 300 years. It is the study of properties of spaces that are invariant under continuous transformations. Topological methods aim to describe spaces and functions through characterizing features without the concept of distance. Therefore, spaces with very different geometries can be considered equivalent. Topology surfaced from the necessity to generalize rigorously structural notions such as continuity, compactness and connectedness Topological Data Analysis (TDA) is the recent approach to Data Science through the methods and perspective of Topology. The reasoning is that topological methods directly confront the previously exposed handicaps of geometrical methodologies. Below is a brief reasoning why TDA is appropriate to solve each of the points presented above: 1. Characterization. Topology was built 2 precisely to study qualitative features of spaces and transformations. Topological Data Analysis extends these methods to points clouds as to extract these very same qualitative properties. Since Topology is a theoretically soundand wellstructuredfield, its translation to data analysis generally provides reliable results. 2. Absence of Metric. Topology conveys a notion of nearness through nested subsets and not through pairwise functions. As such manages to describe robust global identities (shape) through local concepts. This insensitivity to the metric grants topological features an invariance to continuous transformations. 3. Coordinate free. Topology only studies properties that do not depend on chosen coordinates. This is due to the fact that Topology considers objects as spaces on their own. For this point of view it is obvious that coordinates can be forfeited in most cases. 4. Intrinsic point-of-view. With the advent of topology (and Differential Geometry) geometric objects started being considered as spaces of their own. The previously extrinsic point of view only acknowledged the existence of such spaces when embedded in bigger ones, where one could "move outside"the space. While the extrinsic view is more visually intuitive, the intrinsic is more flexible and descriptive albeit less intuitive. Topological Data Analysis has increasingly gained interest in research and traction in its applications. From dimensionality reduction (McInnes et al. [67]) to signal analysis (Perea and Harer [84]), from graph reconstruction (Cerri et al. [24], Biasotti et al. [12]) to computer vision. Among many other, it has found widespread success notably on complex network 2some argue the correct verb is discovered, author included. 3
CHAPTER 2. TOPOLOGY 2.3 Dimension The geometric concept of Dimension is the minimal number of variables necessary to describe each point of a space. However take for example the plane R2 and the real line R , since both have the same cardinality it is possible to describe each point in the plane with a correspondent point in the number line. Then what is the dimension of R2 ? It is possible to repeat such a process with any two sets of the same cardinality. Meaning every point in Rn can be described by an element in R for any n. Space filling curves, such as the Hilbert curve, are an example of this process. A ndimensional Hilbert curve defines a map between n -dimensional space and one-dimensional space. Thus one can understand there is an underlying concept in dimension that is not captured by the geometric perspective alone. The Topological definition of dimension can be motivated by understanding where Hilbert Curves fail. Every space filling curve hits some points multiple times. The multiplicity of these overlaps directly depends on the dimension of the space being mapped. This idea is the basis of the definition of dimension. Definition 2.3.1 (Refinement) . Let U be an open cover of X . We say that V is a refinement of Uif Vis a cover of Xand every set in Vis contained in some set of U ∀V∈V ∃U∈U V⊆U(2.2) Note that there is a small difference between a subcover and a refinement. Every subcover is a refinement however the reciprocal is not true. Informally, a subcover “preserves the open sets” while a refinement can make them “smaller”. Corollary 2.3.2. If Vis a subcover of Uthen Vis a refinement of U Intuitively the dimension of a cover is the minimal number of overlaps reached through cover refinements (minus one). For example the covering dimension of a circle is 1 because given an arbitrary cover, it is not possible to find a refinement that does not contain a point belonging to 2 open sets. Figure 2.1: Illustration of cover refinements of a 1−dimensional space. Definition 2.3.3 (Lebesgue’s Covering Dimension) . The covering dimension of a space X is defined as the minimum number n such that any open cover U of X has a refinement V where any point belongs to at most n+ 1 open sets of the cover. 10
2.4. MANIFOLDS Example 4. The covering dimension of Rnis equal to n. Theorem 2.3.4. Homeomorphic spaces have the same covering dimension. We turn back to the space filling curves and those overlaps that motivated the definition of Covering Dimension. They are in fact surjective however these same overlaps are the ones that prevent a space-filling curve to become a bijection . No space-filing curve is a bijection because that would make it a homeomorphism between spaces of different dimensions. 2.4 Manifolds Manifolds are some of the most intuitive topological spaces. They serve as higher-order generalizations of familiar structures like curves and surfaces. Definition 2.4.1. An-manifold is a topological space1that is locally homeomorphic to Rn Being locally homeomorphic to Rn means that there exists a cover U= (Ui)i∈I of M and a set of homeomorphisms φi:Ui→Vi⊆Rn where Vi is an open set. To each pair (Ui,φi) we call a chart and to the colletion of all charts we call an atlas . It is common to work with smooth manifolds in order to define derivatives. If such is the case we require that the following maps be smooth for all i,j. φi◦φ−1 j:φi(Ui∩Uj)→φj(Ui∩Uj)(2.3) Figure 2.2: Illustration of a Manifold (left) along with homeomorphisms φi,j that map open sets (Ui,Uj) from the manifold to an corresponding subsets of the 2− dimensional Euclidean plane R2(right). Example 5. A1−manifold is called a curve and a 2−manifold is called a surface. Theorem 2.4.2. The dimension of an n-manifold is equal to n Example 6. Consider the n -Sphere, denoted by Sn , which is the set of all points in Rn+1 that are at the same distance from the origin. S1 is a circle, S2 is the surface 1 The space is assumed to be Hausdorff and second countable. The reader is encouraged to ignore these terms if unfamiliar. 11
CHAPTER 2. TOPOLOGY of a sphere. The dimension of Sn is always n . This fact becomes intuitive when one considers the surface of the Earth. At local scales it looks like a flat surface. This relation is actually homeomorphic, meaning at a local level the surface actually behaves as the Euclidean plane, where the shortest distance between two point is a straight line. It is possible to map homeomorphically a portion of its surface into a plane, if it is sufficiently small. This is the intuition behind the chart. However its not possible to use that same projection in every small portion of the sphere, and definitely not for the whole sphere. Example 7. A very trivial example of a n -manifold is Rn itself, or any open set of Rn. Proposition 2.4.3. Homeomorphic manifolds have the same dimension. 2.4.1 Riemannian Manifolds Definition 2.4.4 (Tangent Space) . Let M be a m -manifold embedded in Rn . Consider γ∈C∞ such that γ:]−,[→M is a path in M . Let p∈M be the point where γ(0) = p . The tangent space of Mat point pis the set: Tp(M) = {γ0(0)}(2.4) The tangent space is the set of all vectors of Rn at p that are the derivatives of any curve passing through p. It may be hard to understand what does the derivative of γ(0) represent when M is not embedded. Let (U,φ) be a chart at point p . Meaning U is an open set with p∈U and φ:U→V⊆Rn a homeomorphism. Then φ◦γ defines a curve in Rn and (φ◦γ)0(0) is its tangent space. Figure 2.3: Illustration of a Tangent Space Theorem 2.4.5. The tangent space Tp(M) of an n− manifold M is a n− dimensional vector space. 12
2.4. MANIFOLDS Within this vector space it is possible to construct an inner product and define a metric g . The construction of these structures are beyond the scope of this thesis (and would require an entire devoted chapter). However the reader is pointed to O’Neill [81] and Carmo [22] for a good introduction in differential geometry, and to Crane et al. [32] for an introduction to its discrete applications. Definition 2.4.6 (Riemannian Manifold) . A Riemannian Manifold is a a smooth n -manifold with a inner product gpon the tangent space Tp(M)for every p. The interesting catch of Riemannian Manifolds is that this inner product defines a different metric for each point pin the Manifold. We will use this construction on Chapter 5. 13
Chapter 3 Topological Data Analysis Topology! The stratosphere of human though! In the twenty-fourth century it might possibly be of use to someone..." -Aleksandr Solzhenitsyn (First Circle) Topological Data Analysis (TDA) is the branch that employs the perspective and tools of Topology into data science. However data is often presented as point clouds or images, never explicitly as topological spaces. For example, if one were to analyze the number of connected components of a point cloud with 100 points, it would come as a conclusion that there are 100 different connected components. As such, the fundamental step in Topological data analysis is to infer and reconstruct, from a discrete sample, the data manifold; a continuous space from where the data has been sampled and from where we can extract topological insights. 3.1 Manifold Hypothesis Inferring a governing mathematical structure from a discrete set of observations is a common approach in data analysis, for example, statistics aims at approximating a distribution from a set of observed samples. It is then no surprise to see the same approach being applied in Topological Data Analysis, summarized under the following assumptions: 1. Data has shape ; we assume that the data, represented as a point cloud, has been sampled from a manifold. 2. Shape matters ; meaning the topological properties of said manifold carry relevant (if not fundamental) information. These assumptions have been condensed and popularly regarded as Manifold Hypothesis. Proposition 3.1.1 (Manifold Hypothesis) . Real-world data lie on low-dimensional manifolds embedded within a high-dimensional space. 15
CHAPTER 3. TOPOLOGICAL DATA ANALYSIS There are many theoretical (Carlsson et al. [21] and Lui et al. [65]) and empirical (Carlsson et al. [21], Fefferman et al. [41], Lui et al. [65], and Olah [80]) indicators that the Manifold Hypothesis is reasonable. For example, Carlsson et al. [21] showed that the space of natural images is a Klein Bottle, and Fefferman et al. [41] tested the theory to be acceptable up to a given degree of certainty. It is also the basis for many non-linear dimensionality reduction algorithms that first reconstruct the manifold, and only then embed it into lower dimensional spaces such as Locally Linear Embedding (Saul and Roweis [91]), IsoMap (Tenenbaum et al. [101]) and more recently UMAP (McInnes et al. [67]). The collection of methodologies that aim at reconstructing this lower dimensional manifold from data are called Manifold Learning algorithms. Such algorithms attempt to fit data sampled from high dimensions into low dimensional manifolds. An intuitive example would be linear regression where one tries to fit a line (1 dimensional manifold) onto a collection of 2-dimensional data points. Manifold Learning however is more generally used in the case of non-linear algorithms, though the principle is the same. This first step of manifold learning is essential to TDA. An inaccurate reconstruction (as we will see) might drown any relevant topological features or fail to capture them altogether. Regardless of the approach, manifold reconstruction is generally done through the use of simplicial complexes. 3.2 Simplicial Complexes We now explore the task of creating a continuous topological structure from a discrete set of points. Take two points x,y ∈Rn . Each one of them is what we call a 0 -dimensional simplex. One can create a continuous object by considering all the points between them: σ=t0x+t1ysuch that t0+t1= 1 (3.1) We have created now a continuous interval by adding the line between x,y, which in turn is called a 1 -dimensional simplex. Similarly one can create a 2 -dimensional simplex with three points (x,y,z)and considering the convex set created by them: σ=t0x+t1y+t2zsuch that t0+t1+t2= 1 (3.2) Note that each n -dimensional simplex includes also all other possible simplices of lower dimension. Figure 3.1: Illustration of simplicies of dimension 0,1,2 and 3. 16
3.2. SIMPLICIAL COMPLEXES Definition 3.2.1. Let S be an affine subspace of dimension n. A is said to be convex if t0x+ (1 −t0)y∈A∀x,y ∈S and 0≤t0≤1 . The smallest convex set that contains A is called the convex hull. Definition 3.2.2. We call n-simplex the convex hull in Rm of n+1 points v0,...,vn in general position1. The points v0,...,vnare called the vertices and the simplex is given by: ∆n={(t0,...,tn)∈Rn+1 |Piti= 1 and ti≥0}(3.3) A simplicial complex is a structure built by “glueing together” a collection of simplices of different dimensions. Definition 3.2.3 (Simplicial Complex) . A simplicial complex, denoted as ∆ -complex, is a collection of n -simplicies closed under the restriction: for each simplex σ∈∆ , all its subsets are also in ∆. One can think of ∆ -complexes (simplicial complexes) as higher order generalizations of graphs, or better yet, graphs as ∆ -complexes containing only simplices of dimension 0 (vertices) and1 (edges). When creating a graph the same restriction applies: foran edge ( 1 -simplex) to exist it requires two vertices (0-simplex). Given a set of elements of a space it is possible to construct many different simplicial complexes (just like graphs). The main approach is to take a finite cover of the space and create higher order simplices depending on the intersections of that cover, i.e. add a 1-dimensional simplex whenever the intersection of two sets if not null. The different possibilities on how to do this process give rise to different famillies of simplicial complexes: alpha (Edelsbrunner et al. [38]), tangential (Boissonnat and Ghosh [14]), witness (Silva and Carlsson [94]) and cover complexes such as Mapper (Singh et al. [95]), and the most commonly used Čech Complex and Vietoris-Rips complex (Vietoris [105]). In light of our later applications we focus on the last two. 3.2.1 Čech Complex Given a cover U= (Ui)i∈I we can construct a simplicial complex from U by adding a 1 - dimensional simplex (a line) for each intersection of 2 sets, a 2 -dimensional simplex (a face) for each intersection of 3 sets, etc. One can see that this is a simplicial complex because every time we have a non-null intersection of three sets (a 2 -simplex) it means that the pairwise intersections of these sets are also non empty (all its 1-simplexes). Informally, this processes can be described as adding a vertex for each set in the cover and then drawing a line if two sets touch, a face if 3 sets touch etc. The simplicial complex resulting from this construction is called the nerve of a cover. 1 General position is when n+ 1 points do not lie in a hyperplane of dimension less than n . Consider for example 3 colinear points, they are not in general position since they fit in a hyperplane of dimension 2, a line. 17
CHAPTER 3. TOPOLOGICAL DATA ANALYSIS Definition 3.2.4 (Nerve) . Let U= (Ui)i∈I be a finite collection of open sets. The simplex {t1,...,tk}belongs to the nerve of Uif Ut1∩,...,Utk,∅. The nerve of a cover is a simplicial complex generally called Čech Complex . The Čech Complex is constructed from an existing cover of the space. In order to construct a Čech Complex from a set of points in Rn we must first build a cover. Let S be a finite set of points in Rn. Let Bx(r)be an open ball of radius rand center x∈S: Bx(r) = {y∈Rn|d(x,y)< r}(3.4) We now create one open ball centered at each point and with radius r . We then take the collection B= (Bx(r))x∈S . The nerve of this collection is the Čech Complex of radius r created from the sample S , denoted by Čech (r) . Note the important property that for r0≤r1 we have Čech(r0)⊆Čech(r1). Figure 3.2: Illustration of a Čech Complex. The simplicial complex (top) is built from a cover of open sets (middle), each vertex is a set, each edge is an intersection. These open sets are ε−balls centered in points sampled from the assumed topological space (bottom) The Čech Complex is central to Topological data analysis because it provides a strong theoretical guarantee because the topology of the nerve of a cover “is related” to the topology of the union of the sets. Informally this means that no topological features are lost or created when considering the cover and its nerve. Which means that the nerve of a “good enough” coveris, for all intents and purposes, a “very good” approximation of the space. Many theorems prove variants of such relations under different conditions, and they are collectively called nerve theorems. A good summary can be found in Meunier and Montejano [69]. 3.2.2 Vietoris-Rips Complex Informally in the Vietoris-Rips Complex, simplices are added if the pairwise distance between vertices is less than a certain threshold r . That is, the simplex {t0,t1} exists if and only if d(to,t1)≤2r . Higher order simplices are added if all its subsimplices were added too. For example a 2 -simplex (triangle) is added to the complex if all its edges also belong to the complex, which in turn belong if the distance between each vertex pair is less than 2r. 18
3.3. HOMOLOGY Let (X,d) be a metric space. Consider a sample S=t1,...tn from X , the Vietoris-Rips Complex of radius dis defined as the set: V Rr={ht0,...,tki|d(ti,tj)≤2r∀i,j}(3.5) The difference between both complexes is subtle. Vietoris-Rips complexes require only a metric space, i.e. the pairwise distance between the elements. This makes Vietoris-Rips complexes depend only on the geometry of X and not on an underlying geometry where X maybe be embedded. Consider three points in a plane at the same distance 2d from each other. V Rd would contain the face of the triangle as a 2-simplex while Čech(d) would not since there is no point present in all three balls. However if the same points where embedded in a different space where the intersection of the balls was not null, then the Čech complex would include the 2-simplex while the Vietoris-Rips would remain the same. Figure 3.3: Illustration of a Čech Complex (left) and a Vietoris-Rips complex (right) built from the same cover. Note that Vietoris-Rips complex includes the 2− simplex while the Čech doesn’t since the intersection of all three sets is null. In contrast with the Čech complex, the Vietoris-Rips is not the nerve of a cover. Therefore does not necessarily inherent the topology of the cover. However since Čech(r)⊆V Rr some properties of the nerve theorems still apply for Vietoris-Rips complexes (Latschev [59] and Hausmann [50]). Since checking for high order intersections is very computationally expensive, Vietoris- Rips complexes are much preferred over Čech Complexes, since the former only require pairwise distances. So given a dataset S as a set of points in Rn , what are then the topological properties that we can extract from this simplicial complex? How does one proceed after reconstructing the underlying “data manifold”? 3.3 Homology Informally Homology counts the number of holes of a structure. It defines an equivalence relation in topology. Meaning that it is an inherent feature of a space robust enough to characterize it under continuous deformations. This equivalence relation emerges from the 19
CHAPTER 3. TOPOLOGICAL DATA ANALYSIS 3.4.3.2 Persistence Diagrams in Machine Learning The integration of topological summaries, such as persistence diagrams in machine learning is an active and ongoing research field. The major speed bump is that the space of persistence diagrams is not a Hilbert space (Bubenik and Wagner [19]). This means that its not possible to directly apply many of machine learning methods (such as PCA, since they require the existence of an inner product). Commonly used workflows consist in first mapping the diagrams into a Hilbert space. Several approaches include maps into finite vectors (Adams et al. [1], Di Fabio and Ferri [34], and Kališnik [55]) and functional summaries (Bubenik [18] and Rieck et al. [89]) and various others (Le and Yamada [60]). Obviously such map introduces deformation and potential losses of information (Carrière and Bauer [23]) and even for p > 2 a map from the space of persistence diagrams and the p− Wasserstein distance to a Hilbert space does not even exist (Wagner [106]). Nevertheless its possible to define probability measures in the space of persistence diagrams (Mileyko et al. [70]), guaranteeing that statistics such as mean and expectations are well-defined. In this work the most complex structure we will consider is the metric space of persistence diagrams endowed with p− Wasserstein distance in Chapter 5which is a trivial construction. By assuming a simple structure we do not project on the data behaviours that might be consequence of more complex embeddings. For example, it is common to consider data as vectors in an euclidean vector space. This is a comfortable embedding yet it assumes the existence of many structures (such as inner products, vector norms, dimensions) that might be misleading for example, the embedding dimension can be completely unrelated to the intrinsic dimension of the data. 3.5 Topological Data Analysis Pipeline The common topological data analysis pipeline is as follows: 1. Obtain raw data. It can be images, time-series data, graphs and networks. Most commonly, it is presented as a point cloud, i.e a set of vectors in Rn. 2. Create filtration. From the raw data by constructing a nested sequence of simplicial complexes. For point clouds the main filtrations include: Vietoris-Rips(Vietoris [105]), witness (Silva and Carlsson [94]), Cover (Singh et al. [95]), Chech, Tangential (Boissonnat and Ghosh [14]) and Alpha (Edelsbrunner et al. [38]). For images (or other cubical data) it is common to use cubical persistence introduced by Wagner et al. [107]. For graphs, Flag Complexes (Whitney [108]), also commonly called Clique Complexes (or uncommonly, Whitney Complexes) are normally used, these are equivalent to the Vietoris-Rips complex. 3. Topological Summaries. There are a multitude of possible topological summaries to take from a filtration of simplicial complexes. The most common are the Persistence Diagrams along with the Wasserstein Distance (or Bottleneck). However many others 26
3.5. TOPOLOGICAL DATA ANALYSIS PIPELINE exist including: Persistence Landscape (Bubenik [18]), Persistence Images (Adams et al. [1]), Persistence FlameletsPadellini and Brutti [83], Heat Vectorizations (Reininghaus et al. [88]), Persistence Entropy (Atienza et al. [4]) and Betti Curves. In Chapter 4we introduce a novel one: Topological Complexity. Figure 3.9: Common pipeline of topological data analysis. Consider that data comes from an underlying manifold (left), create a filtration of simplicial complexes (center). Compute persistent homology of filtration and other topological summaries such as the persistence diagram (right). 3.5.1 Computational Overview The bulk of the computational manpower on this work has been developed in Python. There is an increasing number of libraries for topological data analysis available. These include (by order of importance to this work): Ripser (Bauer [9], Tralie et al. [103]), GUDHI (The GUDHI Project [102]) and Giotto (Tauzin et al. [99]). It is important to stress that of the large plethora of available resources, most of them are not included nor required in this project (because they were not used). The reader is pointed to the work of Otter et al. [82] for a computational overview and comparison of most of these projects. Although there is very little standardization in the field, several libraries have started to push TDA computation in that direction (such as GUDHI and Giotto). 27
Chapter 4 Classification and Topological Complexity This algorithm has been proved to work, but has never been observed to do so. -Alexander Barvinok (Illinois Mathematics Colloquium) In order to understand how many different problems a given Neural Network can solve we first need to understand what it is that makes two problems distinct. This chapter aims to define the basis of a classification problem, how previous geometric approaches have tackled the above question and above all how can we approach them topologically . The objective is to establish a baseline and build momentum for understanding topological expressiveness. 4.1 Classification Problem Let S be a sample of points of Rn . Let S be composed by a disjoint union of sets S=FCi . We call each class Ci . Without loss of generalization and unless explicitly stated, we will only consider binary classification problems. That is, situations where S=AtB. A binary classification problem can generally be considered to finding a function f:Rn→ {0,1}such that: f(s) = 1s∈A 0s∈B∀s∈S(4.1) 4.1.0.1 Characterizing Classification Problems The complexity of a problem can range from very simple, such as when the two classes can be separated by a straight line, to very hard, when classes are entangled in non-obvious ways. 29
CHAPTER 4. CLASSIFICATION AND TOPOLOGICAL COMPLEXITY Analyzing the complexity of a given problem is the necessary first step in solving it. But how to do it? A first approach by Ho [51] separates geometric descriptors of complexity into three categories: i) class ambiguity, ii) boundary complexity and iii) sample sparsity and dimensionality. The work has been extended in Lorena et al. [64] and Mollineda et al. [73] with geometrical and statistical descriptors of binary and multiclass problem complexity. In all these works, the authors recognized boundary complexity as the closest notion to the intrinsic difficulty of a classification problem. While the other categories are more symptoms of an ill-defined classification problem. However, authors did not agree on any reliable metric for measuring boundary complexity or even defining it. Note that all the approaches described so far are inherently geometrical. Our approach starts by understanding what makes classification problems similar. While it is not obvious for all types of classification tasks, there is one natural subset of problems of equal complexity: linearly separable problems. Note that this is not a measure, but an entire class of problems, regardless of data complexity, coordinates and ambient dimension. Such mantra should come familiar to the reader by now because this is describing a topological feature of an intrinsic object in classification: the decision boundary. Linearly separable problems are problems whose decision boundary has trivial homology . Following the same idea there should be a class of problems that are bi-linearly separable, i.e. that can be solved (classes can be separated) using two lines . This class would already include the XOR problem. Bi-linearly separable problems are problems whose decision boundary has trivial H1 homology (are lines) but non-trivial H0 (there are two of them). We will use this to motivate topological complexity later. Our approach is then to use Topology to capture this characterization of complexity that is inherent to its perspective. A topological approach to classification complexity has been previously proposed by Guss and Salakhutdinov [48]. The authors argue that a classification problem is complex if its classes display non-trivial homology. For example, classes with many connected components pose a more difficult challenge that those with just one. However, at difference with Guss and Salakhutdinov [48], we do not focus on the homology of each class as a measure of complexity, but rather on the homology of the decision boundary . This is due to the fact that the classes’ homology can sometimes be misleading. For example, topologically complex classes mightbe linearly separable, e.g. the task of classifying between two concentric circles is challenging not because they are circles, but because they are concentric (Fig. 4.1(a) versus (b)). 4.2 Decision Boundary 4.2.1 Necessity of Definition Characterizing the complexity of a classification problem based on the homological complexity of its decision boundary rises a big statement: all decision boundaries have the same homology. 30
4.2. DECISION BOUNDARY (a) (b) Figure 4.1: Two different classification problems where classes have the same topology however (b) is linearly separable while (a) is not. Without this assurance it is not possible to make our analysis. The problem above stems for the observation that a decision boundary is not unique . For example, support vector machines define a decision boundary that minimizes an empirical margin, while Neural Networks learn one that minimizes a user defined loss. As a first step we formally define a decision boundary as the hypersurface that maximizes the interclass distance. This construction is reasonable since any other disparity metric (for example, support) is based on distance. Under this assumption, the decision boundary we aim to approximate is the union of the edges of adjacent Voronoi cells corresponding to points of different classes and is unique. Definition 4.2.1 (Voronoi Cell) . Let (X,d) be a metric space and S={s1,...,sk} be a set of elements of X. The Voronoi cell associated with point siis the set: Vsi={x∈X|d(x,si)≤d(x,sj)∀i,j}(4.2) We call Voronoi Cover (or Voronoi Diagram) to the collection (Vs)s∈S. Figure 4.2: Illustration of a Voronoi diagram (dotted line) along with the decision boundary (solid line) of two classes (black and white). Intuitively, the Voronoi cell of a point si is the set of all the points that are the closest to si than to any other datapoint. Given two points of different classes ai,bi their edge is the 31
CHAPTER 4. CLASSIFICATION AND TOPOLOGICAL COMPLEXITY intersection of both cells. This intersection is empty unless both points have adjacent cells. In that case the edge defines a bounded hyperplane. Definition 4.2.2 (Decision Boundary) . Let S=AtB , given points of different classes a∈A and b∈Btheir decision boundary is the set: DBa,b =Va∩Vb={x∈Rn|d(x,a) = d(x,b)≤d(x,s)}(4.3) We call Decision Boundary the union: Sa∈A,b∈BDBab We call decision boundary the collection of all these edges. Therefore, for a classification problem in Rn with c classes, the decision boundary is a n−1 -manifold since it is a union of bounded hyperplanes. 4.2.2 Sampling the decision boundary. While Voronoi diagrams are fundamental structures, computing one on n points in Rd requires O(nlogn+ndd/2e) [5], making it prohibitive in high dimensions. One can bypass this hurdle by taking advantage of the fact that we do not require the complete boundary but only enough to compute its topology. Thus we introduce an algorithm to sample the decision boundary that is theoretically exact and computationally feasible for high dimensions. The central idea is to sample randomly a point and then “push” it into the decision boundary, by iteratively projecting it to the hyperspace orthogonal to its closest points belonging to different classes. Algorithm 1: Sample the decision boundary Input: A←list of points class A B←list of points of class B n←number of points to sample from boundary iteration ←number of iterations Output: Q←list of npoints in the decision boundary of Aand B Q←Sample npoints uniformly.; for each iteration do for each point pin Q do pA←Nearest Neighbour of pin A; pB←Nearest Neighbour of pin B; project pto the hyperplane orthogonal to pA−pB; p←proj(pA−pB)⊥(p); end end Proposition 4.2.3. The algorithm converges to the edges of adjacent Voronoi cells corresponding to points of different classes. Proof. By definition the Voronoi cell associated with point si∈S is the set {x∈Rn|d(x,si)≤ d(x,sj)∀i,j} . Given a point ai belonging to a class, and bi belonging to another class, we 32
4.2. DECISION BOUNDARY have that the set of points in the common edge of their Voronoi cells is given by: DBab ={x∈ Rn|d(x,ai) = d(x,bi)≤d(x,sj)}. Therefore, at a given iteration of the algorithm, if point P does not belong to the set DBab then, by definition of Voronoi cell, there has to exist a point aj (or bj ) such that d(P ,aj)< d(P ,ai) = d(P ,bi) . Therefore this point is considered the new closest neighbor in the next iteration. It follows that the algorithm only stops when all points reach the decision boundary. Figure 4.3: Example of the algorithm with just one sampled point (black), orange and green represent points of different classes. The Voronoi Diagram represented in grey. It first finds it closestneighbours of differentclasses andthen projects the point to the orthogonalhyperplane. (a) Initial uniform sampling (b) After 1st Epoch (c) After 2nd Epoch (d) After 3rd Epoch Figure 4.4: Example of the decision boundary sampling algorithm over 3 epochs. First we sample N points uniformly distributed (black) (a). Each point is then pushed to the hyperplane orthogonal to the closest neighbours of each class (orange and green). The process is repeated 3times (a)→(b), (b)→(c), (c)→(d). 33
CHAPTER 4. CLASSIFICATION AND TOPOLOGICAL COMPLEXITY (a) Concentric Circles (b) Spirals Figure 4.5: Sampled points in the decision boundary (black). Along with the Voronoi diagram. Note that all points lie on the edges of the Voronoi cells belonging to points of different classes (orange and green). 4.2.3 Complexity As stated before, calculating the Voronoi diagram of n points in Rd has a time complexity of O(nlogn+ndd/2e)[5]. Below we study the complexity of our algorithm. The method is composed of two main steps: 1. The (conditional) Neighbour Search. This step has an average complexity of O(logn) , although this can be reduced using approximate nearest neighbour methods such as Nearest Neighbour Descent (Dong et al. [35]) and HNSWLIB (Malkov and Yashunin [66]), Fig. 4.6. 2. Getting the orthogonal hyperplane. Calculating a orthonormal basis of the subspace orthogonal to a vector w∈Rd is normally done by taking the null-space of a matrix [w|0] . That is, the square matrix d×d with only one non-zero column, w . Such operation has average complexity of O(d3) , which is good but still above that subquadratic sweet-spot. It is possible however to calculate it using QR-Decomposition which approximates the orthonormal basis using a least-squares method. This method lowers the complexity to O√d, Fig. 4.6. Running our method through k epochs to calculate the decision boundary using n points in Rd has average complexity of O√d+ lognk . This is orders of magnitude faster than calculating the Voronoi diagram, making the proposed algorithm very reliable even high for dimensions (above 1000 ). For perspective, standard (Support Vector Machine) SVM has O(n2d+n3) complexity, which is known to be underperforming for high number of points. On the other hand we have Linear Regression, with its misleading name, with O(nd2+d3) complexity. This might seem surprising but Linear Regression relies on matrix inversion which is a complex task for high dimensions Fig (4.6). 34
4.2. DECISION BOUNDARY (a) (b) Figure 4.6: Comparison of the time complexity of our proposed sampling method and the common calculation of the Voronoi diagram for varying dimensions (a) and number of points (b). For comparison there are also the time complexities of the standard SVM algorithm O(n2d+n3)and Linear Regression O(nd2+d3). Note the logarithmic scale on both axes. 4.2.4 Stability The sampling algorithm was designed to enable us to compute the persistent homology of the decision boundary. As such, stability denotes how many point are needed to accurately evaluate the homology of the decision boundary. In this regard our method is inherently robust, by construction, due to two factors: 1. Fewer points are required to capture topological properties compared to geometric properties. To accurately describe a certain topological feature one does not require all the points. Consider for example a circle. It is possible to capture its topological properties with only 4 points, given that they are uniformly distributed for example this is the basis of the Witness Complex (Silva and Carlsson [94]). In practice, this means in a dataset with 1000 points we should require much fewer to accurately capture the topology of its decision boundary. 2. The initial sample covers the space uniformly. If we condition the initial cover of points, in the algorithms initialization, to be uniformly distributed, it is easy to see that they will approximately cover of the space uniformly1. In conclusion, by construction our method captures the accurate topological features of the decision boundary using a small number of points (Fig. 4.7). This is a desirable property especially in case of very large datasets. As a rule of thumb we recommend sampling the same number of points as the cardinality of the sparsest class. 4.2.5 Scalability Another major improvement of our method relative to the one developed by Ramamurthy et al. [87] is its scalability. Their method allows only binary classification while our method is 1This is ongoing work 35
CHAPTER 5. TOPOLOGICAL EXPRESSIVENESS OF NEURAL NETWORKS There are some situations where each transformation Li is a homeomorphism meaning that both Xiand Li(Xi)have the same topology, and φiis an isomorphism. Proposition 5.1.1. Let Wi be a m×n matrix such that m≥n and rank(Wi) = n , and let a be a continuous bijection with continuous inverse. The transformation: Li(x) = a(Wix+Bi)∀x∈Xi(5.5) defines a homeomorphism between Xiand Xi+1 =Li(Xi). The above result states that, in theory, all topological features of the data are preserved from one layer to the next as long as the final layer has at least the same amount of neurons as the initial and the activation function is a homeomorphism (such as hyperbolic tangent or the sigmoid function). There is, however a caveat. Computationally speaking, as pointed by Naitzat et al. [78], functions like the hyperbolic tangent lose their otherwise homeomorphic behavior due to rounding errors of floating point precision numbers. In truth it is a piecewise function defined as: tanhδ(x) = 1if fl(tanh(x)) >1−δ fl(tanh(x)) otherwise −1if fl(tanh(x)) <−1 + δ (5.6) Where fl (x) is the floating point representation of x and δ the unit round-off. This means that while tanh:Rn→(−1,1)nis a homeomorphism, tanhδ:Rn→[−1,1]nis not. Even though most architectures of dense Neural Networks are classified as homeomorphisms, in reality they are not. This poses a huge problem to say, study the topological properties of data through training, or as they travel through the network. This topic is explored further in section 5.2.4 and central in section 5.3. As the field of Topological Data Analysis develops, approaches to Neural Networks have become progressively more common in recent years. Bianchini and Scarselli [11] evaluate the maximum complexity certain architetures can express. They use the sum of Betti numbers as an heuristic for topological complexity. Guss and Salakhutdinov [48] showed that persistent homology can be used to characterize the capacity of neural architectures in direct relation to their ability to generalize on data. Rieck et al. [90] pointed that the 0-dimensional homology class of the weights and their connections is an adequate indicator of a given Neural Network’s learning performance. Naitzat et al. [78] and Brahma et al. [15] propose an early topological understanding to the impact of Neural Networks in the topology of the data. In order to advance on the work proposed by the above authors we must first develop one last tool to help us capture the topological features of Neural Networks. Each network is a map f:X0→Xn (made of the composition of functions Li ). Understanding the topological characteristics of a Neural Network is understanding the topological characteristics of a transformation. 42
5.2. UDIPH: UNIFORM DISTRIBUTED PERSISTENT HOMOLOGY This is fundamentally different from what we have until now. Proposition 5.1.1 provides both with a strong baseline but also the assurance that such baseline is only theoretical, not computationally verifiable. Thus in order to understand how each function Li:Xi→Xj acts topologically the common pipeline is to compare the persistent homology of both Xi and Xj . This is however not so trivial since Xi and Xj are different metric spaces and their persistent homology might not be comparable. We now present a novel method to solve this problem. 5.2 UDiPH: Uniform Distributed Persistent Homology 5.2.1 Motivation The study of the homology of the spaces Xi induced by a Neural Network, i.e the homology of the activations of each layer, H•(X0)φ0 −−→H•(X1)φ1 −−→...H•(Xn−1)φn−1 −−−−→H•(Xn)(5.7) pose a speed bump in the common pipeline of topological data analysis. Since Xi and Xj are different metric spaces (for i,j ) the persistence values are not comparable. Vietoris-Rips filtrations use the metric of the space as a filtration parameter and hence spaces with different metrics will necessarily have different persistent homology regardless if they have the same homology or not. This is because a standard Vietoris-Rips filtration (through the use of the metric) captures always some geometry of space. Thus a change in geometry will affect the topological summary of persistence homology. Even though no change in topology happened. Take for example a space Xi and a map Li:Xi→Xj . One way to gain insight on the map Li is to compare the topology of both Xi and Xj . However if Lj is a transformation that simply scales all pairwise distances by a certain factor, this function is obviously an homeomorphism and, as such it preserves all topological features. This implies that both Xi and Xj have the same homology. However, the persistence values of Xj are going to be scaled by that same factor (Fig 5.1) and thus different from Xi . If one were then to calculate the Wasserstein distance between the diagrams of both metric spaces, one would find the distance to be different than zero, even though the homology had not changed. In this case Wasserstein distance is measuring the change in persistence and not the change in homology. This is a major inconsistency in the perspective of topological data analysis. The tools we use to capture geometric invariant features, are dependent on said geometry. In this chapter we present UDiPH (Uniform Distributed Persistent Homology). This novel approach creates a new metric space that both preserves the topology, and is independent of geometric changes. The objective is to then do a regular Vietoris-Rips filtration over this new metric space, which will highlight the topological properties (homology) and less the geometric ones (sizes). Notice on Fig. 5.1 a) that the persistence homology of a filtration using this UDiPH method still captures the 2 different H1 classes (holes), however their persistence value is very similar. 43
CHAPTER 5. TOPOLOGICAL EXPRESSIVENESS OF NEURAL NETWORKS (a) Example metric space. (b) Example metric space where distances are scaled by a factor of 3 Figure 5.1: Comparison of persistence diagrams of a metric space (a) and the same but scaled by a factor of 3. The persistence diagrams are calculated using standard Vietoris-Rips filtration, and also using the presented novel approach UDiPH (Uniform). Compare it with regular persistent homology where the persistence of both H1 classes is different. This is due to the fact that the Vietoris-Rips filtration uses the ambient metric as a filtration parameter. Thus the different persistence values represent the size of each H1 class: one smaller, the other bigger. After applying a simple scale, as described in the example above, the persistence values obtained through the standard Vietoris-Rips filtration have also been scaled by the same factor. On the other, hand the persistent homology captures through ourUDiPH method has remained the same. Such features can be desirable of course. The persistence values are normally used to validate the existence of the homology classes they represent. This is fundamental when working with static point clouds. In a different scenario, take a Neural Network for example, this dependence on persistence is undesirable since we have a sequence of dynamic metric spaces, and this we require a new way to compare their persistences. We wish to push persistence homology back towards its topological roots and remove some of its quantitative features in favor of a more qualitative topological characterization. 5.2.2 Background Fuzzy mathematics deals with common mathematical structures that accept some uncertainty measurement. It has found its way into set theory, metric spaces (Kramosil and Michálek [58]) and topology (Chang [25]) 44
5.2. UDIPH: UNIFORM DISTRIBUTED PERSISTENT HOMOLOGY (a) Standard Vietoris-Rips filtration. (b) Simplicial filtration using UDiPH. Figure 5.2: Illustration of a standard Vietoris-Rips filtration (a) where the filtration parameter is the ambient metric, or (b) the metric constructed using UDiPH. Definition 5.2.1 (Fuzzy Set).Let Xbe a set and. A fuzzy set Ais the set: A={(x,µA(x)) |x∈X}(5.8) where µA:X→[0,1] is called the membership function. Let A,B be two fuzzy sets and µA,µBtheir respective membership functions. 1. The complement of A is defined by the membership function: µX\A= 1 −µA(5.9) 2. The intersection A∩Bis given by: µA∩B= min{µA,µB}(5.10) 3. The union A∪Bis given by: µA∪B= max{µA,µB}(5.11) Definition 5.2.2 (Fuzzy Topology) . A fuzzy topology T on a set X is a collection of fuzzy sets of Xsatisfying: 1. ∅,X ∈T 2. It is closed under unions. 3. It is closed under finite intersections. 45
CHAPTER 5. TOPOLOGICAL EXPRESSIVENESS OF NEURAL NETWORKS 5.2.3 Construction 5.2.3.1 Intuition UDiPH is novel approach to the computation of persistent homology built on a new metric space that better focuses on the topological features of the data. Given two metric spaces X and Y , our objective is two create new metric spaces X and Y where the persistence values of the respective persistence diagrams are comparable. X Y X Y U U Wp Wp This new metric space is built as to preserve a fuzzy topology that is constructed in an analogous manner for both spaces. This method is the same as used by McInnes et al. [67] who, in turn, is built over the theoretical guarantees of Spivak [97]. The construction steps, including the construction of the fuzzy topology, are the same used in McInnes et al. [67]. The main pipeline is as follows: 1. Assume uniform sampling. Assume that the data has been uniformly sampled from a data manifold with respect to a Riemannian metric. 2. Approximate metric . For each data point, create a local metric space that approximates this Riemannian metric thus validating the uniformity assumption. 3. Fuzzy Topology. Merge different metric spaces into a fuzzy topological space. 4. Create new metric space that preserves topology. Create global metric based on topological structure. 5.2.3.2 Uniform Distribution Similarly to Niyogi et al. [79] and McInnes et al. [67], this algorithm’s main assumption is that the data is uniformly distributed in the data manifold. Naturally, real world data is rarely that well behaved from the perpective of ambient metrics. However we assume that the manifold from which the data has been sampled has a Riemannian metric that makes this assumption true. In Fig.5.3 a) we have a set of points that are uniformly distributed with respect to both the ambient dimension and the geodesic. In this case, all the drawn circles have the same radius. Consider now Fig. 5.3 b) where we have some data that is not uniformly distributed with regards to the ambient metric. Under this assumption we create different metric spaces for each point such that the data is now uniformly distributed. Here each circle also has the same radius (but not in ambient dimensions). By creating a different notion of distance for each point, we enforce our assumption. We then unify all these metric spaces into a fuzzy topological space. 46
5.2. UDIPH: UNIFORM DISTRIBUTED PERSISTENT HOMOLOGY (a) (b) Figure 5.3: Example of the assumption of uniform distribution. In both scenarios the balls represent have all radius one. with respect to the ambient dimension a), or to a Riemannian metric b). 5.2.3.3 Approximate Metric Informally, if a sample S is uniformly distributed in X with relation to a certain metric, then in a ball of fixed radius around each xi∈S there is approximately the same number of points. Conversely, a ball centered at a certain point that contains its k -nearest neighbours should have the same radius for all xi∈S. From the previous step we already assumed that there exists a metric such that S is uniformly distributed in X . We now need to approximate that metric using the ambient metric. The following lemma guarantees that we can approximate geodesic distances from a point to its neighbours by normalizing distances with respect to the distance to its k -th nearest neighbour. Lemma 5.2.3 (McInnes et al. [67]) . Let (M,g) be a Riemannian manifold in Rn , and let p∈M be a point. If g is locally constant about p in an open neighbourhood U such that g is a constant diagonal matrix in ambient coordinates, then in a ball B⊆U centered at p with volume πn/2 2Γ(n/2n+1) with respect to g , the geodesic distance from p to any point q∈B is 1 rdRn(p,q) , where r is the radius of the ball in the ambient space and dRn is the existing metric on the ambient space. In practice this means that if {x1 i,x2 i,...xk i} are the k -nearest neighbours of xi∈S , then we take, d0(xi,xj i) = d(xi,xj i) max m∈{1,...,k}d(xi,xm i)∀xi∈S. (5.12) The reader is pointed again to the definition of Manifold in order to have an informal intuition of lemma 5.2.3. Since manifolds are locally homeomorphic to an euclidean space. 5.2.3.4 Fuzzy Topology We now create a cover of X using fuzzy sets. For each point xi we create a fuzzy set. For each of its k−nearest neighbours {x1 i,x2 i,...xk i}the membership function µiis given by: 47
CHAPTER 5. TOPOLOGICAL EXPRESSIVENESS OF NEURAL NETWORKS µi(xj i) = exp −d0(xi,xj i) σi (5.13) Where σiis such that: k X j µj i= log2k∀xi∈S(5.14) The value of σi is a normalizating factor useful to unite all different metric spaces. The reader is once again pointed to Spivak [97] and McInnes et al. [67] for a thorough explanation of this process. The proofs and derivations are well into Category Theory which is beyond the scope of this thesis. We wish to build a global metric through the membership functions µi . Notice however, that the membership functions are not necessarily symmetric. That is, its not true that µi(xj) = µj(xi)∀xi,xj∈S(5.15) The next step is then to take care of this asymmetry. Let xi be the mth -neighbour of xj . And xjbe the nth-neighbour of xi, we consider the new value: δij =µi(xj) + µj(xi)−µi(xj)µj(xi)(5.16) If the intuition of a membership function is that of a probability of belonging to that set then δij can be informally understood as the probability of xi or xj belonging to each other’s set minus the probability of belonging to the intersection: δij =µi(xj) |{z} P(xj∈Xi) +µj(xi) |{z} P(xi∈Xj) −µi(xj)µj(xi) | {z } P(xij ∈Xi∩Xj) (5.17) Figure 5.4: Illustration of different local metric spaces (grey circles) resulting in non symmetric distances between points (dotted lines) since both circles have the same radius. 48
5.2. UDIPH: UNIFORM DISTRIBUTED PERSISTENT HOMOLOGY 5.2.3.5 Metric Space The resulting construction is a 1-dimensional fuzzy simplicial complex (a.k.a. weighted graph)defined by the adjacency matrix A= [δij] . This topological space is the approximation of our data manifold in which, by construction, the data is uniformly distributed. As our objective is to be able to calculate persistence homology we need to create a metric space. However, we wish to take advantage of the newfound metrics and manifold in order to do this. This can be done in two steps: 1. Local metric. If we consider distance of xi to xj as the probability of xinot belonging in the fuzzy set Xj we create the dissimilarity matrix A0= [1−δij] , which is symmetric by construction. 2. Global metric. We then extend this notion and define the distance between any two points xi,xj∈Sas the shortest path in the simplicial complex A0, which is an approximation of the geodesic distances in the manifold. 5.2.4 Stability 5.2.4.1 Of a Transformation Consider a function f:X→Y on two metric spaces X,Y . We compare the stability of the persistence diagrams of both X and Y using standard Vietoris-Rips filtration and our method. Despite the abuse of language, for ease of reading, we will denote by Wp(Xu,Yu) the p− Wasserstein distance between the persistence diagrams of both X and Y after applying the UDiPH method. In Fig. 5.1 we have seen that homeomorphic transformations such as scaling have a strong impact in the persistence diagrams of Y . UDiPH was developed with the following implication in mind: Xhomeomorphic to Y=⇒Wp(Xu,Yu)=0 (5.18) We will show that in some situations that is actually the case. We will also present situations where conjecture 5.18 only approximately holds, meaning that: Wp(Xu,Yu),0however Wp(Xu,Yu)≤Wp(X,Y )(5.19) and provide a possible explanation as to why there is not a complete invariance. The author believes that conjecture 5.18 holds under mild assumptions and an adapted proof can be achieved. Proving that the neighbour structure of uniformly distributed manifolds is invariant under homeomorphisms is a ongoing future work direction. Consider the following types of homeomorphisms. 1. Isometry is a map that preserves all pairwise distances. It preserves the metric of X in Y . Rotations, reflections and translations (very common in Neural Networks) are examples of isometries. Isometries are the isomorphisms of geometry, meaning they preserve the geometric structure. 49
CHAPTER 5. TOPOLOGICAL EXPRESSIVENESS OF NEURAL NETWORKS 2. Similarity transformations preserve angles and ratio between distances, such as scaling Fig. 5.1 and Fig. 5.5. Figure 5.5: Persistence diagrams before and after a similarity transformation, using standard Vietoris-Rips filtration (top), and UDiPH (bottom). 3. Affine transformations preserve parallel vectors. Since we are considering both X and Y to be embedded in some vector space in Rn and Rm these vectors are well defined. A linear projection to a higher dimensional space using a non-singular matrix is an example (actually the one that is most common in Neural Networks). (Fig. 5.6). Figure 5.6: Persistence diagrams before and after an affine transformation, using standard Vietoris-Rips filtration (top), and UDiPH (bottom). 50
5.2. UDIPH: UNIFORM DISTRIBUTED PERSISTENT HOMOLOGY Transformation H0 H1 Standard UDiPH Standard UDiPH Isometry Rotation 0 0 0 0 Translation 0 0 0 0 Scale (factor) 53056.1 5.3 318.4 6.1 25 15174.7 5.3 1579.8 6.1 100 60615.2 5.3 6305.2 6.1 Affine Random 8642.9±2131.9220.12±5.2501.9±174.673.5±28.3 Continuous Bijection exp 60723.6 26.1 4182.7 7.9 sigmoid 11371.2 218.1 590.5 57.8 tanh 6041.5 202.5 237.8 32.2 Table 5.1: Wasserstein distance between X and Y for different homeomorphic functions f: X→Y . We compare the H0 and H1 homology as the functions always had input domain R2 . For affine transformations random matrixes were used and such the result is the mean of 20 runs and along is the standard deviation. 4. Continuous bijections are the definition of homeomorphisms, with continuous inverse of course( e.g. functions such as exp,log etc, Fig. 5.7). Figure 5.7: Persistence diagrams before and after an continuous transformation (Hyperbolic Tangent), using standard Vietoris-Rips filtration (top), and UDiPH (bottom). 5. Compositions. Any composition of the above maps is also a homeomorphism. If f ,g are homeomorphisms then f◦gand g◦fare also homeomorphisms. In Table 5.1, we present different homeomorphic transformations f:X→Y along with the p− Wasserstein distance Wp(X,Y ) between the persistence diagrams of the domain ( X ) and codomain (Y). Note that since fis a homeomorphisms, in theory Wp(X,Y )=0. 51
CHAPTER 5. TOPOLOGICAL EXPRESSIVENESS OF NEURAL NETWORKS assumption that more expressive architectures are going to generate more diverse and complex decision boundaries. We use the word architecture of a Neural Network in its usual sense, that is, to refer to the number and type of layers, the number of neurons per layer, the activation functions, presence of bias etc. An architecture F is a family of Neural Networks of fixed number of parameters n . Each element in F can be identified uniquely by a vector in Rn , it is trivial to see that there is a direct mapping φ:Rn→ F . Let φ:Rn→ F be the function that maps a vector of parameters to a Neural Network. We denote by fw=φ(w)∈F the Neural Network corresponding to the parameter vector w∈Rn . Whenever the parameter vector is irrelevant or obvious from the context we will denote just by f . Consider the following example, take two architectures F0 and F1 . Let F0={σ(w0x+w1y+w2)|(w0,w1,w2)∈R3} where σ is the sigmoid function, and F1 be a more complex network with one hidden layer of multiple neurons. Obviously, for all w∈R3 the decision boundary of φ(w) = fw∈ F0 is a straight line (Fig.5.15 (top)). While maybe different geometrically, every element of F0 produces a decision boundary with equal topology. The same cannot be said regarding F1 (Fig.5.15 (bottom)). Figure 5.15: The decision boundaries of two paths in the parameter space of two different architectures. A very simple one F0(top row) and one with one hidden layer (bottom row). 5.4.2.2 Construction Our method starts by building a metric space for a given architecture F . The elements of this metric space are the persistence diagrams of decision boundaries of elements of F . Each element of F is a Neural Network obtained by sampling the parameter space (Fig. 5.16). Along with the p− Wasserstein distance between the persistence diagrams this creates a metric space. Following the above intuition, where an architecture is not very “versatile” if it can only produce straight lines, the inverse would be true. A Neural Network’s architecture can be then characterized by how “topologically diverse” the set of all its decision boundaries is. We develop a novel pipeline for evaluating the topological expressive power of a Neural Network’s architecture F, Fig. 5.17. 1. Sample F . Let n be the number of parameters in F . We start by sampling a set of parameter vectors wi∈Rn . Since each parameter vector describes a Neural Network we consider the set of Neural Networks {fi∈F |fi=φ(wi)}. 58
5.4. TOPOLOGICAL EXPRESSIVENESS OF NEURAL NETWORKS 2. Compute decision boundary of each Neural Network in the sampled set {fi∈ F | fi=φ(wi)} 3. Evaluate Homology of the decision boundary of each sampled element of F . We denote by P the set of all these persistence diagrams. That is Di∈P is the dimension k persistence diagram of the decision boundary of the Neural Network fi=φ(wi)∈F whose parameter vector is wi∈Rn(Fig. 5.16). Figure 5.16: Illustration of the pipeline to obtain the persistence diagram of the decision boundary of one element belonging to some architecture F 4. Compute metric space Let P be the set of persistence diagrams and Wp the p -th order Wasserstein distance, then (P ,Wp) is a metric space. For every Neural Network architecture we can consider the metric space (P ,Wp) associated with the persistent diagrams of its decision boundaries (Fig. 5.18 and Fig.5.17). Intuitively, the information that this metric space encodes is how topologically different are the decision boundaries of a specific architecture, given an uniform sample. 5. Measure the Spread of the metric space (Willerton [109]). Figure 5.17: Illustration of the pipeline for evaluating the topological expressive power of an architecture. We sample parameter vectors w,u,v . From the resulting Neural Networks fw,fu and fv we compute the persistence diagram of their decision boundaries and create a metric space. 59
CHAPTER 5. TOPOLOGICAL EXPRESSIVENESS OF NEURAL NETWORKS Figure 5.18: Embedding of the metric space (P ,W2) corresponding to a specific architecture. The metric space is composed of the persistent diagrams of the decision boundaries of a Neural Network along with the Wasserstein distance. The architecture has two hidden reluactivated layers of 10 neurons. The spread of this metric space is our measure of the topological expressive power of this architecture. We now formalize the idea of “diversity” and “spread” of a metric space, that we have been using loosely above. Willerton [109] defines the notion of spread of a metric space. The definition is based on the idea of diversity on a measure space. It is defined as follows, Definition 5.4.1 (Spread).Given a (X,d)a metric space we define spread by E0(tX) = X x∈X X y∈X e−td(x,y) −1 (5.21) Example 11. The measure is aptly named and is intuitive to understand. A sample of points in a straight line has a lower value of spread E0 than a sample of points uniformly in a plane. Through spread Willerton [109] manages to convey a sense of dimension within metric spaces. Theorem 5.4.2. For a metric space (X,d) where X has N elements, we have the following properties: •t0≤t1⇒E0(t0X)≤E(t1X) •limt→0E0(tX)=1 •limt→∞E0(tX) = N 60
5.5. RESULTS AND DISCUSSION 5.5 Results and Discussion 5.5.1 Results In the following results we restrict ourselves to fully connected dense Neural Networks, with parameters defined in the unitary hypercube in Rn . That is, we uniformly sample a set of parameter vectors {w0,w1...wk|wi∈[−1,1]n} and consider the set of Neural Networks {fi∈F |fi=φ(wi)}. For each and every architecture, we uniformly sample 2000 vectors wi in the interval [−1,1]n⊆Rn . For each parameter sample vector wi we consider the Neural Network fwi= φ(wi) . With the exception of subsection 5.5.1.5 all architectures have input dimension 2, such that an analysis of only H0 and H1 homology classes is exhaustive. All architectures have output dimension 1, since (w.l.g.) we will only explore binary classification. All layers have ReLU activation except for the output layer which has sigmoid activation function, as per usual for binary classification problems. 5.5.1.1 Stability of Spread The first step is to make sure that the spread measure is intrinsic to the architecture and not dependent on the number of points. Meaning that it remains constant no matter how many points are sampled, or at least converge to a stable value. Fig. 5.19 plots the spread values for two different architectures: one shallow and wide (79, 59 neurons), another very deep (44, 34, 33, 24, 18, 17,15, 13, 6) for different sample sizes. Figure 5.19: Spread of two metric spaces corresponding to a shallow and wide architecture and a deep one. The x-axis represents the number of points sampled and used to calculate the spread. Note that the spread remains relatively stable specially when more than 800 points are sampled. Note that even though both architecture have the same number of parameters1 the wide architecture displays a higher value of spread. Thus confirming that this architecture is more topologically expressive than a shallow and wide one. 1The reader is pointed to Appendix Bfor details. 61
CHAPTER 5. TOPOLOGICAL EXPRESSIVENESS OF NEURAL NETWORKS 5.5.1.2 Depth and Width To observe the effect of depth and width in the topological expressiveness power we measured the spread of 4 sets of 10 different architectures Fig. (5.20). Each set consists of 10 architectures with increasing number of layers 1-10. The number of neurons in each layer is constant for each set. For example the first set has Neural Networks with layers 1 to 10 all with 5 neurons: (2,5,1),(2,5,5,1),(2,5,5,5,1)... We compare our observations with the previous measures of expressive power of Neural Network architectures Fig. 5.23, the VC-Dimension [7] and the number of linear regions [74, 86] on the same architectures. (a) H0Spread (b) H1Spread Figure 5.20: Spreadvalues forNeural Networks as a function of theirwidth(number ofneurons) and depth (number of layers). (a) VC-Dimension (b) Number of linear regions Figure 5.21: Comparison with previous measures of expressive power. a) The VC-Dimension of the previous architectures as computed by Bartlett et al. [7]. b) The upper bound of the number of linear regions expressed by the same architectures as computed by Montúfar et al. [74] and Poole et al. [86], note the logarithm scale on the y-axis It should come as no surprise to see that the spread increases with both depth and width (Fig. 5.20). We observe a linear growth with respect to the number of layers in accordance with the VC-Dimension bounds by Bartlett et al. [7] (Fig. 5.23 (a)) and in contrast with the exponential increase in the upper bound of linear regions as found Poole et al. [86] and Montúfar et al. [74] (Fig. 5.23 (b)). 62
5.5. RESULTS AND DISCUSSION 5.5.1.3 Spread and Complexity In Chapter 4we introduced Topological Complexity as a summary of a persistence diagram. In Fig. 5.22 instead of considering the spread we take the average Topological Complexity of each of the 2000 sampled decision boundaries of each architecture. Note that for the spread we require the pairwise Wasserstein distance between each diagram but for the Topological complexity we do not, making the latter much faster to compute. (a) H0(b) H1 Figure 5.22: Average topological complexity over the 2000 sampled decision boundaries for each architecture. Notice the correlation with the spread values in Fig. 5.20 (a) H0(b) H1 Figure 5.23: Average topological complexity versus spread. (Pearson’s correlation value in the legend) Intuitively, the average topological complexity represent the expected topological complexity that a decision boundary sampled from an architecture will have. According to Fig. 5.22, Neural Networks of more complex and expressive architecture also tend to describe more topologically complex decision boundaries. Note the similarities between average topological complexity and the spread values in Fig. 5.20. Given the strong correlation between spread and the average topological complexity (Fig. 5.23) it would be interesting to study if Topological Complexity could be computed as a proxy for spread given its lighter computational complexity. 63
CHAPTER 5. TOPOLOGICAL EXPRESSIVENESS OF NEURAL NETWORKS 5.5.1.4 Fixed Number of Parameters So far we have seen that the spread (our measure of topological expressive power) increases with depth and width. However, increasing depth and width also increases the number of parameters of an architecture. In Fig. 5.20 architectures have all different architectures but also different number of parameters. (a) H0(b) H1 Figure 5.24: How the spread (y-axis) changes with respect to the total number of parameters (x-axis). Each line represents architectures of 2 - 10 layers of 10, 20, 50 and 100 neurons each (colors). Note the logarithm scale on the x-axis. The grey line highlights the fact that there are Neural Networks with the same spread but vastly different number of parameters. Note the gray line in the Fig. 5.24 and how architectures of different number of parameters have the same spread. The correlation between the number of parameters (weights and biases) with the number of layers and neurons is explored in Appendix Balong with a method to sample all possible architectures given a fixed number of parameters. Following such method we sampled 200 different architectures all with the same fixed number of parameters (5000). Figure 5.25: Spread values for 200 architectures with the same number of parameters (5000) along with their depth (color of each point) and width (size of each point). 64
5.5. RESULTS AND DISCUSSION (a) Depth (b) Width Figure 5.26: Pearson correlation values between the depth of a network (a) and width (b) with both H0and H1spread, where total spread is equal to qH2 0+H2 1. Combining spread in both homology dimensions, in Fig. 5.25 the most expressive architectures would be on the upper right. One could try to condense this information by taking the norm of each point (Fig. 5.26). The weaker correlation between width and spread can be justified by realizing that increasing the number of neurons directly increases the number of parameters in the network, which is not necessarily true with regarding the number of layers. Figure 5.25 and Fig. 5.26 (a) further cement the importance of depth as the strongest factor for expressive power of neural architectures, even when the number of parameters is fixed. 5.5.1.5 Input Dimension With respect to the input dimension one has to take into consideration its effect on two specific aspects. First , it is on homology itself: for higher dimensions, the dimension of each homology class also tends to increase as also observed in Giusti et al. [46] (Fig. 5.27). This means that concepts like the topological complexity which depend on the number of homology groups (as explained in Chapter 4) will follow the upwards trend caused by the increase of input dimensions (Fig 5.28 (a)). (a) (b) Figure 5.27: Effect of input dimension on the total number of homology classes H1 and H2 . For each dimension we generated 100 samples of 1000 randomly generated points. (b) show the number for each value of the filtration parameter, while (a) shows the sum over all values. 65
CHAPTER 5. TOPOLOGICAL EXPRESSIVENESS OF NEURAL NETWORKS Secondly , as already discussed in the previous section, using the ambient metric as a filtration parameter yields persistence diagrams that are not comparable between spaces of different dimensions. An extensive study on the behavior of metrics in high dimensional spaces can be found in Aggarwal et al. [2]. This in turn makes spread not comparable since it is computed using the Wasserstein Distance between persistence diagrams (Fig 5.28 (b)). Contrary to the first, issue we can solve this problem by using UDiPH to create a filtration (Fig. 5.29). (a) (b) Figure 5.28: (a) Influence of number of homology classes on topological complexity. (b) How the behaviour of the Euclidean metric influences the spread for different dimensions. In their paper, Aggarwal et al. [2], describe a method to visualize the behaviour of different metrics on higher dimensional spaces. Given a set of points {wi} in Rn we measure the difference of Dmax = maxikwik and Dmin = minikwik , that is the difference between the closest point to the origin and the farthest. In Fig. 5.28 (b) we use this very same approach to measure the behaviour of the Euclidean metric. In our case the set {wi} is the set of points sampled from the decision boundary, which is described by the input space. Based on Fig. 5.28, topological complexity does not serve as an accurate proxy for spread and the use of UDiPH becomes imperative. (a) H0Spread (b) H1Spread Figure 5.29: Spread values for Neural Networks with different input dimensions. Both Neural Networks have 5 layers of 5 and 10 neurons each. The persistence diagrams were computed using UDiPH so that the spread values are comparable. 66
5.5. RESULTS AND DISCUSSION It is fundamental to realize that, as a corollary of Fig. 5.27, increasing input dimensions results in an increase in cardinality of all homology groups, in particular higher dimensional ones. For example, data coming from R2 normally does not display relevant H2 classes, while data say in R5 not only might have a sizeable H2 class but also H3 and H4 . Note that in Fig. 5.29 we are only taking into account H0 and H1 . Although we observe a decrease the spread in H0 and H1 with respect to an increase in input dimensions, it is reasonable to assume that architectures with higher input dimension will present greater spread in higher dimensional homology groups such as H2 and H3 , as discussed above, but are not present in the graph. Meaning that, as the input dimensions increase, spread will be lower in each homology dimension but will be present in more dimensions. The decrease of spread observed in Fig. 5.29 might be a consequence of an analysis limited to just H0 and H1 . One could conjecture that each architecture has a “constant spread” summed over all dimension and, the more dimensions it has available, the smaller is the spread allocated for each one. A further analysis for H2 and H3 would be relevant, however, given the sizeable number of persistence diagrams we calculate per architecture (2000) it would require a tremendous computational effort. 5.5.2 Discussion Spread grows with network depth and width. We first investigated how the spread depended on the structural properties of F . We studied architectures with two input neurons, a fixed number of neurons per layers (width, 5,7,9,10 ) and increasing number of layers (depth). For each architecture, we sampled 2000 points from the corresponding Rn , where n is the number of parameters of F . We find that spreads for both H0 and H1 grow monotonically with the number of layers, with the slope monotonically increasing with the number of neurons per layer too (Fig. 5.20). It seems to follow the behaviour of VC-Dimension rather than the exponential growth observed in other geometric properties. Spread is summarised by complexity. For the same type of architectures, we also ask how the average topological complexities for H0 and H1 grow with depth and width (total number of neurons) (Fig. 5.22). We find that complexity too increases with both quantities, similarly to spread (Fig. 5.22). In addition, we also find that complexity and spread correlate strongly with each other (Fig. 5.23). This might perhaps appear unsurprising, but we believe it to be interesting, because it implies that architectures producing richer topological can produce many different types of richer topologies. That is, it is not only that more complex topologies have more ways in which to be different, but that they actually take all these ways, increasing the spread. As a final comment, complexity is computationally much lighter to compute than spread. In fact, computing the spread is quadratic to the number of persistence diagrams while computing the average complexity is linear. The latter therefore constitutes a promising proxy observable in cases where computing spread becomes prohibitive. Spread depends weakly on the total number of parameters. We found that the total number of parameters in networks with fixed number of neurons (width) and increasing 67
BIBLIOGRAPHY [11] M. Bianchini and F. Scarselli. “On the complexity of neural network classifiers: A comparison between shallow and deep architectures.” In: IEEE transactions on neural networks and learning systems 25.8 (2014), pp. 1553–1565. [12] S. Biasotti, D. Giorgi, M. Spagnuolo, and B. Falcidieno. “Size functions for comparing 3D models.” In: Pattern Recognition 41.9 (2008), pp. 2855–2873. issn: 0031-3203. doi: https: //doi. org / 10 .1016 / j . patcog .2008 . 02 . 003 .url: https: / / www . sciencedirect.com/science/article/pii/S0031320308000733. [13] M. Bock, A. K. Tyagi, J. - U. Kreft, and W. Alt. Generalized Voronoi Tessellation as a Model of Two-dimensional Cell Tissue Dynamics. 2009. [14] J. - D. Boissonnat and A. Ghosh. “Manifold reconstruction using tangential Delaunay complexes.” In: Discrete and Computational Geometry 51.1 (Jan. 2014), pp. 221–267. doi: 10 . 1007 / s00454 - 013 - 9557 - 2 .url: https : / / hal . inria . fr / hal - 00932209. [15] P. P. Brahma, D. Wu, and Y. She. “Why deep learning works: A manifold disentanglement perspective.” In: IEEE transactions on neural networks and learning systems 27.10 (2015), pp. 1997–2008. [16] G. Bredon. Topology and Geometry. Graduate texts in mathematics. Springer-Verlag, 1993. isbn: 9783540979265. url: https : / / books . google . pt / books ? id = vsSjQgAACAAJ. [17] D. Bremner, E. Demaine, J. Erickson, J. Iacono, S. Langerman, P. Morin, and G. Toussaint. “Output-sensitive algorithms for computing nearest-neighbour decision boundaries.” In: Discrete and Computational Geometry 33.4 (2005), pp. 593–604. [18] P. Bubenik. “Statistical Topological Data Analysis using Persistence Landscapes.” In: Journal of Machine Learning Research 16.3 (2015), pp. 77–102. url: http://jmlr. org/papers/v16/bubenik15a.html. [19] P. Bubenik and A. Wagner. “Embeddings of persistence diagrams into Hilbert spaces.” In: Journal of Applied and Computational Topology 4.3 (2020), 339–351. issn: 2367- 1734. doi: 10.1007/s41468-020-00056-w .url: http://dx.doi.org/10.1007/ s41468-020-00056-w. [20] G. Carlsson. “Topology and data.” In: Bulletin of the American Mathematical Society 46.2 (2009), pp. 255–308. [21] G. Carlsson, T. Ishkhanov, V. De Silva, and A. Zomorodian. “On the local behavior of spaces of natural images.” In: International journal of computer vision 76.1 (2008), pp. 1–12. [22] M. do Carmo. Riemannian Geometry. Mathematics (Boston, Mass.) Birkhäuser, 1992. isbn: 9783764334901. url: https://books.google.it/books?id=uXJQQgAACAAJ . 74
BIBLIOGRAPHY [23] M. Carrière and U. Bauer. “On the Metric Distortion of Embedding Persistence Diagrams into Reproducing Kernel Hilbert Spaces.” In: CoRR abs/1806.06924 (2018). arXiv: 1806.06924.url:http://arxiv.org/abs/1806.06924. [24] A. Cerri, M. Ferri, and D. Giorgi. “Retrieval of trademark images by means of size functions.” In: Graphical Models 68.5 (2006). Special Issue on the Vision, Video and Graphics Conference 2005, pp. 451–471. issn: 1524-0703. doi: https://doi.org/ 10 . 1016 / j . gmod . 2006 . 07 . 001 .url: https : / / www . sciencedirect . com / science/article/pii/S1524070306000592. [25] C. Chang. “Fuzzy topological spaces.” In: Journal of Mathematical Analysis and Applications 24.1 (1968), pp. 182 –190. issn: 0022-247X. doi: https://doi.org/10. 1016/0022-247X(68)90057-7 .url: http://www.sciencedirect.com/science/ article/pii/0022247X68900577. [26] F. Chazal and B. Michel. An introduction to Topological Data Analysis: fundamental and practical aspects for data scientists. 2017. arXiv: 1710.04019 [math.ST]. [27] D. Cohen-Steiner, H. Edelsbrunner, and J. Harer. “Stability of Persistence Diagrams.” In: Proceedings of the Twenty-first Annual Symposium on Computational Geometry. SCG ’05. Pisa, Italy: ACM, 2005, pp. 263–271. isbn: 1-58113-991-8. [28] D. Cohen-Steiner, H. Edelsbrunner, and D. Morozov. “Vines and Vineyards by Updating Persistence in Linear Time.” In: Proceedings of the Twenty-second Annual Symposium on Computational Geometry. SCG ’06. Sedona, Arizona, USA: ACM, 2006, pp. 119–126. isbn: 1-59593-340-9. doi: 10.1145/1137856.1137877 .url: http: //doi.acm.org/10.1145/1137856.1137877. [29] J. Collins, J. Sohl-Dickstein, and D. Sussillo. Capacity and Trainability in Recurrent Neural Networks. 2016. arXiv: 1611.09913 [stat.ML]. [30] M. Courbariaux, Y. Bengio, and J. - P. David. Training deep neural networks with low precision multiplications. 2014. arXiv: 1412.7024 [cs.LG]. [31] T. M. Cover. “Geometrical and Statistical Properties of Systems of Linear Inequalities with Applications in Pattern Recognition.” In: IEEE Trans. on Electronic Computers EC-14 (1965), pp. 326–334. [32] K. Crane, F. de Goes, M. Desbrun, and P. Schröder. “Digital Geometry Processing with Discrete Exterior Calculus.” In: ACM SIGGRAPH 2013 courses. SIGGRAPH ’13. Anaheim, California: ACM, 2013. [33] D. Crevier. Ai: The Tumultuous History Of The Search For Artificial Intelligence. Basic Books, 1993. isbn: 9780465029976. url: https://books.google.pt/books?id= QJNQAAAAMAAJ. [34] B. Di Fabio and M. Ferri. “Comparing Persistence Diagrams Through Complex Vectors.” In: Image Analysis and Processing — ICIAP 2015. Ed. by V. Murino and E. Puppo. Cham: Springer International Publishing, 2015, pp. 294–305. isbn: 978-3-319-23231-7. 75
BIBLIOGRAPHY [35] W. Dong, M. Charikar, and K. Li. “Efficient K-nearest neighbor graph construction for generic similarity measures.” In: Jan. 2011, pp. 577–586. doi: 10.1145/1963405. 1963487. [36] R. A. Dwyer. “Higher-dimensional Voronoi diagrams in linear expected time.” In: Discrete and Computational Geometry 6.3 (1991), pp. 343–367. [37] H. Edelsbrunner and J. Harer. Computational Topology: An Introduction. Applied Mathematics. American Mathematical Society, 2010. isbn: 9780821849255. url: https: //books.google.pt/books?id=MDXa6gFRZuIC. [38] H. Edelsbrunner, D. Kirkpatrick, and R. Seidel. “On the shape of a set of points in the plane.” In: IEEE Transactions on information theory 29.4 (1983), pp. 551–559. [39] E. Facco, M. d’Errico, A. Rodriguez, and A. Laio. “Estimating the intrinsic dimension of datasets by a minimal neighborhood information.” In: Scientific reports 7.1 (2017), p. 12140. [40] M. Farber. “Topological Complexity of Motion Planning.” In: Discrete & Computational Geometry 29 (Mar. 2003), pp. 211–221. doi:10.1007/s00454-002-0760-9. [41] C. Fefferman, S. Mitter, and H. Narayanan. “Testing the manifold hypothesis.” In: Journal of the American Mathematical Society 29.4 (2016), pp. 983–1049. [42] D. Fernández-Ternero, E. Macías-Virgós, E. Minuz, and J. A. Vilches. Discrete Topological complexity. 2017. arXiv: 1706.02894 [math.AT]. [43] M. Gabella, N. Afambo, S. Ebli, and G. Spreemann. “Topology of Learning in Artificial Neural Networks.” In: CoRR abs/1902.08160 (2019). arXiv: 1902.08160 .url: http: //arxiv.org/abs/1902.08160. [44] E Gardner and B Derrida. “Optimal storage properties of neural network models.” In: Journal of Physics A: Mathematical and General 21.1 (1988), pp. 271–284. doi: 10.1088/0305- 4470/21/1/031 .url: https://doi.org/10.1088\%2F0305- 4470\%2F21\%2F1\%2F031. [45] R. Ghrist. Elementary Applied Topology. CreateSpace Independent Publishing Platform, 2014. isbn: 9781502880857. [46] C. Giusti, E. Pastalkova, C. Curto, and V. Itskov. “Clique topology reveals intrinsic geometric structure in neural correlations.” In: Proceedings of the National Academy of Sciences 112.44 (2015), 13455–13460. issn: 1091-6490. doi: 10.1073/pnas.1506407112 . url:http://dx.doi.org/10.1073/pnas.1506407112. [47] S. Gupta, A. Agrawal, K. Gopalakrishnan, and P. Narayanan. Deep Learning with Limited Numerical Precision. 2015. arXiv: 1502.02551 [cs.LG]. [48] W. H. Guss and R. Salakhutdinov. “On characterizing the capacity of neural networks using algebraic topology.” In: arXiv preprint arXiv:1802.04443 (2018). 76
BIBLIOGRAPHY [49] A. Hatcher and C. U. Press. Algebraic Topology. Algebraic Topology. Cambridge University Press, 2002. isbn: 9780521795401. [50] J. - C. Hausmann. “On the Vietoris-Rips complexes and a cohomology theory for metric spaces.” eng. In: ed. by F. Quinn. Prospects in topology : proceedings of a conference in honor of William Browder. ID: unige:12821. Princeton, N.J.: Princeton University Press, 1995, pp. 175–188. isbn: 978-0-691-02729-6. url: https://archiveouverte.unige.ch/unige:12821. [51] T. K. Ho. Geometrical Complexity of Classification Problems. 2004. arXiv: cs/0402020 [cs.CV]. [52] W. Huang and A. Ribeiro. “Persistent Homology LowerBounds on High Order Network Distances.” In: IEEE Transactions on Signal Processing PP (July 2015). doi: 10.1109/ TSP.2016.2620963. [53] I. Hubara, M. Courbariaux, D. Soudry, R. El-Yaniv, and Y. Bengio. Quantized Neural Networks: Training Neural Networks with Low Precision Weights and Activations. 2016. arXiv: 1609.07061 [cs.NE]. [54] P. Joharinad and J. Jost. “Topology and curvature of metric spaces.” In: Advances in Mathematics 356 (2019), p. 106813. issn: 0001-8708. doi: 10.1016/j.aim.2019. 106813.url:http://dx.doi.org/10.1016/j.aim.2019.106813. [55] S. Kališnik. “Tropical Coordinates on the Space of Persistence Barcodes.” In: Foundations of Computational Mathematics 19.1 (2018), 101–129. issn: 1615-3383. doi: 10.1007/s10208-018-9379-y .url: http://dx.doi.org/10.1007/s10208-018- 9379-y. [56] M. Karpinski andA. Macintyre. “Bounding VC-dimension forneuralnetworks: progress and prospects.” In: European Conference on Computational Learning Theory. Springer. 1995, pp. 337–341. [57] T. Kato and T. Wada. “Direct condensing: An efficient Voronoi condensing algorithm for nearest neighbor classifiers.” In: 3 (Sept. 2004), 474 –477 Vol.3. doi: 10.1109/ ICPR.2004.1334569. [58] I. Kramosil and J. Michálek. “Fuzzy metrics and statistical metric spaces.” eng. In: Kybernetika 11.5 (1975), (336)–344. url:http://eudml.org/doc/28711. [59] J. Latschev. “Vietoris-Rips complexes of metric spaces near a closed Riemannian manifold.” In: Archiv der Mathematik 77 (Dec. 2001), pp. 522–528. doi: 10.1007/ PL00000526. [60] T. Le and M. Yamada. Persistence Fisher Kernel: A Riemannian Manifold Kernel for Persistence Diagrams. 2018. arXiv: 1802.03569 [stat.ML]. [61] T. Leinster. “The magnitude of metricspaces.” In: (2010). arXiv: 1012.5857 [math.MG] . [62] T. Leinster and E. Roff. The maximum entropy of a metric space. 2019. arXiv: 1908. 11184 [math.MG]. 77
BIBLIOGRAPHY [63] C. Lopez, C. - L. Zhao, S. Magniol, N. Chiabaut, and L. Leclercq. “Microscopic Simulation of Cruising for Parking of Trucks as a Measure to Manage Freight Loading Zone.” In: Sustainability 11.5 (2019). issn: 2071-1050. doi: 10.3390/su11051276 .url: https: //www.mdpi.com/2071-1050/11/5/1276. [64] A. C. Lorena, L. P. F. Garcia, J. Lehmann, M. C. P. Souto, and T. K. Ho. How Complex is your classification problem? A survey on measuring classification complexity. 2018. arXiv: 1808.03591 [cs.LG]. [65] K. Y. C. Lui, Y. Cao, M. Gazeau, and K. S. Zhang. “Implicit manifold learning on generative adversarial networks.” In: arXiv preprint arXiv:1710.11260 (2017). [66] Y. A. Malkov and D. A. Yashunin. “Efficient and robust approximate nearest neighbor search using Hierarchical Navigable Small World graphs.” In: CoRR abs/1603.09320 (2016). arXiv: 1603.09320.url:http://arxiv.org/abs/1603.09320. [67] L. McInnes, J. Healy, and J. Melville. “Umap: Uniform manifold approximation and projection for dimension reduction.” In: arXiv preprint arXiv:1802.03426 (2018). [68] M. W. Meckes. “Magnitude, Diversity, Capacities, and Dimensions of Metric Spaces.” In: Potential Analysis 42.2 (2014), 549–572. issn: 1572-929X. doi: 10.1007/s11118- 014-9444-3.url:http://dx.doi.org/10.1007/s11118-014-9444-3. [69] F. Meunier and L. Montejano. “Different versions of the nerve theorem and colourful simplices.” In: Journal of Combinatorial Theory, Series A 169 (2020), p. 105125. issn: 0097-3165. doi: https://doi.org/10.1016/j.jcta.2019.105125 .url: http: //www.sciencedirect.com/science/article/pii/S0097316519300998. [70] Y. Mileyko, S. Mukherjee, and J. Harer. “Probability measures on the space of persistence diagrams.” In: Inverse Problems 27.12 (2011), p. 124007. [71] J. van Mill. Infinite-Dimensional Topology. Prerequisites and Introduction. 1st. North- Holland MathematicalLibrary 43. North Holland, 1988. isbn: 0444871330,9780444871336. url: http://gen.lib.rus.ec/book/index.php?md5=8ca549662db78125115d56e3261e85ce . [72] T. Mitchell. Machine Learning. McGraw-Hill International Editions. McGraw-Hill, 1997. isbn: 9780071154673. url: https : / / books . google . pt / books ? id = EoYBngEACAAJ. [73] R. Mollineda, J. Sánchez, and J. Sotoca. “A meta-learning framework for pattern classification by means of data complexity measures.” In: Inteligencia artificial: Revista Iberoamericana de Inteligencia Artificial, ISSN 1137-3601, N º . 29, 2006 (Ejemplar dedicado a: Minería de Datos), pags. 31-38 10 (Dec. 2006). doi:10.4114/ia.v10i29.875. [74] G. Montúfar, R. Pascanu, K. Cho, and Y. Bengio. On the Number of Linear Regions of Deep Neural Networks. 2014. arXiv: 1402.1869 [stat.ML]. [75] P. A. Mulheran and J. A. Blackman. “Capture zones and scaling in homogeneous thinfilm growth.” In: Phys. Rev. B 53 (15 1996), pp. 10261–10267. doi: 10.1103/PhysRevB. 53.10261.url:https://link.aps.org/doi/10.1103/PhysRevB.53.10261. 78
BIBLIOGRAPHY [76] E. Munch. “Applications of persistent homology to time varying systems.” In: (2013). [77] J. Munkres. Topology. Featured Titles for Topology Series. Prentice Hall, Incorporated, 2000. isbn: 9780131816299. [78] G. Naitzat, A. Zhitnikov, and L. - H. Lim. Topology of deep neural networks. 2020. arXiv: 2004.06093 [cs.LG]. [79] P. Niyogi, S. Smale, and S. Weinberger. “Finding the homology of submanifolds with high confidence from random samples.” In: Discrete & Computational Geometry 39.1-3 (2008), pp. 419–441. [80] C. Olah. Neural Networks, Manifolds, and Topology. 2014. url: https:/ /colah. github.io/posts/2014-03-NN-Manifolds-Topology/ (visited on 01/06/2020). [81] B. O’Neill. Semi-Riemannian Geometry With Applications to Relativity. ISSN. Elsevier Science, 1983. isbn: 9780080570570. url: https://books.google.it/books?id= CGk1eRSjFIIC. [82] N. Otter, M. A. Porter, U. Tillmann, P. Grindrod, and H. A. Harrington. “A roadmap for the computation of persistent homology.” In: EPJ Data Science 6.1 (2017). issn: 2193-1127. doi: 10.1140/epjds/s13688- 017- 0109- 5 .url: http://dx.doi. org/10.1140/epjds/s13688-017-0109-5. [83] T. Padellini and P. Brutti. Persistence Flamelets: multiscale Persistent Homology for kernel density exploration. 2017. arXiv: 1709.07097 [stat.ML]. [84] J. Perea and J. Harer. Sliding Windows and Persistence: An Application of Topological Methods to Signal Analysis. 2013. arXiv: 1307.6188 [math.AT]. [85] G. Petri, P. Expert, F. Turkheimer, R. Carhart-Harris, D. Nutt, P. Hellyer, and F. Vaccarino. “Homological scaffolds of brain functional networks.” In: Journal of The Royal Society Interface 11 (2014), p. 20140873. doi:10.1098/rsif.2014.0873. [86] B. Poole, S. Lahiri, M. Raghu, J. Sohl-Dickstein, and S. Ganguli. “Exponential expressivity in deep neural networks through transient chaos.” In: Advances in Neural Information Processing Systems 29. Ed. by D. D. Lee, M. Sugiyama, U. V. Luxburg, I. Guyon, and R. Garnett. Curran Associates, Inc., 2016, pp. 3360–3368. url: http: / / papers . nips . cc / paper / 6322 - exponential - expressivity - in - deep - neural-networks-through-transient-chaos.pdf. [87] K. N. Ramamurthy, K. R. Varshney, and K. Mody. “Topological Data Analysis of Decision Boundaries with Application to ModelSelection.” In: arXiv preprint arXiv:1805.09949 (2018). [88] J. Reininghaus, S. Huber, U. Bauer, and R. Kwitt. “A stable multi-scale kernel for topological machine learning.” In: June 2015, pp. 4741–4748. doi: 10.1109/CVPR. 2015.7299106. [89] B. Rieck, F. Sadlo, and H. Leitte. Topological Machine Learning with Persistence Indicator Functions. 2019. arXiv: 1907.13496 [math.AT]. 79
BIBLIOGRAPHY [90] B. Rieck, M. Togninalli, C. Bock, M. Moor, M. Horn, T. Gumbsch, and K. Borgwardt. “NeuralPersistence: A Complexity Measure for Deep NeuralNetworks Using Algebraic Topology.” In: International Conference on Learning Representations. 2019. url: https: //openreview.net/forum?id=ByxkijC5FQ. [91] L. K. Saul and S. T. Roweis. “An introduction to locally linear embedding.” In: unpublished. Available at: http://www. cs. toronto. edu/˜ roweis/lle/publications. html (2000). [92] J. Schaeffer. One Jump Ahead: Challenging Human Supremacy in Checkers. Copernicus Series. Springer, 1997. isbn: 9780387949307. url: https://books.google.com. gi/books?id=SLvpkTVhsIsC. [93] V. Silva. “A weak characterisation of the Delaunay triangulation.” In: Geom. Dedicata 135 (Aug. 2008), pp. 39–64. doi:10.1007/s10711-008-9261-1. [94] V. Silva and G. Carlsson. “Topological estimation using witness complexes.” In: Proc. Sympos. Point-Based Graphics (June 2004). doi:10.2312/SPBG/SPBG04/157-166. [95] G. Singh, F. Mémoli, and G. E. Carlsson. “Topological methods for the analysis of high dimensional data sets and 3d object recognition.” In: SPBG 91 (2007), p. 100. [96] P. Skraba and K. Turner. Wasserstein Stability for Persistence Diagrams. 2020. arXiv: 2006.16824 [math.AT]. [97] D. I. Spivak. “METRIC REALIZATION OF FUZZY SIMPLICIAL SETS.” In: 2009. [98] N. Srivastava, G. Hinton, A. Krizhevsky, I. Sutskever, and R. Salakhutdinov. “Dropout: a simple way to prevent neural networks from overfitting.” In: The journal of machine learning research 15.1 (2014), pp. 1929–1958. [99] G. Tauzin, U. Lupo, L. Tunstall, J. B. Pérez, M. Caorsi, A. Medina-Mardones, A. Dassatti, and K. Hess. giotto-tda: A Topological Data Analysis Toolkit for Machine Learning and Data Exploration. 2020. arXiv: 2004.02551 [cs.LG]. [100] D. Taylor, F. Klimm, H. A. Harrington, M. Kramár, K. Mischaikow, M. A. Porter, and P. J. Mucha. “Topological data analysis of contagion maps for examining spreading processes on networks.” In: Nature Communications 6.1 (2015). issn: 2041-1723. doi: 10.1038/ncomms8723.url:http://dx.doi.org/10.1038/ncomms8723. [101] J. B. Tenenbaum, V. De Silva, and J. C. Langford. “A global geometric framework for nonlinear dimensionality reduction.” In: science 290.5500 (2000), pp. 2319–2323. [102] The GUDHI Project. GUDHI User and Reference Manual. 3.3.0. GUDHI Editorial Board, 2020. url:https://gudhi.inria.fr/doc/3.3.0/. [103] C. Tralie, N. Saul, and R. Bar-On. “Ripser.py: A Lean Persistent Homology Library for Python.” In: The Journal of Open Source Software 3.29 (2018), p. 925. doi: 10.21105/ joss.00925.url:https://doi.org/10.21105/joss.00925. 80
BIBLIOGRAPHY [104] V. N. Vapnik and A. Y. Chervonenkis. “On the uniform convergence of relative frequencies of events to their probabilities.” In: Theory of Probability and its Applications. 1971, 16:264–280. [105] L. Vietoris. “Über den höheren Zusammenhang kompakter Räume und eine Klasse von zusammenhangstreuen Abbildungen.” In: Mathematische Annalen 97.1 (1927), pp. 454– 472. [106] A. Wagner. Nonembeddability of Persistence Diagrams with p > 2 Wasserstein Metric. 2019. arXiv: 1910.13935 [math.FA]. [107] H. Wagner, C. Chen, and E. Vuçini. “Efficient Computation of Persistent Homology for Cubical Data.” In: Topological Methods in Data Analysis and Visualization II: Theory, Algorithms, and Applications. Ed. by R. Peikert, H. Hauser, H. Carr, and R. Fuchs. Berlin, Heidelberg: Springer Berlin Heidelberg, 2012, pp. 91–106. isbn: 978-3-642-23175-9. doi: 10.1007/978-3-642-23175-9_7 .url: https://doi.org/10.1007/978-3- 642-23175-9_7. [108] H. Whitney. “Congruent Graphs andthe Connectivity of Graphs.” In: American Journal of Mathematics 54.1 (1932), pp. 150–168. issn: 00029327, 10806377. url: http:// www.jstor.org/stable/2371086. [109] S. Willerton. Spread: a measure of the size of metric spaces. 2012. arXiv: 1209.2300 [math.MG]. [110] S. Wolfram and W. Media. A New Kind of Science. Wolfram Media, 2002. isbn: 9781579550080. 81
Appendix A Proofs It is my experience that proofs involving matrices can be shortened by 50% if one throws the matrices out. -Emil Artin (Geometric Algebra) Proof of theorem 2.1.3. Theorem. The following definitions are equivalent 1. Let X and Y be topological spaces. Let f:X→Y be such that if for each open set U⊆Ythen f−1(U)is also an open set in X 2. ∀ > 0,∃δ > 0such that kp−xk< δ =⇒ kf(p)−f(x)k< Proof. We prove (1) =⇒(2) . Let f:X→Y be such that if for each open set U⊆Y then f−1(U) is also an open set in X . We want to show that for every > 0 it is possible to find δ > 0 such that kp−xk< δ =⇒ kf(p)−f(x)k< . For a fixed x∈X and > 0 let V be the set V=B(f(p)) = {y∈Y|ky−f(p)k< }(A.1) which is by definition an open set. By assumption if V is open, f−1(V) is also an open set, hence there exists a δ > 0such that x∈f−1(V)if kx−f(p)k≤δwhich implies x∈=Bδ(p) =⇒f(x)∈B(f(p)) (A.2) We prove (2) =⇒(1). Let f:X→Y such that ∀ > 0 , ∃δ > 0 such that kp−xk< δ =⇒ kf(p)−f(x)k< . Let V be an open set in Y . Suppose p∈X and f(p)∈V since V is open there exists a > 0 such that B(f(p)) = {y∈Y|ky−f(p)k< }⊆V(A.3) 83
APPENDIX B. ON THE COMBINATORIA OF NEURAL ARCHITECTURES Therefore for each possible partition (l0,l1,l2...ln)of pwe consider the system: n0n1=l0 n1n2=l1 . . . nk−1nk=lk−1 This system is underdetermined since we have k variables and k−1 equations. Yet the total number of solutions is still finite since we have the restriction that each ni has to be an integer. Therefore let αbe a divisor of l0. By setting n0=αwe get a determined system: n0=α ni+1 =li ni∀i > 0(B.3) And the ordered set (n0,n1,n2,...nk) is a valid architecture of p parameters if each ni is an integer. Note that each ni+1 only exists if it is a common divisor of both liand li+1. B.1 Adding bias to the mix. The addition of bias changes minimally the system of equations described above, because the effect of biases on the number of parameters is also uniquely dependent on the number of neurons in each layer. For an architecture (n0,n1,n2...nk) the number of parameters p , including bias is given by: p=n0n1+n1+n1n2+n2...nk−1nk+nk p= k−1 X i=0 nini+1 +ni+1 = k−1 X i=0 ni+1(ni+ 1) In an analogous way, for a (l0,...lk−1) partition of p we have that li=ni+1(ni+ 1) And for each divisor αof l0we get the determined system: n0=α ni+1 =li ni+ 1 ∀i > 0(B.4) B.2 A computational view. Note that we have a possible architecture for every partition of p , times every divisor of the first element of each partition. If Np is the number of neural network architectures with p parameters then we have that: Np≤C(p)X i,j αij (B.5) 90
B.2. A COMPUTATIONAL VIEW. Where αij is the i -th divisor of the first element of the j -partition of p and C(p) is number of ways to partition p . Note that the maximum value in each any partition is p−1 and the sum of all the divisors of p−1, denoted by σ(p−1) is bounded by: σ(p−1) < eγ(p−1)loglog(p−1) + 0.6483(p−1) loglog(p−1) (B.6) Where γ= 0.577215... is the Euler’s constant. We also have that the an upper bound for the different partitions of p: C(p)< eπ√2 3√p(B.7) Proposition B.2.1. Let Np be the number of different architectures with p parameters, we have that: Np< eπ√2 3√p eγ(p−1)loglog(p−1) + 0.6483(p−1) loglog(p−1)!(B.8) ON the practical side, the biggest hurdle is definitely the number of partitions which exponentially increases the number of possible architectures, while the number of divisors has a constant effect on the number of possibilities. This is mainly because there are a lot of partitions that have no practical value in our study such as the trivial ones p=Pp1 . We will touch on this point later. Based on the analysis done above we can create and algorithm to find all possible architectures given a parameter value p . Such an algorithm obviously runs on exponential 91
APPENDIX B. ON THE COMBINATORIA OF NEURAL ARCHITECTURES time. Algorithm 2: Find all architectures of pparameters input :Integer pnumber of parameters input :b= 1 if bias, b= 0 otherwise output:List of lists A= (N0,N1...Nm) where each Niis a list of integers (n0,n1,...nl) A←initialize empty list; for each partition qof pdo for each factor fof q0do N←initialize empty list; z←f; add zto N; i←0; while zis an integer do z←qi z+b; add zto N; i+ +; if i=size of qthen add Nto A; end end end end (a) Upper bound for the number of possible architectures (b) Upper bound compared with the architectures computed using Algo. 2 Figure B.1: Logarithm of total number ofpossible architectures (y-axis logNp ) of p -parameters (x-axis) compared with the upper bound (red) Proposition B.2.2. Let Np be the number of possible architectures of p parameters without considering bias and Nb pbe the number of architectures with bias. We have that Nb p≤Np∀p∈N(B.9) 92
B.2. A COMPUTATIONAL VIEW. Proof. Consider Np as the set of all architectures of p parameters with no bias. Then Np=|Np| . equivalently for the set of architectures with bias Nb p=|Nb p| . We will prove the proposition by showing that: •∀n∈Nb p∃q < p such that n∈Nq •thus justifying that Pp iNb i≤Pp iNi •which along with the implication q≤p⇒Nq≤Npconcludes the proof. Let (n0,n1,...nk)be a p-parameter architecture with bias, meaning that: p= k−1 X i=0 nini+1 +ni+1 = k−1 X i=0 nini+1 + k X i=1 ni Which is equivalent to p− k X i=1 ni= k−1 X i=0 nini+1 (B.10) Let q=p−Pk i=1 ni and since every ni is a positive integer then q is also a positive integer. Thus we have that: q= k−1 X i=0 nini+1 (B.11) Which an acceptable q parameter neural network architecture with no bias. Thus if a sequence (n0,n1,...nk)∈Nb pthen it also belongs to Nqfor some q < p. Hence, we now have that p X iNb i≤ p X iNi(B.12) By noting that q≤p⇒Nq≤Npwe have that: Nb p≤Np∀p∈N(B.13) The proof hangs on the (small) assumption that there is a valid architecture for every p∈N. We leave this unproven, albeit being a interesting problem all by itself. 93