关于#神经网络#的问题,如何解决?

错误使用 network/subsasgn>network_subsasgn (line 555)
"trainFcn" cannot be set to non-existing function "(traingdx".

出错 network/subsasgn (line 14)
net = network_subsasgn(net,subscripts,v,netname);

出错 newff>new_5p1 (line 219)
net.trainfcn = btf;

出错 newff>create_network (line 129)
net = new_5p1(varargin{:});

出错 newff (line 101)
out1 = create_network(varargin{:});的问题
明天就要交论文了
我的代码如下,应该很简单

P=[0 0 0 0 0 0 0;
-0.698 -0.389 -0.818 1.182 -0.225 -0.978 -0.898;
-0.438 -0.232 -0.517 0.503 -0.163 -0.512 -0.543;
0.364 0.221 0.465 0.901 1.038 0.447 0.343;
0.138 0.087 0.168 0.291 0.376 0.185 0.145;
-0.213 -0.135 -0.233 0.445 -0.155 -0.378 -0.356;
-0.047 -0.032 -0.051 0.210 -0.012 -0.121 -0.143;
-0.323 -0.337 -0.245 0.385 -0.321 -0.276 -0.5323;
-0.086 -0.238 -0.087 -0.187 -0.156 -0.098 -0.217];
T=[0 0 0 0;
1 0 0 0;
0.5 0 0 0;
0 1 0 0;
0 0.5 0 0;
0 0 1 0;
0 0 0.5 0;
0 0 0 1;
0 0 0 0.5];
[R,S1]=size(P);
[Q,S2]=size(T);
P=P';
T=T';
t0=clock;
net=newff(minmax(P),[S1 S2],{'logsig','logsig'},'(traingdx');
net.LW{2,1}=net.LW{2,1}*0.01;
net.b{2}=net.b{2}*0.01;
net.performFcn='sse';
net.trainParam.goal=0.003; 
net.trainParam.show=20; 
net.trainParam.epochs=10000; 
net.trainParam.me=0.95;
[net,tr]=train(net,P,T);
y=sim(net,P);
etime(clock,t0);
timeBP=ans;

figure;
t0=clock;
disp_freq=0.5;
max_neuron=50;
err_goal=0.003;
spread=1;
dp=[disp_freq max_neuron err_goal spread];
[w1,b1,w2,b2,nr,dr]=solverb(P,T,dp);
etime(clock,t0);
timeRBF=ans;
U=[-0.698 -0.389 -0.818 1.182 -0.225 -0.978 -0.898];
[a1,a2]=simurb(U',w1,b1,w2,b2);
save a1 a2 b1 b2 111"dr timeBP timeRBF

看起来你的代码中在第 15 行出现了错误。你应该提供一个字符串形式的训练函数名称,而不是一个含有括号的表达式,因此应该将 "(traingdx" 改为 "traingdx"。改正后的代码应该是这样的:

net=newff(minmax(P),[S1 S2],{'logsig','logsig'},'traingdx');

希望这能帮到你。如果你还有其他问题,欢迎继续讨论。

P=[0 0 0 0 0 0 0;
-0.698 -0.389 -0.818 1.182 -0.225 -0.978 -0.898;
-0.438 -0.232 -0.517 0.503 -0.163 -0.512 -0.543;
0.364 0.221 0.465 0.901 1.038 0.447 0.343;
0.138 0.087 0.168 0.291 0.376 0.185 0.145;
-0.213 -0.135 -0.233 0.445 -0.155 -0.378 -0.356;
-0.047 -0.032 -0.051 0.210 -0.012 -0.121 -0.143;
-0.323 -0.337 -0.245 0.385 -0.321 -0.276 -0.5323;
-0.086 -0.238 -0.087 -0.187 -0.156 -0.098 -0.217];
T=[0 0 0 0;
1 0 0 0;
0.5 0 0 0;0 1 0 0;
0 0.5 0 0;
0 0 1 0;
0 0 0.5 0;
0 0 0 1;
0 0 0 0.5];
[R,S1]=size(P);
[Q,S2]=size(T);
P=P';
T=T';
t0=clock;
net=newff(minmax(P),[S1 S2],{'logsig','logsig'},'traingdx');
net.LW{2,1}=net.LW{2,1}*0.01;
net.b{2}=net.b{2}*0.01;
net.performFcn='sse';
net.trainParam.goal=0.003;
net.trainParam.show=20;
net.trainParam.epochs=10000;
net.trainParam.me=0.95;[net,tr]=train(net,P,T);
y=sim(net,P);
etime(clock,t0);
timeBP=ans;
figure;
t0=clock;
disp_freq=0.5;
max_neuron=50;
err_goal=0.003;
spread=1;
dp=[disp_freq max_neuron err_goal spread];
[w1,b1,w2,b2,nr,dr]=solverb(P,T,dp);
etime(clock,t0);
timeRBF=ans;
U=[-0.698 -0.389 -0.818 1.182-0.225 -0.978 -0.898];
[a1,a2]=simurb(U',w1,b1,w2,b2);
save a1 a2 b1 b2 dr timeBP timeRBF

net=newff(minmax(P),[S1 S2],{'logsig','logsig'},'(traingdx');

这行中的 '(traingdx' 多了一个括号 (