24小时热门版块排行榜    

查看: 252  |  回复: 3
当前主题已经存档。
当前只显示满足指定条件的回帖,点击这里查看本话题的所有回帖

xuyuzhang

[交流] 【求助】神经网络设计?

我在参考书上看到的例子,想试试,可是运行不了,提示有错误,不知道怎么问题,希望大家帮帮忙……我是新手,没有金币回报,不好意思:)
=[1 2;-1 1;-2 1;-4 0];
t=[0.2 0.8 0.8 0.2];
net=newff([-1 1;-1 1],[5 1],{'logsig' 'logsig'},'traingd');
net=init(net);
net.trainParam.goal=0.001;
net.trainParam.epochs=5000;
[net,tr]=train(net,p,t);
iw1=net.IW{1}
b1=net.b{1}
iw2=net.IW{2}
b2=net.b{2}
save net51 net;


错误提示:
??? Error using ==> network.train
Inputs are incorrectly sized for network.
Matrix must have 2 rows.

Error in ==> net51 at 8
[net,tr]=train(net,p,t);
回复此楼
已阅   关注TA 给TA发消息 送TA红花 TA的回帖

xuyuzhang

谢谢,
试了一下,可以了!
4楼2009-01-09 19:00:33
已阅   关注TA 给TA发消息 送TA红花 TA的回帖
查看全部 4 个回答

xuyuzhang

不好意思,程序是这样的:
p=[1 2;-1 1;-2 1;-4 0];
t=[0.2 0.8 0.8 0.2];
net=newff([-1 1;-1 1],[5 1],{'logsig' 'logsig'},'traingd');
net=init(net);
net.trainParam.goal=0.001;
net.trainParam.epochs=5000;
[net,tr]=train(net,p,t);
iw1=net.IW{1}
b1=net.b{1}
iw2=net.IW{2}
b2=net.b{2}
save net51 net;


错误提示:
??? Error using ==> network.train
Inputs are incorrectly sized for network.
Matrix must have 2 rows.

Error in ==> net51 at 8
[net,tr]=train(net,p,t);
2楼2009-01-08 22:05:30
已阅   关注TA 给TA发消息 送TA红花 TA的回帖

hitzhang

木虫 (正式写手)

★ ★ ★ ★
woshilsh(金币+4,VIP+0):感谢您的回答和帮助,谢谢,常来!
[net,tr]=train(net,p',t);
3楼2009-01-09 18:24:32
已阅   关注TA 给TA发消息 送TA红花 TA的回帖
信息提示
请填处理意见