How to use feature input layer in transfer learning to concatenate the features with the output of fully-connected layer using MATLAB

4 ビュー (過去 30 日間)
Following the above MATHWORKS example. While performing transfer learning from vgg16, I want to add a concatenation layer with two inputs. One input will be from the last pre-trained layer of the vgg16, which is input 1 (in1) that is true. But, at input 2 (in2) I want to add the hand-crafted features (in mat file), but I cannot make it properly. Please guide me on this. I'm using featureInputLayer to get features and want to use them to concatenate with in1.
close all; clear all; clc;
% Load Pre-trained CNN Model
net = vgg16;
% Replacing the last 3 layers
TransNet = [
net.Layers(1:end-3)
% featureInputLayer(280,'Name','in2')
concatenationLayer(1,2,'Name','concat')
fullyConnectedLayer(4096, 'Name','fc8')
softmaxLayer('Name','sm')
classificationLayer('Name','classification')];
analyzeNetwork(TransNet);

回答 (0 件)

カテゴリ

Help Center および File ExchangeDeep Learning Toolbox についてさらに検索

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by