HGCAE Pytorch implementation. CVPR2021 accepted.

Related tags

Deep Learning HGCAE
Overview

Hyperbolic Graph Convolutional Auto-Encoders

Accepted to CVPR2021 🎉

Official PyTorch code of Unsupervised Hyperbolic Representation Learning via Message Passing Auto-Encoders

Jiwoong Park*, Junho Cho*, Hyung Jin Chang, Jin Young Choi (* indicates equal contribution)

vis_cora Embeddings of cora dataset. GAE is Graph Auto-Encoders in Euclidean space, HGCAE is our method. P is Poincare ball, H is Hyperboloid.

Overview

This repository provides HGCAE code in PyTorch for reproducibility with

  • PoincareBall manifold
  • Link prediction task and node clustering task on graph data
    • 6 datasets: Cora, Citeseer, Wiki, Pubmed, Blog Catalog, Amazon Photo
    • Amazon Photo was downloaded via torch-geometric package.
  • Image clustering task on images
    • 2 datasets: ImageNet10, ImageNetDog
    • Image features extracted from ImageNet10, ImageNetDog with PICA image clustering algorithm
    • Mutual K-NN graph from the image features provided.
  • ImageNet-BNCR
    • We have constructed a new dataset, ImageNet-BNCR(Balanced Number of Classes across Roots), via randomly choosing 3 leaf classes per root. We chose three roots, Artifacts, Natural objects, and Animal. Thus, there exist 9 leaf classes, and each leaf class contains 1,300 images in ImageNet-BNCR dataset.
    • bncr

Installation Guide

We use docker to reproduce performance. Please refer guide.md

Usage

1. Run docker

Before training, run our docker image:

docker run --gpus all -it --rm --shm-size 100G -v $PWD:/workspace junhocho/hyperbolicgraphnn:8 bash

If you want to cache edge splits for train/val dataset and load faster afterwards, mkdir ~/tmp and run:

docker run --gpus all -it --rm --shm-size 100G -v $PWD:/workspace -v ~/tmp:/root/tmp junhocho/hyperbolicgraphnn:8 bash

2. train_<dataset>.sh

In the docker session, run each train shell script for each dataset to reproduce performance:

Graph data link prediction

Run following commands to reproduce results:

  • sh script/train_cora_lp.sh
  • sh script/train_citeseer_lp.sh
  • sh script/train_wiki_lp.sh
  • sh script/train_pubmed_lp.sh
  • sh script/train_blogcatalog_lp.sh
  • sh script/train_amazonphoto_lp.sh
ROC AP
Cora 0.94890703 0.94726805
Citeseer 0.96059407 0.96305937
Wiki 0.95510805 0.96200790
Pubmed 0.96207212 0.96083080
Blog Catalog 0.89683939 0.88651569
Amazon Photo 0.98240673 0.97655753

Graph data node clustering

  • sh script/train_cora_nc.sh
  • sh script/train_citeseer_nc.sh
  • sh script/train_wiki_nc.sh
  • sh script/train_pubmed_nc.sh
  • sh script/train_blogcatalog_nc.sh
  • sh script/train_amazonphoto_nc.sh
ACC NMI ARI
Cora 0.74667651 0.57252940 0.55212928
Citeseer 0.69311692 0.42249294 0.44101404
Wiki 0.45945946 0.46777881 0.21517031
Pubmed 0.74849115 0.37759262 0.40770875
Blog Catalog 0.55061586 0.32557388 0.25227964
Amazon Photo 0.78130719 0.69623651 0.60342107

Image clustering

  • sh script/train_ImageNet10.sh
  • sh script/train_ImageNetDog.sh
ACC NMI ARI
ImageNet10 0.85592308 0.79019131 0.74181220
ImageNetDog 0.38738462 0.36059650 0.22696503
  • At least 11GB VRAM is required to run on Pubmed, BlogCatalog, Amazon Photo.
  • We have used GTX 1080ti only in our experiments.
  • Other gpu architectures may not reproduce above performance.

Parameter description

  • dataset : Choose dataset. Refer to each training scripts.
  • c : Curvature of hypebolic space. Should be >0. Preferably choose from 0.1, 0.5 ,1 ,2.
  • c_trainable : 0 or 1. Train c if 1.
  • dropout : Dropout ratio.
  • weight_decay : Weight decay.
  • hidden_dim : Hidden layer dimension. Same dimension used in encoder and decoder.
  • dim : Embedding dimension.
  • lambda_rec : Input reconstruction loss weight.
  • act : relu, elu, tanh.
  • --manifold PoincareBall : Use Euclidean if training euclidean models.
  • --node-cluster 1 : If specified perform node clustering task. If not, link prediction task.

Acknowledgments

This repo is inspired by hgcn.

And some of the code was forked from the following repositories:

License

This work is licensed under the MIT License

Citation

@inproceedings{park2021unsupervised,
  title={Unsupervised Hyperbolic Representation Learning via Message Passing Auto-Encoders},
  author={Jiwoong Park and Junho Cho and Hyung Jin Chang and Jin Young Choi},
  booktitle={Proceedings of the IEEE conference on computer vision and pattern recognition},
  year={2021}
}

You might also like...
A pytorch implementation of the CVPR2021 paper "VSPW: A Large-scale Dataset for Video Scene Parsing in the Wild"

VSPW: A Large-scale Dataset for Video Scene Parsing in the Wild A pytorch implementation of the CVPR2021 paper "VSPW: A Large-scale Dataset for Video

This project is the official implementation of our accepted ICLR 2021 paper BiPointNet: Binary Neural Network for Point Clouds.
This project is the official implementation of our accepted ICLR 2021 paper BiPointNet: Binary Neural Network for Point Clouds.

BiPointNet: Binary Neural Network for Point Clouds Created by Haotong Qin, Zhongang Cai, Mingyuan Zhang, Yifu Ding, Haiyu Zhao, Shuai Yi, Xianglong Li

Python and C++ implementation of
Python and C++ implementation of "MarkerPose: Robust real-time planar target tracking for accurate stereo pose estimation". Accepted at LXCV @ CVPR 2021.

MarkerPose: Robust real-time planar target tracking for accurate stereo pose estimation This is a PyTorch and LibTorch implementation of MarkerPose: a

An official TensorFlow implementation of “CLCC: Contrastive Learning for Color Constancy” accepted at CVPR 2021.
An official TensorFlow implementation of “CLCC: Contrastive Learning for Color Constancy” accepted at CVPR 2021.

CLCC: Contrastive Learning for Color Constancy (CVPR 2021) Yi-Chen Lo*, Chia-Che Chang*, Hsuan-Chao Chiu, Yu-Hao Huang, Chia-Ping Chen, Yu-Lin Chang,

This is an official implementation of the paper "Distance-aware Quantization", accepted to ICCV2021.

PyTorch implementation of DAQ This is an official implementation of the paper "Distance-aware Quantization", accepted to ICCV2021. For more informatio

Implementation of accepted AAAI 2021 paper: Deep Unsupervised Image Hashing by Maximizing Bit Entropy
Implementation of accepted AAAI 2021 paper: Deep Unsupervised Image Hashing by Maximizing Bit Entropy

Deep Unsupervised Image Hashing by Maximizing Bit Entropy This is the PyTorch implementation of accepted AAAI 2021 paper: Deep Unsupervised Image Hash

This repository contains the official implementation code of the paper Improving Multimodal Fusion with Hierarchical Mutual Information Maximization for Multimodal Sentiment Analysis, accepted at EMNLP 2021.
This repository contains the official implementation code of the paper Improving Multimodal Fusion with Hierarchical Mutual Information Maximization for Multimodal Sentiment Analysis, accepted at EMNLP 2021.

MultiModal-InfoMax This repository contains the official implementation code of the paper Improving Multimodal Fusion with Hierarchical Mutual Informa

The official implementation of paper Siamese Transformer Pyramid Networks for Real-Time UAV Tracking, accepted by WACV22
The official implementation of paper Siamese Transformer Pyramid Networks for Real-Time UAV Tracking, accepted by WACV22

SiamTPN Introduction This is the official implementation of the SiamTPN (WACV2022). The tracker intergrates pyramid feature network and transformer in

Official implementation of NLOS-OT: Passive Non-Line-of-Sight Imaging Using Optimal Transport (IEEE TIP, accepted)
Official implementation of NLOS-OT: Passive Non-Line-of-Sight Imaging Using Optimal Transport (IEEE TIP, accepted)

NLOS-OT Official implementation of NLOS-OT: Passive Non-Line-of-Sight Imaging Using Optimal Transport (IEEE TIP, accepted) Description In this reposit

Comments
  • Question about poincare distance

    Question about poincare distance

    Hi, In the manifolds.poincare.py, the square distance is defined as (line 26-32):

    `

    sqrt_c = c ** 0.5
    dist_c = artanh(
        sqrt_c * self.mobius_add(-p1, p2, c, dim=-1).norm(dim=-1, p=2, keepdim=False)
    )
    dist = dist_c * 2 / sqrt_c
    return dist ** 2
    

    `

    But according to the equation (2) in the paper, the square distance in Poincare ball should be like this `

    sqrt_c = c ** 0.5
    sq_norms_p1 = torch.sum(p1**2, dim=-1)
    sq_norms_p2 = torch.sum(p2**2, dim=-1)
    sq_d = torch.sum((p1-yp2)**2, dim=-1)
    dist_c = arcosh(
        1 + 2*c*sq_d/(1+c*sq_norms_p1)/1+c*sq_norms_p2)
    )
    dist = dist_c / sqrt_c
    return dist ** 2
    

    `

    opened by ttgump 1
Owner
Junho Cho
Integrated Ph.D candidate of Seoul National University (Perception and Intelligence Laboratory)
Junho Cho
Spherical Confidence Learning for Face Recognition, accepted to CVPR2021.

Sphere Confidence Face (SCF) This repository contains the PyTorch implementation of Sphere Confidence Face (SCF) proposed in the CVPR2021 paper: Shen

Maths 70 Dec 9, 2022
Implementation of Geometric Vector Perceptron, a simple circuit for 3d rotation equivariance for learning over large biomolecules, in Pytorch. Idea proposed and accepted at ICLR 2021

Geometric Vector Perceptron Implementation of Geometric Vector Perceptron, a simple circuit with 3d rotation equivariance for learning over large biom

Phil Wang 59 Nov 24, 2022
This repo contains the pytorch implementation for Dynamic Concept Learner (accepted by ICLR 2021).

DCL-PyTorch Pytorch implementation for the Dynamic Concept Learner (DCL). More details can be found at the project page. Framework Grounding Physical

Zhenfang Chen 31 Jan 6, 2023
Official PyTorch implementation of the preprint paper "Stylized Neural Painting", accepted to CVPR 2021.

Official PyTorch implementation of the preprint paper "Stylized Neural Painting", accepted to CVPR 2021.

Zhengxia Zou 1.5k Dec 28, 2022
This is the pytorch implementation for the paper: Generalizable Mixed-Precision Quantization via Attribution Rank Preservation, which is accepted to ICCV2021.

GMPQ: Generalizable Mixed-Precision Quantization via Attribution Rank Preservation This is the pytorch implementation for the paper: Generalizable Mix

null 18 Sep 2, 2022
Official PyTorch implementation of the paper "Recycling Discriminator: Towards Opinion-Unaware Image Quality Assessment Using Wasserstein GAN", accepted to ACM MM 2021 BNI Track.

RecycleD Official PyTorch implementation of the paper "Recycling Discriminator: Towards Opinion-Unaware Image Quality Assessment Using Wasserstein GAN

Yunan Zhu 23 Nov 5, 2022
Official implementation of our CVPR2021 paper "OTA: Optimal Transport Assignment for Object Detection" in Pytorch.

OTA: Optimal Transport Assignment for Object Detection This project provides an implementation for our CVPR2021 paper "OTA: Optimal Transport Assignme

null 217 Jan 3, 2023
[PyTorch] Official implementation of CVPR2021 paper "PointDSC: Robust Point Cloud Registration using Deep Spatial Consistency". https://arxiv.org/abs/2103.05465

PointDSC repository PyTorch implementation of PointDSC for CVPR'2021 paper "PointDSC: Robust Point Cloud Registration using Deep Spatial Consistency",

null 153 Dec 14, 2022
PyTorch implementation of our Adam-NSCL algorithm from our CVPR2021 (oral) paper "Training Networks in Null Space for Continual Learning"

Adam-NSCL This is a PyTorch implementation of Adam-NSCL algorithm for continual learning from our CVPR2021 (oral) paper: Title: Training Networks in N

Shipeng Wang 34 Dec 21, 2022
Pytorch implementation of CVPR2021 paper "MUST-GAN: Multi-level Statistics Transfer for Self-driven Person Image Generation"

MUST-GAN Code | paper The Pytorch implementation of our CVPR2021 paper "MUST-GAN: Multi-level Statistics Transfer for Self-driven Person Image Generat

TianxiangMa 46 Dec 26, 2022