pproximation capability of two hidden layer feedforward neural networks with fixed weight

We algorithmically construct a two hidden layer feedforward neural network (TLFN) model with the weights fixed as the unit coordinate vectors of the $d$-dimensional Euclidean space and having $3d+2$ number of hidden neurons in total, which can approximate any continuous $d$-variable function with an arbitrary precision. This result, in particular, shows an advantage of the TLFN model over the single hidden layer feedforward neural network (SLFN) model, since SLFNs with fixed weights do not have the capability of approximating multivariate functions.

Introduction {#sec:introduction}
============

The topic of artificial neural networks is an important and vibrant area of research in modern science. This is due to a large number of application areas. Nowadays, neural networks are being successfully applied in areas as diverse as computer science, finance, medicine, geology, engineering, physics, etc. Perhaps the greatest advantage of neural networks is their ability to be used as an arbitrary function approximation mechanism. In this paper, we are interested in questions of density (or approximation with arbitrary accuracy) of the multilayer feedforward neural network (MLFN) model. Approximation capabilities of this model have been well studied for the past 30 years. Choosing various activation functions $\sigma$ it was shown in a great number of papers that MLFNs can approximate any continuous function with an arbitrary precision. The most simple MLFN model is the single hidden layer feedforward neural network (SLFN) model. This model evaluates a multivariate function $$\label{eq:single}
  \sum_{i=1}^{k} c_{i} \sigma(\mathbf{w}^{i} \cdot \mathbf{x} - \theta_{i})$$ of the variable $\mathbf{x} = (x_1, \ldots, x_d)$, $d \ge 1$. Here the weights $\mathbf{w}^{i}$ are vectors in $\mathbb{R}^{d}$, the thresholds $\theta_{i}$ and the coefficients $c_{i}$ are real numbers, and the activation function $\sigma$ is a univariate function. A multiple hidden layer network is defined by iterations of the SLFN model. For example, the output of the two hidden layer feedforward neural network (TLFN) model with $k$ units in the first layer, $m$ units in the second layer and the input $\mathbf{x} = (x_1, \ldots, x_d)$ is $$\sum_{i=1}^{m} e_{i} \sigma \left( \sum_{j=1}^{k} c_{ij} \sigma(\mathbf{w}^{ij} \cdot \mathbf{x} - \theta_{ij}) - \zeta_{i} \right).$$ Here $d_{i}$, $c_{ij}$, $\theta_{ij}$ and $\gamma_{i}$ are real numbers, $\mathbf{w}^{ij}$ are vectors of $\mathbb{R}^{d}$, and $\sigma $ is a fixed univariate function.

In many applications, it is convenient to take an activation function $\sigma$ as a *sigmoidal function*, which is defined as $$\lim_{t \to -\infty} \sigma(t) = 0 \qquad \text{ and } \qquad \lim_{t \to +\infty} \sigma(t) = 1.$$ The literature on neural networks abounds with the use of such functions and their superpositions.

The possibility of approximating a continuous function on a compact subset of $\mathbb{R}^{d}$, $d \ge 1$, by SLFNs with a sigmoidal activation function has been tremendously studied in many papers. To the best of our knowledge, Gallant and White @GW88 were the first to prove the universal approximation property for the SLFN model with a sigmoidal activation function. Their activation function, called the *cosine squasher*, has the ability to generate any trigonometric series. As such, this function has the density property. Carroll and Dickinson @CD89 implemented the inverse Radon transformation to approximate $L^{2}$ functions, using any continuous sigmoidal function as an activation function. Cybenko @C89 proved that SLFNs with a continuous sigmoidal activation function can approximate any continuous function with arbitrary accuracy on compact subsets of $\mathbb{R}^{d}$. Funahashi @F89, independently of Cybenko, proved the density property for a continuous monotone sigmoidal function. Hornik, Stinchcombe and White @HSW89 proved density of SLFNs with a discontinuous bounded sigmoidal function. Krková @K92 showed that staircase-like functions of any sigmoidal type has the capability of approximating continuous univariate functions on any compact subset of $\mathbb{R}$ within arbitrarily small tolerance. This result was substantially used in Krková's further results, which showed that a continuous multivariate function can be approximated arbitrarily well by TLFNs with a sigmoidal activation function (see @K91 [@K92]). Chen, Chen and Liu @CCL92 generalized the result of Cybenko by proving that any continuous function on a compact subset of $\mathbb{R}^{d}$ can be approximated by SLFNs with a bounded (not necessarily continuous) sigmoidal activation function. Almost the same result was independently obtained by Jones @J90. Costarelli and Spigler @CS13 constructed special sums of the form (\[eq:single\]), using a given function $f\in C[a,b]$. They then proved that these sums approximate $f$ within any degree of accuracy. In their result, similar to @CCL92, $\sigma$ is any bounded sigmoidal function. Chui and Li @CL92 proved that SLFNs with a continuous sigmoidal activation function having integer weights and thresholds can approximate continuous univariate functions on any compact subset of the real line.

In a number of subsequent papers, which considered the density problem for the SLFN model, nonsigmoidal activation functions were allowed. Here we cite a few of them. The papers by Stinchcombe and White @SW90, Cotter @C90, Hornik @H91, Mhaskar and Micchelli @MM92 are among many others. It should be remarked that the more general result in this direction belongs to Leshno, Lin, Pinkus and Schocken @LLPS93. They proved that the necessary and sufficient condition for any continuous activation function to have the density property is that it not be a polynomial. For more detailed discussion of the density problem, see the review paper by Pinkus @P99.

The above results show that SLFNs with various activation functions enjoy the universal approximation property. In recent years, the theory of neural networks has been developed further in this direction. For example, from the point of view of practical applications, SLFNs with a restricted set of weights have gained a special interest (see, e.g., @D02 [@I12; @I15; @IS17; @JYJ10; @LFN04]). It was proved that SLFNs with some restricted set of weights still possess the universal approximation property. For example, Stinchcombe and White @SW90 showed that SLFNs with a polygonal, polynomial spline or analytic activation function and a bounded set of weights have the universal approximation property. Ito @I91 [@I92] investigated this property of networks using monotone sigmoidal functions, with only weights located on the unit sphere. In @I12 [@I15; @IS17], the second coauthor considered SLFNs with weights varying on a restricted set of directions, and gave several necessary and sufficient conditions for good approximation by such networks. For a set of weights consisting of two directions, he showed that there is a geometrically explicit solution to the problem. Hahm and Hong @HH04 went further in this direction, and showed that SLFNs with fixed weights can approximate arbitrarily well any continuous univariate function. Since fixed weights reduce the computational expense and training time, this result is of particular interest. In a mathematical formulation, the result says that for a bounded measurable sigmoidal function $\sigma$, networks of the form $\sum_{i=1}^{k} c_{i} \sigma(\alpha x - \theta_{i})$ are dense in $C[a, b]$. Cao and Xie @CX10 strengthened this result by specifying the number of hidden neurons to realize $\varepsilon$-approximation to any continuous function. By implementing modulus of continuity, they established Jackson-type upper bound estimations for the approximation error.

Approximation capabilities of SLFNs with fixed weights were also analyzed in Lin, Guo, Cao and Xu @LGCX13. Taking the activation function $\sigma$ as a continuous, even and $2\pi$-periodic function, the authors of @LGCX13 showed that neural networks of the form $\sum_{i=1}^{r} c_{i} \sigma(x-x_{i})$ can approximate any continuous function on $[-\pi, \pi]$ with an arbitrary precision $\varepsilon$. Note that all the weights are fixed equal to $1$, and consequently do not depend on $\varepsilon$. To prove this, they first gave an integral representation for trigonometric polynomials, and constructed explicitly a network with the weight $1$ that approximates this integral representation. Finally, the obtained result for trigonometric polynomials was used to prove a Jackson-type upper bound for the approximation error.

Note that SLFNs with a fixed number of weights cannot approximate $d$-variable functions if $d > 1$. That is, if in (\[eq:single\]) we have $n$ different weights $\mathbf{w}^{i}$ ($n$ is fixed), then there exist a compact set $Q \subset \mathbb{R}^{d}$ and a function $f\in C(Q)$, which cannot be approximated arbitrarily well by the networks formed as (\[eq:single\]). This follows from a result of Lin and Pinkus on sums of $n$ ridge functions (see @LP93 [Theorem 5.1]). For details, see our recent paper @GI18. Thus the above results of Hahm and Hong @HH04, Cao and Xie @CX10, Lin, Guo, Cao and Xu @LGCX13 cannot be generalized to the $d$-dimensional case if one allows only the SLFN model of neural networks.

It should be remarked that in all of the above-mentioned works the number of neurons $k$ in the hidden layer is not fixed. As such to achieve a desired precision one may take an excessive number of hidden neurons. Unfortunately, practicality decreases with the increase of the number of neurons in the hidden layer. In other words, SLFNs are not always effective if the number of neurons in the hidden layer is prescribed. More precisely, they are effective if and only if we consider univariate functions. In @GI16, we consider constructive approximation on any finite interval of $\mathbb{R}$ by SLFNs with a fixed number of hidden neurons. We construct algorithmically a smooth, sigmoidal, almost monotone activation function $\sigma$ providing approximation to an arbitrary univariate continuous function within any degree of accuracy. Note that the result of @GI16 is not applicable to multivariate functions.

The first crucial step in investigating approximation capabilities of MLFNs with a prescribed number of hidden neurons was made by Maiorov and Pinkus @MP99. Their remarkable result revealed that TLFNs with $3d$ units in the first layer and $6d + 3$ units in the second layer can approximate an arbitrary continuous $d$-variable function. Using a different activation function than in @MP99, the second coauthor @I14 showed that the number of neurons in hidden layers can be reduced to $d$ and $2d + 2$ respectively. Note that the results of both papers carry a theoretical character, as they indicate only the existence of the corresponding TLFNs, their activation functions.

We see that in each result above at least one of the following general properties is violated.

1.  the number of hidden neurons is fixed;

2.  the weights are fixed;

3.  the activation function is computable;

4.  the network has the capability of approximating $d$-variable functions in the case $d > 1$.

In this paper, we construct a special TLFN model that satisfies all of the properties (1)–(4). In addition, we show that along with the number of hidden neurons and weights, it is also possible to fix some dilation coefficients of the constructed activation function.

The main result {#sec:result}
===============

In the sequel, we deal with an activation function, which is monotonic in the weak sense. Here by *weak monotonicity* we understand behavior of a function whose difference in absolute value from a monotonic function is a sufficiently small number. In this regard we say that a real function $f$ defined on a set $X \subseteq \mathbb{R}$ is *$\lambda$-increasing* (respectively, *$\lambda $-decreasing*) if there exists an increasing (respectively, decreasing) function $u \colon X \to \mathbb{R}$ such that $|f(x) - u(x)| \le \lambda$ for all $x \in X$. Clearly, $0$-monotonicity coincides with the usual concept of monotonicity and a $\lambda_1$-increasing function is $\lambda_{2}$-increasing if $\lambda_1 \le \lambda_{2}$.

Our main result is the following theorem.

\[thm:main\] Assume a closed interval $[a,b] \subset \mathbb{R}$ is given, $s = b - a$, and $\lambda $ is any sufficiently small positive real number. Then one can algorithmically construct a computable, infinitely differentiable, sigmoidal activation function $\sigma \colon \mathbb{R} \to \mathbb{R}$ which is strictly increasing on $(-\infty, s)$, $\lambda$-strictly increasing on $[s, +\infty)$ and satisfies the following property: 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.

We start with the algorithmic construction of $\sigma$ mentioned in the theorem. The algorithm consists of the following steps.

1\. Consider the function $$h(x) := 1 - \frac{\min\{1/2, \lambda\}}{1 + \log(x - s + 1)}.$$ Obviously, this function is strictly increasing on the real line and satisfies the following properties:

1.  $0 < h(x) < 1$ for all $x \in [s, +\infty)$;

2.  $1 - h(s) \le \lambda$;

3.  $h(x) \to 1$ as $x \to +\infty$.

Our purpose is to construct $\sigma$ satisfying the two-sided inequality $$\label{eq:h_sigma_1}
  h(x) < \sigma(x) < 1$$ for $x \in [s, +\infty)$. Then our $\sigma$ will approach $1$ as $x$ approaches $+\infty$ and obey the inequality $$|\sigma(x) - h(x)| \le \lambda,$$ that is, it will be a $\lambda$-increasing function.

2\. In this step, we enumerate the monic polynomials with rational coefficients. Let $q_n$ be the Calkin–Wilf sequence (see @CW00). We can enumerate all the rational numbers by setting $$r_0 := 0, \quad r_{2n} := q_n, \quad r_{2n-1} := -q_n, \ n = 1, 2, \dots.$$ Note that each monic polynomial with rational coefficients can uniquely be written as $r_{k_0} + r_{k_1} x + \ldots + r_{k_{l-1}} x^{l-1} + x^l$, and each positive rational number determines a unique finite continued fraction $$[m_0; m_1, \ldots, m_l] := m_0 + \dfrac1{m_1 + \dfrac1{m_2 + \dfrac1{\ddots + \dfrac1{m_l}}}}$$ with $m_0 \ge 0$, $m_1, \ldots, m_{l-1} \ge 1$ and $m_l \ge 2$. We now construct a one-to-one mapping between the set of all monic polynomials with rational coefficients and the set of all positive rational numbers as follows. To the only zeroth-degree monic polynomial 1 we associate the rational number 1, to each first-degree monic polynomial of the form $r_{k_0} + x$ we associate the rational number $k_0 + 2$, to each second-degree monic polynomial of the form $r_{k_0} + r_{k_1} x + x^2$ we associate the rational number $[k_0; k_1 + 2] = k_0 + 1 / (k_1 + 2)$, and to each monic polynomial $$r_{k_0} + r_{k_1} x + \ldots + r_{k_{l-2}} x^{l-2} + r_{k_{l-1}} x^{l-1} + x^l$$ of degree $l \ge 3$ we associate the rational number $[k_0; k_1 + 1, \ldots, k_{l-2} + 1, k_{l-1} + 2]$. In other words, we define $u_1(x) := 1$, $$u_n(x) := r_{q_n-2} + x$$ if $q_n \in \mathbb{Z}$, $$u_n(x) := r_{m_0} + r_{m_1-2} x + x^2$$ if $q_n = [m_0; m_1]$, and $$u_n(x) := r_{m_0} + r_{m_1-1} x + \ldots + r_{m_{l-2}-1} x^{l-2} + r_{m_{l-1}-2} x^{l-1} + x^l$$ if $q_n = [m_0; m_1, \ldots, m_{l-2}, m_{l-1}]$ with $l \ge 3$. Hence the first few elements of this sequence are defined as $$1, \quad x^2, \quad x, \quad x^2 - x, \quad x^2 - 1, \quad x^3, \quad x - 1, \quad x^2 + x, \quad \ldots.$$ The sequence of monic polynomials will be used in the sequel.

3\. First we construct $\sigma$ on the intervals $[(2n-1)s, 2ns]$, $n = 1, 2, \ldots$. For each monic polynomial $u_n(x) = \rho_0 + \rho_1 x + \ldots + \rho_{l-1} x^{l-1} + x^l$ with rational coefficients, set $$B_1 := \rho_0 + \frac{\rho_1-|\rho_1|}{2} + \ldots + \frac{\rho_{l-1} - |\rho_{l-1}|}{2}$$ and $$B_2 := \rho_0 + \frac{\rho_1+|\rho_1|}{2} + \ldots + \frac{\rho_{l-1} + |\rho_{l-1}|}{2} + 1.$$ Note that the numbers $B_1$ and $B_2$ depend on $n$, but for simplicity we will omit this in the notation.

Consider the sequence $$M_n := h((2n+1)s), \qquad n = 1, 2, \ldots.$$ Obviously, this sequence is strictly increasing and converges to $1$.

Now we define $\sigma$ as the function $$\label{eq:sigma_again}
\sigma(x) := a_n + b_n u_n \left( \frac{x}{s} - 2n + 1 \right), \quad x \in [(2n-1)s, 2ns].$$ Here $$\label{eq:a_1, b_1}
  a_1 := \frac{1}{2}, \qquad b_1 := \frac{h(3s)}{2},$$ and $$\label{eq:a_n, b_n}
  a_n := \frac{(1 + 2M_n) B_2 - (2 + M_n) B_1}{3(B_2 - B_1)}, \qquad b_n := \frac{1 - M_n}{3(B_2 - B_1)}, \qquad n = 2, 3, \ldots.$$

It is not difficult to see that for $n>2$ the numbers $a_n$, $b_n$ are the coefficients of the linear function $y = a_n + b_n x$ mapping the closed interval $[B_1, B_2]$ onto the closed interval $[(1+2M_n)/3, (2+M_n)/3]$. In addition, for $n=1$, i.e. on the interval $[s,2s]$, $$\sigma(x) = \frac{1+M_1}{2}.$$ Thus, we obtain that $$\label{eq:h_M_sigma_1}
  h(x) < M_n < \frac{1+2M_n}{3} \le \sigma(x) \le \frac{2+M_n}{3} < 1,$$ for all $x \in [(2n-1)s, 2ns]$, $n = 1$, $2$, $\ldots$.

4\. In this step, we construct $\sigma$ on the intervals $[2ns, (2n+1)s]$, $n = 1, 2, \ldots$. To this end we use the *smooth transition function* $$\beta_{a,b}(x) := \frac{\widehat{\beta}(b-x)}{\widehat{\beta}(b-x) + \widehat{\beta}(x-a)},$$ where $$\widehat{\beta}(x) := \begin{cases} e^{-1/x}, & x > 0, \\ 0, & x \le 0. \end{cases}$$ Clearly, $\beta_{a,b}(x) = 1$ for $x \le a$, $\beta_{a,b}(x) = 0$ for $x \ge b$, and $0 < \beta_{a,b}(x) < 1$ for $a < x < b$.

Consider the sequence $$K_n := \frac{\sigma(2ns) + \sigma((2n+1)s)}{2}, \qquad n = 1, 2, \ldots.$$ Recall that the numbers $\sigma(2ns)$ and $\sigma((2n+1)s)$ have already been defined in the previous step. Since both the numbers $\sigma(2ns)$ and $\sigma((2n+1)s)$ belong to the interval $(M_n, 1)$, it follows that $K_n \in (M_n, 1)$.

First we extend $\sigma$ smoothly to the interval $[2ns, 2ns + s/2]$. Take the number $\varepsilon := (1 - M_n)/6$ and select $\delta \le s/2$ such that $$\label{eq:epsilon}
  \left| a_n + b_n u_n \left( \frac{x}{s} - 2n + 1 \right) - \left( a_n + b_n u_n(1) \right) \right| \le \varepsilon, \quad x \in [2ns, 2ns + \delta].$$ One can select this $\delta$ as $$\delta := \min\left\{ \frac{\varepsilon s}{b_n C}, \frac{s}{2} \right\},$$ where $C > 0$ is any number satisfying $|u'_n(x)| \le C$ for $x \in
(1, 1.5)$. For example, if $n=1$, then $\delta$ can be selected as $s/2$. Now define $\sigma$ on the left-hand half of the interval $[2ns, (2n+1)s]$ as the function $$\label{eq:sigma_left}
\begin{split}
  \sigma(x) & := K_n - \beta_{2ns, 2ns + \delta}(x) \\
  & \times \left(K_n - a_n - b_n u_n \left( \frac{x}{s} - 2n + 1 \right)\right), \quad x \in \left[ 2ns, 2ns + \frac{s}{2} \right].
\end{split}$$

Let us prove that $\sigma(x)$ satisfies the condition (\[eq:h\_sigma\_1\]). Indeed, if $2ns + \delta \le x \le 2ns + s/2$, then there is nothing to prove, since $\sigma(x) = K_n \in (M_n, 1)$. If $2ns \le x < 2ns + \delta$, then $0 < \beta_{2ns, 2ns+\delta}(x) \le 1$ and hence from (\[eq:sigma\_left\]) we obtain that for each $x \in [2ns, 2ns + \delta)$, $\sigma(x)$ is between the numbers $K_n$ and $A_n(x) := a_n + b_n u_n \left( \frac{x}{s} - 2n + 1 \right)$. On the other hand, from (\[eq:epsilon\]) it follows that $$a_n + b_n u_n(1) - \varepsilon \le A_n(x) \le a_n + b_n u_n(1) + \varepsilon.$$ The last inequality together with (\[eq:sigma\_again\]) and the inequalities (\[eq:h\_M\_sigma\_1\]) yields that $A_n(x) \in \left[ \frac{1+2M_n}{3} - \varepsilon, \frac{2+M_n}{3} + \varepsilon \right]$ for $x \in [2ns, 2ns + \delta)$. Since $\varepsilon = (1 - M_n)/6$, the inclusion $A_n(x) \in (M_n, 1)$ is valid. Now since both $K_n$ and $A_n(x)$ lie in the interval $(M_n, 1)$, we conclude that $$h(x) < M_n < \sigma(x) < 1, \quad \text{for } x \in \left[ 2ns, 2ns + \frac{s}{2} \right].$$

We define $\sigma$ on the right-hand half of the interval in a similar way: $$\begin{split}
  \sigma(x) & := K_n - (1 - \beta_{(2n+1)s - \overline{\delta}, (2n+1)s}(x)) \\
  & \times \left(K_n - a_{n+1} - b_{n+1} u_{n+1} \left( \frac{x}{s} - 2n - 1 \right)\right), \quad x \in \left[ 2ns + \frac{s}{2}, (2n+1)s \right],
\end{split}$$ where $$\overline{\delta} := \min\left\{ \frac{\overline{\varepsilon}s}{b_{n+1} \overline{C}}, \frac{s}{2} \right\}, \qquad \overline{\varepsilon} := \frac{1 - M_{n+1}}{6}, \qquad \overline{C} \ge \sup_{[-0.5, 0]} |u'_{n+1}(x)|.$$ It is not difficult to verify, as above, that the constructed $\sigma(x)$ satisfies the condition (\[eq:h\_sigma\_1\]) on $[2ns + s/2, 2ns + s]$ and $$\sigma \left( 2ns + \frac{s}{2} \right) = K_n, \qquad \sigma^{(i)} \left( 2ns + \frac{s}{2} \right) = 0, \quad i = 1, 2, \ldots.$$

Steps 3 and 4 together construct $\sigma$ on the interval $[s, +\infty)$.

5\. On the remaining interval $(-\infty, s)$, we define $\sigma$ as $$\sigma(x) := \left( 1 - \widehat{\beta}(s-x) \right) \frac{1 + M_1}{2}, \quad x \in (-\infty, s).$$ Clearly, $\sigma$ is a strictly increasing, smooth function on $(-\infty, s)$. In addition, $\sigma(x) \to \sigma(s) = (1 + M_1) / 2$, as $x$ tends to $s$ from the left and $\sigma^{(i)}(s) = 0$ for $i = 1$, $2$, $\ldots$. This final step completes the construction of $\sigma$ on the whole real line. Note that the constructed $\sigma$ is sigmoidal, infinitely differentiable on $\mathbb{R}$, strictly increasing on $(-\infty, s)$ and $\lambda$-strictly increasing on $[s, +\infty)$.

It should be noted that the above algorithm allows one to compute $\sigma$ at any point of the real axis instantly. The code of this algorithm is available at <https://sites.google.com/site/njguliyev/papers/tlfn>. As a practical example, we give here the graph of $\sigma$ (see Figure \[fig:sigma50\]) and a numerical table (see Table \[tbl:sigma\]) containing several computed values of this function on the interval $[0, 50]$. All computations were done in SageMath @Sage. Figure \[fig:sigma100\_lambda\] shows how the graph of the $\lambda$-increasing function $\sigma$ changes on the interval $[0, 100]$ as the parameter $\lambda$ decreases. Figure \[fig:sigma100\_s\] displays variations in the graph of $\sigma$ with respect to the length $s$ of a closed interval $[a, b]$.

![The graph of $\sigma$ on $[0, 50]$ ($s = 3$, $\lambda = 1/2$)<span data-label="fig:sigma50"></span>](monic-0-50){width="100.00000%"}

   $t$   $\sigma$    $t$    $\sigma$    $t$    $\sigma$    $t$    $\sigma$    $t$    $\sigma$
  ----- ----------- ------ ----------- ------ ----------- ------ ----------- ------ -----------
   $0$   $0.25941$   $10$   $0.91169$   $20$   $0.94932$   $30$   $0.96241$   $40$   $0.94166$
   $1$   $0.36008$   $11$   $0.92728$   $21$   $0.94074$   $31$   $0.94506$   $41$   $0.95333$
   $2$   $0.57848$   $12$   $0.95325$   $22$   $0.93635$   $32$   $0.94003$   $42$   $0.96499$
   $3$   $0.91514$   $13$   $0.93437$   $23$   $0.93635$   $33$   $0.92771$   $43$   $0.95602$
   $4$   $0.91514$   $14$   $0.92551$   $24$   $0.94074$   $34$   $0.92905$   $44$   $0.94295$
   $5$   $0.91514$   $15$   $0.91549$   $25$   $0.93278$   $35$   $0.93842$   $45$   $0.93186$
   $6$   $0.91514$   $16$   $0.92958$   $26$   $0.93177$   $36$   $0.96385$   $46$   $0.93943$
   $7$   $0.91198$   $17$   $0.94366$   $27$   $0.92482$   $37$   $0.94692$   $47$   $0.95079$
   $8$   $0.91105$   $18$   $0.95775$   $28$   $0.92900$   $38$   $0.93923$   $48$   $0.96593$
   $9$   $0.90650$   $19$   $0.95532$   $29$   $0.94153$   $39$   $0.92999$   $49$   $0.95800$

  : Some computed values of $\sigma$ ($s = 3$, $\lambda = 1/2$)<span data-label="tbl:sigma"></span>

![Changes in the graph of $\sigma$ with respect to $\lambda$ ($s = 1$)<span data-label="fig:sigma100_lambda"></span>](monic-0-100_lambda){width="100.00000%"}

![Changes in the graph of $\sigma$ with respect to $s$ ($\lambda = 0.75$)<span data-label="fig:sigma100_s"></span>](monic-0-100_s){width="100.00000%"}

Now we show that in addition to its nice properties such as computability, smoothness and weak monotonicity, our $\sigma$ enjoys an important property of approximating each continuous $d$-variable function as an activation function for TLFNs with a fixed number of hidden neurons.

It follows from (\[eq:sigma\_again\]) that $$\label{eq:sigma_d}
  \sigma(s x + (2n-1) s) = a_n + b_n u_n(x), \qquad x \in [0, 1]$$ for $n = 1$, $2$, $\ldots$. Here $a_n$ and $b_n$ are computed by (\[eq:a\_1, b\_1\]) and (\[eq:a\_n, b\_n\]) for $n = 1$ and $n > 1$ respectively. From (\[eq:sigma\_d\]) we obtain that each monic polynomial $u_n$, $n = 1$, $2$, $\ldots$, can be represented in the form $$\label{eq:u}
  u_n(x) = \frac{1}{b_n} \sigma(s x + (2n - 1) s) - \frac{a_n}{b_n}.$$

Let now $f$ be any continuous function on the box $[a, b]^d$. By the Kolmogorov superposition theorem @K57 in the form given by Lorentz @L65 and Sprecher @S65, there exist constants $\lambda_q > 0$, $q = 1$, $\ldots$, $d$ with $\sum_{q=1}^{d} \lambda_q = 1$ and nondecreasing continuous functions $\phi_p \colon [a, b] \to [0, 1]$, $p = 1$, $\ldots$, $2d + 1$ such that every continuous function $f \colon [a, b]^d \to \mathbb{R}$ admits the representation $$\label{eq:Kolmogorov}
  f(x_1, \ldots, x_d) = \sum_{p=1}^{2d+1} g \left( \sum_{q=1}^d \lambda_q \phi_p(x_q) \right)$$ for some $g \in C[0, 1]$ depending on $f$.

By the density of polynomials with the rational coefficients in the space of continuous functions over any compact subset of $\mathbb{R}$, for the exterior continuous univariate function $g$ in (\[eq:Kolmogorov\]) and any $\varepsilon > 0$ there exists a polynomial $p(x)$ of the mentioned form such that $$|g(x) - p(x)| < \frac{\varepsilon}{2(2d+1)}$$ for all $x \in [0, 1]$. Denote by $p_0$ the leading coefficient of $p$. If $p_0\neq 0$ (i.e., $p\not\equiv 0$) then we define $u_{n}$ as $u_{n}(x):=p(x)/p_0$, otherwise we just set $u_{n}(x):=1$. In both cases $$|g(x) - p_0 u_n(x)| < \frac{\varepsilon}{2(2d+1)}, \qquad x \in [0, 1].$$ This together with (\[eq:u\]) means that $$\label{eq:g}
  |g(x) - (\alpha_0 \sigma(s x - \beta_0) - \gamma_0)| < \frac{\varepsilon}{2(2d+1)}$$ for some $\alpha_0$, $\beta_0$, $\gamma_0 \in \mathbb{R}$ and all $x \in [0,1]$. Namely, $$\label{eq:coef}
  \alpha_0 = \frac{p_0}{b_n}, \qquad \beta_0 = s - 2ns, \qquad \gamma_0 = \frac{p_0 a_n}{b_n}.$$ Substituting (\[eq:g\]) in (\[eq:Kolmogorov\]) we obtain that $$\label{eq:f}
  \left\vert f(x_1, \ldots, x_d) - \sum_{p=1}^{2d+1} \left( \alpha_0 \sigma \left( s \sum_{q=1}^d \lambda_q \phi_p(x_q) - \beta_0 \right) - \gamma_0 \right) \right\vert < \frac{\varepsilon}{2}$$ for all $(x_1, \ldots, x_d) \in [0,1]^d$.

For each $p=1$, $\ldots$, $2d+1$, the function $\phi_p$ in (\[eq:Kolmogorov\]) is defined on $[a,b]$. For this function, using the linear transformation $x = (t-a)/s$ from $[a,b]$ to $[0,1]$ and the same procedure for the function $g$ above, we can obtain the inequality $$\label{eq:fip}
  \left\vert \phi_p(t) - (\alpha_p \sigma(t - \beta_p) - \gamma_p) \right\vert < \delta,$$ for all $t \in [a,b]$. Here $\delta$ is any positive real number, and the parameters $\alpha_p$, $\beta_p$ and $\gamma_p$ depend on $\delta$. Note that these parameters can be computed similarly as in (\[eq:coef\]).

Since $\lambda_q > 0$ for $q = 1$, $\ldots$, $d$, and $\sum_{q=1}^d \lambda_q = 1$, it follows from (\[eq:fip\]) that $$\label{eq:sumfip}
  \left\vert \sum_{q=1}^d \lambda_q \phi_p(x_q) - \left( \sum_{q=1}^d \lambda_q \alpha_p \sigma(x_q - \beta_p) - \gamma_p \right) \right\vert < \delta,$$ for all $p = 1$, $\ldots$, $2d+1$, and $(x_1, \ldots, x_d) \in [0,1]^{d}$.

Now since the function $\alpha_0 \sigma(s x - \beta_0)$ is uniformly continuous on every closed interval of the real line, we can choose $\delta$ as small as necessary and obtain from (\[eq:sumfip\]) that $$\begin{gathered}
  \left\vert \sum_{p=1}^{2d+1} \alpha_0 \sigma \left( s \sum_{q=1}^d \lambda_q \phi_p(x_q) - \beta_0 \right) \right. \\
  \left. - \sum_{p=1}^{2d+1} \alpha_0 \sigma \left( s \left( \sum_{q=1}^d \lambda_q \alpha_p \sigma(x_q - \beta_p) - \gamma_p \right) - \beta_0 \right) \right\vert < \frac{\varepsilon}{2}.\end{gathered}$$ This inequality may be rewritten in the form $$\label{eq:big}
  \left\vert \sum_{p=1}^{2d+1} \alpha_0 \sigma \left( s \sum_{q=1}^d \lambda_q \phi_p(x_q) - \beta_0 \right) - \sum_{p=1}^{2d+1} \alpha_0 \sigma \left( \sum_{q=1}^d c_{pq} \sigma (\mathbf{w}^{q} \cdot \mathbf{x} - \beta_p) - \zeta_p \right) \right\vert < \frac{\varepsilon}{2},$$ where $c_{pq} = s \lambda_q \alpha_p$, $\zeta_p = s \gamma_p + \beta_0$, and $\mathbf{w}^{q}$ is the $q$-th coordinate vector. From (\[eq:f\]) and (\[eq:big\]) it follows that $$\label{eq:f2}
  \left\vert f(\mathbf{x}) - \left( \sum_{p=1}^{2d+1} \alpha_0 \sigma \left( \sum_{q=1}^d c_{pq} \sigma(\mathbf{w}^{q} \cdot \mathbf{x} - \beta_p) - \zeta_p \right) - (2d+1) \gamma_0 \right) \right\vert < \varepsilon,$$ Clearly, the constant $(2d+1) \gamma_0$ can be written in the form $$\label{eq:const}
  (2d+1) \gamma_0 = \alpha \sigma \left( \sum_{q=1}^d c_q \sigma(\mathbf{w}^{q} \cdot \mathbf{x} - \theta_q) - \zeta \right),$$ for $c_q = 0$, $q = 1$, $\ldots$, $d$, and suitable coefficients $\alpha$ and $\zeta$. Considering (\[eq:const\]) in (\[eq:f2\]) we finally obtain that $$\left\vert f(\mathbf{x}) - \left( \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) \right\vert < \varepsilon,$$ where $e_1 = e_2 = \ldots = e_{2d+1}$. The last inequality completes the proof of the theorem.

Obviously, a compact subset $Q$ of the space $\mathbb{R}^{d}$ can be embedded into a box $[-l,l]^{d}$, and by the Tietze extension theorem (see @W70 [Theorem 15.8]), any continuous function $f$ on $Q$ can be extended to $[-l,l]^{d}$. Hence Theorem \[thm:main\] is valid not only for boxes of the form $[a,b]^{d}$ but for any compact set $Q \subset \mathbb{R}^{d}$, with the proviso that $s = 2 l$.

Theorem \[thm:main\], in particular, shows that TLFNs are more powerful than SLFNs, since SLFNs with a fixed number of hidden neurons and/or weights have not the capability of approximating multivariate functions (see Introduction). We refer the reader to @L17 for interesting results and discussions around the comparison of performances between MLFNs and SLFNs.

In @G03, Gripenberg showed that the general approximation property of feedforward multilayer perceptron networks can be achieved in networks where the number of neurons in each layer is bounded, but the number of layers grows to infinity. This is the case provided the activation function is twice continuously differentiable and not linear. Taking an exceedingly large number of layers is an indispensable part of Gripenberg's method. Can one develop a different method which enables to use only a preliminarily prescribed number of layers for all approximated functions? To answer this question, we started with SLFNs. It turned out that in this case the answer is "yes" if approximated functions are univariate (see @GI16). Moreover, one can fix the weights of constructed SLFNs. But SLFNs with fixed weights or bounded number of neurons are proved not capable of approximating multivariate functions (see @GI18). Then how many hidden layers with bounded number of neurons are needed to approximate multivariate functions with arbitrary precision? First of all, one may want to know if any such constrained approximation is possible in practice. Theorem \[thm:main\] shows that even two hidden layers and a specifically constructed activation function are sufficient to solve this problem affirmatively.

<span>99</span>

N. Calkin and H. S. Wilf, *Recounting the rationals*, Amer. Math. Monthly **107** (2000), 360–367.

F. Cao and T. Xie, *The construction and approximation for feedforword neural networks with fixed weights*, Proceedings of the ninth international conference on machine learning and cybernetics, Qingdao, 2010, pp. 3164–3168.

S. M. Carroll and B. W. Dickinson, *Construction of neural nets using the Radon transform*, Proceedings of the 1989 IEEE international joint conference on neural networks, vol. 1, IEEE, New York, 1989, pp. 607–611.

T. Chen, H. Chen and R. Liu, *A constructive proof of Cybenko's approximation theorem and its extensions*, Computing science and statistics, Springer, 1992, pp. 163–168.

C. K. Chui and X. Li, *Approximation by ridge functions and neural networks with one hidden layer*, J. Approx. Theory **70** (1992), 131–141.

D. Costarelli and R. Spigler, *Constructive approximation by superposition of sigmoidal functions*, Anal. Theory Appl. **29** (2013), 169–196.

N. E. Cotter, *The Stone–Weierstrass theorem and its application to neural networks*, IEEE Trans. Neural Networks **1** (1990), 290–295.

G. Cybenko, *Approximation by superpositions of a sigmoidal function*, Math. Control Signal Systems **2** (1989), 303–314.

S. Draghici, *On the capabilities of neural networks using limited precision weights*, Neural Networks **15** (2002), 395–414.

K. Funahashi, *On the approximate realization of continuous mapping by neural networks*, Neural Networks **2** (1989), 183–192.

A. R. Gallant and H. White, *There exists a neural network that does not make avoidable mistakes*, Proceedings of the IEEE 1988 international conference on neural networks, vol. 1, IEEE Press, New York, 1988, pp. 657–664.

G. Gripenberg, *Approximation by neural networks with a bounded number of nodes at each level*, J. Approx. Theory **122** (2003), no. 2, 260–266.

N. J. Guliyev and V. E. Ismailov, *A single hidden layer feedforward network with only one neuron in the hidden layer can approximate any univariate function*, Neural Computation **28** (2016), no. 7, 1289–1304. [arXiv:1601.00013](https://arxiv.org/abs/1601.00013)

N. J. Guliyev and V. E. Ismailov, *On the approximation by single hidden layer feedforward neural networks with fixed weights*, Neural Networks **98** (2018), 296–304. [arXiv:1708.06219](https://arxiv.org/abs/1708.06219)

N. Hahm and B.I. Hong, *An approximation by neural networks with a fixed weight*, Comput. Math. Appl. **47** (2004), no. 12, 1897–1903.

K. Hornik, *Approximation capabilities of multilayer feedforward networks*, Neural Networks **4** (1991), 251–257.

K. Hornik, M. Stinchcombe and H. White, *Multilayer feedforward networks are universal approximators*, Neural Networks **2** (1989), 359–366.

V. E. Ismailov, *Approximation by neural networks with weights varying on a finite set of directions*, J. Math. Anal. Appl. **389** (2012), no. 1, 72–83.

V. E. Ismailov, *On the approximation by neural networks with bounded number of neurons in hidden layers*, J. Math. Anal. Appl. **417** (2014), no. 2, 963–969.

V. E. Ismailov, *Approximation by ridge functions and neural networks with a bounded number of neurons*, Appl. Anal. **94** (2015), no. 11, 2245–2260.

V. E. Ismailov and E. Savas, *Measure theoretic results for approximation by neural networks with limited weights*, Numer. Funct. Anal. Optim. **38** (2017), no. 7, 819–830.

Y. Ito, *Representation of functions by superpositions of a step or sigmoid function and their applications to neural network theory*, Neural Networks **4** (1991), 385–394.

Y. Ito, *Approximation of continuous functions on $\mathbb{R}^d$ by linear combinations of shifted rotations of a sigmoid function with and without scaling*, Neural Networks **5** (1992), 105–115.

B. Jian, C. Yu and Y. Jinshou, *Neural networks with limited precision weights and its application in embedded systems*, Proceedings of the the second international workshop on education technology and computer science, Wuhan, 2010, pp. 86–91.

L. K. Jones, *Constructive approximations for neural networks by sigmoidal functions*, Proc. IEEE **78** (1990), no. 10, 1586–1589; Correction and addition, Proc. IEEE **79** (1991), no. 2, 243.

A. N. Kolmogorov, *On the representation of continuous functions of many variables by superposition of continuous functions of one variable and addition* (Russian), Dokl. Akad. Nauk SSSR **114** (1957), 953–956; English transl. in Amer. Math. Soc. Transl. (2) **28** (1963), 55–59.

V. Krková, *Kolmogorov's theorem is relevant*, Neural Comput. **3** (1991), 617–622.

V. Krková, *Kolmogorov's theorem and multilayer neural networks*, Neural Networks **5** (1992), 501–506.

M. Leshno, V. Ya. Lin, A. Pinkus and S. Schocken, *Multilayer feedforward networks with a non-polynomial activation function can approximate any function*, Neural Networks **6** (1993), 861–867.

Y. Liao, S.-C. Fang and H. L. W. Nuttle, *A neural network model with bounded-weights for pattern classification*, Comput. Oper. Res. **31** (2004), 1411–1426.

S. Lin, *Limitations of shallow nets approximation*, Neural Networks **94** (2017), 96–102.

S. Lin, X. Guo, F. Cao and Z. Xu, *Approximation by neural networks with scattered data* Appl. Math. Comput. **224** (2013), 29–35.

V. Ya. Lin and A. Pinkus, *Fundamentality of ridge functions*, J. Approx. Theory **75** (1993), 295–311.

G. G. Lorentz, *Metric entropy, widths, and superpositions of functions*, Amer. Math. Monthly **69** (1962), 469–485.

V. Maiorov and A. Pinkus, *Lower bounds for approximation by MLP neural networks*, Neurocomputing **25** (1999), 81–91.

H. N. Mhaskar and C. A. Micchelli, *Approximation by superposition of a sigmoidal function and radial basis functions*, Adv. Appl. Math. **13** (1992), 350–373.

A. Pinkus, *Approximation theory of the MLP model in neural networks*, Acta numerica, 1999, Cambridge Univ. Press, Cambridge, 1999, pp. 143–195.

D. A. Sprecher, *On the structure of continuous functions of several variables*, Trans. Amer. Math. Soc. **115** (1965), 340–355.

W. A. Stein et al., *Sage Mathematics Software (Version 7.6)*, The Sage Developers, 2017, <http://www.sagemath.org>.

M. Stinchcombe and H. White, *Approximating and learning unknown mappings using multilayer feedforward networks with bounded weights*, Proceedings of the 1990 IEEE international joint conference on neural networks, vol. 3, IEEE, New York, 1990, pp. 7–16.

S. Willard, *General topology*, Addison-Wesley Publishing Co., Reading, Mass.-London-Don Mills, Ont., 1970.

{'source': 'arXiv_out/2101'}