2

I am trying to train an ANN but until now it is not learning the lower values of the training sample. I have tried using different python libraries to train ANN. The aim is to predict solar radiation from other weather parameters (regression problem). I think the ANN is confusing lower values (winter/cloudy days) with the night-time values (probably). I have tried the following but none of them worked;

  1. Scaling data between different values e.g. [0,1],[-1,1]
  2. Standardising data to have zero mean and unit variance
  3. Shuffling the data
  4. Increasing the training samples (from 3 years to 10 years)
  5. Using different train function (e.g. bfds, gdm)
  6. Trying different transfer functions (e.g. LogSig, TanSig)
  7. Using few input variables
  8. Varying hidden layers and hidden layers' neurons

Below is my code using neurolab but I have used nolearn/lasagne as well and it did not work either.

f = np.loadtxt('C:\Users\ABC.txt')
input = f[:,:8]
output = f[:,8:]
size = len(input)
output3=output
input3=input
norm_inp = nl.tool.Norm(input)
input4 = norm_inp(input)
norm_out = nl.tool.Norm(output)
output4 = norm_out(output)
net = nl.net.newff([[0, 1], [0, 1], [0, 1],[0,1],[0,1],[0,1],[0,1],[0,1]],[100, 1])
net.trainf = nl.train.train_bfgs
net.layers[0].transf= nl.trans.LogSig()
#net.layers[1].transf= nl.trans.LogSig()
error = net.train(input4, output4, epochs=1000, show=10, goal=0)
networksave = net.save('netD1.dat')

Please see below, some of the results that I have got. Any idea about what I may be doing wrong or any directions to try? Results

Muhammad
  • 305
  • 2
  • 6
  • 20
  • Interesting question with prose, code and pictures. I am a bit lost though in guessing how one notices, that whatever you implemented/trained did "not learning the lower values of the training sample". Maybe it is obvious from the rest of the text or the graphs, but I do not see it. Thanks. – Dilettant May 31 '16 at 16:08
  • @Dilettant: Thanks for your comment. As you can see in the left-hand side picture (regression plot) that on lower values the difference between predicted and actual values is quite significant. It is visible in right-hand side picture as well, the ANN does not predict lower (cloudy/night-time) values. – Muhammad May 31 '16 at 16:13
  • Ah, ok. Thanks for providing additional info. Going further based on this, is the selection of dimensions promising? I mean temperature (?) as you note in the text there is an overlap in some region, where the temperature to daytime/radiation relation is not invertible (as you note low temperatures happen at night in spring, summer and at day in autumn/winter ... what are the dimensions in ABC.txt (I am not an active neural network practitioner ;-) – Dilettant May 31 '16 at 16:19
  • I have day, month, hour, temp, relative humidity, Wind speed etc. as my input variables. I have 8 inputs and 1 output variables. I have tried combination of different input variables but that did not made it better. – Muhammad May 31 '16 at 17:49
  • How big is your dataset and how well represented are those low values? Maybe there are just less samples with those values. – Dr. Snoopy May 31 '16 at 21:48
  • I don't think those values have less samples, they are quite well represented. I have tried with over 70000 samples. – Muhammad Jun 01 '16 at 12:00

0 Answers0