Giter Site home page Giter Site logo

Comments (6)

kuynzereb avatar kuynzereb commented on June 12, 2024

SelfAttention itself also looks suspicious. If input tensor is a square (i.e., H equals W), then mode='h' and mode='w' will lead to the very same output. These two modes are used in PAA_kernel and PAA_d modules, so I guess they are expected to produce different outputs.

from inspyrenet.

Amadeus-AI avatar Amadeus-AI commented on June 12, 2024

Interesting, if you have time I suggest you can dig into https://github.com/plemeri/UACANet, which is where PAA_e and PAA_d from.

from inspyrenet.

plemeri avatar plemeri commented on June 12, 2024

Hi, thanks for paying attention to our work.
We initially tried to solve a image resolution problem for Object Contextual Representation architecture which we have been used for the attention-based segmentation decoder and thought it might be useful for the other attention operations such as PAA modules but empirically we found that it wasn't necessary. Those parameters are deprecated and no longer in use.

from inspyrenet.

kuynzereb avatar kuynzereb commented on June 12, 2024

Got it, thank you!

Though the question about mode parameter in SelfAttention still remains. It doesn’t seem correct that mode=“h” and mode=“w” produce the same results for square images. Looks like this mode parameter is used incorrectly.

Now the transformation applied to feature tensors looks like

axis = 1
if "h" in self.mode:
    axis *= height
if "w" in self.mode:
    axis *= width

view = (batch_size, -1, axis)

x = x.view(*view)

It is correct for mode="w" but seems to be incorrect for mode="h". If I understand correctly, in that case it rather should be something like

x = x.permute(0, 1, 3, 2).reshape(*view)  # view = (batch_size, -1, height)

That is, we should additionally transpose H and W dimensions.

from inspyrenet.

plemeri avatar plemeri commented on June 12, 2024

You are once again right about the problem. This was actually came from our previous work UACANet - issue #8 but we do not found any meaningful performance difference at that time, so we didn't change at that moment.

If you're trying to do a research or developing your own work, you can either change it into the right source code or just leave it as is.

from inspyrenet.

kuynzereb avatar kuynzereb commented on June 12, 2024

Ok, thanks!

from inspyrenet.

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.