Skip to content

Instantly share code, notes, and snippets.

@lewtun
Last active January 23, 2020 14:34
Show Gist options
  • Save lewtun/c9832f3bc98c7965c0ac76902307ffac to your computer and use it in GitHub Desktop.
Save lewtun/c9832f3bc98c7965c0ac76902307ffac to your computer and use it in GitHub Desktop.
import gtda.diagrams as diagrams
# calculate persistence diagram
persistence_diagram = ...
# define type of amplitude to calculate
amplitude = diagrams.Amplitude(metric="wasserstein")
# calculate amplitude of diagram
persistence_diagram_amplitude = amplitude.fit_transform(persistence_diagram)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment