I’m currently training the network with a training set of 5000 samples and a batch size of 64 for around 200-500 epochs.
Additionally the training data has no noise.
I thought it would be simple to approximate the data. I’ve tried it with L1Loss and MSELoss also I switched between SGD and Adam but all of them either converge to an linear function or the mean.
Even when I increase the training data and epochs.
@Tony-Y I appreciate your example but it seems like you additionally use the derivative?
After changing the target function to x^2 my code seems to work fine. Even some other functions are perfectly approximated. Does that mean that neural networks are not able to easily approximate periodic functions?