@ptrblck I tried your suggestion and I could achieve some sensitivity to the input data (I used the batch size of 1 and 1000 epochs). Also, the training data was fitted better than the test data, so it looks like overfitting. Although, the fitting of the training data is also not perfect as can be seen in the picture below.
ovefrfitting1049×225 30.3 KB
And here is the prediction result for the two test data samples that my network has never seen before:

I also tried the batch size of 10, and after 1000 epochs, the result is worse for the training data (compared to the batch size of 1):
ovefrfitting_testset_101027×225 56.7 KB
For the same network architecture I tried the same images, but different “labels” (batch size of 1, 1000 epochs). The labels are oscillatory curves centered around zero vertically and horizontally. The result is not good at all: the prediction is the same for all 10 training data.
ovefrfitting_testset_10_oscillator1027×225 30.3 KB
Question: Would you have an idea why oscillatory behaviour is so different?