U NDERSTANDING D EEP N EURAL N ETWORKS WITH R ECTIFIED L INEAR U NITS
A BSTRACT
In this paper we investigate the family of functions representable by deep neural networks (DNN) with rectiﬁed linear units (ReLU).
We give an algorithm to train a ReLU DNN with one hidden layer to global optimality with runtime polynomial in the data size albeit exponential in the input dimension.
Further, we improve on the known lower bounds on size (from exponential to super exponential) for approximating a ReLU deep net function by a shallower ReLU net.
Our gap theorems hold for smoothly parametrized families of “hard” functions, contrary to countable, discrete families known in the literature.
An example consequence of our gap theorems is the following: for every natural number k there exists a function representable by a ReLU DNN with k 2 hidden layers and total size k 3 , such that any ReLU DNN with at most k hidden layers will require at least 12 k k +1 − 1 total nodes.
Finally, for the family of R n → R DNNs with ReLU activations, we show a new lowerbound on the number of afﬁne pieces, which is larger than previous constructions in certain regimes of the network architecture and most distinctively our lowerbound is demonstrated by an explicit construction of a smoothly parameterized family of functions attaining this scaling.
Our construction utilizes the theory of zonotopes from polyhedral theory.
I NTRODUCTION
Deep neural networks (DNNs) provide an excellent family of hypotheses for machine learning tasks such as classiﬁcation.
Neural networks with a single hidden layer of ﬁnite size can represent any continuous function on a compact subset of R n arbitrary well.
The universal approximation result was ﬁrst given by Cybenko in 1989 for sigmoidal activation function (Cybenko, 1989), and later generalized by Hornik to an arbitrary bounded and nonconstant activation function Hornik (1991).
Furthermore, neural networks have ﬁnite VC dimension (depending polynomially on the number of edges in the network), and therefore, are PAC (probably approximately correct) learnable using a sample of size that is polynomial in the size of the networks Anthony & Bartlett (1999).
However, neural networks based methods were shown to be computationally hard to learn (Anthony & Bartlett, 1999) and had mixed empirical success.
Consequently, DNNs fell out of favor by late 90s.
Recently, there has been a resurgence of DNNs with the advent of deep learning LeCun et al.
Deep learning, loosely speaking, refers to a suite of computational techniques that have been developed recently for training DNNs.
It started with the work of Hinton et al.
(2006), which gave empirical evidence that if DNNs are initialized properly (for instance, using unsupervised pre-training), then we can ﬁnd good solutions in a reasonable amount of runtime.
This work was soon followed by a series of early successes of deep learning at signiﬁcantly improving the state-of-the-art in speech recognition Hinton et al.
Since then, deep learning has received immense attention from the machine learning community with several state-of-the-art AI systems in speech recognition, image classiﬁcation, and natural language processing based on deep neural nets Hinton et al.
Dahl et al.
; Krizhevsky et al.
(2012); Le (2013);
Sutskever et al.
While there is less of evidence now that pre-training actually helps, several other solutions have since been put forth to address the issue of efﬁciently training DNNs.
These include heuristics such as dropouts Srivastava et al.
(2014), but also considering alternate deep architectures such as convolutional neural networks Sermanet et al.
(2014), deep belief networks Hinton et al.
(2006), and deep Boltzmann machines Salakhutdinov & Hinton (2009).
In addition, deep architectures based on new non-saturating activation functions have been suggested to be more effectively trainable – the most successful and widely popular of these is the rectiﬁed linear unit (ReLU) activation, i.e., σ ( x ) = max { 0 , x } , which is the focus of study in this paper.
In this paper, we formally study deep neural networks with rectiﬁed linear units; we refer to these deep architectures as ReLU DNNs.
Our work is inspired by these recent attempts to understand the reason behind the successes of deep learning, both in terms of the structure of the functions represented by DNNs, Telgarsky (2015; 2016); Kane & Williams (2015); Shamir (2016), as well as efforts which have tried to understand the non-convex nature of the training problem of DNNs better Kawaguchi (2016); Haeffele & Vidal (2015).
Our investigation of the function space represented by ReLU DNNs also takes inspiration from the classical theory of circuit complexity; we refer the reader to Arora & Barak (2009); Shpilka & Yehudayoff (2010); Jukna (2012); Saptharishi (2014); Allender (1998) for various surveys of this deep and fascinating ﬁeld.
In particular, our gap results are inspired by results like the ones by Hastad Hastad (1986), Razborov Razborov (1987) and Smolensky Smolensky (1987) which show a strict separation of complexity classes.
We make progress towards similar statements with deep neural nets with ReLU activation.
1. N OTATION AND D EFINITIONS
We extend the ReLU activation function to vectors x ∈ R n through entry-wise operation: σ ( x ) =
(max { 0 , x 1 } , max { 0 , x 2 } , . . .
, max { 0 , x n } ) .
For any ( m, n ) ∈ N , let A nm and L nm denote the class of afﬁne and linear transformations from R m → R n , respectively.
Deﬁnition 1.
[ReLU DNNs, depth, width, size]
For any number of hidden layers k ∈ N , input and output dimensions w 0 , w k +1 ∈ N , a R w 0 → R w k +1 ReLU DNN is given by specifying a sequence of k natural numbers w 1 , w 2 , . . .
, w k representing widths of the hidden layers, a set of k afﬁne transformations T i : R w i − 1 → R w i for i = 1 , . . .
, k and a linear transformation
T k +1 :
R w k
→ R w k +1 corresponding to weights of the hidden layers.
Such a ReLU DNN is called a ( k + 1) -layer
ReLU DNN, and is said to have k hidden layers.
The function f : R n 1 → R n 2 computed or represented by this ReLU DNN is
[Equation]
where ◦ denotes function composition.
The depth of a ReLU DNN is deﬁned as k + 1 .
The width of a ReLU DNN is max { w 1 , . . .
, w k } .
The size of the ReLU DNN is w
+ w 2 + . . .
+ w k .
Deﬁnition 2.
We denote the class of R w
→ R w k +1 ReLU DNNs with k hidden layers of widths { w i } ki =1 by F { w i } k +1 i =0 , i.e.
[Equation]
Deﬁnition 3.
[Piecewise linear functions]
We say a function f : R n → R is continuous piecewise linear (PWL) if there exists a ﬁnite set of polyhedra whose union is R n , and f is afﬁne linear over each polyhedron (note that the deﬁnition automatically implies continuity of the function because the afﬁne regions are closed and cover R n , and afﬁne functions are continuous).
The number of pieces of f is the number of maximal connected subsets of R n over which f is afﬁne linear (which is ﬁnite).
Many of our important statements will be phrased in terms of the following simplex.
Deﬁnition 4.
Let M > 0 be any positive real number and p ≥ 1 be any natural number.
Deﬁne the following set:
[Equation]
E XACT CHARACTERIZATION OF FUNCTION CLASS REPRESENTED BY R E LU DNN S
One of the main advantages of DNNs is that they can represent a large family of functions with a relatively small number of parameters.
In this section, we give an exact characterization of the functions representable by ReLU DNNs.
Moreover, we show how structural properties of ReLU
DNNs, speciﬁcally their depth and width, affects their expressive power.
It is clear from deﬁnition that any function from R n → R represented by a ReLU DNN is a continuous piecewise linear (PWL) function.
In what follows, we show that the converse is also true, that is any PWL function is representable by a ReLU DNN.
In particular, the following theorem establishes a one-to-one correspondence between the class of ReLU DNNs and PWL functions.
Theorem 2.1.
Every R n → R ReLU DNN represents a piecewise linear function, and every piecewise linear function R n → R can be represented by a ReLU DNN with at most (cid:100) log 2 ( n + 1) (cid:101) +depth.
Proof Sketch: It is clear that any function represented by a ReLU DNN is a PWL function.
To see the converse, we ﬁrst note that any PWL function can be represented as a linear combination of piecewise linear convex functions.
More formally, by Theorem 1 in (Wang & Sun, 2005), for every piecewise linear function f : R n → R , there exists a ﬁnite set of afﬁne linear functions (cid:96) 1 , . . .
, (cid:96) k and subsets S 1 , . .
, S p ⊆ { 1 , . . .
, k } (not necessarily disjoint) where each S i is of cardinality at most n + 1 ,
such that
[Equation]
[Equation]
) where s j ∈ {− 1 , +1 } for all j = 1 , . .
p .
Since a function of the form max i ∈ S j (cid:96) i is a piecewise linear convex function with at most n + 1 pieces (because | S j | ≤ n + 1 ), Equation (2.1) says that any continuous piecewise linear function (not necessarily convex) can be obtained as a linear combination of piecewise linear convex functions each of which has at most n + 1 afﬁne pieces.
Furthermore, Lemmas D.1, D.2 and D.3 in the Appendix (see supplementary material), show that composition, addition, and pointwise maximum of PWL functions are also representable by ReLU
DNNs.
In particular, in Lemma D.3 we note that max { x, y } = x
+ y 2 + | x − y
|is
implementable by a two layer ReLU network and use this construction in an inductive manner to show that maximum of n + 1 numbers can be computed using a ReLU DNN with depth at most (cid:100) log 2 ( n + 1) (cid:101) .
While Theorem 2.1 gives an upper bound on the depth of the networks needed to represent all continuous piecewise linear functions on R n , it does not give any tight bounds on the size of the networks that are needed to represent a given piecewise linear function.
For n = 1 , we give tight bounds on size as follows:
Theorem 2.2.
Given any piecewise linear function R → R with p pieces there exists a 2-layer DNN with at most p nodes that can represent f .
Moreover, any 2-layer DNN that represents f has size at least p − 1 .
Finally, the main result of this section follows from Theorem 2.1, and well-known facts that the piecewise linear functions are dense in the family of compactly supported continuous functions and the family of compactly supported continuous functions are dense in L q ( R n ) (Royden & Fitzpatrick, 2010)).
Recall that L q ( R n ) is the space of Lebesgue integrable functions f such that (cid:82) | f | q dµ < ∞ , where µ is the Lebesgue measure on R n (see Royden Royden & Fitzpatrick (2010)).
Theorem 2.3.
Every function in L q ( R n ) , (1 ≤ q ≤ ∞ ) can be arbitrarily well-approximated in the
L q norm (which for a function f is given by ||
f || q
= ( (cid:82) | f | q ) 1 /q ) by a ReLU DNN function with at most (cid:100) log 2 ( n + 1) (cid:101) hidden layers.
Moreover, for n = 1 , any such L q function can be arbitrarily well-approximated by a 2-layer DNN, with tight bounds on the size of such a DNN in terms of the approximation.
Proofs of Theorems 2.2 and 2.3 are provided in Appendix A. We would like to remark that a weaker version of Theorem 2.1 was observed in (Goodfellow et al., 2013, Proposition 4.1) (with no bound on the depth), along with a universal approximation theorem (Goodfellow et al., 2013, Theorem 4.3) similar to Theorem 2.3.
The authors of Goodfellow et al.
(2013) also used a previous result of
Wang (Wang, 2004) for obtaining their result.
In a subsequent work Boris Hanin (Hanin, 2017) has, among other things, found a width and depth upper bound for ReLU net representation of positive
PWL functions on [0 , 1] n .
The width upperbound is n+3 for general positive PWL functions and n + 1 for convex positive PWL functions.
For convex positive PWL functions his depth upper bound is sharp if we disallow dead ReLUs.
B ENEFITS OF D EPTH
Success of deep learning has been largely attributed to the depth of the networks, i.e. number of successive afﬁne transformations followed by nonlinearities, which is shown to be extracting hierarchical features from the data.
In contrast, traditional machine learning frameworks including support vector machines, generalized linear models, and kernel machines can be seen as instances of shallow networks, where a linear transformation acts on a single layer of nonlinear feature extraction.
In this section, we explore the importance of depth in ReLU DNNs.
In particular, in Section 3.1, we provide a smoothly parametrized family of R → R “hard” functions representable by ReLU DNNs, which requires exponentially larger size for a shallower network.
Furthermore, in Section 3.2, we construct a continuum of R n → R “hard” functions representable by ReLU DNNs, which to the best of our knowledge is the ﬁrst explicit construction of ReLU DNN functions whose number of afﬁne pieces grows exponentially with input dimension.
The proofs of the theorems in this section are provided in Appendix B.
3. C IRCUIT LOWER BOUNDS FOR R → R R E LU DNN S
In this section, we are only concerned about R → R ReLU DNNs, i.e. both input and output dimensions are equal to one.
The following theorem shows the depth-size trade-off in this setting.
Theorem 3.1.
For every pair of natural numbers k ≥ 1 , w ≥ 2 , there exists a family of hard functions representable by a R → R ( k + 1) -layer ReLU DNN of width w such that if it is also representable by a ( k (cid:48) + 1) -layer ReLU DNN for any k (cid:48) ≤ k , then this ( k (cid:48) + 1) -layer ReLU DNN has size at least 12 k (cid:48)
w kk (cid:48) − 1 .
In fact our family of hard functions described above has a very intricate structure as stated below.
Theorem 3.2.
For every k ≥ 1 , w ≥ 2 , every member of the family of hard functions in Theorem 3. has w k pieces and this family can be parametrized by
[Equation]
i.e., for every point in the set above, there exists a distinct function with the stated properties.
The following is an immediate corollary of Theorem 3.1 by choosing the parameters carefully.
Corollary 3.3.
For every k ∈ N and (cid:15) > 0 , there is a family of functions deﬁned on the real line such that every function f from this family can be represented by a ( k 1+ (cid:15) )
+ 1 -layer DNN with size k 2+ (cid:15) and if f is represented by a k +1 -layer DNN, then this DNN must have size at least 12 k · k k (cid:15) − 1 .
Moreover, this family can be parametrized as, [Equation]
A particularly illuminative special case is obtained by setting (cid:15)
= 1 in Corollary 3.3:
Corollary 3.4.
For every natural number k ∈ N , there is a family of functions parameterized by the set ∪ M> 0 ∆ k 3 − 1 M such that any f from this family can be represented by a k 2 + 1 -layer DNN with k 3 nodes, and every k + 1 -layer DNN that represents f needs at least [-1 
-]12 k k +1 − 1 nodes.
We can also get hardness of approximation versions of Theorem 3.1 and Corollaries 3.3 and 3.4, with the same gaps (upto constant terms), using the following theorem.
Theorem 3.5.
For every k ≥ 1 , w ≥ 2 , there exists a function f k,w that can be represented by a ( k + 1) -layer ReLU DNN with w nodes in each layer, such that for all δ > 0 and k (cid:48)
≤ k the following holds:
[Equation]
where G k (cid:48) ,δ is the family of functions representable by ReLU DNNs with depth at most k (cid:48) + 1 , and size at most k (cid:48) w k/k (cid:48) ( [Equation] δ
[Equation]
1 /k
[Equation]
1+
[Equation] k [Equation] The depth-size trade-off results in Theorems 3.1, and 3.5 extend and improve Telgarsky’s theorems from (Telgarsky, 2015; 2016) in the following three ways:
(i)
If we use our Theorem 3.5 to the pair of neural nets considered by Telgarsky in Theorem 1 . 1 in Telgarsky (2016) which are at depths k 3 (of size also scaling as k 3 ) and k then for this purpose of approximation in the (cid:96) 1 − norm we would get a size lower bound for the shallower net which scales as Ω(2 k 2 ) which is exponentially (in depth) larger than the lower bound of Ω(2 k ) that Telgarsky can get for this scenario.
(ii) Telgarsky’s family of hard functions is parameterized by a single natural number k .
In contrast, we show that for every pair of natural numbers w and k , and a point from the set in equation 3.1, there exists a “hard” function which to be represented by a depth k (cid:48) network would need a size of at least w kk (cid:48) k (cid:48) .
With the extra ﬂexibility of choosing the parameter w , for the purpose of showing gaps in representation ability of deep nets we can shows size lower bounds which are super -exponential in depth as explained in Corollaries 3.3 and 3.4.
(iii)
A characteristic feature of the “hard” functions in Boolean circuit complexity is that they are usually a countable family of functions and not a “smooth” family of hard functions.
In fact, in the last section of Telgarsky (2015), Telgarsky states this as a “weakness” of the state-of-the-art results on “hard” functions for both Boolean circuit complexity and neural nets research.
In contrast, we provide a smoothly parameterized family of “hard” functions in Section 3.1 (parametrized by the set in equation 3.1).
Such a continuum of hard functions wasn’t demonstrated before this work.
We point out that Telgarsky’s results in (Telgarsky, 2016) apply to deep neural nets with a host of different activation functions, whereas, our results are speciﬁcally for neural nets with rectiﬁed linear units.
In this sense, Telgarsky’s results from (Telgarsky, 2016) are more general than our results in this paper, but with weaker gap guarantees.
Eldan-Shamir (Shamir, 2016; Eldan & Shamir, 2016) show that there exists an R n → R function that can be represented by a 3-layer DNN, that takes exponential in n number of nodes to be approximated to within some constant by a 2-layer DNN.
While their results are not immediately comparable with Telgarsky’s or our results, it is an interesting open question to extend their results to a constant depth hierarchy statement analogous to the recent result of Rossman et al (Rossman et al., 2015).
We also note that in last few years, there has been much effort in the community to show size lowerbounds on ReLU DNNs trying to approximate various classes of functions which are themselves not necessarily exactly representable by ReLU
DNNs (Yarotsky, 2016; Liang & Srikant, 2016; Safran & Shamir, 2017).
3. A CONTINUUM OF HARD FUNCTIONS FOR R n → R FOR n ≥
One measure of complexity of a family of R n → R “hard” functions represented by ReLU DNNs is the asymptotics of the number of pieces as a function of dimension n , depth k + 1 and size s of the ReLU DNNs.
More precisely, suppose one has a family H of functions such that for every n, k, w ∈ N the family contains at least one R n → R function representable by a ReLU DNN with depth at most k + 1 and maximum width at most w .
The following deﬁnition formalizes a notion of complexity for such a H .
Deﬁnition 5 (comp H ( n, k, w ) ) .
The measure comp H ( n, k, w ) is deﬁned as the maximum number of pieces (see Deﬁnition 3) of a R n → R function from H that can be represented by a ReLU DNN with depth at most k + 1 and maximum width at most w .
Similar measures have been studied in previous works Montufar et al.
Pascanu et al.
; Raghu et al.
The best known families H are the ones from Theorem 4 of (Montufar et al., 2014) and a mild generalization of Theorem 1 .
1 of (Telgarsky, 2016) to k layers of ReLU activations with width w ; these constructions achieve
[Equation]
and comp H ( n, k, s ) =
O ( w k ) , respectively.
At the end of this section we would explain the precise sense in which we improve on these numbers.
An analysis of this complexity measure is done using integer programming techniques in (Serra et al., 2017).
Deﬁnition 6.
Let b 1 , . . .
, b m ∈ R n .
The zonotope formed by b 1 , . .
, b m ∈ R n is deﬁned as
[Equation]
[Figure]
The set of vertices of Z ( b 1 , . . .
, b m ) will be denoted by vert( Z ( b 1 , . . .
, b m )) .
The support function γ Z ( b 1 ,..., b m ) :
R n → R associated with the zonotope Z ( b 1 , . . .
, b m ) is deﬁned as
[Equation]
The following results are well-known in the theory of zonotopes (Ziegler, 1995).
Theorem 3.6.
The following are all true
| vert( Z ( b 1 , . . .
, b m ))
| ≤ (cid:80) n − 1 i =0 (cid:0) m − 1 i (cid:1) .
The set of ( b 1 , . . .
, b m ) ∈ R n × . . .
×
R n such that this does not hold at equality is a 0 measure set.
γ Z ( b 1 ,..., b
[Equation]
[Equation]
γ Z ( b 1 ,..., b m ) is therefore a piecewise linear function with | vert( Z ( b 1 , . . .
, b m )) | pieces.
[Equation]
Deﬁnition 7 (extremal zonotope set) .
The set S ( n, m ) will denote the set of ( b 1 , . . .
, b m ) ∈ R n × . . .
×
R n such that | vert( Z ( b 1 , . . .
, b m ))
| = (cid:80) n − 1 i =0 (cid:0) m − 1 i (cid:1) .
S ( n, m ) is the so-called “extremal zonotope set”, which is a subset of R nm , whose complement has zero Lebesgue measure in R nm .
Lemma 3.7.
Given any b 1 , . . .
, b m ∈ R n , there exists a 2-layer ReLU DNN with size 2 m which represents the function γ Z ( b 1 ,..., b m ) ( r ) .
Deﬁnition 8.
For p ∈ N and a ∈ ∆ pM , we deﬁne a function
h a : R → R which is piecewise linear over the segments ( −∞ , 0] , [0 , a 1 ] , [ a 1 , a 2 ] , . . .
, [ a p , M ] , [ M, + ∞ ) deﬁned as follows: h a ( x ) =for all x ≤ 0 , h a ( a i ) =
M ( i mod 2) , and h a ( M ) =
M − h a ( a p ) and for x ≥ M , h a ( x ) is a linear continuation of the piece over the interval [ a p , M ] .
Note that the function has p + 2 pieces, with the leftmost piece having slope 0 .
Furthermore, for a 1 , . . .
, a k ∈ ∆ pM , we denote the composition of the functions h a 1 , h a 2 , . . .
, h a k by
[Equation]
Proposition 3.8.
Given any tuple ( b 1 , . . .
, b m ) ∈ S ( n, m ) and any point
[Equation]
[Equation]
, the function ZONOTOPE nk,w,m [ a 1 , . .
. , a k , b 1 , . . .
, b m ] :
= H a 1 ,..., a k ◦ γ Z ( b 1 ,..., b m ) has ( m − 1) n − 1 w k pieces and it can be represented by a k + 2 layer ReLU DNN with size 2 m
+ wk .
Finally, we are ready to state the main result of this section.
Theorem 3.9.
For every tuple of natural numbers n, k, m ≥ 1 and w ≥ 2 , there exists a family of R n → R functions, which we call ZONOTOPE nk,w,m with the following properties:
(i)
Every f ∈ ZONOTOPE nk,w,m is representable by a ReLU DNN of depth k +
and size 2 m + wk , and has (cid:16)(cid:80) n − 1 i =0 (cid:0) m − 1 i (cid:1)(cid:17) w k pieces.
(ii) Consider any f ∈ ZONOTOPE nk,w,m .
If f is represented by a ( k (cid:48) + 1) - layer DNN for any k (cid:48) ≤ k , then this ( k (cid:48) + 1) -layer DNN has size at least
[Equation]
(iii)
The family ZONOTOPE nk,w,m is in one-to-one correspondence with
[Equation]
( n, m ) [Equation]
Firstly we note that the construction in (Montufar et al., 2014) requires all the hidden layers to have width at least as big as the input dimensionality n .
In contrast, we do not impose such restrictions and the network size in our construction is independent of the input dimensionality. Thus our result probes networks with bottleneck architectures whose complexity cant be seen from their result.
Secondly , in terms of our complexity measure, there seem to be regimes where our bound does better.
One such regime, for example, is when n ≤ w < 2 n and k ∈ Ω( n log( n ) ) , by setting in our construction m < n .
Thirdly , it is not clear to us whether the construction in (Montufar et al., 2014) gives a smoothly parameterized family of functions other than by introducing small perturbations of the construction in their paper. In contrast, we have a smoothly parameterized family which is in one-to-one correspondence with a well-understood manifold like the higher-dimensional torus.
T RAINING 2- LAYER R n → R R E LU DNN S TO GLOBAL OPTIMALITY
In this section we consider the following empirical risk minimization problem.
Given D data points ( x i , y i ) ∈ R n × R , i = 1 , . . .
, D , ﬁnd
the function f represented by 2-layer R n → R ReLU DNNs of width w , that minimizes the following optimization problem
[Equation]
where (cid:96) :
R × R → R is a convex loss function (common loss functions are the squared loss, (cid:96) ( y, y (cid:48) )
= ( y − y (cid:48) ) 2 , and the hinge loss function given by (cid:96) ( y, y (cid:48) )
= max { 0 , 1 − yy (cid:48) } ).
Our main result of this section gives an algorithm to solve the above empirical risk minimization problem to global optimality.
Theorem 4.1.
There exists an algorithm to ﬁnd a global optimum of Problem 4.1 in time
O (2 w ( D ) nw poly ( D, n, w )) .
Note that the running time O (2 w ( D ) nw poly ( D, n, w )) is polynomial in the data size D for ﬁxed n, w .
Proof Sketch:
A full proof of Theorem 4.1 is included in Appendix C.
Here we provide a sketch of the proof.
When the empirical risk minimization problem is viewed as an optimization problem in the space of weights of the ReLU DNN, it is a nonconvex, quadratic problem.
However, one can instead search over the space of functions representable by 2-layer DNNs by writing them in the form similar to (2.1).
This breaks the problem into two parts: a combinatorial search and then a convex problem that is essentially linear regression with linear inequality constraints.
This enables us to guarantee global optimality.
1: function ERM( D ) (cid:46)
Where D = { ( x i , y i ) } Di =1 ⊂ R n × R 2:
S =
{ +1 , − 1 } w (cid:46)
All possible instantiations of top layer weights 3:
P i = { ( P i + , P i − ) } , i = 1 , . . .
, w (cid:46)
All possible partitions of data into two parts 4:
P = P 1 × P 2 × · · · × P w 5: count =(cid:46) Counter 6: for s ∈ S do 7: for { ( P i + , P i − ) } wi =1 ∈ P do 8: loss(count) =
  minimize: ˜ a, ˜ b
D (cid:88)
j = (cid:88)
i : j ∈ P i + (cid:96) ( s i (˜ a i · x j + ˜ b i ) , y j ) subject to: ˜ a i · x j + ˜ b i ≤ 0 ∀ j ∈ P
i − ˜ a i · x j + ˜ b i ≥
∀ j ∈ P
i + 9: count + + 10: end for 11:
OPT = argmin loss(count) 12: end for 13: return { ˜ a } , { ˜ b } , s corresponding to OPT’s iterate 14: end function Let T 1 ( x ) = Ax + b and T 2 ( y ) = a (cid:48) · y for A ∈ R w × n and b, a (cid:48) ∈ R w .
If we denote the i -th row of the matrix A by a i , and write b i , a (cid:48) i to denote the i -th coordinates of the vectors b, a (cid:48) respectively, due to homogeneity of ReLU gates, the network output can be represented as f ( x [Equation] = [Equation]
(cid:88)
[Equation]
where ˜ a i ∈ R n , ˜ b i ∈ R and s i ∈ {− 1 , +1 } for all i = 1 , . .
w .
For any hidden node i ∈ { 1 . . . , w } , the pair (˜ a i , ˜ b i ) induces a partition P i :
= ( P i + , P i − ) on the dataset, given by P i − =
{ j : ˜ a i · x j + ˜ b i ≤ 0 } and P i + = { 1 , . . .
, D }\ P i − .
Algorithm 1 proceeds by generating all combinations of the partitions P i as well as the top layer weights s ∈ { +1 , − 1 } w , and minimizing the loss (cid:80)
Dj =1 (cid:80) i : j ∈ P
i + (cid:96) ( s i (˜ a i · x j + ˜ b i ) , y j ) subject to the constraints ˜
a i · x j + ˜ b i ≤ 0 ∀ j ∈ P
i − and ˜ a i · x j + ˜ b i ≥ 0 ∀ j ∈ P
i + which are imposed for all i = 1 , . . . , w , which is a convex program.
Algorithm 1 implements the empirical risk minimization (ERM) rule for training ReLU DNN with one hidden layer.
To the best of our knowledge there is no other known algorithm that solves the ERM problem to global optimality.
We note that due to known hardness results exponential dependence on the input dimension is unavoidable Blum & Rivest (1992); Shalev-Shwartz & BenDavid (2014); Algorithm 1 runs in time polynomial in the number of data points.
To the best of our knowledge there is no hardness result known which rules out empirical risk minimization of deep nets in time polynomial in circuit size or data size.
Thus our training result is a step towards resolving this gap in the complexity literature.
A related result for improperly learning ReLUs has been recently obtained by Goel
et al
(Goel et al., 2016).
In contrast, our algorithm returns a ReLU DNN from the class being learned.
Another difference is that their result considers the notion of reliable learning as opposed to the empirical risk minimization objective considered in (4.1).
D ISCUSSION
The running time of the algorithm that we give in this work to ﬁnd the exact global minima of a two layer ReLU-DNN is exponential in the input dimension n and the number of hidden nodes w .
The exponential dependence on n can not be removed unless P = NP ; see Shalev-Shwartz & Ben-David (2014); Blum & Rivest (1992); DasGupta et al.
However, we are not aware of any complexity results which would rule out the possibility of an algorithm which trains to global optimality in time that is polynomial in the data size and/or the number of hidden nodes, assuming that the input dimension is a ﬁxed constant.
Resolving this dependence on network size would be another step towards clarifying the theoretical complexity of training ReLU DNNs and is a good open question for future research, in our opinion.
Perhaps an even better breakthrough would be to get optimal training algorithms for DNNs with two or more hidden layers and this seems like a substantially harder nut to crack.
It would also be a signiﬁcant breakthrough to get gap results between consecutive constant depths or between logarithmic and constant depths
A CKNOWLEDGMENTS
We would like to thank Christian Tjandraatmadja for pointing out a subtle error in a previous version of the paper, which affected the complexity results for the number of linear regions in our constructions in Section 3.2.
Anirbit would like to thank Ramprasad Saptharishi, Piyush Srivastava and
Rohit Gurjar for extensive discussions on Boolean and arithmetic circuit complexity.
This paper has been immensely inﬂuenced by the perspectives gained during those extremely helpful discussions. Amitabh Basu gratefully acknowledges support from the NSF grant CMMI1452820. Raman Arora was supported in part by NSF BIGDATA grant IIS-1546482. A E XPRESSING PIECEWISE LINEAR FUNCTIONS USING R E LU DNN S
Proof of Theorem 2.2.
Any continuous piecewise linear function R → R which has m pieces can be speciﬁed by three pieces of information, (1) s L the slope of the left most piece, (2) the coordinates of the non-differentiable points speciﬁed by a ( m − 1) − tuple { ( a i , b i ) } m − 1 i =1 (indexed from left to right) and (3) s
R the slope of the rightmost piece.
A tuple ( s L , s R , ( a 1 , b 1 ) , . . .
, ( a m − 1 , b m − 1 ) uniquely speciﬁes a m piecewise linear function from R → R and vice versa.
Given such a tuple, we construct a 2 -layer DNN which computes the same piecewise linear function.
One notes that for any a, r ∈ R , the function
[Equation]
is equal to sgn( r ) max {| r | ( x − a ) , 0 } , which can be implemented by a 2-layer ReLU DNN with size 1.
Similarly, any function of the form,
[Equation]
is equal to − sgn( t ) max {−| t | ( x − a ) , 0 } , which can be implemented by a 2-layer ReLU DNN with size 1.
The parameters r, t will be called the slopes of the function, and a will be called the breakpoint of the function.
If we can write the given piecewise linear function as a sum of m functions of the form (A.1) and (A.2), then by Lemma D.2 we would be done.
It turns out that such a decomposition of any p piece PWL function h : R → R as a sum of p ﬂaps can always be arranged where the breakpoints of the p ﬂaps all are all contained in the p − 1 breakpoints of h .
First, observe that adding a constant to a function does not change the complexity of the ReLU
DNN expressing it, since this corresponds to a bias on the output node.
Thus, we will assume that the value of h at the last break point a m − 1 is b m − 1 = 0 .
We now use a single function f of the form (A.1) with slope r and breakpoint a = a m − 1 , and m − 1 functions g 1 , . .
, g m − 1 of the form (A.2) with slopes t 1 , . . .
, t m − 1 and breakpoints a 1 , . . .
, a m − 1 , respectively.
Thus, we wish to express h
= f
+ g 1 + . . .
+ g m − 1 .
Such a decomposition of h would be valid if we can ﬁnd values for r, t 1 , . . .
, t m − 1 such that (1) the slope of the above sum is = s L for x < a 1 , (2) the slope of the above sum is =
s R for x > a m − 1 , and (3) for each i ∈ { 1 , 2 , 3 , .., m − 1 } we have b
[Equation]
The above corresponds to asking for the existence of a solution to the following set of simultaneous linear equations in r, t 1 , . . .
, t m − 1 :
[Equation]
It is easy to verify that the above set of simultaneous linear equations has a unique solution.
Indeed, r must equal s R , and then one can solve for t 1 , . .
, t m − 1 starting from the last equation b m − 2 =
t m − 1 ( a m − 2 − a m − 1 ) and then back substitute to compute t m − 2 , t m − 3 , . .
t 1 .
The lower bound of p − 1 on the size for any 2 -layer ReLU DNN that expresses a p piece function follows from
Lemma D.6.
One can do better in terms of size when the rightmost piece of the given function is ﬂat, i.e., s R = 0 .
In this case r = 0 , which means that f = 0 ; thus, the decomposition of h above is of size p − 1 .
A similar construction can be done when s L = 0 .
This gives the following statement which will be useful for constructing our forthcoming hard functions.
Corollary A.1.
If the rightmost or leftmost piece of a R → R piecewise linear function has 0 slope, then we can compute such a p piece function using a 2 -layer DNN with size p − 1 .
Proof of theorem 2.3.
Since any piecewise linear function R n → R is representable by a ReLU
DNN by Corollary 2.1, the proof simply follows from the fact that the family of continuous piecewise linear functions is dense in any L p ( R n ) space, for 1 ≤ p ≤ ∞ .
B B ENEFITS OF D EPTH B. C ONSTRUCTING A CONTINUUM OF HARD FUNCTIONS FOR R → R R E LU DNN S AT EVERY DEPTH AND EVERY WIDTH
Lemma B.1.
For any M > 0 , p ∈ N , k ∈ N and a 1 , . . .
, a k ∈ ∆ pM , if we compose the functions h a 1 , h a 2 , . .
h a k the resulting function is a piecewise linear function with at most ( p + 1) k +pieces, i.e.,
[Equation]
is piecewise linear with at most ( p +1)
k +2 pieces, with ( p +1)
k of these pieces in the range [0 , M ] (see Figure 2).
Moreover, in each piece in the range [0 , M ] , the function is afﬁne with minimum value 0 and maximum value M .
Proof.
Simple induction on k .
Proof of Theorem 3.2.
Given k ≥ 1 and w ≥ 2 , choose any point
[Equation]
By Deﬁnition 8, each h a
i , i = 1 , . . .
, k is a piecewise linear function with w + 1 pieces and the leftmost piece having slope 0 .
Thus, by Corollary A.1, each h a i , i = 1 , . . .
, k can be represented by a 2-layer ReLU DNN with size w .
Using Lemma D.1, H a 1 ,..., a k can be represented by a k + 1 layer
DNN with size wk ; in fact, each hidden layer has exactly w nodes.
Proof of Theorem 3.1.
Follows from Theorem 3.2 and Lemma D.6.
Proof of Theorem 3.5.
Given k ≥ 1 and w ≥ 2 deﬁne q := w k and s q :=
h a ◦ h a ◦ . . .
◦
h a (cid:124) (cid:123)(cid:122) (cid:125)
k times where a = ( 1 w , 2 w , . . .
, w − 1 w ) ∈
∆ q − 1.
Thus, s q is representable by a ReLU DNN of width w +1 and depth k + 1 by Lemma D.1.
In what follows, we want to give a lower bound on the (cid:96) 1 distance of s q from any continuous p -piecewise linear comparator g p : R → R .
The function s q contains (cid:98) q 2 (cid:99) triangles of width 2 q and unit height.
A p -piecewise linear function has p − 1 breakpoints in the interval [0 , 1] .
So that in at least (cid:98) w k 2 (cid:99) − ( p − 1) triangles, g p has to be afﬁne.
In the following we demonstrate that
The dotted line in the bottom panel corresponds to the function in the top panel.
It shows that for every piece there is a inside any triangle of s q , any afﬁne function will incur an (cid:96) 1 error of at least 12 w k .
[Equation]
The above integral attains its minimum of 12 w k at y 1 = y 2 = 12 .
Putting together,
[Equation]
Thus, for any δ > 0 , p ≤
[Equation]
The result now follows from Lemma D.6.
B. A CONTINUUM OF HARD FUNCTIONS FOR R n → R FOR n ≥
Proof of Lemma 3.7.
By Theorem 3.6 part 3., γ Z ( b 1 ,..., b m ) [Equation] r ) = | [Equation]
[Equation]
[Equation] | [Equation] + |(cid:104) r
[Equation]
b m (cid:105)| .
It sufﬁces to observe
[Equation]
Proof of Proposition 3.8.
The fact that ZONOTOPE nk,w,m [ a 1 , . .
. , a k , b 1 , . . .
, b m ] can be represented by a k + 2 layer ReLU DNN with size 2 m + wk follows from Lemmas 3.7 and D.1.
The number of pieces follows from the fact that γ Z ( b 1 ,..., b m ) has (cid:80) n − 1 i =0 (cid:0) m − 1 i (cid:1) distinct linear pieces by parts 1. and 2. of Theorem 3.6, and H a 1 ,..., a k has w k pieces by Lemma B.1.
Proof of Theorem 3.9.
Follows from Proposition 3.8.
C E XACT E MPIRICAL R ISK M INIMIZATION
Proof of Theorem 4.1.
Let (cid:96) :
R → R be any convex loss function, and let ( x 1 , y 1 ) , . . .
, ( x D , y D ) ∈ R n × R be the given D data points.
As stated in (4.1), the problem requires us to ﬁnd an afﬁne transformation T 1 : R n → R w and a linear transformation T 2 : R w → R , so as to minimize the empirical loss as stated in (4.1).
Note that T 1 is given by a matrix A ∈ R w × n and a vector b ∈ R w
so that T ( x ) =
Ax + b for all x ∈ R n .
Similarly, T 2 can be represented by a vector a (cid:
) ∈
R w such that T 2 ( y ) = a (cid:48) · y for all y ∈ R w .
If we denote the i -th row of the matrix A by a i , and write b i , a (cid:48) i to denote the i -th coordinates of the vectors b, a (cid:48) respectively, we can write the function represented by this network as
[Equation]
In other words, the family of functions over which we are searching is of the form
[Equation]
where ˜ a i ∈ R n , b i ∈ R and s i ∈ {− 1 , +1 } for all i = 1 , . .
, w .
We now make the following observation.
For a given data point ( x j , y j ) if ˜ a i · x j + ˜ b i ≤ 0 , then the i -th term of (C.1) does not contribute to the loss function for this data point ( x j , y j ) .
Thus, for every data point ( x j , y j ) , there exists a set S j ⊆ { 1 , . . .
, w } such that f ( x j ) =
(cid:80) i ∈ S
j s i (˜ a i · x j + ˜ b i ) .
In particular, if we are given the set S j for ( x j , y j ) , then the expression on the right hand side of (C.1) reduces to a linear function of ˜ a i ,
˜ b i .
For any ﬁxed i ∈ { 1 , . . . , w } , these sets S j induce a partition of the data set into two parts.
In particular, we deﬁne P i
+ :=
{ j : i ∈ S j } and P i − := { 1 , . . .
, D } \ P i + .
Observe now that this partition is also induced by the hyperplane given by ˜ a i , ˜ b
i : P i + = { j : ˜ a i · x j + ˜ b i > 0 } and P i + = { j : ˜ a i · x j + ˜ b i ≤ 0 } .
Our strategy will be to guess the partitions P
i + , P i − for each i = 1 , . . .
, w , and then do linear regression with the constraint that regression’s decision variables ˜
a i , ˜ b
i induce the guessed partition.
More formally, the algorithm does the following.
For each i = 1 , . . .
, w , the algorithm guesses a partition of the data set ( x j , y j ) , j = 1 , . . .
, D by a hyperplane.
Let us label the partitions as follows ( P i + , P i − ) , i = 1 , . . .
, w .
So, for each i = 1 , . . .
, w , P i + ∪ P
i − = { 1 , . . .
, D } , P i + and P i − are disjoint, and there exists a vector c ∈ R n and a real number δ such that P i − =
{ j : c · x j + δ ≤ 0 } and P i + = { j : c · x j + δ > 0 } .
Further, for each i = 1 , . . .
, w the algorithm selects a vector s in { +1 , − 1 } w .
For a ﬁxed selection of partitions ( P i + , P i − ) , i = 1 , . . .
, w and a vector s in { +1 , − 1 } w , the algorithm solves the following convex optimization problem with decision variables ˜ a i ∈ R n , ˜ b
i ∈ R for i = 1 , . . .
, w (thus, we have a total of ( n + 1) · w decision variables).
The feasible region of the optimization is given by the constraints
[Equation]
which are imposed for all i = 1 , . .
w .
Thus, we have a total of D · w constraints.
Subject to these constraints we minimize the objective (cid:80) Dj =1 (cid:80) i : j ∈ P i + (cid:96) ( s i (˜ a i · x j + ˜ b i ) , y j ) .
Assuming the loss function (cid:96) is a convex function in the ﬁrst argument, the above objective is a convex function.
Thus, we have to minize a convex objective subject to the linear inequality constraints from (C.2).
We ﬁnally have to count how many possible partitions ( P i + , P i − ) and vectors s the algorithm has to search through.
It is well-known Matousek (2002) that the total number of possible hyperplane partitions of a set of size D in R n is at most 2 (cid:0) Dn (cid:1) ≤ D n whenever n ≥ 2 .
Thus with a guess for each i = 1 , . . .
, w , we have a total of at most D nw partitions.
There are 2 w vectors s in {− 1 , +1 } w .
This gives us a total of 2 w D nw guesses for the partitions ( P i + , P i − ) and vectors s .
For each such guess, we have a convex optimization problem with ( n + 1) · w decision variables and D · w constraints, which can be solved in time poly ( D, n, w ) .
Putting everything together, we have the running time claimed in the statement.
The above argument holds only for n ≥ 2 , since we used the inequality 2 (cid:0) Dn (cid:1) ≤ D n which only holds for n ≥ 2 .
For n = 1 , a similar algorithm can be designed, but one which uses the characterization achieved in Theorem 2.2.
Let (cid:96) :
R → R be any convex loss function, and let ( x 1 , y 1 ) , . . .
, ( x D , y D ) ∈ R 2 be the given D data points.
Using Theorem 2.2, to solve problem (4.1) it sufﬁces to ﬁnd a R → R piecewise linear function f with w pieces that minimizes the total loss.
In other words, the optimization problem (4.1) is equivalent to the problem
[Equation]
We now use the observation that ﬁtting piecewise linear functions to minimize loss is just a step away from linear regression, which is a special case where the function is contrained to have exactly one afﬁne linear piece.
Our algorithm will ﬁrst guess the optimal partition of the data points such that all points in the same class of the partition correspond to the same afﬁne piece of f , and then do linear regression in each class of the partition.
Altenatively, one can think of this as guessing the interval ( x i , x i +1 ) of data points where the w − 1 breakpoints of the piecewise linear function will lie, and then doing linear regression between the breakpoints.
More formally, we parametrize piecewise linear functions with w pieces by the w slope-intercept values ( a 1 , b 1 ) , . . .
, ( a 2 , b 2 ) , . . .
, ( a w , b w ) of the w different pieces.
This means that between breakpoints j and j + 1 , 1 ≤ j ≤ w − 2 , the function is given by f ( x )
=
a j +1 x + b j +1 , and the ﬁrst and last pieces are a 1 x
+ b 1 and a w x + b w , respectively.
Deﬁne I to be the set of all ( w − 1) -tuples ( i 1 , . .
, i w − 1 ) of natural numbers such that 1 ≤ i 1 ≤ . . .
≤ i w − 1 ≤ D .
Given a ﬁxed tuple
I =
( i 1 , . .
, i w − 1 ) ∈
I , we wish to search through all piece- wise linear functions whose breakpoints, in order, appear in the intervals ( x i 1 , x i 1 +1 ) , ( x i 2 , x i 2 +1 ) , . . .
, ( x i w − 1 , x i w − 1 +1 ) .
Deﬁne also S =
− 1 , 1 } w − 1 .
Any S ∈ S will have the following inter- pretation: if S j = 1 then a j ≤ a j +1 , and if S j = − 1 then a j ≥ a j +1 .
Now for every I ∈ I and S ∈ S , requiring a piecewise linear function that respects the conditions imposed by I and
S is easily seen to be equivalent to imposing the following linear inequalities on the parameters ( a 1 , b 1 ) , . . .
, ( a 2 , b 2 ) , . . .
, ( a w , b w ) :
[Equation]
Let the set of piecewise linear functions whose breakpoints satisfy the above be denoted by PWL 1 I,S for I
∈
I , S ∈ S .
Given a particular I ∈
I , we deﬁne
[Equation]
Observe that min {
D (cid:88) i = (cid:96) ( f ( x i ) −
[Equation]
The right hand side of the above equation is the problem of minimizing a convex objective subject to linear constraints.
Now, to solve (C.3), we need to simply solve the problem (C.5) for all
I ∈
I , S ∈
S and pick the minimum.
Since |I| = (cid:0) Dw (cid:1)
=
O ( D w ) and |S| = 2 w − 1 we need to solve O (2 w · D w ) convex optimization problems, each taking time O ( poly ( D )) .
Therefore, the total running time is
O ((2 D ) w poly ( D )) .
D A UXILIARY L EMMAS
Now we will collect some straightforward observations that will be used often.
The following operations preserve the property of being representable by a ReLU DNN.
Lemma D.1.
[Function Composition]
If f 1 : R d → R m is represented by a d, m ReLU DNN with depth k 1 + 1 and size s 1 , and f 2 : R m → R n is represented by an m, n ReLU DNN with depth k 2 + 1 and size s 2 , then f 2 ◦ f 1 can be represented by a d, n ReLU DNN with depth k 1 + k 2 + 1 and size s 1 + s 2 .
Proof.
Follows from (1.1) and the fact that a composition of afﬁne transformations is another afﬁne transformation.
Lemma D.2.
[Function Addition]
If f 1 : R n → R m is represented by a n, m ReLU DNN with depth k + 1 and size s 1 , and f 2 : R n → R m is represented by a n, m ReLU DNN with depth k +and size s 2 , then f 1 + f 2 can be represented by a n, m ReLU DNN with depth k +1 and size s 1 + s 2 .
Proof.
We simply put the two ReLU DNNs in parallel and combine the appropriate coordinates of the outputs.
Lemma D.3.
[Taking maximums/minimums] Let f 1 , . . .
, f m : R n → R be functions that can each be represented by R n → R ReLU DNNs with depths
k i + 1 and size s i , i = 1 , . . .
, m .
Then the function f : R n → R deﬁned as f ( x ) :
= max { f 1 ( x ) , . . .
f m ( x ) } can be represented by a ReLU
DNN of depth at most max { k 1 , . . .
, k m } + log( m ) + 1 and size at most s 1 + . . .
s m + 4(2 m − 1) .
Similarly, the function g ( x ) :
= min { f 1 ( x ) , . . .
f m ( x ) } can be represented by a ReLU DNN of depth at most max { k 1 , . . .
, k m } + (cid:100) log( m ) (cid:101) + 1 and size at most s 1 + . . .
s m + 4(2 m − 1) .
Proof.
We prove this by induction on m .
The base case m = 1 is trivial.
For m ≥ 2 , consider g 1 :=
max { f 1 , . . .
, f (cid:98) m 2 (cid:99) } and g 2 := max { f (cid:98) m 2 (cid:99) +1 , . . .
, f m } .
By the induction hypothesis (since (cid:98) m 2 (cid:99) , (cid:100) m 2 (cid:101) < m when m ≥ 2 ), g 1 and g 2 can be represented by ReLU DNNs of depths at most max { k 1 , . . .
, k (cid:98) m 2 (cid:99) }
+ (cid:100) log( (cid:98) m 2 (cid:99) )
(cid:101) +1 and max { k (cid:98) m 2 (cid:99) +1 , . . .
, k m } + (cid:100) log( (cid:100) m 2 (cid:101) )
(cid:101) +1 respectively, and sizes at most s 1 + . . .
s (cid:98) m 2 (cid:99) +4(2 (cid:98) m 2 (cid:99)− 1) and s (cid:98) m 2 (cid:99) +
+ . . .
+ s m +4(2 (cid:98) m 2 (cid:99)− 1) , respectively.
Therefore, the function G : R n → R 2 given by G ( x ) =
( g 1 ( x ) , g 2 ( x )) can be implemented by a
ReLU DNN with depth at most max { k 1 , . . .
, k m } + (cid:100) log( (cid:100) m 2 (cid:101) ) (cid:101) + 1 and size at most s 1 + . . .
+ s m + 4(2 m − 2) .
We now show how to represent the function T : R 2 → R deﬁned as T ( x, y )
=
max { x, y } = x
+ y 2 + | x − y |by a 2-layer ReLU DNN with size 4 – see Figure 3.
The result now follows from the fact that f = T ◦ G and Lemma D.1.
[Figure]
[Figure]
Lemma D.4.
Any afﬁne transformation T : R n → R m is representable by a 2-layer ReLU DNN of size 2 m .
Proof.
Simply use the fact that T =
( I ◦ σ ◦ T )
+ ( − I ◦ σ ◦ ( − T )) , and the right hand side can be represented by a 2-layer ReLU DNN of size
m using Lemma D.2.
Lemma D.5.
Let f : R → R be a function represented by a R → R ReLU DNN with depth k + 1 and widths w 1 , . . .
, w k of the k hidden layers.
Then f is a PWL function with at most 2 k − 1 · ( w 1 + 1) · w 2 · . . .
· w k pieces.
Proof.
We prove this by induction on k .
The base case is k = 1 , i.e, we have a 2-layer ReLU DNN.
Since every activation node can produce at most one breakpoint in the piecewise linear function, we can get at most w 1 breakpoints, i.e., w 1 + 1 pieces.
Now for the induction step, assume that for some k ≥ 1 , any R → R ReLU DNN with depth k +and widths w 1 , . . .
, w k of the k hidden layers produces at most 2 k − 1 · ( w 1 + 1) · w 2 · . . .
· w k pieces.
Consider any R → R ReLU DNN with depth k + 2 and widths w 1 , . .
w k +1 of the k + 1 hidden layers.
Observe that the input to any node in the last layer is the output of a R → R ReLU DNN with depth k + 1 and widths w 1 , . . .
, w k .
By the induction hypothesis, the input to this node in the last layer is a piecewise linear function f with at most 2 k − 1 · ( w 1 +1) · w 2 · . . .
· w k pieces.
When we apply the activation, the new function g ( x ) = max { 0 , f ( x ) } , which is the output of this node, may have at most twice the number of pieces as f , because each original piece may be intersected by the x -axis; see Figure 4.
Thus, after going through the layer, we take an afﬁne combination of w k + functions, each with at most 2 · (2 k − 1 · ( w 1 + 1) · w 2 · . . .
· w k ) pieces.
In all, we can therefore get at most· (2 k − 1 · ( w 1 +1) · w 2 · . . .
· w k ) · w k +1 pieces, which is equal to 2 k · ( w 1 +1) · w 2 · . . .
· w k · w k +1 , and the induction step is completed.
Lemma D.5 has the following consequence about the depth and size tradeoffs for expressing functions with agiven number of pieces.
Lemma D.6.
Let f : R → R be a piecewise linear function with p pieces.
If f is represented by a
ReLU DNN with depth k + 1 , then it must have size at least 12 kp 1 /k − 1 .
Conversely, any piecewise linear function f that represented by a ReLU DNN of depth k + 1 and size at most s , can have at most ( 2 sk ) k pieces.
Proof.
Let widths of the k hidden layers be w 1 , . . .
, w k .
By Lemma D.5, we must have
[Equation]
By the AM-GM inequality, minimizing the size w 1 + w 2 + . . .
+ w k subject to (D.1), means setting w 1 + 1 = w 2 = . . .
= w k .
This implies that w 1 + 1 = w 2 = . . .
=
w k ≥ 12 p 1 /k .
The ﬁrst statement
AM-GM inequality w k .