Change parameters of network from Deep Network Designer
이전 댓글 표시
Hi,
I haven't been able to find the answer to this question in the boards, but perhaps I'm using the wrong terminology.
I designed a 2D Unet using the Deep Network Designer so that I could get a better understanding of how everything links together and the different parameters of each layer. I did the "generate code" option so that I can easily run the .mlx file and get my network.
Now I want a different Unet that has the same structure, but a different number of filters in the final convolution layer. I can manually edit the network using the Deep Network Designer, but I'd rather do this programmatically, however I get a read only error:
This is the final convolution layer from the Deep Network Designer
>> lgraph.Layers(76)
ans =
Convolution2DLayer with properties:
Name: 'conv_19'
Hyperparameters
FilterSize: [3 3]
NumChannels: 'auto'
NumFilters: 2
Stride: [1 1]
DilationFactor: [1 1]
PaddingMode: 'same'
PaddingSize: []
PaddingValue: 0
Learnable Parameters
Weights: []
Bias: []
This is the error that I get when changing the NumFilters
>> lgraph.Layers(76).NumFilters=6
Unable to set the 'NumFilters' property of class
'Convolution2DLayer' because it is read-only.
Can anyone offer any suggestions? I feel like I'm missing a simple step.
Thank you!
채택된 답변
추가 답변 (1개)
Sina Alizad
2022년 9월 6일
0 개 추천
use this trick
1-save to a temp net
2-change props in the tmp net
3-load back and assemble the network
1)
tmp_net = lgraph.saveobj;
2)
tmp_net.Layers(2,1).Weights = w1;
tmp_net.Layers(2,1).Bias = b1;
3)
convnet = lgraph.loadobj(tmp_net);
convnet=assembleNetwork(convnet);
카테고리
도움말 센터 및 File Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!