On the (non-)closedness of the set of ReLU networks
Eloi Martinet, Leon Bungert
Abstract
We prove that the set NN of ReLU networks with one hidden layer and at most N∈N neurons is weakly closed in W1,p(Ω), for a bounded connected open set Ω⊂Rd. Consequently, every coercive, weakly lower semicontinuous energy on this space attains its minimum over NN. This covers the Deep Ritz method with convex integrands, Sobolev training and Lipschitz learning. Moreover, as the weight decay parameter tends to zero, minimizers of the regularized problem converge, up to subsequences, to minimizers with minimal parameter norm. We also prove that the set of ReLU networks with two hidden layers of bounded widths is not closed in W1,p(Ω) or in C(Ωˉ). This disproves a conjecture of Petersen, Raslan and Voigtlaender.
Contents
1
Introduction
1
2
Weak closedness of one-hidden-layer ReLU networks in Sobolev spaces
3
3
Non-closedness for deeper networks
9
3.1
Construction of the limit
11
3.2
Convergence of the sequence of neural networks
12
3.3
Non-representability of the limit
14
4
Applications
17
4.1
The Deep Ritz method
18
4.2
Lipschitz learning
21
4.3
Selection of minimal-norm parameters via weight decay
22
4.4
Failure of existence for two hidden layers
23
5
Discussion
24
1 Introduction
A given neural network architecture defines a family of functions parametrized by its weights and biases, which is referred to as the architecture's realization set. This set is not a vector space, and even its most basic topological property, closedness, is far from obvious: If networks of a fixed size converge in some function space, is the limit still a network of the same size?
This question goes back at least to [32], where the authors are interested in the existence of a best approximation from a set of neural network, namely the existence of a neural network uθ of fixed size that minimizes ∥uθ−f∥ where f is a target function and ∥⋅∥ some function space norm.
The topology of realization sets was studied systematically by Petersen, Raslan and Voigt-laender [15]. Under broad assumptions on the activation, which include the ReLU, they show that the realization set of every fixed architecture is not closed in Lp for 1<p<∞. In the uniform topology, non-closedness also occurs for most commonly used activations, whereas shallow networks with ReLU activation were shown to be closed in the uniform topology on C([−B,B]d), and so are deeper networks with bounded weights. Mahan, King and Cloninger [14] showed that, in general, closedness is false in Sobolev spaces: For activation functions which are m-times but not m+1-times continuously differentiable, networks of fixed architecture can converge in the W(m−1),p norms (p∈[1,∞]) to functions outside the realization set. In all these constructions, the mechanism is the same. The high-level idea is that for a smooth activation σ,
n[σ(⋅+1/n)−σ(⋅)]⟶σ′,
so that two collapsing neurons approximate σ′, which in general lies outside the realization set, while the parameters escape to infinity. For the ReLU σ(t):=max(t,0), this collapse produces the Heaviside function 1{t>0}. This explains the non-closedness in the Lp norm, but also why closedness can hold in stronger topologies. Note that a jump along a hyperplane is excluded by uniform convergence and, as we will see, by weak convergence in W1,p.
The same exceptional behavior appears in the literature on optimal networks. Existence of best approximations is known for fixed-width Heaviside networks in Lp [28, 29], and for shallow ReLU networks with the mean-square loss, first in one dimension [10] and then in any dimension and for every width [6]. The latter proof enlarges the closure of the realization set by discontinuous generalized responses and shows that they cannot improve the optimal value. Similar results hold for residual [5] and sparse [7] ReLU networks. Generally speaking, it seems that ReLU networks enjoy closedness properties that smoother activations lack. However, all these results concern a single hidden layer, and closedness of deeper ReLU networks without parameter bounds was conjectured in [15].
Main contributions: (non-)closedness. This paper aims to clarify how far the closedness of ReLU networks extends in Sobolev spaces. Let Ω⊂Rd be bounded, open and connected, and let NN be the set of shallow ReLU networks with at most N neurons on Ω. Our first main result, Theorem 2.3, states that if (un)n⊂NN converges in Lloc1(Ω) to some u∈Wloc1,1(Ω), then u∈NN. In particular, NN is weakly closed in W1,p(Ω) for p<∞, and weakly-* closed in W1,∞(Ω). For p≤d, this is not implied by any of the results above which concern Lp, the uniform topology, or smooth activations.
It turns out that this closedness is specific to shallow ReLU networks. Our second main result, Theorem 3.1, shows that for any bounded open set Ω⊂Rd, d≥2, the set NN,M of ReLU networks with two hidden layers of widths N and M is neither closed in C(Ωˉ) nor, weakly or strongly, in any W1,p(Ω) with 1≤p<∞. This answers negatively the question of closedness in the uniform topology for deeper ReLU networks. The mechanism of this counterexample is different from the collapse of neurons which produces a jump. Indeed, we construct a sequence whose limit f is still a ReLU network, however, of a larger size, in accordance with [13, 17, 22].
Applications. These results have immediate consequences for variational problems posed in Sobolev spaces. In the Deep Ritz method [23], the energy associated with a partial differential equation is minimized over a class of networks instead of the full energy space, see [9, 11, 19, 20] for its analysis. Sobolev training [24] and Lipschitz learning [12, 18, 21] follow the same principle, albeit with the aim of solving regression or classification problems. If the energy is coercive and weakly lower semicontinuous, a natural question is whether its restriction to a neural network class of fixed size attain its infimum. Note that coercivity of the energy only controls the realized function sequence, not the parameters, a “coercivity gap” recently emphasized by Rezaei and Wojtowitsch [2] and Zuazua [4]; the latter showed that parameters of Gaussian networks may escape to infinity while the realized functions converge in H1. However, using that minimizing sequences are bounded in W1,p, the question of the existence of energy minimizers reduces to the weak closedness of the network class.
As a consequence of our closedness result Theorem 2.3, every coercive and weakly lower semicontinuous energy on W1,p(Ω), 1<p≤∞, attains its infimum over NN (Theorem 4.2), where for p=∞ the weak-* topology has to be used. This covers the Deep Ritz method for convex integrands, Sobolev training and Lipschitz learning (the latter for p=∞). The case p=1 fails, since bounded sequences in W1,1 are not weakly compact by the lack of a predual space. Since the same neural network function has many different parametrizations, we also show that vanishing weight decay selects an optimal network with parameters of minimal norm (Proposition 4.12). Furthermore, as a consequence of our non-closedness result for deeper networks Theorem 3.1, Sobolev training with the target f constructed there has infimum zero, which is not attained, and the parameters diverge along every minimizing sequence (Proposition 4.13).
Scope and outline. Our results concern existence at fixed width, they do not assert that the minimizer of an energy over the whole Sobolev space is a neural network. The convergence of the minimal energies as N→∞ is a separate question, considered for instance in [2, 3, 11, 16]. Section 2 proves the closedness of NN and discusses the role of connectedness of Ω. Section 3 establishes the non-closedness for two hidden layers of respective sizes 4 and 6. Section 4 contains the applications to Deep Ritz, Sobolev training, Lipschitz learning and weight decay, as well as the failure of existence for two hidden layers. We conclude with a discussion in Section 5.
2 Weak closedness of one-hidden-layer ReLU networks in Sobolev spaces
Throughout this section, Ω⊂Rd is a bounded, open and connected set and
R:=x∈Ωsup∣x∣<∞.
We denote by W1,p(Ω) the Sobolev space of Lp functions with weak first derivatives in Lp, p∈[1,∞]. In what follows, σ(t):=max(t,0) denotes the ReLU activation function. For θ=(w,b)∈Sd−1×R we set
zθ(x):=w⋅x+b,Hθ:={x∈Rd:zθ(x)=0},−θ:=(−w,−b),
so that H−θ=Hθ and z−θ=−zθ. The function σ(zθ) is called a neuron with parameter θ and break hyperplane Hθ.
We denote by A the (d+1)-dimensional real vector space of affine functions of the form x↦p⋅x+q on Rd, and by A∣U their restrictions to a set U.
Definition 2.1 (Shallow ReLU networks of width at most N). For an integer N≥1,
Remark 2.2. Note that (1) coincides with the usual definition of single-layer neural networks; indeed, by the positive homogeneity of ReLU we have aσ(w⋅x+b)=a∣w∣σ(∣w∣w⋅x+∣w∣b) such that w=0 can be normalized to Sd−1, and w=0 produces a constant absorbed in c.
We will use the following two identities repeatedly: First, since σ(t)=σ(−t)+t and −zθ=z−θ, we have
aσ(zθ)=aσ(z−θ)+azθforalla∈R,θ∈Sd−1×R.(2)
Second, affine functions on Ω cost one neuron: Indeed, for v=0 we have
Theorem 2.3 (Closedness). Let Ω⊂Rd be bounded, open and connected, and N≥1. Let un∈NN satisfy
un→uinLloc1(Ω)andu∈Wloc1,1(Ω).
Then u∈NN. In particular, NN is weakly closed in W1,p(Ω) for 1≤p<∞: if un∈NN and
un⇀uinW1,p(Ω),1≤p<∞,
then u∈NN. The same statement holds for p=∞ with respect to the weak- ∗ convergence.
Note that for p>d and Ω Lipschitz, Morrey's compact embedding turns weak W1,p convergence into uniform convergence on Ω. Theorem 2.3 then follows from the closedness of shallow ReLU networks in the uniform norm of [15] when Ω is a cube. The novelty of our result lies in that we do not have to assume Lipschitz of the boundary of Ω and in the full treatment of the p≤d cases. Note that this closedness result also applies to p=1 but the existence result from Section 4 does not, due to a lack of weak compactness in W1,1.
Before going to the proof of Theorem 2.3, we give the following elementary lemma:
Lemma 2.4. Let B⊂Rd be an open ball, θ∈Sd−1×R with Hθ∩B=∅, and q∈A. If q1{zθ>0}∈W1,1(B), then q=Azθ for some A∈R.
Proof. Write θ=(w,b), B+:=B∩{zθ>0}, v:=q1B+. The set B+ is a Lipschitz domain whose boundary inside B is Hθ∩B, with outer unit normal −w. For φ∈Cc∞(B) the divergence theorem gives
If v∈W1,1(B), then ∂jv∈L1(B) for all j. Since w is a unit vector, it has at least one non-zero entry and hence the singular part of the distribution must vanish for some j, i.e., q=0 holds Hd−1-a.e. and hence (by continuity) everywhere on Hθ∩B. This is a nonempty relatively open subset of the hyperplane Hθ and an affine function vanishing there vanishes on all of Hθ. Finally, affine functions vanishing on {zθ=0} are exactly the multiples of zθ. □
We can now proceed to show the main result.
Proof of Theorem 2.3. The second statement follows from the first. To see this, note that for 1≤p<∞, this follows from the Rellich theorem: Indeed, weak convergence in W1,p(Ω) implies strong convergence in Lp(B)↪L1(B) for every ball B with B⊂Ω. For p=∞, this is a consequence of the Arzelà–Ascoli theorem, since weakly- ∗ converging sequences in W1,∞(B) are bounded in W1,∞(B) hence equi-Lipschitz. Covering a compact subset K⊂Ω by finitely many balls proves the second statement.
Next, we prove the first statement. Write the sequence of neural networks un∈NN for n∈N as follows:
In order to keep the notations as clear as possible, we shall pass to subsequences several times without relabeling. Since u is the limit of the whole sequence, the conclusion u∈NN is not affected.
Step 1: sorting the neurons. First, we distinguish between neurons for which the break hyperplanes stay in Ω and the ones that eventually leave Ω. More precisely, for each 1≤i≤N, at least one of the sets
{n∈N:Hθin∩Ω=∅}or{n∈N:Hθin∩Ω=∅}
is infinite. If the first one is, we put i∈Iin; otherwise, i∈Iout. Starting from i=1, we can recursively extract N subsequences of (θin)n∈N such that
i∈Iin⟺Hθin∩Ω=∅foralln∈N
and
i∈Iout⟺Hθin∩Ω=∅foralln∈N.
Since Ω is connected, for every i∈Iout, the linear functions zθin have constant sign on Ω. This implies that the corresponding neurons are either 0 or affine for all n on Ω. Hence, we obtain
un=i∈Iin∑ainσ(zθin)+ℓn(x),(4)
where ℓn is an affine remainder.
Next, observe that only neurons that share the same limiting hyperplane could potentially create a jump at the limit. Hence, for i∈Iin, we can further group the neurons in a way that every neuron of each group shares the same limiting hyperplane. Indeed, for all i∈Iin, there exists x∈Ω such that win⋅x+bin=0 hence ∣bin∣=∣win⋅x∣≤R. Hence, the full parameter sequence θin is bounded and up to a subsequence, there exists θi such that θinn→∞θi. Using the equivalence relation i∼j when θi=±θj (meaning that Hθi=Hθj), we partition Iin into equivalence classes C1,…,CL for L∈{1,…,N}.
For each 1≤k≤L, let θ(k) be a representative of the class. For i∈Ck, if θi=−θ(k), we can replace every neuron ainσ(zθin) by ainσ(z−θin)+ainzθin in un using (2). By flipping the sign of such θin, we have that for all i∈Ck, θinn→∞θ(k). Hence, we can further reduce (4) to
un=k=1∑Li∈Ck∑ainσ(zθin)+ℓn(x)(5)
where we put all the ainzθin in the affine remainder ℓn. As a consequence the parameters θin and the affine reminder ℓn(x) in this formula are, in general, different from the ones in (4).
We can further group the neurons according to whether the limit hyperplane still intersects Ω or is tangent to it: to this purpose, we denote
Figure 1: Construction of x0∈Ω lying on Hθ(k) but on no other limiting break hyperplane. Hence, on the ball B(x0,r) the neural network un for all n∈N large enough is of the form un=vkn+ℓkn for vkn as in (6) and some affine function ℓkn∈A.
Moreover, we will denote by
vkn=i∈Ck∑ainσ(zθin)(6)
the contribution of a single cluster in (5).
Step 2: limit of a single cluster. We will now study the limits of the cluster contributions vkn defined in (6) as n→∞. For this, we distinguish between the simple case where k corresponds to a tangent limiting hyperplane and the more interesting one where k corresponds to a hyperplane that intersects Ω.
Let k∈Ktan. Up to changing the affine remainder ℓn, we can use (2) and the connectedness of Ω to assume that zθ(k)<0 on Ω. This implies that for all compact K⊂Ω, we have that for all i∈Ck and n large enough, zθin<0 on K: hence, vkn→0 on K.
Now let k∈Kin. We first show that near the hyperplane Hθ(k), the limit function is of the form u=m+q1{zθ(k)>0} where m and q are affine. Indeed, let
x0∈(Hθ(k)∩Ω)∖j=k⋃Hθ(j)
be a point in Ω that lies on the break hyperplane Hθ(k) but on now other break hyperplane. For r>0 small enough, since all break hyperplanes Hθ(k) for 1≤k≤L are mutually different, B:=B(x0,r) is such that B⊂Ω and B∩Hθ(j)=∅ for all j=k. In particular, this implies that on B, for n large enough, every neuron in a cluster j=k is affine; hence un is of the form un=vkn+ℓkn for some affine function ℓkn. See Figure 1 for an illustration of the construction.
Define
B+:=B∩{zθ(k)>0}andB−:=B∩{zθ(k)<0},
and let K−⊂B− be compact with non-empty interior. Since θin→θ(k) then for n large enough, zθin<0 on K− for all i∈Ck and hence un=ℓkn on K−. Since un→u in Lloc1(Ω) then in particular ℓkn→u in L1(K−), which implies that u is affine on K−. By taking a sequence of compact sets exhausting B−, we get that u is affine on B−: we denote by mk the affine function such that u=mk on B−. Moreover, since the space of affine functions A is a finite-dimensional vector space space and the L1(K−) norm is a norm on it, we have that ℓkn→mk in A.
By the same arguments, on a compact subset K+⊂B+ with non-empty interior, vkn is of the form
vkn=i∈Ck∑ainzθn=:Pkn∈A
for n large enough. Hence the limit u is also equal to some affine function on B+. Moreover, on K+, we have that ℓkn→mk for the same affine function mk as before, hence Pkn=un−ℓkn→u−mk=:qk in A with qk∈A also being affine. By exhausting B+ by such sets K+, we have that u=mk+qk on B+.
It follows that
u=mk+qk1{zθ(k)>0}a.e.onB.(7)
Since u∈W1,1(B) by assumption and mk∈A trivially lies in W1,1(B), we have that qk1{zθ(k)>0}∈W1,1(B) hence by Lemma 2.4, qk=Akzθ(k) for some Ak∈R. This implies that
It turns out that the convergence Pkn→qk=Akzθ(k) in A already implies that vkn converges uniformly on suitable compactly contained subsets: Let D⊂Ω be compact and ε>0. Define Dk,ε:=D∩{∣zθ(k)∣≥ε}. The uniform convergence zθin→zθ(k) shows that, for n large, every zθin with i∈Ck has the sign of zθ(k) in Dk,ε, see Figure 2. Hence vkn=1{zθ(k)>0}Pkn there, which means that
uniformly on Dk,ε. In this sense, each cluster collapses to at most one neuron in the limit.
Figure 2: Definition of the set Dk,ε on which zθin with i∈Ck and zθ(k) have the same sign for large enough n∈N since the former converges uniformly to the latter.
Step 3: the limit is in NN. Let D⊂Ω be compact with nonempty interior, and let ε>0 be so small that
Dε:=D∩k∈Kin⋂{∣zθ(k)∣≥ε}=k∈Kin⋂Dk,ε.
has nonempty interior. Obviously, this is possible since Kin is finite. Since Dε⊂Dk,ε for every k∈Kin, (8) in the end of Step 2 gives vkn→Akσ(zθ(k)) uniformly on Dε for k∈Kin.
Furthermore, vkn=0 on Dε for k∈Ktan and n large since Dε is compactly contained in Ω. Hence,
As in Step 2, the affine functions ℓn converge in A to some affine ℓ, which does not depend on D or ε. Since the sets Dε exhaust Ω∖⋃k∈KinHθ(k) which differs from Ω just by a Lebesgue nullset, we have
u=k∈Kin∑Akσ(zθ(k))+ℓa.e.inΩ.
To conclude the proof, we must show that u can be represented with at most N neurons. There are two cases:
If ♯Kin=N, it means that Iout=∅ and hence ℓn=cn∈R in (4). Moreover, since by definition of the set Kin and the number L, we have ♯Kin≤L≤N, in this case it has to hold L=N and each class C1,…,CN has exactly one element. Hence, there is no need to use (2) and we do not have an additional affine remainder. Finally, Step 2 tells us that
u=k∈Kin∑Akσ(zθ(k))+c
where c∈R hence u∈NN.
If ♯Kin≤N−1, we can use (3) to represent the affine remainder ℓ at the cost of one neuron, also leading to u∈NN.
Remark 2.5 (Comparison with [6]). In [6], the authors also observe that neurons of the type of (7), which are not necessarily ReLU neurons, naturally arise as Lp-limit of ReLU networks in the context of regression problems. They call these neurons generalized responses, and in their analysis, they rule out such neurons by showing that they can not improve the loss. In our case (where no loss is involved), such neurons are shown to be actually representable by ReLU neurons thanks to the regularity of the limit alone.
Remark 2.6 (Disconnectedness is essential in the argument: we need the collapse of neurons to occur in the domain in order to control the jump. Take the following simple counterexample. Let Ω=(−1,0)∪(0,1)
un(x):=(n+1)σ(x+1/n)−nσ(x),
and u(x):=(x+1)1{x>0}∈W1,∞(Ω). Then we have that un→u in Lloc1, but u∈/NM for any M since ReLU networks are continuous on R.
One could ask whether asking the connected components to be at positive distance restores Theorem 2.3. While it is the case in dimension 1, it still fails in higher dimension. Indeed, consider the set Ω in Figure 3 and un(x)=σ(nx2)−σ(nx2−1). Then un→u in Lloc1(Ω) where u(x)=1{x2>0}. However, the latter is not representable by a shallow network with two neurons.
In many applications, most prominently in the Deep Ritz method, it is of interest to be able to impose boundary conditions for the function class at hand. For instance, if one works in the Sobolev space H01(Ω), it is common to consider neural networks of the form u=φu~ where u~∈NN and φ is a positive function on Ω that vanishes in ∂Ω, see, for instance, [30] for an early example. A typical choice for φ would be φ:=dist(⋅,∂Ω), the distance function to the boundary of Ω. The next corollary allows us to extend Theorem 2.3 to such class of networks:
Figure 3: A domain Ω with two connected components at positive distance from each other. The only hyperplane H that separates the components is tangent to both of them, preventing u to be represented by a neural network.
Corollary 2.7 (Networks with hard constraints). Let Ω⊂Rd be bounded, open and connected, and N≥1. Let φ∈W1,∞(Ω)∩C(Ω) with φ>0 in Ω and φ=0 on ∂Ω, and define VN:=φNN⊂W01,p(Ω). Let un∈VN satisfy
un→uinLloc1(Ω)andu∈Wloc1,1(Ω).
Then u∈VN. In particular, VN is weakly closed in W1,p(Ω) for 1≤p<∞: if un∈VN and
un⇀uinW1,p(Ω),1≤p<∞,
then u∈VN. The same statement holds for p=∞ with respect to the weak-* convergence.
Proof. As in the proof of Theorem 2.3, the second statement follows from the first, and we just prove the first one.
Fix a ball B with B⊂Ω. By assumption un→u in L1(B) where u∈Wloc1,1(Ω). Since un=φvn for vn∈NN, B is compactly supported in Ω, and φ is continuous and positive on Ω, we obtain that φ≥cB>0 on B and hence
vn=φun→φu=:vinL1(B).(9)
Since φ lies in W1,∞(Ω), it even holds v∈W1,1(B). Covering an arbitrary compactly contained subset of Ω by such balls gives vn→v in Lloc1(Ω) with v∈Wloc1,1(Ω). By Theorem 2.3, v∈NN, so u=φv∈VN. This concludes the proof. □
3 Non-closedness for deeper networks
In this section, we show that the set of ReLU networks with two hidden layers of fixed size is not closed in any Sobolev space W1,p or in the space of continuous functions. The latter result disproves a conjecture of [15] stating that the set of ReLU networks of a fixed complexity is closed in C(Ω); they proved this result in two particular cases, namely for shallow ReLU networks with one hidden layer and deep networks with some parameter bound. It turns out that it is false in general, i.e., for deep networks without parameter bounds. A first result in this direction can be found in [7], where the authors show that imposing certain sparsity patterns on the weight matrices of deep ReLU networks can break the closedness. However, their result does not apply to dense networks.
We will focus on networks with two hidden layers. Let Ω⊂Rd. For M,N∈N let NN,M be the set of functions Ω→R of the form
with ak,cke,dk,be,c∈R and we∈Rd for e=1,…,N and k=1…M. These are the two-hidden-layer networks with first width at most N and second width at most M. The main theorem is the following:
Theorem 3.1 (Non-closedness). Let d≥2, let Ω⊂Rd be a bounded, open set. There exist a Lipschitz continuous and piecewise affine function f:Ω→R, a sequence of two-hidden-layer networks (uη)η>0⊂N4,6 and constants Cp,Cη,C>0 such that, for 0<η<Cη and 1≤p<∞, we have
In particular, Theorem 3.1 states that N4,6 is not closed in C(Ω). It is also not strongly (and hence not weakly) closed in any W1,p with 1≤p<∞. In the construction, some second-layer weights of uη are of order η−1, while ∥uη−f∥W1,p(Ω)≤Cη1/p. This blow-up of the parameters cannot be avoided, see Proposition 4.13 (ii) in Section 4. The same networks also show non-closedness for the weak-* topology of W1,∞, which is the exact counterpart of the case p=∞ of Theorem 2.3:
Corollary 3.2. Under the assumptions of Theorem 3.1, uη∗f in W1,∞(Ω) as η→0. In particular, N4,6(Ω) is not weakly-* closed in W1,∞(Ω).
Proof. Uniform convergence uη→f implies uη∗f in L∞(Ω). For the gradients, let g∈L1(Ω;Rd) and ε>0, and choose gε∈L∞(Ω;Rd) with ∥g−gε∥L1≤ε. Since ∥∇uη∥L∞≤C and f is Lipschitz, Theorem 3.1 with p=1 gives
∫Ω(∇uη−∇f)⋅gdx≤(C+∥∇f∥L∞)ε+∥gε∥L∞C1η.
Letting η→0 and then ε→0 gives ∇uη∗∇f in L∞(Ω;Rd).
Whether NN,M is closed for the norm topology of W1,∞(Ω) remains open, but this property would not be very useful anyway since the relevant energies on W1,∞(Ω) do not provide sufficient compactness for strong convergence in that space.
In order to show Theorem 3.1, we first show the following proposition:
Proposition 3.3. Let Q:=(0,5)×(0,2)×(0,1)d−2, let L≥2 and let QL:=(−L,5+L)×(−L,L)d−1, so that Q⊂QL. There exist f:QL→R Lipschitz and (uη)η>0⊂N4,6 and a constant C>0 such that, for 0<η<1/2L,
(i) ∥uη−f∥L∞(QL)≤Cη;
(ii) ∥∇uη∥L∞(QL)≤C, and for every p∈[1,∞) there is Cp with ∥∇(uη−f)∥Lp(QL)p≤Cpη;
(iii) f∈N5,6(QL), and f∣Q∈/N4,M(Q) for every M∈N.
3.1 Construction of the limit
Before we give the proof of Proposition 3.3, we will construct the target f and the approximating sequence of neural networks uη. In the sequel, we will denote x=(x1,x2,xˉ)∈Rd. For η>0 and x∈Rd, let
This notation is motivated by the fact that on the right half (5/2,5+L)×(−L,L)d−1 of QL, we have x2η=x2 for η<1/2L. Using the previously defined functions, we can further put
for j∈{1,2,3} and c1,c2,c3>0 to be defined later. Let S(x)=(5−x1,x2,xˉ) be the reflection with respect to the x1=5/2 hyperplane and define the target function f and its approximations uη as:
Note that the target is depicted in Figure 4 for d=2 and d=3, while the uη are depicted in Figure 5 for d=2. From the construction it seems believable that uη converges to f and we will prove this in the next subsection. First, we show that indeed f∈N5,6 and uη∈N4,6.
Lemma 3.4. For any η>0 the functions f:QL→R and uη:QL→R defined in (14) satisfy f∈N5,6(QL) and uη∈N4,6(QL).
Proof. By expanding the definition of f and uη and also using that K∘S=h1+λh2 and Kη∘S=h1η+λh2η, we get
Written as is, f is not a neural network since x2 must be the output of some first-layer neuron, whereas x2η in the definition of uη is. On QL, it however trivially holds that x2=σ(x2+L)−L
Figure 4: The target f on Q with λ=5 for d=2 (left) and d=3 (right). For d=3, f does not depend on x3, and only the slices {x3=0} and {x3=1} are shown. The orange lines are the zero level sets {x2−cj−K(x)=0} of the arguments of the gj (right side) and their mirror images {x2−cj−K(S(x))=0} (left side); the dashed lines are the walls {x1=k}, k=1,…,4. The set P used in the proof of Proposition 3.3 (iii) consists of twelve points for d=2 and of twelve segments parallel to the x3-axis for d=3.
and hence uη∈N4,6 with first-layer neurons h1η,…,h4η.
Remark 3.5. Importantly, Lemma 3.4 does not show that f∈/N4,M for every M∈N. This we will prove in Section 3.3 for a suitable choice of cj. The core mechanism of the proof is that while the function x↦x2 in the first layer can be approximated using the 4 first layer neurons of uη, it can not be exactly represented without adding an additional neuron. Note that, more generally, continuous, piece-wise linear functions can always be represented by a deep ReLU network (see for instance [13, 17, 22]).
3.2 Convergence of the sequence of neural networks
We continue with proving the statements (i)−(ii) in Proposition 3.3 which assert that the neural networks uη indeed converge to f (uniformly, strongly in W1,p(QL), and by Corollary 3.2 also weak-* in W1,∞(QL)). See Figure 5 for an illustration of the convergence.
Figure 5: The networks uη∈N4,6 with λ=5 for η=0.4,0.2,0.1 and their limit f∈N5,6 (bottom right), on Q=(0,5)×(0,2).
Proof of Proposition 3.3 (i)–(ii). By symmetry it suffices to work on QL+=QL∩{x1>5/2}. We first show that the terms gj and gjη defined in (13) vanish on QL−:=QL∩{x1<5/2}. First, note that K defined in (11) is a decreasing function of x1 hence given that λ>2L then K((5/2,x2,xˉ))>L which implies that K>L on QL−. Together with x2<L and cj>0, this implies that x2−cj−K(x)<0 and hence gj(x)=0 for all x∈QL−. To show that gjη(x)=0, we first show that x2η≤x2 for x∈QL−. Indeed, we have that σ(a)−σ(b)≤σ(a−b) for all a,b∈R, hence
If x2≥0, then Kη(x)≥K(x) by the monotonicity of σ, hence x2η−cj−Kη(x)≤x2−K(x)<0. If x2<0, then x2η−cj−Kη(x)≤x2<0, since Kη≥0. In both cases, gjη(x)=0.
Hence, we proved that gj,gjη=0 on QL−. By symmetry, gjη∘S and gj∘S vanish on QL+. Then, using also x2η=x2 on QL+ from (14) we get
Hence ∣∇gjη∣≤C which, using that η is bounded, leads to ∣∇uη∣≤C (for a different C). The same formulas with η=0 hold for ∇gj hence ∣∇f∣≤C.
Let Eη⊂QL+ be the union of the strips {∣x1−3∣≤Lη} and {∣x1−4∣≤2Lη} with the three bands {∣x2−cj−K(x)∣≤(λ+2)Lη} (all restricted to QL+). Since (by Cavalieri's principle)
for constants C1,C2,C3>0, we get ∣Eη∣≤Cη for some C>0 that only depends on L and d.
We now show that {h4η>0}={h4>0}. Let x∈QL+∖Eη. Since ∣x2∣<L, we have
∣2ηx2∣<2Lη<∣4−x1∣.
Now observe that for a,b∈R, ∣a−b∣<∣b∣ implies that a and b are nonzero and have the same sign. By choosing a=4−x1+2ηx2 and b=4−x1 in the previous inequality, we have that 4−x1+2ηx2 and 4−x1 have the same sign hence {h4η>0}={h4>0}. In a similar fashion, {h3η>0}={h3>0} and using that
∣Kη(x)−K(x)∣≤(λ+2)Lη<∣x2−cj−K(x)∣,
we have {x2>cj+Kη}={x2>cj+K}. Combined with (15), it leads to
∣∇gjη−∇gj∣≤∣∇Kη−∇K∣≤(λ+2)η
which implies ∣∇uη−∇f∣≤Cη. Using the same arguments on the mirrored half
We now focus on showing the non-representability statement (iii) of Proposition 3.3 which asserts f∈/N4,M for any M∈N, in other words, one needs at least five inner neurons to represent f as a neural network, as done in Lemma 3.4. We first introduce a notion of local shallowness of a function:
Definition 3.6. Let U⊂Rd be open and P∈U. A function g:U→R is locally shallow at P if it coincides, on some ball around P, with a shallow neural network of the form x↦∑i=1Iαiσ(vi⋅x+βi)+γ, where αi,βi,γ∈R and vi∈Rd.
Sums and differences preserve this property, and so does composition with affine maps of the input. Shallow ReLU networks have the following structural property; a related observation already appears in the literature, for instance, in [8, Example 4.2], to show that certain continuous, piecewise linear functions can not be represented by a shallow network.
Lemma 3.7. If g is locally shallow at P∈Rd, then v↦g(P+v)−g(P−v) is linear in a neighborhood of P.
Proof. Shrink the ball so that every neuron with vi⋅P+βi=0 has constant sign on it. For small ∣v∣, such a neuron contributes 2αivi⋅v or 0 to g(P+v)−g(P−v). A neuron with vi⋅P+βi=0 contributes αi(σ(vi⋅v)−σ(−vi⋅v))=αivi⋅v. The constant γ cancels. □
Figure 6: The function g(x)=σ(x2−κ(x1)) of Lemma 3.8, for κ with a single breakpoint at t0. The highlighted curve is {x2=κ(x1)}, and g is not locally shallow at the point P=(t0,κ(t0)). The kinks of g near P lie on three half-lines starting at P, whereas the kinks of a shallow network lie on full lines.
The following lemma allows us to easily build ReLU networks that are not locally shallow around certain points, as illustrated in Figure 6.
Lemma 3.8. Let κ:R→R be continuous and piecewise affine. Let t0 be the position of a kink of κ, with κ having slopes λ−=λ+ in a left and right neighborhood of t0. Then g(x):=σ(x2−κ(x1)) is not locally shallow at P:=(t0,κ(t0),x3,…,xd)∈Rd for arbitrary values of x3,…,xd∈R.
Proof. Let t>0 be small enough that κ is affine on [t0−t,t0] and on [t0,t0+t] and in particular
κ(t0+t)=κ(t0)+λ+t,κ(t0−t)=κ(t0)−λ−t.
Let vs,t:=(t,s,0,…,0) with ∣s∣≤(∣λ−∣+∣λ+∣+1)t. Then
g(P+vs,t)−g(P−vs,t)=σ(s−λ+t)−σ(λ−t−s).
As a function of s, the derivative of this Lipschitz-continuous function is 1{s>λ+t}+1{s<λ−t}. This takes both values 1 and 2 if λ+<λ−, and both values 0 and 1 if λ+>λ−. Hence, s↦g(P+vs,t)−g(P−vs,t) for ∣s∣≤(∣λ−∣+∣λ+∣+1)t is not affine. Then if g were locally shallow at P, then for t>0 small, Lemma 3.7 would give that g(P+vs,t)−g(P−vs,t) is linear in s and t which would lead to a contradiction. □
Let u∈NN,M be of the form (10). We call the hyperplanes {x∈Rd:we⋅x+be=0} for which 1≤e≤N with we=0 the first-layer hyperplanes of u. Knowing that a ReLU network u is not locally shallow at a point P forces P to lie on a first-layer hyperplane, as we show in the next lemma:
Lemma 3.9. If u is not locally shallow at P∈Rd, then P lies on a first-layer hyperplane of u.
Proof. Assume P lies on no first-layer hyperplane. Then any neuron with we=0 is affine on a ball around P and equals 0 or we⋅x+be there. Any neuron with we=0 coincides with the constant σ(be). Hence, each inner sum in (10) is affine on that ball and, consequently, u is shallow there. This is a contradiction. □
Figure 7: The counting argument in the proof of Proposition 3.3 (iii), with cj=j/10. Four walls contain the twelve points of P (left), while a non-vertical first-layer line contains at most two points of P (right), which leaves two points out.
By Lemma 3.4 we already know that f∈N5,6 and it remains to prove that f∈/N4,M for every M∈N. The proof proceeds as follows: we assume for the sake of contradiction that f∈N4,M for some M, and for 1≤j≤3, let
The Sji are points in d=2 and segments of length 1 in d=3. We can show that at every point in
P:=j=1⋃3i=1⋃4Sji,
f is not locally shallow (see Figure 4 for an illustration of the set P for d=2). Using Lemma 3.9, this forces the first layer hyperplanes to contain every point of P, which in turn forces every first layer hyperplane to be vertical using a counting argument with carefully chosen cj. Finally, vertical first layer hyperplanes means that neurons of the first layer are of the form x↦σ(αk(x1−k)), which implies that f does not depend on x2, which is a contradiction.
Proof of Proposition 3.3 (iii). Observe that no three points of {(1,0),(2,1),(3,1),(4,0)} lie on one line. Hence two or less of the sets
lies in a given hyperplane. It follows that for 0<c1<c2<c3<1 small enough, the only hyperplanes containing more than two segments in P are the vertical hyperplanes {x1=k}, 1≤k≤4, which contains three each. Define f as in (14) and suppose for the sake of contradiction that f∈N4,M.
We start by showing that f is not locally shallow at any P∈P. By the symmetry f∘S=f it suffices to show this for P=(3,1+cj,xˉ) and P=(4,cj,xˉ). Near such P, the mirrored terms gj′∘S vanish for 1≤j′≤3, as was shown in the proof of Proposition 3.3 (i)-(ii) in Section 3.2. Moreover, for j′=j, the 0-level set {x2−cj′−K(x1)=0} of gj′ stays at vertical distance δ≥mini=j∣ci−cj∣>0 from P. So gj′ equals 0 or x2−cj′−K(x) in a small neighborhood of P, and both are shallow because K is and x2=σ(x2). Thus f=gj+h where h is a shallow ReLU network near P.
Next, let κ(t)=cj+λσ(3−t)+σ(4−t) such that K(x)+cj=κ(x1) and
gj(x)=σ(x2−κ(x1)).
Since t↦κ(t) has a breakpoint at t=3 and at t=4, Lemma 3.8 shows that gj is not locally shallow at any of the choices of P above. Consequently, f=gj+h with shallow h cannot be locally shallow at P.
Using Lemma 3.9, we have that any Sji in P must lie on some first-layer hyperplane of f: indeed, since finitely many hyperplanes cover Sji, one of them contains it; otherwise each would meet the (d−2)-dimensional affine span of Sji in a set of measure zero. Note that we have 12 such Sji and 4 first-layer hyperplanes. Assume that some first layer hyperplane ℓe={we⋅x+be=0} is not of the form {x1=k}. Hence, by construction of the cj, ℓe passes at most by two distinct Sji. The remaining 3 first-layer hyperplanes must therefore pass through the 10 remaining Sji: this is not possible, since any hyperplane passes through at most 3Sji (see Figure 7). Hence, the first layer lines of u are exactly the lines {x1=k}, k∈{1,2,3,4}.
Hence, every neuron on the first layer is of the form x↦σ(αk(x1−k)) for numbers αk∈R and k=1,2,3,4. This implies that f depends only on x1. However, for x∈Q with x1>4 and x2>1 we have
f(x)=j=1∑3σ(x2−cj−K(x))=j=1∑3σ(x2−cj)
which is clearly not constant in x2 (see also Figures 4 and 5) and leads to a contradiction. □
The proof of Theorem 3.1 is now a straightforward consequence of Proposition 3.3:
Proof of Theorem 3.1. Since Ω is open, there exists α>0 and β∈Rd such that Q⊂Ω~:=αΩ+β. Since Ω is bounded Ω~ is and there exists L≥2 such that Ω~⊂QL. Then, using Proposition 3.3 restricted to Ω~, we have
for all 0<η<2L1=:Cη. Moreover, f∈/N4,M(Q) hence f∈/N4,M(Ω~).
Now, putting T(x)=αx+β, the functions uη∘T are neural networks of the size of uη on Ω (and similarly for f∘T). Moreover, the previous inequalities holds on Ω for uη∘T and f∘T by a change of variables, which leads to the result. □
Remark 3.10. Our argument gives no information or counterexample for d=1. Every continuous piecewise affine function of one variable is locally shallow, so Lemma 3.8 has no one-dimensional counterpart, and tilting the walls requires a second coordinate. Hence, whether NN,M itself is closed in C([a,b]) for an interval [a,b]⊂R remains open for N≥2.
Remark 3.11. Note that our argument does not prove non-closedness for deeper networks. While we believe this to be true, we leave this question open for further investigation.
Remark 3.12. Note that the construction above can be extended to an even amount of neurons N≥4 and M≥6 in a straightforward way. We believe that a similar construction makes Theorem 3.1 hold for any N≥4 and M≥6.
4 Applications
In this section, we study the consequences of Theorem 2.3 and Theorem 3.1 on multiple learning problems. We will be interested in minimizing an energy or objective function E:W1,p(Ω)→(−∞,∞],1<p≤∞, which verifies:
(H1) Weak lower semicontinuity: un⇀u in W1,p(Ω) (un⋆u in W1,∞(Ω)) implies E(u)≤liminfn→∞E(un);
(H2) Coercivity: E(u)→+∞ as ∥u∥W1,p(Ω)→∞;
(H3) E(0)<∞.
Remark 4.1. (H3) is here to ensure that E is not identically equal to ∞ on any NN. Since 0∈NN for every N, this condition is sufficient.
A direct corollary of Theorem 2.3 is that if the energy verifies assumptions (H1)–(H3), then there is a shallow ReLU network with fixed size that minimizes the energy:
Theorem 4.2 (Existence). Let Ω⊂Rd be bounded, open and connected, and let E:W1,p(Ω)→(−∞,∞], 1<p≤∞ satisfy (H1), (H2) and (H3). Then for every N≥1,
u∈NNinfE(u)isattained.
Moreover, every minimizing sequence in NN possesses a subsequence converging weakly in W1,p(Ω) to a minimizer (weakly-* in W1,∞(Ω) if p=∞).
The proof of Theorem 4.2 is a classical application of the direct method of the calculus of variations, but we recall it here for the sake of completeness:
Proof of Theorem 4.2. Let 1<p<∞ and let un∈NN with E(un)→m:=infNNE<∞. Such sequences exists by (H3). For n large, E(un)≤max(m,0)+1, so (un) is bounded in W1,p(Ω) by coercivity (H2). Since W1,p(Ω) is reflexive for 1<p<∞, we can extract a subsequence (that we do not relabel) such that un⇀u weakly in W1,p(Ω). By Theorem 2.3, u∈NN, and by weak lower semicontinuity (H1) we have E(u)≤liminfnE(un)=m. Since E(u)>−∞, we get m>−∞ and, as u∈NN, E(u)=m.
The same proof applies for p=∞ with the weak-* convergence by applying the Banach–Alaoglu theorem.
Remark 4.3. Theorem 2.3 holds for p=1, but Theorem 4.2 does not, because bounded sequences in W1,1 need not have weakly convergent subsequences. Consider on W1,1(0,1)
E(u)=∥u∥W1,1+2∣u(1)−u(0)−1∣.
It is coercive, and weakly lower semicontinuous as the sum of a norm and of the absolute value of a continuous affine functional.
With t:=u(1)−u(0), we have ∥u′∥L1≥∣t∣ and ∣t∣+2∣t−1∣≥1, so E(u)≥∥u∥L1+1. Hence E(u)>1 for u=0, and E(0)=2. On the other hand, the single neurons un=nσ(x−1+n1) satisfy E(un)=1+2n1 and, hence, are a minimizing sequence. Thus infN1E=infW1,1E=1, and this infimum is attained neither on N1 nor on W1,1(0,1). If it was attained at some u∈W1,1(0,1) or u∈N1, from the above we would get that ∥u∥L1=0 and hence u=0. This implies E(u)=2 which is a contradiction.
4.1 The Deep Ritz method
The Deep Ritz method [23] solves a PDE that has a variational formulation, for instance, through the Lax-Milgram or Stampacchia theorem [26], by minimizing the corresponding energy over a class of neural networks. Following [2], we consider energies of the form
on a bounded, open, connected Lipschitz set Ω⊂Rd, where u on ∂Ω is understood in the sense of traces. Let 1<p<∞. To keep the proofs elementary, we make the following assumptions.
(D1) Convexity. For all (u,ξ), the maps x↦F(x,u,ξ) and x↦G(x,u) are measurable. For a.e. x∈Ω, (u,ξ)↦F(x,u,ξ) is convex on R×Rd, and for Hd−1-a.e. x∈∂Ω, u↦G(x,u) is convex on R.
(D2) Growth. ∣F(x,u,ξ)∣≤a(x)+C(∣u∣p+∣ξ∣p) and ∣G(x,u)∣≤b(x)+C∣u∣p, with a∈L1(Ω), b∈L1(∂Ω) and C≥0.
A finite convex function on Rm is continuous, so (D1) implies that F and G are Carathéodory functions. In particular, for u∈W1,p(Ω), (D2) asserts that x↦F(x,u(x),∇u(x)) is integrable on Ω and using the definition of the trace, x↦G(x,u(x)) is integrable on ∂Ω. Hence, E:W1,p(Ω)→R is well defined.
Theorem 4.4. Let Ω⊂Rd be a bounded, Lipschitz, open and connected set. Under (D1)−(D3), (16) defines a functional E:W1,p(Ω)→R which is convex, continuous, and satisfies (H1)−(H3). Hence, by Theorem 4.2, infNNE is attained for every N≥1.
Proof. First, note that (D1) implies that E is convex. Let us show that it is strongly continuous: let un→u in W1,p(Ω). It suffices to show that every subsequence has a further subsequence along which E(un)→E(u). Using [26, Theorem 4.9], we may assume that there exist h1,h2∈Lp(Ω) and h3∈Lp(∂Ω) and a subsequence un such that
By continuity of F and G in (u,ξ), the integrands converge pointwise a.e. By (D2), they are dominated by
a+C(∣h1∣p+∣h2∣p)andb+C∣h3∣p,
which are in L1(Ω) and in L1(∂Ω) respectively. The dominated convergence theorem gives E(un)→E(u). Consequently, E is convex, strongly continuous hence weakly lower-semicontinuous, i.e. (H1) holds.
If c1>0, the first two terms bound min(c0,c1)∥u∥W1,pp from below. If c1=0, then c2>0 and the Friedrichs inequality ∥u∥Lp(Ω)p≤CF(∥∇u∥Lp(Ω)p+∥u∥Lp(∂Ω)p) [25], valid on bounded connected Lipschitz sets, gives the same conclusion. In both cases E(u)≥κ∥u∥W1,pp−∥h∥Lp′∥u∥W1,p−C′ with κ>0, and the right-hand side tends to +∞ since p>1. This proves (H2). □
Remark 4.5 (Weaker assumptions). Assumptions (D1)–(D3) can be relaxed considerably; for instance, convexity of F is only needed in the ξ variable [27, Chapter 7] and the boundary lower bound only needs to hold on a part Γ⊂∂Ω of positive Hd−1 measure.
Example 4.6 (Robin energy). Let f∈L2(Ω) and β>0, and consider the Poisson problem with Robin boundary condition
{−Δu=f∂nu+βu=0inΩ,on∂Ω.(17)
Its weak solution is the minimizer over H1(Ω) of
E(u)=21∫Ω∣∇u∣2dx+2β∫∂Ωu2dHd−1−∫Ωfudx.
This energy has the form (16) with p=2, F(x,u,ξ)=21∣ξ∣2−f(x)u and G(x,u)=2βu2. Both are convex, which gives (D1). Since ∣fu∣≤21f2+21u2, (D2) holds with a=21f2 and b=0. Finally, (D3) holds with c0=21, c1=0, c2=2β, h=∣f∣ and a0=b0=0. By Theorem 4.4, E admits a minimizer over NN for every N≥1.
Formally, as β→∞, (17) becomes the Dirichlet problem −Δu=f in Ω, u=0 on ∂Ω. Taking β≫1 thus corresponds to the “soft” imposition of Dirichlet boundary conditions commonly used in the Deep Ritz method.
Example 4.7 (Hard imposition of Dirichlet boundary conditions). Let f∈L2(Ω) and consider the Poisson problem with homogeneous Dirichlet boundary conditions
{−Δu=fu=0inΩ,on∂Ω.(18)
Its weak solution is the minimizer over H01(Ω) of
E(u)=21∫Ω∣∇u∣2dx−∫Ωfudx.
Let φ be as in Corollary 2.7 and set VN=φNN. We can show that
u∈VNinfE(u)isattained.
Indeed, E is convex and continuous on H1(Ω), hence weakly lower semicontinuous. It is coercive on H01(Ω): by Poincaré's inequality, E(u)≥21∥∇u∥L22−CP∥f∥L2∥∇u∥L2. A minimizing sequence in VN⊂H01(Ω) is therefore bounded in H1(Ω). By Corollary 2.7, it has a subsequence converging weakly to some element of VN, which is a minimizer by lower semicontinuity.
Example 4.8 (Sobolev training). Sobolev training [24] fits a network to both the values and the derivatives of a target. Given f∈Lp(Ω) and g∈Lp(Ω;Rd), typically g=∇f when f∈W1,p(Ω), and weights α,γ>0, consider
E(u)=α∫Ω∣u−f∣pdx+γ∫Ω∣∇u−g∣pdx.(19)
E is of the form (16) with F(x,u,ξ)=α∣u−f(x)∣p+γ∣ξ−g(x)∣p and G=0. Assumption (D1) is clear. The inequality 21−p∣s∣p−∣t∣p≤∣s−t∣p≤2p−1(∣s∣p+∣t∣p) gives (D2) with a=2p−1(α∣f∣p+γ∣g∣p) and C=2p−1max(α,γ), and (D3) with c0=21−pγ, c1=21−pα>0, h=0 and a0=α∣f∣p+γ∣g∣p. By Theorem 4.4, E admits a minimizer over NN for every N≥1.
4.2 Lipschitz learning
Lipschitz learning constrains or penalizes the Lipschitz constant Lip(u):=supx=y∈Ω∣u(x)−u(y)∣/∣x−y∣ of a classifier in order to make it robust to perturbations of the input, see, for instance, [12, 18, 21]. Throughout this subsection, every u∈W1,∞(Ω) is identified with its continuous representative on the open set Ω, so that Lip(u)∈[0,∞] is well defined and constraints such as 0≤u≤1 hold pointwise. Note that ∥∇u∥L∞(Ω)≤Lip(u).
We shall first discuss the binary classification problem with Lipschitz constraint. Lipschitz learning then takes the form of minimizing the following energy
Here ρ is a probability measure on Ω×{0,1} and ℓ:[0,1]2→[0,∞) is a loss function, continuous in its first variable.
Example 4.9 (Lipschitz learning). E defined in (20) satisfies (H1)–(H3) with p=∞ and hence, by Theorem 4.2, admits a minimizer in NN for every N≥1. Clearly E≥0>−∞.
For (H1), let un∗u in W1,∞(Ω) with liminfn→∞E(un)<∞, so that, along a subsequence realizing the liminf we have un∈CL. In particular, un is uniformly bounded in W1,∞(Ω). Hence, by the Arzelà–Ascoli theorem the continuous representatives of un converge locally uniformly on Ω (and hence also pointwise) to some u∈CL. Thanks to the continuity of ℓ and Fatou's lemma we have
Furthermore, coercivity (H2) is immediate since, using ∥∇u∥L∞(Ω)≤Lip(u),
CL:={u∈W1,∞(Ω):0≤u≤1andLip(u)≤L}
is bounded in W1,∞(Ω).
Finally, (H3) holds since E(0)<∞.
Since (20) incorporates hard constraints, it is more of academic interest and less relevant in practice. There, one usually replaces the Lipschitz bound by a penalty term and the data-fitting term with a binary cross-entropy loss composed with the softmax function which eliminates the constraint 0≤u≤1. More precisely, u is now interpreted as a logit rather than a probability: Letting s(t):=1/(1+e−t) denote the sigmoid function, the class probabilities are (1−s(u),s(u)), and the loss is chosen as the cross-entropy composed with the softmax operation, i.e.,
ℓ(u,y):=−ylogs(u)−(1−y)log(1−s(u)),y∈{0,1}.
Since −logs(u)=L(−u) and −log(1−s(u))=L(u) with L(t):=log(1+et), the energy can be written compactly as
E(u):=∫Ω×{0,1}L((1−2y)u)dρ(x,y)+λLip(u),(21)
where λ>0. Note that E takes values in [0,∞], since Lip(u) may be infinite.
Example 4.10 (Cross-entropy with Lipschitz penalty). Assume that the unnormalized conditional distributions ρi:=ρ(⋅×{i}) are not the zero measure for both i∈{0,1}. Then, E defined in (21) satisfies (H1)–(H3) with p=∞ and hence, by Theorem 4.2, admits a minimizer in NN for every N≥1.
For (H1), if un∗u in W1,∞(Ω) then by the Arzelà–Ascoli theorem un→u locally uniformly, hence pointwise on Ω. Since L≥0 is continuous, Fatou's lemma gives lower semicontinuity of the cross-entropy term, and Lip is lower semicontinuous under pointwise convergence.
For (H2), define D:=diam(Ω). Since ∥∇u∥L∞≤Lip(u)≤E(u)/λ, it suffices to show that E(un)→∞ when ∥un∥L∞→∞ with Lip(un) bounded uniformly in n. Suppose this is not the case, meaning for such a sequence we have supn∈NE(un)<∞. Note that ∥un∥L∞→∞ together with the uniform Lipschitz continuity of un implies that (up to passing to a subsequence) there exists x0∈Ω with ∣un(x0)∣→∞. Up to passing to another subsequence, we can, without loss of generality, assume that un(x0)→∞ (the case un(x0)→−∞ is treated symmetrically). We can use un≥un(x0)−DLip(un) on Ω, L(t)≥t, as well as ρ0(Ω)>0 to get
E(un)≥ρ0(Ω)(un(x0)−DLip(un))→∞,n→∞
which is a contradiction.
Finally, E(0)=log2<∞ which shows (H3).
4.3 Selection of minimal-norm parameters via weight decay
Theorem 4.2 guarantees that suitable energies E admit a minimizer u∗∈NN, but says nothing about the parameters realizing it. These are never unique: by positive homogeneity of σ, the rescaling (ai,wi,bi)↦(ai/t,twi,tbi), t>0, leaves uθ unchanged, so u∗ has parameter representations of arbitrarily large norm. A natural way to select one is to penalize the parameter norm. We show that minimizers of the penalized objective stay bounded and, as the penalty vanishes, accumulate only at minimal-norm parameter representations of minimizers of E. This is a classical instance of Tikhonov regularization [31].
Let RP denote the parameter space with P=N(d+2)+1, where each parameter vector θ=(a1,…,aN,w1,…,wN,b1,…,bN,c)∈RP induces a network realization uθ∈NN. Define the parameter loss J(θ):=E(uθ) and the weight decay regularizer R(θ):=∥θ∥2. For λ>0, consider the regularized objective
Fλ(θ):=J(θ)+λR(θ).
We will need the following lemma:
Lemma 4.11 (Continuity of the realization map). Let Ω⊂Rd be bounded and 1≤p<∞. The map RP∋θ↦uθ∈W1,p(Ω) is continuous.
Proof. Let θn→θ, and write zin(x):=win⋅x+bin and zi(x):=wi⋅x+bi. By [15, Prop. 4.1], or directly because σ is 1-Lipschitz, uθn→uθ uniformly on Ω, hence in Lp(Ω). By the chain rule, ∇uθ=∑i=1Naiwi1{zi>0} a.e. in Ω and terms with wi=0 vanish on both sides. Therefore
The first sum tends to 0 uniformly. For the second sum, if wi=0, then zin→zi pointwise, so 1{zin>0}→1{zi>0} outside the null set {zi=0}. The summands are bounded by 2∣ai∣∣wi∣ and Ω is bounded, so dominated convergence gives convergence in Lp(Ω). □
Proposition 4.12 (Convergence to minimal-norm parameter representations). Let E:W1,p(Ω)→(−∞,∞], 1<p<∞, satisfy (H1)–(H3).
(i) For every λ>0, Fλ attains its global infimum over RP at some θλ∈RP.
(ii) The family of regularized minimizers (θλ)λ>0 is bounded in RP.
(iii) Every sequence λn→0+ admits a subsequence (λnk)k such that θλnk→θ† in RP, where θ† is a minimal-norm optimal parameter representation:
Proof. Step 1: Existence of a minimal-norm minimizer. By Theorem 4.2, the unregularized set of parameter minimizers Θ∗:={θ∈RP:J(θ)=infNNE} is non-empty. Using Lemma 4.11, θ↦uθ is continuous from RP into W1,p(Ω) and E is weakly lower semicontinuous, J is lower semicontinuous on RP and bounded from below. Thus Θ∗ is a non-empty, closed subset of RP. Since R(θ)=∥θ∥2 is continuous and coercive, it attains its minimum over Θ∗ and we can choose θ†∈argminθ∈Θ∗R(θ).
Step 2: Boundedness of θλ. Fix λ>0. The functional Fλ is lower semicontinuous and coercive on RP because J is bounded from below and λR(θ)→+∞ as ∥θ∥→∞. Hence Fλ admits a minimizer θλ∈RP, proving (i). By minimality of θλ:
which yields R(θλ)≤R(θ†). Thus, ∥θλ∥≤∥θ†∥ for all λ>0, establishing (ii).
Step 3: Convergence as λ→0+. Let λn→0+. By (ii) and the Bolzano–Weierstrass theorem, there is a subsequence with θλnk→θ0 for some θ0∈RP. Lower semicontinuity of J gives
which implies J(θ0)=infNNE, so θ0∈Θ∗. Continuity of R together with Step 2 yields R(θ0)=limkR(θλnk)≤R(θ†). By definition of θ†, we conclude R(θ0)=R(θ†), so θ0 is a minimal-norm parameter representation. Finally, uθλnk→uθ0 in W1,p(Ω) by Lemma 4.11, which proves (iii) with θ0 in place of θ†. □
4.4 Failure of existence for two hidden layers
The existence results above rely on Theorem 2.3, and therefore on the network having a single hidden layer. Theorem 3.1 shows that this restriction cannot be removed. Even for the simplest energy of Example 4.8, a coercive, convex and continuous functional on W1,p(Ω), the infimum over networks with two hidden layers need not be attained.
For u∈NN,M as in (10), we write θ=(we,be,cke,dk,ak,c)∈RP′ for its parameters, where P′:=N(d+1)+M(N+1)+M+1, and uθ for its realization on Ω.
Proposition 4.13 (Sobolev training over two hidden layers). Let d≥2, let Ω⊂Rd be bounded and open, and let f be the target of Theorem 3.1. For 1≤p<∞ and α,γ>0, consider the Sobolev training energy (19) with g=∇f, i.e.
E(u)=α∥u−f∥Lpp+γ∥∇u−∇f∥Lpp
Then:
(i) infu∈N4,6E(u)=0, and this infimum is not attained.
(ii) Every minimizing sequence (uθn)n⊂N4,6 satisfies ∥θn∥→∞.
Proof. (i). By Theorem 3.1, the networks uη∈N4,6 satisfy
E(uη)≤α∣Ω∣(Cη)p+γCpηη→00.
Hence the infimum is 0. If E(u)=0 for some u∈N4,6, then u=f a.e. in Ω. Both functions are continuous, so u=f on Ω, which contradicts f∈/N4,6.
(ii). The map (θ,x)↦uθ(x) is continuous, so θ↦uθ is continuous from RP′ into C(Ω). Suppose that E(uθn)→0 and that (θn) has a bounded subsequence. A further subsequence converges to some θ∗, and then uθn→uθ∗ uniformly on Ω. Hence ∥uθ∗−f∥Lp=limn∥uθn−f∥Lp=0, and uθ∗=f as in (i). This is a contradiction. □
Remark 4.14. The energy E is convex and continuous on W1,p(Ω), and coercive since E(u)≥min(α,γ)∥u−f∥W1,pp. So it satisfies (H1)–(H3), cf. Example 4.8. Thus Theorem 4.2 is false for NN,M in place of NN, for every 1<p<∞.
5 Discussion
In this paper, we proved that the set of ReLU neural networks with one hidden layer is closed in Sobolev spaces, and as a consequence gave existence proofs for learning methods like the Deep Ritz method or Lipschitz learning. We also disproved a conjecture by Petersen, Raslan and Voigtlaender by constructing a sequence of ReLU networks with two hidden layers with a limit that cannot be represented with the same number of neurons. Hence, the space of ReLU neural networks with two hidden layer is not closed, neither in Sobolev spaces not in the space of continuous functions.
Our results imply that regularization methods like weight decay are called for if one wants to ensure the existence of optimal deep neural networks, minimizing a given loss. In contrast, the special geometry of shallow ReLU networks ensures existence even without regularization.
A natural follow-up question from our results is whether learning problems with finitely many data always possess solutions (over the space of shallow or deep ReLU networks) or the study of existence of solutions for the bounded-variation-type problems that arise from adversarial training, see [1] where a weight-decay regularizer was added to ensure coercivity and existence of solutions in NN. Another direction could be to investigate the convergence of (stochastic) gradient descent in the context of Sobolev training or the Deep Ritz method over the space NN, similarly to [10].
Acknowledgment
LB acknowledges funding by the Federal Ministry of Research, Technology and Space of Germany (BMFTR) under grant agreement No. 16IS24072 (COMFORT) and by the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation), project number 544579844 (GeoMAR).
AI use disclosure
Claude Opus 5.5 was used to refine an initial draft of Theorem 2.3, which was originally written by the authors. The result stated in Theorem 3.1 is based on a counterexample initially derived entirely by Claude and subsequently refined by the authors. The remainder of the paper was written by the authors and all AI-generated proofs were carefully reviewed, largely rewritten for clarity, and verified by the authors, who retain full responsibility for the correctness of the manuscript.
Claude was also used to improve grammar and style, as well as to perform final mathematical checks and help to create visual illustrations of the proofs.
References
[1] Yannick Lunk, Atell Yehor Krasnopolsky, Damien Garreau, and Leon Bungert. Explaining the Saliency Map Sparsity of Adversarially-Trained Neural Networks. 2026. arXiv:2610.10666 [cs.LG] (cit. on p. 24).
[2] Nima Rezaei and Stephan Wojtewytisch. “The Barron–Lipschitz Energy Gap and Depth Separation Phenomena in Scientific Machine Learning”. In: arXiv preprint arXiv:2607.25905 (2026). arXiv: 2607.25905 [math.AP] (cit. on pp. 3, 18).
[3] Stephan Wojtewytisch. “Elliptic Regularity Theory in Barron Spaces and Applications to the Deep Ritz Method”. In: arXiv preprint arXiv:2607.25100 (2026). arXiv: 2607.25100 [math.NA] (cit. on p. 3).
[4] Enrique Zuazua. “The Coercivity Gap in Neural PDE Solvers: Parameter Escape and Functional Convergence”. In: arXiv preprint arXiv:2606.04018 (2026). arXiv: 2606.04018 [math.NA] (cit. on p. 3).
[5] Steffen Dereich, Arnulf Jentzen, and Sebastian Kassing. “On the Existence of Minimizers in Shallow Residual ReLU Neural Network Optimization Landscapes”. In: SIAM Journal on Numerical Analysis 62.6 (2024), pp. 2640–2666 (cit. on p. 2).
[6] Steffen Dereich and Sebastian Kassing. “On the Existence of Optimal Shallow Feed-forward Networks with ReLU Activation”. In: Journal of Machine Learning 3.1 (2024), pp. 1–22 (cit. on pp. 2, 8).
[7] Quoc-Tung Le, Elisa Riccietti, and Rémi Gribonval. “Does a Sparse ReLU Network Training Problem Always Admit an Optimum?” In: Advances in Neural Information Processing Systems. Vol. 36. 2023 (cit. on pp. 2, 9).
[8] Steffen Dereich and Sebastian Kassing. “On minimal representations of shallow ReLU networks”. In: Neural Networks 148 (2022), pp. 121–128 (cit. on p. 14).
[9] Patrick Dondl, Johannes Müller, and Marius Zeinhofer. “Uniform Convergence Guarantees for the Deep Ritz Method for Nonlinear Problems”. In: Advances in Continuous and Discrete Models 2022 (2022), Paper No. 49 (cit. on p. 2).
[10] Arnulf Jentzen and Adrian Riekert. “On the Existence of Global Minima and Convergence Analyses for Gradient Descent Methods in the Training of Deep Neural Networks”. In: Journal of Machine Learning 1.2 (2022), pp. 141–246 (cit. on pp. 2, 24).
[11] Johannes Müller and Marius Zeinhofer. “Error Estimates for the Deep Ritz Method with Boundary Penalty”. In: Proceedings of Mathematical and Scientific Machine Learning. Ed. by Bin Dong, Qianxiao Li, Lei Wang, and Zhi-Qin John Xu. Vol. 190. Proceedings of Machine Learning Research. PMLR, 2022, pp. 215–230 (cit. on pp. 2, 3).
[12] Leon Bungert, René Raab, Tim Roith, Leo Schwinn, and Daniel Tenbrinck. “CLIP: Cheap Lipschitz Training of Neural Networks”. In: Scale Space and Variational Methods in Computer Vision (SSVM 2021). Ed. by Abderrahim Elmoataz, Jalal Fadili, Yvain Quéau, Julien Rabin, and Loïc Simon. Vol. 12679. Lecture Notes in Computer Science. Cham: Springer, 2021, pp. 307–319 (cit. on pp. 2, 21).
[13] Christoph Hertrich, Amitabh Basu, Marco Di Summa, and Martin Skutella. "Towards Lower Bounds on the Depth of ReLU Neural Networks". In: Advances in Neural Information Processing Systems. Vol. 34. 2021, pp. 3336–3348 (cit. on pp. 2, 12).
[14] Scott Mahan, Emily J. King, and Alexander Cloninger. "Nonclosedness of Sets of Neural Networks in Sobolev Spaces". In: Neural Networks 137 (2021), pp. 85–96 (cit. on p. 2).
[15] Philipp Petersen, Mones Raslan, and Felix Voigtlaender. "Topological Properties of the Set of Functions Generated by Neural Networks of Fixed Size". In: Foundations of Computational Mathematics 21 (2021), pp. 375–444 (cit. on pp. 2, 4, 9, 22).
[16] Ingo Gühring, Gitta Kutyniok, and Philipp Petersen. "Error Bounds for Approximations with Deep ReLU Neural Networks in Ws,p Norms". In: Analysis and Applications 18.5 (2020), pp. 803–859 (cit. on p. 3).
[17] Juncai He, Lin Li, Jinchao Xu, and Chunyue Zheng. “ReLU Deep Neural Networks and Linear Finite Elements”. In: Journal of Computational Mathematics 38.3 (2020), pp. 502–527 (cit. on pp. 2, 12).
[18] Vishaal Krishnan, Al Makdah, Abed AlRahman, and Fabio Pasqualetti. “Lipschitz bounds and provably robust training by Laplacian smoothing”. In: Advances in Neural Information Processing Systems 33 (2020), pp. 10924–10935 (cit. on pp. 2, 21).
[19] Johannes Müller and Marius Zeinhofer. “Deep Ritz Revisited”. In: ICLR 2020 Workshop on Integration of Deep Neural Models and Differential Equations. 2020 (cit. on p. 2).
[20] Jinchao Xu. “Finite Neuron Method and Convergence Analysis”. In: Communications in Computational Physics 28.5 (2020), pp. 1707–1745 (cit. on p. 2).
[21] Chris Finlay, Jeff Calder, Bilal Abbasi, and Adam Oberman. Lipschitz regularized Deep Neural Networks generalize and are adversarially robust. 2019. arXiv: 1808.09540 [cs.LG] (cit. on pp. 2, 21).
[22] Raman Arora, Amitabh Basu, Poorya Mianjy, and Anirbit Mukherjee. “Understanding Deep Neural Networks with Rectified Linear Units”. In: International Conference on Learning Representations (ICLR). 2018 (cit. on pp. 2, 12).
[23] Weinan E and Bing Yu. “The Deep Ritz Method: A Deep Learning-Based Numerical Algorithm for Solving Variational Problems”. In: Communications in Mathematics and Statistics 6.1 (2018), pp. 1–12 (cit. on pp. 2, 18).
[24] Wojciech M. Czarnecki, Simon Osindero, Max Jaderberg, Grzegorz Swirszcz, and Razvan Pascanu. “Sobolev Training for Neural Networks”. In: Advances in Neural Information Processing Systems. Vol. 30. 2017, pp. 4278–4287 (cit. on pp. 2, 20).
[25] Jindřich Nečas. Direct Methods in the Theory of Elliptic Equations. Springer Monographs in Mathematics. Heidelberg: Springer, 2012 (cit. on p. 19).
[26] Haim Brezis. Functional Analysis, Sobolev Spaces and Partial Differential Equations. Universitext. New York: Springer, 2011 (cit. on pp. 18, 19).
[27] Irene Fonseca and Giovanni Leoni. Modern Methods in the Calculus of Variations: LP Spaces. Springer Monographs in Mathematics. New York: Springer, 2007 (cit. on p. 19).
[28] Paul C. Kainen, Věra Kürková, and Andrew Vogt. “Best Approximation by Linear Combinations of Characteristic Functions of Half-Spaces”. In: Journal of Approximation Theory 122.2 (2003), pp. 151–159 (cit. on p. 2).
[29] Paul C. Kainen, Věra Kürková, and Andrew Vogt. “Best Approximation by Heaviside Perceptron Networks”. In: Neural Networks 13.7 (2000), pp. 695–697 (cit. on p. 2).
[30] Isaac E Lagaris, Aristidis Likas, and Dimitrios I Fotiadis. "Artificial neural networks for solving ordinary and partial differential equations". In: IEEE transactions on neural networks 9.5 (1998), pp. 987–1000 (cit. on p. 8).
[31] Heinz W. Engl, Martin Hanke, and Andreas Neubauer. Regularization of Inverse Problems. Vol. 375. Mathematics and Its Applications. Dordrecht: Kluwer Academic Publishers, 1996 (cit. on p. 22).
[32] Federico Girosi and Tomaso Poggio. "Networks and the Best Approximation Property". In: Biological Cybernetics 63.3 (1990), pp. 169–176 (cit. on p. 1).