一般来说,拿到数据都要做预处理,包括之前提到的去均值和方差归一化。构造的数据幅度保持在-1到1之间,否则会不收敛。
It need because default activation function TanSig must generate output in
range [-1, 1]
I recommend you scalable input data too, for get better train process
缩放方法:
target = [[1.,2.,3.,4.,4.], [2.,4.,6.,5.,1.]]
normf = nl.tool.Norm(target)
norm_target = normf(target)
# restore net output:
print normf.renorm(norm_target)