shenjingwangluo
代码说明:
T=[1 0 0 1 0 0 1 0 0 0 1 0 0 1 0 0 1 0 0 0 1 0 0 1 0 0 1] 输入向量的最大值和最小值 threshold=[0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1] net=newff(threshold,[31 3],{ tansig , logsig }, trainlm ) 训练次数为1000,训练目标为0.01,学习速率为0.1 net.trainParam.epochs=1000 net.trainParam.goal=0.01 LP.lr=0.1 net = train(net,P,T) 测试数据,和训练数据不一致 P_test=[0.2101 0.0950 0.1298 0.1359 0.2601 0.1001 0.0753 0.0890 0.0389 0.1451 0.0128 0.1590 0.2452 0.0512 0.1319 0.2593 0.1800 0.0711 0.2801 0.1501 0.1298 0.1001 0.1891 0.2531 0.0875 0.0058 0.1803 0.0992 0.0802 0.1002 (T = [1 0 0 1 0 0 1 0 0 0 1 0 0 1 0 0 1 0 0 0 1 0 0 1 0 0 1] ' of the maximum and minimum input vector threshold = [0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1] net = newff (threshold, [31 3], {' tansig' , ' logsig' }, ' trainlm' ) training times for the 1000 target of 0.01 training, learning rate of 0.1 net.trainParam.epochs = 1000 net. trainParam.goal = 0.01 LP.lr = 0.1 net = train (net, P, T) test data, and training data inconsistencies P_test = [0.2101 0.0950 0.1298 0.1359 0.2601 0.1001 0.0753 0.0890 0.0389 0.1451 0.0128 0.1590 0.2452 0.0512 0.1319 0.2593 0.1800 0.0711 0.2801 0.1501 0.1298 0.1001 0.1891 0.2531 0.0875 0.0058 0.1803 0.0992 0.0802 0.1002 )
下载说明:请别用迅雷下载,失败请重下,重下不扣分!