Did you try other training methods? I saw in other answer that it helped, because of a bug in library.
Available methods:
train_gd, train_gdm, train_gda, train_gdx, train_rprop, train_bfgs (DEFAULT), train_cg
You can change it by calling:
net.trainf = nl.train.train_gd
If you could provide input data (even with changed values) it would be great.
I tried calling train method for input in form: [0,1,2,3...18,19] and it failed - I had to change input (and target) to [[0],[1],...[18],[19]]
EDIT:
Your data is in wrong format, you should transform it to list of lists. I don't have scipy on my machine, but try this:
import numpy as np
import neurolab as nl
input_data = np.fromfile('BCICIV1bAF3.dat' ,dtype=float)
transformed_input_data = [[x] for x in input_data] # added
print(len(transformed_input_data)) # changed
net = nl.net.newff([[-215.1, -10.5]], [20, 1])
error = net.train(transformed_input_data, transformed_input_data, epochs=500) # changed
EDIT 2:
I won't explain what neural network is (I didn't use them in quite a while), but it should look like this when we want to transform 3D input into 2D output with use of 1 hidden layer:
INPUT [3D] | HIDDEN LAYER | OUTPUT [2D]
----
| H1 |
----
----
| X1 |
----
---- ----
| H2 | | Y1 |
---- ----
----
| X2 |
----
---- ----
| H3 | | Y2 |
---- ----
----
| X3 |
----
----
| H4 |
----
Every X is multiplied by every H and we calculate output. How do we have those H values? They're computed by algorithms during training of neural network. We specify how many hidden layers we want and by trial and error arrive at satisfactory solution. Very important - we should use different data to train and to check ouput of neural network.
When could we use this particular network? E.g. when calculating how many Big Macs and fries people order at McDonald based on age, salary of client and placement of particular restaurant. It would look like this:
-----
| AGE |
-----
---- ----------
| H2 | | BIG MACS |
---- ----------
--------
| SALARY |
--------
---- -----------
| H3 | | FRIES |
---- -----------
-------
| PLACE |
-------
----
| H4 |
----
So we could say that transformation looks like this f([Age, Salary, Place]) = [Big Macs, Fries].
We may have millions of input and output data records gathered by employees to train our network, so translating into python it would be list of inputs (3D) and we expect list of outputs (2D). E.g. f([[A_1, S_1, P_1], [A_2, S_2, P_2], ... , [A_N, S_N, P_N]]) -> [[BM_1, F_1], [BM_2, F_2], ... , [BM_N, F_N]]
We want same thing with your data, BUT we want to have both input and output to be 1D, hence we had to "wrap" every element of a list into another list. Same thing with output AND simulation input - you forgot that.
predicted_output = net.sim(input_data) # this won't work! You should wrap it
But testing neural network on training data is just wrong - you shouldn't do that