How to update weight of pre-trained network (Resnet50) using deep network designer

hi, i notice that when importing pretrained network using deep network designer the weights of the convolution2dLayer is fixed. Is there any ways for me to update the weight instead of replacing the whole new convolution2dLayer?
The pre-trained network convolution2dLayer
The new convolution2dLayer
Hope someone could enlighten me on this because i try to add another layer on top the original convolutional layer.

 Accepted Answer

Hi,
Deep Network Designer has no capability of editing Weights directly, this is normally done during the training process.
However it would be great to try and capture your use case, to see if we should consider adding this capability.
Can you elaborate why you'd like to manually replace one layer, and then edit the weights of the network?
Regards,
David

5 Comments

Thanks @David Willingham for the clarification. The reason is due to the error i facing when adding another new layer into the pre-trained model. Attached is the screenshot using the analyzer in Deep Network Designer for your reference. Thank you again.
It sounds like you may want to *clear the weights* on a conv layer?
If I understand this correctly:
  1. Load resnet50
  2. Duplicated one of the groups of layers, and placed it above all the other groups of layers (that duplicate is the one highlighted in the red rectangle)
That act means that the activations of the reluLayer above the conv layers with analyzer errors has a different number of output channels
That set of channels is given to the erroring-conv-layers which are expecting 64 channels *because the weights have 64 channels*. Those weights are setting the expectation of what number of channels to expect. If instead the weights were empty, those layers would no longer have any expectation as to what number of channels to expect.
If so, the solution is to delete the weights on those erroring-conv-layers so that they no longer have any expectation of what number of channels to expect.
same issue with me,
Dear, i have use the pretrained model for classification purposes (5 classes),but the accuracy of 3 classes are accurately predicted, but two classes have lower accuracy, when i tried to explore the results of these 2 classes in an other pretrained model,shows better results.. ultimately we need to combined the weights of these two pretrained models or updates the weights of 1st pretrained model of concerned two classes only...hope so, results may improve the overall accuracy by do this....
Thanks & Regards
tahir.abbas@kics.edu.pk

Sign in to comment.

More Answers (0)

Categories

Find more on Deep Learning Toolbox in Help Center and File Exchange

Products

Release

R2021a

Community Treasure Hunt

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

Start Hunting!