Feedforwardnet for XOR problem with logsig transfer function
Mostra commenti meno recenti
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).
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Pattern Recognition in Centro assistenza e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!