我有一个 包含数据的文件BCICIV1bAF3.dat 。文件大小为20x1
这是我的代码...
在 newff 函数中,我根据最小值/最大值决定范围,但我不知道如何决定其他参数。我想要多少隐藏层等。
import numpy as np
import neurolab as nl
input_data = np.fromfile('BCICIV1bAF3.dat' ,dtype=float)
print(len(input_data))
transformed_input_data = [[x] for x in input_data] # added
print(len(transformed_input_data))
output_data = np.fromfile('test.dat',dtype=float)
transformed_output_data = [[x] for x in output_data] # added
net = nl.net.newff([[-21, -10.5]], [1020, 1])
error = net.train(transformed_input_data, transformed_output_data)
predicted_output = net.sim(input_data)
输入数据:
-10.5 -91.7 -219.8 -227 -190.8 -218.7 -208.2 -205 -214.3 -202 -211.5 -211.1 -208.2 -212.4 -206 -206.7 -211.5 -210.7 -212 -215.1
输出数据:
-5.2 -45.6 -108.6 -112 -94.5 -106.7 -99.6 -98.5 -105.4 -101.2 -106.4 -106.5 -102.4 -105.7 -104 -97.9 -99.5 -101.3 -100.6 -103.7
错误:
Traceback (most recent call last):
File "NNwork2.py", line 15, in <module>
error = net.train(transformed_input_data, transformed_output_data)
File "C:\Python34\lib\site-packages\neurolab\core.py", line 328, in __call__
assert target.shape[0] == input.shape[0]
AssertionError
我该如何训练?并模拟 input_data?
如果有人可以指导...我将非常感激。谢谢