t-sne visualization of Vision transformer
16 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
How to visualize the features of the vision transfomer after training using t-sne visualizion?
example of vision transformer: https://se.mathworks.com/help/deeplearning/ug/train-vision-transformer-network-for-image-classification.html
and t-sne visualization of CNN: https://se.mathworks.com/help/deeplearning/ug/view-network-behavior-using-tsne.html
I could not apply the same in vision transformer beacuse there are an error during using actication function as follows:
earlyLayerName = "'encoderblock1_mha1";
pool1Activations = activations(net,...
augimdsTrain,earlyLayerName,"OutputAs","rows");
0 Kommentare
Antworten (1)
Garmit Pant
am 5 Mär. 2024
From what I gather, you are following the MATLAB examples “Train Vision Transformer Network for Image Classification” and “View Network Behavior Using tsne” to visualise the results of the network activations of a trained vision transformer. You are encountering an error in the process.
The line of code where you are encountering the error is trying to refer to a non-existent layer, assuming you are using the MATLAB default implementation of the “visionTransformer” network. By analysing the network, we can see the layer is named “encoderblock1_mha” and not “encoderblock1_mha1”. Unless you have renamed and replaced the layer, passing the correct layer name shall eliminate the result.
I hope you find the above explanation and suggestions useful!
3 Kommentare
Garmit Pant
am 8 Mär. 2024
Hi Mahmoud
Are you using the same data as mentioned and included in the examples?
Siehe auch
Kategorien
Mehr zu Image Data Workflows finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!