CCCL: Contrastive Cascade Graph Learning.

Overview

CCGL: Contrastive Cascade Graph Learning

This repo provides a reference implementation of Contrastive Cascade Graph Learning (CCGL) framework as described in the paper:

CCGL: Contrastive Cascade Graph Learning
Xovee Xu, Fan Zhou, Kunpeng Zhang, and Siyuan Liu
Submitted for review
arXiv:2107.12576

Dataset

You can download all five datasets (Weibo, Twitter, ACM, APS, and DBLP) via any one of the following links:

Google Drive Dropbox Onedrive Tencent Drive Baidu Netdisk
trqg

Environmental Settings

Our experiments are conducted on Ubuntu 20.04, a single NVIDIA 1080Ti GPU, 48GB RAM, and Intel i7 8700K. CCGL is implemented by Python 3.7, TensorFlow 2.3, Cuda 10.1, and Cudnn 7.6.5.

Create a virtual environment and install GPU-support packages via Anaconda:

# create virtual environment
conda create --name=ccgl python=3.7 cudatoolkit=10.1 cudnn=7.6.5

# activate virtual environment
conda activate ccgl

# install other dependencies
pip install -r requirements.txt

Usage

Here we take Weibo dataset as an example to demonstrate the usage.

Preprocess

Step 1: divide, filter, generate labeled and unlabeled cascades:

cd ccgl
# labeled cascades
python src/gene_cas.py --input=./datasets/weibo/ --unlabel=False
# unlabeled cascades
python src/gene_cas.py --input=./datasets/weibo/ --unlabel=True

Step 2: augment both labeled and unlabeled cascades (here we use the AugSIM strategy):

python src/augmentor.py --input=./datasets/weibo/ --aug_strategy=AugSIM

Step 3: generate cascade embeddings:

python src/gene_emb.py --input=./datasets/weibo/ 

Pre-training

python src/pre_training.py --name=weibo-0 --input=./datasets/weibo/ --projection_head=4-1

The saved pre-training model is named as weibo-0.

Fine-tuning

python src/fine_tuning.py --name=weibo-0 --num=0 --input=./datasets/weibo/ --projection_head=4-1

Here we load the pre-trained model weibo-0 and save the teacher network as weibo-0-0.

Distillation

python src/distilling.py --name=weibo-0-0 --num=0 --input=./datasets/weibo/ --projection_head=4-1

Here we load the teacher network weibo-0-0 and save the student network as weibo-0-0-student-0.

(Optional) Run the Base model

python src/base_model.py --input=./datasets/weibo/ 

CCGL model weights

We provide pre-trained, fine-tuned, and distilled CCGL model weights. Please see details in the following table.

Model Dataset Label Fraction Projection Head MSLE Weights
Pre-trained CCGL model Weibo 100% 4-1 - Download
Pre-trained CCGL model Weibo 10% 4-4 - Download
Pre-trained CCGL model Weibo 1% 4-3 - Download
Fine-tuned CCGL model Weibo 100% 4-1 2.70 Download
Fine-tuned CCGL model Weibo 10% 4-4 2.87 Download
Fine-tuned CCGL model Weibo 1% 4-3 3.30 Download

Load weights into the model:

# construct model, carefully check projection head designs:
# use different number of Dense layers
...
# load weights for fine-tuning, distillation, or evaluation
model.load_weights(weight_path)

Check src/fine_tuning.py and src/distilling.py for weights loading examples.

Default hyper-parameter settings

Unless otherwise specified, we use following default hyper-parameter settings.

Param Value Param Value
Augmentation strength 0.1 Pre-training epochs 30
Augmentation strategy AugSIM Projection Head (100%) 4-1
Batch size 64 Projection Head (10%) 4-4
Early stopping patience 20 Projection Head (1%) 4-3
Embedding dimension 64 Model size 128 (4x)
Learning rate 5e-4 Temperature 0.1

Change Logs

  • Jul 21, 2021: fix a bug and some annotations

Cite

If you find our paper & code are useful for your research, please consider citing us 😘 :

@article{xu2021ccgl, 
  author = {Xovee Xu and Fan Zhou and Kunpeng Zhang and Siyuan Liu}, 
  title = {{CCGL}: Contrastive Cascade Graph Learning}, 
  journal = {arXiv:2107.12576},
  year = {2021}, 
}

We also have a survey paper you might be interested:

@article{zhou2021survey,
  author = {Fan Zhou and Xovee Xu and Goce Trajcevski and Kunpeng Zhang}, 
  title = {A Survey of Information Cascade Analysis: Models, Predictions, and Recent Advances}, 
  journal = {ACM Computing Surveys (CSUR)}, 
  volume = {54},
  number = {2},
  year = {2021},
  articleno = {27},
  numpages = {36},
  doi = {10.1145/3433000},
}

Acknowledgment

We would like to thank Xiuxiu Qi, Ce Li, Qing Yang, and Wenxiong Li for sharing their computing resources and help us to test the codes. We would also like to show our gratitude to the authors of SimCLR (and Sayak Paul), node2vec, DeepHawkes, and others, for sharing their codes and datasets.

Contact

For any questions please open an issue or drop an email to: xovee at ieee.org

Owner
Xovee Xu
PhD student in UESTC, Chengdu, China.
Xovee Xu
A CNN implementation using only numpy. Supports multidimensional images, stride, etc.

A CNN implementation using only numpy. Supports multidimensional images, stride, etc. Speed up due to heavy use of slicing and mathematical simplification..

2 Nov 30, 2021
Jax/Flax implementation of Variational-DiffWave.

jax-variational-diffwave Jax/Flax implementation of Variational-DiffWave. (Zhifeng Kong et al., 2020, Diederik P. Kingma et al., 2021.) DiffWave with

YoungJoong Kim 37 Dec 16, 2022
Direct design of biquad filter cascades with deep learning by sampling random polynomials.

IIRNet Direct design of biquad filter cascades with deep learning by sampling random polynomials. Usage git clone https://github.com/csteinmetz1/IIRNe

Christian J. Steinmetz 55 Nov 02, 2022
HomeAssitant custom integration for dyson

HomeAssistant Custom Integration for Dyson This custom integration is still under development. This is a HA custom integration for dyson. There are se

Xiaonan Shen 232 Dec 31, 2022
Linear Variational State Space Filters

Linear Variational State Space Filters To set up the environment, use the provided scripts in the docker/ folder to build and run the codebase inside

0 Dec 13, 2021
FB-tCNN for SSVEP Recognition

FB-tCNN for SSVEP Recognition Here are the codes of the tCNN and FB-tCNN in the paper "Filter Bank Convolutional Neural Network for Short Time-Window

Wenlong Ding 12 Dec 14, 2022
InDuDoNet+: A Model-Driven Interpretable Dual Domain Network for Metal Artifact Reduction in CT Images

InDuDoNet+: A Model-Driven Interpretable Dual Domain Network for Metal Artifact Reduction in CT Images Hong Wang, Yuexiang Li, Haimiao Zhang, Deyu Men

Hong Wang 4 Dec 27, 2022
Seach Losses of our paper 'Loss Function Discovery for Object Detection via Convergence-Simulation Driven Search', accepted by ICLR 2021.

CSE-Autoloss Designing proper loss functions for vision tasks has been a long-standing research direction to advance the capability of existing models

Peidong Liu(刘沛东) 54 Dec 17, 2022
CVPR2022 paper "Dense Learning based Semi-Supervised Object Detection"

[CVPR2022] DSL: Dense Learning based Semi-Supervised Object Detection DSL is the first work on Anchor-Free detector for Semi-Supervised Object Detecti

Bhchen 69 Dec 08, 2022
Live Hand Tracking Using Python

Live-Hand-Tracking-Using-Python Project Description: In this project, we will be

Hassan Shahzad 2 Jan 06, 2022
This reposityory contains the PyTorch implementation of our paper "Generative Dynamic Patch Attack".

Generative Dynamic Patch Attack This reposityory contains the PyTorch implementation of our paper "Generative Dynamic Patch Attack". Requirements PyTo

Xiang Li 8 Nov 17, 2022
PyTorch implementation of Higher Order Recurrent Space-Time Transformer

Higher Order Recurrent Space-Time Transformer (HORST) This is the official PyTorch implementation of Higher Order Recurrent Space-Time Transformer. Th

13 Oct 18, 2022
PyTorch implementation of Neural Dual Contouring.

NDC PyTorch implementation of Neural Dual Contouring. Citation We are still writing the paper while adding more improvements and applications. If you

Zhiqin Chen 140 Dec 26, 2022
Camera-caps - Examine the camera capabilities for V4l2 cameras

camera-caps This is a graphical user interface over the v4l2-ctl command line to

Jetsonhacks 25 Dec 26, 2022
FIRA: Fine-Grained Graph-Based Code Change Representation for Automated Commit Message Generation

FIRA is a learning-based commit message generation approach, which first represents code changes via fine-grained graphs and then learns to generate commit messages automatically.

Van 21 Dec 30, 2022
The official implementation of Equalization Loss for Long-Tailed Object Recognition (CVPR 2020) based on Detectron2

Equalization Loss for Long-Tailed Object Recognition Jingru Tan, Changbao Wang, Buyu Li, Quanquan Li, Wanli Ouyang, Changqing Yin, Junjie Yan ⚠️ We re

Jingru Tan 197 Dec 25, 2022
This repository contains the code for our fast polygonal building extraction from overhead images pipeline.

Polygonal Building Segmentation by Frame Field Learning We add a frame field output to an image segmentation neural network to improve segmentation qu

Nicolas Girard 186 Jan 04, 2023
Code for the ICML 2021 paper: "ViLT: Vision-and-Language Transformer Without Convolution or Region Supervision"

ViLT Code for the paper: "ViLT: Vision-and-Language Transformer Without Convolution or Region Supervision" Install pip install -r requirements.txt pip

Wonjae Kim 922 Jan 01, 2023
Stochastic Tensor Optimization for Robot Motion - A GPU Robot Motion Toolkit

STORM Stochastic Tensor Optimization for Robot Motion - A GPU Robot Motion Toolkit [Install Instructions] [Paper] [Website] This package contains code

NVIDIA Research Projects 101 Dec 12, 2022
Pytorch implementation of the paper "COAD: Contrastive Pre-training with Adversarial Fine-tuning for Zero-shot Expert Linking."

Expert-Linking Pytorch implementation of the paper "COAD: Contrastive Pre-training with Adversarial Fine-tuning for Zero-shot Expert Linking." This is

BoChen 12 Jan 01, 2023