Is there a way to import only learning structures from models like Alexnet and GoogLeNet?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Jin Yong Kim
am 18 Jul. 2019
Kommentiert: Jin Yong Kim
am 29 Jul. 2019
Is there a way to get only the structures that are not being trained on models like Alexnet and GoogLeNet?
0 Kommentare
Akzeptierte Antwort
Srivardhan Gadila
am 25 Jul. 2019
Bearbeitet: Srivardhan Gadila
am 29 Jul. 2019
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 Kommentare
Srivardhan Gadila
am 29 Jul. 2019
Bearbeitet: Srivardhan Gadila
am 29 Jul. 2019
The code has been updated now to work correctly.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Image Data Workflows finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!