Why doesn't concatLayer in Deep Learning Toolbox concatenate the 'T' dimension?
Show older comments
Hello,
While implementing a ViT transformer in Matlab, I found at that the concatLayer does not concatenate over the T dimension. This is needed to concatenate the class token with patch tokens, since the natural representation is CBT with C corresponding to features, B to batch and T to token within a batch (this is also the canonical representation in the attention function).
It's possible to work around this by hacking to e.g. SCB, but then other problems pop up which also need to be hacked around.
Thx
Accepted Answer
More Answers (0)
Categories
Find more on Operations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!