Effacer les filtres
Effacer les filtres

how to implement CBAM with a pretarined network in matlab. i have seen tutorials doing this on other platforms but not on matlab.

6 vues (au cours des 30 derniers jours)
%this is the code i found on GitHub but couldn't implement it
lgraph = layerGraph();
tempLayers = imageInputLayer([227 227 3],"Name","imageinput");
lgraph = addLayers(lgraph,tempLayers);
tempLayers = maxPooling2dLayer([5 5],"Name","maxpool_1","Padding","same");
lgraph = addLayers(lgraph,tempLayers);
tempLayers = averagePooling2dLayer([5 5],"Name","avgpool2d_1","Padding","same");
lgraph = addLayers(lgraph,tempLayers);
tempLayers = [
multiplicationLayer(2,"Name","multiplication_1")
fullyConnectedLayer(10,"Name","fc_1")
fullyConnectedLayer(10,"Name","fc_2")
fullyConnectedLayer(10,"Name","fc_3")
leakyReluLayer(0.01,"Name","leakyrelu_1")];
lgraph = addLayers(lgraph,tempLayers);
tempLayers = averagePooling2dLayer([5 5],"Name","avgpool2d_2","Padding","same");
lgraph = addLayers(lgraph,tempLayers);
tempLayers = maxPooling2dLayer([5 5],"Name","maxpool_2","Padding","same");
lgraph = addLayers(lgraph,tempLayers);
tempLayers = [
multiplicationLayer(2,"Name","multiplication_2")
leakyReluLayer(0.01,"Name","leakyrelu_2")
sigmoidLayer("Name","sigmoid")
yolov2OutputLayer([16 16;32 32],"Name","yolov2-out")];
lgraph = addLayers(lgraph,tempLayers);
% 清理辅助变量
clear tempLayers;
%链接所有层
lgraph = connectLayers(lgraph,"imageinput","maxpool_1");
lgraph = connectLayers(lgraph,"imageinput","avgpool2d_1");
lgraph = connectLayers(lgraph,"maxpool_1","multiplication_1/in2");
lgraph = connectLayers(lgraph,"avgpool2d_1","multiplication_1/in1");
lgraph = connectLayers(lgraph,"leakyrelu_1","avgpool2d_2");
lgraph = connectLayers(lgraph,"leakyrelu_1","maxpool_2");
lgraph = connectLayers(lgraph,"avgpool2d_2","multiplication_2/in1");
lgraph = connectLayers(lgraph,"maxpool_2","multiplication_2/in2");
0 comments on commit b93ff1d
  2 commentaires
Tian,HCong
Tian,HCong le 27 Mai 2024
Hello, have you resolved your problem now? I am also very interested in this problem.
Laraib
Laraib le 27 Mai 2024
No i was not able to resolve it. Though my fellow implemented it but using tensorflow and python. In matlab, I couldn't do it.

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Call Python from MATLAB dans Help Center et File Exchange

Produits


Version

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by