Quantcast
Channel: MATLAB Central Newsreader Recent Posts
Viewing all articles
Browse latest Browse all 19628

neural network with constrained output

$
0
0
Hi all
I am a beginner of neural networks and I am trying to train a network with these characteristics:
14 input in the input layer
30 hidden nodes in the hidden layer
5 output in the output layer

I know from the nature of the problem that the sum of the 5 outputs must be 100 (or 1) and each output value belongs to [0,100] (or [0,1]).

I have trained a lot of NN playing with training parameters but I sometime obtain negative values (the sum of the output is always near 100).

How can I constrain the output to follow the physics? Change to logsig the transfer function in the hidden layer? Change the performance function adding a penalization term (how can I do it)?

This is the essence of my very simple script (matlab R2010b)

nninput=CCTInputs; %14x661
nntarget=CCTmicroTargets; %5x661
net=feedforwardnet(30);
net=init(net);
net.trainParam.max_fail=20;
[net,tr]=train(net,nninput,nntarget);
nnoutput = net(nninput)

I have also tryed logsig function in the hidden layer adding net.layers{1}.transferFcn='logsig';
and not changing anithing else, but the performance of the network in term of predictive capabilities have worsened.

Thank you in advance
bye!

Ale

Viewing all articles
Browse latest Browse all 19628

Trending Articles