Code Monkey home page Code Monkey logo

partial-gw-for-pu's Introduction

Partial Gromov-Wasserstein with applications on Positive-Unlabeled Learning

This code is an attempt to help reproduce results from the paper "Partial Gromov-Wasserstein with applications on Positive-Unlabeled Learning" https://arxiv.org/abs/2002.08276.

Pre-requisites

This code is Python3 code and relies on the following libraries:

pot
math
numpy
pandas
matplotlib
sklearn
torch
torchvision
scipy
numba
geoopt
torch
mpl_toolkits
time
IPython

Dependencies can be installed via:

pip install -r requirements.txt

(maybe the torch dependency will raise an error and an alternative install method will be prompted).

Available scripts

For figures 1 to 3, notebook that generate the figures is provided.

For tables 1 & 2, notebook that generate the performances relative to the partial-W and partial-GW results is provided. The results regarding competitors have been obtained using the following github repository https://github.com/MasaKat0/PUlearning from the paper

Masahiro Kato, Takeshi Teshima, Junya Honda 
Learning from Positive and Unlabeled Data with a Selection Bias. 
In ICLR, 2019.

To run notebook tab12.ipynb, first make the data folder with the following datasets:

  • mushrooms, shuttle.scale, shuttle.scale.t, usps, usps.t, connect-4 from https://www.csie.ntu.edu.tw/~cjlin/libsvmtools/datasets/
  • page-blocks.data, spambase.data from https://archive.ics.uci.edu/ml/index.php
  • Caltech10_zscore_SURF_L10.mat, amazon_zscore_SURF_L10.mat, webcam_zscore_SURF_L10.mat , dslr_zscore_SURF_L10.mat, caltech_decaf.mat, amazon_decaf.mat,webcam_decaf.mat, dslr_decaf.mat from ``https://github.com/jindongwang/transferlearning/blob/master/data/dataset.md#office+caltech`

(the MNIST dataset is automatically downloaded with torchvision).

partial_gw.py

This is the script that contains the main function for computing partial-GW.

Data come from the github repository https://github.com/una-dinosauria/3d-pose-baseline from the paper

Julieta Martinez, Rayat Hossain, Javier Romero, James J. Little. 
A simple yet effective baseline for 3d human pose estimation. 
In ICCV, 2017.

utils.py

This file contains functions to load the datasets, draw the different positive and unlabeled datasets and draw the figures.

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.