Purpose and implementation of 're-flatten' Layer in Vision Transformer

1 vue (au cours des 30 derniers jours)
HK ZHOU
HK ZHOU le 21 Sep 2023
Réponse apportée : Tijue le 12 Fév 2024
In MATLAB 2023b's Computer Vision Toolbox, there is a pre-trained vision Transformer model that includes patch embedding and re-flatten layers. What is the purpose of the re-flatten layer? Additionally, it seems that there is no "re-flatten" function in the Deep Learning Toolbox. Do I need to write this function myself?
  2 commentaires
xingxingcui
xingxingcui le 4 Jan 2024
I only see patch embedding layer,flatten layer,can't find re-flaten layers in MATLAB 2023b,can you post the re-flaten layer link?
HK ZHOU
HK ZHOU le 5 Jan 2024
Thanks for your comment.
After executing the following codes, in the NetworkAnalyzer, the 're-flatten' function is visible, but cannot find the source code.
net = visionTransformer;
analyzeNetwork(net)

Connectez-vous pour commenter.

Réponses (1)

Tijue
Tijue le 12 Fév 2024
Hello Zhou,
You can open the "visionTransformer" function and find the "re-flatten" layer at line 67.

Catégories

En savoir plus sur Deep Learning Toolbox dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by