Coder Social home page Coder Social logo

Comments (4)

yuweihao avatar yuweihao commented on June 16, 2024 2

Hi @jizongFox ,

Thanks for your attention. Similar to convolution, pooling a local operator that only mixes nearby tokens, so positional embedding is not needed. I used to add positional embedding into PoolFormer-S12 and can not observe significant improvement.

For MLP, $X' = WX$, where $X'\in \mathcal{R}^{N\times C}$ and $X \in \mathcal{R}^{N\times C}$ are output and input features with token length $N$ and channel number $C$, and $W \in \mathcal{R}^{N\times N}$ are learnable parameters. Each position $i \in [0, 1, 2, 3, ..., N-1]$ has corresponding parameters $W_{i, :} \in \mathcal{R}^{1 \times N}$. Thus, the positional embedding is not needed for MLP models.

from poolformer.

jizongFox avatar jizongFox commented on June 16, 2024

Hello Yu,

I am convinced by your answer and thank you a lot. However for MLP, the network may not be able to recognize the position relationship along x and y axis if the positional embedding is not included. It can only retain a relationship for flatten vectors. Does this make any sense?

from poolformer.

yuweihao avatar yuweihao commented on June 16, 2024

Hi @jizongFox ,

In my opinion, MLP models can recoginize 2D structure by training from large amount of images. For position $i \in [0, 1, 2, ..., N-1]$ corresponding learnable parameters $W_{i, :} \in \mathcal{R}^{1\times N}$, reshape it as $M^i = \mathrm{Reshape}(W_{i, :}) \in \mathcal{R}^{H \times W}$ where $H$ is the height, $W$ is the width and $N = HW$. If we visualize the $M^i$, it can be seen that $M^i_{j, k}$ ($j = i // W$, $k=i$%$W$) and its nearby positions $M^i_{p, q}$ ($p \in [j-1, j, j+1]$, $q \in [k-1, k, k+1]$ if have) will have large scores. You can refer to the visualization examples from Figure 2 and Figure B.1 in ResMLP paper.

from poolformer.

jizongFox avatar jizongFox commented on June 16, 2024

Thank you for your reply. I will carefully read these works and reopen the issue if my question persists.

from poolformer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.