[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
GeneDisco is a benchmark suite for evaluating active learning algorithms for experimental design in drug discovery.

GeneDisco is a benchmark suite for evaluating active learning algorithms for experimental design in drug discovery.

22 Dec 12, 2022
Code for the paper Open Sesame: Getting Inside BERT's Linguistic Knowledge.

Open Sesame This repository contains the code for the paper Open Sesame: Getting Inside BERT's Linguistic Knowledge. Credits We built the project on t

9 Jul 24, 2022
Overview of architecture and implementation of TEDS-Net, as described in MICCAI 2021: "TEDS-Net: Enforcing Diffeomorphisms in Spatial Transformers to Guarantee TopologyPreservation in Segmentations"

TEDS-Net Overview of architecture and implementation of TEDS-Net, as described in MICCAI 2021: "TEDS-Net: Enforcing Diffeomorphisms in Spatial Transfo

Madeleine K Wyburd 14 Jan 04, 2023
Delving into Localization Errors for Monocular 3D Object Detection, CVPR'2021

Delving into Localization Errors for Monocular 3D Detection By Xinzhu Ma, Yinmin Zhang, Dan Xu, Dongzhan Zhou, Shuai Yi, Haojie Li, Wanli Ouyang. Intr

XINZHU.MA 124 Jan 04, 2023
Classification models 1D Zoo - Keras and TF.Keras

Classification models 1D Zoo - Keras and TF.Keras This repository contains 1D variants of popular CNN models for classification like ResNets, DenseNet

Roman Solovyev 12 Jan 06, 2023
A Kaggle competition: discriminate gender based on handwriting

Gender discrimination based on handwriting See http://fastml.com/gender-discrimination/ for description. prep_data.py - a first step chunk_by_authors.

Zygmunt Zając 22 Jul 20, 2022
SingleVC performs any-to-one VC, which is an important component of MediumVC project.

SingleVC performs any-to-one VC, which is an important component of MediumVC project. Here is the official implementation of the paper, MediumVC.

谷下雨 26 Dec 28, 2022
Tightness-aware Evaluation Protocol for Scene Text Detection

TIoU-metric Release on 27/03/2019. This repository is built on the ICDAR 2015 evaluation code. If you propose a better metric and require further eval

Yuliang Liu 206 Nov 18, 2022
PyTorch implementation of Rethinking Positional Encoding in Language Pre-training

TUPE PyTorch implementation of Rethinking Positional Encoding in Language Pre-training. Quickstart Clone this repository. git clone https://github.com

Jake Tae 5 Jan 27, 2022
Deep learning model, heat map, data prepo

deep learning model, heat map, data prepo

Pamela Dekas 1 Jan 14, 2022
Integrated physics-based and ligand-based modeling.

ComBind ComBind integrates data-driven modeling and physics-based docking for improved binding pose prediction and binding affinity prediction. Given

Dror Lab 44 Oct 26, 2022
git《Learning Pairwise Inter-Plane Relations for Piecewise Planar Reconstruction》(ECCV 2020) GitHub:

Learning Pairwise Inter-Plane Relations for Piecewise Planar Reconstruction Code for the ECCV 2020 paper by Yiming Qian and Yasutaka Furukawa Getting

37 Dec 04, 2022
Training Very Deep Neural Networks Without Skip-Connections

DiracNets v2 update (January 2018): The code was updated for DiracNets-v2 in which we removed NCReLU by adding per-channel a and b multipliers without

Sergey Zagoruyko 585 Oct 12, 2022
Introduction to AI assignment 1 HCM University of Technology, term 211

Sokoban Bot Introduction to AI assignment 1 HCM University of Technology, term 211 Abstract This is basically a solver for Sokoban game using Breadth-

Quang Minh 4 Dec 12, 2022
The official PyTorch implementation of the paper: *Xili Dai, Xiaojun Yuan, Haigang Gong, Yi Ma. "Fully Convolutional Line Parsing." *.

F-Clip — Fully Convolutional Line Parsing This repository contains the official PyTorch implementation of the paper: *Xili Dai, Xiaojun Yuan, Haigang

Xili Dai 115 Dec 28, 2022
Pytorch implementation of MaskFlownet

MaskFlownet-Pytorch Unofficial PyTorch implementation of MaskFlownet (https://github.com/microsoft/MaskFlownet). Tested with: PyTorch 1.5.0 CUDA 10.1

Daniele Cattaneo 84 Nov 02, 2022
Code for generating the figures in the paper "Capacity of Group-invariant Linear Readouts from Equivariant Representations: How Many Objects can be Linearly Classified Under All Possible Views?"

Code for running simulations for the paper "Capacity of Group-invariant Linear Readouts from Equivariant Representations: How Many Objects can be Lin

Matthew Farrell 1 Nov 22, 2022
Parris, the automated infrastructure setup tool for machine learning algorithms.

README Parris, the automated infrastructure setup tool for machine learning algorithms. What Is This Tool? Parris is a tool for automating the trainin

Joseph Greene 319 Aug 02, 2022
TorchOk - The toolkit for fast Deep Learning experiments in Computer Vision

TorchOk - The toolkit for fast Deep Learning experiments in Computer Vision

52 Dec 23, 2022
Auto-Lama combines object detection and image inpainting to automate object removals

Auto-Lama Auto-Lama combines object detection and image inpainting to automate object removals. It is build on top of DE:TR from Facebook Research and

44 Dec 09, 2022