Smooth Function Approximation by Deep Neural Networks with General Activation Functions

There has been a growing interest in expressivity of deep neural networks. However, most of the existing work about this topic focuses only on the specific activation function such as ReLU or sigmoid. In this paper, we investigate the approximation ability of deep neural networks with a broad class of activation functions. This class of activation functions includes most of frequently used activation functions. We derive the required depth, width and sparsity of a deep neural network to approximate any Hölder smooth function upto a given approximation error for the large class of activation functions. Based on our approximation error analysis, we derive the minimax optimality of the deep neural network estimators with the general activation functions in both regression and classification problems.


Introduction
Neural networks are learning machines motivated by the architecture of the human brain. Neural networks are comprised of multiple hidden layers, and each of the hidden layers has multiple hidden nodes which consist of an affine map of the outputs from the previous layer and a nonlinear map called an activation function. Deep neural networks have been leading tremendous success in various pattern recognition and machine learning tasks such as object recognition, image segmentation, machine translation and others. For an overview on the empirical success of deep neural networks, we refer to the review paper [1] and recent book [2].
Inspired by the success of deep neural networks, many researchers have tried to give theoretical supports for the success of deep neural networks. Much of the work upto date has focused on the expressivity of deep neural networks, i.e., ability to approximate a rich class of functions efficiently. The well-known classical result on this topic is the universal approximation theorem, which states that every continuous function can be approximated arbitrarily well by a neural network [3][4][5][6][7]. But these results do not specify the required numbers of layers and nodes of a neural network to achieve a given approximation accuracy.
Recently, several results about the effects of the numbers of layers and nodes of a deep neural network to its expressivity have been reported. They provide upper bounds of the numbers of layers and nodes required for neural networks to uniformly approximate all functions of interest. Examples of a class of functions include the space of rational functions of polynomials [8], the Hölder space [9][10][11][12], Besov and mixed Besov spaces [13] and even a class of discontinuous functions [14,15].
The nonlinear activation function is a central part that makes neural networks differ from the linear models, that is, a neural network becomes a linear function if the linear activation function is used. Therefore, the choice of an activation function substantially influences on the performance and computational efficiency. Numerous activation functions have been suggested to improve neural network learning [16][17][18][19][20][21]. We refer to the papers [21,22] for an overview of this topic.
There are also many recent theoretical studies about the approximation ability of deep neural networks. However, most of the studies focus on a specific type of the activation function such as ReLU [9,10,[13][14][15], or small classes of activation functions such as sigmoidal functions with additional monotonicity, continuity, and/or boundedness conditions [23][24][25][26][27] and m-admissible functions which are sufficiently smooth and bounded [11]. For definitions of sigmoidal and m-admissible functions, see [24] and [11], respectively. Thus a unified theoretical framework still lacks.
In this paper, we investigate the approximation ability of deep neural networks with a quite general class of activation functions. We derive the required numbers of layers and nodes of a deep neural network to approximate any Hölder smooth function upto a given approximation error for the large class of activation functions. Our specified class of activation functions and the corresponding approximation ability of deep neural networks include most of previous results [9][10][11]23] as special cases.
Our general theoretical results of the approximation ability of deep neural networks enables us to study statistical properties of deep neural networks. Schmidt-Hieber [10] and Kim et al. [28] proved the minimax optimality of a deep neural network estimator with the ReLU activation function in regression and classification problems, respectively. In this paper, we derive similar results for general activation functions.
This paper is structured as follows. In Section 2, we introduce some notions about deep neural networks. In Section 3, we introduce two large classes of activation functions. In Section 4, we present our main result on the approximation ability of a deep neural network with the general activation function considered in Section 3. In Section 5, we apply the result in Section 4 to the supervised learning problems of regression and classification. Conclusions are given in Section 6. The proofs of all results are given in Appendix.

Notation
We denote by 1 (·) the indicator function. Let R be the set of real numbers and N be the set of natural numbers. For a real valued vector x ≡ (x 1 , . . . , x d ), we let |x| 0 := ∑ d j=1 1(x j = 0), |x| p := ∑ d j=1 |x j | p 1/p for p ∈ [1, ∞) and |x| ∞ := max 1≤j≤d |x j |. For simplicity, we let |x| := |x| 1 . For a real valued function f (x) : R → R, we let f (a), f (a) and f (a) are the first, second and third order derivatives of f at a, respectively. We let f (a+) For x ∈ R, we write (x) + := max{x, 0}.

Deep Neural Networks
In this section we provide a mathematical representation of deep neural networks. A neural network with L ∈ N layers, n l ∈ N many nodes at the l-th hidden layer for l = 1, . . . , L, input of dimension n 0 , output of dimension n L+1 and nonlinear activation function σ : R → R is expressed as where A l : R n l−1 → R n l is an affine linear map defined by A l (x) = W l x + b l for given n l × n l−1 dimensional weight matrix W l and n l dimensional bias vector b l and σ l : R n l → R n l is an element-wise nonlinear activation map defined by σ l (z) := (σ(z 1 ), . . . , σ(z n l )) . Here, θ denotes the set of all weight matrices and bias vectors θ := (W 1 , b 1 ), (W 2 , b 2 ), . . . , (W L+1 , b L+1 ) , which we call θ the parameter of the neural network, or simply, a network parameter. We introduce some notations related to the network parameter. For a network parameter θ, we write L(θ) for the number of hidden layers of the corresponding neural network, and write n max (θ) for the maximum of the numbers of hidden nodes at each layer. Following a standard convention, we say that L(θ) is the depth of the deep neural network and n max (θ) is the width of the deep neural network. We let |θ| 0 be the number of nonzero elements of θ, i.e., where vec(W l ) transforms the matrix W l into the corresponding vector by concatenating the column vectors. We call|θ| 0 sparsity of the deep neural network. Let|θ| ∞ be the largest absolute value of elements of θ, i.e., We call |θ| ∞ magnitude of the deep neural network. We let in(θ) and out(θ) be the input and output dimensions of the deep neural network, respectively. We denote by Θ d,o (L, N) the set of network parameters with depth L, width N, input dimension d and output dimension o, that is, We further define a subset of Θ d,o (L, N) with restrictions on sparsity and magnitude as

Classes of Activation Functions
In this section, we consider two classes of activation functions. These two classes include most of commonly used activation functions. Definitions and examples of each class of activation functions are provided in the consecutive two subsections.

Piecewise Linear Activation Functions
We first consider piecewise linear activation functions. Definition 1. A function σ : R → R is continuous piecewise linear if it is continuous and there exist a finite number of break points a 1 ≤ a 2 ≤ · · · ≤ a K ∈ R with K ∈ N such that σ (a k −) = σ (a k +) for every k = 1, . . . , K Throughout this paper, we write "picewise linear" instead of "continuous picewise linear" for notational simplicity unless there is a confusion. The representative examples of piecewise linear activation functions are as follows: Leaky ReLU: σ(x) = max{x, ax} for a ∈ (0, 1).
The ReLU activation function is the most popular choice in practical applications due to better gradient propagation and efficient computation [22]. In this reason, most of the recent results on the function approximation by deep neural networks are based on the ReLU activation function [9,10,[13][14][15].
In Section 4, as Yarotsky [9] did, we extend these results to any continuous piecewise linear activation function by showing that the ReLU activation function can be exactly represented by a linear combination of piecewise linear activation functions. A formal proof for this argument is presented in Appendix A.1.

Locally Quadratic Activation Functions
One of the basic building blocks in approximation by deep neural networks is the square function, which should be approximated precisely. Piecewise linear activation functions have zero curvature (i.e., constant first-order derivative) inside each interval divided by its break points, which makes it relatively difficult to approximate the square function efficiently. But if there is an interval on which the activation function has nonzero curvature, the square function can be approximated more efficiently, which is a main motivation of considering a new class of activation functions that we call locally quadratic.

Definition 2.
A function σ : R → R is locally quadratic if there exits an open interval (a, b) ⊂ R on which σ is three times continuously differentiable with bounded derivatives and there exists t ∈ (a, b) such that σ (t) = 0 and We now give examples of locally quadratic activation functions. First of all, any nonlinear smooth activation function with nonzero second derivative, is locally quadratic. Examples are: Inverse square root unit (ISRU) [18]: • Soft clipping [19]: σ(x) = 1 a log 1 + e ax 1 + e a(x−1) for a > 0.

Approximation of Smooth Functions by Deep Neural Networks
In this section we introduce the function class we consider and show the approximation ability of the deep neural networks with a activation function considered in Section 3.

Hölder Smooth Functions
We recall the definition of Hölder smooth functions. For a d-dimensional multiple index For a function f : X → R, where X denotes the domain of the function, we let f ∞ := sup x∈X | f (x)|. We use notation for m ∈ N d 0 to denote a derivative of f of order m. We denote by C m (X ), the space of m times differentiable functions on X whose partial derivatives of order m with |m| ≤ m are continuous. We define the Hölder coefficient of order s ∈ (0, 1] as For a positive real value α, the Hölder space of order α is defined as where f H α (X ) denotes the Hölder norm defined by We denote by H α,R (X ) the closed ball in the Hölder space of radius R with respect to the Hölder norm, i.e.,

Approximation of Hölder Smooth Functions
We present our main theorem in this section. α, R and σ such that, for any > 0, there is a neural network satisfying sup The result of Theorem 1 is equivalent to the results on the approximation by ReLU neural networks [9,10] in a sense that the upper bounds of the depth, width and sparsity are the same orders of those for ReLU, namely, depth = O(log(1/ )), width = O( −d/α ) and sparsity = O( −d/α log(1/ )). We remark that each upper bound is equivalent to the corresponding lower bound established by [9] up to logarithmic factor.
For piecewise linear activation functions, Yarotsky [9] derived similar results to ours. For locally quadratic activation functions, only special classes of activation functions were considered in the previous work. Li et al. [12] considered the RePU activation function and Bauer and Kohler [11] considered sufficiently smooth and bounded activation functions which include the sigmoid, tangent hyperbolic, ISRU and soft clipping activation functions. However, soft plus, swish, ELU, ISRLU, softsign and square nonlinearity activation functions are new ones only considered in our results.
Even if the orders of the depth, width and sparsity are the same for both both piecewise linear and locally quadratic activation functions, the ways of approximating a smooth function by use of these two activation function classes are quite different. To describe this point, let us provide an outline of the proof. We first consider equally spaced grid points with length 1/M inside the d-dimensional unit hypercube For a given Hölder smooth function f of order α, we first find a "local" function for each grid that approximates the target function near the grid point but vanishes at apart from the grid point. To be more specific, we construct the local functions g z , z ∈ G d,M which satisfies: for some universal constant C > 0. The inequality (4) implies that the more grid points we used, the more accurate approximation we get. Moreover, the quality of approximation is improved when the target function is more smooth (i.e., large α) and low dimensional (i.e., small d ). In fact, g z,M (x) is given by a product of the Taylor polynomial P z, at z and the local basis function The second stage is to approximate each monomial x m and each local basis function φ z,M (x) by deep neural networks. Each monomial can be approximated more efficiently by a deep neural network with a locally quadratic activation function than a piecewise linear activation function since each monomial has nonzero curvature. On the other hand, the local basis function can be approximated more efficiently by a deep neural network with a piecewise linear activation than a locally quadratic activation function since the local basis function is piecewise linear itself. That is, there is a trade-off in using either a piecewise linear or a locally quadratic activation function.
We close this section by giving a comparison of our result to the approximation error analysis of [11]. Bauer and Kohler [11] studies approximation of the Hölder smooth function of order α by a two layer neural network with m-admissible activation functions with m ≥ α, where a function σ is called m-admissible if (1) σ is at least m + 1 times continuously differentiable with bounded derivatives; (2) a point t ∈ R exists, where all derivatives up to the order m of σ are different from zero; and (3) |σ(x) − 1| ≤ 1/x for x > 0 and |σ(x)| ≤ 1/|x| for x < 0. Our notion of locally quadratic activation functions is a generalized version of the m-admissibility.
In the proof of [11], the condition m ≥ α is necessary because they approximate any monomial of order m with |m| ≤ α with a two layer neural network, which is impossible when m < α. We drop the condition m ≥ α by showing that any monomial of order m with |m| ≤ α can be approximated by deep neural network with a finite number of layers, which depends on α.

Application to Statistical Learning Theory
In this section, we apply our results about the approximation error of neural networks to the supervised learning problems of regression and classification. Let X be the input space and Y the output space. Let F be a given class of measurable functions from X to Y. Let P 0 be the true but unknown data generating distribution on X × Y. The aim of supervised learning is to find a predictive function that minimizes the population risk R( f ) := E (X,Y)∼P 0 (Y, f (X)) with respect to a given loss function . Since P 0 is unknown, we cannot directly minimize the population risk, and thus any estimatorf inevitably has the excess risk which is defined as R . For a given sample of size n, let F n be a given subset of F called a sieve and let (x 1 , y 1 ), . . . , (x n , y n ) be observed (training) data of input-output pairs assumed to be independent realizations of (X, Y) following P 0 . Letf n be an estimated function among F n based on the training data (x 1 , y 1 ), . . . , (x n , y n ). The excess risk off n is decomposed to approximation and estimation errors as There is a trade-off between approximation and estimation errors. If the function class F n is sufficiently large to approximate the optimal estimator f * := argmin f ∈F R( f ) well, then the estimation error becomes large due to high variance. In contrast, if F n is small, it leads to low estimation error but it suffers from large approximation error.
One of the advantages of deep neural networks is that we can construct a sieve which has good approximation ability as well as low complexity. Schmidt-Hieber [10] and Kim et al. [28] proved that a neural network estimator can achieve the optimal balance between the approximation and estimation errors to obtain the minimax optimal convergence rates in regression and classification problems, respectively. But they only considered the ReLU activation function. Based on the results of Theorem 1, we can easily extend their results to general activation functions.
The main tool to derive the minimax optimal convergence rate is that the complexity of a class of functions generated by a deep neural network is not affected much by a choice of an activation function, provided that the activation function is Lipschitz continuous. The function σ : for any x 1 , x 2 ∈ R. Here, C σ is called the Lipschitz constant. We use the covering number with respect to the L ∞ norm · ∞ as a measure of complexity of function classes. We recall the definition of the covering number. Let F be a given class of real-valued functions defined on X . Let δ > 0. A collection { f j ∈ F : j = 1, . . . , J} is called a δ-covering set of F with respect to the L ∞ norm if for all f ∈ F , there exists f j in the collection such that f − f j ∞ ≤ δ. The cardinality of the minimal δ-covering set is called the δ-covering number of F with respect to the L ∞ norm which is denoted by N (δ, F , · ∞ ). That is, The following proposition provides the covering number of a class of functions generated by neural networks.  For any δ > 0, where B ∨ 1 := max{B, 1}.
The result in Proposition 1 is very similar to the existing results in literature, e.g., Theorem 14.5 of [29], Lemma 5 of [10] and Lemma 3 of [13]. We employ similar techniques used in [10,13,29] to obtain the version presented here. We give the proof of this proposition in Appendix B.
All of the activation functions considered in Section 3 except RePU satisfy the Lipschitz condition (6) and hence Proposition 1 can be applied. An interesting implication of Proposition 1 is that the complexity of the function class generated by deep neural networks is not affected by the choice of an activation function. Hence, the remaining step to derive the convergence rate of a neural network estimator is that approximation accuracies by various activation functions are the same as that of the ReLU neural network.

Application to Regression
First we consider the regression problem. For simplicity, we let X = [0, 1] d . Suppose that the generated model is Y|X = x ∼ N( f 0 (x), 1) for some f 0 : [0, 1] d → R. The performance of an estimator is measured by the L 2 risk R 2, f 0 ( f ), which is defined by where P x is the marginal distribution of X. The following theorem proves that the optimal convergence rate is obtained by the deep neural network estimator of the regression function f 0 for a general activation function.
Theorem 2. Suppose that the activation function σ is either piecewise linear or locally quadratic satisfying the Lipschitz condition (6). Then there are universal positive constants L 0 , N 0 , S 0 and B 0 such that the deep neural network estimator obtained byf for some universal constant C > 0, where the expectation is taken over the training data.

Application to Binary Classification
The aim of the binary classification is to find a classifier that predicts the label y ∈ {−1, 1} for any input x ∈ [0, 1] d . An usual assumption on the data generating process is that Y|X = where Bern(p) denotes the Bernoulli distribution with parameter p. Note that η(x) is the conditional probability function P 0 (Y = 1|X = x). A common approach is, instead of finding a classifier directly, to construct a real valued function f , a so-called classification function, and predict the label y based on the sign of f (x). The performance of a classification function is measured by the misclassification error R 01,η ( f ), which is defined by It is well known that the convergence rate of the excess risk for classification is faster than that of regression when the conditional probability function η(x) satisfies the following condition: there is a constant q ∈ [0, ∞] such that for any sufficiently small u > 0, we have This condition is called the Tsybakov noise condition and q is called the noise exponent [30,31]. When q is larger, the classification task is easier since the probability of generating vague samples become smaller. The following theorem proves that the optimal convergence rate can be obtained by the deep neural network estimator with an activation function considered in Section 3. As is done by [28], we consider the hinge loss hinge (z) := max{1 − z, 0}. (8) with the noise exponent q ∈ [0, ∞]. Suppose that the activation function σ, which is either piecewise linear or locally quadratic satisfying the Lipschitz condition (6), is used for all hidden layers except the last one and the ReLU activation function is used for the last hidden layer. Then there are universal positive constants L 0 , N 0 , S 0 and B 0 such that the deep neural network estimator obtained bŷ
Note that the Bayes classifier f * := argmin f ∈F R 01,η ( f ) is given by which is an indicator function. Since a neural network with the ReLU activation function can approximate indicator functions well [14,15,28], we use the ReLU activation function in the last layer in order to approximate the Bayes classifier more precisely and thus to achieve the optimal convergence rate.

Conclusions
In this study, we established the upper bounds of the required depth, width and sparsity of deep neural networks to approximate any Hölder continuous function for the general classes of activation functions. These classes of activation functions include most of the popularly used activation functions. The derived upper bounds of the depth, width and sparsity are optimal in a sense that they are equivalent to the lower bounds up to logarithmic factors. We used this generalization of the approximation error analysis to extend the statistical optimality of the deep neural network estimator in regression and classification problems, where the activation function is other than the ReLU.
Our construction of neural networks for approximation reveals that the piecewise linear activation functions are more efficient in approximating local basis functions while locally quadratic activation functions are more efficient in approximating polynomials. Hence if the activation function has both piecewise linear region and locally quadratic region, we could have a better approximation result. We leave the development of such activation functions as a future work.

Conflicts of Interest:
The authors declare no conflict of interest.

Appendix A. Proof of Theorem 1 Appendix A.1. Proof of Theorem 1 for Piecewise Linear Activation Functions
The main idea of the proof is that any deep neural network with the ReLU activation function can be exactly reconstructed by a neural network with a piecewise activation function whose proof is in the next lemma that is a slight modification of Proposition 1 (b) of [9]. Lemma A1. Let σ be an any continuous peicewise linear activation function, and ρ be the ReLU activation function. Let θ ∈ Θ d,1 (L, N, S, B). Then there exists θ * ∈ Θ d,1 (L, 2N, 4S + 2LN + 1, where C 1 > 0 is a constant depending on the activation function σ. Proof. Let a be any break point of σ. Note that σ(a−) = σ(a+). Let r 0 be the distance between a and the closest other break point. Then σ is linear on [a − r 0 , a] and [a, a + r 0 ]. Then for any r > 0, the ReLU activation function ρ(x) := (x) + is expressed as for any x ∈ [−r, r], where we define 1 (L, N, S, B) be given. Since both input x ∈ [0, 1] d and the network parameter θ are bounded, we can take a sufficiently large r so that Equation (A1) holds for any hidden nodes of the network θ. We consider the deep neural network θ * ≡ ((W * for l = 1, . . . , L and Here, 1 n denotes the n-dimensional vector of 1 s. Then by Equation (A1) and some algebra, we have that N σ (x|θ * ) = N ρ (x|θ) for any x ∈ [0, 1] d . For the sparsity of θ * , we note that vec(W * l ) 0 + b * l 0 ≤ 4 vec(W l ) 0 + 2n l which implies that|θ * | 0 ≤ 4|θ| 0 + 2L(θ)n max (θ) + 1.
Thanks to Lemma A1, to prove Theorem 1 for piecewise linear activation functions, it suffices to show the approximation ability of the ReLU networks, which is already done by [10] as in the next lemma.
Theorem 1 for piecewise linear activation functions is a direct consequence of Lemmas A1 and A2, which is summarized as follows.

Proof of Theorem 1 for piecewise linear activation functions. Let ρ be the ReLU activation function. By
for some positive constants L 0 , N 0 , and S 0 depending only on α, d and R. Hence by Lemma A1, there is a network parameter θ producing the same output of the ReLU neural network N ρ (·|θ) with L(θ) = L(θ ), n max (θ) = 2n max (θ ), only on α, d, R and σ, and some B 0 > 0 depending only on σ, which completes the proof.

Appendix A.2. Proof of Theorem 1 for Locally Quadratic Activation Functions
Lemma A3. Assume that an activation function σ is locally quadratic. There is a constant K 0 depending only on the activation function such that for any K > K 0 the following results hold.
(a) There is a neural network Let α be a positive integer. For any multi-index m ∈ N d 0 with |m| ≤ α, there is a network parameter for some positive constants C 2 and C 3 depending only on σ and α.
Proof. Recall that there is an interval (a, b) on which σ(x) is three times continuously differentiable with bounded derivatives and there is t ∈ (a, b) such that σ (t) = 0 and σ (t) = 0 Proof of (a). Take K large so that 2/K < min{|t − b|, |t − a|}. Consider a neural network Since σ is three times continuously differentiable on (a, b) and (k − 1)x/K + t ∈ (a, b) if x ∈ [0, 1], it can be expanded in the Taylor series with Lagrange remainder around t to have Since the third order derivative is bounded on (a, b), we get the desired assertion by retaking K ← 2/σ (t)K.

Appendix C. Proof of Theorem 2
The proof Theorem 2 is based on the following oracle inequality.
By definition off n , we have ∆ n = 0. Also it can be easily verified that f 0 = argmin f ∈F R 2, f 0 ( f ) and E f 0 ,P x f n (X) − f 0 (X) 2 = R 2, f 0 (f n ) − R 2, f 0 ( f 0 ). Set δ = 1/n. By Proposition 1, log N 1 n , F σ,n , · ∞ ≤ C 1 n d 2α+d log 3 n, for some C 1 > 0. If a function f n is approximates f 0 by error which is sufficeintly small, then f n ∞ ≤ 2R since f 0 ∞ ≤ R. Now, Theorem 1 implies that there is f n ∈ F σ,n such that which completes the proof.

Appendix D. Proof of Theorem 3
For a given real-valued function f , let R hinge,η ( f ) := E Y|X∼2Bern(η(X))−1,X∼P x hinge (Y f (X)), which we call the hinge risk. The proof of Theorem 3 is based on the following theorem, which is given in [28].

•
there exists a sequence of classes of functions {F n } n∈N with sup n∈N sup f ∈F n f ∞ ≤ F for some F > 0 such that there is f n ∈ F n with R hinge,η ( f n ) − min f ∈F R hinge,η ( f ) ≤ C 1 δ n for some universal constant C 1 > 0; • log N (δ n , F n , · ∞ ) ≤ C 2 nδ (q+2)/(q+1) n for some universal constant C 2 > 0.
Then the estimatorf n obtained byf for some universal constant C 3 > 0, where the expectation is taken over the training data.

Proof of Theorem 3.
It is well known that f * = 21 η(·) ≥ 1/2 − 1 = argmin f ∈F R hinge,η ( f ), i.e., the hinge risk minimizer is equal to the Bayes classifier [32]. The first step is to find a function f n ∈ F σ,n which approximates the Bayes classifier f * well. Let (ξ n ) n∈N be a given sequence of positive integers.