Git Product home page Git Product logo

Comments (5)

Hind-M avatar Hind-M commented on May 18, 2024

Is this bug still relevant ? Is it related to the mathematics involved (bad formula) or something else ?

from gudhi-devel.

mglisse avatar mglisse commented on May 18, 2024

Yes, I don't believe the bug was fixed.

There are strange things about the formula. Computing sqrt then immediately squaring it back, the normalization factor 1/(pi*sigma²) (useless since there is a renormalization right after) doesn't match the usual 1/(sigma*sqrt(2pi)), it looks closer to its square but not quite either.

There are contradictory comments and I am not sure what is intended. From this comment

// we are computing the kernel mask to 2 standard deviations away from the center. We discretize it in a grid of a
// size 2pixel_radius times 2pixel_radius.

it seems that pixel_radius is maybe also supposed to be used as the standard deviation of the Gaussian, up to some constant factor, in which case we should remove the confusing and useless second argument, document that, and check that the formula is consistent. Or if sigma is meant to be used, then we should fix the formula.

Paweł never commented on this, maybe @MathieuCarriere would have some idea there.

from gudhi-devel.

MathieuCarriere avatar MathieuCarriere commented on May 18, 2024

Sorry for the late comment.
I did not use this code a lot, but I seem to remember that pixel_radius was indeed the equivalent of sigma, while the actual sigma parameter is not really used. Moreover, I think there is some sort of approximation there: the kernel is rounded to 0 with a mask outside of pixel_radius (probably for faster computations), whereas the exact formula requires integration of the kernel on each pixel.

from gudhi-devel.

MathieuCarriere avatar MathieuCarriere commented on May 18, 2024

Mentioning this also reminds me that in our current Python version (in gudhi.representations), we also do an approximation by assuming that the kernel is constant on each pixel (also for faster computations).

from gudhi-devel.

MathieuCarriere avatar MathieuCarriere commented on May 18, 2024

Generally speaking, it would be nice to include such exact versions in Python (when there is no approximation going on).

from gudhi-devel.

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.