フィルターのクリア

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

1 回表示 (過去 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 Center および File ExchangeDeep Learning Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by