Error bounds for approximations with deep ReLU networks
Dmitry Yarotsky
Introduction
Recently, multiple successful applications of deep neural networks to pattern recognition problems (Schmidhuber , LeCun et al. ) have revived active interest in theoretical properties of such networks, in particular their expressive power. It has been argued that deep networks may be more expressive than shallow ones of comparable size (see, e.g., Delalleau and Bengio , Raghu et al. , Montufar et al. , Bianchini and Scarselli , Telgarsky ). In contrast to a shallow network, a deep one can be viewed as a long sequence of non-commutative transformations, which is a natural setting for high expressiveness (cf. the well-known Solovay-Kitaev theorem on fast approximation of arbitrary quantum operations by sequences of non-commutative gates, see Kitaev et al. , Dawson and Nielsen ).
There are various ways to characterize expressive power of networks. Delalleau and Bengio 2011 consider sum-product networks and prove for certain classes of polynomials that they are much more easily represented by deep networks than by shallow networks. Montufar et al. 2014 estimate the number of linear regions in the network’s landscape. Bianchini and Scarselli 2014 give bounds for Betti numbers characterizing topological properties of functions represented by networks. Telgarsky 2015, 2016 provides specific examples of classification problems where deep networks are provably more efficient than shallow ones.
In the context of classification problems, a general and standard approach to characterizing expressiveness is based on the notion of the Vapnik-Chervonenkis dimension (Vapnik and Chervonenkis ). There exist several bounds for VC-dimension of deep networks with piece-wise polynomial activation functions that go back to geometric techniques of Goldberg and Jerrum 1995 and earlier results of Warren 1968; see Bartlett et al. , Sakurai and the book Anthony and Bartlett . There is a related concept, the fat-shattering dimension, for real-valued approximation problems (Kearns and Schapire , Anthony and Bartlett ).
A very general approach to expressiveness in the context of approximation is the method of nonlinear widths by DeVore et al. 1989 that concerns approximation of a family of functions under assumption of a continuous dependence of the model on the approximated function.
In this paper we examine the problem of shallow-vs-deep expressiveness from the perspective of approximation theory and general spaces of functions having derivatives up to certain order (Sobolev-type spaces). In this framework, the problem of expressiveness is very well studied in the case of shallow networks with a single hidden layer, where it is known, in particular, that to approximate a -function on a -dimensional set with infinitesimal error one needs a network of size about , assuming a smooth activation function (see, e.g., Mhaskar , Pinkus for a number of related rigorous upper and lower bounds and further qualifications of this result). Much less seems to be known about deep networks in this setting, though Mhaskar et al. 2016, 2016 have recently introduced functional spaces constructed using deep dependency graphs and obtained expressiveness bounds for related deep networks.
We will focus our attention on networks with the ReLU activation function , which, despite its utter simplicity, seems to be the most popular choice in practical applications LeCun et al. . We will consider -error of approximation of functions belonging to the Sobolev spaces (without any assumptions of hierarchical structure). We will often consider families of approximations, as the approximated function runs over the unit ball in . In such cases we will distinguish scenarios of fixed and adaptive network architectures. Our goal is to obtain lower and upper bounds on the expressiveness of deep and shallow networks in different scenarios. We measure complexity of networks in a conventional way, by counting the number of their weights and computation units (cf. Anthony and Bartlett ).
The main body of the paper consists of Sections 2, 3 and 4.
In Section 2 we describe our ReLU network model and show that the ReLU function is replaceable by any other continuous piece-wise linear activation function, up to constant factors in complexity asymptotics (Proposition 1).
In Section 3 we establish several upper bounds on the complexity of approximating by ReLU networks, in particular showing that deep networks are quite efficient for approximating smooth functions. Specifically:
In Subsection 3.1 we show that the function can be -approximated by a network of depth and complexity (Proposition 2). This also leads to similar upper bounds on the depth and complexity that are sufficient to implement an approximate multiplication in a ReLU network (Proposition 3).
In Subsection 3.2 we describe a ReLU network architecture of depth and complexity that is capable of approximating with error any function from (Theorem 1).
In Subsection 3.3 we show that, even with fixed-depth networks, one can further decrease the approximation complexity if the network architecture is allowed to depend on the approximated function. Specifically, we prove that one can -approximate a given Lipschitz function on the segment $O(\frac{1}{\epsilon\ln(1/\epsilon)})$ connections and activation units (Theorem 2). This upper bound is of interest since it lies below the lower bound provided by the method of nonlinear widths under assumption of continuous model selection (see Subsection 4.1).
In Section 4 we obtain several lower bounds on the complexity of approximation by deep and shallow ReLU networks, using different approaches and assumptions.
In Subsection 4.1 we recall the general lower bound provided by the method of continuous nonlinear widths. This method assumes that parameters of the approximation continuously depend on the approximated function, but does not assume anything about how the approximation depends on its parameters. In this setup, at least connections and weights are required for an -approximation on (Theorem 3). As already mentioned, for this lower bound is above the upper bound provided by Theorem 2.
In Subsection 4.2 we consider the setup where the same network architecture is used to approximate all functions in , but the weights are not assumed to continuously depend on the function. In this case, application of existing results on VC-dimension of deep piece-wise polynomial networks yields a lower bound in general and a lower bound if the network depth grows as (Theorem 4).
In Subsection 4.3 we consider an individual approximation, without any assumptions regarding it as an element of a family as in Subsections 4.1 and 4.2. We prove that for any there exists a function in such that its approximation complexity is not as (Theorem 5).
In Subsection 4.4 we prove that -approximation of any nonlinear -function by a network of fixed depth requires at least computation units (Theorem 6). By comparison with Theorem 1, this shows that for sufficiently smooth functions approximation by fixed-depth ReLU networks is less efficient than by unbounded-depth networks.
In Section 5 we discuss the obtained bounds and summarize their implications, in particular comparing deep vs. shallow networks and fixed vs. adaptive architectures.
The arXiv preprint of the first version of the present work appeared almost simultaneously with the work of Liang and Srikant Liang and Srikant containing results partly overlapping with our results in Subsections 3.1,3.2 and 4.4. Liang and Srikant consider networks equipped with both ReLU and threshold activation functions. They prove a logarithmic upper bound for the complexity of approximating the function , which is analogous to our Proposition 2. Then, they extend this upper bound to polynomials and smooth functions. In contrast to our treatment of generic smooth functions based on standard Sobolev spaces, they impose more complex assumptions on the function (including, in particular, how many derivatives it has) that depend on the required approximation accuracy . As a consequence, they obtain strong complexity bounds rather different from our bound in Theorem 1 (in fact, our lower bound proved in Theorem 5 rules out, in general, such strong upper bounds for functions having only finitely many derivatives). Also, Liang and Srikant prove a lower bound for the complexity of approximating convex functions by shallow networks. Our version of this result, given in Subsection 4.4, is different in that we assume smoothness and nonlinearity instead of global convexity.
The ReLU network model
Throughout the paper, we consider feedforward neural networks with the ReLU (Rectified Linear Unit) activation function
The network consists of several input units, one output unit, and a number of “hidden” computation units. Each hidden unit performs an operation of the form
with some weights (adjustable parameters) and depending on the unit. The output unit is also a computation unit, but without the nonlinearity, i.e., it computes . The units are grouped in layers, and the inputs of a computation unit in a certain layer are outputs of some units belonging to any of the preceding layers (see Fig. 1). Note that we allow connections between units in non-neighboring layers. Occasionally, when this cannot cause confusion, we may denote the network and the function it implements by the same symbol.
The depth of the network, the number of units and the total number of weights are standard measures of network complexity (Anthony and Bartlett ). We will use these measures throughout the paper. The number of weights is, clearly, the sum of the total number of connections and the number of computation units. We identify the depth with the number of layers (in particular, the most common type of neural networks – shallow networks having a single hidden layer – are depth-3 networks according to this convention).
We finish this subsection with a proposition showing that, given our complexity measures, using the ReLU activation function is not much different from using any other piece-wise linear activation function with finitely many breakpoints: one can replace one network by an equivalent one but having another activation function while only increasing the number of units and weights by constant factors. This justifies our restricted attention to the ReLU networks (which could otherwise have been perceived as an excessively particular example of networks).
Let be a network with the activation function , having depth , weights and computation units. Then there exists a ReLU network that has depth , not more than weights and not more than units, and that computes the same function as .
a) Let be the breakpoints of , i.e., the points where its derivative is discontinuous: . We can then express via the ReLU function , as a linear combination
with appropriately chosen coefficients and . It follows that computation performed by a single -unit,
can be equivalently represented by a linear combination of a constant function and computations of -units,
(here is the index of a -unit). We can then replace one-by-one all the -units in the network by -units, without changing the output of the network. Obviously, these replacements do not change the network depth. Since each hidden unit gets replaced by new units, the number of units in the new network is not greater than times their number in the original network. Note also that the number of connections in the network is multiplied, at most, by . Indeed, each unit replacement entails replacing each of the incoming and outgoing connections of this unit by new connections, and each connection is replaced twice: as an incoming and as an outgoing one. These considerations imply the claimed complexity bounds for the resulting -network .
b) Let be any breakpoint of , so that . Let be the distance separating from the nearest other breakpoint, so that is linear on and on (if has only one node, any will do). Then, for any , we can express the ReLU function via in the -neighborhood of 0:
It follows that a computation performed by a single -unit,
can be equivalently represented by a linear combination of a constant function and two -units,
holds. Since is a bounded set, we can choose at each unit of the initial network sufficiently large so as to satisfy condition (2) for all network inputs from . Then, like in a), we replace each -unit with two -units, which produces the desired -network. ∎
Upper bounds
Our first key result shows that ReLU networks with unconstrained depth can very efficiently approximate the function (more efficiently than any fixed-depth network, as we will see in Section 4.4). Our construction uses the “sawtooth” function that has previously appeared in the paper Telgarsky .
The function on the segment $\epsilon>0O(\ln(1/\epsilon))$.
Consider the “tooth” (or “mirror”) function
Telgarsky has shown (see Lemma 2.4 in Telgarsky ) that is a “sawtooth” function with uniformly distributed “teeth” (each application of doubles the number of teeth):
(see Fig. 2(a)). Our key observation now is that the function can be approximated by linear combinations of the functions . Namely, let be the piece-wise linear interpolation of with uniformly distributed breakpoints :
(see Fig. 2(b)). The function approximates with the error . Now note that refining the interpolation from to amounts to adjusting it by a function proportional to a sawtooth function:
Since can be implemented by a finite ReLU network (as g(x)=2\sigma(x)-4\sigma\big{(}x-\frac{1}{2}\big{)}+2\sigma(x-1)) and since construction of only involves linear operations and compositions of , we can implement by a ReLU network having depth and the number of weights and computation units all being (see Fig. 2(c)). This implies the claim of the proposition.
we can use Proposition 2 to efficiently implement accurate multiplication in a ReLU network. The implementation will depend on the required accuracy and the magnitude of the multiplied quantities.
for any inputs , if and then ;
if or , then ;
the depth and the number of weights and computation units in is not greater than with an absolute constant and a constant .
2 Fast deep approximation of general smooth functions
In order to formulate our general result, Theorem 1, we consider the Sobolev spaces with Recall that is defined as the space of functions on lying in along with their weak derivatives up to order . The norm in can be defined by
where , , and is the respective weak derivative. Here and in the sequel we denote vectors by boldface characters. The space can be equivalently described as consisting of the functions from such that all their derivatives of order are Lipschitz continuous.
Throughout the paper, we denote by the unit ball in :
Also, it will now be convenient to make a distinction between networks and network architectures: we define the latter as the former with unspecified weights. We say that a network architecture is capable of expressing any function from with error meaning that this can be achieved by some weight assignment.
For any and , there is a ReLU network architecture that
is capable of expressing any function from with error ;
has the depth at most and at most weights and computation units, with some constant .
The proof will consist of two steps. We start with approximating by a sum-product combination of local Taylor polynomials and one-dimensional piecewise-linear functions. After that, we will use results of the previous section to approximate by a neural network.
Let be a positive integer. Consider a partition of unity formed by a grid of functions on the domain :
Here and the function is defined as the product
For any , consider the degree- Taylor polynomial for the function at :
with the usual conventions and . Now define an approximation to by
We bound the approximation error using the Taylor expansion of :
Here in the second step we used the support property (7) and the bound (6), in the third the observation that any belongs to the support of at most functions , in the fourth a standard bound for the Taylor remainder, and in the fifth the property
(where is the ceiling function), then
Note that, by (8) the coefficients of the polynomials are uniformly bounded for all :
We have therefore reduced our task to the following: construct a network architecture capable of approximating with uniform error any function of the form (9), assuming that is given by (10) and the polynomials are of the form (12).
The expansion is a linear combination of not more than terms . Each of these terms is a product of at most piece-wise linear univariate factors: functions (see (5)) and at most linear expressions . We can implement an approximation of this product by a neural network with the help of Proposition 3. Specifically, let be the approximate multiplication from Proposition 3 for and some accuracy to be chosen later, and consider the approximation of the product obtained by the chained application of :
that Using statement c) of Proposition 3, we see can be implemented by a ReLU network with the depth and the number of weights and computation units not larger than for some constant .
Now we estimate the error of this approximation. Note that we have and for all and all . By statement a) of Proposition 3, if and , then . Repeatedly applying this observation to all approximate multiplications in (14) while assuming , we see that the arguments of all these multiplications are bounded by our (equal to ) and the statement a) of Proposition 3 holds for each of them. We then have
Moreover, by statement b) of Proposition 3,
We estimate the approximation error of :
where in the first step we use expansion (13), in the second the identity (16), in the third the bound and the fact that for at most functions and in the fourth the bound (15). It follows that if we choose
then and hence, by (11),
On the other hand, note that by (17), can be implemented by a network consisting of parallel subnetworks that compute each of ; the final output is obtained by weighting the outputs of the subnetworks with the weights . The architecture of the full network does not depend on ; only the weights do. As already shown, each of these subnetworks has not more than layers, weights and computation units, with some constant . There are not more than such subnetworks. Therefore, the full network for has not more than layers and weights and computation units. With given by (18) and given by (10), we obtain the claimed complexity bounds. ∎
3 Faster approximations using adaptive network architectures
Theorem 1 provides an upper bound for the approximation complexity in the case when the same network architecture is used to approximate all functions in . We can consider an alternative, “adaptive architecture” scenario where not only the weights, but also the architecture is adjusted to the approximated function. We expect, of course, that this would decrease the complexity of the resulting architectures, in general (at the price of needing to find the appropriate architecture). In this section we show that we can indeed obtain better upper bounds in this scenario.
For simplicity, we will only consider the case . Then, is the space of Lipschitz functions on the segment $F_{1,1}f\|f\|_{\infty}O(\frac{\ln(1/\epsilon)}{\epsilon})O(\frac{1}{\epsilon})$ obtained simply by piece-wise interpolation.
Namely, given and , set and let be the piece-wise interpolation of with uniformly spaced breakpoints (i.e., ). The function is also Lipschitz with constant 1 and hence (since for any we can find such that and then ). At the same time, the function can be expressed in terms of the ReLU function by
with some coefficients and . This expression can be viewed as a special case of the depth-3 ReLU network with weights and computation units.
We show now how the bound can be improved by using adaptive architectures.
For any and , there exists a depth-6 ReLU network (with architecture depending on ) that provides an -approximation of while having not more than weights, connections and computation units. Here is an absolute constant.
We first explain the idea of the proof. We start with interpolating by a piece-wise linear function, but not on the length scale – instead, we do it on a coarser length scale , with some . We then create a “cache” of auxiliary subnetworks that we use to fill in the details and go down to the scale , in each of the -subintervals. This allows us to reduce the amount of computations for small because the complexity of the cache only depends on . The assignment of cached subnetworks to the subintervals is encoded in the network architecture and depends on the function . We optimize by balancing the complexity of the cache with that of the initial coarse approximation. This leads to and hence to the reduction of the total complexity of the network by a factor compared to the simple piece-wise linear approximation on the scale . This construction is inspired by a similar argument used to prove the upper bound for the complexity of Boolean circuits implementing -ary functions Shannon .
The proof becomes simpler if, in addition to the ReLU function , we are allowed to use the activation function
in our neural network. Since is discontinuous, we cannot just use Proposition 1 to replace -units by -units. We will first prove the analog of the claimed result for the model including -units, and then we will show how to construct a purely ReLU nework.
For any and , there exists a depth-5 network including -units and -units, that provides an -approximation of while having not more than weights, where is an absolute constant.
Given , we will construct an approximation to in the form
Here, is the piece-wise linear interpolation of with the breakpoints , for some positive integer to be chosen later. Since is Lipschitz with constant 1, is also Lipschitz with constant 1. We will denote by the intervals between the breakpoints:
We will now construct as an approximation to the difference
Note that vanishes at the endpoints of the intervals :
and is Lipschitz with constant 2:
since and are Lipschitz with constant 1.
Note that the size of is not larger than .
Moreover, if is defined by (20), then, using (21), (22), on each interval the function can be approximated with error not larger than by a properly rescaled function . Namely, for each we can define the function by . Then it is Lipschitz with constant 2 and , so we can find such that
Note that the obtained assignment is not injective, in general ( will be much larger than ).
We can then define on the whole by
This approximates with error on :
and hence, by (20), for the full approximation we will also have
Note that the approximation has properties analogous to (21), (22):
in particular, is continuous on .
We will now rewrite in a different form interpretable as a computation by a neural network. Specifically, using our additional activation function given by (19), we can express as
Indeed, given , observe that all the terms in the inner sum vanish except for the one corresponding to the determined by the condition . For this particular we have . Since , we conclude that (28) agrees with (23).
Let us also expand over the basis of shifted ReLU functions:
Substituting this expansion in (28), we finally obtain
The first layer contains the single input unit .
The second layer contains units computing
The third layer contains units computing . This is equivalent to , because .
The fourth layer contains units computing
The final layer consists of a single output unit
Examining this network, we see that the total number of connections and units in it is and hence is . This also holds for the full network implementing , since the term requires even fewer layers, connections and units. The output units of the subnetworks for and can be merged into the output unit for , so the depth of the full network is the maximum of the depths of the networks implementing and , i.e., is 5 (see Fig. 4).
Now, given , take and Then, by (25), the approximation error , while , which implies the claimed complexity bound. ∎
We show now how to modify the constructed network so as to remove -units. We only need to modify the part of the network. We will show that for any we can replace with a function (defined below) that
obeys the following analog of approximation bound (24):
and is implementable by a depth-6 ReLU network having complexity with an absolute constant independent of .
Since can be taken arbitrarily small, the Theorem then follows by arguing as in Lemma 1, only with replaced by .
As a first step, we approximate by a continuous piece-wise linear function , with a small :
Let be defined as in (29), but with replaced by :
Since is a continuous piece-wise linear function with three breakpoints, we can express it via the ReLU function, and hence implement by a purely ReLU network, as in Proposition 1, and the complexity of the implementation does not depend on . However, replacing with affects the function on the intervals , introducing there a large error (of magnitude ). But recall that both and vanish at the points by (21), (26). We can then largely remove this newly introduced error by simply suppressing near the points .
Precisely, consider the continuous piece-wise linear function
and the full comb-like filtering function
Note that is continuous piece-wise linear with breakpoints, and . We then define our final modification of as
The function obeys the bound (30).
Given , let and be determined from the representation (i.e., is the relative position of in the respective interval ). Consider several possibilities for :
. In this case . Note that
because, by construction, , and by (26), (27). It follows that both terms in (31) vanish, i.e., . But, since is Lipschitz with constant 2 by (22) and , we have . This implies .
. In this case and . Using (32), we find that . It follows that .
. In this case . Since is Lipschitz with constant 1, . Both and are Lipschitz with constant 2 (by (22), (27)) and vanish at and (by (21), (26)). It follows that
It remains to verify the complexity property b) of the function . As already mentioned, can be implemented by a depth-5 purely ReLU network with not more than weights, connections and computation units, where is an absolute constant independent of . The function can be implemented by a shallow, depth-3 network with units and connection. Then, computation of can be implemented by a network including two subnetworks for computing and , and an additional layer containing two -units as written in (31). We thus obtain 6 layers in the resulting full network and, choosing and in the same way as in Lemma 1, obtain the bound for the number of its connections, weights, and computation units. ∎
Lower bounds
The method of continuous nonlinear widths (DeVore et al. ) is a very general approach to the analysis of parameterized nonlinear approximations, based on the assumption of continuous selection of their parameters. We are interested in the following lower bound for the complexity of approximations in
The hypothesis of continuous weight selection is crucial in Theorem 3. By examining our proof of the counterpart upper bound in Theorem 1, the weights are selected there in a continuous manner, so this upper bound asymptotically lies above in agreement with Theorem 3. We remark, however, that the optimal choice of the network weights (minimizing the error) is known to be discontinuous in general, even for shallow networks (Kainen et al. ).
We also compare the bounds of Theorems 3 and 2. In the case , Theorem 3 provides a lower bound for the number of weights and connections. On the other hand, in the adaptive architecture scenario, Theorem 2 provides the upper bound for the number of weights, connections and computation units. The fact that this latter bound is asymptotically below the bound of Theorem 3 reflects the extra expressiveness associated with variable network architecture.
2 Bounds based on VC-dimension
In this section we consider the setup where the same network architecture is used to approximate all functions , but the dependence of the weights on is not assumed to be necessarily continuous. In this setup, some lower bounds on the network complexity can be obtained as a consequence of existing upper bounds on VC-dimension of networks with piece-wise polynomial activation functions and Boolean outputs (Anthony and Bartlett ). In the next theorem, part a) is a more general but weaker bound, while part b) is a stronger bound assuming a constrained growth of the network depth.
For any , a ReLU network architecture capable of approximating any function with error must have at least weights, with some constant .
Let be some constants. For any , if a ReLU network architecture of depth is capable of approximating any function with error , then the network must have at least weights, with some constant .The author thanks Matus Telgarsky for suggesting this part of the theorem.
where is the number of weights, is the network depth, and is an absolute constant.
Let us obtain a condition ensuring that such . For any multi-index ,
with the constant , then .
Suppose that there is a ReLU network architecture that can approximate, by adjusting its weights, any with error less than . Denote by the output of the network for the input vector and the vector of weights .
Consider any assignment of Boolean values . Set
and let be given by (35) (see Fig. 5); then (36) holds and hence .
By assumption, there is then a vector of weights, , such that for all we have and in particular
Since the Boolean values were arbitrary, we conclude that the subset is shattered and hence
Expressing through with (37), we obtain
To establish part a) of the Theorem, we apply bound (33) to the network :
where is the number of weights in , which is the same as in if we do not count the threshold parameter. Combining (38) with (39), we obtain the desired lower bound with .
To establish part b) of the Theorem, we use bound (34) and the hypothesis :
Trying a of the form with a constant , we get
Comparing this with (41), we see that if we choose , then for sufficiently small we have and hence , as claimed. We can ensure that for all by further decreasing . ∎
We remark that the constrained depth hypothesis of part b) is satisfied, with , by the architecture used for the upper bound in Theorem 1. The bound stated in part b) of Theorem 4 matches the upper bound of Theorem 1 and the lower bound of Theorem 3 up to a power of .
3 Adaptive network architectures
Our goal in this section is to obtain a lower bound for the approximation complexity in the scenario where the network architecture may depend on the approximated function. This lower bound is thus a counterpart to the upper bound of Section 3.3.
To state this result we define the complexity of approximating the function with error as the minimal number of hidden computation units in a ReLU network that provides such an approximation.
For any , there exists such that is not as .
Fix . For any sufficiently small there exists such that , with some constant .
Observe that all the networks with not more than hidden computation units can be embedded in the single “enveloping” network that has hidden layers, each consisting of units, and that includes all the connections between units not in the same layer (see Fig. 6(a)). The number of weights in this enveloping network is . On the other hand, Theorem 4a) states that at least weights are needed for an architecture capable of -approximating any function in . It follows that there is a function that cannot be -approximated by networks with fewer than computation units. ∎
Before proceeding to the proof of Theorem 5, note that is a monotone decreasing function of with a few obvious properties:
(follows by multiplying the weights of the output unit of the approximating network by a constant);
(follows by approximating by an approximation of );
(follows by combining approximating networks for and as in Fig. 6(b)).
The claim of Theorem 5 is similar to the claim of Lemma 3, but is about a single function satisfying a slightly weaker complexity bound at multiple values of . We will assume that Theorem 5 is false, i.e.,
for all and we will reach contradiction by presenting violating this assumption. Specifically, we construct this as
We determine sequentially. Suppose we have already found ; let us describe how we define .
so that the function defined by the series (46) will be in , because .
Next, using Lemma 3 and Eq. (42), observe that if is sufficiently small, then we can find such that
In addition, by assumption (45), if is small enough then
Let us choose and so that both (49) and (50) hold. Obviously, we can also make sure that as .
Let us check that the above choice of ensures that inequality (47) holds for all :
Here in the first step we use inequality (43), in the second the monotonicity of , in the third the monotonicity of and the setting (48), in the fourth the inequality (44), and in the fifth the conditions (49) and (50). ∎
4 Slow approximation of smooth functions by shallow networks
In this section we show that, in contrast to deep ReLU networks, shallow ReLU networks relatively inefficiently approximate sufficiently smooth () nonlinear functions. We remark that Liang and Srikant 2016 prove a similar result assuming global convexity instead of smoothness and nonlinearity.
Let be a nonlinear function (i.e., not of the form on the whole ). Then, for any fixed , a depth- ReLU network approximating with error must have at least weights and computation units, with some constant
Suppose that is an -approximation of function , and let be implemented by a ReLU network of depth . Let . Then also approximates with error not larger than . Moreover, since is obtained from by a linear substitution , can be implemented by a ReLU network of the same depth and with the number of units and weights not larger than in (we can obtain from by replacing the input layer in with a single unit, accordingly modifying the input connections, and adjusting the weights associated with these connections). It is thus sufficient to establish the claimed bounds for .
By construction, is a continuous piece-wise linear function of . Denote by the number of linear pieces in . We will use the following counting lemma.
, where is the number of computation units in .
This bound, up to minor details, is proved in Lemma 2.1 of Telgarsky . Precisely, Telgarsky’s lemma states that if a network has a single input, connections only between neighboring layers, at most units in a layer, and a piece-wise linear activation function with pieces, then the number of linear pieces in the output of the network is not greater than . By examining the proof of the lemma we see that it will remain valid for networks with connections not necessarily between neighboring layers, if we replace by in the expression . Moreover, we can slightly strengthen the bound by noting that in the present paper the input and output units are counted as separate layers, only units of layers 3 to have multiple incoming connections, and the activation function is applied only in layers 2 to . By following Telgarsky’s arguments, this gives the slightly more accurate bound (i.e., with the power instead of ). It remains to note that the ReLU activation function corresponds to . ∎
Lemma 4 implies that there is an interval of length not less than on which the function is linear. Let Then, by the approximation accuracy assumption, , while by (51) and by the linearity of on , It follows that and hence
which implies the claimed bound . Since there are at least as many weights as computation units in a network, a similar bound holds for the number of weights. ∎
Discussion
We discuss some implications of the obtained bounds.
Our results clearly show that deep ReLU networks more efficiently express smooth functions than shallow ReLU networks. By Theorem 1, functions from the Sobolev space can be -approximated by ReLU networks with depth and the number of computation units . In contrast, by Theorem 6, a nonlinear function from cannot be -approximated by a ReLU network of fixed depth with the number of units less than In particular, it follows that in terms of the required number of computation units, unbounded-depth approximations of functions from are asymptotically strictly more efficient than approximations with a fixed depth at least when
(assuming also , so that ). The efficiency of depth is even more pronounced for very smooth functions such as polynomials, which can be implemented by deep networks using only units (cf. Propositions 2 and 3 and the proof of Theorem 1). Liang and Srikant describe in Liang and Srikant some conditions on the approximated function (resembling conditions of local analyticity) under which complexity of deep -approximation is with a constant power .
Continuous model selection vs. function-dependent network architectures.
When approximating a function by a neural network, one can either view the network architecture as fixed and only tune the weights, or optimize the architecture as well. Moreover, when tuning the weights, one can either require them to continuously depend on the approximated function or not. We naturally expect that more freedom in the choice of the approximation should lead to higher expressiveness.
Our bounds confirm this expectation to a certain extent. Specifically, the complexity of -approximation of functions from the unit ball in is lower bounded by in the scenario with a fixed architecture and continuously selected weights (see Theorem 3). On the other hand, we show in Theorem 2 that this complexity is upper bounded by if we are allowed to adjust the network architecture. This bound is achieved by finite-depth (depth-6) ReLU networks using the idea of reused subnetworks familiar from the theory of Boolean circuits Shannon .
In the case of fixed architecture, we have not established any evidence of complexity improvement for unconstrained weight selection compared to continuous weight selection. We remark however that, already for approximations with depth-3 networks, the optimal weights are known to discontinuously depend, in general, on the approximated function (Kainen et al. ). On the other hand, part b) of Theorem 4 shows that if the network depth scales as , discontinuous weight selection cannot improve the continuous-case complexity more than by a factor being some power of .
Upper vs. lower complexity bounds.
We indicate the gaps between respective upper and lower bounds in the three scenarios mentioned above: fixed architectures with continuous selection of weights, fixed architectures with unconstrained selection of weights, or adaptive architectures.
For fixed architectures with continuous selection the lower bound is provided by Proposition 3, and the upper bound by Theorem 1, so these bounds are tight up to a factor .
In the case of fixed architecture but unconstrained selection, part b) of Theorem 4 gives a lower bound under assumption that the depth is constrained by . This is only different by a factor of from the upper bound of Theorem 1. Without this depth constraint we only have the significantly weaker bound (part a) of Theorem 4).
In the case of adaptive architectures, there is a big gap between our upper and lower bounds. The upper bound is given by Theorem 2 for . The lower bound, proved for general in Theorem 5, only states that there are for which the complexity is not .
ReLU vs. smooth activation functions.
A popular general-purpose method of approximation is shallow (depth-3) networks with smooth activation functions (e.g., logistic sigmoid). Upper and lower approximation complexity bounds for these networks (Mhaskar , Maiorov and Meir ) show that complexity scales as up to some factors. Comparing this with our bounds in Theorems 1,2,4, it appears that deep ReLU networks are roughly (up to factors) as expressive as shallow networks with smooth activation functions.
Conclusion.
We have established several upper and lower bounds for the expressive power of deep ReLU networks in the context of approximation in Sobolev spaces. We should note, however, that this setting may not quite reflect typical real world applications, which usually possess symmetries and hierarchical and other structural properties substantially narrowing the actually interesting classes of approximated functions (LeCun et al. ). Some recent publications introduce and study expressive power of deep networks in frameworks bridging this gap, in particular, graph-based hierarchical approximations are studied in Mhaskar et al. , Mhaskar and Poggio and convolutional arithmetic circuits in Cohen et al. . Theoretical analysis of expressiveness of deep networks taking into account such properties of real data seems to be an important and promising direction of future research.
Acknowledgments
The author thanks Matus Telgarsky and the anonymous referees for multiple helpful comments on the preliminary versions of the paper. The research was funded by Skolkovo Institute of Science and Technology.