Coder Social home page Coder Social logo

persistence_diagram_barycenter_python's Introduction

Persistence_Diagram_Barycenter_Python

This repository provides python classes to compute distances and a (possibly weighted) barycenter of persistence diagrams

Persistence Diagram format

A Persistence Diagram should be represented as a list of list where each inner list corresponds to a persistence pair with 2 values, its birth and its death.

Example:

diag = [[0, 10], [4, 5], [6, 8]]

Computing distance between Persistence Diagrams

This repository provides an implementation of the Auction algorithm [Bertsekas, 1981] to compute a distance between two persistence diagrams, and hence an assignment between their pairs.

Example:

from auction import Auction

diag1 = [[0, 10], [4, 5], [6, 8]]
diag2 = [[2, 12], [3, 7]]

auctionSolver = Auction()
matching = auctionSolver.runFromData(diag1, diag2)
distance = auctionSolver.getDistanceFromMatching(matching)

Computing barycenter of an ensemble of Persistence Diagrams

This repository provides an implementation of the barycenter (Fréchet means) algorithm [Turner et al., 2014] for an ensemble of persistence diagrams.

Example

from barycenter import Barycenter

diag1 = [[1, 10], [4, 7], [3, 8], [5, 6]]
diag2 = [[0, 11], [3, 8], [4, 9]]
diag3 = [[2, 15], [2, 9]]
data = [diag1, diag2, diag3]

barycenterSolver = Barycenter()
barycenter = barycenterSolver.run(data)

Computing a weighted barycenter of an ensemble of Persistence Diagrams

Example

from barycenter import Barycenter

diag1 = [[1, 10], [4, 7], [3, 8], [5, 6]]
diag2 = [[0, 11], [3, 8], [4, 9]]
diag3 = [[2, 15], [2, 9]]
data = [diag1, diag2, diag3]
weights = [1.0/7, 2.0/7, 4.0/7]

barycenterSolver = Barycenter()
barycenter = barycenterSolver.run(data, weights)

The second parameter of the run function are the weights of each input diagram, the sum of the weights should be 1.

References

[Bertsekas, 1981] D. P. Bertsekas. A new algorithm for the assignment problem. Mathematical Programming, 1981.

[Turner et al., 2014] K. Turner, Y. Mileyko, S. Mukherjee, and J. Harer. Fréchet Means for Distributions of Persistence Diagrams. DCG, 2014.

persistence_diagram_barycenter_python's People

Contributors

matpont avatar

Watchers

 avatar

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.