Submitted by T4KKKK t3_zw702q in MachineLearning
[removed]
Submitted by T4KKKK t3_zw702q in MachineLearning
[removed]
Periodicity cannot be learned by a general neural network unless you impose some sort of structural prior onto it (e.g. use periodic activation functions), or transform your inputs accordingly (e.g. nn_input = x % (2*pi))
Vanilla ANNs, or MLPs more specifically, are well known to be shit at extrapolating, which is what you're trying to do. There has been some works using periodic activation functions that claim to be better. Try to look for those.
Sorry for being inaccurate.
The exact problem is to predict the next couple points of the sine wave *outside* of the train range.
From the other responses I understood that its possible with periodic activation functions only.
I would rather recommend starting with polynomial curve fitting.
y = sin(ax + b) is all you need. It’s 1 “neuron” with sine activation.
Use LSTM to solve this problem
https://www.resceu.s.u-tokyo.ac.jp/workshops/resceu20s/docs/hartwig.pdf
I guess you could try this. I have always wanted to try this to see if this works, but I admittedly am lazy.
Neural networks with any non-linear activation should do the job, periodic activations are not necessary.
Also if you have to predict the sine wave, don't do neural networks. Try simpler learning algorithms, neural networks are mostly overkill. Imho kernel regression or something should be an easier way to go, but as always, can't guarantee without trying
Try training an NN with `sin` activations to fit a `sin(kx)` for various `k`, and you will find that generally they can't.
It won't train `a` and `b`, just try it.
fujiitora t1_j1t6rjh wrote
That sounds like a dumb assignment, what is the exact problem and what does the data look like? Are you given a bunch of noisy points from some unknown sine curve and have to learn the defining parameters i.e. period/amp/shifts? Do you have to predict new points following that same curve at some new x value(s)? You can't predict outside of the training range, it will predict as an extension of the activation function. Whatever problem this actually is, its literally just a simple curve fitting one, using a NN is pointless