{'fraction_non_alphanumeric': 0.04148587152079585, 'fraction_numerical': 0.011323949624298868, 'mean_word_length': 4.302749719416386, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
PhaseDNN - A Parallel Phase Shift Deep Neural Network for Adaptive Wideband Learning

In this paper, we propose a phase shift deep neural network (PhaseDNN) which provides a wideband convergence in approximating a high dimensional function during its training of the network. The PhaseDNN utilizes the fact that many DNN achieves convergence in the low frequency range first, thus, a series of moderately-sized of DNNs are constructed and trained in parallel for ranges of higher frequencies. With the help of phase shifts in the frequency domain, implemented through a simple phase factor multiplication on the training data, each DNN in the series will be trained to approximate the target function's higher frequency content over a specific range. Due to the phase shift, each DNN achieves the speed of convergence as in the low frequency range. As a result, the proposed PhaseDNN system is able to convert wideband frequency learning to low frequency learning, thus allowing a uniform learning to wideband high dimensional functions with frequency adaptive training. Numerical results have demonstrated the capability of PhaseDNN in learning information of a target function from low to high frequency uniformly.


Introduction
Deep neural network (DNNs) have shown great potential in approximating high dimensional functions without suffering the curse of dimensionality of traditional approximations based on Lagrangian interpolation or spectral methods. Recently, it has been shown in [1,2] that some common NNs, including fully connected and CNN with tanh and ReLU activation functions, demonstrated a frequency dependent convergence behavior, namely, the DNN during the training are able to approximate the low frequency components of the targeted functions first before the higher frequency components, named as F-Principle of DNNs [1]. The stalling of DNN convergence in the later stage of training could be mostly coming from learning the high frequency component. This F-principle behavior of DNN is just the opposite to the convergence behavior of the traditional multigrid method (MGM) [3] for approximating the solutions of PDEs where the convergence occurs first in the higher frequency end of the spectrum, due to the smoothing operator employed in the MGM. The MGM takes advantage of this fast high frequency error reduction in the smoothing iteration cycles and restrict the original solution of a fine grid to a coarse grid, then continuing the smoothing iteration on the coarse grid to reduce the higher end frequency spectrum in the context of the coarse grid. This downward restriction can be continued until errors over all frequency are reduced by a small number of iteration on each level of the coarse grids.
In this work, we propose a wideband DNN in error reductions in the approximation for all frequencies of the targeted function by making use of the faster convergence in the low frequencies of the DNN during its training. We first will train a neural network T (x, θ (n 0 ) ) until it will achieve a sufficient error reduction for the frequency range |k| < K 0 for a prescribed K 0 within n 0 training epoches. In order to further learn the high frequency component of the target function, we decompose the residual, i.e. the difference between the target function and T (x, θ (n 0 ) ), into a series of functions with frequency spectrum through a partition of the unit (POU) in the k-space. To learn each of these function of specific frequency range, we will employ a phase shift in the k-space to translate its frequency to the range |k| < K 0 , the phase shifted function now only has low frequency content and can be learned by common DNN with a small number of epoches of training. This series of DNNs with phase shifts will be named Phase-shift deep Neural Network (PhaseDNN).
It should be noted that during the construction of PhaseDNN, only the original set of training data will be needed, but it will be modified to account for the frequency shifts, implemented simply by multiplying the training data by an phase factor e ±ω j x on the residuals from the previous neural network approximations. We also allude the way PhaseDNN achieve approximation over increasing range of frequency with each additional network to that of wavelet approximations, which generate better and better resolution of approximation by adding wavelet subspaces produced by dialation of mother wavelet to account for higher frequency [4] [5]. In the case of PhaseDNN though phase shifts are used to cover higher frequencies. The substraction between the target function provided by the training data and the lower frequency network approximation is similar to the strategy employed in construction of multi-resolution interpolation for PDE solutions [5].
The rest of the paper will be organized as follows. In section 2, we will review the fast low frequency convergence property of neural network with tanh activation function. Section 3 will present the new phase shift deep neural network. Finally, a conclusion and discussions will be given in Section 4.

Deep Neural Network and frequency dependent training of DNN
The nonlinear activation function σ(u) : R → R. By applying this function componentwisely, we can extend activation function to σ(u) : R n → R n naturally. A DNN with L + 1 layers can be expressed as a compact form with T 0 (x) = Θ 0 (x). Equivalently, we can also express it explicitly: Here, Θ l (x) = W l x + b l : R n l → R n l+1 are linear functions. This DNN is also said to have L hidden layers. The l-th layer has n l neurons. In the following text, we only consider DNN with one dimensional input layer and one dimensional output layer. Namely, Θ 0 (x) : The activation function is chosen to be σ(u) = tanh(u).
In this paper, we consider the problem of approximating a function by DNN through training. Given a function f (x) ∈ L 1 (R) ∩ L 2 (R) (This choice is only to ensure the existence of Fourier transform and loss function for analysis reason.), we are going to minimize (3) We consider this problem in frequency space. We define Fourier transform and its inverse of a function f (x) by Let θ denotes all the parameters in DNN. Namely, Here, p = n 1 + 1 + (n 1 + 1) × n 2 + (n 2 + 1) × n 3 + . . . (n L + 1) is the number of the parameters. The F-principle states the relative changing rate of ∂L(k) ∂θ j for different frequency k. We cite the following result from [2] Theorem 1. Given a function f (x) ∈ L 1 (R) ∩ L 2 (R) and a DNN function where ε > 0 is a small parameter. Suppose W l rs = 0 for all 0 l L − 1, 1 r n l and 1 s n l+1 . For any frequency k 1 and is the Lebesgue measure and c > 0, C > 0 are two constants.

Parallel Phase shift DNN (PhaseDNN)
The F-principle and estimation of L(k) in Theorem 1 suggest that when we apply a gradient-based training method to loss function, the low frequency part of loss function converges faster than the high frequency part. So when we train a DNN T (x) to approximate f (x), there exists positive frequency number K 0 and an integer n 0 such that after n 0 steps of training, the Fourier transform of training function F[T ](k; θ (n 0 ) ) should be a good approximation of F[f ](k) for |k| < K 0 , where θ (n 0 ) are parameters obtained after n 0 steps of training.
In order to speed up the learning of the higher frequency content of the target function f (x), we will employ a phase shift technique to translate higher frequency spectrum f (k) to the frequency range of [−K 0 , K 0 ]. Such a shift in frequency is a simple phase factor multiplication on the training data in the physical space, which can be easily implemented.
For a given ∆k, let us assume that Before we can carry out this scheme, we construct a mesh for the interval [−m∆k, m∆k] by ω j = j∆k, j = −m, · · · , m, Then, we introduce a POU for the domain [−M, M ] associated with the mesh as The simplest choice of ϕ j (k) is where ϕ(k) is just the characteristic function of [−1, 1], i.e., The inverse Fourier transform of ϕ(k), indicated by ∨, is For a smoother function ϕ(k) whose inverse Fourier transform, which will act as a frequency selection kernel in x-space, has a faster decay condition, we could use B-Splines B m (k),defined by the following recursive convolutions. Namely, It can be easily shown that In most cases, we will just use the cubic B-Spine. We choose and ϕ j (k) = ϕ(k/∆k − j). Therefore, which defines the frequency selection kernel . From the basic property of B-spline functions, we know that In Eqn. (12), we define ϕ −m−1 = B 4 (k/∆k + m + 3), ϕ m = B 4 (k/∆k − m + 2) and ϕ m+1 = B 4 (k/∆k − m + 1). Now, with the POU in (7), we can decompose the target function f (x) in the Fourier space as follows, Equation (13) will give a corresponding decomposition in x-space where The decomposition (14) involves m + 1 function f j (x) whose frequency spectrum is limited to [ω j−1, ω j+1 ], therefore, a simple phase shift could translate its spectrum to [−K 0 , K 0 ], then it could be learned quickly by a DNN with n 0 training epoches.
• A parallel phase shift DNN (PhaseDNN) algorithm We define the first approximation to f (x) by T (x, θ (n 0 ) ), x ∈ R, based on given N -training data Let us consider the residual between the function f (x) and its first DNN approximation f DNN , We should have namely, Our next step is to learn this residual function r(x) based on its training data In order to learn r(x) for its frequency information for |k| > K 0 , we will apply the decomposition (14) to r(x) where The training data for {r j (x i )} N i=1 will be computed by (22), which can be implemented in the data x-space through the following convolution where δ is chosen such that the kernel function |ϕ ∨ j (δ)| = |ϕ ∨ (K 0 δ)| is smaller than some given error tolerance, N s is the number of data points inside Now as the support of r j (k) is [ω j−1, ω j+1 ], then r j (k − ω j ) will have its frequency spectrum in [−∆k, ∆k] = [−K 0 , K 0 ], therefore its inverse Fourier can be learned quickly by a DNN in n 0 -epoches of training. Moreover, we know that which provides the training data for r shift j (x). Equation (26) shows that once r shift j (x) is learned, r j (x) is also learned by removing the phase factor.
Now all r j (x) 0 ≤ j ≤ m have been learned, we will have an approximation to r(x) as Finally, we will obtain our Phase shift DNN (PhaseDNN) approximation of f (x), as illustrated in the flowchart in Fig. 1 Remark 1. (Parallelism of PhaseDNN) It is clear the learning for each part of residual function r j (x) can be done in parallel, the PhaseDNN is a version of domain decomposition method in k-space.

Remark 2. (Recursive version of PhaseDNN)
After the updating step (29), in principle, we can repeat the process by starting at (17) with the new f DNN (x) to further reduce any remaining error in all frequency range (see Fig. 1).

Remark 3. (Frequency Adaptivity of PhaseDNN)
The frequency-selected residual r j (x i ) requires the evaluation of the convolution (23), which implicitly assumes sufficient data information is available in the neighborhood of x i . In case such an assumption is not valid, we basically do not have enough data to extract the frequency information for the target function. In all practical sense of learning, we should assume the target function do not have the information of this specific frequency, and there is no need to learn this function r j (x) near x i and we could simply set r j (x) = 0 for x ∈ (x i − δ, x i + δ), which is what could happen for a constant (or low) frequency function r(x). As this process is done locally in space and frequency, the PhaseDNN will be able to achieve frequency adaptivity commonly associated with wavelet approximation of signals and images.
• Adaptivity in frequency and local radial Basis fitting A preanalysis of the training data could be done to investigate the frequency content of the data, so only those frequencies will be considered when phase shifts are used for error reduction. Firstly, we group the training data x i into N c clusters (disjoint or overlapping). Secondly, in a sphere centered at the center of a cluster, a local radial basis function fitting of training data {x i , y i } falling in the sphere will be carried out [6]. Finally, we apply an 1-D discrete Fourier transform over the fitting function along each coordinate direction within the cluster to get the frequency content for the data in the cluster. Once this analysis is done for each cluster, we will have a collection of frequencies and those with significant magnitude will be used as candidates for the phase shifts in the PhaseDNN.
Remark 4. (Selection of K 0 and n 0 and pre-processing training data) In principle, any nonzero frequency threshold K 0 can be used in the implementation of PhaseDNN, which will dictate the size of n 0 to achieve sufficient convergence of the underlying DNN over the frequency range [−K 0 , K 0 ]. Therefore, a careful analysis and numerical experiment of the specific low frequency convergence of the DNN will be needed.
As n 0 is selected to train the initial network in PhaseDNN to learn low frequent content of the data, a low-pass filtering on the training data could be used to select appropriate size of n 0 needed for achieve convergence within K 0 frequency.
making frequency shift along various − → k unit vector directions. However, for high dimension problems, the shifts employed in the frequency k ∈ R d -space to learn r(x) in (17) should be done in an alternating direction sweep over the k-coordinate directions to avoid the curse of dimensionality. Namely, we will carry out m + 1 shifts along k 1 direction, learn m + 1 DNNs for the phase shifts only along k 1 direction, which will be used to update f DN N (x) in (29). Then, we learn another m+1 DNNs for the shifts along k 2 direction, etc, until all directions in k are touched. In all, d(m + 1) DNNs will have been trained for one sweep of all k coordinate directions at a cost O(d). This alternating direction sweep in k space can be repeated to improve the accuracy.
Another way to improve the efficiency of the k alternating direction sweep is to introduce matching random rotation of the coordinate systems in both x and k spaces, so the rotated k coordinate directions will be able to detect the high frequency in non-uniform data during the sweep more effectively.

Numerical Result
In this section, we will present some preliminary numerical results to demonstrate the capability of PhaseDNN to learn high frequency content of target functions. In practice, we could sweep over all frequency ranges. For the test function we have some rough idea of the the range of frequencies in the data, only a few frequency intervals are selected for the phase shift.
We choose a target function f (x) defined in [−π, π] by Because the frequencies of this function is well separated, we need not to sweep all the frequencies in [−∞, +∞]. Instead, we choose ∆k = 5, and use the following functions to collect the frequency information in the corresponding frequency intervals and shift the center of the interval to the origin by a phase factor. For , we construct two DNNs to learn its real part and imaginary part, separately. Every DNN have 4 hidden layers and each layer has 40 neurons. Namely, the DNN has the structure 1-40-40-40-40-1. The training data is obtained by 10,000 samples from the uniform distribution on [−π, π] and the testing data is 500 uniformly distributed samples. We train these DNNs by Adam optimizer with training rate 0.0002 with 10 epochs of training for each DNN. The result is shown in Fig. 2.
The detail of this training is shown in Fig. 3. These figures clearly shows that phase DNN can capture the various high frequencies, from low frequency ±1, ±3 to high frequency ±203 quite well. The training error and time of phase DNN are collected in table 1 It is shown that taking the advantage of vectorization, the convolution step costs about 20% time of training. Because in different interval, f j (x) can be trained in parallel, PhaseDNN is ideal to take advantage of parallel computing architectures.
In comparison with one single DNN, we have used a 24 hidden layers with 80 neurons per hidden layer with the same amount of training data, the loss is still around 100 after more than 5000 epoch of training taking over 22 hours nonstop running on the same workstation.

Discussion and Conclusion
In this paper, we proposed a parallel PhaseDNN, consisting of a series of commonly-used DNNs in parallel, to achieve uniform frequency convergence of deep neural network in approximating a function. In contrast to the wavelet multi-resolution approximation with its higher resolution wavelet subspaces generated by dilation of mother wavelet to provide approximation to higher frequency components, the PhaseDNN uses a phase shift strategy , [−π/10, π/10], [π/3−π/10, π/3+π/10], [π/2−π/10, π/2+π/10], [2π/3 − π/10, 2π/3 + π/10] and [π − π/10, π] correspondingly. The blue solid line is f (x) and the data marked by + in red is the value of f DN N (x) at testing data set. to handle higher frequency, which allows us to make use of the fast convergence of common DNN in the low frequency range. The PhaseDNN employs original training data, which are easily modified (i.e., a multiplication by a phase factor) to carry out the required phase shift operation.

Convolution Training Training
Two additional comments on the PhaseDNN are given below.
• Training data and PhaseDNN. The convolution computation (23) required in obtaining the training data for the selected frequency component of the residual r j (x) implicitly implies that the training data location x are dense enough to extract the information of the given frequency range. Similarly, The frequency shift in the PhaseDNN in (26) also implicitly requires that the training data location x are dense enough to be uni-solvent to represent the Fouirer mode e ±iω j x . Otherwise due to the alias phenomenon of the Fourier modes on a discrete set, the simple multiplication by e ±iω j x on the training data will not achieve the desired frequency shift.
• Spatial and Frequency adaptive approximation. The frequency shifts can be done in any order, therefore, for problems for prior knowledge of frequency information or need of knowledge for specific frequency such as segmentation, the PhaseDNN can be used to obtain convergence in the desired frequency ranges. As mentioned in Remark 3, each DNN in the PhaseDNN is linked to the local spatial and frequency, therefore PhaseDNN can achieve also spatial adaptivity in the construction of the its DNNs.
In future work, more numerical tests will be carried out to understand the potential and behavior of the proposed PhaseDNN and calibrate the efficiency and accuracy of the PhaseDNN over a stand-alone DNN, especially for high dimensional problems.