急~神经网络 matlab
- 提问者网友:逝爱
- 2021-02-01 11:12
Matrix must have 4 rows.3101].lr=0;0 1],M-out)
以上的程序执行后matlab不停地指示说
?.4745 1.3277 0;
LP;
net=newff(threshold,P; sz2 at 64
net=train(net? Error using ==>,[9;
plot(1;
net?;
P_test=[0;
out=sim(net.1709 0;
net,4],P_test);
但我的P.7783 0.
Error in ==>.01,{',T),请问这是为什么呢,T).trainParam;
net=train(net;;
M=[0;}.trainParam;0 1:4;trainlm','.goal=0threshold=[0 1;0 1.train
Inputs are incorrectly sized for network.4114 0.0000 0;)
- 二级知识专家网友:转身→时光静好
- 2021-02-01 11:38
你转置看看
而且一般神经网络的输入都是列向量吧
你的输入明显是四列的行向量阿
- 1楼网友:萌萌哒小可爱
- 2021-02-01 12:46
程序有点问题,估计是原作者数据处理没贴全。先改进如下:
clc; clear all; close all; format long; clear all; p=[4949.93 5203.34 5365.04 5365.99]; t=[10977.09 10987.81 11754.32 12520.57 1180.6 1333.5 1561.8 1738.8]; tt=[3.1 3.6; 4.2 4.8; 6.7 9.1; 13 18.9; 29 226.6; 51.1 42; 78.2 79.6; 113 720.4; 169.3 194.4; 202.3 253.8]; damax=max(max(max(tt)),max(t)); damin=min(min(min(tt)),min(t)); [a,b]=size(tt); for i=1:a pp(i,:)=(tt(i,:)-damin)/(damax-damin); end tt=(t-damin)/(damax-damin); n=length(tt); threshold=[0,1;0,1]; net=newff(threshold,[3,1],{'tansig','logsig'},'trainlm'); net.trainparam.epochs=1000; net.trainparam.goal=0.001; lp.lr=0.1; pp = pp'; net=train(net,pp(:,1:n),tt); for i=1:length(pp) p_test=pp(:,i); out(i)=sim(net,p_test); pre(i)=out(i)*(damax-damin)+damin; end