Manuscript Offprint
arXiv:2611.05626Exact signal recovery from generative priors with sigmoid output activation
ABSTRACT
We show exact signal recovery in generative compressed sensing for feedforward neural networks with piecewise-linear activations and a final sigmoid activation, with no assumption of expansivity. Consider a ReLU network of depth with a sigmoid final activation, whose input layer, of dimension , is the narrowest, and let be the geometric mean of the widths of its layers. We show that, with high probability, all signals of the range whose entries lie in are uniformly recovered from measurements.
1 Introduction
Compressed sensing recovers a signal from linear measurements , with deterministic noise , by leveraging a prior assumption on the structure of the true signal. Classical theory uses sparsity. Generative compressed sensing uses a trained generator instead: natural images lie close to the range of a network trained on them, and searching that range for the image whose measurements best match recovers images from far fewer measurements than sparsity needs [1].
How many measurements suffice is a question about the complexity of the range: the measurement matrix must not collapse the difference between two images of the range, so that they may be differentiated from measurements alone. A random matrix with few rows preserves the norm of any one fixed vector with high probability; the difficulty is to do so for all differences of points in the range at once. The more complex the range, the more directions these differences take, and the more likely a random matrix is to collapse some of them.
The complexity of the range of feedforward neural networks has been quantified in several ways. For networks with rectified linear units (ReLU), the range is a union of pieces of dimension at most . A union bound over pairs of pieces shows that, once for an absolute constant , has the restricted isometry property (RIP) on the differences of points in the range: it preserves their lengths up to a constant factor, and recovery of signals in the range from noiseless measurements is exact [1], [7]. Here and in the rest of the paper, denote absolute constants, which may differ from one appearance to the next.
For general -Lipschitz networks with inputs in a ball of radius , Bora et al. [1] obtain recovery up to an accuracy of from measurements. The generality of the Lipschitz route has a cost: the Lipschitz constant of a trained network is typically very large, and the sample complexity it gives is then often an artifact of the theory rather than a property of the range. For example, for a linear generator with of rank , the range is a -dimensional subspace, so measurements suffice, while is arbitrary. The sample complexity is governed by the geometry of the range, not by the Lipschitz constant. Piece counting captures this geometry for piecewise-linear networks, but decoders commonly end in a sigmoid, and their range has no flat pieces.
*Corresponding author.
Gajjar and Musco [3] use piecewise-linear approximations to obtain embeddings for subspaces under smooth entrywise nonlinearities. Their pairwise-distance theorem covers generators of the form , without bounds on the input or the weight matrix, but includes an additive error term. They also prove purely relative norm embeddings for certain nonlinearities; however, these do not directly provide the secant estimates required for signal recovery. In the many-layer case, they use the Lipschitz constant of the network. We also approximate the sigmoid with a piecewise-linear function, but in relative error, enabling exact recovery in the noiseless setting. Our results do not depend on the Lipschitz constant of the network, and our sample complexity matches that of piecewise-linear networks of the same architecture, up to an additive doubly-logarithmic term.
For ReLU networks whose input layer is the narrowest, we provide a signal recovery result for a final sigmoid activation, uniform over the signals away from saturation.
Theorem 1.1 (Simplified version of Theorem 3.7). Let be a feedforward network of depth with ReLU intermediate activations, sigmoid final activation and widths in , let be a saturation level, and let be a matrix with independent entries. With , suppose that the input layer is the narrowest, for , and let be the geometric mean of the widths of the layers of the network. We require that . There are absolute constants such that if
then with probability at least , for every signal whose entries lie in , noise and tolerance , with measurements , every such that satisfies
This result follows directly from Theorem 3.7; we provide the details in the appendix.
Our method is to first prove a sharper bound on the number of linear pieces in the range of a piecewise-linear feedforward network, improving on [7, Lemma 3.1]: we truncate the network at its narrowest layer, and the bound holds for any piecewise-linear activation with a finite hyperplane cover, with biases (Section 2). Counting the linear pieces of a network is also a classical question in the study of expressivity [6], [8], [4]. Compared with these counts, we obtain a tighter bound by recognizing that all pieces originating from layers preceding the bottleneck layer get merged together at the bottleneck layer, and therefore do not contribute to the complexity of the range. This improvement is only meaningful when considering the number of pieces in the range; if one cares about the number of pieces of as a piecewise-linear function, then earlier layers cannot be ignored.
We then approximate the network in a metric suited to signal recovery. Consider , a smooth output activation after a piecewise-linear network , and for a piecewise-linear approximation of . The network is piecewise linear, and by counting its pieces we can guarantee the RIP on the difference vectors of its range with high probability. The RIP depends only on the directions of the difference vectors, not their lengths, so the RIP of passes to when each difference vector of is close in angle to some difference vector of . A sufficient condition is that, for some small and all ,
Requiring the approximation to be uniformly close to would be the wrong metric: it leaves an additive error and fails to guarantee exact recovery. Instead, we choose to approximate relatively: for all real ,
which gives the bound above coordinate by coordinate, since the two networks share . This works for any smooth output activation that admits such an approximation; we construct one for the sigmoid, a common choice in practice; other smooth output activations can be treated similarly. The main difficulty is that, for the sigmoid, such a piecewise-linear approximation must have infinitely many pieces. We get around this by restricting the uniform guarantee to the signals away from saturation, whose entries lie in for a saturation level fixed in advance. Their pre-activations lie in a bounded window, and we only need the bound above for in that window, which one approximation with finitely many pieces achieves for all (Section 3). The sample complexity then depends, through a double logarithm, on how far into saturation the sigmoid may go to generate the true signal: the saturation level adds only a term , about for .
. Such a finite set of affine hyperplanes is called an arrangement of hyperplanes. An arrangement splits the space into cells, the connected components between the hyperplanes. The activation is affine wherever no entry of changes sign, that is, on each cell of the arrangement of these hyperplanes. The same holds for any continuous piecewise-linear entrywise activation, with one hyperplane per entry and kink. Activations that are not entrywise, such as max-pooling, are still affine on the cells of finitely many hyperplanes, and the number of these hyperplanes is what our bounds use.
Definition 2.1. A hyperplane cover of a continuous piecewise-linear map is a finite set of affine hyperplanes in the domain of such that is affine on each cell of their arrangement.
Definition 2.2. A feedforward network with layers of widths in is
with affine maps , , where , , and activations , , which are continuous piecewise-linear maps, each with a finite hyperplane cover.
The parameters of are the depth , the bottleneck layer , and the hyperplane counts , , the least number of hyperplanes in a hyperplane cover of .
Remark 2.3. For a max-pooling activation, fix a pool size dividing , and split the coordinates of into blocks of consecutive coordinates, . A max-pooling activation returns the maximum of each block, padded with zeros to keep the width . The maximum of a block is linear on each set where a given coordinate of the block is largest, and these sets are cut out by the hyperplanes , one for each pair of indices in a common block. Each block contributes hyperplanes, so . A similar hyperplane count for max-pooling appears in [8, Theorem 10].
Lemma 2.4. Consider an arrangement of affine hyperplanes in , . It has at most
cells.
Proof of Lemma 2.4. By [5, Proposition 6.1.1], the cells number at most . If , then for , so this sum is , as is nondecreasing on and equals at . If , then and give
Lemma 2.5. Let , let be affine subspaces, each of dimension at most , and let be continuous with a hyperplane cover, as in Definition 2.1, of hyperplanes. Then lies in a union of at most affine subspaces of , each of dimension at most .
Proof of Lemma 2.5. It suffices to show that each , lies in a union of at most affine subspaces of dimension at most .
Fix , write , let be its dimension, and let be the hyperplane cover of , with hyperplanes. At most hyperplanes cut in a hyperplane of . If , is a point and a single cell. Otherwise, by Lemma 2.4, has at most (1+eM/D')^D' \leq (1+eM/D)^D cells, whose closures cover ; the inequality holds as is nondecreasing on .
We show that is affine on the closure of each cell of , by showing that lies in the closure of a single cell of . The cells of are described by picking a side for each hyperplane in the arrangement: one of its two open half-spaces. The points lying in every picked half-space form a cell, when that set is nonempty. Fix a direction parallel to no hyperplane of . For each , we have either:
-
does not contain , and then , being connected and disjoint from , lies in one open half-space of ; we pick that one; or
-
contains , and then lies on neither side; we pick the side towards which points.
Let be the set of points lying in every picked half-space. It is nonempty: pick any . For each hyperplane containing , the point lies on the side towards which points for every , as lies on the hyperplane; for each other hyperplane, lies strictly on the picked side, and so does for small enough , by continuity. So is a cell of whose closure contains . The map is affine on , by definition of a hyperplane cover, therefore on , by continuity, and therefore on .
Thus each lies in an affine subspace of dimension at most , and is covered by at most such subspaces.
The next proposition covers the range by few low-dimensional pieces. By truncating the network at its narrowest layer, it improves on the piece count of [7, Lemma 3.1] and requires no expansivity.
Proposition 2.6. Let be a network as in Definition 2.2, with parameters . Then there are affine subspaces , each of dimension at most , with
Remark 2.7. This bound can be further refined by using the minimal rank of the weight matrices in place of the minimal width.
Proof of Proposition 2.6. Write .
If , then , and the claim holds with and . Let from now on.
For , define the network from the bottleneck to layer to be
and let be the identity map of . The network after the bottleneck is , so that , and if . Hence lies in the image . We argue by induction that for every , the image lies in a union of affine subspaces of , each of dimension at most , with
For , take the single subspace , so . For , let be the affine subspaces given by induction. Since is affine, each is an affine subspace of of dimension at most , and their union contains . The activation is continuous with a hyperplane cover of hyperplanes, so by Lemma 2.5, with and , the image lies in a union of at most affine subspaces of , each of dimension at most . Hence Equation (1) holds for .
At , as , this gives affine subspaces , each of dimension at most , with and
The bound is increasing in each , so an upper bound on the number of hyperplanes may be substituted for it.
Definition 2.8. Let . A matrix satisfies the -RIP (restricted isometry property with constant ) on a set if
Proposition 2.9. Let G be a network as in Definition 2.2, with parameters b, d, , and N such that
If has independent entries and , then with probability at least , satisfies the -RIP on range; are absolute constants.
Proof of Proposition 2.9. Let , with , be the affine subspaces of Proposition 2.6. A chord lies in some , which spans a linear subspace of dimension at most , so the chords of lie in the union of the at most subspaces . On a fixed subspace of dimension , a Gaussian matrix satisfies for all in it with probability at least once ([9, Theorem 4.6.1]). A union bound over the subspaces of gives these bounds on all of , hence on the chords, the factor being absorbed, for large enough, since then , at the cost of halving , as in [1] and [7].
3 Smooth output activation
We now consider networks whose final activation is the sigmoid , all earlier activations being piecewise linear. The idea is to replace by a piecewise-linear approximation : the resulting network is piecewise linear, so the proposition above gives the restricted isometry on its range, and the next lemma carries it over to when is close to . Closeness on the chords from every true signal of the range would need infinitely many pieces in , since entries of near 0 or 1 come from arbitrarily large pre-activations. Instead, we fix a saturation level before is drawn, and only consider true signals whose entries lie in . Their pre-activations lie in a bounded window, where a with few pieces suffices.
Lemma 3.1. Let , let , and let . If , then
Proof of Lemma 3.1. The first hypothesis gives and . By the triangle inequality and the second,
since .
Applied at every chord from a signal away from saturation, the lemma passes the -RIP on the chords of to the -RIP on those of . For a Gaussian matrix , the relative accuracy it asks for is of order .
Remark 3.2. Write and for the normalized chords. The restricted isometry of a chord depends only on its direction: the ratio is in fact . So comparing with means comparing with . These are close when the unit vectors and are close, that is, when the angle between and is small. The hypothesis of the statement makes this angle small:
3.1 Approximating the sigmoid
It remains to build a suitable : a piecewise-linear activation with few pieces such that approximates G well enough for the restricted isometry to transfer from to G, as in Lemma 3.1. We begin with an approximation on a bounded interval.
Lemma 3.3. Let be real numbers, , and let with , let and let . There is a continuous piecewise-linear with , and at most pieces such that for all
Proof of Lemma 3.3. Let , so that . Since is continuous in , we can take nodes with and on each subinterval , and let interpolate . On a subinterval, for all in it, so . On each subinterval, the slope is the average of over it, so it lies between the least and greatest value of there, and . Subtracting gives , and since , . Hence for in ,
The transfer needs more: the approximation must follow the increments of the sigmoid from the pre-activation of every signal away from saturation, which lies in a bounded interval, to any other point of the line.
Lemma 3.4. Let be the sigmoid, , let and , and let . The piecewise-linear approximation is, on , the one of given by Lemma 3.3 with accuracy parameter , and is constant on the tails, on and on . It is continuous, has at most pieces, and follows the increments of from every point of to relative accuracy : for all and ,
Proof of Lemma 3.4. We first count the pieces. As , , so Lemma 3.3 gives at most pieces on , plus two tails, and as ; is continuous because it agrees with at and .
For the accuracy bound, write , so that , and let . If , Lemma 3.3 gives .
If , then . As , the triangle inequality gives
and we bound both terms by . For the first, since for all and for ,
For the second, Lemma 3.3 at the pair gives . Hence , while , so
If , the same argument applies with in place of , since .
Remark 3.5. At a fixed relative accuracy, the piecewise-linear approximation needs a number of pieces proportional to the length of the interval, and no piecewise-linear function with finitely many pieces approximates the sigmoid on all of in this sense. This is why follows the increments of the sigmoid only from the points of the window , which holds the pre-activations of the signals away from saturation, and is constant on the tails.
The scalar approximation carries over to the networks.
Lemma 3.6. Let be a network of depth as in Definition 2.2 with hyperplane counts , let be affine, let , with the sigmoid applied entrywise, let and , let be the piecewise-linear approximation of the sigmoid from Lemma 3.4 with accuracy parameter , applied entrywise, and let , . Then is a network as in Definition 2.2 with hyperplane counts and
and for all with ,
Proof of Lemma 3.6. The bound of Lemma 3.4 in coordinate , at with , squared and summed over , is the accuracy claim. For the count, has one kink fewer than its pieces, and the hyperplanes , for each entry and kink , cover it on .
3.2 Recovery with Gaussian measurements
Theorem 3.7. Let , let be a network of depth as in Definition 2.2 with hyperplane counts . With , let be the bottleneck layer of the widths , so that . Let be affine, and let be the network , where is the sigmoid applied entrywise. Let . Finally, let be a matrix with independent entries. There are absolute constants such that if
then with probability at least the following holds. For every signal , point , noise and tolerance , with measurements , and any such that , we have
Proof of Theorem 3.7. We first show that, with probability at least , satisfies the -RIP on the set of differences ; the error bound then follows in a few lines. To get the RIP, we approximate by a piecewise-linear network , fixed before is drawn, whose range has few pieces, so that satisfies the RIP on its range, and we transfer the RIP from to .
We start with the approximation. Let , so that, as the sigmoid is increasing, exactly when . Let , and let be the network of Lemma 3.6 with accuracy parameter . As and , we have that is a network as in Definition 2.2 whose hyperplane counts match those of , and whose last count satisfies for an absolute constant .
We show that satisfies the RIP on the range of . With as in Proposition 2.9, . Taking into account the bound on , the sample complexity bound in the statement suffices for Proposition 2.9, which gives the -RIP on range() - range() with probability at least . Also, with probability at least ([9, Theorem 7.3.1] and Gaussian concentration, [2, Theorem 5.6]). Taking , by a union bound both events hold with probability at least .
We now transfer the RIP from to . Conditioning on both events, as ,
which shows that is small enough to satisfy the conditions of Lemma 3.1. By Lemma 3.6, for every and every with , the difference is within relative accuracy of , so Lemma 3.1 gives the -RIP on range.
Finally we bound the recovery error. Let . By the RIP and the choice of , which gives ,
The claim follows from .
In the ideal setting, where we have noiseless measurements , no modeling error and an exact minimizer , we obtain exact recovery, . Also note that when lies off the range, with high probability, provided and are fixed before is drawn [1].
Truncating the sigmoid at the saturation level removes the restriction to .
Corollary 3.8. Make the assumptions of Theorem 3.7, but with the final activation of replaced by the sigmoid truncated at , , . Then the guarantee of that theorem holds for every .
Proof of Corollary 3.8. We model the truncated sigmoid by adding an intermediate layer in front of the untruncated sigmoid, so that the modified network becomes a network with the untruncated sigmoid whose whole range lies away from saturation. Let , so that and , and let be the all-ones vector. We build the layer before the sigmoid from ReLUs: let , , let be the ReLU applied entrywise, and let , . Then . This adds one layer before the sigmoid, of width with hyperplanes, and changes nothing else in the network. Every entry of a point of range lies in , so Theorem 3.7, at depth , applies to all of range . In its sample complexity bound the narrowest width stays , and the added layer contributes at most one term , which is absorbed in the absolute constant .
Conclusion
The main open problem arising from this work is uniform recovery without a saturation level: whether, for the un-truncated sigmoid, the matrix satisfies, with high probability, the restricted isometry on all chords of range , with a sample complexity competitive with that for piecewise-linear networks. Finally, only the output activation of our networks is smooth; one avenue for future work would be to extend our results to networks with smooth hidden activations.
Acknowledgements
The authors thank Sharvaj Kubal for many discussions and advice, and for his help in developing the piecewise-linear approximation of the sigmoid.
Y. Plan is partially supported by an NSERC Discovery Grant (GR009284) and an NSERC Discovery Accelerator Supplement (GR007657). O. Yilmaz was supported by an NSERC Discovery Grant (22R82411). O. Yilmaz also acknowledges support by the Pacific Institute for the Mathematical Sciences (PIMS) and the CNRS – PIMS International Research Laboratory.
Artificial intelligence was used at all stages of writing this manuscript, including planning, proof writing, and polishing the manuscript. The core ideas were developed by the authors, and the manuscript was thoroughly manually edited and reviewed.
Data availability
Data sharing is not applicable to this article as no datasets were generated or analysed during the current study.
Conflict of interest
On behalf of all authors, the corresponding author states that there is no conflict of interest.
References
[1] Ashish Bora, Ajil Jalal, Eric Price, and Alexandros G. Dimakis. Compressed sensing using generative models. In Proceedings of the 34th International Conference on Machine Learning, volume 70 of Proceedings of Machine Learning Research, pages 537–546. PMLR, 2017.
[2] Stéphane Boucheron, Gábor Lugosi, and Pascal Massart. Concentration Inequalities: A Nonasymptotic Theory of Independence. Oxford University Press, Oxford, 2013.
[3] Aarshvi Gajjar and Cameron Musco. Subspace embeddings under nonlinear transformations. In Proceedings of the 32nd International Conference on Algorithmic Learning Theory, volume 132 of Proceedings of Machine Learning Research, pages 656–672. PMLR, 2021.
[4] Peter Hinz and Sara van de Geer. A framework for the construction of upper bounds on the number of affine linear regions of ReLU feed-forward neural networks. IEEE Transactions on Information Theory, 65(11):7304–7324, 2019.
[5] Jiří Matoušek. Lectures on Discrete Geometry, volume 212 of Graduate Texts in Mathematics. Springer, New York, 2002.
[6] Guido Montúfar. Notes on the number of linear regions of deep neural networks. In 2017 International Conference on Sampling Theory and Applications (SampTA), 2017.
[7] Alireza Naderi and Yaniv Plan. Beyond independent measurements: General compressed sensing with GNN application. In NeurIPS 2021 Workshop on Deep Learning and Inverse Problems, 2021.
[8] Thiago Serra, Christian Tjandraatmadja, and Srikumar Ramalingam. Bounding and counting linear regions of deep neural networks. In Proceedings of the 35th International Conference on Machine Learning, pages 4558–4566. PMLR, 2018.
[9] Roman Vershynin. High-Dimensional Probability: An Introduction with Applications in Data Science, volume 47 of Cambridge Series in Statistical and Probabilistic Mathematics. Cambridge University Press, Cambridge, 2018.
Appendix
Proof of Theorem 1.1. The simplified statement is the special case of Theorem 3.7 for ReLU networks with , for which the first two terms of the error bound vanish. We only detail the points that are not immediate.
Hyperplane counts. The ReLU on is affine on each cell of the coordinate hyperplanes, so , and as the input layer is the narrowest.
Sample complexity. The bracket in Theorem 3.7 is increasing in each . As , we have , and with . So the bracket is at most
where the requirement , that is , absorbs . So the simplified statement holds with .