Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default weighting function normalization #40

Open
aywagner opened this issue Aug 14, 2020 · 0 comments
Open

Default weighting function normalization #40

aywagner opened this issue Aug 14, 2020 · 0 comments

Comments

@aywagner
Copy link

The default linear weighting function is being normalized per diagram rather than being fixed or normalized per experiment. As a consequence, the norm of a persistence image corresponding to a diagram with one point very close to the diagonal is not close to zero.

persim/persim/images.py

Lines 151 to 160 in 76b2b5a

if landscape is not None:
if len(landscape) > 0:
maxy = np.max(landscape[:, 1])
else:
maxy = 1
def linear(interval):
# linear function of y such that f(0) = 0 and f(max(y)) = 1
d = interval[1]
return (1 / maxy) * d if landscape is not None else d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant