Vanilla MLPs and their limits
Learning objectives
- Measure how many steps a vanilla network needs to learn each of the column's wavelength bands, by reading where each band's miss falls below one half
- Show that ten times Section 0.9's training takes the 1-16-16-1 network's miss of the band from 125 m to 250 m from 83 % to 11 % and leaves 81 % of the shortest wavelengths
- Compare two and four hidden layers trained the same way
- Say why the price in steps of a short wavelength is the case for the architectures of Part 2
Slow, Not Unable
A vanilla tanh network does not fail to learn the column's short wavelengths: it learns them slowly. Section 0.9's 1-16-16-1 network, with its seed and its rate, trained for 30000 Adam steps, ten times Section 0.9's, misses 11 % of the column's wavelengths from 125 m to 250 m, where it missed 83 % at 3000 steps, and still 81 % of those shorter than 125 m. The longest wavelengths are half learnt within the first 100 steps and the band from 125 m to 250 m after about 6500. That price, paid in steps by every network that learns a wave this way, is why Part 2 changes the network rather than the training.
The Same Network, Longer
The run is Section 0.9's: the same network from the same seed at the same rate, 0.01, on the same 176 depths every 10 m, so its first 3000 steps are Section 0.9's fit (the kernel's gate holds the two to the bit) and the next 27000 are new. Its fit goes from 106 m/s RMS at 3000 steps to 31 m/s at 10000 and 23 m/s at 30000. The bands fall in Section 0.9's order: after 2000 steps the band from 500 m to 1000 m is 12 % missed; after 10000 the band from 250 m to 500 m is 6.2 % missed and the band from 125 m to 250 m 23 %; after 30000 the last is 11 %.
The Price of a Short Wavelength
Plate (c) reads when each band was half learnt: where its miss in plate (b) first falls below one half, placed between the checkpoints on either side on the logarithm of the step. For the two-layer network the wavelengths of 1000 m and longer were half learnt within the first 100 steps, the band from 500 m to 1000 m after about 1400, the bands from 250 m to 500 m and from 125 m to 250 m after about 6500, and the wavelengths shorter than 125 m not within 30000. Rahaman et al. (2019) showed that deep ReLU networks are biased towards low frequency functions, and Xu et al. (2019) that networks often fit target functions from low to high frequencies; on the column that order is a cost in steps.
Depth
Four hidden layers of 16, 865 parameters to 321, trained the same way, half learn the band from 125 m to 250 m after about 2400 steps and the wavelengths shorter than 125 m after about 8500. After 30000 steps the network is 7.8 m/s RMS from the column and misses 24 % of its wavelengths shorter than 125 m; at Section 0.9's 3000 steps it still missed 86 % of them. Depth buys the shortest wavelengths, but at ten times Section 0.9's training, and its fit wanders on the way: 13 m/s RMS at 10000 steps and 15 m/s at 20000.
Why Not Just Train Longer
A PINN of a wavefield learns its field through the same kind of network and the same gradient descent, and a field's short wavelengths are its reflections. Tancik et al. (2020) take the other way: a Fourier feature mapping of the input lets a network learn high frequency functions in low-dimensional domains, Section 2.2's remedy. Every remedy in Sections 2.2 to 2.5 is measured on this column at Section 0.9's 3000 steps, against these runs.
What Comes Next
Section 2.2 puts sines and cosines of the depth at chosen scales in front of the same network: Fourier features, the first remedy.
References
- Rahaman, N., Baratin, A., Arpit, D., Draxler, F., Lin, M., Hamprecht, F. A., Bengio, Y. and Courville, A. (2019). On the spectral bias of neural networks. arXiv:1806.08734.
- Xu, Z.-Q. J., Zhang, Y., Luo, T., Xiao, Y. and Ma, Z. (2019). Frequency principle: Fourier analysis sheds light on deep neural networks. arXiv:1901.06523.
- Tancik, M., Srinivasan, P. P., Mildenhall, B., Fridovich-Keil, S., Raghavan, N., Singhal, U., Ramamoorthi, R., Barron, J. T. and Ng, R. (2020). Fourier features let networks learn high frequency functions in low dimensional domains. arXiv:2006.10739.