[WACV 2022] Contextual Gradient Scaling for Few-Shot Learning

Related tags

Deep LearningCxGrad
Overview

CxGrad - Official PyTorch Implementation

Contextual Gradient Scaling for Few-Shot Learning
Sanghyuk Lee, Seunghyun Lee, and Byung Cheol Song
In WACV 2022. (Paper link will be provided soon)

This repository is an official PyTorch implementation for "Contextual Gradient Scaling for Few-Shot Learning" in WACV 2022.

Installation

This code is based on PyTorch. Please make a virtual environment and use it by running the command below:

conda env create --file environment.yml -n CxGrad
conda activate CxGrad

Datasets

We provide instructions to download 4 datasets: miniImageNet, tieredImageNet, CUB, and CIFAR-FS. Download the datasets you want to use and move them to datasets.

  1. miniImageNet: Download mini_imagenet_full_size.tar.bz2 from this link, provided in MAML++. Note that by downloading and using the miniImageNet, you accept terms and conditions found in imagenet_license.md.

  2. tieredImageNet: Download tiered_imagenet.tar from this link.

  3. CIFAR-FS: Download cifar100.zip from this link. The splits and the download link are provided by Bertinetto.

  4. CUB: Download CUB_200_2011.tgz from this link. The classes of each split are randomly chosen. Thus, we provide the splits of our experiments: CUB_split_train.txt, CUB_split_val.txt, and CUB_split_test.txt in datasets/preprocess. These splits are done by a script written by Chen.

Then, run the command below to preprocess the datasets you downloaded.

python preprocess/preprocess.py --datasets DATASET1 DATASET2 ...

The structure should be like this:

CxGrad 
  ├── datasets
  |      ├── miniImageNet
  |      |        ├── train
  |      |        ├── val
  |      |        └── test
  |      |── tieredImageNet
  |      |         ├── train
  |      |         ├── val
  |      |         └── test
  |      ├── CIFAR-FS
  |      |       ├── train
  |      |       ├── val
  |      |       └── test
  |      └── CUB
  |           ├── train
  |           ├── val
  |           └── test
  ├── utils
  ├── README.md
  └── ...

Run experiments

  • Change directory to experiment_scripts.

Train

  • In order to train the model on N-way K-shot miniImageNet classification, run
    bash mini_imagenet_Nway_Kshot/CxGrad_4conv.sh GPU_ID
    
  • Otherwise for tieredImageNet, run
     bash tiered_imagenet_Nway_Kshot/CxGrad_4conv.sh GPU_ID
    

Test

  • ex) Test on CUB using the model trained on 5-way 5-shot miniImageNet
     TEST=1 TEST_DATASET=CUB bash mini_imagenet_5way_5shot/CxGrad_4conv.sh GPU_ID
    

Citation

To be prepared

Acknowledgment

Thanks to the authors of MAML++ and ALFA, which our work is based on, for their great implementations.

Owner
Sanghyuk Lee
Sanghyuk Lee
A machine learning project which can detect and predict the skin disease through image recognition.

ML-Project-2021 A machine learning project which can detect and predict the skin disease through image recognition. The dataset used for this is the H

Debshishu Ghosh 1 Jan 13, 2022
Papers about explainability of GNNs

Papers about explainability of GNNs

Dongsheng Luo 236 Jan 04, 2023
A Multi-modal Perception Tracker (MPT) for speaker tracking using both audio and visual modalities

MPT A Multi-modal Perception Tracker (MPT) for speaker tracking using both audio and visual modalities. Implementation for our AAAI 2022 paper: Multi-

yidiLi 4 May 08, 2022
AfriBERTa: Exploring the Viability of Pretrained Multilingual Language Models for Low-resourced Languages

AfriBERTa: Exploring the Viability of Pretrained Multilingual Language Models for Low-resourced Languages This repository contains the code for the pa

Kelechi 40 Nov 24, 2022
Flower - A Friendly Federated Learning Framework

Flower - A Friendly Federated Learning Framework Flower (flwr) is a framework for building federated learning systems. The design of Flower is based o

Adap 1.8k Jan 01, 2023
The official code for PRIMER: Pyramid-based Masked Sentence Pre-training for Multi-document Summarization

PRIMER The official code for PRIMER: Pyramid-based Masked Sentence Pre-training for Multi-document Summarization. PRIMER is a pre-trained model for mu

AI2 111 Dec 18, 2022
Informer: Beyond Efficient Transformer for Long Sequence Time-Series Forecasting

Informer: Beyond Efficient Transformer for Long Sequence Time-Series Forecasting This is the origin Pytorch implementation of Informer in the followin

Haoyi 3.1k Dec 29, 2022
Python implementation of the multistate Bennett acceptance ratio (MBAR)

pymbar Python implementation of the multistate Bennett acceptance ratio (MBAR) method for estimating expectations and free energy differences from equ

Chodera lab // Memorial Sloan Kettering Cancer Center 169 Dec 02, 2022
An Efficient Implementation of Analytic Mesh Algorithm for 3D Iso-surface Extraction from Neural Networks

AnalyticMesh Analytic Marching is an exact meshing solution from neural networks. Compared to standard methods, it completely avoids geometric and top

Karbo 45 Dec 21, 2022
Conjugated Discrete Distributions for Distributional Reinforcement Learning (C2D)

Conjugated Discrete Distributions for Distributional Reinforcement Learning (C2D) Code & Data Appendix for Conjugated Discrete Distributions for Distr

1 Jan 11, 2022
Wider or Deeper: Revisiting the ResNet Model for Visual Recognition

ademxapp Visual applications by the University of Adelaide In designing our Model A, we did not over-optimize its structure for efficiency unless it w

Zifeng Wu 338 Dec 12, 2022
CVPR2021 Workshop - HDRUNet: Single Image HDR Reconstruction with Denoising and Dequantization.

HDRUNet [Paper Link] HDRUNet: Single Image HDR Reconstruction with Denoising and Dequantization By Xiangyu Chen, Yihao Liu, Zhengwen Zhang, Yu Qiao an

XyChen 105 Dec 20, 2022
Pytorch implementation of paper Semi-supervised Knowledge Transfer for Deep Learning from Private Training Data

Pytorch implementation of paper Semi-supervised Knowledge Transfer for Deep Learning from Private Training Data

Hrishikesh Kamath 31 Nov 20, 2022
My 1st place solution at Kaggle Hotel-ID 2021

1st place solution at Kaggle Hotel-ID My 1st place solution at Kaggle Hotel-ID to Combat Human Trafficking 2021. https://www.kaggle.com/c/hotel-id-202

Kohei Ozaki 18 Aug 19, 2022
This project generates news headlines using a Long Short-Term Memory (LSTM) neural network.

News Headlines Generator bunnysaini/Generate-Headlines Goal This project aims to generate news headlines using a Long Short-Term Memory (LSTM) neural

Bunny Saini 1 Jan 24, 2022
Source code of our BMVC 2021 paper: AniFormer: Data-driven 3D Animation with Transformer

AniFormer This is the PyTorch implementation of our BMVC 2021 paper AniFormer: Data-driven 3D Animation with Transformer. Haoyu Chen, Hao Tang, Nicu S

24 Nov 02, 2022
Local trajectory planner based on a multilayer graph framework for autonomous race vehicles.

Graph-Based Local Trajectory Planner The graph-based local trajectory planner is python-based and comes with open interfaces as well as debug, visuali

TUM - Institute of Automotive Technology 160 Jan 04, 2023
Sionna: An Open-Source Library for Next-Generation Physical Layer Research

Sionna: An Open-Source Library for Next-Generation Physical Layer Research Sionna™ is an open-source Python library for link-level simulations of digi

NVIDIA Research Projects 313 Dec 22, 2022
SnapMix: Semantically Proportional Mixing for Augmenting Fine-grained Data (AAAI 2021)

SnapMix: Semantically Proportional Mixing for Augmenting Fine-grained Data (AAAI 2021) PyTorch implementation of SnapMix | paper Method Overview Cite

DavidHuang 126 Dec 30, 2022
UltraPose: Synthesizing Dense Pose with 1 Billion Points by Human-body Decoupling 3D Model

UltraPose: Synthesizing Dense Pose with 1 Billion Points by Human-body Decoupling 3D Model Official repository for the ICCV 2021 paper: UltraPose: Syn

MomoAILab 92 Dec 21, 2022