Git Product home page Git Product logo

dsc291-final-project's Introduction

Final Project for DSC 291: Geometry of Data

Log-Euclidean Signatures for Intrinsic Distances Between Unaligned Datasets

Python implementation of the LES distance and examples from the paper. LES is an intrinsic geometric measure for comparing unaligned datasets of different dimensions and domains.

LESdistance

Prerequisites

  • Numpy
  • SciPy
  • Matplotlib
  • Optional packages for clustered data usage example: scikit-learn
  • Optional packages and repositories for comparisons with other algorithms:
    • IMD [1] - clone and place the msid folder in the current folder.
    • TDA: H0, H1 and H2 bottleneck distances, requires persim , ripser.
    • GS [2] - clone and place the gs folder in the current folder.
      Requires GUDHI and Cython.
    • GW [3] - requires pot.

The code was tested with python 3.8 and 3.9

Usage example of LES

Distances between multi-cluster and single-cluster datasets of different dimensions

import numpy as np
import sklearn.datasets as skld
from les.les import les_desc_comp, les_dist_comp
   
np.random.seed(1)
x1 = skld.make_blobs(n_samples=1000, centers=5, n_features=10)[0]
x2 = skld.make_blobs(n_samples=1000, centers=5, n_features=9)[0]
x3 = skld.make_blobs(n_samples=1000, centers=1, n_features=10)[0]
  
SIGMA, NEV, GAMMA = 2, 200, 1e-8     
les_desc_x1 = les_desc_comp(x1, SIGMA, NEV, GAMMA)
les_desc_x2 = les_desc_comp(x2, SIGMA, NEV, GAMMA)
les_desc_x3 = les_desc_comp(x3, SIGMA, NEV, GAMMA)
    
print('LES(x1{5 clusters}, x2{5 clusters})=',les_dist_comp(les_desc_x1, les_desc_x2))
print('LES(x1{5 clusters}, x3{1 cluster})=',les_dist_comp(les_desc_x1, les_desc_x3))
print('LES(x2{5 clusters}, x3{1 cluster})=',les_dist_comp(les_desc_x2, les_desc_x3))

Running the tori example (Figure 1 in the paper)

python les/main_tori.py

By default the code compares LES only with our implementation of IMD (our approach) to reduce run-time and code dependencies. To compare with additional algorithms that were mentioned in the paper, specify the algorithm names in main_tori.py, ALGS2COMPARE, and follow the installation instructions of each package in the prequisites above. Note that the topological data analysis methods (tda) and Gromov-Wasserstein distance (gw) require significantly longer run-times.

References

[1] Tsitsulin et al., "The Shape of Data: Intrinsic Distance for Data Distributions", ICLR, 2019.
[2] Khrulkov and Oseledets, "Geometry score: A method for comparing generative adversarial networks", ICML, 2018.
[3] Peyré et al., "Gromov-Wasserstein averaging of kernel and distance matrices", ICML, 2016.

dsc291-final-project's People

Contributors

d-laub avatar aaprasad 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.