Filter löschen
Filter löschen

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

3 Ansichten (letzte 30 Tage)
Lin Bai
Lin Bai am 14 Feb. 2018
Kommentiert: Lin Bai am 14 Feb. 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?

Antworten (1)

Greg Heath
Greg Heath am 14 Feb. 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 Kommentar
Lin Bai
Lin Bai am 14 Feb. 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);

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Deep Learning Toolbox finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by