Abstract
We consider the problem of learning a periodic one-dimensional signal with neural networks and designing models capable of extrapolating the signal well beyond the training window. We demonstrate that multi-layer perceptrons with ReLU activations are provably unable to perform this task, leading to poor performance even near the training window. We propose a novel architecture utilizing sine activation functions combined with a specific non-convex regularization. This approach enables signal extrapolation with low error over hundreds of periods and accurately recovers the frequency spectrum in multi-tone settings, outperforming existing methods by several orders of magnitude.
Introduction
Many real-world phenomena, from climate patterns to financial cycles, are inherently periodic. Despite their success in other domains, standard deep learning architectures like Multi-Layer Perceptrons (MLPs) with ReLU activations fail significantly on periodic tasks. This failure stems from two primary issues:
- Fundamental Representation Limits: ReLU networks are piecewise linear. It can be formally proven (Proposition 1) that any periodic function represented by a finite ReLU network must be constant. Consequently, these models cannot learn the underlying periodicity and fail immediately outside the training range.
- Optimization Challenges with Periodic Activations: While sine activations are a natural choice, they are difficult to train. Standard initialization often leads to missing high-frequency components (spectral bias) or noisy extrapolations due to destructive interference between neurons at similar frequencies.
Methodology
We propose a two-layer neural network architecture based on sine and cosine activations: $$F(x) = \sum_{i=1}^{m} a_i \sin(\omega_i x) + b_i \cos(\omega_i x)$$
To ensure robust recovery and long-range extrapolation, we introduce two critical modifications to the training procedure:
- Structured Frequency Initialization: Instead of independent and identically distributed (i.i.d.) random weights, we initialize frequency parameters ($\omega_i$) at regular intervals. This ensures the network considers a broad spectrum of potential frequencies from the outset.
- Decaying Non-Convex Regularization: We employ a sparsity-promoting penalty defined as: $$\mathcal{R}(a, b) = -\sum_{i} \exp(-\sqrt{a_i^2 + b_i^2 + \epsilon})$$ This penalty encourages the model to concentrate energy into a few dominant frequencies. To allow the model to perfectly fit the data in the later stages of training, the weight of this penalty decays exponentially over time ($e^{-t/\tau}$).
Experimental Results
The proposed architecture was evaluated on synthetic one-dimensional signals, including single-tone, multi-tone (25 harmonics), and noisy variants.
Extrapolation Performance
The regularized sine network achieves extrapolation errors several orders of magnitude lower than architectures using ReLU, Tanh, or Snake activations. It maintains high accuracy even 100 periods beyond the training data. This success is attributed to the non-convex penalty's ability to avoid the "truncation trap," where models otherwise prefer signals that decay to zero outside the training window to minimize standard norms.
Frequency Spectrum Recovery
In complex multi-tone scenarios, our method accurately identifies the constituent frequencies of the signal. In contrast, unregularized or poorly regularized models often exhibit "wiggling" artifacts or fail to localize the true frequencies. Furthermore, the Sine-NN approach demonstrates robustness to noise, performing competitively with classical signal processing techniques like periodogram maximization, especially in data-sparse regimes.
Conclusion and Future Work
This work establishes that proper regularization and initialization are essential for neural networks to learn and extrapolate periodic signals. While the results in one dimension are compelling, future research should explore scaling these techniques to high-dimensional data and non-stationary signals. Additionally, reducing the computational overhead compared to classical frequency-domain methods remains an open challenge.
Summary updated