Question about neural network weights/biases initialization

2 visualizaciones (últimos 30 días)
Natalia Genaro
Natalia Genaro el 21 de Abr. de 2011
Editada: Greg Heath el 12 de Jun. de 2014
Hi,
I'm creating a feedforward backpropagation network this way:
net = fitnet(7);
Then I set some parameters:
net.inputs{1}.processFcns = {'removeconstantrows','mapminmax'};
net.outputs{2}.processFcns = {'removeconstantrows','mapminmax'};
net.divideFcn = 'random'; % Divide data randomly
net.divideMode = 'sample'; % Divide up every sample
net.divideParam.trainRatio = 185/289;
net.divideParam.valRatio = 35/289;
net.divideParam.testRatio = 69/289;
net.initFcn = 'initlay';
net.layers{1}.initFcn = 'initnw';
net.layers{2}.initFcn = 'initnw';
net.inputWeights{1,1}.initFcn = 'rands';
net.layerWeights{1,1}.initFcn = 'rands';
net.biases{1,1}.initFcn = 'rands';
net.trainFcn = 'trainlm'; % Levenberg-Marquardt
net.performFcn = 'mse'; % Mean squared error
After that, I initialite the network as follows:
net=init(net);
And when I want to access the weights and biases matrix:
net.IW{1,1}
net.LW{1,1}
net.b{1,1}
I just get the following answer:
Empty matrix: 7-by-0
I don't want to start training the net with all the weights set to zero. They should be random values, shouldn't they? How can I get them set to random values? Didn't I already do it when setting
net.inputWeights{1,1}.initFcn = 'rands'?
Thank you in advance

Respuesta aceptada

Greg Heath
Greg Heath el 9 de Jun. de 2014
Editada: Greg Heath el 12 de Jun. de 2014
net = configure(net,inputs,targets);
help configure
doc configure
Hope this helps.
Greg

Más respuestas (0)

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by