Git Product home page Git Product logo

dgnet's Introduction

Dynamic Dual Gating Neural Networks

This repository contains the PyTorch implementation for

Dynamic Dual Gating Neural Networks
Fanrong Li, Gang Li, Xiangyu He, Jian Cheng
ICCV 2021 Oral

image

Getting Started

Requirements

The main requirements of this work are:

  • Python 3.7
  • PyTorch == 1.5.0
  • Torchvision == 0.6.0
  • CUDA 10.2

We recommand using conda env to setup the experimental environments.

# Create environment
conda create -n DGNet python=3.7
conda activate DGNet

# Install PyTorch & Torchvision
pip install torch==1.5.0 torchvision==0.6.0

# Clone repo
git clone https://github.com/anonymous-9800/DGNet.git ./DGNet
cd ./DGNet

# Install other requirements
pip install -r requirements.txt

Trained models

Our trained models can be found here: Google Drive. And the pretrained cifar10 models can be found here: Google Drive. Unzip and place them into the DGNet folder.

Evaluate a trained DGNet

# CIFAR-10
sh ./scripts/cifar_e.sh [ARCH] [PATH-TO-DATASET] [GPU-IDs] [PATH-TO-SAVE] [PATH-TO-TRAINED-MODEL]

# ResNet on ImageNet
sh ./scripts/imagenet_e.sh [ARCH] [PATH-TO-DATASET] [GPU-IDs] [PATH-TO-SAVE] [PATH-TO-TRAINED-MODEL]

# Example
sh ./scripts/imagenet_e.sh resdg34 [PATH-TO-DATASET] 0 imagenet/resdg34-04-e ./trained_models_cls/imagenet_results/resdg34/sparse06/resdg34_04.pth.tar

Train a DGNet

# CIFAR-10
sh ./scripts/cifar_t.sh [ARCH] [PATH-TO-DATASET] [TARGET-DENSITY] [GPU-IDs] [PATH-TO-SAVE] [PATH-TO-PRETRAINED-MODEL]

# ResNet on ImageNet
sh ./scripts/imagenet_t.sh [ARCH] [PATH-TO-DATASET] [TARGET-DENSITY] [GPU-IDs] [PATH-TO-SAVE]

# Example
sh ./scripts/imagenet_t.sh resdg34 [PATH-TO-DATASET] 0.4 0,1 imagent/resdg34-04

Main results

Model Method Top-1 (%) Top-5 (%) FLOPs Google Drive
ResNet-18 DGNet (50%) 70.12 89.22 9.54E8 Link
DGNet (60%) 69.38 88.94 7.88E8 Link
ResNet-34 DGNet (60%) 73.01 90.99 1.50E9 Link
DGNet (70%) 71.95 90.46 1.21E9 Link
ResNet-50 DGNet (60%) 76.41 93.05 1.65E9 Link
DGNet (70%) 75.12 92.34 1.31E9 Link
MobileNet-V2 DGNet (50%) 71.62 90.05 1.60E8 Link

Citation

If you find this project useful for your research, please use the following BibTeX entry.

@inproceedings{dgnet,
  title={Dynamic Dual Gating Neural Networks},
  author={Li, Fanrong and Li, Gang and He, Xiangyu and Cheng, Jian},
  booktitle={Proceedings of the IEEE International Conference on Computer Vision (ICCV)},
  year={2021}
}

Contact

For any questions, feel free to contact: [email protected]

dgnet's People

Contributors

lfr-0531 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.