Neural Network Transfer Function

조회 수: 70 (최근 30일)
James He
James He 2017년 2월 7일
편집: Greg Heath 2018년 2월 18일
Hi friends,
I was using neural network to train a set of sensing data. The transfer function is designed to be 'logsig'. The input is a n*4 matrix values between 0 to 3, output is a n*3 matrix values between 0 to 10.
The training process is normal. But after we have the resultant network, when applying, output values are no less than 5 which is the average of my target output. That is to say, for all values supposed to be lower than 5, it returns 5.
Code will be the following: net1=feedforwardnet([80,80]); net1.trainParam.max_fail=10; net1.layers{3}.transferFcn='logsig'; net1.layers{1}.transferFcn='logsig'; net1.layers{2}.transferFcn='logsig'; net1=train(net1,transpose(det),transpose(pos));
Thank you all in advance.
Yichang

답변 (2개)

Greg Heath
Greg Heath 2018년 2월 18일
편집: Greg Heath 2018년 2월 18일
There is no good reason to differ from the default
help fitnet % Form of feedforwardnet for regression & curvefitting)
doc fitnet
given matrix sizes
[ I N ] = size(input) % [ 4 N ]
[ O N ] = size(target) % [ 3 N ]
Default number of training equations
Ntrneq = 0.7*N*O = 2.1*N
and number of unknown weights for a single hidden layer with H nodes yielding Nw unknown weights and biases
Nw = (I+1)*H+(H+1)*O = (4+1+3)*H + 3 = 8*H+3
For more training equations than unknowns
Ntrneq >= Nw
or
H <= (Ntrneq -O) /( I + O +1)=(2.1*N-3)/8
Therefore, the default value of H = 10 can be used if
N >= 40 .
Hope this helps.
Thank you for formally accepting my answer
Greg

Akshay Joshi
Akshay Joshi 2018년 2월 16일
편집: Akshay Joshi 2018년 2월 16일
Try the following:
net1.layers{1}.transferFcn='logsig';
net1.layers{2}.transferFcn='logsig';
net1.layers{3}.transferFcn='purelin'
In many cases, using non-linear function for classification at hidden layer, and then using linear function at output layer yields a proper, classified output data.

카테고리

Help CenterFile Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by