Why Deep Neural Networks for Function Approximation?
Shiyu Liang, R. Srikant
Introduction
Neural networks have drawn significant interest from the machine learning community, especially due to their recent empirical successes (see the surveys (Bengio, 2009)). Neural networks are used to build state-of-art systems in various applications such as image recognition, speech recognition, natural language process and others (see, Krizhevsky et al. 2012; Goodfellow et al. 2013; Wan et al. 2013, for example). The result that neural networks are universal approximators is one of the theoretical results most frequently cited to justify the use of neural networks in these applications. Numerous results have shown the universal approximation property of neural networks in approximations of different function classes, (see, e.g., Cybenko 1989; Hornik et al. 1989; Funahashi 1989; Hornik 1991; Chui & Li 1992; Barron 1993; Poggio et al. 2015).
All these results and many others provide upper bounds on the network size and assert that small approximation error can be achieved if the network size is sufficiently large. More recently, there has been much interest in understanding the approximation capabilities of deep versus shallow networks. Delalleau & Bengio (2011) have shown that there exist deep sum-product networks which cannot be approximated by shallow sum-product networks unless they use an exponentially larger amount of units or neurons. Montufar et al. (2014) have shown that the number of linear region increases exponentially with the number of layers in the neural network. Telgarsky (2016) has established such a result for neural networks, which is the subject of this paper. Eldan & Shamir (2015) have shown that, to approximate a specific function, a two-layer network requires an exponential number of neurons in the input dimension, while a three-layer network requires a polynomial number of neurons. These recent papers demonstrate the power of deep networks by showing that depth can lead to an exponential reduction in the number of neurons required, for specific functions or specific neural networks. Our goal here is different: we are interested in function approximation specifically and would like to show that for a given upper bound on the approximation error, shallow networks require exponentially more neurons than deep networks for a large class of functions.
The multilayer neural networks considered in this paper are allowed to use either rectifier linear units (ReLU) or binary step units (BSU), or any combination of the two. The main contributions of this paper are
We have shown that, for -approximation of functions with enough piecewise smoothness, a multilayer neural network which uses layers only needs neurons, while neurons are required by neural networks with layers. In other words, shallow networks require exponentially more neurons than a deep network to achieve the level of accuracy for function approximation.
We have shown that for all differentiable and strongly convex functions, multilayer neural networks need neurons to achieve an -approximation. Thus, our results for deep networks are tight.
The outline of this paper is as follows. In Section 2, we present necessary definitions and the problem statement. In Section 3, we present upper bounds on network size, while the lower bound is provided in Section 4. Conclusions are presented in Section 5. Around the same time that our paper was uploaded in arxiv, a similar paper was also uploaded in arXiv by Yarotsky (2016). The results in the two papers are similar in spirit, but the details and the general approach are substantially different.
Preliminaries and problem statement
In this section, we present definitions on feedforward neural networks and formally present the problem statement.
Here, denotes the activation function and denotes the index set . In this paper, we only consider two important types of activation functions:
We call the number of layers and the number of neurons in the network as the depth and the size of the feedforward neural network, respectively. We use the set to denote the function set containing all feedforward neural networks of depth , size and composed of a combination of rectifier linear units (ReLUs) and binary step units. We say one feedforward neural network is deeper than the other network if and only if it has a larger depth. Through this paper, the terms feedforward neural network and multilayer neural network are used interchangeably.
2 Problem Statement
Specifically, we aim to answer the following questions:
Does there exists and such that (1) is satisfied? We will refer to such and as upper bounds on the depth and size of the required neural network.
Given a fixed depth , what is the minimum value of such that (1) is satisfied? We will refer to such an as a lower bound on the size of a neural network of a given depth .
The first question asks what depth and size are sufficient to guarantee an -approximation. The second question asks, for a fixed depth, what is the minimum size of a neural network required to guarantee an -approximation. Obviously, tight bounds in the answers to these two questions provide tight bounds on the network size and depth required for function approximation. Besides, solutions to these two questions together can be further used to answer the following question. If a deeper neural network of size and a shallower neural network of size are used to approximate the same function with the same error, then how fast does the ratio decay to zero as the error decays to zero?
Upper bounds on function approximations
In this section, we present upper bounds on the size of the multilayer neural network which are sufficient for function approximation. Before stating the results, some notations and terminology deserve further explanation. First, the upper bound on the network size represents the number of neurons required at most for approximating a given function with a certain error. Secondly, the notion of the approximation is the distance: for two functions and , the distance between these two function is the maximum point-wise disagreement over the cube .
In this subsection, we present all results on approximating univariate functions. We first present a theorem on the size of the network for approximating a simple quadratic function. As part of the proof, we present the structure of the multilayer feedforward neural network used and show how the neural network parameters are chosen. Results on approximating general functions can be found in Theorem 2 and 4.
The proof is composed of three parts. For any , we first use the multilayer neural network to approximate by its finite binary expansion . We then construct a 2-layer neural network to implement function .
For each , can be denoted by its binary expansion where for all . It is straightforward to see that the -layer neural network shown in Figure 1 can be used to find .
Finally, we consider the approximation error of this multilayer neural network,
Therefore, in order to achieve -approximation error, one should choose . In summary, the deep neural network has layers, binary step units and rectifier linear units. ∎
Next, a theorem on the size of the network for approximating general polynomials is given as follows.
The proof is composed of three parts. We first use the deep structure shown in Figure 1 to find the -bit binary expansion of . Then we construct a multilayer network to approximate polynomials , . Finally, we analyze the approximation error.
Using the same deep structure shown in Figure 1, we could find the binary expansion sequence . In this step, we used binary steps units in total. Now we rewrite ,
Clearly, the equation (2) defines iterations between the outputs of neighbor layers. Therefore, the deep neural network shown in Figure 2 can be used to implement the iteration given by (2). Further, to implement this network, one should use layers with rectifier linear units in total.
This indicates, to achieve -approximation error, one should choose . Besides, since we used layers with binary step units and rectifier linear units in total, this multilayer neural network thus has layers, binary step units and rectifier linear units. ∎
In Theorem 2, we have shown an upper bound on the size of multilayer neural network for approximating polynomials. We can easily observe that the number of neurons in network grows as with respect to , the degree of the polynomial. We note that both Andoni et al. (2014) and Barron (1993) showed the sizes of the networks grow exponentially with respect to if only 3-layer neural networks are allowed to be used in approximating polynomials.
Besides, every function with continuous derivatives on a bounded set can be approximated easily with a polynomial with degree . This is shown by the following well known result of Lagrangian interpolation. By this result, we could further generalize Theorem 2. The proof can be found in the reference (Gil et al., 2007).
If a function is defined at points , , , there exists a polynomial of degree not more than such that , This polynomial is given by where and Additionally, if is continuous on $n+1(-1,1)$, then
where is the derivative of of the th order and the norm is the norm .
Then the upper bound on the network size for approximating more general functions follows directly from Theorem 2 and Lemma 3.
Let . From Lemma 3, it follows that there exists polynomial of degree such that for any ,
Remark: Note that, to implement the architecture in Figure 2 using the definition of a feedforward neural network in Section 2, we need the , at the output. This can be accomplished by using additional ReLUs. Since , this doesn’t change the order result in Theorem 4.
Theorem 4 shows that any function with enough smoothness can be approximated by a multilayer neural network containing polylog neurons with error. Further, Theorem 4 can be used to show that for functions ,…, with enough smoothness, then linear combinations, multiplications and compositions of these functions can as well be approximated by multilayer neural networks containing polylog neurons with error. Specific results are given in the following corollaries.
Remark: Clearly, Corollary 5 follows directly from the fact that the linear combination satisfies the conditions in Theorem 4 if all the functions ,…, satisfy those conditions. We note here that the upper bound on the network size for approximating linear combinations is independent of , the number of component functions.
Remark: Proofs of Corollary 6 and 7 can be found in the appendix. We observe that different from the case of linear combinations, the upper bound on the network size grows as in the case of function multiplications and grows as in the case of function compositions where is the number of component functions.
In this subsection, we have shown a poly upper bound on the network size for -approximation of both univariate polynomials and general univariate functions with enough smoothness. Besides, we have shown that linear combinations, multiplications and compositions of univariate functions with enough smoothness can as well be approximated with error by a multilayer neural network of size poly. In the next subsection, we will show the upper bound on the network size for approximating multivariate functions.
2 Approximation of multivariate functions
In this subsection, we present all results on approximating multivariate functions. We first present a theorem on the upper bound on the neural network size for approximating a product of multivariate linear functions. We next present a theorem on the upper bound on the neural network size for approximating general multivariate polynomial functions. Finally, similar to the results in the univariate case, we present the upper bound on the neural network size for approximating the linear combination, the multiplication and the composition of multivariate functions with enough smoothness.
Theorem 8 shows an upper bound on the network size for -approximation of a product of multivariate linear functions. Furthermore, since any general multivariate polynomial can be viewed as a linear combination of products, the result on general multivariate polynomials directly follows from Theorem 8.
Remark: The proof is given in the appendix. By further analyzing the results on the network size, we obtain the following results: (a) fixing degree , as and (b) fixing input dimension , as . Similar results on approximating multivariate polynomials were obtained by Andoni et al. (2014) and Barron (1993). Barron (1993) showed that on can use a 3-layer neural network to approximate any multivariate polynomial with degree , dimension and network size . Andoni et al. (2014) showed that one could use the gradient descent to train a 3-layer neural network of size to approximate any multivariate polynomial. However, Theorem 9 shows that the deep neural network could reduce the network size from to for the same error. Besides, for a fixed input dimension , the size of the 3-layer neural network used by Andoni et al. (2014) and Barron (1993) grows exponentially with respect to the degree . However, the size of the deep neural network shown in Theorem 9 grows only polynomially with respect to the degree. Therefore, the deep neural network could reduce the network size from to when the degree becomes large.
Theorem 9 shows an upper bound on the network size for approximating multivariate polynomials. Further, by combining Theorem 4 and Corollary 7, we could obtain an upper bound on the network size for approximating more general functions. The results are shown in the following corollary.
Remark: Corollary 10 shows an upper bound on network size for approximating compositions of multivariate polynomials and general univariate functions. The upper bound can be loose due to the assumption that is a general multivariate polynomials of degree . For some specific cases, the upper bound can be much smaller. We present two specific examples in the Appendix H and I.
In this subsection, we have shown that a similar poly upper bound on the network size for -approximation of general multivariate polynomials and functions which are compositions of univariate functions and multivariate polynomials.
The results in this section can be used to find a multilayer neural network of size polylog which provides an approximation error of at most . In the next section, we will present lower bounds on the network size for approximating both univariate and multivariate functions. The lower bound together with the upper bound shows a tight bound on the network size required for function approximations.
While we have presented results in both the univariate and multivariate cases for smooth functions, the results automatically extend to functions that are piecewise smooth, with a finite number of pieces. In other words, if the domain of the function is partitioned into regions, and the function is sufficiently smooth (in the sense described in the Theorems and Corollaries earlier) in each of the regions, then the results essentially remain unchanged except for an additional factor which will depend on the number of regions in the domain.
Lower bounds on function approximations
In this section, we present lower bounds on the network size in function for certain classes of functions. Next, by combining the lower bounds and the upper bounds shown in the previous section, we could analytically show the advantages of deeper neural networks over shallower ones. The theorem below is inspired by a similar result (DasGupta & Schnitger, 1993) for univariate quadratic functions, where it is stated without a proof. Here we show that the result extends to general multivariate strongly convex functions.
Remark: The proof is in the Appendix F. Theorem 11 shows that every strongly convex function cannot be approximated with error by any multilayer neural network with rectifier linear units and binary step units and of size smaller than . Theorem 11 together with Theorem 1 directly shows that to approximate quadratic function with error , the network size should be of order . Further, by combining Theorem 11 and Theorem 4, we could analytically show the benefits of deeper neural networks. The result is given in the following corollary.
Remarks: (i) The strong convexity requirement can be relaxed: the result obviously holds if the function is strongly concave and it also holds if the function consists of pieces which are strongly convex or strongly concave. (ii) Corollary 12 shows that in the approximation of the same function, the size of the deep neural network is only of polynomially logarithmic order of the size of the shallow neural network , i.e., . Similar results can be obtained for multivariate functions on the type considered in Section 3.2.
Conclusions
In this paper, we have shown that an exponentially large number of neurons are needed for function approximation using shallow networks, when compared to deep networks. The results are established for a large class of smooth univariate and multivariate functions. Our results are established for the case of feedforward neural networks with ReLUs and binary step units.
The research reported here was supported by NSF Grants CIF 14-09106, ECCS 16-09370, and ARO Grant W911NF-16-1-0259.
References
Appendix A Proof of Corollary 5
Then the approximation error is upper bounded by
Appendix B Proof of Corollary 6
Since , then the derivative of of order is
By the assumption that holds for , then we have
Then from Theorem 4, it follows that there exists a polynomial of degree that
Further, function is monotonically increasing on and
Therefore, to suffice the inequality (3), one should should choose
Since by assumptions, then there exists a polynomial of degree such that
Let denote the binary expansion of and let
Appendix C Proof of Corollary 7
Further we assume the derivative of has an upper bound Then for , since can be rewritten as
In addition, the derivative of can be upper bounded by
From iterations (4) and (5), we could have for ,
From the iteration (6), we have for ,
Therefore, to approximate , we need at most layers, binary step units and rectifier linear units.
Appendix D Proof of Theorem 8
The proof is composed of two parts. As before, we first use the deep structure shown in Figure 1 to find the binary expansion of and next use a multilayer neural network to approximate the polynomial.
In the rest of proof, we consider the approximation error. Since for and ,
By choosing , we have
Since we use binary step units to convert the input to binary form and neurons in function approximation, we thus use binary step units and rectifier linear units in total. In addition, since we have used layers to convert the input to binary form and layers in the function approximation section of the network, the whole deep structure has layers. ∎
Appendix E Proof of Theorem 9
Since the total number of multinomial is upper bounded by
the size of deep neural network is thus upper bounded by
If the dimension of the input is fixed, then (8) is has the order of
while if the degree is fixed, then (8) is has the order of
Appendix F Proof of Theorem 11
Now we calculate the lower bound on . We first define 4 points , , and , . We assume
Further, Telgarsky (2016) has shown that the maximum number of break points that a multilayer neural network of depth and size could have is . Thus, and should satisfy
Besides, let . Since each layer in network should have at least 2 neurons, i.e., , then
Now we consider the multivariate case . Assume input vector to be . We now fix and define two univariate functions
Remark: We make the following remarks about the lower bound in the theorem.
if the depth is fixed, as in shallow networks, the number of neurons required is .
if we are allowed to choose optimally to minimize the lower bound, we will choose and thus the lower bound will become , closed to the upper bound shown in Theorem 4.
Appendix G Proof of Corollary 12
Substituting for from (12) to (11), we have
By definition, a shallow neural network has a small number of layers, i.e., . Thus, the size of the deep neural network is . This means . ∎
Appendix H Proof of Corollary 13
Besides, from Theorem 4, it follows that there exists a deep neural network with layers binary step units and such that
By inequalities (13) and (14), the the approximation error is upper bounded by
Now the deep neural network has layers, binary step units and rectifier linear units.