필터 지우기
필터 지우기

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

조회 수: 3 (최근 30일)
Lin Bai
Lin Bai 2018년 2월 14일
댓글: Lin Bai 2018년 2월 14일
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?

답변 (1개)

Greg Heath
Greg Heath 2018년 2월 14일
% 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
Lin Bai
Lin Bai 2018년 2월 14일
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);

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by