How to add regression layer to DAG network like resnet50 for image regression problem?
조회 수: 4 (최근 30일)
이전 댓글 표시
Hi all,
Can anyone suggest me how to add regression layer to DAG network like Resnet50 at the end, for Iamge regression problem. I could able to understand how to add regression layer to series network architecure like Alexnet. How to do with DAG network architecture like Resnet50?
댓글 수: 0
채택된 답변
Deepika Ahlawat
2020년 9월 16일
Hi,
To remove the classification layer and use regression layer instread you can use the add/remove/replace APIs.
More information can be found here: https://www.mathworks.com/help/deeplearning/ref/nnet.cnn.layergraph.html?s_tid=srchtitle
The following code should resolve your issue.
net=resnet50;
net.SortedLayers;
lgraph = layerGraph(net);
newlgraph = removeLayers(lgraph,'ClassificationLayer_fc1000');
newlgraph = removeLayers(newlgraph,'fc1000_softmax');
lgraph = addLayers(newlgraph,regressionLayer('Name','out'));
lgraph = connectLayers(lgraph,'fc1000','out');
snet = assembleNetwork(lgraph);
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Image Data Workflows에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!