Weights don't initialize.
Mostra commenti meno recenti
I created the following network:
P = dataH;
T = dataXsm;
net=network;
net.numInputs = 1;
net.numLayers = 3;
net.biasConnect(1) = 1;
net.biasConnect(2) = 1;
net.biasConnect(3) = 1;
net.inputConnect = [1; 0; 0];
net.layerConnect = [0 0 0; 1 0 0; 0 1 0];
net.outputConnect = [0 0 1];
net.inputs{1}.size = 2;
net.layers{1}.size = 2;
net.layers{1}.transferFcn = 'hardlim';
net.layers{1}.initFcn = 'initnw';
net.layers{2}.size = 10;
net.layers{2}.transferFcn = 'hardlim';
net.layers{2}.initFcn = 'initnw';
net.layers{3}.size = 10;
net.layers{3}.initFcn = 'initnw';
net.layers{3}.transferFcn = 'hardlim';
net.initFcn = 'initlay';
net.IW{1,1}, net.IW{2,1},
net.LW{3,2}
net.b{1}, net.b{3}
net.trainFcn = 'trainc';
net.performFcn = 'sse';
net.adaptFcn = 'trains';
net.trainParam.goal=0.01;
net.trainParam.epochs=100;
net.trainParam.passes = 1;
net = init(net);
a = sim(net,P), e = T-a
net=train(net,P,T);
net.adaptParam.passes = 100;
[net,a,e] = adapt(net,P,T); e
twts = net.IW, tbiase = net.b
but it doesn't work, weights don't initialize and it gives all 1 as result: twts =
[2x2 double]
[]
[]
a =
1 1 1...1
...
1 1 1...1
Is something wrong with layer connection? Or do I initialize something wrong?
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Deep Learning Toolbox in Centro assistenza e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!