C RITICAL P ERCOLATION AS A F RAMEWORK TO A NALYZE THE T RAINING OF D EEP N ETWORKS
In this paper we approach two relevant deep learning topics: i) tackling of graph structured input data and ii) a better understanding and analysis of deep networks and related learning algorithms.
With this in mind we focus on the topological classiﬁcation of reachability in a particular subset of planar graphs (Mazes).
Doing so, we are able to model the topology of data while staying in Euclidean space, thus allowing its processing with standard CNN architectures.
We suggest a suitable architecture for this problem and show that it can express a perfect solution to the classiﬁcation task.
The shape of the cost function around this solution is also derived and, remarkably, does not depend on the size of the maze in the large maze limit.
Responsible for this behavior are rare events in the dataset which strongly regulate the shape of the cost function near this global minimum.
We further identify an obstacle to learning in the form of poorly performing local minima in which the network chooses to ignore some of the inputs.
We further support our claims with training experiments and numerical analysis of the cost function on networks with up to 128 layers.
I NTRODUCTION
Deep convolutional networks have achieved great success in the last years by presenting human and super-human performance on many machine learning problems such as image classiﬁcation, speech recognition and natural language processing (LeCun et al.
Importantly, the data in these common tasks presents particular statistical properties and it normally rests on regular lattices (e g. images) in Euclidean space (Bronstein et al.
Recently, more attention has been given to other highly relevant problems in which the input data belongs to non-Euclidean spaces.
Such kind of data may present a graph structure when it represents, for instance, social networks, knowledge bases, brain activity, protein-interaction, 3D shapes and human body poses.
Although some works found in the literature propose methods and network architectures speciﬁcally tailored to tackle graph-like input data (Bronstein et al.
; Bruna et al.
; Henaff et al.
; Li et al.
; Masci et al.
(2015a;b)), in comparison with other topics in the ﬁeld this one is still not vastly investigated.
Another recent focus of interest of the machine learning community is in the detailed analysis of the functioning of deep networks and related algorithms (Daniely et al.
; Ghahramani (2015)).
The minimization of high dimensional non-convex loss function by means of stochastic gradient descent techniques is theoretically unlikely, however the successful practical achievements suggest the contrary.
The hypothesis that very deep neural nets do not suffer from local minima (Dauphin et al.
(2014)) is not completely proven (Swirszcz et al.
The already classical adversarial examples (Nguyen et al.
(2015)), as well as new doubts about supposedly well understood questions, such as generalization (Zhang et al.
(2016)), bring even more relevance to a better understanding of the methods.
In the present work we aim to advance simultaneously in the two directions described above.
To accomplish this goal we focus on the topological classiﬁcation of graphs (Perozzi et al.
Scarselli et al.
However, we restrict our attention to a particular subset of planar graphs constrained by a regular lattice.
The reason for that is threefold: i) doing so we still touch upon the issue of real world graph structured data, such as the 2D pose of a human body (Andriluka et al.
(2014); Jain et al.
or road networks (Masucci et al.
; Viana et al.
; ii) we maintain the data in Euclidean space, allowing its processing with standard CNN architectures; iii) this particular class of graphs has various non-trivial statistical properties derived from percolation theory and conformal ﬁeld theories (Cardy (2001); Langlands et al.
; Smirnov & Werner (2001)), allowing us to analytically compute various properties of a deep CNN proposed by the authors to tackle the problem.
Speciﬁcally, we introduce Maze-testing, a specialized version of the reachability problem in graphs (Yu & Cheng (2010)).
In Maze-testing, random mazes, deﬁned as L by L binary images, are classiﬁed as solvable or unsolvable according to the existence of a path between given starting and ending points in the maze (vertices in the planar graph).
Other recent works approach maze problems without framing them as graphs (Tamar et al.
Oh et al.
(2017); Silver et al.
However, to do so with mazes (and maps) is a common practice in graph theory (Biggs et al.
(1976); Schrijver (2012))
and in applied areas, such as robotics (Elfes (1989); Choset & Nagatani (2001)).
Our Mazetesting problem enjoys a high degree of analytical tractability, thereby allowing us to gain important theoretical insights regarding the learning process.
We propose a deep network to tackle the problem that consists of O
( L 2 ) layers, alternating convolutional, sigmoid, and skip operations, followed at the end by a logistic regression function.
We prove that such a network can express an exact solution to this problem which we call the optimal-BFS (breadth-ﬁrst search) minimum.
We derive the shape of the cost function around this minimum.
Quite surprisingly, we ﬁnd that gradients around the minimum do not scale with L .
This peculiar effect is attributed to rare events in the data.
In addition, we shed light on a type of sub-optimal local minima in the cost function which we dub "neglect minima".
Such minima occur when the network discards some important features of the data samples, and instead develops a sub-optimal strategy based on the remaining features.
Minima similar in nature to the above optimal-BFS and neglect minima are shown to occur in numerical training and dominate the training dynamics.
Despite the fact the Maze-testing is a toy problem, we believe that its fundamental properties can be observed in real problems, as is frequently the case in natural phenomena (Schmidt & Lipson (2009)), making the presented analytical analysis of broader relevance.
Additionally important, our framework also relates to neural network architectures with augmented memory, such as Neural Turing Machines (Graves et al.
and memory networks (Weston et al.
; Sukhbaatar et al.
The hot-spot images (Fig. 7), used to track the state of our graph search algorithm, may be seen as an external memory.
Therefore, to observe how activations spread from the starting to the ending point in the hot-spot images, and to analyze errors and the landscape of the cost function (Sec. 5), is analogous to analyze how errors occur in the memory of the aforementioned architectures.
This connection gets even stronger when such memory architectures are employed over graph structured data, to perform task such as natural language reasoning and graph search (Weston et al.
; Johnson (2017); Graves et al. (2016)).
In these cases, it can be considered that their memories in fact encode graphs, as it happens in our framework.
Thus, the present analysis may eventually help towards a better understanding of the cost functions of memory architectures, potentially leading to improvements of their weight initialization and optimization algorithms thereby facilitating training (Mishkin & Matas (2015)).
The paper is organized as follows:
Sec. 2 describes in detail the Maze-testing problem.
In Sec.we suggest an appropriate architecture for the problem.
In Sec.
4 we describe an optimal set of weights for the proposed architecture and prove that it solves the problem exactly.
In Sec.
5 we report on training experiments and describe the observed training phenomena.
In Sec.
6 we provide an analytical understanding of the observed training phenomena.
Finally, we conclude with a discussion and an outlook.
M AZE - TESTING
Let us introduce the Maze-testing classiﬁcation problem.
Mazes are constructed as a random two dimensional, L × L , black and white array of cells ( I ) where the probability ( ρ ) of having a black cell is given by ρ c = 0 .
59274(6) , while the other cells are white.
An additional image ( H 0 ), called the initial hot-spot image, is provided.
It deﬁnes the starting point by being zero ( Off ) everywhere except on a 2 × 2 square of cells having the value 1 ( On ) chosen at a random position (see Fig.7).
A Maze-testing sample (i.e. a maze and a hot-spot image) is labelled Solvable if the ending point, deﬁned as a 2 × 2 square at the center of the maze, is reachable from the starting point (deﬁned by the hot-spot image) by moving horizontally or vertically along black cells.
The sample is labelled
Unsolvable otherwise.
A maze in a Maze-testing sample has various non-trivial statistical properties which can be derived analytically based on results from percolation theory and conformal ﬁeld theory (Cardy (2001);
Langlands et al.
; Smirnov & Werner (2001)).
Throughout this work we directly employ such statistical properties, however we refer the reader to the aforementioned references for further details and mathematical derivations.
At the particular value chosen for ρ , the problem is at the percolation-threshold which marks the phase transition between the two different connectivity properties of the maze: below ρ c the chance of having a solvable maze decays exponentially with r (the geometrical distance between the ending and starting points).
Above ρ c it tends to a constant at large r .
Exactly at ρ c the chance of having a solvable maze decays as a power law ( 1 /r η , η = 5 / 24 ).
We note in passing that although Mazetesting can be deﬁned for any ρ , only the choice ρ
= ρ c leads to a computational problem whose typical complexity increases with L .
Maze-testing datasets can be produced very easily by generating random arrays and then analyzing their connectivity properties using breadth-ﬁrst search (BFS), whose worse case complexity is O
( L 2 ) .
Notably, as the system size grows larger, the chance of producing solvable mazes decay as 1 /L η , and so, for very large L , the labels will be biased towards unsolvable.
There are several ways to de-bias the dataset.
One is to select an unbiased subset of it.
Alternatively, one can gradually increase the size of the starting-point to a starting-square whose length scales as L η .
Unless stated otherwise, we simply leave the dataset biased but deﬁne a normalized test error ( err ), which is proportional to the average mislabeling rate of the dataset divided by the average probability of being solvable.
T HE ARCHITECTURE
Here we introduce an image classiﬁcation architecture to tackle the Maze-testing problem.
We frame maze samples as a subclass of planar graphs, deﬁned as regular lattices in the Euclidean space, which can be handle by regular CNNs.
Our architecture can express an exact solution to the problem and, at least for small Mazes ( L ≤ 16 ), it can ﬁnd quite good solutions during training.
Although applicable to general cases, graph oriented architectures ﬁnd it difﬁcult to handle large sparse graphs due to regularization issues (Henaff et al.
; Li et al.
(2015)), whereas we show that our architecture can perform reasonably well in the planar subclass.
Our network, shown in Fig.
(7), is a deep feedforward network with skip layers, followed by a logistic regression module.
The deep part of the network consists of n alternating convolutional and sigmoid layers.
Each such layer ( i ) receives two L × L images, one corresponding to the original maze ( I ) and the other is the output of the previous layer ( H i − 1 ).
It performs the operation
H i =
σ ( K hot ∗ H i − 1 + K ∗
I + b ) , where ∗ denotes a 2 D convolution, the K convolutional kernel is 1 × 1 , the K hot kernel is 3 × 3 , b is a bias, and σ ( x )
=
(1+ e − x ) − 1 is the sigmoid function.
The logistic regression layer consists of two perceptrons ( j = 0 , 1 ), acting on H n as [ p 0 , p 1 ] T = W j
(cid:126) H n + (cid:126)b reg , where (cid:126) H n is the rasterized/ﬂattened version of H n , W j is a 2 × L 2 matrix, and (cid:126)b reg is a vector of dimension 2 .
The logistic regression module outputs the label Solvable if p 1 ≥ p 0 and Unsolvable otherwise.
The cost function we used during training was the standard negative log-likelihood.
A N OPTIMAL SOLUTION : T HE BREADTH - FIRST SEARCH MINIMUM
As we next show, the architecture above can provide an exact solution to the problem by effectively forming a cellular automaton executing a breadth-ﬁrst search (BFS).
A choice of parameters which achieves this is λ ≥ λ c = 9 .
727 ± 0 .
001 , K hot =
[[0 , λ, 0] , [ λ, λ, λ ] , [0 , λ, 0]] , K = 5 λ c , b = − 5 .
5 λ c , [ W ] jq = ( − 1)
j λδ q center q and (cid:126)b reg =
5 λ, − 0 .
5 λ ] T , where q center is the index of (cid:126) H n which corresponds to the center of the maze.
Let us explain how the above neural network processes the image (see also Fig. 7).
Initially H 0 is On only at the starting-point.
Passing through the ﬁrst convolutional-sigmoid layer it outputs H 1 which will be On (i.e. have values close to one) on all black cells which neighbor the On cells as well as on the original starting point.
Thus On regions spread on the black cluster which contains the original starting-point, while white clusters and black clusters which do not contain the starting-point remain
Off (close to zero in H i ).
The ﬁnal logistic regression layer simply checks whether one of the 2 ×cells at the center of the maze are On and outputs the labels accordingly.
To formalize the above we start by deﬁning two activation thresholds, v l and v h , and refer to activations which are below v l as being Off and to those above v h as being On .
The quantity v l is deﬁned as the smallest of the three real solutions of the equation v l = σ (5 v l − 0 .
5 λ ) .
Notably we previously chose λ > λ c as this is the critical value above which three real solutions to v l (rather than one) exist.
For v h we choose 0 .
Next, we go case by case and show that the action of the convolutional-sigmoid layer switches activations between Off and On just as a BFS would.
This amounts to bounding the expression σ ( K hot ∗ H i − 1 + K ∗
I + b ) for all possibly 3 × 3 sub-arrays of H i − 1 and 1 × 1 sub-arrays of I .
There are thus 2 10 possibilities to be examined.
Figure 2 shows the desired action of the layer on three important cases (A-C).
Each case depicts the maze shape around some arbitrary point x , the hot-spot image around x before the action of the layer ( H i − 1 ), and the desired action of the layer ( H i ).
Case A.
Having a white cell at x implies
I[ x ] = 0 and therefore the argument of the above sigmoid is smaller than − 0 .
5 λ c
this
regardless of H i − 1 at and around x .
Thus H i [ x ] < v l
and so it is Off .
As the 9 activations of H i − 1 played no role, case A covers in fact 2 9 different cases.
Case B. Consider a black cell at x , with H i − 1 in its vicinity all being Off (vicinity here refers to x and its 4 neighbors).
Here the argument is smaller or equal to 5 v l − 0 .
5 λ c , and so the activation remains Off as desired.
Case B covers 2 4 cases as the values of H i − 1 on the 4 corners were irrelevant.
Case C. Consider a black cell at x with one or more
On activations of H i − 1 in its vicinity.
Here the argument is larger than v h λ c − 0 .
5 λ c = 0 .
4 λ c .
The sigmoid is then larger than 0 .
97 implying it is On .
Case C covers 2 4 (2 5 − 1) different cases.
Since 2 9 + 2 4 + 2 4 (2 5 − 1) = 2 10 we exhausted all possible cases.
Lastly it can be easily veriﬁed that given an On ( Off ) activation at the center of the full maze the logistic regression layer will output the label Solvable ( Unsolvable ).
Let us now determine the required depth for this speciﬁc architecture.
The previous analysis tells us that at depth d unsolvable mazes would always be labelled correctly however solvable mazes would be label correctly only if the shortest-path between the starting-point and the center is d or less.
The worse case scenario thus occurs when the center of the maze and the starting-point are connected by a one dimensional curve twisting its way along O ( L 2 ) sites.
Therefore, for perfect performance the network depth would have to scale as the number of sites namely n =
O ( L 2 ) .
A tighter but probabilistic bound on the minimal depth can be established by borrowing various results from percolation theory.
It is known, from Zhou et al.
(2012), that the typical length of the shortest path ( l ) for critical percolation scales as r d min , where r is the geometrical distance and d min = 1 .
Moreover, it is known that the probability distribution P ( l | r ) has a tail which falls as l − 2 for l ≈ > r d min (Dokholyan et al. (1999)).
Consequently, the chance that at distance r the shortest path is longer than r d min r a , where a is some small positive number, decays to zero and so, d should scale as L with a power slightly larger than d min (say n = L 1 . 2 ).
T RAINING EXPERIMENTS
We have performed several training experiments with our architecture on L = 16 and L =mazes with depth n = 16 and n = 32 respectively, datasets of sizes M = 1000 , M = 10000 , and
M = 50000 .
Unless stated otherwise we used a batch size of 20 and a learning rate of 0 .
In the following, we split the experiments into two different groups corresponding to the related phenomena observed during training, which will the analyzed in detail in the next section.
Optimal-BFS like minima.
For L = 16 , M = 10000 mazes and a positive random initialization for
K hot and K in [0 , (cid:112) 6 / 8] the network found a solution with ≈ 9% normalized test error performance in 3 out of the 7 different initializations (baseline test error was 50% ).
In all three successful cases the minima was a variant of the Optimal-BFS minima which we refer to as the checkerboard-BFS minima.
It is similar to the optimal-BFS but spreads the On activations from the starting-point using a checkerboard pattern rather than a uniform one, as shown in Fig.
The fact that it reaches ≈ 9% test error rather than zero is attributed to this checkerboard behavior which can occasionally miss out the exit point from the maze. be
Neglect minima.
Again for L = 16 but allowing for negative entries in K and K hot test error following 14 attempts and 500 epochs did not improve below 44% .
Analyzing the weights of the network, the 6% improvement over the baseline error ( 50% ) came solely from identifying the inverse correlation between many white cells near the center of the maze and the chance of being solvable.
Notably, this heuristic approach completely neglects information regarding the starting-point of the maze.
For L = 32 mazes, despite trying several random initialization strategies including positive entries, dataset sizes, and learning rates, the network always settled into such a partial neglect minimum.
In an unsuccessful attempt to push the weights away from such partial neglect behavior, we performed further training experiments with a biased dataset in which the maze itself was uncorrelated with the label.
More accurately, marginalizing over the starting-point there is an equal chance for both labels given any particular maze.
To achieve this, a maze shape was chosen randomly and then many random locations were tried-out for the starting-point using that same maze.
From these, we picked 5 that resulted in a Solvable label and 5 that resulted in an Unsolvable label.
Maze shapes which were always Unsolvable were discarded.
Both the L = 16 and L = 32 mazes trained on this biased dataset performed poorly and yielded 50% test error.
Interestingly they improved their cost function by settling into weights in which b
≈ − 10 is large compared to [ K hot ] ij <
≈ 1 while W and (cid:126)b were close to zero (order of 0 . 01 ).
We have veriﬁed that such weights imply that activations in the last layer have a negligible dependence on the starting-point and a weak dependence on the maze shape.
We thus refer to this minimum as a "total neglect minimum".
C OST FUNCTION LANDSCAPE AND THE OBSERVED TRAINING PHENOMENA
Here we seek an analytical understanding of the aforementioned training phenomena through the analysis of the cost function around solutions similar or equal to those the network settled into during training.
Speciﬁcally we shall ﬁrst study the cost function landscape around the optimal-BFS minimum.
As would become clearer at the end of that analysis, the optimal BFS shares many similarities with the checkerboard-BFS minimum obtained during training and one thus expects a similar cost function landscape around both of these.
The second phenomena analyzed below is the total neglect minimum obtained during training on the biased dataset.
The total neglect minimum can be thought of as an extreme version of the partial neglect minima found for L = 32 in the original dataset.
6. T HE SHAPE OF THE COST FUNCTION NEAR THE OPTIMAL -BFS MINIMUM
Our analysis of the cost function near the optimal-BFS minimum will be based on two separate models capturing the short and long scale behavior of the network near this miminum.
In the ﬁrst model we approximate the network by linearizing its action around weak activations.
This model would enable us to identify the density of what we call "bugs" in the network.
In the second model we discretize the activation levels of the neural network into binary variables and study how the resulting cellular automaton behaves when such bugs are introduced.
Figure 4 shows a numerical example of the dynamics we wish to analyze
6.1. L INEARIZATION AROUND THE OPTIMAL -BFS MINIMUM AND THE EMERGENCE OF BUGS
Unlike an algorithm, a neural network is an analog entity and so a-priori there are no sharp distinctions between a functioning and a dis-functioning neural network.
An algorithm can be debugged and the bug can be identiﬁed as happening at a particular time step.
However it is unclear if one can generally pin-point a layer and a region within where a deep neural network clearly malfunctioned.
Interestingly we show that in our toy problem such pin-pointing of errors can be done in a sharp fashion by identifying fast and local processes which cause an unwanted switching been Off and On activations in H i (see Fig. 4).
We call these events bugs, as they are local, harmful, and have a sharp meaning in the algorithmic context.
Below we obtain asymptotic expressions for the chance of generating such bugs as the network weights are perturbed away from the optimal-BFS minimum.
The main result of this subsection, derived below, is that the density of bugs (or chance of bug per cell) scales as
[Equation]
for ( λ − λ c ) < ≈ 0 and zero for λ − λ c > = 0 where C (cid:48)
≈ 1 . 7 .
Following the analysis below, we expect the same dependence to hold for generic small perturbations only with different C (cid:48) and λ c .
We have tested this claim numerically on several other types of perturbations (including ones that break the π/ 2 rotational symmetry of the weights) and found that it holds.
To derive Eq.
(1), we ﬁrst recall the analysis in Sec. 4, initially as it is decreased λ has no effect but to shift v l (the Off activation threshold) to a higher value.
However, at the critical value ( λ = λ c , v l = v l,c ) the solution corresponding to v l vanishes (becomes complex) and the correspondence with the BFS algorithm no longer holds in general.
This must not mean that all Off activations are no longer stable.
Indeed, recall that in Sec. 4 the argument that a black Off cell in the vicinity of Off cells remains Off (Fig. 2, Case B) assumed a worse case scenario in which all the cells in its vicinity where both Off , black, and had the maximal Oﬀ activation allowed ( v l ).
However, if some cells in its vicinity are white, their Off activations levels are mainly determined by the absence of the large K term in the sigmoid argument and orders of magnitude smaller than v l .
We come to the conclusion that black Off cells in the vicinity of many white cells are less prone to be spontaneously turned On than black Off cells which are part of a large cluster of black cells (see also the bug in Fig.
In fact using the same arguments one can show that inﬁnitesimally below λ c only uniform black mazes will cause the network to malfunction.
To further quantify this, consider a maze of size l × l where the hot-spot image is initially all zero and thus Off .
Intuitively this hot-spot image should be thought of as a sub-area of a larger maze located far away from the starting-point.
In this case a functioning network must leave all activation levels below v l .
To assess the chance of bugs we thus study the probability that the output of the ﬁnal convolutional-sigmoid layer will have one or more On cells.
To this end, we ﬁnd it useful to linearize the system around low activation yielding (see the Appendix for a complete derivation)
[Equation]
where r b denotes black cells ( I( r b ) = 1 ), the sum is over the nearest neighboring black cells to r b , ψ n ( r ) =
H n ( r ) − v l,c , and ˜ λ
= λ dσdx ( σ − 1 ( v l,c )) .
For a given maze ( I ), Eq.
(2), deﬁnes a linear Hermitian operator ( L I ) with random off-diagonal matrix elements dictated by I via the restriction of the off-diagonal terms to black cells.
Stability of
Oﬀ activations is ensured if this linear operator is contracting or equivalently if all its eigenvalues are smaller than 1 in magnitude.
Hermitian operators with local noisy entries have been studied extensively in physics, in the context of disordered systems and Anderson localization (Kramer & MacKinnon (1993)).
Let us describe the main relevant results.
For almost all I ’s the spectrum of L consists of localized eigenfunctions ( φ m ).
Any such function is centered around a random site ( x m ) and decays exponentially away from that site with a decay length of χ which in our case would be a several cells long.
Thus given φ m with an eigenvalue | E m | > 1 , t repeated actions of the convolutional-sigmoid layer will make ψ n [ x ] in a χ vicinity of x m grow in size as e E m t .
Thus ( | E m | − 1) − 1 gives the characteristic time it takes these localized eigenvalue to grow into an unwanted localized region with an On activation which we deﬁne as a bug.
Our original question of determining the chance of bugs now translates into a linear algebra task: ﬁnding, N ˜ λ , the number of eigenvalues in L I which are larger than 1 in magnitude, averaged over I , for a given λ .
Since ˜ λ simply scales all eigenvalues one ﬁnds that N ˜ λ is the number of eigenvalues larger than ˜ λ − 1 in L I with ˜ λ
= 1 .
Analyzing this latter operator, it is easy to show that the maximal eigenvalues occurs when φ n ( r ) has a uniform pattern on a large uniform region where the I is black.
Indeed if I contains a black uniform true box of dimension l u × l u , the maximal eigenvalue is easily shown to be E l u = 5 − 2 π 2 / ( l u ) 2 .
However the chance that such a uniform region exists goes as ( l/l u ) 2 e log( ρ c ) l 2 u and so P (∆ E )
∝ l 2 e log( ρc )
π 2 (∆ E ) , where ∆ E = 5 − E .
This reasoning is rigorous as far as lower bounds on N ˜ λ are concerned, however it turns out to capture the functional behavior of P (∆ E ) near ∆ E = 0 accurately (Johri & Bhatt (2012)) which is given by P (∆ E → 0 + ) =
l 2 e − C (∆ E ) , where the unknown constant C captures the dependence on various microscopic details.
In the Appendix we ﬁnd numerically that C ≈ 0 .
Following this we ﬁnd
N ˜ λ
∝ l 2 (cid:82) ∆ E λdxP ( x ) where ∆ E λ = 5 − ˜ λ − 1 ≥ 0 .
The range of integration is chosen to includes all eigenvalues which, following a multiplication by ˜ λ , would be larger than 1 .
To conclude we found the number of isolated unwanted On activations which develop on l × l Off regions.
Dividing this number by l 2 we obtain the density of bugs ( ρ bug ) near λ
≈ λ c .
The last technical step is thus to express ρ bug in terms of λ .
Focusing on the small ρ bug region or ∆ E → 0 + , we ﬁnd that ∆ E = 0 occurs when dσdx ( σ − 1 ( η ∞ ( λ )))
=
1 / (5 λ ) , ˜ λ
= 1 / 5 , and λ
= λ c = 9 .
Expanding around λ
=
λ c we ﬁnd ∆ E λ = 49 − λ c 10 λ c ( λ c − λ ) + O (( λ c − λ ) 2 ) .
Approximating the integral over P ( x ) and taking the leading scale dependence, we arrive at Eq.
(1) with C (cid:48)
=
C 10 λ c 49 − λ c .
6.1. E FFECTS OF BUGS ON BREADTH - FIRST SEARCH
In this subsection we wish to understand the large scale effect of ρ bug namely, its effect on the test error and the cost function.
Our key results here are that
[Equation]
(3) for C (cid:48)
d − 1 f / log( L ) + O (log − 2 ( L )) <
( λ c − λ ) < C (cid:48) where ( d f = 91 / 48 ).
Notably this expression is independent of L .
In the domain ( λ c − λ ) < ≈ C (cid:48)
d − 1 f / log( L ) or equivalently ρ bug < ≈ L − d f a weak dependence on L remains and
[Equation]
(4) despite its appearance it can be veriﬁed that the above right hand side is smaller than L − 5 / 48 within its domain of applicability.
Figure (5) shows a numerical veriﬁcation of this last result (see Appendix for further details).
To derive Eqs.
(3) and (4), we note that as a bug is created in a large maze, it quickly switches On the cells within the black "room" in which it was created.
From this region it spreads according to
BFS and turns On the entire cluster connected to the buggy room (see Fig. 4).
To asses the effect this bug has on performance ﬁrst note that solvable mazes would be labelled Solvable regardless of bugs however unsolvable mazes might appear solvable if a bug occurs on a cell which is connected to the center of the maze.
Assuming we have an unsolvable maze, we thus ask what is the chance of it being classiﬁed as solvable.
Given a particular unsolvable maze instance ( I ), the chance of classifying it as solvable is given by p err ( I ) = 1 − (1 − ρ bug ) s = 1 − e − ρ bug s + O ( ρ 2 bug ) where s counts the number of sites in the cluster connected to the central site (central cluster).
The probability distribution of s for percolation is known and given by p ( s ) =
Bs 1 − τ , τ = 187 / 91 (Cardy & Ziff (2003)), with B being an order of one constant which depends on the underlying lattice.
Since clusters have a fractional dimension, the maximal cluster size is L d f .
Consequently, p err ( I ) averaged over all I instances is given by p err
= (cid:82) L dfp ( s ) [1 − e − ρ bug s ] ds , which can be easily expressed in terms of Gamma functions
( Γ( x ) , Γ( a, x ) ) (see Abramowitz (1974)).
In the limit of ρ bug < ≈ L − d f , where its derivatives with respect to ρ bug are maximal, it simpliﬁes to
[Equation]
whereas for ρ bug > L − d f , its behavior changes to p err =
( − B Γ(2 − τ ))
ρ ( τ − 2) bug ∝ ρ 5 / 91 bug .
Notably once ρ bug becomes of order one, several of the approximation we took break down.
Let us relate p err to the test error ( err ).
In Sec.
(2) the cost function was deﬁned as the mislabeling chance over the average chance of being solvable ( p solvable ).
Following the above discussion the mislabelling chance is p err p solvable and consequently err = p err .
Combining Eqs.
1 and 5 we obtain our key results, Eqs.
As a side, one should appreciate a potential training obstacle that has been avoided related to the fact that err ∝ ρ 5 / 91 big .
Considering L → ∞ , if ρ bug was simply proportional to ( λ c − λ ) , err will have a sharp singularity near zero.
For instance, as one reduces err by a factor of 1 /e , the gradients increase by e 86 / 5 ≈ 3 E + 7 .
These effects are in accordance with ones intuition that a few bugs in a long algorithm will typically have a devastating effect on performance.
Interestingly however, the essential singularity in ρ bug ( λ ) , derived in the previous section, completely ﬂattens the gradients near λ c .
Thus the essentially singularity which comes directly from rare events in the dataset strongly regulates the test error and in a related way the cost function.
However it also has a negative side-effect concerning the robustness of generalization.
Given a ﬁnite dataset the rarity of events is bounded and so having λ <
λ c may still provide perfect performance.
However when encountering a larger dataset some samples with rarer events (i.e. larger black region) would appear and the network will fail sharply on these (i.e. the wrong prediction would get a high probability).
Further implications of this dependence on rare events on training and generalization errors will be studied in future work.
6. C OST FUNCTION NEAR A TOTAL NEGLECT MINIMA
To provide an explanation for this phenomena let us divide the activations of the upper layer to its starting-point dependent and independent parts.
Let H n denote the activations at the top layer.
We expand them as a sum of two functions
[Equation]
where the function A and B are normalized such that their variance on the data ( α and β , respectively) is 1 .
Notably near the reported total neglect minima we found that α (cid:28) β ≈ e − 10 .
Also note that for the biased dataset the maze itself is uncorrelated with the labels and thus β can be thought of as noise.
Clearly any solution to the Maze testing problem requires the starting-point dependent part ( α ) to become larger than the independent part ( β ).
We argue however that in the process of increasing α the activations will have to go through an intermediate "noisy" region.
In this noisy region α grows in magnitude however much less than β and in particular obeys α < β 2 .
As shown in the Appendix the negative log-likelihood, a commonly used cost function, is proportional to β 2 − α for α, β (cid:28) 1 .
Thus it penalizes random false predictions and, within a region obeying α < β 2 it has a minimum (global with respect to that region)
when α = β = 0 .
The later being the deﬁnition of a total neglect minima.
Establishing the above α (cid:28) β 2 conjecture analytically requires several pathological cases to be examined and is left for future work.
In this work we provide an argument for its typical correctness along with supporting numerics in the Appendix.
A deep convolution network with a ﬁnite kernel has a notion of distance and locality.
For many parameters ranges it exhibits a typical correlation length ( χ ).
That is a scale beyond which two activations are statistically independent.
Clearly to solve the current problem χ has to grow to an order of L such that information from the input reaches the output.
However as χ gradually grows, relevant and irrelevant information is being mixed and propagated onto the ﬁnal layer.
While β depends on information which is locally accessible at each layer (i.e. the maze shape), α requires information to travel from the ﬁrst layer to the last.
Consequently α and β are expected to scale differently, as e − L/χ and e − 1 /χ resp.
(for χ << L ).
Given this one ﬁnds that α (cid:28) β 2 as claimed.
Further numerical support of this conjecture is shown in the Appendix where an upper bound on the ratio α/β 2 is studied on 100 different paths leading from the total neglect miminum found during training to the checkerboard-BFS minimum.
In all cases there is a large region around the total neglect minimum in which α (cid:28) β 2 .
C ONCLUSIONS
Despite their black-box reputation, in this work we were able to shed some light on how a particular deep CNN architecture learns to classify topological properties of graph structured data.
Instead of focusing our attention on general graphs, which would correspond to data in non-Euclidean spaces, we restricted ourselves to planar graphs over regular lattices, which are still capable of modelling real world problems while being suitable to CNN architectures.
We described a toy problem of this type (Maze-testing) and showed that a simple CNN architecture can express an exact solution to this problem.
Our main contribution was an asymptotic analysis of the cost function landscape near two types of minima which the network typically settles into:
BFS type minima which effectively executes a breadth-ﬁrst search algorithm and poorly performing minima in which important features of the input are neglected.
Quite surprisingly, we found that near the BFS type minima gradients do not scale with L , the maze size.
This implies that global optimization approaches can ﬁnd such minima in an average time that does not increase with L .
Such very moderate gradients are the result of an essential singularity in the cost function around the exact solution.
This singularity in turn arises from rare statistical events in the data which act as early precursors to failure of the neural network thereby preventing a sharp and abrupt increase in the cost function.
In addition we identiﬁed an obstacle to learning whose severity scales with L which we called neglect minima.
These are poorly performing minima in which the network neglects some important features relevant for predicting the label.
We conjectured that these occur since the gradual incorporation of these important features in the prediction requires some period in the training process in which predictions become more noisy.
A ”wall of noise" then keeps the network in a poorly performing state.
It would be interesting to study how well the results and lessons learned here generalize to other tasks which require very deep architectures.
These include the importance of rare-events, the essential singularities in the cost function, the localized nature of malfunctions (bugs), and neglect minima stabilized by walls of noise.
These conjectures potentially could be tested analytically, using other toy models as well as on real world problems, such as basic graph algorithms (e.g. shortest-path)
(Graves et al.
; textual reasoning on the bAbI dataset (Weston et al.
(2015)), which can be modelled as a graph; and primitive operations in "memory" architectures (e.g. copy and sorting)
(Graves et al.
More speciﬁcally the importance of rare-events can be analyzed by studying the statistics of errors on the dataset as it is perturbed away from a numerically obtained minimum.
Technically one should test whether the perturbation induces an typical small deviation of the prediction on most samples in the dataset or rather a strong deviation on just a few samples.
Bugs can be similarly identiﬁed by comparing the activations of the network on the numerically obtained minimum and on some small perturbation to that minimum while again looking at typical versus extreme deviations.
Such an analysis can potentially lead to safer and more robust designs were the network fails typically and mildly rather than rarely and strongly.
Turning to partial neglect minima these can be identiﬁed provided one has some prior knowledge on the relevant features in the dataset.
The correlations or mutual information between these features and the activations at the ﬁnal layer can then be studied to detect any sign of neglect.
If problems involving neglect are discovered it may be beneﬁcial to add extra terms to the cost function which encourage more mutual information between these neglected features and the labels thereby overcoming the noise barrier and pushing the training dynamics away from such neglect minimum. A CKNOWLEDGMENTS
Rodrigo Andrade de Bem is a CAPES Foundation scholarship holder (Process no: 99999.013296/2013-02, Ministry of Education, Brazil).
A V ISUALIZATION OF THE OPTIMAL -BFS MINIMUM
B T EST ERROR AWAY FROM THE OPTIMAL -BFS SOLUTION
We have implemented the architecture described in the main text using Theano (Theano Development
Team (2016)) and tested how cost changes as a function of δ = λ c − λ
( λ c = 9 .
for mazes of sizes L = 24 , 36 and depth (number of layers) 128 .
These depths are enough to keep the error rate negligible at δ = 0 .
A slight change made compared to Maze-testing as described in the main text, is that the hot-spot was ﬁxed at a distance L/ 2 for all mazes.
The size of the datasets was between 1 E + 5 and 1 E + 6 .
We numerically obtained the normalized performance ( cost L ( δ ) ) as a function of L and δ .
As it follows from Eq.
(4) in the main text the curve, log( L − 2+5 / 24 cost L ( δ )) , for the L = 24 and
L = 36 results should collapse on each other for ρ bug < L − d f .
Figure (5) of the main-test depicts three such curves, two for L = 36 , to give an impression of statistical error, and one for L =curve (green), along with the ﬁt to the theory (dashed line).
The ﬁt, which involves two parameters (the proportionally constant in Eq.
(4) of the main text and C ) captures well the behavior over three orders of magnitude.
As our results are only asymptotic, both in the sense of large L and λ → λ c , minor discrepancies are expected.
C L INEARIZATION OF THE SIGMOID - CONVOLUTIONAL NETWORK AROUND O FF ACTIVATION
To prepare the action of sigmoid-convolutional for linearization we ﬁnd it useful to introduce the following variables on locations ( r b , r w ) with black ( b ) and white ( w ) cells [Equation]
[Equation]
Rewriting the action of the sigmoid-convolutional layer in terms of these we obtain
[Equation]
where (cid:80) (cid:104) r (cid:48) ,r (cid:105) means summing over the 4 sites neighboring r .
Next we treating ψ n ( r ) as small and
Taylor expand
[Equation]
 where v l,c ≈ 0 . 02(0) is the low (and marginally stable) solution of the equation v l, c
= σ ( − 0 .
5 λ c + 5 v l,c ) .
Next in the consistency with our assumption that | ψ n − 1 ( r ) | is small, we can assume | ψ n − 1 ( r ) | < 1 , and obtain that ψ n ( r w ) <
e − 5 .
5 λ (5 + e − 0 .
5 λ ) and therefore, since we are working near λ
= 9 .
727 .. it is negligible.
The equation of ψ n ( r b ) now appears as
[Equation]
where the summation of neighbor now includes only black cells and ˜
λ
= λ dσdx | σ − 1 ( v l,c ) .
Due to form the sigmoid function, λ d 2 σ dx 2 | σ − 1 [ (cid:15) ∞ ] is of the same magnitude as ˜ λ , and consequently the relative smallness of this terms is guaranteed as long as ψ n (cid:28) 1 .
We thus obtained a linearized version for the sigmoid-convolutional network which is suitable for stability analysis.
Packing ψ n ( r b ) and d ( r b ) − 5 v l,c into vectors ( (cid:126)ψ n , (cid:126) d ( r b ) )
the equation we obtained can be written as
[Equation]
with S being a symmetric matrix.
Denoting by (cid:126)φ Tn and s n the left eigenvectors and eigenvalues of S , we multiply the above equation from the left with (cid:126)φ Tn and obtain
[Equation]
[Equation] Stability analysis on this last equation is straightforward: For | s n | < 1 , a stable solution exists given by c n = (cid:126)φ Tn (cid:126)d (1 − s n ) .
Furthermore as the matrix S has strong disorder, (cid:126)φ n are localized in space.
Consequently (cid:126)φ Tn (cid:126)d is of the same order of magnitude as (cid:126)d ≈ e − 0 .
5 λ ≈ 0 .
and as long as s n < 0 .
9 , these stable solutions are well within the linear approximation we have carried.
For | s n | > 1 , there are no stable solutions.
There is an important qualitative lesson to be learned from applying these results on an important test case: A maze with only black cells.
In this case it is easy to verify directly on the non-linear sigmoid-convolutional map that a uniform solution becomes unstable exactly at λ = λ c .
Would we ﬁnd the same result within our linear approximation?
To answer the above, ﬁrst note that the maximal eigenvalue of S will be uniform with s max = 5 ˜ λ .
Furthermore for an all black maze (cid:126) d would be exactly zero and the linear equation becomes homogeneous.
Consequently destabilization occurs exactly at ˜ λ
= 1 /
and is not blurred by the inhomogeneous terms.
Recall that λ c is deﬁned as the value at which the two lower solutions of x = σ [ − 0 .
5 λ c
+ 5 λ c x ]
and it also satisﬁes the equation v l,c
= σ [ − 0 .
5 λ c
+ 5 λ c v l,c ] .
Taking a derivative of the former and putting x = v l,c one ﬁnds that 1 = 5 λ c dσ [ − 0 .
5 λ c +5 v l,c ] dx .
It is now easy to verify that even within the linear approximation destabilization occurs exactly at λ c .
The source of this agreement is the fact that (cid:126)d vanishes for a uniform black maze.
The qualitative lesson here is thus the following: The eigenvectors of S with large s , are associated with large black regions in the maze.
It is only on the boundaries of such regions that (cid:126)d is non-zero.
Consequently near λ ≈ λ c the (cid:126)d term projected on the largest eigenvalues can, to a good accuracy, be ignored and stability analysis can be carried on the homogeneous equation (cid:126)ψ = S (cid:126)ψ where s n <means stability and s n > 1 implies a bug.
D L OG - LIKELIHOOD AND NOISY PREDICTIONS
Consider an abstract classiﬁcation tasks where data point x ∈ X are classiﬁed into two categories l ∈ { 0 , 1 } using a deterministic function f : X → { 0 , 1 } and further assume for simplicity that the chance of f ( x ) = a is equal to f ( x ) = b .
Phrased as a conditional probability distribution P f
( l | x ) is given by P f
( f ( a ) | x ) = 1 while P f (!
f ( a ) | x ) = 0 .
Next we wish to compare the following family of approximations to P f
[Equation]
[Equation]
where g | X → { 0 , 1 } is a random function, uncorrelated with f ( x ) , outputting the labels { 0 , 1 } with equal probability.
Notably at α (cid:48)
= 1 / 2 , β (cid:48)
=
it yields P f while at α (cid:48) , β (cid:48)
=
it is simply the maximum entropy distribution.
Let us measure the log-likelihood of P α (cid:48) ,β (cid:48) under P f for α (cid:48) , β (cid:48) (cid:28)
[Equation] , β
[Equation]
We thus ﬁnd that β (cid:48) reduces the log-likelihood in what can be viewed as a penalty to false conﬁdence or noise.
Assuming, as argued in the main text, that α (cid:48) is constrained to be smaller than β (cid:48) 2 near β (cid:48)
≈ 0 , it is preferable to take both α (cid:48) and β (cid:48) to zero and reach the maximal entropy distribution.
We note by passing that the same arguments could be easily generalized to f ( x ) , g ( x ) taking real values leading again to an O ( α ) − O ( β 2 ) dependence in the cost function.
Let us relate the above notations to the ones in the main text.
Clearly x = ( { I } , H 0 ) and { 0 , 1 } = { Unsolvable, Solvable } .
Next we recall that in the main text α and β multiplied the vectors function representing the H 0 -depended and H
-independent parts of H n .
The probability estimated by the logistic regression module was given by
[Equation]
which yields, to leading order in α and β
[Equation]
(18) where (cid:126)K − =
( (cid:126)K Solvable − (cid:126)K Unsolvable ) / 2 and (2 l + 1) understood as the taking the values ± 1 .
Consequently (2 f − 1) and (2 g − 1) are naturally identiﬁed with (cid:126)K Solvable · A/N A and (cid:126)K Solvable ·
B/N B respectively with N A and N B being normalization constants ensuring a variance of 1 .
While ( α (cid:48) , β (cid:48) )
=
( N A α, N B β ) .
Recall also that by construction of the dataset, the g we thus obtain is uncorrelated with
E N UMERICAL SUPPORT FOR THE α (cid:28) β 2 CONJECTURE
Here we provide numerical evidence showing that α (cid:28) β 2 in a large region around the total neglect minima found during the training of our architecture on the biased dataset (i.e. the one where marginalizing over the starting-point yields a 50/50 chance of being solvable regardless of the maze shape).
For a given set of K h ot, K and b parameters we ﬁx the maze shape and study the variance of the top layer activations given O (100) different starting points.
We pick the maximal of these and then average this maximal variance over O (100) different mazes.
This yields our estimate of α .
In fact it is an upper bound on α as this averaged-max-variance may reﬂect wrong prediction provided that they depend on H 0 .
We then obtain an estimate of β by again calculating the average-max-variance of the top layer however now with H
= 0 for all maze shapes.
Next we chose a 100 random paths parametrized by γ leading from the total neglect minima ( γ = 0 ) for the total neglect through a random point at γ = 15 , and then to the checkerboard-BFS minima at γ = 30 .
The random point was placed within a hyper-cube of length 4 having the total neglect minima at its center.
The path was a simple quadratic interpolation between the three point.
The graph below shows the statistics of α/β 2 on these 100 different paths.
Notably no path even had α > e − 30 β 2 within the hyper-cube.
We have tried three different other lengths for the hyper cube (and 1 ) and arrived at the same conclusions.