Feedforwardnet for XOR problem with logsig transfer function
显示 更早的评论
Hi, I want learn feed forward net for my classification problem. But network doesn't learn anything useful, so I start checking network setting.
I choose xor problem. I find that network doesn't learn xor if the output transfer function is set to logsig! Sample code:
x = [0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1; 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1];
y =[0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0];
net = feedforwardnet([2 2]);
net = configure(net,x,y);
net.layers{3}.transferFcn = 'logsig';
[net,tr] = train(net,x,y);
net(x)
The outputs are: 0.5000 0.5000 0.9985 0.5000 0.5000 0.5000 0.9985 0.5000 0.5000 0.5000 0.9985 0.5000 0.5000 0.5000 0.9985 0.5000
I try few times and I never got any value smaller then 0.5. If I comment 6th line setting transfer function to logsig the net learn perfect.
Does anyone know why network with logsig doesn't work?
P.S My matlab version MATLAB 7.12.0 (R2011a).
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Pattern Recognition 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!