Giter Club home page Giter Club logo

cert_ogw's Introduction

Certifying Robust Graph Classification under Orthogonal Gromov-Wasserstein Threats

Preparation

  • create virtual env (restrict to python=3.7, which is compatible with CPLEX 12.10) conda create -n gdro python=3.7

  • install pytorch / pytorch-geometric conda install pytorch=1.8.0 torchvision torchaudio cudatoolkit=11.1 -c pytorch -c nvidia pip install torch-scatter torch-sparse torch-cluster torch-spline-conv -f https://pytorch-geometric.com/whl/torch-1.8.0+cu111.html pip install torch-geometric pot

  • install supplimentary libraries conda install matplotlib joblib networkx numba conda install gurobi -c gurobi pip install qpsolvers nsopy

  • install the package as develop mode python setup.py develop

  • (optional) install additional solver if available. conda install docplex cplex -c imbdecisionoptimization conda install mosek -c mosek conda install cvxopt -c conda-forge

dataset

dataset # graphs # lables # features ave. edge min edge max edge avg. node min node max node
MUTAG 188 2 7 38 20 66 17.5 10 28
PTC_MR 344 2 18 25.0 2 142 13.0 2 64
COX2 467 2 38 86.0 68 118 41.0 32 56
BZR 405 2 56 74.0 26 120 35.0 13 57

Experiments

We provided a comprehensive notebook demo.ipynb to show the idea of

  • tractable bounds of FGW
  • convex extension of FGW
  • certification and attack for task of graph classification

Other files includes:

  • demo_train.py: build the model for certificate and attack.
  • demo_spla.py: preprocess to generate the linear mapping matrix $\mathcal{A}$.
  • demo_certify.py: complete setup for experiments of robust certifications.
  • demo_attack.py: complete setup for experiments of attack.

License

The project is under MIT license.

NOTE:

scipy==1.7.3 in case the changes in source code made differences.

cert_ogw's People

Contributors

cshjin avatar

Stargazers

 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.