フィルターのクリア

How to add regression layer to DAG network like resnet50 for image regression problem?

5 ビュー (過去 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?

採用された回答

Deepika Ahlawat
Deepika Ahlawat 2020 年 9 月 16 日
Hi,
To remove the classification layer and use regression layer instread you can use the add/remove/replace APIs.
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);
  1 件のコメント
Dhanaraj Nelapati
Dhanaraj Nelapati 2020 年 9 月 25 日
Hi Deepika,
Thank you for your answer, I could able to solve the problem with your insights. Thank you once again.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeImage Data Workflows についてさらに検索

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by