DA2Lite is an automated model compression toolkit for PyTorch.

Overview

DA2Lite (Deep Architecture to Lite) is a toolkit to compress and accelerate deep network models.

MIT licensed Python version support Pytorch version support

Star us on GitHub — it helps!!

Frameworks & Libraries Algorithms
Built-in
  • Supported Framework
    • PyTorch

Install

git clone https://github.com/da2so/DA2Lite.git

You will need a machine with a GPU and CUDA installed.
Then, you prepare runtime environment:

pip install -r requirements.txt

Use

Run

main.py(DA2Lite) runs with two main configurations like as follows:

CUDA_VISIBLE_DEVICES=0 python main.py --train_config_file=./configs/train/cifar10/cifar10/vgg16.yaml --compress_config_file=./configs/compress/tucker.yaml

The first one is train_config_file, which indicates training configurations and the other is compress_config_file, which represents compress configurations. The details of available configurations are described in Here.

After you run DA2Lite to compress a DNN model, logging and compressed model are saved in ./log directory.

The following shows the format of saving:

  • YYYY-MM-DD.HH.MM.SS : format of saved directory for an instance.
    • models
      • origin_{dataset}_{model}.pt : The original model is saved.
      • compress_1_{dataset}_{model}.pt : The first compressed model is saved.
      • ...
    • process.log : The inevitable log is only logged.
    • specific_process.log : The training procedure log is added with process.log

Example

  • Run the CIFAR10 example with resnet18 using tucker decomposition.
    • The pretrained-model are decomposed and right after fine-tuned: Here

Result

Cifar10 dataset

Model Acc(%) Param num(M) MACs(G) File size(MB) Download
ResNet18 94.74% -> 94.14% (-0.6) 11.17M -> 0.75M (14.81x) 0.56G -> 0.19G (2.96x) 42.70MB -> 2.96MB (14.44x) Here
Vgg16 90.83% -> 88.37% (-2.46) 14.72M -> 0.38M (39.12x) 0.31G -> 0.1G (3.29x) 56.16MB -> 1.45MB (38.71x) Here
Vgg16_bn 93.22% -> 92.74% (-0.48) 14.73M -> 0.71M (20.7x) 0.31G -> 0.11G (2.93x) 56.25MB -> 2.77MB (20.29x) Here

TODO

  • Multi-GPU training
  • PyTorchMobile conversion
  • Train a model based on a custom dataset
  • Rand-augmentation for improving an accuracy
  • Make a model zoo
  • Up-to-date model architectures.
  • Train a model for object detection tasks (further future...)
  • Compression methods for object detection tasks (further future...)

License

The entire codebase is under MIT license

Owner
Sinhan Kang
Explainable AI(XAI), Model Compression
Sinhan Kang
A simple Python library for stochastic graphical ecological models

What is Viridicle? Viridicle is a library for simulating stochastic graphical ecological models. It implements the continuous time models described in

Theorem Engine 0 Dec 04, 2021
Joint Channel and Weight Pruning for Model Acceleration on Mobile Devices

Joint Channel and Weight Pruning for Model Acceleration on Mobile Devices Abstract For practical deep neural network design on mobile devices, it is e

11 Dec 30, 2022
Pytorch Implementation of Zero-Shot Image-to-Text Generation for Visual-Semantic Arithmetic

Pytorch Implementation of Zero-Shot Image-to-Text Generation for Visual-Semantic Arithmetic [Paper] [Colab is coming soon] Approach Example Usage To r

170 Jan 03, 2023
TensorFlow code for the neural network presented in the paper: "Structural Language Models of Code" (ICML'2020)

SLM: Structural Language Models of Code This is an official implementation of the model described in: "Structural Language Models of Code" [PDF] To ap

73 Nov 06, 2022
CLEAR algorithm for multi-view data association

CLEAR: Consistent Lifting, Embedding, and Alignment Rectification Algorithm The Matlab, Python, and C++ implementation of the CLEAR algorithm, as desc

MIT Aerospace Controls Laboratory 30 Jan 02, 2023
Tensor-based approaches for fMRI classification

tensor-fmri Using tensor-based approaches to classify fMRI data from StarPLUS. Citation If you use any code in this repository, please cite the follow

4 Sep 07, 2022
Diabet Feature Engineering - Predict whether people have diabetes when their characteristics are specified

Diabet Feature Engineering - Predict whether people have diabetes when their characteristics are specified

Şebnem 6 Jan 18, 2022
Serverless proxy for Spark cluster

Hydrosphere Mist Hydrosphere Mist is a serverless proxy for Spark cluster. Mist provides a new functional programming framework and deployment model f

hydrosphere.io 317 Dec 01, 2022
A curated list of automated deep learning (including neural architecture search and hyper-parameter optimization) resources.

Awesome AutoDL A curated list of automated deep learning related resources. Inspired by awesome-deep-vision, awesome-adversarial-machine-learning, awe

D-X-Y 2k Dec 30, 2022
H&M Fashion Image similarity search with Weaviate and DocArray

H&M Fashion Image similarity search with Weaviate and DocArray This example shows how to do image similarity search using DocArray and Weaviate as Doc

Laura Ham 18 Aug 11, 2022
LaneAF: Robust Multi-Lane Detection with Affinity Fields

LaneAF: Robust Multi-Lane Detection with Affinity Fields This repository contains Pytorch code for training and testing LaneAF lane detection models i

155 Dec 17, 2022
Code release to accompany paper "Geometry-Aware Gradient Algorithms for Neural Architecture Search."

Geometry-Aware Gradient Algorithms for Neural Architecture Search This repository contains the code required to run the experiments for the DARTS sear

18 May 27, 2022
In this project, we create and implement a deep learning library from scratch.

ARA In this project, we create and implement a deep learning library from scratch. Table of Contents Deep Leaning Library Table of Contents About The

22 Aug 23, 2022
A (PyTorch) imbalanced dataset sampler for oversampling low frequent classes and undersampling high frequent ones.

Imbalanced Dataset Sampler Introduction In many machine learning applications, we often come across datasets where some types of data may be seen more

Ming 2k Jan 08, 2023
Pytorch Implementation of LNSNet for Superpixel Segmentation

LNSNet Overview Official implementation of Learning the Superpixel in a Non-iterative and Lifelong Manner (CVPR'21) Learning Strategy The proposed LNS

42 Oct 11, 2022
PyGCL: Graph Contrastive Learning Library for PyTorch

PyGCL: Graph Contrastive Learning for PyTorch PyGCL is an open-source library for graph contrastive learning (GCL), which features modularized GCL com

GCL: Graph Contrastive Learning Library for PyTorch 594 Jan 08, 2023
DETReg: Unsupervised Pretraining with Region Priors for Object Detection

DETReg: Unsupervised Pretraining with Region Priors for Object Detection Amir Bar, Xin Wang, Vadim Kantorov, Colorado J Reed, Roei Herzig, Gal Chechik

Amir Bar 283 Dec 27, 2022
Official PyTorch implementation and pretrained models of the paper Self-Supervised Classification Network

Self-Classifier: Self-Supervised Classification Network Official PyTorch implementation and pretrained models of the paper Self-Supervised Classificat

Elad Amrani 24 Dec 21, 2022
Square Root Bundle Adjustment for Large-Scale Reconstruction

RootBA: Square Root Bundle Adjustment Project Page | Paper | Poster | Video | Code Table of Contents Citation Dependencies Installing dependencies on

Nikolaus Demmel 205 Dec 20, 2022
Software Platform for solving and manipulating multiparametric programs in Python

PPOPT Python Parametric OPtimization Toolbox (PPOPT) is a software platform for solving and manipulating multiparametric programs in Python. This pack

10 Sep 13, 2022