Programmatically determine which Deep Learning layer properties contain learnables
이전 댓글 표시
In the Deep Learning Toolbox, there are a variety of layer object types. The display methods of these objects indicate which object properties contain learnable parameter data. For example, for LSTMLayer objects, the learnable parameters are stored in the properties "InputWeights", "RecurrentWeights", and "Bias" as shown below. My question is, is there a way, given a layer object, to programmatically determine the subset of its properties that are learnable?
layer = lstmLayer(100,'Name','lstm1')
채택된 답변
추가 답변 (1개)
Let's define the a network
layers = [sequenceInputLayer(32, 'Name', 'input')
lstmLayer(128, 'OutputMode', 'sequence', 'Name', 'lstm')]
since each layer is a nnet.cnn.layer type object, one can determine
you can determine the object type using class() command.
For example,
layerType = class(layers(2))
And then you can search for a match in that class for the type you are looking for
For example
contains(class(layers(2)),'lstm','IgnoreCase',true)
you can check for specific parameters like RecurrentWeights once you identify its an LSTM, or a GRU layer..
카테고리
도움말 센터 및 File Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!