bias problem with trainb

조회 수: 3 (최근 30일)
Emiliano Rosso
Emiliano Rosso 2016년 7월 1일
댓글: Emiliano Rosso 2016년 7월 2일
I need to train a supervised neural network to linearly separate a set of inputs with logical output 0,1 in batch training. My inputs is inputstemp2 (100,2000) of double precision & target is dividetargets(2,2000) of double 0 & 1. My code is :
mynet=perceptron;
mynet.trainFcn= 'trainb';
mynet.inputWeights.learnFcn='learnp'; %default
mynet.biases.learnFcn= 'learnp'; %default
mynet.biasConnect =[1];
mynet.outputs{1}.processFcns = {};
mynet.inputs{1}.processFcns = {'mapstd','processpca'};
mynet.divideFcn = 'divideblock';
mynet.divideParam.trainRatio = 80/100;
mynet.divideParam.valRatio = 10/100;
mynet.divideParam.testRatio =10/100;
mynet.trainParam.showWindow = false;
mynet.trainParam.showCommandLine = false;
mynet.trainParam.epochs=500;
mynet.efficiency.memoryReduction=1;
[mynet,tr]=train(mynet,inputstemp2,dividetargets);
No problem if mynet.biasConnect =[0] but if I set mynet.biasConnect =[1] Matlab return:
Error using *
Inner matrix dimensions must agree.
Error in learnp>apply (line 93)
dw = e*p';
Error in trainb>train_network (line 231)
[db,BLS{i}] = learnFcn.apply(net.b{i}, ...
Error in trainb (line 55)
[out1,out2] = train_network(varargin{2:end});
ecc.... The same if I use linearlayer and harlim. Somebody can explain me why bias is not accepted?

채택된 답변

Greg Heath
Greg Heath 2016년 7월 1일
Just use the current (i.e., non-obsolete) classifier
net = patternnet([]); % [] => No hidden layer for linear model
For documentation
help patternnet
doc patternnet
Hope this helps.
Thank you for formally accepting my answer
Greg
  댓글 수: 1
Emiliano Rosso
Emiliano Rosso 2016년 7월 2일
Solved & best convergence.
Thanks.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

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