bias problem with trainb
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Emiliano Rosso
il 1 Lug 2016
Commentato: Emiliano Rosso
il 2 Lug 2016
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?
0 Commenti
Risposta accettata
Greg Heath
il 1 Lug 2016
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
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Define Shallow Neural Network Architectures in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!