Neural Networks Fail to Learn Periodic Functions and How to Fix It

Liu Ziyin, Tilman Hartwig, Masahito Ueda
6/15/2020
cs.LGstat.ML

Official code: liu-ziyin/NeurIPS_2020_Snake (31 stars, last commit 2021-08-16).

Abstract

Previous literature offers limited clues on how to learn a periodic function using modern neural networks. We start with a study of the extrapolation properties of neural networks; we prove and demonstrate experimentally that the standard activations functions, such as ReLU, tanh, sigmoid, along with their variants, all fail to learn to extrapolate simple periodic functions. We hypothesize that this is due to their lack of a "periodic" inductive bias. As a fix of this problem, we propose a new activation, namely, $x + \sin^2(x)$, which achieves the desired periodic inductive bias to learn a periodic function while maintaining a favorable optimization property of the ReLU-based activations. Experimentally, we apply the proposed method to temperature and financial data prediction.

View on arXivView PDF

Code Implementations(1)

312Jupyter NotebookOct 23, 20205 years ago

Similar Papers

Cite this paper

@article{ziyin2020neural,
  title  = {Neural Networks Fail to Learn Periodic Functions and How to Fix It},
  author = {Liu Ziyin and Tilman Hartwig and Masahito Ueda},
  year   = {2020},
  eprint = {2006.08195},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2006.08195}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2006.08195.svg)](https://codeofpaper.com/paper/2006.08195)

Discussion