Modifying ClassNames parameter for clssificationLayer in Matlab 2017a

조회 수: 6 (최근 30일)
Andreia Lazarec
Andreia Lazarec 2022년 3월 26일
답변: Srivardhan Gadila 2022년 4월 6일
I want to construct the output classification layer for a rcnn in Matlab 2017a. When I try to use the function classificationLayer I can only modify/set the Name of the layer and no other parameters. Also, I can't access the parameters by .ClassNames because they are read only and probably can be set just during declaration.
I saw that there exist other output layers (made by Matlab) where these parameters have different values such as in:
load('rcnnStopSigns.mat','layers');
output_layer = layers(15,1);
Do you have any idea how can I change these parameters?

답변 (1개)

Srivardhan Gadila
Srivardhan Gadila 2022년 4월 6일
It is not possible to manually set or modify the ClassNames property of the classificationLayer until MATLAB version R2018a, it is automatically set by the trainNetwork function in the trained network.
But it is possible from R2018b onwards, you can specify the class names using the Classes name-value pair argument. If you want to replace the class names in the layers/layerGraph of an already trained network, then you can create new instance of the layer by specifying class names as mentioned above and replace the exisitng layer with the newly created layer.
Refer to the following documentation pages for more information:
  1. R2017a: https://mathworks.com/help/releases/R2017a/nnet/ref/classificationlayer.html
  2. R2018a: https://mathworks.com/help/releases/R2018a/nnet/ref/classificationlayer.html
  3. R2018b: https://mathworks.com/help/releases/R2018b/deeplearning/ref/classificationlayer.html
  4. Latest release: https://mathworks.com/help/deeplearning/ref/classificationlayer.html

카테고리

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

제품


릴리스

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by