Learning with convolution and pooling operations in kernel methods
Theodor Misiakiewicz, Song Mei
Introduction
Convolutional neural networks (CNNs) have become essential elements of the deep learning toolbox, achieving state-of-the-art performance in many computer vision tasks . CNNs are constructed by stacking convolution and pooling layers, which were shown to be paramount to their empirical success . A widely accepted hypothesis to explain their favorable properties is that these architectures successfully encode useful properties of natural images: locality and compositionality of the data, stability by local deformations, and translation invariance. While some theoretical progress has been made in studying the approximation and generalization benefits brought by convolution and pooling operations , our mathematical understanding of the interaction between network architecture, image distribution, and efficient learning remains limited.
Note that pooling and downsampling operations are often tied together in the literature. However in this work we will treat these two operations separately.
In the formula above, different values for lead to different architectures with vastly different behaviors. For example, when and , we recover a two-layer fully-connected neural network which has the universal approximation property at large . When and , the network is “locally connected” , and not a universal approximator anymore: however, vastly outperforms in some cases . For , local pooling enables learning functions that are locally invariant by translations more efficiently than without pooling. For (global pooling), the network only fits functions fully invariant by cyclic translations.
The aim of this paper is to formalize and quantify the interplay between the target function class and the statistical efficiency brought by these different architectures. As a concrete first step in this direction, we consider kernel models that are naturally associated with the convolutional neural networks (CNN-AP-DS) through the neural tangent kernel perspective . Kernel methods have the advantage of 1) being tractable—leaving the computational issue of learning CNNs aside; 2) having well-understood approximation and generalization properties, which depends on the eigendecomposition of the kernel and the alignment between the target function and associated RKHS (see Appendices B and C for background). While kernel models only describe neural networks in the lazy training regime and miss important properties of deep learning, such as feature learning, architecture choice already plays a crucial role to learn efficiently ‘image-like’ functions in the fixed-feature regime.
Neural tangent kernels are obtained by linearizing the associated neural networks. Here we consider the tangent kernel associated to the network (c.f. Appendix A.2 for a detailed derivation):
In this paper, we will further consider a stylized setting with input signal distribution (uniform distribution over the discrete hypercube in dimensions). This simple choice allows for a complete characterization of the eigendecomposition of , thanks to all patches having same marginal distribution . We will be particularly interested in four specific choices of in (CK-AP-DS):
These kernels are respectively the neural tangent kernels of a fully-connected network (FC), a convolutional network (CK), a convolutional network followed by local average pooling (CK-AP) and a convolutional network followed by global pooling (CK-GP). We will further be interested in (CK-GP) with patch size , which we denote : this corresponds to a convolutional kernel with full-size patches , followed by global pooling.
Our contributions are two-fold. First, we describe the RKHS associated with the convolutional kernel (CK-AP-DS) in the stylized setting , which provides a fully explicit picture of the roles of convolution, pooling and downsampling operations in approximating specific classes of functions. Second, we provide sharp asymptotics for the generalization error of KRR in high-dimension, given any target function and one of the kernels described in the introductionNote that we modify slightly to simplify the derivation of the high-dimension asymptotics. However, we believe such a simplification to be unecessary. The fixed-dimension bounds do not require such a simplification.. These asymptotics are obtained rigorously using the framework of (see Appendix C for background). For completeness, we also include bounds on the KRR test error in the classical fixed-dimension setting with capacity/source assumptions (see Appendix C for limitations of this classical approach).
We summarize our results below. Define the -local function class and the cyclic -local function class (subspace of consisting of cyclic-invariant functions) as follows:
When , downsampling after average pooling leaves the low-frequency eigenspaces of stable. In particular, the downsampling operation does not modify the statistical complexity of learning low-frequency functions in one-layer kernels, while being potentially beneficial in further layers in deep convolutional kernels.
There are two important model assumptions in this paper, which deserve some discussions:
One-layer convolutional kernel (CK): extra layers allow for hierarchical interactions between the patches (see for example ). However, we believe that the main insights on the approximation and statistical trade-off are already captured in the one-layer case (see for multi-layer but independent patches). Note that depth might be less important for CKs than for CNNs: the one-layer CK considered in this paper achieves accuracy on CIFAR-10 (versus in ) and 3-layers CK achieves accuracy (versus for the best multi-layer CK ). See Appendix A.5 for a discussion on how our results could be extended to 2-layers.
Data uniform on the hypercube: this choice is motivated by our goal of deriving rigorous fine-grained approximation and generalization errors, which requires to diagonalize the kernel (CK-AP-DS). More general data distributions either require strong assumptions (independent patches ), loose minmax bounds on the generalization error (e.g., classical source/capacity assumptions) or non-rigorous statistical physics heuristics .
The rest of the paper is organized as follows. We discuss related work in Section 1.2. In Section 2, we present our main results on convolutional kernels and describe precisely the roles of convolution, pooling and downsampling operations. Finally, we present a numerical simulation on synthetic data in Section 3 and conclude in Section 4. Some details and discussions are deferred to Appendix A.
2 Related work
Convolutional kernels have been considered in . In particular, they showed that these architectures achieve good results in image classification ( accuracy on Cifar10) and that pooling and downsampling were necessary for their good performance .
The generalization error of kernel ridge regression (KRR) has been well-studied in both the fixed dimension regime [47, Chap. 13], and the high-dimensional regimes . These results show that the generalization error depends on the eigenvalues and eigenfunctions of the kernel, and the alignment of the kernel with the target function.
Recently, a few theoretical work have considered the generalization properties of invariant kernels and convolutional kernels . In particular, consider convolutional kernel with global pooling and full-size patches , and show a gain of factor in sample complexity when learning cyclic functions, compared to inner-product kernels. considers additionally kernels that are stable with respect to local deformations, and similarly quantify the sample complexity gain. A concurrent work considers sharp asymptotics of the KRR test error using the framework of for certain hierarchical convolutional kernels under the strong assumption of non-overlapping patches (whereas we consider the more natural architecture of overlapping patches). They arrive at a similar trade-off between approximation and generalization power in convolutional kernels, which they call ‘eigenspace restructuring principle’: given a finite statistical budget (i.e., a sample size ), convolutional architectures allocate the ‘eigenvalue mass’ by weighting differently the eigenspaces.
consider a one-layer convolutional kernel with and without global pooling and obtain a diagonalization similar to Proposition 1 for data uniformly distributed on the continuous cube. They further derive asymptotic rates in , the number of samples, in a student-teacher scenario using statistical physics heuristics and a Gaussian equivalence conjecture. In particular, they show that locality rather than translation-invariance breaks the curse of dimensionality. Here, our goal is different: we derive mathematically rigorous quantitative bounds that give separation in generalization power between different architectures. We consider classical source and capacity conditions and obtain non-asymptotic bounds on the test error that are minmax optimal in both and . We further give pointwise generalization error in a high-dimensional framework that give a separation in sample complexity for learning a given function.
See for more theoretical results on the separation between convolutional and fully connected neural networks, and for the inductive bias of pooling operations in convolutional neural networks.
Main results
We start by introducing some background on functions on the hypercube and eigendecomposition of kernel operators in Section 2.1. We first consider a kernel with a single convolution layer in Section 2.2, and characterize its eigendecomposition and generalization properties. We then show how these results are modified when applying local average pooling and downsampling in Section 2.3.
2 One-layer convolutional kernel
where we recall that is the ’th patch of the image with size .
Let be a convolutional kernel as defined in Eq. (3). Then admits the following eigendecomposition:
On the other hand, the RKHS associated to the fully-connected kernel (FC) typically contains all the functions in (under genericity assumptions on ). The RKHS with convolution is significantly smaller than , which prompts the following question: what is the statistical advantage of using over when learning functions in ?
We first consider the classical approach to bounding the test error of which relies on the following two standard assumptions:
Capacity condition: we assume withHere, is the integral operator and with eigenvalues of . .
Source condition: withAgain, is the operator with , where are the eigenvectors of . and .
The capacity condition (A1) characterizes the size of the RKHS: for increasing , the RKHS contains less and less functions. The source condition (A2) characterizes the regularity of the target function (the ‘source’) with respect to the kernel: increasing corresponds to smoother and smoother functions. See Appendix B.2 for more discussions.
Based on these two assumptions, we can apply standard bounds on the KRR test error and obtain:
Theorem 1 and results of this type suffers from several limitations: 1) they are tight only in a minmax sense; 2) they do not provide comparisons for specific subclasses of functions; 3) in order to obtain the minmax rate, the regularization parameter has to be carefully tuned to balance the bias and variance terms, which is in contrast to modern practice where often the model is trained until interpolation. This led several groups to consider instead the test error of KRR in a high-dimensional limit and derive exact asymptotic predictions correct up to an additive vanishing constant for any (see Appendix C for more details).
Using the general framework in , we get the following result for large:
where is the projection on the span of with either and or and .
See Appendix C.1 for a rigorous statement. In words, when , KRR with only learns a degree- polynomial approximation to .
On the other hand, when considering the standard inner-product kernel (FC) we get:
where is the projection on the subspace of degree- polynomials.
This theorem was proved in . Notice that Eq. (7) does not depend on the structure of . Hence, when , Theorems 2 and 3 shows a clear statistical advantage of over when (and therefore of one-layer CNNs over fully-connected neural networks in the kernel regime).
3 Local average pooling and downsampling
In many applications such as object recognition, we expect the target function to depend mildly on the absolute spatial position of an object and to be stable under small shifts of the input. To take this local invariance into account, convolution layers are often followed by a pooling operation. Here we consider local average pooling on a segment of length and obtain the kernel
Let be a convolutional kernel with local average pooling as defined in Eq. (8). Then admits the following eigendecomposition:
where (denoting the translated set by positions with cyclic convention in )
First notice that, as long as , the RKHS associated to contains the same set of functions as the RKHS of , i.e., all local functions . (There are number of zero weights: for all such that is a divisor of . See Appendix A.3 for details.) However will penalize different frequency components of the functions differently. Denote the -th component of the discrete Fourier transform of the function, i.e., where and is the cyclic shift by pixels. Then reweights the eigenspaces associated with by a factor , promoting low-frequency components () and penalizing the high-frequencies (). In words, pooling biases the learning towards low-frequency functions, which are stable by small shifts.
Let us focus on two special choices here: the pooling parameter and . When , reduces to ( for all ) which does not bias towards either low or high frequency components. When , we denote such kernel by which corresponds to global average pooling. In this case, we have and for which enforces exact invariance under the group of cyclic translations. More precisely, has RKHS that contains all cyclic q-local functions (c.f. Eq. (CYC-LOC)).
We obtain a bound on the test error of KRR with similar to Theorem 1, but with replaced by an effective dimension .
By Jensen’s inequality, we have . In particular, for global pooling, and the bound (11) does not depend on at all. Adding average pooling improve by a factor the upper bound on the sample complexity for fitting low-frequency functions. Can we confirm this statistical advantage using the predictions for KRR in high dimension? Consider first the case of global pooling:
Hence, global average pooling results in an improvement by a factor in statistical efficiency when fitting cyclic local functions, compared to . This improvement was already noticed in but in the case of (fully connected neural networks).
For , a direct application of the theorems in is more challenging because of the mixing of eigenvalues. In this case, a modification of , where eigenvalues are not necessary ordered anymore would apply. However, for simplicity, we present in Appendix C.1 a simplified kernel with non-overlapping local pooling which we believe captures the statistical behavior of local pooling. In this case, we show that Theorem 5 holds with , which interpolates between Theorem 2 () and Theorem 5 ().
Often pooling is associated with a downsampling operation, which subsample one every output coordinates. In Appendix A.4, we characterize the eigendecomposition of (Proposition 4) and prove for the popular choice , that downsampling does not modify the cyclic invariant subspace (Proposition 5). More generally, we conjecture and check numerically that downsampling with leaves the low-frequency eigenspaces approximately unchanged. In particular, the statistical complexity of learning low-frequency functions is not modified by downsampling operation in the one-layer case (while downsampling is potentially beneficial in further layers).
Numerical simulations
In order to check our theoretical predictions, we perform a simple numerical experiment on simulated data. We take with , and consider two target functions:
Here is a cyclic-invariant local polynomial ( is ‘low-frequency’). The function is a high-frequency local polynomial, and is orthogonal to the space of cyclic invariant functions. On these target functions, we compare the test error of kernel ridge regression with 5 different kernels: a standard inner-product kernel ; a cyclic invariant kernel (convolutional kernel with global pooling and full-size patches ); a convolutional kernel with patch size ; a convolutional kernel with local pooling with and ; and a convolutional kernel with global pooling with . In all these kernels, we choose a common which is a degree -polynomial.
In Figure 1, we report the test errors of fitting (left) and (right) using kernel ridge regression with these kernels. We choose a small regularization parameter , and the noise level . The curves are averaged over independent instances and the error bar stands for the standard deviation of these instances. The results match well our theoretical predictions. For the function , the sample sizes required to achieve vanishing test errors are ordered as and are around the predicted thresholds respectively. Next we look at the test error of fitting the high frequency local function . The test errors of and are the same for and : this is because these kernels do not have bias towards either high-frequency or low-frequency functions. The kernel perform worse on than on : this is because the eigenspaces of are biased towards low-frequency polynomials. The kernels and do not fit at all (test error greater than or equal to ): this is because the RKHS of these two kernels only contain cyclic polynomials, but is orthogonal to the space of cyclic polynomials.
Discussion and Future Work
In this paper, we characterized in a stylized setting how convolution, average pooling and downsampling operations modify the RKHS, by restricting it to -local functions and then biasing the RKHS towards low-frequency components. We quantified precisely the gain in statistical efficiency of KRR using these operations. Beyond illustrating the ‘RKHS engineering’ of image-like function classes, these results can further provide intuition and a rigorous foundation for convolution and pooling operations in kernels and CNNs. A natural extension would be to study the multilayer convolutional kernels in details and consider other pooling operations such as max-pooling. Another important question is how anisotropy of the data impacts the results of this paper: in particular, it was shown that pre-processing (whitening of the patches) greatly improves the performance of convolutional kernels . A more challenging question is to study how training and feature learning can further improve the performance of CNNs outside the kernel regime.
References
Appendix A Details from the main text
A.2 Convolutional neural tangent kernel
In this section, we justify the expression of the convolutional neural tangent kernel (CK-AP-DS), obtained as the tangent kernel of a neural network composed of a one convolution layer followed by local average pooling and downsampling (CNN-AP-DS).
For , define
Computing the derivative of the convolutional neural network with respect to , we have
Hence by law of large number, we have almost surely
Similarly, computing the derivative with respect to gives
By law of large number, using that and are independent of mean zero and variance , we get almost surely
Taking concludes the proof. ∎
A.3 Local average pooling operation
Consider a function : we can decompose it as
where and is the cyclic shift of by pixels. We can think about as the -th component of the discrete Fourier transform of the function seen as a -dimensional vector for any .
Notice furthermore that if is a local function, i.e., can be decomposed as a sum of functions on patches , then we can write
where we denoted ()
which shows that the -th frequency component is in the span of . In particular, applying average pooling operation in the kernel will reweight this eigenspace by a factor .
Let us further comment on the values of . First, we have
In particular, the maximal eigenvalue is attained at with , which corresponds to the subspace of cyclic invariant functions. Furthermore, if and only if is a divisor of for , i.e., is a multilple of . There are such zero eigenvalues.
where (the distance between and on with cyclic convention). Note that has the same eigendecomposition as but with different weights .
A popular choice for is the Gaussian filter . In Figure 2, we compare the eigenvalues for local average pooling and Gaussian filter with different value of and . Note that the eigenvalue decay controls how much high-frequencies are penalized: faster decay induces heavier penalty on the high-frequency components.
A.4 Downsampling operation
As mentioned in the main text, a downsampling operation is often added after pooling. The kernel is given by
Let us introduce the family of block-circulant matrices defined by
We can now state the eigendecomposition of in terms of the eigenvalues and eigenvectors of the matrices .
Let be a convolutional kernel with local average pooling and downsampling, as defined in Eq. (18). Then admits the following eigendecomposition:
where with eigenvalues and eigenvectors of .
Let us make a few comments on these matrices . First because they only depend on through the diameter , the eigenvalues and eigenvectors only depend on . Second, we see that and if , where (i.e., the distance between and on the torus ). In words is a symmetric block-circulant matrix with non-zero elements on a band of size on the left and right of the diagonal, and on the upper-right and lower-left corners. Furthermore, notice that
which is independent of and justify the chosen normalization. In particular, this implies that (for )
is also independent of the parameters .
Take , , , then
The matrix is Hermitian and we denote and its eigenvalues and eigenvectors. Then the eigenvalues and eigenvectors of are given by and .
In particular, if and is a circulant matrix, then the eigenvalues are simply given by
and eigenvectors .
Here we will focus on the impact of downsampling for single-layer convolutional kernels. We expect the downsampling operation to have a much more important role for the next layers: for example, increasing the scale of interactions or reducing the dimensionality of the pixel space.
To emphasize the dependency on , denote the matrix (19). We will study the change in the matrix when adding downsampling , and consider
where we denote . Notice that is a symmetric block-circulant matrix. Therefore, from Remark 1, the eigenvectors of are given by where and with and eigenvectors of (23). The eigenvectors of are given by with . Notice that
which is except when . Hence, we see that in Eq. (24) only modify the eigenspaces of as follows: the eigendirections coming from (23) only modify the eigenspaces of spanned by .
For simplicity, we will focus on the popular choice . Furthermore, we will only look at the impact of the eigenvalues on the eigenspace spanned by , which contain the cyclic invariant direction. We show below that and therefore does not modify the cyclic invariant eigenspace of :
Consider and the symmetric block-circulant matrix . Denote and
If , then , and downsampling does not modify the matrix .
We have and downsampling does not modify the cyclic invariant eigenspace .
Let us first start by proving point (a). Consider . Fix and . Let us compute the entry of the matrix : this amounts to counting the number of quadruples with , and , satisfying . Notice that we must have and therefore . Notice that for each interval with , there are exactly ways of choosing and then and to satisfy the equality. We deduce that
By symmetry of , this concludes the proof of point (a).
Consider now point (b). First notice, because has zero entries for , the only non-zero blocks are and . Furthermore, when computing , the diagonal entries only have one contribution from the diagonal elements of . The off-diagonal elements of have two contribution: one from and one from (if below the diagonal) or (if above the diagonal), i.e.,
Let us compute first the diagonal elements: we have easily, by a similar argument as above , and therefore has zero zero diagonal entries. For off-diagonal elements, first notice that . Then for , we can consider each subsegment separately, and by a simple counting argument, get . We deduce that , which by symmetry implies and concludes the proof. ∎
From the above result, we conjecture that more generally, for , the low-frequency eigenspaces of remain approximately unchanged when applying a downsampling operation. We verify this conjecture numerically in several examples. In Figure 3, we plot the eigenvalues with and without downsampling. On the left, we compare for fixed and increasing . We notice that the eigenvalues do not change much for , and for , some become null, as discussed above. On the right, we plot for (continuous line) and (dashed lines) for several . As conjectured, the top eigenvalues (low-frequency) are left approximately unchanged. In Figure 4, we plot a heatmap of the eigenvectors ordered vertically from highest associated eigenvalue (bottom) to lowest (top) for a fixed and increasing downsampling . First indeed check that the top eigenvectors correspond to low-frequency functions and the bottom eigenvectors correspond to high-frequency functions. Second, most eigenvectors are not much modified between and . For the case, , the top eigenvectors corresponds still low-frequency functions.
From these observations, we expect to have the same statistical properties as when learning low-frequency functions. In Figure 5, we plot the test error of kernel ridge regression for fitting cyclic -local polynomials (see Section A.7) on the hypercube of dimension . We report the test error of one realization, against the sample size , and choose regularization and noise . We compare kernels with and without downsampling. On the left, we consider and , and compare the test error with (continous line) and with (dashed line) when learning degree , and polynomials. On the right, we fix the target function to be the cubic local cyclic polynomial and consider the test error of learning with for , , and . As expected, we observe in both simulations that the test error is almost identical between the kernels with and without downsampling, when learning cyclic invariant functions.
In Section C.1, we further check that downsampling with does not improve the high-dimensional predictions for the test error of KRR.
A.5 Multilayer convolutional kernels
For completeness, we briefly discuss here some intuitions of multilayer convolutional kernels. The benefit of depth in convolutional kernels has been investigated in . In particular, observed that the top layer operation of a two-layers convolutional kernel can be replaced by a low-degree polynomial without a performance change.
As an example, we will consider a two layers convolutional kernel with patch and local average pooling sizes on the first layer and on the second layer. We consider a general inner-product kernel for the first layer:
Let us decompose this two-layers convolutional kernel in the Fourier basis. Let be the output of the first layer, with
Then denoting , the two-layers convolutional kernel is given by
We believe that techniques contained in this paper can be used to study kernels of the type (27) by a careful combinatorial argument and a 2-dimensional Fourier transform on the second layer (see ). We leave this problem to future work. Here we only comment on the structure of :
Including a second convolutional layer allows interactions between patches. The associated RKHS, which we will denote , contains all the homogeneous polynomials with with , contained on segments of size , with the two segments separated by at most . In words, the RKHS contains interaction between patches and that are within some distance.
The eigenvalue associated to a degree- homogeneous polynomials is still of order in high-dimension. To learn functions restricted to , it is statistically more efficient to use (smaller degeneracy of eigenvalues). However will fit a richer class of functions with two-patch interactions, while still not being plagued by dimensionality: . Hence we still expect to be much more statistically efficient than a standard inner-product kernel.
Local pooling on the two layers plays different roles: pooling on the first layer encourages the interactions to not depend strongly on the relative positions of the patches, while pooling on the second layer penalizes functions that depend on the global position of these interactions.
For more layers and higher degree kernels, one obtain hierarchical interactions of higher-order, with multi-scale absolute and relative local invariances brought by pooling layers.
A.6 Proofs diagonalization of convolutional kernels
In this section, we prove the diagonalization of the kernels , and introduced in Propositions 1, 2 and 4 respectively.
By the spectral theorem of compact operators, there exists an orthonormal basis of and eigenvalues , with nonincreasing values and , such that
We first prove the diagonalization of in Proposition 4. The case of and then follows by setting , and respectively.
Using Eq. (29) and that , we have the following decomposition of in the Fourier basis
where we recall the definition of the set of indices
which concludes the proof of Proposition 4. ∎
We can now prove Propositions 1 and 2 by taking and respectively.
Set in Proposition 4. We get
In this case, is simply equal to identity, which concludes the proof. ∎
where is the distance between and on the torus (i.e., if , ). Hence, is a circulant matrix independent of , which has well known explicit formula for eigenvalues and eigenvectors (see for example Remark 1). ∎
A.7 Additional numerical simulations
Here, we consider a numerical experiment similar to Figure 1. We consider with and consider three cyclic invariant target functions:
We consider a higher order polynomial kernel than in Figure 1, which should lead to higher self-induced regularization. We consider the same kernels as before, with and .
In Figure 6, we report the test errors of fitting (top), (middle) and (bottom) using kernel ridge regression with the kernels of interests in the main text. We choose a small regularization parameter , and the noise level . The curves are averaged over independent instances and the error bar stands for the standard deviation of these instances. The results again match with our overall theoretical predictions. We report the predicted thresholds for the three functions:
For target: for .
For target: for .
For target: for .
We see that the kernels, especially for , perform much better than their theoretical high-dimension predictions: this can be explained by the low-dimensionality of the experiment where .
Appendix B Generalization error of kernel methods in fixed dimension
We first consider the case of a Lipschitz bounded loss and uniform convergence, and make a few simple remarks on the connection between generalization error and eigendecomposition in kernel methods.
The generalization error of has the following standard bound on the Rademacher complexity of the kernel class : with probability ,
Note that instead of a constraint on the norm in Eq. (33), one might find more convenient to use a penalty. In that case, there exists an equivalent to the bound (34) , but we focus here on the constrained formulation for simplicity.
Consider as in Eq. (8) and assume . From the normalization choice of the kernel (see Eq. (22)), we have
Consider now for simplicity . From the eigendecomposition in Proposition 2, the RKHS norm of is given by
We make the following two remarks on this bound:
It depends on , which is a RKHS norm on instead of , which has potentially much lower dimension and contain less smooth function for balls of same radius.
There is a factor gain in sample complexity when learning functions that have -th frequency with . In particular, for (cyclic invariant functions), , and we need less samples to get the same (upper) bound on the generalization error. On the contrary, when , i.e., high-frequency oscillatory functions, the generalization bound becomes worse.
B.2 Generalization error of KRR in the classical regime
We consider here the regression setting which allows for finer results. Several works have considered bounding the generalization error of kernel ridge regression (KRR) , [47, Theorem 13.17]. In this section, we consider the following fully-explicit upper bound from .
which has the following analytical formula:
where is the empirical kernel matrix, and . The risk is taken to be the test error with squared error loss
[3, Theorem 7.2] Assume almost surely and let the regularization parameter . If , then
Let us comment on the upper-bound in Eq. (36). The first term corresponds to an upper bound on the variance: is sometimes called the degrees of freedom or the effective dimension of the kernel . The second term bounds the bias term and corresponds to an approximation error. In particular, for any ,
From the above discussion, it is natural to consider the following two assumptions on and , that are standard in the kernel literature:
Capacity condition: with .
Intuitively, the capacity condition (B1) characterizes the size of the RKHS: for increasing , the RKHS contains less and less functions. It is verified when the eigenvalues ’s of decay at the rate . For example, taking the Matern kernel of order , whose RKHS is the Sobolev space of order (i.e., functions with bounded -order derivatives), we have (e.g., see ). The source condition (B2) characterizes the regularity of the target function (the ‘source’) with respect to the kernel: is equivalent to , while corresponds to more smooth (and less smooth ).
Assuming (B1) and (B2) in Theorem 6, we get the bound
where in the second line, we balanced the two terms by taking . Note that in order to use Theorem 6, we need further to constrain . For simplicity, we will choose , so that this condition is verified for sufficiently large.
The rate in in Eq. (38) is minmax optimal over all functions that verify assumptions (A1) and (A2) . However, for large , the RKHS is composed of very smooth functions (e.g., Sobolev spaces of order are RKHS if and only if , i.e., if the order of the bounded derivatives grows with the dimension ) and will be small, such that for functions with bounded derivatives up to order . In that case, the risk decreases at the rate : KRR suffers from the curse of dimensionality when does not scale with . As a consequence, the bound (38) is vacuous when does not scale exponentially in , which led several groups to derive finer bounds on KRR in the high dimensional regime (see Section C).
Let us now apply Theorem 6 and Eq. (38) to our convolutional kernels to show Theorems 1 and 4.
First notice that and we can therefore apply Theorem 6. The effective dimension of is bounded by
Injecting the two above bounds in Eq. (38), we deduce that there exists constants that only depends on the constants in (A1) and (A2), and (but independent of ), such that taking and , we get
The proof is similar to the proof of Theorem 1. Notice that , and that the effective dimension of is bounded by
where we used condition (A1). Denoting , the rest of the proof follows from the proof of Theorem 1 with replaced by and replaced by . ∎
Appendix C Generalization error of KRR in high dimension
In Section B.2, we considered upper bounds on the test error of KRR using the standard capacity and source conditions. However, these results suffer from several limitations:
They only provide an upper bound on the test error. While the decay rate with respect to is minmax optimal (see ), this is not strong enough to show, for example, a statistical advantage of using local average pooling, which appears as a prefactor , and which would require a lower bound matching the upper bound within a constant factor.
As mentioned in Remark 2, the bound is of order , except when the target function has smoothness order increasing with . This bound is non-vacuous only if which is impractical in modern image datasets where typically . This motivates a new type of question: given , what is the prediction error achieved by KRR for a given function?
In order to achieve the bound Eq. (38), one need to carefully balance the bias and the variance terms by setting the regularization parameter. This is in contrast with modern practice which usually train until interpolation (which corresponds to setting ).
Given the above limitations, several recent works have instead considered a high-dimensional setting where the number of samples scales with , and derived asymptotic test errors, exact up to a vanishing additive error . In addition to these works, several papers have derived general estimates for the test error using non-rigorous methods that are believe to be correct in the high dimensional limit and which show great agreement with numerical experiments. The picture that emerges in this regime is much more precise than in the classical regime: KRR approximately acts as a shrinkage operator on the target function (not assumed to be in a particular space anymore), with shrinkage parameter that scales as a self-induced regularization parameter over the number of samples.
for some . Then, assuming some additional conditions insuring that the kernel is ‘spread-out’ and well behaved, the KRR solution
is equal up to a vanishing additive -error (as ) to the following effective ridge regression estimator
The solution of Eq. (40) admits an explicit solution in terms of a shrinkage operator in the basis of eigenfunctions of :
Hence, KRR will fit better the target function along eigendirections associated to larger eigenvalues of . If , KRR fits perfectly along the eigendirection , while if , KRR does not fit this eigendirection at all. This phenomena has been referred as the spectral bias and task-kernel alignment of kernel ridge regression in several works.
Finally, notice from Eq. (41) that the minimum test error is achieved for the regularization parameter , which corresponds to the KRR estimator fitting perfectly the training data. In other words, the interpolating solution is optimal for kernel ridge regression in high dimension.
we first consider a vanilla one-layer convolutional kernel as defined in Eq. (3). We will assume that the kernels verify the following ‘genericity’ condition.
Assumption 1 will be verified by standard kernels, e.g., the Gaussian kernel. We discuss this assumption in Section C.2 and present sufficient conditions on the activation function for its associated CNTK to verify Assumption 1.
for any . The following result is a consequence of the general theorem on the generalization error of KRR in .
Let be a sequence of local functions. Let and with . Assume for some and let be a sequence of activation functions satisfying Assumption 1 at level . Consider the sequence of convolutional kernels associated to as defined in Eq. (3). Then the following holds for the solution of KRR with kernels .
For any regularization parameter , define the effective regularization . Then for any , we have
The proof of Theorem 7 is deferred to Section C.4.
Let us expound on the predictions of Theorem 7. First, recall that is given explicitly in Eq. (41) by a shrinkage operator with parameter . From Assumption 1 and taking , the shrinkage operator is of order
KRR fits the eigendirections corresponding to the homogeneous polynomials of degree and less, and of degree for subsets such that .
KRR does not fit at all the eigendirections correpsonding to homogeneous polynomials of degree and larger, and degree for subsets such that .
In words, for , KRR fits at least a degree- polynomial approximation to and at most a degree- polynomial approximation. As increases from to , KRR first fits degree- homogeneous polynomials that have smaller diameter (i.e., ‘more localized’).
Test error of CK with global average pooling:
we consider the kernel given by a convolutional layer followed by global average pooling:
In addition to the genericity condition, we will assume that the kernels verify the following differentiability condition.
where we denoted the truncated inner-product kernel as in Eq. (45).
Assumption 2 is used to extend the following theorem to non-polynomial kernel (in particular, it is trivially verified for polynomial kernels by taking larger than the degree of ). This assumption is difficult to check in practice, however we provide some examples where it holds in Appendix C.2.
Let be a sequence of convolutional functions. Assume for some and let be a sequence of activation functions satisfying Assumptions 1 and 2 at level . Consider the sequence of convolutional kernels with global pooling associated to as defined in Eq. (47). Then the solution of KRR with kernels verifies Eq. (46) with .
The proof of Theorem 8 is deferred to Section C.5.
The predictions of Theorem 8 are similar to the ones of Theorem 7 but with a factor gain in statistical efficiency: this is due to the eigenvalues of being a factor larger than for . Therefore, with global average pooling, for , KRR fits at least a degree- invariant polynomial approximation to and at most a degree- invariant polynomial approximation. As increases from to , KRR first degree- invariant homogeneous polynomials with increasing diameter .
Test error of CK with local average pooling:
Assume and is a divisor of . Denote the -th segment of length in and the patch of size with cyclic convention in . Consider the following convolutional kernel with ‘non-overlapping’ average pooling:
In words, is the combination of non-overlapping convolutional kernels with global average pooling on images of size :
where where is the translated set with cyclic convention in .
Denote the RKHS associated to , which contains functions that are locally convolutions on segments of size . For this simplified model, the proof of Theorem 8 can be easily adapted and we obtain the following result:
Let be a sequence of local convolutional functions. Assume for some and let be a sequence of activation functions satisfying Assumptions 1 and 2 at level . Consider the sequence of convolutional kernels with non-overlapping pooling associated to as defined in Eq. (48). Then the solution of KRR with kernels verifies Eq. (46) with .
Corollary 1 shows that enjoys a factor gain in statistical efficiency compared to , due to a factor smaller effective ridge regularization. Therefore, with (non-overlapping) local average pooling, for , KRR fits degree- locally invariant polynomials and none of the polynomials of degree- and larger. Heuristically, we see that this yields the same statistical efficiency than for and for , and interpolates between the two cases for .
Test error of convolutional kernels with downsampling:
We consider adding a downsampling operation to the previous kernels. Let be a constant and a divisor of and and consider the following ‘downsampled’ kernels:
We can easily adapt the proofs of Theorems 7 and 8, and Corollary 1 to these kernels. In particular, their conclusions do not change (for any constant ) and downsampling do not provide a statistical advantage.
C.2 Checking the assumptions
In this section, we discuss Assumptions 1 and 2 and present sufficient conditions for them to be verified.
The genericity assumption amounts to: 1) A universality condition in Eqs. (42) and (43): if , then does not learn degree- homogeneous polynomials; 2) A constant order scaling of the self-induced regularization , from and Eq. (43) with , i.e., and ; 3) The last eigenvalues decay sufficiently fast in Eq. (44) in order to avoid pathological cases.
The function is differentiable and there exists and independent of , such that .
where is arbitrary.
Differentiability assumption:
C.3 Proof of Proposition 6
Let us decompose both functions and in the Gegenbauer polynomial on the hypercube basis:
From the definition of in Eq. (54) and the eigendecomposition (60), we have
Similarly, from the definition of in Eq. (55), the eigendecomposition (61) and using Lemma 1 stated below, we get
such that the NT kernel (53) can be written as the kernel of the effective activation :
Recall that the sequence satisfies Assumption 3 at level . From Assumption 3. (for example by adapting the proof of Lemma C.1 in to the hypercube), there exists such that
Furthermore, by Assumption 3., using that and , we get
In particular, this implies that . ∎
where we recall the definition of the homogeneous polynomial . We have
with the convention .
C.4 Proof of Theorem 7
Let be a sequence of integers with for some . We will denote for simplicity. Consider , for some and a sequence of inner-product kernels that satisfies Assumption 1 at level . We consider the vanilla one-layer convolutional kernel
Theorem 7 is a consequence of Theorem 4 in where we take , and . The proof amounts to checking that verifies the kernel concentration properties and eigenvalue condition (see Section 3.2 in ). We borrow some of the notations introduced in and we refer the reader to their Section 2.1.
Step 1. Diagonalization of the kernel and choosing .
From Proposition 1, we have the following diagonalization of :
Step 2. Diagonal elements of the truncated kernel.
Define the truncated kernel to be
The diagonal elements of the truncated kernel are given by: for any ,
Hence using that , we have
Let be chosen as in Assumption 1, i.e., such that . We have
Step 4. Checking the kernel concentration property at level .
Let us check the kernel concentration property at level with the sequence of integers defined in the previous step (Assumption 4 in ):
(Hypercontractivity of finite eigenspaces) The subspace spanned by the top eigenvectors is contained in the subspace of polynomials of degree less or equal to on the hypercube. The hypercontractivity of this subspace is a consequence of a classical result due to Beckner, Bonami and Gross (see Lemma 4 in Section D).
(Properly decaying eigenvalues.) From step 3 and recalling that where verifies , we have
for sufficiently small. Similarly,
for chosen sufficiently small.
(Concentration of the diagonal elements of the kernel) From Eqs. (66) and (67), the diagonal elements of the kernel are constant and the assumption is automatically verified.
Step 5. Checking the eigenvalue condition at level .
Let us now check the eigenvalue condition at level which corresponds to Assumption 5 in ):
for sufficiently small. Similarly,
This is a direct consequence of Eq. (65).
We can therefore apply Theorem 4 in , which concludes the proof. ∎
C.5 Proof of Theorem 8
Consider for some and a sequence of inner-product kernels that satisfies Assumptions 1 and 2 at level . We consider the one-layer convolutional kernel with global average pooling
Again, the proof of Theorem 8 will amount to checking that the conditions of Theorem 4 in hold.
Step 1. Diagonalization of the kernel and choosing .
From Proposition 2 with , we have the following diagonalization of :
Step 2. Diagonal elements of the truncated kernel.
Define the truncated kernel to be
The diagonal elements of the truncated kernel are given by: for any ,
Step 4. Checking the kernel concentration property at level .
The kernel concentration property at level hold with the sequence as defined in step 3. The hypercontractivity of finite eigenspaces and the properly decaying eigenvalues are obtained as in step 4 of the proof of Theorem 7, while the concentration of the diagonal elements of the kernel is given by Eq. (71).
Step 5. Checking the eigenvalue condition at level .
This is obtained similarly as in step 5 of the proof of Theorem 7.
C.6 Auxiliary results
where is the inner-product kernel where the first Gegenbauer coefficients are set to .
Then for for some fixed , letting , we have
Following the same proof as Proposition 8 in , notice that for the integer in Assumption 2, by Lemma 2 stated below, we have
By Assumption 2, there exists such that for any ,
and for . Moreover, by Hanson-Wright inequality as in Lemma 3, using (at most polynomial in ) and a union bound, we have for any ,
Therefore, injecting these bounds in Eq. (74), we get
which concludes the proof of the first bound.
Then, by Lemma 2, we get for any ,
We conclude following the same argument as in the proof of Proposition 9 in . ∎
Let for some fixed . Then, for , we have
Let us bound the right hand side. We have
where , , and , and we denoted
Notice that if (the symmetric difference) and otherwise. In other words, every elements in appears exactly in 2 or 4 of these sets.
where we used that .
Using Markov’s inequality and taking sufficiently small yield Eq. (77).
Further notice that following the same computation as in Eq. (69), we get
where we recall that .
Taking the union bound over concludes the proof. ∎
Appendix D Technical background of function spaces on the hypercube
Fourier analysis on the hypercube is a well studied subject . The purpose of this section is to introduce some notations and objects that are useful in the statement and proofs in the main text.
It is easy to verify that (notice that if is odd and if is even)
D.2 Hypercubic Gegenbauer
Notice that the right hand side only depends on and therefore these polynomials are well defined. In particular,
Furthermore, Eq. (86) imply that —up to a constant— is a representation of the projector onto the subspace of degree- polynomials
By permutation invariance, the space of homogeneous polynomials of degree is an eigenspace of , and we will denote the corresponding eigenvalue by . In other words . The eigenvalues can be computed via
D.3 Hermite polynomials
Here and below, for a polynomial, is the vector of the coefficients of . As a consequence, for any fixed integer , we have
where and are given in Eq. (92) and (88).
D.4 Hypercontractivity of uniform distributions on the hypercube
By Holder’s inequality, we have for any and any . The reverse inequality does not hold in general, even up to a constant. However, for some measures, the reverse inequality will hold for some sufficiently nice functions. These measures satisfy the celebrated hypercontractivity properties .