MATLAB Answers

Arcface loss, sphereface loss

26 views (last 30 days)
Syed Sameed Husain
Syed Sameed Husain on 8 May 2020
Edited: cui on 13 Jan 2021
Hi
Is there any implementation of arcface loss or sphereface loss in MATLAB deep leaning toolbox?
Best Regards
Sameed

  0 Comments

Sign in to comment.

Answers (2)

Harsha Priya Daggubati
Harsha Priya Daggubati on 11 May 2020
Hi,
Currently there is no support for arcface or sphereface loss in MATLAB.

  0 Comments

Sign in to comment.


cui
cui on 21 Nov 2020
Edited: cui on 13 Jan 2021

  4 Comments

Show 1 older comment
cui
cui on 22 Nov 2020
How do you input the value format of label in the "trainNetwork" function? Can you post your code here, thank you!"Regression network" requires discrete values, I don’t know how to input.
Syed Sameed Husain
Syed Sameed Husain on 22 Nov 2020
Hi Cui
Yes we have to create our datastore for regression net. Here is the sample code
% delete old pool
poolobj=gcp('nocreate');
delete(poolobj);
%% convert net to layer graph
lgraph=layerGraph(net); clear net
%% Get database for regression problem
imds = imageDatastore('landmarks','LabelSource','foldernames','IncludeSubfolders',true);
Predictor=imds.Files;
lb=single(imds.Labels);
num_classes=size(unique(lb),1);
Y = zeros(length(lb), num_classes, 'single');
for i=1:length(lb)
Y(i,lb(i))=1;
end
responseName=Y;
T=table(Predictor,responseName);
auimds=augmentedImageDatastore([224 224 3],T,'responseName');
%% train network
miniBatchSize = 32;
options = trainingOptions('sgdm', ...
'Momentum',0.9, ...
'InitialLearnRate',1e-3, ...
'MaxEpochs',5, ...
'MiniBatchSize',miniBatchSize, ...
'ExecutionEnvironment','multi-gpu', ...
'CheckpointPath','/scratch/');
net = trainNetwork(auimds,lgraph,options);
cui
cui on 23 Nov 2020
@Syed Sameed Husain
Thank you very much for your useful code!

Sign in to comment.

Products


Release

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by