Coder Social home page Coder Social logo

copt's Introduction

COPT: Coordinated Optimal Transport for Graph Sketching

COPT is a novel distance metric between graphs defined via an optimization routine, computing a coordinated pair of optimal transport maps simultaneously. This is an unsupervised way to learn general-purpose graph representations, it can be used for both graph sketching and graph comparison.

For a sample run script, please see demo.py. For instance, to sketch a sample graph with 400 training steps and with fixed seed we can run:

python demo.py --seed --n_epochs 400

There are many other options to allow easy custom tuning. To see all command line options, see utils.py[utils.py] or run:

python demo.py --h

For instance, one can run COPT with:

python searchGraph.py --hike --hike_interval 15 python searchGraph.py --hike --hike_interval 15 --grid_search --seed --compress_fac 4

graph.py contains core COPT routines for applications such as graph sketching and comparison. runGraph.py, searchGraph.py, etc contain various applications for COPT.

There is a data directory used by the scripts to write data to. There is some generated sample data provided. Furthermore, if one wishes to generate graph data for other named datasets, one can run the generateData.py script with the dataset name such as:;

python generateData.py --dataset_type real --dataset_name BZR

A corresponding lap.pt data file will be created.

Dependencies

PyTorch 1.1+ numpy networkx netlsd grakel

To install PyTorch, please follow these simple OS-specific instructions.

The other packages can be installed via pip, e.g. python -m pip install numpy networkx grakel netlsd. Or by running

pip install -r requirements.txt

Depending on the functionalities one wishes to run, additional dependencies include: Gromov Wasserstein by Vayer et al, can be placed as "gromov" in directory above this one.

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.