Approximating Continuous Functions by ReLU Nets of Minimal Width
Boris Hanin, Mark Sellke
Introduction
Over the past several years, artificial neural networks, especially deep networks, have become the state of the art in a wide variety of machine learning tasks. These tasks include important benchmark problems in machine vision ([KSH12]) and machine translation ([SVL14, WSC+16]) as well as superhuman performance at games such as Go [SHM+16]. Despite these varied and striking successes, a theory of why neural nets provide such good approximations to interesting functions and can be effectively trained is only beginning to take shape.
While non-linear activations help neural nets express a wide variety of functions, repeated non-linearities can also “garble” the signal, leading to a loss of mutual information between the input and the activations at various hidden layers. Such an information theoretic point of view on neural nets has recently been systematically taken up in the work of Tishby with Shwartz-Ziv, Moshkovitz, and Zaslavsky [ST17, MT17, TZ15]. In the present article, we answer a basic information theoretic question about neural nets. Namely, for each what is the minimal width so that neural nets whose hidden layers have width at least and arbitrary depth can approximate arbitrarily well any scalar continuous function of variables? We treat only neural nets with a popular and particularly simple activation function called rectified linear units, defined
It have been known since the 1980’s (e.g. the work of Cybenko [Cyb89] and Hornik-Stinchcombe-White [HSW89]) that feed-forward neural nets with a single hidden layer can approximate essentially any function if the hidden layer is allowed to be arbitrarily wide. Such results hold for a wide variety of activations, including However, part of the recent renaissance in neural nets, is the empirical observation that deep neural nets tend to achieve greater expressivity per parameter than their shallow cousins. There are now a number of rigorous results about this so-called expressive power of depth [ABMM16, MLP16, LTR17, MP16, PLR+16, RPK+17, RT17, Tel15, Tel16, Tel17, Yar16]. We refer the reader to §3 in [Han17] for a discussion of the relationships between some of these articles.
The main result of this article shows a sharp transition in the representational power of deep feed-forward neural nets with activations as a function of the widths of their hidden layers. To state it, we need some notation. We say that is a feed-forward neural net with activations, input dimension , output dimension , and widths (a net for short) if it computes a function of the form
The main result of this article is the following estimate for
Proving the upper bound in Theorem 1 requires a novel construction by which any continuous function with input variables and output variables can be approximated to arbitrary precision by a net with width and depth depending on its modulus of continuity . Recall that when implies that uniformly over all inputs Since need not be continuous or bijective, define
We refer the reader to Proposition 3 for the precise statement. The construction is carried out in §2. In contrast, obtaining the lower bound
Our construction in §3 only requires that the function have some compact level set (connected component of a fiber ) and be non-constant inside that level set.
The first author would like to thank Zhangyang Wang for several stimulating discussions about extending the results in this article to allowing residual connections and to more general activations. We are also grateful to Dmitry Yarotsky for pointing out several inaccuracies and a mistake (now corrected) in the proof of Lemma 6 in a previous version.
Proof of the Upper Bound in Theorem 1
where each is either a coordinate-wise max or a min.
The statement (3) follows immediately from the following two propositions.
Nonetheless, Proposition 3 is of a rather different nature since we are allowed to take only max and min of two affine functions at a time.
We may assume without loss of generality that is contained in the positive orthant:
since we can always shift the input to a neural net by a fixed vector. Let us fix a max-min string
is the graph of Note that the final is trivial since is non-negative. Appending a final layer yields the desired net. ∎
2. Proof of Proposition 3
where the max and min are componentwise. By construction, Further, because is large, for . Hence and agree on , completing the proof. ∎
such that is contained in the infinite planar sector . Then if there exists a max-min string with
then there also exists a max-min string with
Next, by the definition of we have
We now show that this estimate continues to hold for as well. We claim that on we have
Indeed, suppose that ray has length for integer and real remainder . Then by the triangle inequality we have
Therefore, as desired. ∎
We now turn to the details of the proof of Proposition 3. We will explain how to approximate our fixed continuous function by a max-min string on a ball of radius centered at the origin. We will use Lemma 5 to show that we can approximate on successively larger and larger balls. Observe that if then
so that the constant max-min string is an -approximation to on the small ball . To prove that we can approximate on larger balls, suppose is a max-min string on variables that approximates to within on the ball with We use Lemma 5 to construct a new max-min string which uniformly -approximates on a ball of slightly larger radius
Since for every the function is strictly increasing in it cannot have a fixed point and the fold composition sends any to infinity with Using this procedure repeatedly therefore allows us to increase without bound and will complete the proof. Our approach is illustrated in Figures 1 and 2.
We begin with the construction when and will explain the simple modification for below. For each and any two sufficiently close points on the boundary of , let be the intersections of line with the boundary circle of . Also, denote by be the intersection of the tangents to through (see Figure 1). Then is contained in the planar sector , and the diameter of can be made arbitrarily small by taking close to and close to In particular, for every we take
This choice for is valid because , so we can indeed find points at this distance with no problem. Then
We also know that because , implying obtuseness of at . Thus,
Lemma 5 therefore shows that there exists a max-min string that uniformly approximates on Notice that contains the circular sector of cut out by the rays and Finally, consider a net on the circumference of with
The size of this net is Applying Lemma 5 times and repeating the above argument with completes the proof of the upper bound in Theorem 1 when
The argument when is essentially the same. The idea is to take the diagrams depicted and rotate them around the axis Lemma 5 extends to higher dimensions with the triangle replaced by the tip of a cone with the same diameter requirement. Such a cone is obtained by rotating in Figures 1 and 2. The rest of the argument then carries over verbatim.
balls. We get one extra max and min in the max-min string we build to approximate for each such ball. Thus, at a cost of many maxes and mins, the radius on which we approximate increases
Hence, if we fix then for every we have
and to obtain an approximation of on by a max-min we need to extend the approximation of from a small ball to a larger ball at most times. The number of maxes and mins required for each extension is . Hence, the length of the max-min string we construct to approximate on is
We have tacitly neglected the case . This case is the same as but easier. In fact here we require only
layers, which would naively correspond to . The reason is that a -dimensional ball can be increased in radius by by adding only a single external line segment of length . In the higher dimensional cases, we need to add the external pieces mostly tangentially which requires more layers.
Proof of the Lower Bound in Theorem 1
Fix and consider a width net
computed by the first hidden layers of are of a rather special form.
For each , set to be the set of points on which all ReLU evaluations throughout the evaluation of are (strictly) positive. Then is open and convex, is affine on , and every level set of that is bounded is contained in
In this case is a sphere and is a ball. Suppose and . Then for , we show that is not -approximable on .
Set , and let be the intersection of with . Since is continuous, the intermediate value theorem implies that separates and . Let be the boundary of any connected component of that contains . Informally, surrounds which surrounds . Now, suppose some computed by a neural net satisfies
Suppose in the second case that does not contain , so there is . Then, by Lemma 6, the level set of containing must be unbounded, and hence must intersect (as separates from and is reachable from without intersecting A). This is again a contradiction for
In both cases, we showed that and differed significantly; the first case used the affineness of on while the second used the unboundedness of level sets away from . We conclude that a width- net cannot uniformly approximate .