how to extract the learned features from a dlnetwork

9 ビュー (過去 30 日間)
eline
eline 2024 年 8 月 23 日
コメント済み: Umar 2024 年 8 月 25 日
I wanted to extract the feature vector of training and testing data from a dlnetwork by using the activations and forward functions, matlab show me this error with any format of training and testing data, Incorrect number or types of inputs or outputs for function activations or forward function.
featureSet = forward(net,trainData,net.Layers(181).Name,'OutputAs','columns');
featureSet = activations(net,dltrainData,net.Layers(181).Name);
is there another running instruction with another format of training and testing data
  6 件のコメント
eline
eline 2024 年 8 月 24 日
No, I am working on a network that has an arcfaceLayer with two inputs
Umar
Umar 2024 年 8 月 25 日
Hi @Elaine,
If you need any assistance with face recognition task or defining a custom layer that processes both inputs accordingly, please let us know.

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

回答 (1 件)

Matt J
Matt J 2024 年 8 月 23 日
featureSet = forward(net,trainData,'Outputs',net.Layers(181).Name);
  2 件のコメント
eline
eline 2024 年 8 月 23 日
matlab still throws this error message :
Incorrect number of network inputs. Network has 2 inputs, but 1 inputs were passed. To determine number and order of inputs, check network 'InputNames' property.
Matt J
Matt J 2024 年 8 月 23 日
編集済み: Matt J 2024 年 8 月 23 日
If your network has two inputs, the syntax is supposed to be like this,
featureSet = forward(net,In1,In2,'Outputs',net.Layers(181).Name);
where In1 and In2 are the two network inputs as dlarrays. If trainData is a datastore, you cannot give it to forward() directly. You will have to read a particular In1 and In2 from the datastore and convert them to dlarrays.

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

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by