Coder Social home page Coder Social logo

Question on alignment.py about dcsr HOT 4 CLOSED

tengfei-wang avatar tengfei-wang commented on July 22, 2024
Question on alignment.py

from dcsr.

Comments (4)

Tengfei-Wang avatar Tengfei-Wang commented on July 22, 2024

It is for even-size kernels. Currently, the alignment only supports ever-sized kerkers. For example, when kernel size is 6, this gives a local mesh grid of [-2.5, -1.5, -0.5, 0.5, 1.5, 2.5]^2.
In this case, add (self.kernel_size-1)//2+0.5=2.5 transform the local mesh grid to 0~5. We then add it on p_0 to obtain global mesh coordinates.

from dcsr.

codeslake avatar codeslake commented on July 22, 2024

It is for even-size kernels. Currently, the alignment only supports ever-sized kerkers. For example, when kernel size is 6, this gives a local mesh grid of [-2.5, -1.5, -0.5, 0.5, 1.5, 2.5]^2. In this case, add (self.kernel_size-1)//2+0.5=2.5 transform the local mesh grid to 0~5. We then add it on p_0 to obtain global mesh coordinates.

But if you add (self.kernel_size-1)//2+0.5, the range of global mesh coordinate becomes 1~h. It lies between 0~h-1 if we add (self.kernel_size-1)//2-0.5. Isn't it the global mesh coordinate that should be in range 0~h-1?

from dcsr.

Tengfei-Wang avatar Tengfei-Wang commented on July 22, 2024

It is for even-size kernels. Currently, the alignment only supports ever-sized kerkers. For example, when kernel size is 6, this gives a local mesh grid of [-2.5, -1.5, -0.5, 0.5, 1.5, 2.5]^2. In this case, add (self.kernel_size-1)//2+0.5=2.5 transform the local mesh grid to 0~5. We then add it on p_0 to obtain global mesh coordinates.

But if you add (self.kernel_size-1)//2+0.5, the range of global mesh coordinate becomes 1h. It lies between 0h if we add (self.kernel_size-1)//2-0.5. Isn't it the global mesh coordinate that should be in range 0~h-1?

Yes, or you may also modify the range of p_0 to [0, h-1].

from dcsr.

codeslake avatar codeslake commented on July 22, 2024

Ok, Thanks for the answer!

from dcsr.

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.