Skip to content

Clarification on the weight parameter in PersistenceImage #1238

@caki35

Description

@caki35

First of all, thank you for providing this excellent library — it has been very useful in my work.

I am a bit confused about the role of the weight parameter in the PersistenceImage constructor.

According to the documentation:

“weight (function) – weight function for the persistence diagram points (default constant function, i.e. lambda x: 1). This function must be defined on 2D points, i.e. lists or numpy arrays of the form [p_x, p_y].”

From this, I understood that the input points are given as (birth, death), so a natural choice for weighting by persistence would be weight = lambda x: x[1] - x[0].

However, in the tutorial it is stated:

“A persistence image is obtained by rotating by -π/4, centering Gaussian functions on all diagram points (usually weighted by a parameter function — here we consider the squared distance to the diagonal) and summing all these Gaussians.”

In that example, the weight function is weight = lambda x: x[1]**2, which seems to imply that x[1] corresponds to the vertical axis after rotation (i.e., persistence) rather than the raw death coordinate from the input diagram.

Could you clarify this apparent inconsistency? Specifically: Does the weight function receive points in (birth, death) or in (birth, persistence) form?

Thank you for your time.

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