Giter Club home page Giter Club logo

Comments (3)

jorge-pessoa avatar jorge-pessoa commented on July 19, 2024

Hello,
Thank you for raising this point. Note that the avg_pool2d stride defaults to the kernel size (which is (2, 2)).

As far as I understand, from the original implementation of MS-SSIM:

downsample_filter = ones(2)./4;
(...)
for l = 1:level
  (...)
   filtered_im1 = imfilter(im1, downsample_filter, 'symmetric', 'same');
   filtered_im2 = imfilter(im2, downsample_filter, 'symmetric', 'same');
   clear im1, im2;
   im1 = filtered_im1(1:2:end, 1:2:end);
   im2 = filtered_im2(1:2:end, 1:2:end);

At each iteration, the image is averaged over a 2x2 window using the downsample_filter and then each odd value in width and height is kept using the range selection (every 2 values, so that no window overlaps). I believe this is the same behaviour as an avg_pool2d of kernel_size (2, 2) and stride (2, 2) as is used in the code. The tensorflow code provided seems to use the same logic as the original implementation.

Please let me know if I understood your point incorrectly or misinterpreted the original implementation. Thank you for your contribution

from pytorch-msssim.

ductm104 avatar ductm104 commented on July 19, 2024

Sorry about not read the docs carefully. I checked the pytorch documents and your implementation is correct.

from pytorch-msssim.

jorge-pessoa avatar jorge-pessoa commented on July 19, 2024

No problem. Thank you for using the library, and feel free to open other issues if you have any more questions.

Closing this issue.

from pytorch-msssim.

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.