Borrar filtros
Borrar filtros

is it possible to touch the weights & bias in neural network toolbox

3 visualizaciones (últimos 30 días)
Lin Bai
Lin Bai el 14 de Feb. de 2018
Comentada: Lin Bai el 14 de Feb. de 2018
i am right now using neural network toolbox. and would love to do something on weights during training, like apply the saturation function on weights. but cannot find any helpful solution could anybody give any solution for this?

Respuestas (1)

Greg Heath
Greg Heath el 14 de Feb. de 2018
% OMIT THE ENDING SEMICOLONS IN THE FOLLOWING 2 COMMANDS
net = fitnet
TRAINPARAM = net.trainParam
% You can directly modify every property listed. For example
net.trainParam.mu = 0.002;
% Now check to se if mu is changed
Hope this helps.
Thank you for formally accepting my answer
Greg
  1 comentario
Lin Bai
Lin Bai el 14 de Feb. de 2018
Thank you Greg, but this looks like how to get access to the weights/biases. My problem is to do something during training.
I used the following code to train, seems i have no access to the weights during training.
layers = [
imageInputLayer([28 28 1])
convolution2dLayer(3,16,'Padding',1)
batchNormalizationLayer
reluLayer
maxPooling2dLayer(2,'Stride',2)
convolution2dLayer(3,32,'Padding',1)
batchNormalizationLayer
*myLayer(change weight when back propagation)*
reluLayer...];
options = trainingOptions('sgdm',...
'MaxEpochs',6, ...
'ValidationData',{valImages,valLabels},...
'ValidationFrequency',30,...
'Verbose',false,...
'Plots','training-progress');
net = trainNetwork(trainImages,trainLabels,layers,options);

Iniciar sesión para comentar.

Categorías

Más información sobre Deep Learning Toolbox en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by