Universal approximation theorem

{{Short description|Feed-forward neural network with a 1 hidden layer can approximate continuous functions}}

{{Technical|date=July 2023}}

In the mathematical theory of artificial neural networks, universal approximation theorems are theorems{{cite journal |last1=Hornik |first1=Kurt |last2=Stinchcombe |first2=Maxwell |last3=White |first3=Halbert |title=Multilayer feedforward networks are universal approximators |journal=Neural Networks |date=January 1989 |volume=2 |issue=5 |pages=359–366 |doi=10.1016/0893-6080(89)90020-8 }}Balázs Csanád Csáji (2001) Approximation with Artificial Neural Networks; Faculty of Sciences; Eötvös Loránd University, Hungary of the following form: Given a family of neural networks, for each function f from a certain function space, there exists a sequence of neural networks \phi_1, \phi_2, \dots from the family, such that \phi_n \to f according to some criterion. That is, the family of neural networks is dense in the function space.

The most popular version states that feedforward networks with non-polynomial activation functions are dense in the space of continuous functions between two Euclidean spaces, with respect to the compact convergence topology.

Universal approximation theorems are existence theorems: They simply state that there exists such a sequence \phi_1, \phi_2, \dots \to f, and do not provide any way to actually find such a sequence. They also do not guarantee any method, such as backpropagation, might actually find such a sequence. Any method for searching the space of neural networks, including backpropagation, might find a converging sequence, or not (i.e. the backpropagation might get stuck in a local optimum).

Universal approximation theorems are limit theorems: They simply state that for any f and a criterion of closeness \epsilon > 0, if there are enough neurons in a neural network, then there exists a neural network with that many neurons that does approximate f to within \epsilon. There is no guarantee that any finite size, say, 10000 neurons, is enough.

Setup

Artificial neural networks are combinations of multiple simple mathematical functions that implement more complicated functions from (typically) real-valued vectors to real-valued vectors. The spaces of multivariate functions that can be implemented by a network are determined by the structure of the network, the set of simple functions, and its multiplicative parameters. A great deal of theoretical work has gone into characterizing these function spaces.

Most universal approximation theorems are in one of two classes. The first quantifies the approximation capabilities of neural networks with an arbitrary number of artificial neurons ("arbitrary width" case) and the second focuses on the case with an arbitrary number of hidden layers, each containing a limited number of artificial neurons ("arbitrary depth" case). In addition to these two classes, there are also universal approximation theorems for neural networks with bounded number of hidden layers and a limited number of neurons in each layer ("bounded depth and bounded width" case).

History

= Arbitrary width =

The first examples were the arbitrary width case. George Cybenko in 1989 proved it for sigmoid activation functions.{{cite journal |citeseerx=10.1.1.441.7873 |doi=10.1007/BF02551274|title=Approximation by superpositions of a sigmoidal function|year=1989|last1=Cybenko|first1=G.|journal=Mathematics of Control, Signals, and Systems|volume=2|issue=4|pages=303–314|bibcode=1989MCSS....2..303C |s2cid=3958369}} {{ill|Kurt Hornik|de}}, Maxwell Stinchcombe, and Halbert White showed in 1989 that multilayer feed-forward networks with as few as one hidden layer are universal approximators. Hornik also showed in 1991{{Cite journal|doi=10.1016/0893-6080(91)90009-T|title=Approximation capabilities of multilayer feedforward networks|year=1991|last1=Hornik|first1=Kurt|journal=Neural Networks|volume=4|issue=2|pages=251–257|s2cid=7343126 }} that it is not the specific choice of the activation function but rather the multilayer feed-forward architecture itself that gives neural networks the potential of being universal approximators. Moshe Leshno et al in 1993{{Cite journal|last1=Leshno|first1=Moshe|last2=Lin|first2=Vladimir Ya.|last3=Pinkus|first3=Allan|last4=Schocken|first4=Shimon|date=January 1993|title=Multilayer feedforward networks with a nonpolynomial activation function can approximate any function|journal=Neural Networks|volume=6|issue=6|pages=861–867|doi=10.1016/S0893-6080(05)80131-5|s2cid=206089312|url=http://archive.nyu.edu/handle/2451/14329 }} and later Allan Pinkus in 1999{{Cite journal|last=Pinkus|first=Allan|date=January 1999|title=Approximation theory of the MLP model in neural networks|journal=Acta Numerica|volume=8|pages=143–195|doi=10.1017/S0962492900002919|bibcode=1999AcNum...8..143P|s2cid=16800260 }} showed that the universal approximation property is equivalent to having a nonpolynomial activation function.

= Arbitrary depth =

The arbitrary depth case was also studied by a number of authors such as Gustaf Gripenberg in 2003,{{Cite journal|last1=Gripenberg|first1=Gustaf|date=June 2003|title= Approximation by neural networks with a bounded number of nodes at each level|journal= Journal of Approximation Theory |volume=122|issue=2|pages=260–266|doi= 10.1016/S0021-9045(03)00078-9 |doi-access=}} Dmitry Yarotsky,{{cite journal |last1=Yarotsky |first1=Dmitry |title=Error bounds for approximations with deep ReLU networks |journal=Neural Networks |date=October 2017 |volume=94 |pages=103–114 |doi=10.1016/j.neunet.2017.07.002 |pmid=28756334 |arxiv=1610.01145 |s2cid=426133 }} Zhou Lu et al in 2017,{{cite journal |last1=Lu |first1=Zhou |last2=Pu |first2=Hongming |last3=Wang |first3=Feicheng |last4=Hu |first4=Zhiqiang |last5=Wang |first5=Liwei |title=The Expressive Power of Neural Networks: A View from the Width |journal=Advances in Neural Information Processing Systems |volume=30 |year=2017 |pages=6231–6239 |url=http://papers.nips.cc/paper/7203-the-expressive-power-of-neural-networks-a-view-from-the-width |publisher=Curran Associates |arxiv=1709.02540 }} Boris Hanin and Mark Sellke in 2018{{cite arXiv |last1=Hanin|first1=Boris|last2=Sellke|first2=Mark|title=Approximating Continuous Functions by ReLU Nets of Minimal Width|eprint=1710.11278|class=stat.ML|date=2018}} who focused on neural networks with ReLU activation function. In 2020, Patrick Kidger and Terry Lyons{{Cite conference|last1=Kidger|first1=Patrick|last2=Lyons|first2=Terry|date=July 2020|title=Universal Approximation with Deep Narrow Networks|arxiv=1905.08539|conference=Conference on Learning Theory}} extended those results to neural networks with general activation functions such, e.g. tanh or GeLU.

One special case of arbitrary depth is that each composition component comes from a finite set of mappings. In 2024, Cai {{Cite journal|last1=Yongqiang|first1=Cai|date=2024|title= Vocabulary for Universal Approximation: A Linguistic Perspective of Mapping Compositions|journal= ICML|pages=5189–5208 |arxiv=2305.12205 |url= https://proceedings.mlr.press/v235/cai24a.html}} constructed a finite set of mappings, named a vocabulary, such that any continuous function can be approximated by compositing a sequence from the vocabulary. This is similar to the concept of compositionality in linguistics, which is the idea that a finite vocabulary of basic elements can be combined via grammar to express an infinite range of meanings.

= Bounded depth and bounded width =

The bounded depth and bounded width case was first studied by Maiorov and Pinkus in 1999.{{Cite journal|last1=Maiorov|first1=Vitaly|last2=Pinkus|first2=Allan|date=April 1999|title=Lower bounds for approximation by MLP neural networks|journal=Neurocomputing|volume=25|issue=1–3|pages=81–91|doi=10.1016/S0925-2312(98)00111-8}} They showed that there exists an analytic sigmoidal activation function such that two hidden layer neural networks with bounded number of units in hidden layers are universal approximators.

In 2018, Guliyev and Ismailov{{Cite journal |last1=Guliyev |first1=Namig |last2=Ismailov |first2=Vugar |date=November 2018 |title=Approximation capability of two hidden layer feedforward neural networks with fixed weights |journal=Neurocomputing |volume=316 |pages=262–269 |arxiv=2101.09181 |doi=10.1016/j.neucom.2018.07.075 |s2cid=52285996}} constructed a smooth sigmoidal activation function providing universal approximation property for two hidden layer feedforward neural networks with less units in hidden layers. In 2018, they also constructed{{Cite journal|last1=Guliyev|first1=Namig|last2=Ismailov|first2=Vugar|date=February 2018|title=On the approximation by single hidden layer feedforward neural networks with fixed weights|journal=Neural Networks|volume=98| pages=296–304|doi=10.1016/j.neunet.2017.12.007|pmid=29301110 |arxiv=1708.06219 |s2cid=4932839 }} single hidden layer networks with bounded width that are still universal approximators for univariate functions. However, this does not apply for multivariable functions.

In 2022, Shen et al.{{cite journal |last1=Shen |first1=Zuowei |last2=Yang |first2=Haizhao |last3=Zhang |first3=Shijun |date=January 2022 |title=Optimal approximation rate of ReLU networks in terms of width and depth |journal=Journal de Mathématiques Pures et Appliquées |volume=157 |pages=101–135 |arxiv=2103.00502 |doi=10.1016/j.matpur.2021.07.009 |s2cid=232075797}} obtained precise quantitative information on the depth and width required to approximate a target function by deep and wide ReLU neural networks.

= Quantitative bounds =

The question of minimal possible width for universality was first studied in 2021, Park et al obtained the minimum width required for the universal approximation of Lp functions using feed-forward neural networks with ReLU as activation functions.{{Cite conference |last1=Park |first1=Sejun |last2=Yun |first2=Chulhee |last3=Lee |first3=Jaeho |last4=Shin |first4=Jinwoo |date=2021 |title=Minimum Width for Universal Approximation |conference=International Conference on Learning Representations |arxiv=2006.08859}} Similar results that can be directly applied to residual neural networks were also obtained in the same year by Paulo Tabuada and Bahman Gharesifard using control-theoretic arguments.{{Cite conference |last1=Tabuada |first1=Paulo |last2=Gharesifard |first2=Bahman |date=2021 |title=Universal approximation power of deep residual neural networks via nonlinear control theory |conference=International Conference on Learning Representations |arxiv=2007.06007}}{{cite journal |last1=Tabuada |first1=Paulo |last2=Gharesifard |first2=Bahman |date=May 2023 |title=Universal Approximation Power of Deep Residual Neural Networks Through the Lens of Control |journal=IEEE Transactions on Automatic Control |volume=68 |issue=5 |pages=2715–2728 |doi=10.1109/TAC.2022.3190051 |s2cid=250512115}}{{Erratum|doi=10.1109/TAC.2024.3390099|checked=yes}} In 2023, Cai obtained the optimal minimum width bound for the universal approximation.{{Cite journal |last=Cai |first=Yongqiang |date=2023-02-01 |title=Achieve the Minimum Width of Neural Networks for Universal Approximation |url=https://openreview.net/forum?id=hfUJ4ShyDEU |journal=ICLR |language=en |arxiv=2209.11395}}

For the arbitrary depth case, Leonie Papon and Anastasis Kratsios derived explicit depth estimates depending on the regularity of the target function and of the activation function.{{Cite journal |last1=Kratsios |first1=Anastasis |last2=Papon |first2=Léonie |date=2022 |title=Universal Approximation Theorems for Differentiable Geometric Deep Learning |url=http://jmlr.org/papers/v23/21-0716.html |journal=Journal of Machine Learning Research |volume=23 |issue=196 |pages=1–73 |arxiv=2101.05390}}

= Kolmogorov network =

The Kolmogorov–Arnold representation theorem is similar in spirit. Indeed, certain neural network families can directly apply the Kolmogorov–Arnold theorem to yield a universal approximation theorem. Robert Hecht-Nielsen showed that a three-layer neural network can approximate any continuous multivariate function.{{Cite journal |last=Hecht-Nielsen |first=Robert |date=1987 |title=Kolmogorov's mapping neural network existence theorem |url=https://cir.nii.ac.jp/crid/1572543025788928512 |journal=Proceedings of International Conference on Neural Networks, 1987 |volume=3 |pages=11–13}} This was extended to the discontinuous case by Vugar Ismailov.{{cite journal |last1=Ismailov |first1=Vugar E. |date=July 2023 |title=A three layer neural network can represent any multivariate function |journal=Journal of Mathematical Analysis and Applications |volume=523 |issue=1 |pages=127096 |arxiv=2012.03016 |doi=10.1016/j.jmaa.2023.127096 |s2cid=265100963}} In 2024, Ziming Liu and co-authors showed a practical application.{{cite arXiv |last1=Liu |first1=Ziming |title=KAN: Kolmogorov-Arnold Networks |date=2024-05-24 |eprint=2404.19756 |last2=Wang |first2=Yixuan |last3=Vaidya |first3=Sachin |last4=Ruehle |first4=Fabian |last5=Halverson |first5=James |last6=Soljačić |first6=Marin |last7=Hou |first7=Thomas Y. |last8=Tegmark |first8=Max|class=cs.LG }}

= Reservoir computing and quantum reservoir computing=

In reservoir computing a sparse recurrent neural network with fixed weights equipped of fading memory and echo state property is followed by a trainable output layer. Its universality has been demonstrated separately for what concerns networks of rate neurons {{Cite journal |last1=Grigoryeva |first1=L. |last2=Ortega |first2=J.-P. |date=2018 |title=Echo state networks are universal |journal=Neural Networks |volume=108 |issue=1 |pages=495–508 |arxiv=1806.00797 |doi=10.1016/j.neunet.2018.08.025|pmid=30317134 }} and spiking neurons, respectively. {{Cite journal |last1=Maass |first1=Wolfgang |last2=Markram |first2=Henry |date=2004 |title=On the computational power of circuits of spiking neurons |url=http://www.igi.tugraz.at/maass/psfiles/135.pdf |journal=Journal of Computer and System Sciences |volume=69 |issue=4 |pages=593–616|doi=10.1016/j.jcss.2004.04.001 }} In 2024, the framework has been generalized and extended to quantum reservoirs where the reservoir is based on qubits defined over Hilbert spaces. {{cite arXiv |last1=Monzani |first1=Francesco |title=Universality conditions of unified classical and quantum reservoir computing |date=2024|eprint=2401.15067 |last2=Prati |first2=Enrico |class=quant-ph }}

= Variants =

Discontinuous activation functions, noncompact domains,{{Cite journal |last1=van Nuland |first1=Teun |year=2024 |title=Noncompact uniform universal approximation |url=https://doi.org/10.1016/j.neunet.2024.106181 |journal=Neural Networks |volume=173|doi=10.1016/j.neunet.2024.106181 |pmid=38412737 |arxiv=2308.03812 }} certifiable networks,{{cite conference |last1=Baader |first1=Maximilian |last2=Mirman |first2=Matthew |last3=Vechev |first3=Martin |date=2020 |title=Universal Approximation with Certified Networks |url=https://openreview.net/forum?id=B1gX8kBtPr |conference=ICLR}}

random neural networks,{{Cite journal |last1=Gelenbe |first1=Erol |last2=Mao |first2=Zhi Hong |last3=Li |first3=Yan D. |year=1999 |title=Function approximation with spiked random networks |url=https://zenodo.org/record/6817275 |journal=IEEE Transactions on Neural Networks |volume=10 |issue=1 |pages=3–9 |doi=10.1109/72.737488 |pmid=18252498}} and alternative network architectures and topologies.{{Cite conference |last1=Lin |first1=Hongzhou |last2=Jegelka |first2=Stefanie|author2-link=Stefanie Jegelka |date=2018 |title=ResNet with one-neuron hidden layers is a Universal Approximator |url=https://papers.nips.cc/paper/7855-resnet-with-one-neuron-hidden-layers-is-a-universal-approximator |publisher=Curran Associates |volume=30 |pages=6169–6178 |journal=Advances in Neural Information Processing Systems}}

The universal approximation property of width-bounded networks has been studied as a dual of classical universal approximation results on depth-bounded networks. For input dimension dx and output dimension dy the minimum width required for the universal approximation of the Lp functions is exactly max{dx + 1, dy} (for a ReLU network). More generally this also holds if both ReLU and a threshold activation function are used.

Universal function approximation on graphs (or rather on graph isomorphism classes) by popular graph convolutional neural networks (GCNs or GNNs) can be made as discriminative as the Weisfeiler–Leman graph isomorphism test.{{Cite conference |last1=Xu |first1=Keyulu |last2=Hu |first2=Weihua |last3=Leskovec |first3=Jure |last4=Jegelka |first4=Stefanie|author4-link=Stefanie Jegelka |date=2019 |title=How Powerful are Graph Neural Networks? |url=https://openreview.net/forum?id=ryGs6iA5Km |journal=International Conference on Learning Representations}} In 2020,{{Cite conference |last1=Brüel-Gabrielsson |first1=Rickard |date=2020 |title=Universal Function Approximation on Graphs |url=https://proceedings.neurips.cc//paper/2020/hash/e4acb4c86de9d2d9a41364f93951028d-Abstract.html |publisher=Curran Associates |volume=33 |journal=Advances in Neural Information Processing Systems}} a universal approximation theorem result was established by Brüel-Gabrielsson, showing that graph representation with certain injective properties is sufficient for universal function approximation on bounded graphs and restricted universal function approximation on unbounded graphs, with an accompanying \mathcal O(\left|V\right| \cdot \left|E\right|)-runtime method that performed at state of the art on a collection of benchmarks (where V and E are the sets of nodes and edges of the graph respectively).

There are also a variety of results between non-Euclidean spaces{{Cite conference |last1=Kratsios |first1=Anastasis |last2=Bilokopytov |first2=Eugene |date=2020 |title=Non-Euclidean Universal Approximation |url=https://papers.nips.cc/paper/2020/file/786ab8c4d7ee758f80d57e65582e609d-Paper.pdf |publisher=Curran Associates |volume=33 |journal=Advances in Neural Information Processing Systems}} and other commonly used architectures and, more generally, algorithmically generated sets of functions, such as the convolutional neural network (CNN) architecture,{{cite journal |last1=Zhou |first1=Ding-Xuan |year=2020 |title=Universality of deep convolutional neural networks |journal=Applied and Computational Harmonic Analysis |volume=48 |issue=2 |pages=787–794 |arxiv=1805.10769 |doi=10.1016/j.acha.2019.06.004 |s2cid=44113176}}{{Cite journal |last1=Heinecke |first1=Andreas |last2=Ho |first2=Jinn |last3=Hwang |first3=Wen-Liang |year=2020 |title=Refinement and Universal Approximation via Sparsely Connected ReLU Convolution Nets |journal=IEEE Signal Processing Letters |volume=27 |pages=1175–1179 |bibcode=2020ISPL...27.1175H |doi=10.1109/LSP.2020.3005051 |s2cid=220669183}} radial basis functions,{{Cite journal |last1=Park |first1=J. |last2=Sandberg |first2=I. W. |year=1991 |title=Universal Approximation Using Radial-Basis-Function Networks |journal=Neural Computation |volume=3 |issue=2 |pages=246–257 |doi=10.1162/neco.1991.3.2.246 |pmid=31167308 |s2cid=34868087}} or neural networks with specific properties.{{cite journal |last1=Yarotsky |first1=Dmitry |year=2021 |title=Universal Approximations of Invariant Maps by Neural Networks |journal=Constructive Approximation |volume=55 |pages=407–474 |arxiv=1804.10306 |doi=10.1007/s00365-021-09546-1 |s2cid=13745401}}{{cite journal |last1=Zakwan |first1=Muhammad |last2=d’Angelo |first2=Massimiliano |last3=Ferrari-Trecate |first3=Giancarlo |date=2023 |title=Universal Approximation Property of Hamiltonian Deep Neural Networks |journal=IEEE Control Systems Letters |page=1 |arxiv=2303.12147 |doi=10.1109/LCSYS.2023.3288350 |s2cid=257663609}}

Arbitrary-width case

A spate of papers in the 1980s—1990s, from George Cybenko and {{ill|Kurt Hornik|de}} etc, established several universal approximation theorems for arbitrary width and bounded depth.{{cite journal |last1=Funahashi |first1=Ken-Ichi |title=On the approximate realization of continuous mappings by neural networks |journal=Neural Networks |date=January 1989 |volume=2 |issue=3 |pages=183–192 |doi=10.1016/0893-6080(89)90003-8 }}{{cite journal |last1=Hornik |first1=Kurt |last2=Stinchcombe |first2=Maxwell |last3=White |first3=Halbert |title=Multilayer feedforward networks are universal approximators |journal=Neural Networks |date=January 1989 |volume=2 |issue=5 |pages=359–366 |doi=10.1016/0893-6080(89)90020-8 }} SeeHaykin, Simon (1998). Neural Networks: A Comprehensive Foundation, Volume 2, Prentice Hall. {{isbn|0-13-273350-1}}.Hassoun, M. (1995) Fundamentals of Artificial Neural Networks MIT Press, p. 48 for reviews. The following is the most often quoted:{{math_theorem

| name = Universal approximation theorem|Let C(X, \mathbb{R}^m) denote the set of continuous functions from a subset X of a Euclidean \mathbb{R}^n space to a Euclidean space \mathbb{R}^m. Let \sigma \in C(\mathbb{R}, \mathbb{R}). Note that (\sigma \circ x)_i = \sigma(x_i), so \sigma \circ x denotes \sigma applied to each component of x.

Then \sigma is not polynomial if and only if for every n \in \mathbb{N}, m \in \mathbb{N}, compact K \subseteq \mathbb{R}^n, f \in C(K, \mathbb{R}^m), \varepsilon > 0 there exist k \in \mathbb{N}, A \in \mathbb{R}^{k \times n}, b \in \mathbb{R}^k, C \in \mathbb{R}^{m \times k} such that

\sup_{x \in K} \| f(x) - g(x) \| < \varepsilon

where

g(x) = C \cdot ( \sigma \circ (A \cdot x + b) )

}}

Also, certain non-continuous activation functions can be used to approximate a sigmoid function, which then allows the above theorem to apply to those functions. For example, the step function works. In particular, this shows that a perceptron network with a single infinitely wide hidden layer can approximate arbitrary functions.

Such an f can also be approximated by a network of greater depth by using the same construction for the first layer and approximating the identity function with later layers.

{{Math proof

| title = Proof sketch

| proof = It suffices to prove the case where m = 1, since uniform convergence in \R^m is just uniform convergence in each coordinate.

Let F_\sigma be the set of all one-hidden-layer neural networks constructed with \sigma. Let C_0(\R^d, \R) be the set of all C(\R^d, \R) with compact support.

If the function is a polynomial of degree d, then F_\sigma is contained in the closed subspace of all polynomials of degree d, so its closure is also contained in it, which is not all of C_0(\R^d, \R).

Otherwise, we show that F_\sigma's closure is all of C_0(\R^d, \R). Suppose we can construct arbitrarily good approximations of the ramp function

r(x) = \begin{cases}

-1 & \text{if } x < -1 \\

\phantom{+}x & \text{if } |x|\leq 1 \\

\phantom{+}1 & \text{if } x > 1 \\

\end{cases}

then it can be combined to construct arbitrary compactly-supported continuous function to arbitrary precision. It remains to approximate the ramp function.

Any of the commonly used activation functions used in machine learning can obviously be used to approximate the ramp function, or first approximate the ReLU, then the ramp function.

if \sigma is "squashing", that is, it has limits \sigma(-\infty) < \sigma(+\infty), then one can first affinely scale down its x-axis so that its graph looks like a step-function with two sharp "overshoots", then make a linear sum of enough of them to make a "staircase" approximation of the ramp function. With more steps of the staircase, the overshoots smooth out and we get arbitrarily good approximation of the ramp function.

The case where \sigma is a generic non-polynomial function is harder, and the reader is directed to.}}

The above proof has not specified how one might use a ramp function to approximate arbitrary functions in C_0(\R^n, \R). A sketch of the proof is that one can first construct flat bump functions, intersect them to obtain spherical bump functions that approximate the Dirac delta function, then use those to approximate arbitrary functions in C_0(\R^n, \R).{{Cite book |last=Nielsen |first=Michael A. |date=2015 |title=Neural Networks and Deep Learning |url=http://neuralnetworksanddeeplearning.com/ |language=en}} The original proofs, such as the one by Cybenko, use methods from functional analysis, including the Hahn-Banach and Riesz–Markov–Kakutani representation theorems. Cybenko first published the theorem in a technical report in 1988,G. Cybenko, "Continuous Valued Neural Networks with Two Hidden Layers are Sufficient", Technical Report, Department of Computer Science, Tufts University, 1988. then as a paper in 1989.

Notice also that the neural network is only required to approximate within a compact set K. The proof does not describe how the function would be extrapolated outside of the region.

The problem with polynomials may be removed by allowing the outputs of the hidden layers to be multiplied together (the "pi-sigma networks"), yielding the generalization:

{{math_theorem

| name = Universal approximation theorem for pi-sigma networks|With any nonconstant activation function, a one-hidden-layer pi-sigma network is a universal approximator.

}}

Arbitrary-depth case

The "dual" versions of the theorem consider networks of bounded width and arbitrary depth. A variant of the universal approximation theorem was proved for the arbitrary depth case by Zhou Lu et al. in 2017. They showed that networks of width n + 4 with ReLU activation functions can approximate any Lebesgue-integrable function on n-dimensional input space with respect to L^1 distance if network depth is allowed to grow. It was also shown that if the width was less than or equal to n, this general expressive power to approximate any Lebesgue integrable function was lost. In the same paper it was shown that ReLU networks with width n + 1 were sufficient to approximate any continuous function of n-dimensional input variables.Hanin, B. (2018). Approximating Continuous Functions by ReLU Nets of Minimal Width. arXiv preprint arXiv:1710.11278. The following refinement, specifies the optimal minimum width for which such an approximation is possible and is due to.{{Cite journal |last=Park, Yun, Lee, Shin |first=Sejun, Chulhee, Jaeho, Jinwoo |date=2020-09-28 |title=Minimum Width for Universal Approximation |url=https://openreview.net/forum?id=O-XJwyoIF-k |journal=ICLR |arxiv=2006.08859 |language=en}}

{{math theorem

| name = Universal approximation theorem (L1 distance, ReLU activation, arbitrary depth, minimal width)

| math_statement = For any Bochner–Lebesgue p-integrable function f : \mathbb R^n \to \mathbb R^m and any \varepsilon > 0, there exists a fully connected ReLU network F of width exactly d_m = \max\{n + 1, m\}, satisfying

\int_{\mathbb R^n} \|f(x) - F(x)\|^p \, \mathrm{d}x < \varepsilon.

Moreover, there exists a function f \in L^p(\mathbb{R}^n, \mathbb{R}^m) and some \varepsilon > 0, for which there is no fully connected ReLU network of width less than d_m = \max\{n + 1 ,m\} satisfying the above approximation bound.

Remark: If the activation is replaced by leaky-ReLU, and the input is restricted in a compact domain, then the exact minimum width is d_m = \max\{n, m, 2\}.

Quantitative refinement: In the case where f:[0, 1]^n \rightarrow \mathbb{R} , (i.e. m = 1 ) and \sigma is the ReLU activation function, the exact depth and width for a ReLU network to achieve \varepsilon error is also known.{{cite journal |last1=Shen |first1=Zuowei |last2=Yang |first2=Haizhao |last3=Zhang |first3=Shijun |title=Optimal approximation rate of ReLU networks in terms of width and depth |journal=Journal de Mathématiques Pures et Appliquées |date=January 2022 |volume=157 |pages=101–135 |doi=10.1016/j.matpur.2021.07.009 |arxiv=2103.00502 |s2cid = 232075797 }} If, moreover, the target function f is smooth, then the required number of layer and their width can be exponentially smaller.{{cite journal |last1=Lu |first1=Jianfeng |last2=Shen |first2=Zuowei |last3=Yang |first3=Haizhao |last4=Zhang |first4=Shijun |title=Deep Network Approximation for Smooth Functions |journal = SIAM Journal on Mathematical Analysis |date=January 2021 |volume=53 |issue=5 |pages=5465–5506 |doi=10.1137/20M134695X |arxiv=2001.03040 |s2cid=210116459 }} Even if f is not smooth, the curse of dimensionality can be broken if f admits additional "compositional structure".{{Cite journal |last1=Juditsky |first1=Anatoli B. |last2=Lepski |first2=Oleg V. |last3=Tsybakov |first3=Alexandre B. |date=2009-06-01 |title=Nonparametric estimation of composite functions |journal=The Annals of Statistics |volume=37 |issue=3 |doi=10.1214/08-aos611 |s2cid=2471890 |issn=0090-5364|doi-access=free |arxiv=0906.0865 }}{{Cite journal |last1=Poggio |first1=Tomaso |last2=Mhaskar |first2=Hrushikesh |last3=Rosasco |first3=Lorenzo |last4=Miranda |first4=Brando |last5=Liao |first5=Qianli |date=2017-03-14 |title=Why and when can deep-but not shallow-networks avoid the curse of dimensionality: A review |journal=International Journal of Automation and Computing |volume=14 |issue=5 |pages=503–519 |doi=10.1007/s11633-017-1054-2 |s2cid=15562587 |issn=1476-8186|doi-access=free |arxiv=1611.00740 }}

}}

Together, the central result of yields the following universal approximation theorem for networks with bounded width (see also for the first result of this kind).

{{math theorem

| name = Universal approximation theorem (Uniform non-affine activation, arbitrary depth, constrained width).

| math_statement = Let \mathcal{X} be a compact subset of \mathbb{R}^d. Let \sigma:\mathbb{R} \to \mathbb{R} be any non-affine continuous function which is continuously differentiable at at least one point, with nonzero derivative at that point. Let \mathcal{N}_{d,D:d+D+2}^\sigma denote the space of feed-forward neural networks with d input neurons, D output neurons, and an arbitrary number of hidden layers each with d + D + 2 neurons, such that every hidden neuron has activation function \sigma and every output neuron has the identity as its activation function, with input layer \phi and output layer \rho. Then given any \varepsilon > 0 and any f \in C(\mathcal{X}, \mathbb{R}^D), there exists \hat{f} \in \mathcal{N}_{d,D:d+D+2}^\sigma such that

\sup_{x \in \mathcal{X}} \left\|\hat{f}(x) - f(x)\right\| < \varepsilon.

In other words, \mathcal{N} is dense in C(\mathcal{X}; \mathbb{R}^D) with respect to the topology of uniform convergence.

Quantitative refinement: The number of layers and the width of each layer required to approximate f to \varepsilon precision known; moreover, the result hold true when \mathcal{X} and \mathbb{R}^D are replaced with any non-positively curved Riemannian manifold.

}}

Certain necessary conditions for the bounded width, arbitrary depth case have been established, but there is still a gap between the known sufficient and necessary conditions.{{cite conference |last=Johnson |first=Jesse |conference=International Conference on Learning Representations |date=2019 |url=https://openreview.net/forum?id=ryGgSsAcFQ |title=Deep, Skinny Neural Networks are not Universal Approximators}}

Bounded depth and bounded width case

The first result on approximation capabilities of neural networks with bounded number of layers, each containing a limited number of artificial neurons was obtained by Maiorov and Pinkus. Their remarkable result revealed that such networks can be universal approximators and for achieving this property two hidden layers are enough.

{{math theorem

| name = Universal approximation theorem:

| math_statement= There exists an activation function \sigma which is analytic, strictly increasing and sigmoidal and has the following property: For any f\in C[0,1]^{d} and

\varepsilon >0 there exist constants d_{i}, c_{ij}, \theta _{ij}, \gamma _{i}, and vectors \mathbf{w}^{ij}\in \mathbb{R}^{d} for which

\left\vert f(\mathbf{x})-\sum_{i=1}^{6d+3} d_{i}\sigma \left(

\sum_{j=1}^{3d} c_{ij} \sigma (\mathbf{w}^{ij}\cdot \mathbf{x-}\theta_{ij}) - \gamma_{i}\right) \right\vert <\varepsilon

for all \mathbf{x}=(x_{1},...,x_{d})\in [0,1]^{d}.

}}

This is an existence result. It says that activation functions providing universal approximation property for bounded depth bounded width networks exist. Using certain algorithmic and computer programming techniques, Guliyev and Ismailov efficiently constructed such activation functions depending on a numerical parameter. The developed algorithm allows one to compute the activation functions at any point of the real axis instantly. For the algorithm and the corresponding computer code see. The theoretical result can be formulated as follows.

{{math theorem

| name = Universal approximation theorem:

| math_statement = Let [a,b] be a finite segment of the real line, s=b-a and \lambda be any positive number. Then one can algorithmically construct a computable sigmoidal activation function \sigma \colon \mathbb{R} \to \mathbb{R}, which is infinitely differentiable, strictly increasing on (-\infty, s) , \lambda -strictly increasing on [s,+\infty) , and satisfies the following properties:

  1. For any f \in C[a,b] and \varepsilon > 0 there exist numbers c_1,c_2,\theta_1 and \theta_2 such that for all x \in [a,b] |f(x) - c_1 \sigma(x - \theta_1) - c_2 \sigma(x - \theta_2)| < \varepsilon
  2. For any continuous function F on the d-dimensional box [a,b]^{d} and \varepsilon > 0, there exist constants e_p, c_{pq}, \theta_{pq} and \zeta_p such that the inequality \left| F(\mathbf{x}) - \sum_{p=1}^{2d+2} e_p \sigma \left( \sum_{q=1}^{d} c_{pq} \sigma(\mathbf{w}^{q} \cdot \mathbf{x} - \theta_{pq}) - \zeta_p \right) \right| < \varepsilon holds for all \mathbf{x} = (x_1, \ldots, x_d) \in [a, b]^{d}. Here the weights \mathbf{w}^{q}, q = 1, \ldots, d, are fixed as follows: \mathbf{w}^{1} = (1, 0, \ldots, 0), \quad \mathbf{w}^{2} = (0, 1, \ldots, 0), \quad \ldots, \quad \mathbf{w}^{d} = (0, 0, \ldots, 1). In addition, all the coefficients e_p, except one, are equal.

}}

Here “ \sigma \colon \mathbb{R} \to \mathbb{R} is \lambda-strictly increasing on some set X” means that there exists a strictly increasing function u \colon X \to \mathbb{R} such that |\sigma(x) - u(x)| \le \lambda for all x \in X. Clearly, a \lambda-increasing function behaves like a usual increasing function as \lambda gets small.

In the "depth-width" terminology, the above theorem says that for certain activation functions depth-2 width-2 networks are universal approximators for univariate functions and depth-3 width- (2d+2) networks are universal approximators for d-variable functions (d>1).

See also

References