Is there a way to import only learning structures from models like Alexnet and GoogLeNet?

조회 수: 1 (최근 30일)
Is there a way to get only the structures that are not being trained on models like Alexnet and GoogLeNet?

채택된 답변

Srivardhan Gadila
Srivardhan Gadila 2019년 7월 25일
편집: Srivardhan Gadila 2019년 7월 29일
You can import the architecture of the pretrained models to MATLAB without weights for the keras, caffe and ONNX networks. You can refer to importCaffeLayers, importKerasLayers, importONNXLayers.
For the pretrained network in MATLAB we’ll get both the Layers and the trained Weights. You can remove the weights if required as follows,
net = alexnet;
layers = net.Layers;
layers(2).Weights=[];
You can also use the isprop function to check whether the property Weights or any other related trainable property exists for a layer so that you can remove them.
if isprop(layers(2),'Weights') == true
layers(2).Weights = [];
end
  댓글 수: 3
Srivardhan Gadila
Srivardhan Gadila 2019년 7월 29일
편집: Srivardhan Gadila 2019년 7월 29일
The code has been updated now to work correctly.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Image Data Workflows에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by