Code Monkey home page Code Monkey logo

aux-ts's Introduction

Adaptive Transfer Learning on Graph Neural Networks

This repository is the implementation of AUX-TS(arxiv).

We design an adaptive auxiliary loss weighting model to learn the weights of auxiliary tasks by quantifying the consistency between auxiliary tasks and the target task. In addition, we learn the weighting model through meta-learning. Our methods can be applied to various transfer learning approaches, it performs well not only in multi-task learning but also in pre-training and fine-tuning.

DataSet

We use datasets from GPT-GNN.

Setup

This implementation is based on pytorch_geometric. To run the code, you will need the following dependencies:

You can simply run conda env create -f env.yaml to install all the necessary packages.

Usage

We first introduce the arguments to control hyperparameters.

For pre-training, we provide arguments to control different modules for attribute and edge generation tasks:

  --n_fold                         INT     number of fold for cross validation                  Default is 1.
  --weight_emb_dim                 INT     embedding dimensions for weighting model             Default is 100.
  --wlr                            FLOAT   learning rate for weighting model                    Default is 1e-3.
  --lr                             FLOAT   learning rate for gnn model.                         Default is 1e-3.
  --act_type                       STR     activation type for weighting model                  Default is sigmoid

The following commands pretrain a 3-layer HGT over OAG-CS:

python pretrain_OAG.py --attr_type text --conv_name hgt --n_layers 3 --pretrain_model_dir ./gta_all_cs3

The following commands use the pre-trained model as initialization and finetune on the paper-field classification task(one sim):

python3 -u multi_OAG_PF_one.py --conv_name hgt --cuda 0 --n_epoch 500 --link_ratio 1 --attr_ratio 1 --w2v_dir <w2v_dir> --pretrain_model_dir <pretrain_model_dir> --data_dir <data_file> --model_dir <model_dir> --act_type sigmoid --n_batch 32 --use_pretrain

The following commands use the pre-trained model as initialization and finetune on Reddit dataset(one sim):

python3 -u multi_reddit_one.py --conv_name hgt --cuda 0 --n_epoch 200 --pretrain_model_dir <pretrain_model_dir> --data_dir <data_dir> --model_dir <model_dir> --batch_size 200 --use_pretrain

Citation

Please consider citing the following paper when using our code for your application.

@inproceedings{10.1145/3447548.3467450,
author = {Han, Xueting and Huang, Zhenhuan and An, Bang and Bai, Jing},
title = {Adaptive Transfer Learning on Graph Neural Networks},
year = {2021},
isbn = {9781450383325},
publisher = {Association for Computing Machinery},
address = {New York, NY, USA},
url = {https://doi.org/10.1145/3447548.3467450},
doi = {10.1145/3447548.3467450},
booktitle = {Proceedings of the 27th ACM SIGKDD Conference on Knowledge Discovery &amp; Data Mining},
pages = {565โ€“574},
numpages = {10},
keywords = {graph neural networks, multi task learning, graph representation learning, transfer learning, GNN pre-training},
location = {Virtual Event, Singapore},
series = {KDD '21}
}

This implementation is mainly based on pyHGT API.

aux-ts's People

Contributors

sean-huang65 avatar shadab2706 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.