Skip to content

Bispectrum: Bugs and improved implementation in spatialstats #234

@e-koch

Description

@e-koch

@mjo22 has put together improved + much faster CPU/GPU implementations for calculating the bispectrum in https://github.com/mjo22/spatialstats/.

  • Add spatialstats as an optional dependency and expose the option to use the improved implementations in Bispectrum
  • Ensure the implementations give a common result on the unit test data (depends on bug fixes in TurbuStat, see below).

Michael also caught minor bugs in the turbustat implementations that should be fixed and enable all 3 implementations to return the same answer:

  • Fix bispectral amplitudes by normalizing by the number of samples
  • k1+k2=k3 needs to be bounded such that k3 remains in the region sampled by the image. Current samples "roll-over" using negative indices, but these should instead be thrown out or the sampling should be changed to avoid sampling outside the accepted range.

Neither of these bugs significantly changes the TurbuStat output for its current uses. For example, bispectra are compared using the same number of samples, so the normalization will not affect the difference between the two.

@mjo22, let me know if there are any important points I've missed! Or if you want to clarify anywhere. Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions