Giter VIP home page Giter VIP logo

qsparse's Introduction

QSPARSE

License: MIT

QSPARSE provides the open source implementation of the quantization and pruning methods proposed in Learning Low-Precision Structured Subnetworks Using Joint Layerwise Channel Pruning and Uniform Quantization. This library was developed to support and demonstrate strong performance and flexibility among various experiments.

Full Precision Joint Quantization 4bit and Channel Pruning 75%
import torch.nn as nn
net = nn.Sequential(
    nn.Conv2d(3, 32, 5),
    nn.ReLU(),
    nn.ConvTranspose2d(32, 3, 5, stride=2)
)
import torch.nn as nn
from qsparse import prune, quantize, convert
net = nn.Sequential(
    quantize(nn.Conv2d(3, 32, 5), bits=4), 
    nn.ReLU(),
    prune(sparsity=0.75, dimensions={1}), 
    quantize(bits=8),  
    quantize(nn.ConvTranspose2d(32, 3, 5, stride=2), bits=4)
)
# Automatic conversion is available via `convert`.
# Please refer to documentation for more details.

Installation

QSPARSE can be installed from PyPI:

pip install qsparse

Usage

Documentation can be accessed from Read the Docs.

Examples of applying QSPARSE to different tasks are provided at examples and mdpi2022.

Citing

If you find this open source release useful, please reference in your paper:

Zhang, X.; Colbert, I.; Das, S. Learning Low-Precision Structured Subnetworks Using Joint Layerwise Channel Pruning and Uniform Quantization. Appl. Sci. 2022, 12, 7829. https://doi.org/10.3390/app12157829

@Article{app12157829,
	AUTHOR = {Zhang, Xinyu and Colbert, Ian and Das, Srinjoy},
	TITLE = {Learning Low-Precision Structured Subnetworks Using Joint Layerwise Channel Pruning and Uniform Quantization},
	JOURNAL = {Applied Sciences},
	VOLUME = {12},
	YEAR = {2022},
	NUMBER = {15},
	ARTICLE-NUMBER = {7829},
	URL = {https://www.mdpi.com/2076-3417/12/15/7829},
	ISSN = {2076-3417}
}

qsparse's People

Contributors

mlzxy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

qsparse's Issues

关于模型量化和剪枝之后的大小变化问题

您好,我最近在学习同时进行量化和剪枝的相关实验,您的项目对我非常有帮助,但是在运行时我发现了一些问题,特别是我运行原始的mnist.py文件后,发现模型参数大小并没有减小反而增加了,请问这是由于什么问题导致的呢?

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.