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

2 ビュー (過去 30 日間)
HK ZHOU
HK ZHOU 2023 年 9 月 21 日
回答済み: Tijue 2024 年 2 月 12 日
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 件のコメント
xingxingcui
xingxingcui 2024 年 1 月 4 日
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 2024 年 1 月 5 日
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)

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

回答 (1 件)

Tijue
Tijue 2024 年 2 月 12 日
Hello Zhou,
You can open the "visionTransformer" function and find the "re-flatten" layer at line 67.

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by