Effects of Data Geometry in Early Deep Learning
Abstract
Deep neural networks can approximate functions on different types of data, from images to graphs, with varied underlying structure.
This underlying structure can be viewed as the geometry of the data manifold.
By extending recent advances in the theoretical understanding of neural networks, we study how a randomly initialized neural network with piece-wise linear activation splits the data manifold into regions where the neural network behaves as a linear function.
We derive bounds on the density of boundary of linear regions and the distance to these boundaries on the data manifold.
This leads to insights into the expressivity of randomly initialized deep neural networks on non-Euclidean data sets.
We empirically corroborate our theoretical results using a toy supervised learning problem.
Our experiments demonstrate that number of linear regions varies across manifolds and the results hold with changing neural network architectures.
We further demonstrate how the complexity of linear regions is different on the low dimensional manifold of images as compared to the Euclidean space, using the
MetFaces dataset.
Introduction
The capacity of Deep Neural Networks (DNNs) to approximate arbitrary functions given sufficient training data in the supervised learning setting is well known [Cybenko, 1989, Hornik et al., 1989,
Anthony and Bartlett, 1999].
Several different theoretical approaches have emerged that study the effectiveness and pitfalls of deep learning.
These studies vary in their treatment of neural networks and the aspects they study range from convergence [Allen-Zhu et al., 2019, Goodfellow and Vinyals, 2015], generalization [Kawaguchi et al., 2017, Zhang et al., 2017, Jacot et al., 2018, Sagun et al., 2018], function complexity [Mont´ufar et al., 2014, Mhaskar and Poggio, 2016], adversarial attacks [Szegedy et al., 2014, Goodfellow et al., 2015] to representation capacity [Arpit et al., 2017].
Some recent theories have also been shown to closely match empirical observations [Poole et al., 2016,
Hanin and Rolnick, 2019b, Kunin et al., 2020].
One approach to studying DNNs is to examine how the underlying structure, or geometry, of the data interacts with learning dynamics.
The manifold hypothesis states that high-dimensional real world data typically lies on a low dimensional manifold [Tenenbaum, 1997, Carlsson et al., 2007, Fefferman et al., 2013].
Empirical studies have shown that DNNs are highly effective in deciphering this underlying structure by learning intermediate latent representations [Poole et al., 2016].
The ability of DNNs to “flatten” complex data manifolds, using composition of seemingly simple piece-wise linear functions, appears to be unique [Brahma et al., 2016, Hauser and Ray, 2017].
DNNs with piece-wise linear activations, such as ReLU [Nair and Hinton, 2010], divide the input space into linear regions, wherein the DNN behaves as a linear function [Mont´ufar et al., 2014].
The density of these linear regions serves as a proxy for the DNN’s ability to interpolate a complex data landscape and has been the subject of detailed studies [Mont´ufar et al., 2014, Telgarsky, 2015, Serra et al., 2018, Raghu et al., 2017].
The work by Hanin and Rolnick [2019a] on this topic stands out because they derive bounds on the average number of linear regions and verify the tightness of these bounds empirically for deep ReLU networks, instead of larger bounds that rarely materialize.
Hanin and Rolnick [2019a] conjecture that the number of linear regions correlates to the expressive power of randomly initialized DNNs with piece-wise linear activations.
However, they assume that the data is uniformly sampled from the Euclidean space R d , for some d .
By combining the manifold hypothesis with insights from Hanin and Rolnick [2019a], we are able to go further in estimating the number of linear regions and the average distance from linear boundaries .
We derive bounds on how the geometry of the data manifold affects the aforementioned quantities.
To corroborate our theoretical bounds with empirical results, we design a toy problem where the input data is sampled from two distinct manifolds that can be represented in a closed form.
We count the exact number of linear regions and the average distance to the boundaries of linear regions on these two manifolds that a neural network divides the two manifolds into.
We demonstrate how the number of linear regions and average distance varies for these two distinct manifolds.
These results show that the number of linear regions on the manifold do not grow exponentially with the dimension of input data.
Our experiments do not provide estimates for theoretical constants, as in most deep learning theory, but demonstrate that the number of linear regions change as a consequence of these constants.
We also study linear regions of deep ReLU networks for high dimensional data that lies on a low dimensional manifold with unknown structure and how the number of linear regions vary on and off this manifold, which is a more realistic setting.
To achieve this we present experiments performed on the manifold of natural face images.
We sample data from the image manifold using a generative adversarial network (GAN)
[Goodfellow et al., 2014] trained on the curated images of paintings.
Specifically, we generate images using the pre-trained StyleGAN [Karras et al., 2019, 2020b] trained on the curated MetFaces dataset [Karras et al., 2020a].
We generate curves on the image manifold of faces, using StyleGAN, and report how the density of linear regions varies on and off the manifold.
These results shed new light on the geometry of deep learning over structured data sets by taking a data intrinsic approach to understanding the expressive power of DNNs.
Preliminaries and Background
Our goal is to understand how the underlying structure of real world data matters for deep learning.
We first provide the mathematical background required to model this underlying structure as the geometry of data.
We then provide a summary of previous work on understanding the approximation capacity of deep ReLU networks via the complexity of linear regions.
For the details on how our work fits into one of the two main approaches within the theory of DNNs, from the expressive power perspective or from the learning dynamics perspective, we refer the reader to Appendix C.
2.1 Data Manifold and Definitions
Suppose each point corresponds to an image of a face on this 2-torus.
We can chart two curves: one straight line cutting across the 3D space and another curve that stays on the torus.
Images corresponding to the points on the torus will have a smoother variation in style and shape whereas there will be images corresponding to points on the straight line that are not faces.
We use the example of the MetFaces dataset [Karras et al., 2020a] to illustrate how data lies on a low dimensional manifold.
The images in the dataset are 1028 × 1028 × 3 dimensional.
By contrast, the number of realistic dimensions along which they vary are limited, e.g. painting style, artist, size and shape of the nose, jaw and eyes, background, clothing style; in fact, very few 1028 × 1028 × dimensional images correspond to realistic faces.
We illustrate how this affects the possible variations in the data in Figure 1.
A manifold formalises the notion of limited variations in high dimensional data.
One can imagine that there exists an unknown function f : X → Y from a low dimensional space of variations, to a high dimensional space of the actual data points.
Such a function f : X → Y , from one open subset X ⊂ R m , to another open subset Y ⊂ R k , is a diffeomorphism if f is bijective, and both f and f − 1 are differentiable (or smooth).
Therefore, a manifold is defined as follows.
Definition 2.1.
Let k, m ∈ N 0 .
A subset M ⊂ R k is called a smooth m -dimensional submanifold of R k (or m -manifold in R k ) iff every point x ∈ M has an open neighborhood U ⊂ R k such that
U ∩ M is diffeomorphic to an open subset Ω ⊂ R m .
A diffeomorphism (i.e. differentiable mapping),
[Equation]
is called a coordinate chart of M and the inverse,
[Equation]
is called a smooth parametrization of U ∩ M .
For the MetFaces dataset example, suppose there are 10 dimensions along which the images vary.
Further assume that each variation can take a value continuously in some interval of R .
Then the smooth parametrization would map f : Ω ∩ R 10 → M ∩ R 1028 × 1028 × 3 .
This parametrization and its inverse are unknown in general and computationally very difficult to estimate in practice.
There are similarities in how geometric elements are defined for manifolds and Euclidean spaces.
A smooth curve, on a manifold M , γ : I → M is defined from an interval I to the manifold M as a function that is differentiable for all t ∈ I , just as for Euclidean spaces.
The shortest such curve between two points on a manifold is no longer a straight line, but is instead a geodesic .
One recurring geometric element, which is unique to manifolds and stems from the definition of smooth curves, is that of a tangent space , defined as follows.
Definition 2.2.
Let M be an m -manifold in R k and x ∈ M be a fixed point.
A vector v ∈ R k is called a tangent vector of M at x if there exists a smooth curve γ : I → M such
that γ (0) =
x, ˙ γ (0) = v where ˙ γ ( t ) is the derivative of γ at t .
The set
[Equation]
of tangent vectors of M at x is called the tangent space of M at x .
In simpler terms, the plane tangent to the manifold M at point x is called the tangent space and denoted by by T x M .
Consider the upper half of a 2-sphere, S 2 ⊂ R 3 , which is a 2-manifold in R 3 .
The tangent space at a fixed point x ∈ S 2 is the 2D plane perpendicular to the vector x and tangential to the surface of the sphere that contains the point x .
For additional background on manifolds we refer the reader to Appendix B.
2.2 Linear Regions of Deep ReLU Networks
The higher the density of these linear regions the more complex a function a DNN can approximate.
For example, a sin curve in the range [0 , 2 π ] is better approximated by 4 piece-wise linear regions as opposed to 2.
To clarify this further, with the 4 “optimal” linear regions [0 , π/ 2) , [ π/ 2 , π ) , [ π, 3 π/ 2) , and [3 π/ 2 , 2 π ] a function could approximate the sin curve better than any 2 linear regions.
In other words, higher density of linear regions allows a DNN to approximate the variation in the curve better.
We define the notion of boundary of a linear regions in this section and provide an overview of previous results.
We consider a neural network, F , which is a composition of activation functions.
Inputs at each layer are multiplied by a matrix, referred to as the weight matrix, with an additional bias vector that is added to this product.
We limit our study to ReLU activation function [Nair and Hinton, 2010], which is piece-wise linear and one of the most popular activation functions being applied to various learning tasks on different types of data like text, images, signals etc.
We further consider DNNs that map inputs, of dimension n in , to scalar values.
Therefore, F : R n in → R is defined as,
[Equation]
where W l ∈ M n l × n l − 1 is the weight matrix for the l th hidden layer, n l is the number of neurons in the l th hidden layer, B l ∈ R n l is the vector of biases for the l th hidden layer, n 0 = n in and σ : R → R is the activation function.
For a neuron z in the l th layer we denote the pre-activation of this neuron, for given input x ∈ R n in , as z l ( x ) .
For a neuron z in the layer l we have
[Equation]
for l > 1 (for the base case l = 1 we have z ( x ) =
W 1 ,z x ) where W l − 1 ,z is the row of weights, in the weight matrix of the l th layer, W l , corresponding to the neuron z .
We use W z to denote the weight vector for brevity, omitting the layer index l in the subscript.
We also use b z to denote the bias term for the neuron z .
Neural networks with piece-wise linear activations are piece-wise linear on the input space [Mont´ufar et al., 2014].
Suppose for some fixed y ∈ R n in as x → y if we have z ( x ) → − b z then we observe a discontinuity in the gradient ∇ x σ ( b z + W z z ( x )) at y .
Intuitively, this is because x is approaching the boundary of the linear region of the function defined by the output of z .
Therefore, the boundary of linear regions, for a feed forward neural network F , is defined as:
[Equation]
Hanin and Rolnick [2019a] argue that an important generalization for the approximation capacity of a neural network F is the ( n in − 1) − dimensional volume density of linear regions defined as vol n in − 1 ( B F ∩ K ) / vol n in ( K ) , for a bounded set K ⊂ R n in .
This quantity serves as a proxy for density of linear regions and therefore the expressive capacity of DNNs.
Intuitively, higher density of linear boundaries means higher capacity of the DNN to approximate complex non-linear functions.
The quantity is applied to lower bound the distance between a point x ∈ K and the set B F , which is
[Equation]
z
[Equation]
x ) || , which measures the sensitivity over neurons at a given input.
The above quantity measures how “far” the input is from flipping any neuron from inactive to active or vice-versa.
Informally, Hanin and Rolnick [2019a] provide two main results for a randomly initialized DNN F , with a reasonable initialisation.
Firstly, they show that
[Equation]
meaning the density of linear regions is bound above and below by some constant times the number of neurons.
Secondly, for x ∈ [0 , 1] n in ,
[Equation]
where C > 0 depends on the distribution of biases and weights, in addition to other factors.
In other words, the distance to the nearest boundary is bounded above and below by a constant times the inverse of the number of neurons.
These results stand in contrast to earlier worst case bounds that are exponential in the number of neurons.
Hanin and Rolnick [2019a] also verify these results empirically to note that the constants lie in the vicinity of 1 throughout training.
Linear Regions on the Data Manifold
One important assumption in the results presented by Hanin and Rolnick [2019a] is that the input, x , lies in a compact set K ⊂ R n in and that vol n in ( K ) is greater than 0.
Also, the theorem pertaining to the lower bound on average distance of x to linear boundaries the input assumes the input uniformly distributed in [0 , 1] n in .
As noted earlier, high-dimensional real world datasets, like images, lie on low dimensional manifolds, therefore both these assumptions are false in practice.
This motivates us to study the case where the data lies on some m − dimensional submanifold of R n in , i.e. M ⊂ R n in where m ≪ n in .
We illustrate how this constraint effects the study of linear regions in Figure 2.
As introduced by Hanin and Rolnick [2019a], we denote the “ ( n in − k ) − dimensional piece” of
B F as B F,k .
More precisely, B F, 0 = ∅ and B F,k is recursively defined to be the set of points x ∈ B F \ {B F, 0 ∪ ... ∪ B F,k − 1 } with the added condition that in a neighbourhood of x the set B F,k coincides with hyperplane of dimension n in − k .
We provide a detailed and formal definition for B F,k with intuition in Appendix E.
In our setting, where the data lies on a manifold M , we define B ′ F,k as B F,k ∩ M , and note that dim( B ′ F,k ) = m
− k
(Appendix E Proposition E.4).
For example, the transverse intersection (see Definition E.3) of a plane in 3D with the 2D manifold S 2 is a 1D curve in
S 2 and therefore has dimension 1 .
Therefore, B ′ F,k is a submanifold of dimension 3 − 2 = 1 .
This imposes the restriction k ≤ m , for the intersection B F,k ∩ M to have a well defined volume.
We first note that the definition of the determinant of the Jacobian, for a collection of neurons z 1 , ..., z k , is different in the case when the data lies on a manifold M as opposed to in a compact set of dimension n in in R n in .
Since the determinant of the Jacobian is the quantity we utilise in our proofs and theorems repeatedly we will use the term Jacobian to refer to it for succinctness.
Intuitively, this follows from the Jacobian of a function being defined differently in the ambient space R n in as opposed to the manifold M .
In case of the former it is the volume of the paralellepiped determined by the vectors corresponding to the directions with steepest ascent along each one of the n in axes.
In case of the latter it is more complex and defined below.
Let H m be the m − dimensional Hausdorff measure (we refer the reader to the Appendix B for background on Hausdorff measure).
The Jacobian of a function on manifold M , as defined by Krantz and Parks [2008] (Chapter 5), is as follows.
Definition 3.1.
The (determinant of) Jacobian of a function H :
M → R k , where k ≤ dim( M ) = m , is defined as
[Equation]
(cid:111)
[Equation]
where D M : T x M → R k is the differential map (see Appendix B) and we use D M H ( P ) to denote the mapping of the set P in T x M , which is a parallelepiped, to R k .
The supremum is taken over all parallelepipeds P .
We also say that neurons z 1 , ..., z k are good at x if there exists a path of neurons from z to the output in the computational graph of F so that each neuron is activated along the path.
Our three main results that hold under the assumptions listed in Appendix A, each of which extend and improve upon the theoretical results by Hanin and Rolnick [2019a], are:
Theorem 3.2.
Given F a feed-forward ReLU network with input dimension n in , output dimension 1 , and random weights and biases.
Then for any bounded measurable submanifold M ⊂ R n in and any k = 1 , ...., m the average ( m − k ) − dimensional volume of B F,k inside M ,
[Equation]
where Y z 1 ,...,z k is J Mm,
H k
( x ) ρ b 1 ,...,
b k ( z 1 ( x ) , ..., z k ( x )) , times the indicator function of the event that z j is good at x for each j = 1 , ..., k .
Here the function ρ b z 1 ,...,
b zk is the density of the joint distribution of the biases b z 1 , ..., b z k .
This change in the formula, from Theorem 3.4 by Hanin and Rolnick [2019a], is a result of the fact that z ( x ) has a different direction of steepest ascent when it is restricted to the data manifold
M , for any j .
The proof is presented in Appendix E. Formula 3 also makes explicit the fact that the data manifold has dimension m ≤ n in and therefore the m − k -dimensional volume is a more representative measure of the linear boundaries.
Equipped with Theorem 3.2, we provide a result for the density of boundary regions on manifold M .
Theorem 3.3.
For data sampled uniformly from a compact and measurable m dimensional manifold
M we have the following result for all k ≤ m :
[Equation]
where C grad depends on ||∇ z
( x ) || and the DNN’s architecture, C M depends on the geometry of M , and C bias on the distribution of biases ρ b .
The constant C M is the supremum over the matrix norm of projection matrices onto the tangent space, T x M , at any point x ∈ M .
For the Euclidean space C M is always equal to 1 and therefore the term does not appear in the work by Hanin and Rolnick [2019a], but we cannot say the same for our setting.
We refer the reader to Appendix F for the proof, further details, and interpretation.
Finally, under the added assumptions that the diameter of the manifold M is finite and M has polynomial volume growth we provide a lower bound on the average distance to the linear boundary for points on the manifold and how it depends on the geometry and dimensionality of the manifold.
Theorem 3.4.
For any point, x , chosen randomly from M , we have:
[Equation]
where C M,κ depends on the scalar curvature, the input dimension and the dimensionality of the manifold M .
The function distance M is the distance on the manifold M .
This result gives us intuition on how the density of linear regions around a point depends on the geometry of the manifold.
The constant C M,κ captures how volumes are distorted on the manifold
M as compared to the Euclidean space, for the exact definition we refer the reader to the proof in
Appendix G. For a manifold which has higher volume of a unit ball, on average, in comparison to the Euclidean space the constant C M,κ is higher and lower when the volume of unit ball, on average, is lower than the volume of the Euclidean space.
For background on curvature of manifolds and a proof sketch we refer the reader to the Appendices B and D, respectively.
Note that the constant C M is the same as in Theorem 3.3.
Another difference to note is that we derive a lower bound on the geodesic distance on the manifold M and not the Euclidean distance in R k as done by Hanin and
Rolnick [2019a].
This distance better captures the distance between data points on a manifold while incorporating the underlying structure.
In other words, this distance can be understood as how much a data point should change to reach a linear boundary while ensuring that all the individual points on the curve, tracing this change, are “valid” data points.
3.1 Intuition For Theoretical Results
One of the key ingredients of the proofs by Hanin and Rolnick [2019a] is the co-area formula [Krantz and Parks, 2008].
The co-area formula is applied to get a closed form representation of the k − dimensional volume of the region where any set of k neurons, z 1 , z 2 , ...,
z k is “good” in terms of the expectation over the Jacobian, in the Euclidean space.
Instead of the co-area formula we use the smooth co-area formula [Krantz and Parks, 2008] to get a closed form representation of the m − k − dimensional volume of the region intersected with manifold, M , in terms of the Jacobian defined on a manifold (Definition 3.1).
The key difference between the two formulas is that in the smooth co-area formula the Jacobian (of a function from the manifold M ) is restricted to the tangent plane.
While the determinant of the “vanilla” Jacobian measures the distortion of volume around a point in Euclidean space the determinant of the Jacobian defined as above (Definition 3.1) measures the distortion of volume on the manifold instead for the function with the same domain, the function that is 1 if the set of neurons are good and 0 otherwise.
The value of the Jacobian as defined in Definition 3.1 has the same volume as the projection of the parallelepiped defined by the gradients ∇ z ( x ) onto the tangent space (see Proposition F.1 in
Appendix).
This introduces the constant C M , defined above.
Essentially, the constant captures how the magnitude of the gradients, ∇ z ( x ) , are modified upon being projected to the tangent plane.
Certain manifolds “shrink” vectors upon projection to the tangent plane more than others, on an average, which is a function of their geometry.
We illustrate how two distinct manifolds “shrink” the gradients differently upon projection to the tangent plane as reflected in the number of linear regions on the manifolds (see Figure 11 in the appendix) for 1D manifolds.
We provide intuition
[Figure]
for the curvature of a manifold in Appendix B, due to space constraints, which is used in the lower bound for the average distance in Theorem 3.4.
The constant C M,κ depends on the curvature as the supremum of a polynomial whose coefficients depend on the curvature, with order at most n in and at least n in − m .
Note that despite this dependence on the ambient dimension, there are other geometric constants in this polynomial (see Appendix G).
Finally, we also provide a simple example as to how this constant varies with n in and m , for a simple and contrived example, in Appendix G.1.
Experiments 4.1 Linear Regions on a 1D Curve
To empirically corroborate our theoretical results, we calculate the number of linear regions and average distance to the linear boundary on 1D curves for regression tasks in two settings.
The first is for 1D manifolds embedded in 2D and higher dimensions and the second is for the high-dimensional data using the MetFaces dataset.
We use the same algorithm, for the toy problem and the highdimensional dataset, to find linear regions on 1D curves.
We calculate the exact number of linear regions for a 1D curve in the input space, x : I → R n in where I is an interval in real numbers, by finding the points where z ( x ( t ))
=
b z for every neuron z .
The solutions thus obtained gives us the boundaries for neurons on the curve x .
We obtain these solutions by using the programmatic activation of every neuron and using the sequential least squares programming (SLSQP) algorithm
[Kraft, 1988] to solve for | z ( x ( t )) − b z | = 0 for t ∈ I .
In order to obtain the programmatic activation of a neuron we construct a Deep ReLU network as defined in Equation 2.
We do so for all the neurons for a given DNN with fixed weights.
4.2 Supervised Learning on Toy Dataset
We define two similar regression tasks where the data is sampled from two different manifolds with different geometries.
We parameterize the first task, a unit circle without its north and south poles, by ψ circle : ( − π, π ) →
R 2 where ψ circle ( θ ) =
(cos θ, sin θ ) and θ is the angle made by the vector from the origin to the point with respect to the x-axis.
We set the target function for regression task to be a periodic function in θ .
The target is defined as z ( θ ) = a sin( νθ ) where a is the amplitude and ν is the frequency (Figure 3).
DNNs have difficulty learning periodic functions [Ziyin et al., 2020].
The motivation behind this is to present the DNN with a challenging task where it has to learn the underlying structure of the data.
Moreover the DNN will have to split the circle into linear regions.
For the second regression task, a tractrix is parametrized by ψ tractrix : R 1 → R 2 where ψ tractrix ( y ) =
( y − tanh y, sech y )
(see Figure 3).
We assign a target function z ( t )
=
a sin( νt ) .
For the purposes of our study we restrict the domain of ψ tractrix to ( − 3 , 3) .
We choose ν
so as to ensure that the number of peaks and troughs, 6, in the periodic target function are the same for both the manifolds.
This ensures that the domains of both the problems have length close to 6.28.
Further experimental details are in Appendix H.
The results, averaged over 20 runs, are presented in Figures 4 and 5.
We note that C M is smaller for Sphere (based on Figure 4) and the curvature is positive whilst C M is larger for tractrix and the curvature is negative.
Both of these constants (curvature and C M ) contribute to the lower bound in Theorem 3.4.
Similarly, we show results of number of linear regions divided by the number of neurons upon changing architectures, consequently the number of neurons, for the two manifolds in
Figure 8, averaged over 30 runs.
Note that this experiment observes the effect of C M × C grad , since changing the architecture also changes C grad and the variation in C grad is quite low in magnitude as observed empirically by Hanin and Rolnick [2019a].
The empirical observations are consistent with our theoretical results.
We observe that the number of linear regions starts off close to # neurons and remains close throughout the training process for both the manifolds.
This supports our theoretical results (Theorem 3.3) that the constant C M , which is distinct across the two manifolds, affects the number of linear regions throughout training.
The tractrix has a higher value of C M and that is reflected in both Figures 4 and 5.
Note that its relationship is inverse to the average distance to the boundary region, as per Theorem 3.4, and it is reflected as training progresses in Figure 5.
This is due to different “shrinking” of vectors upon being projected to the tangent space (Section 3.1).
4.3 Varying n in
To empirically corroborate the results of Theorems 2 and 3 we vary the dimension n in while keeping m constant.
We achieve this by counting the number of linear regions and the average distance to boundary region on the 1D circle as we vary the input dimension in steps of 5.
We draw samples of 1D circles in R n in by randomly choosing two perpendicular basis vectors.
We then train a network with the same architecture as the previous section on the periodic target function ( a sin( νθ ) ) as defined above.
The results in Figure 6 shows that the quantities stay proportional to # neurons , and do not vary as n in is increased, as predicted by our theoretical results.
Our empirical study asserts how the relevant upper and lower bounds, for the setting where data lies on a low-dimensional manifold, does not grow exponentially with n in for the density of linear regions in a compact set of R n in but instead depend on the intrinsic dimension.
Further details are in Appendix H.
4.4 MetFaces: High Dimensional Dataset
Our goal with this experiment is to study how the density of linear regions varies across a low dimensional manifold and the input space.
To discover latent low dimensional underlying structure of data we employ a GAN.
Adversarial training of GANs can be effectively applied to learn a mapping from a low dimensional latent space to high dimensional data [Goodfellow et al., 2014].
The generator is a neural network that maps g : R k
→ R n in .
We train a deep ReLU network on the MetFaces dataset with random labels (chosen from 0 , 1 ) with cross entropy loss.
As noted by Zhang et al.
[2017], training with random labels can lead to the DNN memorizing the entire dataset.
We compare the log density of number of linear regions on a curve on the manifold with a straight line off the manifold.
We generate these curves using the data sampled by the StyleGAN by [Karras et al., 2020a].
Specifically, for each curve we sample a random pair of latent vectors: z 1 , z 2 ∈ R k , this gives us the start and end point of the curve using the generator g ( z 1 ) and g ( z 2 ) .
We then generate 100 images to approximate a curve connecting the two images on the image manifold in a piece-wise manner.
We do so by taking 100 points on the line connecting z 1 and z 2 in the latent space that are evenly spaced and generate an image from each one of them.
Therefore, the i th image is generated as: z ′ i
=
g
(((100 − i ) ×
z 1 + i × z 2 ) / 100) , using the StyleGAN generator g .
We qualitatively verify the images to ensure that they lie on the manifold of images of faces.
The straight line, with two fixed points g ( z 1 ) and g ( z 2 ) , is defined as x ( t ) =
(1 − t ) g
( z 1 ) + tg ( z 2 ) with t ∈ [0 , 1] .
The approximated curve on the manifold is defined as x ′ ( t ) =
(1 − t ) g
( z ′ i )
+ tg
( z ′ i +1 ) where i = floor (100 t ) .
We then apply the method from Section 4.1 to obtain the number of linear regions on these curves.
The results are presented in Figure 9.
This leads us to the key observation: the density of linear regions is significantly lower on the data manifold and devising methods to “concentrate” these linear regions on the manifold is a promising research direction.
That could lead to increased expressivity for the same number of parameters.
We provide further experimental details in Appendix I.
Discussion and Conclusions
There is significant work in both supervised and unsupervised learning settings for non-Euclidean data [Bronstein et al., 2017].
Despite these empirical results most theoretical analysis is agnostic
Figure 6: We observe that as the dimension n in is increased, while keeping the manifold dimension constant, the number of linear regions remains proportional to number of neurons (26).
Figure 7: We observe that as the dimension n in is increased, while keeping the manifold dimension constant, the average distance varies very little.
Figure 8: The effects of changing the architecture on the number of linear regions.
We observe that the value of C M effects the number of linear regions proportionally.
The number of hidden units for three layer networks are in the legend along with the data manifold.
Figure 9: We observe that the log density of number of linear regions is lower
) as off
This is for the MetFaces dataset.
to data geometry, with a few prominent exceptions [Cloninger and Klock, 2020, Shaham et al., 2015, Schmidt-Hieber, 2019].
We incorporate the idea of data geometry into measuring the effective approximation capacity of DNNs, deriving average bounds on the density of boundary regions and distance from the boundary when the data is sampled from a low dimensional manifold.
Our experimental results corroborate our theoretical results.
We also present insights into expressivity of DNNs on low dimensional manfiolds for the case of high dimensional datasets.
Estimating the geometry, dimensionality and curvature, of these image manifolds accurately is a problem that remains largely unsolved [Brehmer and Cranmer, 2020, Perraul-Joncas and Meila, 2013], which limits our inferences on high dimensional dataset to observations that guide future research.
We note that proving a lower bound on the number of linear regions, as done by Hanin and Rolnick [2019a], for the manifold setting remains open.
Our work opens up avenues for further research that combines model geometry and data geometry and can lead to empirical research geared towards developing
DNN architectures for high dimensional datasets that lie on a low dimensional manifold.
Acknowledgements
This work was funded by L2M (DARPA Lifelong Learning Machines program under grant number
FA8750-18-2-0117), the Penn MURI (ONR under the PERISCOPE MURI Contract N00014- 171-2699), and the ONR Swarm (the ONR under grant number N00014-21-1-2200).
This research was conducted using computational resources and services at the Center for Computation and
Visualization, Brown University.
We would like to thank Sam Lobel, Rafael Rodriguez Sanchez, and Akhil Bagaria for refining our work, multiple technical discussions, and their helpful feedback on the implementation details.
We also thank Tejas Kotwal for assistance on deriving the mathematical details related to the 1D
Tractrix and sources for various citations.
We thank Professor Pedro Lopes de Almeida, Nihal Nayak,
Cameron Allen and Aarushi Kalra for their valuable comments on writing and presentation of our work.
We thank all the members of the Brown robotics lab for their guidance and support at various stages of our work.
Finally, we are indebted to, and graciously thank, the numerous anonymous reviewers for their time and labor as their valuable feedback and thoughtful engagement have shaped and vastly refine our work
Checklist
For all authors... (a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope?
[Yes] (b) Did you describe the limitations of your work?
[Yes] (c) Did you discuss any potential negative societal impacts of your work?
[N/A]
Our work is primarily theoretical with few toy experiments we do not see its applicability (d) Have you read the ethics review guidelines and ensured that your paper conforms to them?
[Yes] 2.
If you are including theoretical results... (a) Did you state the full set of assumptions of all theoretical results?
[Yes] See Appendix A for a list (b) Did you include complete proofs of all theoretical results?
[Yes] 3.
If you ran experiments... (a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)?
[Yes] See Appendix J (b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)?
[Yes] See experimental sections in the Appendix and main body (c)
Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)?
[Yes] Except for the cases where there are multiple graphs that are overlapping (Figure 6,7, 8) because it would make interpreting them difficult.
(d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)?
[Yes] Appendix J 4.
If you are using existing assets (e.g., code, data, models) or curating/releasing new assets... (a) If your work uses existing assets, did you cite the creators?
[Yes] (b) Did you mention the license of the assets?
[Yes] (c) Did you include any new assets either in the supplemental material or as a URL?
[No] (d) Did you discuss whether
and how consent was obtained from people whose data you’re using/curating?
[N/A] (e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content?
[N/A] 5.
If you used crowdsourcing or conducted research with human subjects... (a) Did you include the full text of instructions given to participants and screenshots, if applicable?
[N/A]
(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable?
[N/A] (c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation?
[N/A]
A Assumptions
We first make explicit the assumptions on the distribution of weights and biases.
A1:
The conditional distribution of any set of biases b z 1 , ..., b z k given all other weights and biases has a density ρ z 1 ,...,z k ( b 1 , ..., b k ) with respect to Lebesgue measure on R k .
A2: The joint distribution of all weights has a density with respect to Lebesgue measure on R # weights .
A3:
The data manifold M is smooth.
A4: (Only needed for Theorem 3) the diameter of M defined by d M
=
sup x,y ∈ M distance M ( x, y ) is finite.
A5:
(Only needed for Theorem 3) a geodesic ball in manifold M has polynomial volume growth of order m .
B Additional Background on Manifolds
We provide further background on the theory of manifolds.
In this section we first provide the background, definition and an interpretation for the scalar curvature of a manifold at a point.
Every smooth manifold is also equipped with a Riemannian metric tensor (or metric tensor in short).
Given any two vectors, v and w , in the tangent space of a point x on a manifold M , the metric tensor defines a parallel to the dot product in Euclidean spaces.
The metric tensor, at a point x , is defined by the smooth functions g ij : M → R , i, j ∈ { 1 , ..., k } .
Where the matrix defined by
[Equation]
ij
[Equation]

 is symmetric and invertible.
The inner product of u, v ∈ T x M is then defined by ⟨ u, v ⟩ M =
u T G x v .
the inner product is symmetric, non-degenerate, and bilinear, i.e.
[Equation]
As can be seen, these properties also hold for the Euclidean inner product (with G x =
I for all x ).
Let the inverse of G =
[ g ij ( x )] be denoted by [ g ij ( x )] .
Building on this definition of the metric tensor the Ricci curvature tensor is defined as
[Equation]
For geometric interpretations of the above tensors we refer the reader to the work by Loveridge [2004].
Another quantity, from the theory of manifolds, which we utilise in our proofs and theorems, is scalar curvature (or Ricci curvature).
The curvature is a measure how much the volume of a geodisic ball on the manifold M, e.g. S 2 , deviates from a d − 1 sphere in the flat space, e.g. R 3 .
The volume on the manifold deviates by an amount proportional to the curvature.
We illustrate this idea in figure 10.
We refer the reader to works by Gray [1974] and Wan [2016] for further technical details.
Since our main theorems relate to the volume of linear regions the scalar curvature plays an important role.
[Figure]
Formally, the scalar curvature of a manifold M at a point x with metric tensor [ g ij ] and Ricci tensor
[ R ij ] is defined as
[Equation]
Another important concept is that of Hausdorff measure .
Since the volumes are “distorted” on a manifold it requires careful consideration when defining a measure and integrating using it on a manifold.
The m − dimensional Hausdorff measure, of a set S , is defined as
[Equation]
Next we introduce the definition of the differential map that is used in Definition 3.1, for the determinant of the Jacobian.
The differential map of a smooth function H from a manifold M to a manifold S at a point x ∈ M is the smooth map dH : T x M → T x S such that the tangent vector corresponding to any smooth curve γ : I → M at x , γ ′ (
) ∈ T x M , maps to the tangent vector of
H ◦ γ in T H ( x ) N .
This is the analog of the total derivative of “vanilla calculus”.
More intuitively, the differential map captures how the function changes along different directions on N as its input changes along different directions on M , this also has an analog to how rows of the Jacobian matrix are viewed in calculus.
In Definition 3.1 we use the specific case where the function H maps from manifold M to the Euclidean space R k and the tangent space of a Euclidean space is the Euclidean space itself.
Finally, a paralellepiped’s, P in T x M , mapping via the differential map gives us the points in R k that correspond to this set P .
C Related Work
There have been various approaches to explain the efficacy of DNNs in approximating arbitrarily complex functions.
We briefly touch upon two such promising approaches.
Broadly, the theory of
DNNs can be viewed from two lenses: expressive power [Hornik et al., 1989, Bartlett et al., 1998,
Poole et al., 2016, Raghu et al., 2017, Kawaguchi et al., 2017, Neyshabur et al., 2018, Hanin, 2019] and learning dynamics [Saxe et al., 2014, Su et al., 2016, Smith and Le, 2018, Jacot et al., 2018,
Lee et al., 2019, Arora et al., 2019a,b].
These approaches are not independent of one another but complementary.
For example, Kawaguchi et al.
[2017] argue theoretically how the family of DNNs generalize well despite the large capacity of the function class.
Neyshabur et al.
[2018] provide
PAC-Bayes generalization bounds which are improved upon by Arora et al.
Hanin [2019] shows that Deep ReLU networks of finite width can approximate any continuous, convex or smooth functions on a unit cube.
These works look at DNNs from the lens of expressive power.
More recently, there has been a surge in explaining how various algorithms arrive at these almost accurate function approximations by applying different theoretical models of DNNs.
Jacot et al.
[2018] provide results for convergence and generalization of DNNs in the infinite width limit by introducing a the neural tangent kernel (NTK).
Hanin and Nica [2020] provide finite depth and width corrections for the NTK.
Another line of work within the learning dynamics literature looks at implicit regularization that emerge from the learning algorithm and over-parametrised DNNs [Arora et al., 2019a,b, Du et al., 2018, Liang et al., 2019].
Researchers have begun to incorporate data geometry into the theoretical analyses of DNNs by applying the assumption that the data lies on a general manifold.
First we note the works looking at DNNs from the lens of expressive power combined with the idea of data geometry.
Shaham et al.
[2015] demonstrate that the size of the neural network depends on the curvature of the data manifold and the complexity of the function, whilst depending weakly on the input data dimension, for their construction of sparsely-connected 4-layer neural networks.
Cloninger and Klock [2020] show that their construction of deep ReLU nets achieve near optimal approximation rates which depend only on the intrinsic dimensionality of the data.
Chen et al.
[2019] exploit the low dimensional structure of data to enhance the function approximation capacity of Deep ReLU networks by means of theoretical guarantees.
Schmidt-Hieber [2019] shows that sparsely connected deep ReLU networks can approximate a Holder function on a low dimensional manifold embedded in a high dimensional space.
Simultaneously, researchers have incorporated data geometry into the learning dynamics line of work [Goldt et al., 2020, Paccolat et al., 2020, Buchanan et al., 2021, Wang et al., 2021].
Buchanan et al.
[2021] apply the NTK model to study how DNNs can separate two curves, representing the data manifolds of two separate classes, on the unit sphere.
Goldt et al.
[2020] introduce the Hidden
Manifold Model for structured data sets to capture the dynamics of two-layer neural networks trained with stochastic gradient descent.
Rahaman et al.
[2019] provide empirical results on which data manifolds are learned faster.
Finally, the work by Novak et al.
[2018] comes the closes in studying the number of linear regions on the data manifold.
They study the change in input output Jacobian, and as a consequence the number of linear regions, for DNNs with piece-wise linearities.
They provide empirical studies by counting the number of linear regions along lines connecting data points as a proxy for number of linear regions on the data manifold.
Our work fits into the study of expressive power of DNNs.
The number of linear regions is a good proxy for the practical expressive power or approximation capacity of Deep ReLU networks [Mont ´ ufar et al., 2014].
The results surrounding the density of linear regions make the fewest simplifying assumptions both on the data and the architecture of the DNN.
The results by Hanin and
Rolnick [2019a] bound the number of linear regions orders of magnitude tighter than previous results by deriving bounds for the average case and not the worst case.
Moreover, they demonstrate the validity empirically in a setting with very few simplifying assumptions.
We introduce the manifold hypothesis to this setting in order to obtain tighter bounds for the first time.
This introduces a toolbox of ideas from differential geometry to analyse the approximation capacity of deep ReLU networks.
In addition to the theoretical works listed above, there has been significant empirical work that applies
DNNs to non-Euclidean data [Bronstein et al., 2017, 2021].
Here the data is assumed to be sampled from manifolds with certain geometric properties.
For example, Ganea et al.
[2018] design DNNs for data sampled from Hyperbolic spaces of arbitrary dimensionality and modify the forward and backward passes accordingly.
There have been numerous applications of modified DNNs, namely graph convolutional networks, to graph data that incorporate the idea that graphs are discrete samples from a smooth manifold [Henaff et al., 2015, Monti et al., 2017, Kipf and Welling, 2017], see the survey by Wu et al.
[2019] for a comprehensive review.
Graph convolutional networks have also been applied to point cloud data for applications in graphics [Qi et al., 2017, Wang et al., 2019].
D Proof Sketch
In this section we provide an overview of how the three main theorems are proved.
Theorem 3. provides an equality for measuring the volume of m − k dimensional boundary regions on the manifold.
To this effect, we introduce the idea of viewing boundary regions as submanifolds on the data manifold instead of hyperplanes (Proposition 6).
We then prove an equality between the volume of boundary regions and the Jacobian of the neurons over the manifold.
We utilise the smooth coarea formula that, intuitively, is applied to integrate a function using level sets on a manifold.
This completes the proof for Theorem 3.2.
To prove Theorem 3.3 we first prove that the Jacobian of a function on a manifold can be denoted using the volume of paralellepiped of vectors in the ambient space subject to a linear transform (Proposition 8).
Using this result and combining it with Theorem 3.2 we can then give an inequality for the density of linear regions.
As can be expected this volume depends on the aforementioned projection, which in turn is related to the geometry of the manifold.
Finally, for proving Theorem 3.4 we first provide an inequality over the tubular neighbourhood of the boundary region.
We then use this result to lower bound the geodesic distance between the boundary region and any random point on the manifold.
The proof strategy follows that of Hanin and Rolnick [2019a] but there are major deviations when it comes to accounting for the geometry of the data manifold.
To the best of our knowledge, we are utilising elements of differential topology that are unique to machine learning when it comes to developing a theoretical understanding of DNNs.
E Proof of Theorem 3.
We follow the proof strategy used by Hanin and Rolnick [2019a] but deviate from it to account for our setting where x ∈ M .
Let S z be the set of values at which the neuron z has a discontinuity in the differential of its output (or the neuron switches between the two linear regions of the piece-wise linear activation σ ),
[Equation]
We also have
[Equation]
Further,
[Equation]
S z ∩ O .
We state propositions 9 and 10 by Hanin and Rolnick [2019a] as we apply them to prove Theorem 3.2, relabeling them as needed.
Proposition E.1.
(Proposition 9 by Hanin and Rolnick [2019a]) Under assumptions A1 and A2, we have, with probability 1,
[Equation]
By extending the notion of S z to multiple neurons we have
[Equation]
meaning that the set (cid:101) S z 1 ,...,
z k is, intuitively, the collection of inputs in R in where the neurons z j , j = 1 , ..., k, switch between linear regions for σ and at which the output of F is affected by the outputs of these neurons.
We refer the reader to section B of the appendix in the work by Hanin and
Rolnick [2019a] for an intuitive explanation of proposition E.1.
Before proceeding we provide a formal definition and intuition for the set B F,k ,
[Equation]
and for any ball of radius ϵ > 0 ,
[Equation] [Equation]
F, − k is subset to a n − k dimensional hyperplane } .
Following the explanation provided by Hanin and Rolnick [2019a], B F,k is the n in − k dimensional piece of B F .
Suppose the boundaries of linear regions for n in = 2 are unions of polygon boundaries, as depicted in Figure 2 of the main body of the paper, then B F, 1 are all the open line segments of these polygons and B F, 2 are the end points.
Next we state Proposition 10 by Hanin and Rolnick [2019a].
Proposition E.2.
(Prosposition 10 by Hanin and Rolnick [2019a])
Fix k
= 1 , ..., n in , and k distinct neurons z 1 , ..., z k in F .
Then, with probability 1, for every x ∈ B F,k there exists a neighbourhood in which B F,k coincides with a n in − k − dimensional hyperplane.
We now present Proposition E.4, and its proof, which incorporates the additional constraint that x ∈ M , which is an m -dimensional manifold in R n in .
To prove the proposition we need the definition of tranversal intersection of two manifolds
[Guillemin and Pollack, 1974].
Definition E.3.
Two submanifolds, M 1 and M 2 , of S are said to intersect transversally if at every point of intersection their tangent spaces, at that point, together generate the tangent space of the manifold, S , by means of linear combinations.
Formally, for all x ∈ M 1 ∩ M
[Equation]
if and only if M 1 and M 2 intersect transversally.
For example, given a 2D hyperplane, P , and the surface of a 3D sphere, S 2 , intersect in the ambient space R 3 .
We have that this intersection is transverse if and only if P is not tangent to S 2 .
For the case where a 2D hyperplane, ¯ P , intersects with S 2 at a point p but does not intersect tranversally it coincides exactly with the tangent plane of S 2 at point { p } =
S 2 ∩ P , i.e. T p S = P .
Note that in either case the tangent space of the 2D hyperplane P at any point of intersection is the plane itself.
Proposition E.4.
Fix k
= 1 , ..., m and k distinct neurons z 1 , ..., z k in F .
Then, with probability 1, for every x ∈ B F,k ∩ M there exists a neighbourhood in which B F,k coincides with an m − k dimensional submanifold in R in .
Proof.
From Proposition E.2 we already know that B F,k is a n in − k -dimensional hyperplane in some neighbourhood of x , with probability 1, for any x ∈ B F,k ∩ M .
Let this hyperplane be denoted by P k .
This is an n − k dimensional submanifold of R n in .
The tangent space of this hyperplane at x is the hyperplane itself.
Therefore, from assumptions A1 and A2 we have that the probability that this hyperplane intersects the manifold M transversally with probability 1.
In other words the probability that this plane P k contains or is contained in T x M is 0 .
Finally, we have the intersection,
M ∩ H k , has dimension dim( M ) + dim( H k ) − n in [Guillemin and Pollack, 1974], which is equal to m − k .
One implication of Proposition E.4 is that for any k ≤ m the m − ( k + 1) dimensional volume of
B F,k ∩ M is 0.
In addition to that, Proposition E.4 implies that, with probability 1,
[Equation]
The final step in the proof of Theorem 3.2 is to prove the following result.
Proposition E.5.
Let z 1 , ..., z k be distinct neurons in F and k ≤ m .
Then for a bounded m − Hausdorff measurable manifold M embedded in R n in ,
[Equation]
where Y z 1 ,...,z k ( x ) equals
[Equation] [Equation]
, z
[Equation]
)) , times the indicator function of the event that z j , for j = 1 , ..., k , is good at x for every j and
H k : R n in → R k is such that H k ( x ) =
[ z 1 ( x ) , ..., z k ( x )] T .
The expectation is over the distribution of weights and biases.
Proof.
Let z 1 , ..., z k be distinct neurons in F and M be an m − dimensional compact Haudorff measurable manifold.
We seek to compute the mean of vol m − k
( (cid:101) S z 1 ,...,z k ∩ M ) over the distribution of weights and biases.
We can rewrite this expression as
[Equation]
The map H k is Lipschitz and C 1 almost everywhere.
We first note the smooth coarea formula (theorem 5.3.9 by Krantz and Parks [2008]) in context of our notation.
Suppose m ≥ k and
H k : R n in → R k is C 1 and M ⊆ R n in is an m − dimensional C 1 manifold in R n in , then
[Equation]
for every H m -measurable function g where J Mk,H k is as defined in Definition 3.1.
We denote preactivations and biases of neurons as z ( x ) =
[ z 1 ( x ) , ..., z k ( x )] T and b z =
[ b z 1 , ..., b z k ] T .
From the notation in A1, we have that
[Equation]
is the joint conditional density of b z 1 , ...,
b z k given all other weights and biases.
The mean of the term in equation 5 over the conditional distribution of b z 1 , ..., b z k , ρ b z , is therefore
[Equation]
where we denote [ b 1 , ..., b k ] T as b .
Thus applying the smooth co-area formula (Equation 6) to the expression in 7 shows that the average 5 is equal to
[Equation]
Finally, we take the average over the remaining weights and biases and commute the expectation with the dx integral.
We can do this since the integrand is non-negative.
This gives us the result:
[Equation]
as required.
Finally, taking the summation over all possible sets of distinct neurons z 1 , ..., z k and combining equation 4 with Proposition E.5 completes the proof for Theorem 3.2.
F Proof of Theorem 3.
To prove the upper bound in Theorem 3.3 we first show that the (determinant of) Jacobian for the function
H k : M → R k , H k ( x ) =
[ z 1 ( x ) , ..., z k ( x )] T , as defined in 3.1 is equal to the volume of the parallelopiped defined by the vectors ϕ
H k ( ∇ z j ( x )) , for j = 1 , ..., k , where ϕ H k : R k
→ T x M is an orthogonal projection onto the orthogonal complement of the kernel of the differential D M H k .
Intuitively, this shows that with the added assumption x ∈ M in Theorem 3.3 how exactly we can incorporate the geometry of the data manifold M into the upper bound provided by Hanin and
Rolnick [2019a] in corollary 7.
Proposition F.1.
Given H k : M
→ R k such that H k ( x ) =
[ z 1 ( x ) , ..., z k ( x )] T and the differential
D M H k is surjective at x then
[Equation]
(9) where
ϕ H k
R n → R k is a linear map and Gram denotes the Gramian matrix.
Proof.
We first define the orthogonal complement of the kernel of the differential D M H k .
For a manifold M ⊂ R n and a fixed point x we have that T x M is a m − dimensional hyperplane.
If we choose an orthonormal basis e 1 , ..., e n of R n such that e 1 , ..., e m spans T x M for a fixed x
we can denote all vectors in T x M using m coordinates corresponding to this basis.
Therefore, for any vector y ∈ R k we can get the orthogonal projection of y onto T x M using a m × n matrix which we denote as P x , where P x y (matrix multiplied by a vector) represents a vector in T x M corresponding to the basis e 1 , ..., e m .
For any manifold M in R n and function H k : M → R k we have that
D M H k : T x M → R k at a fixed point x is linear function.
Therefore we can write D M H k ( v ) =
Av where v ∈ T x M is denoted using the aforementioned basis of T x M .
This implies that A is a k × m matrix.
Therefore, the kernel of D M H k for a fixed point x ∈ M is
[Equation]
Since we can create a canonical basis for the space ker( D M H k ) starting from the basis e 1 , ..., e m in
R n using the Gram-Schmidt process given the matrix
A
we have that for any y ∈ R n we can project it orthogonally onto ker( D M H k ) .
The orthogonal complement of ker( D M H k ) is therefore defined by ker( D M H k
[Equation]
= (cid:110) a | a · z = 0 for all z ∈ ker
( D M H k ) and a ∈ T x M (cid:111) .
Similar to the previous argument, we construct a canonical basis starting from e 1 , ..., e m for ker( D M H k ) ⊥ and therefore we can denote the orthogonal projection onto ker
( D M H k ) ⊥
as a linear transformation.
We denote this linear projection for fixed x using ϕ k .
We denote the basis vectors e 1 , ...., e m as a m × n matrix E where each row i corresponds to the vector e i .
Therefore, the orthogonal projection of any vector y ∈ R n is Ey .
Now we can get the matrix
A using E ∇ z j ( x ) corresponding to each row j for j = 1 , ..., m .
This uses the fact that the direction of steepest ascent on z j ( x ) restricted to the tangent space T x M of the manifold M is an orthogonal projection of the direction of steepest ascent in R n .
Finally, from lemma 5.3.5 by Guillemin and Pollack [1974] we have that
[Equation]
for any parallelepiped P contained in (ker( D M H k )) ⊥ .
Arguing similar to the proof of lemma 5.3.
by Guillemin and Pollack [1974] we get that
[Equation]
thereby showing that ϕ
H k
( y )
=
Ey is a linear mapping.
Although we state Proposition F.1 for neurons z j ( x ) , j = 1 , ..., k in the proof, it applies to any function that satisfy the conditions laid out in the proposition.
Equipped with Proposition F.1 we prove Theorem 3.3.
When the weights and biases of F are independent obtain an upper bound on ρ b z 1 ,...,b zk ( b 1 , ..., b k ) as
[Equation]
Hence,
[Equation]
From Proposition 9 we have that J M k,H k is equal to the k -dimensional volume of the paralellopiped spanned by ϕ x ( ∇ z j ( x )) for j = 1 , ..., k .
Therefore, we have
[Equation]
where || E || denotes the matrix norm which is defined as
[Equation]
Note that E does not depend on F (or z 1 , ..., z k ) but only on T x M or more generally the geometry of
M at any point x .
From Theorem 3.2 by Hanin and Nica [2018] we have, for any fixed x ,
[Equation]
where,
[Equation]
[Figure]
wherein C > 0 depends only on µ and not on the architecture of F and n j is the width of the hidden layer j .
Let C M be defined as
[Equation]
| there exists a set, S, of non zero m
− k -dimensional Hausdorff measure such that || E x
[Equation]
Therefore, combining equations 11, 10 and result from Theorem 3.2 we have
[Equation]
where the expectation is over the distribution of weights and biases.
G Proof of Theorem 3.
We first prove the following proposition
Proposition G.1.
For a compact m -dimensional submanifold M in R n , m, n ≥ 1 and m < n let
S ⊆ R n be a compact fixed continuous piece-wise linear submanifold with finitely many pieces and given any U > 0 .
Let S 0 = ∅ and let S k be the union of the interiors of all k -dimensional pieces of
S \
[Equation]
S 0 ∪ ... ∪ S k − 1 ) .
Denote by T ϵ the ϵ -tubuluar neighbourhood of any X ⊂ M such that
[Equation]
where ϵ ∈ (0 , U ) , d M is the geodesic distance between the point y and set X on the manifold M , we have
[Equation]
where C k,κ,U > 0 is a constant that depends on the average scalar curvature κ ( S k ∩ M ) ⊥ and U , and ω n − k is the volume of the unit ball in R n − k .
Proof.
Define d to be the maximal dimension of linear pieces in S .
Let x ∈ T ϵ
( X ∩ M ) .
Suppose x / ∈ T ϵ ( X ∩ M ) for all k = n − m, ..., d − 1 .
Then the intersection of a geodesic ball of radius ϵ around s with S is a ball inside S d ∩ M .
Using the convexity of this ball, with respect to the manifold
M [Robbin et al., 2011], there exists a point y in S d ∩ M such that the geodesic γ : [0 , 1] → M with γ (0) =
y and γ (1) =
x is perpendicular to S d ∩ M at y .
Formally, T S d ∩ M M at y is perpendicular to ˙ γ (0)
∈
T M at y .
Let B ϵ
( N ∗ ( S d ∩ M )) be the union of all the ϵ balls along the fiber of the submanifold S d ∩ M .
Therefore, we have
[Equation]
where S ≤ d − 1 := ∪ d − 1 k =0 S k .
We also note that
[Equation]
where B ϵ (( M ∩ S d ) ⊥ ) is the average volume of an ϵ ball in the submanifold of M orthogonal to M ∩ S d .
This volume depends on the average scalar curvature, κ ( M ∩ S d ) ⊥ of the submanifold ( M ∩ S d ) ⊥ .
As shown by Wan [2016], for a fixed point x ∈ ( M ∩ S d ) ⊥
[Equation]
where ω n − d is the volume of the unit ball of dimension n − d , B ϵ ( x, ( M ∩ S d ) ⊥ ) is the geodesic ball of radius ϵ in the manifold ( M ∩ S d ) ⊥ centered at x and κ ( M ∩ S d ) ⊥ ( x ) denotes the scalar curvature at point x .
Gray [1974] provides the second order expansion of the formula above.
Given that ϵ ∈ (0 , U ) , for all k ∈ { n − m, n − m + 1 , ..., d } , then we have a smallest C k,κ,U such that
[Equation]
The above inequality follows from assumption A5.
Using the above inequalities 12, 13 and repeating the argument d − 1 − n + m times we get the result of the proposition.
We also note that C k,κ,U increases monotonically with U , this also follows from the volume being monotonically increasing and positive for ϵ > 0 .
Finally, we can now prove Theorem 3.4.
Let x ∈ M be uniformly chosen.
Then, for all ϵ ∈ (0 , U ) , using Markov’s inequality and Proposition G.1, we have
[Equation]
Note that as we increase U the constants C n − k,κ,U increase, although not strictly, for all k .
To find the supremum of the expression on the right hand side, of the last inequality, in ϵ ∈ (0 , U ) we multiply and divide the expression by C grad C bias C M # neurons to get the polynomial
[Equation]
where ζ = ϵC grad C bias C M # neurons and ζ ∈ (0 , U ′ ) where U ′ =
UC grad C bias C M # neurons.
Let d M be the diameter of the manifold M , defined by d M = sup x,y ∈ M distance M ( x, y ) .
We assume that d M is finite.
Taking the supremum over all U ∈ (0 , d M ] or U ′ ∈ (0 , d ′ M ] , where d ′ M =
d M C grad C bias C M # neurons, gives us the constant C M,κ
[Equation]
Since d M is finite the constant above exists and is finite.
We make a note on the existence of this constant C M,κ in the absence of the constraint that the diameter of manifold M is finite.
As U increases the constants C n in − k,κ,U also increase and are all positive.
The solution for p ′ U ( ζ ) = 0 , ζ > 0 , which we denote by ζ U , is unique and keeps decreasing as U increases.
The uniqueness of the solution follows from the fact that the coefficients C n in − k,κ,U are all positive.
We also note that p U ( ζ U ) need not be equal to sup ζ ∈
(0 ,U ′ )
{ p U ( ζ ) } because ζ U need not lie in (0 , U ′ ) .
In all such cases sup ζ ∈ (0 ,U ′ )
{ p U ( ζ ) } =
p U ( U ′ ) .
Given the polynomial p U ( ζ ) above if we can assert that there exists a C U , and the corresponding C U ′ , such that for all U > C U , and corresponding
U ′ > C U ′ , we have sup ζ ∈ (0 ,U ′ )
{ p U ( ζ ) } =
p U ( ζ U ) < ∞ and for all 0 < U ≤ C U we have sup ζ ∈ (0 ,U ′ )
{ p U ( ζ ) } =
p U ( U ′ ) < ∞ .
Therefore, C M,κ exists and is finite if the previous assertion holds, proving this assertion is beyond the scope of our current work and particularly challenging.
Finally, taking the average over distribution of weights gives us the inequality
[Equation]
where C M,κ is a constant which depends on the average scalar curvature of the manifold M .
This completes the proof of Theorem 3.4.
G.1 Variations in Supremum of p U
We illustrate the dependence of the the constant C M,κ on varying values of n in , m using a simple example.
We fix the coefficient of the polynomial p ( ζ ) to be all 1, this not always the case but we do so to illustrate the relationship between the optima and the exponents for simplest such polynomial:
[Equation]
We plot the supremums of this simplified polcynomial C simplified = sup ζ ∈ (0 , 1) p simplified ( ζ ) for each n in from the { 2 , ..., 30 } and varying m in Figure 12.
Similarly, we vary n in with fixed m and report the supremums C simplified in Figure 13.
We notice that for a fixed n in the supremum decreases with m and for a fixed m the supremum increases with n in .
We programatically calculate the supremum being reported by restricting the domain of p simplified to (0 , 1) .
We solve for the supremum by using the fminbound method from the scipy package [Virtanen et al., 2020].
The function uses Brent’s method [Brent, 1971] to find the supremum.
H Toy Supervised Learning Problems
For the two supervised learning tasks with different geometries (tractrix and sphere), we uniformly sample 1000 data points from each 1D manifold to come up with samples of ( x i , y i ) pairs.
We then add Gaussian noise to y .
We train a DNN with 2 hidden layers, with 10 and 16 neurons in each layer and a single linear output neuron, for a total of 26 neurons with piece-wise linearity, using the
PyTorch library.
The optimization is performed using the Adam optimizer [Kingma and Ba, 2015] with a learning rate of 0.01.
We ensure a reasonable fit of the model by reducing the test time mean squared error (see Figure 14).
We then calculate the exact number of linear regions on the respective domains by finding the points where z ( x ( t ))
=
b z for every neuron z and x is on the 1D manifold.
We do this by adding neurons, z , one by one at every layer and using the SLSQP [Kraft, 1988] to solve for | z ( x ( t ))
− b z | = 0 in t for tractrix and | z ( x ( θ ))
− b z | = 0 in θ for the circle.
Note that this methodology can be extended to solve for linear regions of a deep ReLU network for any 1D curve x ( . ) in any dimension.
We then split a linear region depending on where this solution lies compared to previous layers.
For every epoch, we then uniformly randomly sample points from the 1D manifold, by sampling directly from θ and t , to measure average distance to the nearest linear boundaries.
The experiment was run on CPUs, from training to counting of number of linear regions.
The intel cpus had access to 4 GB memory per core.
A total of, approximately, 24 cpu hours were required for all the experiments in this section.
This was run on an on demand cloud instance.
All implementations are in PyTorch, except for SLQSP for which we used sklearn.
H.1 Varying n in
The experimental setup, hyperparameters, network architecture, target function and methods are all the same as described for the toy supervised learning problem for the case where the geometry is a sphere.
The only difference is that the input dimension varies, n in .
I High Dimensional Dataset
We utilise the official implementation of pretrained StyleGAN generator to generate curves of images that lie on the manifold of face images.
Specifically, for each curve we sample a random pair of latent vectors: z 1 , z 2 ∈ R k , this gives us the start and end point of the curve using the generator g ( z 1 ) and g ( z 2 ) .
We then generate 100 images to approximate a curve connecting the two images on the image manifold in a piece-wise manner.
We do so by taking 100 points on the line connecting z 1 and z 2 in the latent space that are evenly spaced and generate an image from each one of them.
Therefore, the i th image is generated as: x i =
g
(((100 − i ) ×
z 1 + i × z 2 ) / 100) , using the StyleGAN generator g .
We qualitatively verify the images to ensure that they lie on the manifold of images of faces.
4 examples of these curves, sampled as above, are illustrated in the video here: https:// drive.google.com/file/d/1p9B8ATVQGQYoiMh3Q22D-jSaI0USsoNx/view?usp=sharing .
These two constructions allow us to formulate two curves in the high-dimensional setting.
The straight line, with two fixed points g ( z 1 ) and g ( z 2 ) , is defined as x ( t ) =
(1 − t ) g
( z 1 ) + tg ( z 2 ) with t ∈ [0 , 1] .
The approximated curve on the manifold is defined as x ′ ( t ) =
(1 − t ) g
( z i )
+ tg
( z i +1 )
[Figure]
where i = floor (100 t ) .
This once again gives us two curves and we solve for the zeros of | z ( x ( t ))
− b z | = 0 and | z ( x ′ ( t )) − b z | = 0 for t ∈ [0 , 1] using SLQSP as described in Appendix H.
The neural network, used for classification in our MetFaces experiment, is feed forward with ReLU activation.
There are two hidden layers with 256 and 64 neurons in the first and second layers respectively.
We downsample the images to 128 × 128 × 3 .
We augment the dataset using random horizontal flips of the images.
All inputs are normalized.
We use a batch size of 32.
The neural network is trained using SGD.
The learning rate is 0.01 and the momentum is 0.5.
The total time required, for these experiments on MetFaces dataset, was approximately 36 GPU hours on a Titan
RTX GPU that has 24 GB memory.
This was run on an on demand cloud instance.
We chose hyperparameters by trial and error, targeting a better fit for the training data for the results reported in
Figure 9 of the main body of the paper.
We report further results for density of linear regions with varying hyperparameters in Figure 15.
We also report the training and testing accuracy for the various sets of hyperparameters in Figure 16.
Note that Figure 16(a) corresponds to the test and train accuracies on MetFaces reported in the main body of the paper (Figure 9).
Note all of these results are for the same architecture as described above.
J Code, Data and Licenses
All the code used for our experiments (except the StyleGAN2 code) is enclosed in the folder exp/ .
The instructions to run all the experiments are enclosed in exp/readme.txt .
We plan on releasing the code as an open github repository under the MIT License ( https://opensource.
org/licenses/MIT ).
The files changed on the github repository for the official implementation of StyleGAN2 ( https://github.com/NVlabs/stylegan2-ada-pytorch ) are enclosed in the folder stylegan2-ada-pytorch .
The instructions to run the experiments are documented in stylegan2-ada-pytorch/readme.
[Figure]
Finally, the images we used to sample linear regions on a curve’s piece-wise approximation on the manifold of face images, for the MetFaces experiment, are in the zip file https://drive.google.
com/file/d/1x5t-sc9NlW5N_ZBXUM0WcfX-toUXa85L/
view?usp
=sharing .