GithubHelp home page GithubHelp logo

paperwave / agnn Goto Github PK

View Code? Open in Web Editor NEW

This project forked from chenghao-ch94/agnn

0.0 0.0 0.0 78 KB

Code for paper "Attentive Graph Neural Networks for Few-shot Learning"

Python 100.00%

agnn's Introduction

Attentive Graph Neural Networks for Few-Shot Learning

This repository contains the code for Attentive Graph Neural Networks for Few-Shot Learning.

Running the code

Preliminaries

Environment

  • Python 3.7.3
  • Pytorch 1.7.1
  • tensorboardX

Datasets

Download the datasets and link the folders into materials/ with names mini-imagenet, tiered-imagenet and imagenet. Note imagenet refers to ILSVRC-2012 1K dataset with two directories train and val with class folders.

When running python programs, use --gpu to specify the GPUs for running the code (e.g. --gpu 0,1). For Classifier-Baseline, we train with 4 GPUs on miniImageNet and tieredImageNet and with 8 GPUs on ImageNet-800. Meta-Baseline uses half of the GPUs correspondingly.

In following we take miniImageNet as an example. For other datasets, replace mini with tiered. By default it is 1-shot, modify shot in config file for other shots. Models are saved in save/.

*The models on miniImageNet and tieredImageNet use ConvNet-4 as backbone, the channels in each block are 64-96-128-256.

1. Pretraining the ConvNet4 Backbone

python train_classifier.py --config configs/train_classifier_mini.yaml

The pretrained Classifier-Baselines can be downloaded from Google Drive (Mini-ImageNet , Tiered-ImageNet).

You can unzip and place the foder under the 'save' folder.

2. Training and Testing AGNN

python train_meta.py --config configs/train_meta_mini.yaml

Citation

@inproceedings{cheng2022attentive,
  title={Attentive graph neural networks for few-shot learning},
  author={Cheng, Hao and Zhou, Joey Tianyi and Tay, Wee Peng and Wen, Bihan},
  booktitle={2022 IEEE 5th International Conference on Multimedia Information Processing and Retrieval (MIPR)},
  pages={152--157},
  year={2022},
  organization={IEEE}
}

Extension is accepted by IEEE Transactions on Multimedia, Update Soon

@article{cheng2023graph,
  title={Graph Neural Networks With Triple Attention for Few-Shot Learning},
  author={Cheng, Hao and Zhou, Joey Tianyi and Tay, Wee Peng and Wen, Bihan},
  journal={IEEE Transactions on Multimedia},
  year={2023},
  publisher={IEEE}
}

Acknowledgment

We thank the following repos providing helpful components/functions in our work.

agnn's People

Contributors

chenghao-ch94 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.