Feedforwardnet for XOR problem with logsig transfer function
Mostrar comentarios más antiguos
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).
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Pattern Recognition en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!