Year: 2019

Abstract:
We study the training process of Deep Neural Networks (DNNs) from the Fourier analysis perspective. We demonstrate a very universal Frequency Principle (FPrinciple) — DNNs often fit target functions from low to high frequencies — on high-dimensional benchmark datasets such as MNIST/CIFAR10 and deep neural networks such as VGG16. This F-Principle of DNNs is opposite to the behavior of most conventional iterative numerical schemes (e.g., Jacobi method), which exhibit faster convergence for higher frequencies for various scientific computing problems. With theories under an idealized setting, we illustrate that this F-Principle results from the smoothness/regularity of the commonly used activation functions. The F-Principle implies an implicit bias that DNNs tend to fit training data by a low-frequency function. This understanding provides an explanation of good generalization of DNNs on most real datasets and bad generalization of DNNs on parity function or a randomized dataset.

heading: 1 INTRODUCTION
text: Understanding the training process of Deep Neural Networks (DNNs) is a fundamental problem in the area of deep learning. We find a common behavior of the gradient-based training process of DNNs, that is, a Frequency Principle (F-Principle):
DNNs often fit target functions from low to high frequencies during the training process.
In another word, at the early stage of training, the low-frequencies are fitted and as iteration steps of training increase, the high-frequencies are fitted. For example, when a DNN is trained to fit y = sin(x) + sin(2x), its output would be close to sin(x) at early stage and as training goes on, its output would be close to sin(x) + sin(2x). F-Principle was observed empirically in synthetic low-dimensional data with MSE loss during DNN training (Xu et al., 2018; Rahaman et al., 2018). However, in deep learning, empirical phenomena could vary from one network structure to another, from one dataset to another and could exhibit significant difference between synthetic data and highdimensional real data. Therefore, the universality of the F-Principle remains an important problem for further study. Especially for high-dimensional real problems, because the computational cost of high-dimensional Fourier transform is prohibitive in practice, it is of great challenge to demonstrate the F-Principle. On the other hand, the mechanism underlying the F-Principle and its implication to the application of DNNs, e.g., design of DNN-based PDE solver, as well as their generalization ability are also important open problems to be addressed.
In this work, we design two methods, i.e., projection and filtering methods, to show that the FPrinciple exists in the training process of DNNs for high-dimensional benchmarks, i.e., MNIST (LeCun, 1998), CIFAR10 (Krizhevsky et al., 2010). The settings we have considered are i) different DNN architectures, e.g., fully-connected network, convolutional neural network (CNN), and VGG16 (Simonyan & Zisserman, 2014); ii) different activation functions, e.g., tanh and rectified linear unit (ReLU); iii) different loss functions, e.g., cross entropy, mean squared error (MSE), and loss energy functional in variational problems. These results demonstrate the universality of the F-Principle.
To facilitate the designs and applications of DNN-based schemes, we characterize a stark difference between DNNs and conventional numerical schemes on various scientific computing problems, where most of the conventional methods (e.g., Jacobi method) exhibit the opposite convergence behavior
— faster convergence for higher frequencies. This difference implies that DNN can be adopted to accelerate the convergence of low frequencies for computational problems.
We also intuitively explain with theories under an idealized setting how the smoothness/regularity of commonly used activation functions contributes to the F-Principle. Note that this mechanism is rigorously demonstrated for DNNs of general settings in a subsequent work (Luo et al., 2019). Finally, we discuss that the F-Principle provides an understanding of good generalization of DNNs in many real datasets (Zhang et al., 2016) and poor generalization in learning the parity function (Shalev-Shwartz et al., 2017; Nye & Saxe, 2018), that is, the F-Principle which implies that DNNs prefer low frequencies, is consistent with the property of low frequencies dominance in many real datasets, e.g., MNIST/CIFAR10, but is different from the parity function whose spectrum concentrates on high frequencies. Compared with previous studies, our main contributions are as follows:
1. By designing both the projection and filtering methods, we consistently demonstrate the F-Principle for MNIST/CIFAR10 over various architectures such as VGG16 and various loss functions.
2. For the application of solving differential equations, we show that (i) conventional numerical schemes learn higher frequencies faster whereas DNNs learn lower frequencies faster by the FPrinciple, (ii) convergence of low frequencies can be greatly accelerated with DNN-based schemes.
3. We present theories under an idealized setting to illustrate how smoothness/regularity of activation function contributes to the F-Principle.
4. We discuss in detail the implication of the F-Principle to the generalization of DNNs that DNNs are implicitly biased towards a low frequency function and provide an explanation of good and poor generalization of DNNs for low and high frequency dominant target functions, respectively.

heading: 2 FREQUENCY PRINCIPLE
text: The concept of “frequency” is central to the understanding of F-Principle. In this paper, the “frequency” means response frequency NOT image (or input) frequency as explained in the following.
Image (or input) frequency (NOT used in the paper): Frequency of 2-d function I : R2 → R representing the intensity of an image over pixels at different locations. This frequency corresponds to the rate of change of intensity across neighbouring pixels. For example, an image of constant intensity possesses only the zero frequency, i.e., the lowest frequency, while a sharp edge contributes to high frequencies of the image.
Response frequency (used in the paper): Frequency of a general Input-Output mapping f . For example, consider a simplified classification problem of partial MNIST data using only the data with label 0 and 1, f(x1, x2, · · · , x784) : R784 → {0, 1}mapping 784-d space of pixel values to 1-d space, where xj is the intensity of the j-th pixel. Denote the mapping’s Fourier transform as f̂(k1, k2, · · · , k784). The frequency in the coordinate kj measures the rate of change of f(x1, x2, · · · , x784) with respect to xj , i.e., the intensity of the j-th pixel. If f possesses significant high frequencies for large kj , then a small change of xj in the image might induce a large change of the output (e.g., adversarial example). For a dataset with multiple classes, we can similarly define frequency for each output dimension. For real data, the response frequency is rigorously defined via the standard nonuniform discrete Fourier transform (NUDFT), see Appendix A.
Frequency Principle: DNNs often fit target functions from low to high (response) frequencies during the training process. An illustration of F-Principle using a function of 1-d input is in Appendix B. The F-Principle is rigorously defined through the frequency defined by the Fourier transform (Appendix A, Bracewell & Bracewell (1986)) and the converging speed defined by the relative error. By using high-dimensional real datasets, we then experimentally demonstrate F-Principle at the levels of both individual frequencies (projection method) and coarse-grained frequencies (filtering method).

heading: 3 F-PRINCIPLE IN MNIST/CIFAR10 THROUGH PROJECTION METHOD
text: Real datasets are very different from synthetic data used in previous studies. In order to utilize the F-Principle to understand and better use DNNs in real datasets, it is important to verify whether the F-Principle also holds in high-dimensional real datasets.
In the following experiments, we examine the F-Principle in a training dataset of {(xi,yi)}n−1i=0 where n is the size of dataset. xi ∈ Rd is a vector representing the image and yi ∈ {0, 1}10 is the output (a one-hot vector indicating the label for the dataset of image classification). d is the dimension of the input (d = 784 for MNIST and d = 32× 32× 3 for CIFAR10). Since the high dimensional discrete Fourier transform (DFT) requires prohibitively high computational cost, in this section, we only consider one direction in the Fourier space through a projection method for each examination.

heading: 3.1 EXAMINATION METHOD: PROJECTION
text: For a dataset {(xi,yi)}n−1i=0 we consider one entry of 10-d output, denoted by yi ∈ R. The high dimensional discrete non-uniform Fourier transform of {(xi, yi)}n−1i=0 is ŷk = 1n ∑n−1 i=0 yi exp (−i2πk · xi). The number of all possible k grows exponentially on dimension d. For illustration, in each examination, we consider a direction of k in the Fourier space, i.e., k = kp1, p1 is a chosen and fixed unit vector, hence |k| = k. Then we have ŷk = 1n ∑n−1 i=0 yi exp (−i2π(p1 · xj)k), which is essentially the 1-d Fourier transform of {(xp1,i, yi)}n−1i=0 , where xp1,i = p1 · xi is the projection of xi on the direction p1 (Bracewell & Bracewell, 1986). For each training dataset, p1 is chosen as the first principle component of the input space. To examine the convergence behavior of different frequency components during the training, we compute the relative difference between the DNN output and the target function for selected important frequencies k’s at each recording step, that is, ∆F (k) = |ĥk− ŷk|/|ŷk|, where ŷk and ĥk are 1-d Fourier transforms of {yi}n−1i=0 and the corresponding DNN output{hi}n−1i=0 , respectively, along p1. Note that each response frequency component, ĥk, of DNN output evolves as the training goes.

heading: 3.2 MNIST/CIFAR10
text: In the following, we show empirically that the F-Principle is exhibited in the selected direction during the training process of DNNs when applied to MNIST/CIFAR10 with cross-entropy loss. The network for MNIST is a fully-connected tanh DNN (784-400-200-10) and for CIFAR10 is two ReLU convolutional layers followed by a fully-connected DNN (800-400-400-400-10). All experimental details of this paper can be found in Appendix C. We consider one of the 10-d outputs in each case using non-uniform Fourier transform. As shown in Fig. 1(a) and 1(c), low frequencies dominate in both real datasets. During the training, the evolution of relative errors of certain selected frequencies (marked by black squares in Fig. 1(a) and 1(c)) is shown in Fig. 1(b) and 1(d). One can easily observe that DNNs capture low frequencies first and gradually capture higher frequencies. Clearly, this behavior is consistent with the F-Principle. For other components of the output vector and other directions of p, similar phenomena are also observed.

heading: 4 F-PRINCIPLE IN MNIST/CIFAR10 THROUGH FILTERING METHOD
text: The projection method in the previous section enables us to visualize the F-Principle in one direction for each examination at the level of individual frequency components. However, demonstration by this method alone is insufficient because it is impossible to verify the F-Principle at all potentially informative directions for high-dimensional data. To compensate the projection method, in this
section, we consider a coarse-grained filtering method which is able to unravel whether, in the radially averaged sense, low frequencies converge faster than high frequencies.

heading: 4.1 EXAMINATION METHOD: FILTERING
text: The idea of the filtering method is as follows. We split the frequency domain into two parts, i.e., a low-frequency part with |k| ≤ k0 and a high-frequency part with |k| > k0, where | · | is the length of a vector. The DNN is trained as usual by the original dataset {(xi,yi)}n−1i=0 , such as MNIST or CIFAR10. The DNN output is denoted as h. During the training, we can examine the convergence of relative errors of low- and high- frequency part, using the two measures below
elow =
(∑ k 1|k|≤k0 |ŷ(k)− ĥ(k)|2∑
k 1|k|≤k0 |ŷ(k)|2
) 1 2
, ehigh =
(∑ k(1− 1|k|≤k0)|ŷ(k)− ĥ(k)|2∑
k(1− 1|k|≤k0)|ŷ(k)|2
) 1 2
,
respectively, where ·̂ indicates Fourier transform, 1k≤k0 is an indicator function, i.e.,
1|k|≤k0 = { 1, |k| ≤ k0, 0, |k| > k0.
If we consistently observe elow < ehigh for different k0’s during the training, then in a mean sense, lower frequencies are first captured by the DNN, i.e., F-Principle.
However, because it is almost impossible to compute above quantities numerically due to high computational cost of high-dimensional Fourier transform, we alternatively use the Fourier transform of a Gaussian function Ĝδ(k), where δ is the variance of the Gaussian function G, to approximate 1|k|>k0 . This is reasonable due to the following two reasons. First, the Fourier transform of a Gaussian is still a Gaussian, i.e., Ĝδ(k) decays exponentially as |k| increases, therefore, it can approximate 1|k|≤k0 by Ĝ
δ(k) with a proper δ(k0) (referred to as δ for simplicity). Second, the computation of elow and ehigh contains the multiplication of Fourier transforms in the frequency domain, which is equivalent to the Fourier transform of a convolution in the spatial domain. We can equivalently perform the examination in the spatial domain so as to avoid the almost impossible high-dimensional Fourier transform. The low frequency part can be derived by
ylow,δi , (y ∗G δ)i, (1)
where ∗ indicates convolution operator, and the high frequency part can be derived by yhigh,δi , yi − y low,δ i . (2) Then, we can examine
elow =
(∑ i |y low,δ i − h
low,δ i |2∑
i |y low,δ i |2
) 1 2
, ehigh =
(∑ i |y high,δ i − h
high,δ i |2∑
i |y high,δ i |2
) 1 2
, (3)
where hlow,δ and hhigh,δ are obtained from the DNN output h, which evolves as a function of training epoch, through the same decomposition. If elow < ehigh for different δ’s during the training, F-Principle holds; otherwise, it is falsified. Next, we introduce the experimental procedure.
Step One: Training. Train the DNN by the original dataset {(xi,yi)}n−1i=0 , such as MNIST or CIFAR10. xi is an image vector, yi is a one-hot vector.
Step Two: Filtering. The low frequency part can be derived by
ylow,δi = 1
Ci n−1∑ j=0 yjG δ(xi − xj), (4)
where Ci = ∑n−1 j=0 G
δ(xi − xj) is a normalization factor and Gδ(xi − xj) = exp ( −|xi − xj |2/(2δ) ) . (5)
The high frequency part can be derived by yhigh,δi , yi − y low,δ i . We also compute h low,δ i and hhigh,δi for each DNN output hi.
Step Three: Examination. To quantify the convergence of hlow,δ and hhigh,δ, we compute the relative error elow and ehigh at each training epoch through Eq. (3).

heading: 4.2 DNNS WITH VARIOUS SETTINGS
text: With the filtering method, we show the F-Principle in the DNN training process of real datasets for commonly used large networks. For MNIST, we use a fully-connected tanh-DNN (no softmax) with MSE loss; for CIFAR10, we use cross-entropy loss and two structures, one is small ReLU-CNN network, i.e., two convolutional layers, followed by a fully-connected multi-layer neural network with a softmax; the other is VGG16 (Simonyan & Zisserman, 2014) equipped with a 1024 fully-connected layer. These three structures are denoted as “DNN”, “CNN” and “VGG” in Fig. 2, respectively. All are trained by SGD from scratch. More details are in Appendix C.
We scan a large range of δ for both datasets. As an example, results of each dataset for several δ’s are shown in Fig. 2, respectively. Red color indicates small relative error. In all cases, the relative error of the low-frequency part, i.e., elow, decreases (turns red) much faster than that of the high-frequency part, i.e., ehigh. Therefore, as analyzed above, the low-frequency part converges faster than the high-frequency part. We also remark that, based on the above results on cross-entropy loss, the F-Principle is not limited to MSE loss, which possesses a natural Fourier domain interpretation by the Parseval’s theorem. Note that the above results holds for both SGD and GD.

heading: 5 F-PRINCIPLE IN SOLVING DIFFERENTIAL EQUATION
text: Recently, DNN-based approaches have been actively explored for a variety of scientific computing problems, e.g., solving high-dimensional partial differential equations (E et al., 2017; Khoo et al., 2017; He et al., 2018; Fan et al., 2018) and molecular dynamics (MD) simulations (Han et al., 2017). However, the behaviors of DNNs applied to these problems are not well-understood. To facilitate the designs and applications of DNN-based schemes, it is important to characterize the difference between DNNs and conventional numerical schemes on various scientific computing problems. In this section, focusing on solving Poisson’s equation, which has broad applications in mechanical engineering and theoretical physics (Evans, 2010), we highlight a stark difference between a DNN-based solver and the Jacobi method during the training/iteration, which can be explained by the F-Principle.
Consider a 1-d Poisson’s equation:
−∆u(x) = g(x), x ∈ Ω , (−1, 1), (6) u(−1) = u(1) = 0. (7)
We consider the example with g(x) = sin(x)+4 sin(4x)−8 sin(8x)+16 sin(24x) which has analytic solution uref(x) = g0(x) + c1x+ c0, where g0 = sin(x) + sin(4x)/4− sin(8x)/8 + sin(24x)/36, c1 = (g0(−1)−g0(1))/2 and c0 = −(g0(−1)+g0(1))/2. 1001 training samples {xi}ni=0 are evenly spaced with grid size δx in [0, 1]. Here, we use the DNN output, h(x; θ), to fit uref(x) (Fig. 3(a)). A
DNN-based scheme is proposed by considering the following empirical loss function (E & Yu, 2018),
Iemp = n−1∑ i=1 ( 1 2 |∇xh(xi)|2 − g(xi)h(xi) ) δx+ β ( h(x0) 2 + h(xn) 2 ) . (8)
The second term in Iemp(h) is a penalty, with constant β, arising from the Dirichlet boundary condition (7). After training, the DNN output well matches the analytical solution uref . Focusing on the convergence of three peaks (inset of Fig. 3(a)) in the Fourier transform of uref , as shown in Fig. 3(b), low frequencies converge faster than high frequencies as predicted by the F-Principle. For comparison, we also use the Jacobi method to solve problem (6). High frequencies converge faster in the Jacobi method (Details can be found in Appendix D), as shown in Fig. 3(c).
As a demonstration, we further propose that DNN can be combined with conventional numerical schemes to accelerate the convergence of low frequencies for computational problems. First, we solve the Poisson’s equation in Eq. (6) by DNN with M optimization steps (or epochs), which needs to be chosen carefully, to get a good initial guess in the sense that this solution has already learned the low frequencies (large eigenvalues) part. Then, we use the Jacobi method with the new initial data for the further iterations. We use ‖h− uref‖∞ , maxx∈Ω |h(x)− uref(x)| to quantify the learning result. As shown by green stars in Fig. 3(d), ‖h− uref‖∞ fluctuates after some running time using DNN only. Dashed lines indicate the evolution of the Jacobi method with initial data set to the DNN output at the corresponding steps. If M is too small (stop too early) (left dashed line), which is equivalent to only using Jacobi, it would take long time to converge to a small error, because low frequencies converges slowly, yet. If M is too big (stop too late) (right dashed line), which is equivalent to using DNN only, much time would be wasted for the slow convergence of high frequencies. A proper choice of M is indicated by the initial point of orange dashed line, in which low frequencies are quickly captured by the DNN, followed by fast convergence in high frequencies of the Jacobi method.
This example illustrates a cautionary tale that, although DNNs has clear advantage, using DNNs alone may not be the best option because of its limitation of slow convergence at high frequencies. Taking advantage of both DNNs and conventional methods to design faster schemes could be a promising direction in scientific computing problems.

heading: 6 A PRELIMINARY THEORETICAL UNDERSTANDING
text: A subsequent theoretical work (Luo et al., 2019) provides a rigorous mathematical study of the FPrinciple at different frequencies for general DNNs (e.g., multiple hidden layers, different activation functions, high-dimensional inputs). The key insight is that the regularity of DNN converts into the decay rate of a loss function in the frequency domain. For an intuitive understanding of this key insight, we present theories under an idealized setting, which connect the smoothness/regularity of the activation function with different gradient and convergence priorities in frequency domain.
The activation function we consider is σ(x) = tanh(x), which is smooth in spatial domain and its derivative decays exponentially with respect to frequency in the Fourier domain. For a DNN of one
hidden layer withm nodes, 1-d input x and 1-d output: h(x) = ∑m j=1 ajσ(wjx+bj), aj , wj , bj ∈ R. We also use the notation θ = {θlj} with θ1j = aj , θ2j = wj , and θ3j = bj , j = 1, · · · ,m. The
loss at frequency k is L(k) = 12 ∣∣∣ĥ(k)− f̂(k)∣∣∣2, ·̂ is the Fourier transform, f is the target function.
The total loss function is defined as: L = ∫ +∞ −∞ L(k) dk. Note that according to Parseval’s theorem, this loss function in the Fourier domain is equal to the commonly used MSE loss. We have the following theorems (The proofs are at Appendix E.). Define W = (w1, w2, · · · , wm)T ∈ Rm. Theorem 1. Considering a DNN of one hidden layer with activation function σ(x) = tanh(x), for any frequencies k1 and k2 such that |f̂(k1)| > 0, |f̂(k2)| > 0, and |k2| > |k1| > 0, there exist positive constants c and C such that for sufficiently small δ, we have
µ ({ W : ∣∣∣∂L(k1)∂θlj ∣∣∣ > ∣∣∣∂L(k2)∂θlj ∣∣∣ for all l, j} ∩Bδ) µ(Bδ) ≥ 1− C exp(−c/δ),
where Bδ ⊂ Rm is a ball with radius δ centered at the origin and µ(·) is the Lebesgue measure.
Theorem 1 indicates that for any two non-converged frequencies, with small weights, the lowerfrequency gradient exponentially dominates over the higher-frequency ones. Due to Parseval’s theorem, the MSE loss in the spatial domain is equivalent to the L2 loss in the Fourier domain. To intuitively understand the higher decay rate of a lower-frequency loss function, we consider the training in the Fourier domain with loss function of only two non-zero frequencies.
Theorem 2. Considering a DNN of one hidden layer with activation function σ(x) = tanh(x). Suppose the target function has only two non-zero frequencies k1 and k2, that is, |f̂(k1)| > 0, |f̂(k2)| > 0, |k2| > |k1| > 0, and |f̂(k)| = 0 for k 6= k1, k2. Consider the loss function of L = L(k1) + L(k2) with gradient descent training. Denote
S = { ∂L(k1)
∂t ≤ 0, ∂L(k1) ∂t ≤ ∂L(k2) ∂t
} ,
that is, L(k1) decreases faster than L(k2). There exist positive constants c and C such that for sufficiently small δ, we have
µ ({W : S holds} ∩Bδ) µ(Bδ) ≥ 1− C exp(−c/δ),
where Bδ ⊂ Rm is a ball with radius δ centered at the origin and µ(·) is the Lebesgue measure.

heading: 7 DISCUSSIONS
text: DNNs often generalize well for real problems (Zhang et al., 2016) but poorly for problems like fitting a parity function (Shalev-Shwartz et al., 2017; Nye & Saxe, 2018) despite excellent training accuracy for all problems. Understanding the differences between above two types of problems, i.e., good and bad generalization performance of DNN, is critical. In the following, we show a qualitative difference between these two types of problems through Fourier analysis and use the F-Principle to provide an explanation different generalization performances of DNNs.
For MNIST/CIFAR10, we examine ŷtotal,k = 1ntotal ∑ntotal−1 i=0 yi exp (−i2πk · xi), where {(xi, yi)}ntotal−1i=0 consists of both the training and test datasets with certain selected output component, at different directions of k in the Fourier space. We find that ŷtotal,k concentrates on the low frequencies along those examined directions. For illustration, ŷtotal,k’s along the first principle component are shown by green lines in Fig. 4(a, b) for MNIST/CIFAR10, respectively. When only the training dataset is used, ŷtrain,k well overlaps with ŷtotal,k at the dominant low frequencies.
For the parity function f(x) = ∏d j=1 xj defined on Ω = {−1, 1}d, its Fourier transform is f̂(k) =
1 2d ∑ x∈Ω ∏d j=1 xje −i2πk·x = (−i)d ∏d j=1 sin 2πkj . Clearly, for k ∈ [− 1 4 , 1 4 ] d, the power of the parity function concentrates at k ∈ {− 14 , 1 4} d and vanishes as k→ 0, as illustrated in Fig. 4(c) for the direction of 1d. Given a randomly sampled training dataset S ⊂ Ω with s points, the nonuniform
Fourier transform on S is computed as f̂S(k) = 1s ∑ x∈S ∏d j=1 xje
−i2πk·x. As shown in Fig. 4(c), f̂(k) and f̂S(k) significantly differ at low frequencies.
By experiments, the generalization ability of DNNs can be well reflected by the Fourier analysis. For the MNIST/CIFAR10, we observed the Fourier transform of the output of a well-trained DNN on {xi}ntotal−1i=0 faithfully recovers the dominant low frequencies, as illustrated in Fig. 4(a) and 4(b), respectively, indicating a good generalization performance as observed in experiments. However, for the parity function, we observed that the Fourier transform of the output of a well-trained DNN on {xi}i∈S significantly deviates from f̂(k) at almost all frequencies, as illustrated in Fig. 4(c), indicating a bad generalization performance as observed in experiments.
The F-Principle implicates that among all the functions that can fit the training data, a DNN is implicitly biased during the training towards a function with more power at low frequencies. If the target function has significant high-frequency components, insufficient training samples will lead to artificial low frequencies in training dataset (see red line in Fig. 4(c)), which is the wellknown aliasing effect. Based on the F-Principle, as demonstrated in Fig. 4(c), these artificial low frequency components will be first captured to explain the training samples, whereas the high frequency components will be compromised by DNN. For MNIST/CIFAR10, since the power of high frequencies is much smaller than that of low frequencies, artificial low frequencies caused by aliasing can be neglected. To conclude, the distribution of power in Fourier domain of above two types of problems exhibits significant differences, which result in different generalization performances of DNNs according to the F-Principle.

heading: 8 RELATED WORK
text: There are different approaches attempting to explain why DNNs often generalize well. For example, generalization error is related to various complexity measures (Bartlett et al., 1999; Neyshabur et al., 2017; E et al., 2018), local properties (sharpness/flatness) of loss functions at minima (Keskar et al., 2016; Wu et al., 2017), stability of optimization algorithms (Hardt et al., 2015), and implicit bias of the training process (Soudry et al., 2018; Arpit et al., 2017; Xu et al., 2018). On the other hand, several works focus on the failure of DNNs (Shalev-Shwartz et al., 2017; Nye & Saxe, 2018), e.g., fitting the parity function, in which a well-trained DNN possesses no generalization ability. We propose that the Fourier analysis can provide insights into both success and failure of DNNs.
F-Principle was first discovered in (Xu et al., 2018; Rahaman et al., 2018) simultaneously through simple synthetic data and not very deep networks. In the revised version, Rahaman et al. (2018) examines the F-Principle in the MNIST dataset. However, they add noise to MNIST, which contaminates the labels and damages the structure of real data. They only examine not very deep (6-layer) fully connected ReLU network with MSE loss, while cross-entropy loss is widely used. This paper verified that F-Principle holds in the training process of MNIST and CIFAR10, both CNN and fully connected networks, very deep networks (VGG16) and various loss functions, e.g., MSE Loss, cross-entropy loss and variational loss function. In the aspect of theoretical study, based on the key mechanism found by the theoretical study in this paper, Luo et al. (2019) shows a rigorous proof of the F-Principle for general DNNs. The theoretical study of the gradient of tanh(x) in the Fourier domain is adopted
by Rahaman et al. (2018), in which they generalize the analysis to ReLU and show similar results. Thm 1 is also used to analyze a nonlinear collaborative scheme for deep network training (Zhen et al., 2018). In the aspect of application, based on the study of the F-Principle in this paper, Cai et al. (2019) and Cai & Xu (2019) design DNN-based algorithms to solve high-dimensional and high-frequency problems.

heading: C EXPERIMENTAL SETTINGS
text: In Fig. 5, the parameters of the DNN is initialized by a Gaussian distribution with mean 0 and standard deviation 0.1. We use a tanh-DNN with widths 1-8000-1 with full batch training. The learning rate is 0.0002. The DNN is trained by Adam optimizer (Kingma & Ba, 2014) with the MSE loss function.
In Fig. 1, for MNIST dataset, the training process of a tanh-DNN with widths 784-400-200-10 is shown in Fig. 1(a) and 1(b). For CIFAR10 dataset, results are shown in Fig. 1(c) and 1(d) of a ReLU-CNN, which consists of one convolution layer of 3 × 3 × 64, a max pooling of 2 × 2, one convolution layer of 3 × 3 × 128, a max pooling of 2 × 2, followed by a fully-connected DNN with widths 800-400-400-400-10. For both cases, the output layer of the network is equipped with a softmax. The network output is a 10-d vector. The DNNs are trained with cross entropy loss by Adam optimizer (Kingma & Ba, 2014). (a, b) are for MNIST with a tanh-DNN. The learning rate is 0.001 with batch size 10000. After training, the training accuracy is 0.951 and test accuracy is 0.963. The amplitude of the Fourier coefficient with respect to the fourth output component at each frequency is shown in (a), in which the red dots are computed using the training data. Selected frequencies are marked by black squares. (b) ∆F (k) at different training epochs for the selected frequencies. (c, d)
are for CIFAR10 dataset. We use a ReLU network of a CNN followed by a fully-connected DNN. The learning rate is 0.003 with batch size 512. (c) and (d) are the results with respect to the ninth output component. After training, the training accuracy is 0.98 and test accuracy is 0.72.
In Fig. 2, for MNIST, we use a fully-connected tanh-DNN with widths 784-400-200-10 and MSE loss; for CIFAR10, we use cross-entropy loss and a ReLU-CNN, which consists of one convolution layer of 3× 3× 32, a max pooling of 2× 2, one convolution layer of 3× 3× 64, a max pooling of 2× 2, followed by a fully-connected DNN with widths 400-10 and the output layer of the network is equipped with a softmax. The learning rate for MNIST and CIFAR10 is 0.015 and 0.003, respectively. The networks are trained by Adam optimizer (Kingma & Ba, 2014) with batch size 10000. For VGG16, the learning rate is 10−5. The network is trained by Adam optimizer (Kingma & Ba, 2014) with batch size 500.
In Fig. 3, the samples are evenly spaced in [0, 1] with sample size 1001. We use a DNN with widths 1-4000-500-400-1 and full batch training by Adam optimizer (Kingma & Ba, 2014). The learning rate is 0.0005. β is 10. The parameters of the DNN are initialized following a Gaussian distribution with mean 0 and standard deviation 0.02.
In Fig. 4, the settings of (a) and (b) are the same as the ones in Fig. 1. For (c), we use a tanh-DNN with widths 10-500-100-1, learning rate 0.0005 under full batch-size training by Adam optimizer (Kingma & Ba, 2014). The parameters of the DNN are initialized by a Gaussian distribution with mean 0 and standard deviation 0.05.

heading: D CENTRAL DIFFERENCE SCHEME AND JACOBI METHOD
text: Consider a one-dimensional (1-d) Poisson’s equation:
−∆u(x) = g(x), x ∈ Ω = (−1, 1) (9)
u(x) = 0, x = −1, 1.
[−1, 1] is uniformly discretized into n+ 1 points with grid size h = 2/n. The Poisson’s equation in Eq. (9) can be solved by the central difference scheme,
−∆ui = − ui+1 − 2ui + ui−1
(δx)2 = g(xi), i = 1, 2, · · · , n, (10)
resulting a linear system Au = g, (11)
where
A =  2 −1 0 0 · · · 0 −1 2 −1 0 · · · 0 0 −1 2 −1 · · · 0 ... ... · · · ...
0 0 · · · 0 −1 2  (n−1)×(n−1) , (12)
u =  u1 u2 ...
un−2 un−1
 , g = (δx)2  g1 g2 ...
gn−2 gn−1  , xi = 2 in . (13) A class of methods to solve this linear system is iterative schemes, for example, the Jacobi method. Let A = D −L−U , where D is the diagonal of A, and L and U are the strictly lower and upper triangular parts of −A, respectively. Then, we obtain
u = D−1(L + U)u + D−1g. (14)
At step t ∈ N, the Jacobi iteration reads as
ut+1 = D−1(L + U)ut + D−1g. (15)
We perform the standard error analysis of the above iteration process. Denote u∗ as the true value obtained by directly performing inverse of A in Eq. (11). The error at step t+1 is et+1 = ut+1−u∗. Then, et+1 = RJet, where RJ = D−1(L + U). The converging speed of et is determined by the eigenvalues of RJ , that is,
λk = λk(RJ) = cos kπ
n , k = 1, 2, · · · , n− 1, (16)
and the corresponding eigenvector vk’s entry is
vk,i = sin ikπ
n , i = 1, 2, · · · , n− 1. (17)
So we can write
et = n−1∑ k=1 αtkvk, (18)
where αtk can be understood as the magnitude of e t in the direction of vk. Then,
et+1 = n−1∑ k=1 αtkRJvk = n−1∑ k=1 αtkλkvk. (19)
αt+1k = λkα t k.
Therefore, the converging rate of et in the direction of vk is controlled by λk. Since
cos kπ n = − cos (n− k)π n , (20)
the frequencies k and (n − k) are closely related and converge with the same rate. Consider the frequency k < n/2, λk is larger for lower frequency. Therefore, lower frequency converges slower in the Jacobi method.

heading: E PROOF OF THEOREMS
text: The activation function we consider is σ(x) = tanh(x).
σ(x) = tanh(x) = ex − e−x
ex + e−x , x ∈ R.
For a DNN of one hidden layer with m nodes, 1-d input x and 1-d output:
h(x) = m∑ j=1 ajσ(wjx+ bj), aj , wj , bj ∈ R, (21)
where wj , aj , and bj are called parameters, in particular, wj and aj are called weights, and bj is also known as a bias. In the sequel, we will also use the notation θ = {θlj} with θ1j = aj , θ2j = wj , and θlj = bj , j = 1, · · · ,m. Note that σ̂(k) = − iπsinh(πk/2) where the Fourier transformation and its inverse transformation are defined as follows:
f̂(k) = ∫ +∞ −∞ f(x)e−ikx dx, f(x) = 1 2π ∫ +∞ −∞ f̂(k)eikx dk.
The Fourier transform of σ(wjx+ bj) with wj , bj ∈ R, j = 1, · · · ,m reads as
̂σ(wj ·+bj)(k) = 2πi
|wj | exp ( ibjk wj ) 1 exp(− πk2wj )− exp( πk 2wj ) . (22)
Thus
ĥ(k) = m∑ j=1 2πaj i |wj | exp ( ibjk wj ) 1 exp(− πk2wj )− exp( πk 2wj ) . (23)
We define the amplitude deviation between DNN output and the target function f(x) at frequency k as
D(k) , ĥ(k)− f̂(k).
Write D(k) as D(k) = A(k)eiφ(k), where A(k) ∈ [0,+∞) and φ(k) ∈ R are the amplitude and phase of D(k), respectively. The loss at frequency k is L(k) = 12 |D(k)|
2, where | · | denotes the norm of a complex number. The total loss function is defined as: L = ∫ +∞ −∞ L(k) dk. Note that according to Parseval’s theorem, this loss function in the Fourier domain is equal to the commonly used loss of mean squared error, that is, L = ∫ +∞ −∞ 1 2 (h(x)− f(x))
2 dx. For readers’ reference, we list the partial derivatives of L(k) with respect to parameters
∂L(k)
∂aj =
2π wj sin (bjk wj − φ(k) ) E0, (24)
∂L(k)
∂wj = [ sin (bjk wj − φ(k) )(π2ajk w3j E1 − 2πaj w2j )
− 2πajbjk w3j cos (bjk wj − φ(k) )] E0, (25)
∂L(k)
∂bj =
2πajbjk w2j cos (bjk wj − φ(k) ) E0, (26)
where
E0 = sgn(wj)A(k)
exp( πk2wj )− exp(− πk 2wj
) ,
E1 = exp( πk2wj ) + exp(− πk 2wj )
exp( πk2wj )− exp(− πk 2wj
) .
The descent increment at any direction, say, with respect to parameter θlj , is
∂L
∂θlj = ∫ +∞ −∞ ∂L(k) ∂θlj dk. (27)
The absolute contribution from frequency k to this total amount at θlj is∣∣∣∣∂L(k)∂θlj ∣∣∣∣ ≈ A(k) exp (−|πk/2wj |)Flj(θj , k), (28)
where θj , {wj , bj , aj}, θlj ∈ θj , Flj(θj , k) is a function with respect to θj and k, which can be found in one of Eqs. (24, 25, 26).
When the component at frequency k where ĥ(k) is not close enough to f̂(k), exp (−|πk/2wj |) would dominate Glj(θj , k) for a small wj . Through the above framework of analysis, we have the following theorem. Define W = (w1, w2, · · · , wm)T ∈ Rm. (29) Theorem. Consider a one hidden layer DNN with activation function σ(x) = tanhx. For any frequencies k1 and k2 such that |f̂(k1)| > 0, |f̂(k2)| > 0, and |k2| > |k1| > 0, there exist positive constants c and C such that for sufficiently small δ, we have
µ ({ W : ∣∣∣∂L(k1)∂θlj ∣∣∣ > ∣∣∣∂L(k2)∂θlj ∣∣∣ for all l, j} ∩Bδ) µ(Bδ)
≥ 1− C exp(−c/δ), (30)
where Bδ ⊂ Rm is a ball with radius δ centered at the origin and µ(·) is the Lebesgue measure.
We remark that c and C depend on k1, k2, |f̂(k1)|, |f̂(k2)|, sup |ai|, sup |bi|, and m.
Proof. To prove the statement, it is sufficient to show that µ(Slj,δ)/µ(Bδ) ≤ C exp(−c/δ) for each l, j, where
Slj,δ := { W ∈ Bδ : ∣∣∣∣∂L(k1)∂θlj ∣∣∣∣ ≤ ∣∣∣∣∂L(k2)∂θlj ∣∣∣∣} . (31) We prove this for S1j,δ , that is, θlj = aj . The proofs for θlj = wj and bj are similar. Without loss of generality, we assume that k1, k2 > 0, bj > 0, and wj 6= 0, j = 1, · · · ,m. According to Eq. (24), the inequality |∂L(k1)∂aj | ≤ | ∂L(k2) ∂aj | is equivalent to
A(k2)
A(k1)
∣∣∣∣∣exp( πk1 2wj )− exp(− πk12wj )
exp( πk22wj )− exp(− πk2 2wj )
∣∣∣∣∣ · ∣∣∣ sin(bjk2wj − φ(k2) )∣∣∣ ≥ ∣∣∣ sin(bjk1 wj − φ(k1) )∣∣∣ (32) Note that |ĥ(k)| ≤ C ∑m j=1 |aj | |wj | exp(− πk 2|wj | ) for k > 0. Thus
lim W→0 ĥ(k) = 0 and lim W→0 D(k) = −f̂(k). (33)
Therefore, lim W→0 A(k) = |f̂(k)| and lim W→0 φ(k) = π + arg(f̂(k)). (34)
For W ∈ Bδ with sufficiently small δ, A(k1) > 12 |f̂(k1)| > 0 and A(k2) < 2|f̂(k2)|. Also note that | sin( bjk2wj − φ(k2))| ≤ 1 and that for sufficiently small δ,∣∣∣∣∣exp( πk1 2wj )− exp(− πk12wj )
exp( πk22wj )− exp(− πk2 2wj )
∣∣∣∣∣ ≤ 2 exp(−π(k2 − k1)2|wj | ) . (35)
Thus, inequality (32) implies that∣∣∣ sin(bjk1 wj − φ(k1) )∣∣∣ ≤ 8|f̂(k2)| |f̂(k1)| exp ( − π(k2 − k1) 2|wj | ) . (36)
Noticing that 2π |x| ≤ | sinx| (|x| ≤ π 2 ) and Eq. (34), we have for W ∈ Slj,δ , for some q ∈ Z,∣∣∣bik1
wi − arg(f̂(k1))− qπ ∣∣∣ ≤ 8π|f̂(k2)| |f̂(k1)| exp ( − π(k2 − k1) 2δ ) (37)
that is,
− c1 exp(−c2/δ) + qπ + arg(f̂(k1)) ≤ bik1 wi ≤ c1 exp(−c2/δ) + qπ + arg(f̂(k1)), (38)
where c1 = 8π|f̂(k2)| |f̂(k1)| and c2 = π(k2 − k1). Define I := I+ ∪ I− where
I+ := {wj > 0 : W ∈ S1j,δ}, I− := {wj < 0 : W ∈ S1j,δ}. (39) For wj > 0, we have for some q ∈ Z,
0 < bjk1
c1 exp(−c2/δ) + qπ + arg(f̂(k1)) ≤ wj ≤
bjk1
−c1 exp(−c2/δ) + qπ + arg(f̂(k1)) . (40)
Since W ∈ Bδ and c1 exp(−c2/δ) + arg(f̂(k1)) ≤ 2π, we have bjk12π+qπ ≤ wj ≤ δ. Then Eq. (40) only holds for some large q, more precisely, q ≥ q0 := bjkπδ − 2. Thus we obtain the estimate for the (one-dimensional) Lebesgue measure of I+
µ(I+) ≤ ∞∑ q=q0 ∣∣∣∣∣ bjk1−c1 exp(−c2/δ) + qπ + arg(f̂(k1)) − bjk1c1 exp(−c2/δ) + qπ + arg(f̂(k1)) ∣∣∣∣∣
≤ 2|bj |k1c1 exp(−c2/δ) · ∞∑ q=q0
1
(qπ + arg(f̂(k1)))2 − (c1 exp(−c2/δ))2
≤ C exp(−c/δ). (41)
The similar estimate holds for µ(I−), and hence µ(I) ≤ C exp(−c/δ). For W ∈ Bδ, the (m− 1) dimensional vector (w1, · · · , wj−1, wj+1, · · · , wm)T is in a ball with radius δ in Rm−1. Therefore, we final arrive at the desired estimate
µ(S1j,δ) µ(Bδ) ≤ µ(I)ωm−1δ
m−1
ωmδm ≤ C exp(−c/δ), (42)
where ωm is the volume of a unit ball in Rm.
Theorem. Considering a DNN of one hidden layer with activation function σ(x) = tanh(x). Suppose the target function has only two non-zero frequencies k1 and k2, that is, |f̂(k1)| > 0, |f̂(k2)| > 0, and |k2| > |k1| > 0, and |f̂(k)| = 0 for k 6= k1, k2. Consider the loss function of L = L(k1) + L(k2) with gradient descent training. Denote
S = { ∂L(k1)
∂t ≤ 0, ∂L(k1) ∂t ≤ ∂L(k2) ∂t
} ,
that is, L(k1) decreases faster than L(k2). There exist positive constants c and C such that for sufficiently small δ, we have
µ ({W : S holds} ∩Bδ) µ(Bδ) ≥ 1− C exp(−c/δ),
where Bδ ⊂ Rm is a ball with radius δ centered at the origin and µ(·) is the Lebesgue measure.
Proof. By gradient descent algorithm, we obtain
∂L(k1) ∂t = ∑ l,j ∂L(k1) ∂θlj ∂θlj ∂t
= − ∑ l,j ∂L(k1) ∂θlj ∂(L(k1) + L(k2)) ∂θlj
= − ∑ l,j ( ∂L(k1) ∂θlj )2 − ∑ l,j ∂L(k1) ∂θlj ∂L(k2) ∂θlj ,
∂L(k2)
∂t = − ∑ l,j ( ∂L(k2) ∂θlj )2 − ∑ l,j ∂L(k1) ∂θlj ∂L(k2) ∂θlj ,
and ∂L
∂t = ∂ (L(k1) + L(k2)) ∂t = − ∑ l,j ( ∂L(k1) ∂θlj + ∂L(k2) ∂θlj )2 ≤ 0. (43)
To obtain
0 < ∂L(k1) ∂t − ∂L(k2) ∂t = − ∑ l,j
[( ∂L(k1)
∂θlj
)2 − ( ∂L(k2)
∂θlj
)2] , (44)
it is sufficient to have ∣∣∣∣∂L(k1)∂θlj ∣∣∣∣ > ∣∣∣∣∂L(k2)∂θlj ∣∣∣∣ . (45) Eqs. (43, 44) also yield to
∂L(k1)
∂t < 0.
Therefore, Eq. (45) is a sufficient condition for S. Based on the theorem 1, we have proved the theorem 2.
F MEMORIZING 2-D IMAGE
We train a DNN to fit a natural image (See Fig. 6(a)), a mapping from coordinate (x, y) to gray scale strength, where the latter is subtracted by its mean and then normalized by the maximal absolute value. First, we initialize DNN parameters by a Gaussian distribution with mean 0 and standard deviation 0.08 (initialization with small parameters). From the snapshots during the training process, we can see that the DNN captures the image from coarse-grained low frequencies to detailed high frequencies (Fig. 6(b)). As an illustration of the F-Principle, we study the Fourier transform of the image with respect to x for a fixed y (red dashed line in Fig. 6(a), denoted as the target function f(x) in the spatial domain). The DNN can well capture this 1-d slice after training as shown in Fig. 6(c). Fig. 6(d) displays the amplitudes |f̂(k)| of the first 40 frequency components. Due to the small initial parameters, as an example in Fig. 6(d), when the DNN is fitting low-frequency components, high frequencies stay relatively small. As the relative error shown in Fig. 6(e), the first five frequency peaks converge from low to high in order.
Next, we initialize DNN parameters by a Gaussian distribution with mean 0 and standard deviation 1 (initialization with large parameters). After training, the DNN can well capture the training data, as shown in the left in Fig. 6(f). However, the DNN output at the test pixels are very noisy, as shown in the right in Fig. 6(f). For the pixels at the red dashed lines in Fig. 6(a), as shown in Fig. 6(g), the DNN output fluctuates a lot. Compared with the case of small initial parameters, as shown in Fig. 6(h), the convergence order of the first five frequency peaks do not have a clear order.

Review summaries:
This paper proposes to analyze the loss of neural networks in the Fourier domain. Since this is computationally expensive for larger-dimensional datasets, the analysis instead first projects the data onto the principal component of the data, and then using a Gaussian kernel estimation (which has nice properties in the Fourier domain). The analysis finds that DNNs tend to learn low-frequency components before high-frequency ones.

The paper studies the training process of NNs through the lens of Fourier analysis. The authors argue that during the training process, NNs will first learn low frequencies part of the function first and then the high frequency part. To verify this claim empirically, the author propose two methods: 1. examine the convergence of different frequencies in a pre-selected direction in the frequency space during training; 2. examine the convergence rate of the 2-norm of low v.s. high frequencies during training.  Through the experimental results of these two methods, the authors conclude that NNs learn the low  frequency components before the high frequency components. The authors also discuss a potential application of this observation to solving high dimensional PDEs: coupling DNNs training (good at learning low frequency components) with the Jacobi method (good at learning high frequency components). Finally, the authors also provide some theoretical intuition (Thm 1., 2.) why low frequency components are learned faster and an explanation why NNs could generalize well on images but perform poorly on tasks like learning parity functions.