My third neural network experiment (second was FIR filter). DFT output is just a linear combination of inputs, so it should be implementable by a single layer with no activation function.
Animation of weights being trained:
Red are positive, blue are negative. The black squares (2336 out of 4096) are unused, and could be pruned out to save computation time (if I knew how to do that).
Even with pruning, it would be less efficient than an FFT, so if the FFT output is useful, probably best to do it externally and provide it as separate inputs?
This at least demonstrates that neural networks can figure out frequency content on their own, though, if it's useful to the problem.
The loss goes down for a while but then goes up. I don't know why:
@masip85 No, not at all. It's inaccurate and highly inefficient, and you need to train it on white data if you want it to be correct at all points of the spectrum. It was just an experiment. I'm a signal processing engineer and was trying to learn the basics of ANNs.
If you think that your neural network would benefit from FFT features, then I would suggest calculating the FFT and feeding it to the network separately.
I also tested if it could learn the absolute value of the FFT output and it did not do very well with ReLUs, they were not good at approximating the absolute value function.
Again, I would feed that information directly to the network if I thought it would benefit from it.