Git Product home page Git Product logo

samesame's Introduction

Same, Same But Different

An Tensorflow.keras implementation of ICML2019 paper "Same, Same But Different - Recovering Neural Network Quantization Error Through Weight Factorization"(https://arxiv.org/pdf/1902.01917.pdf) motivation

Quick Start

This code has been tested on Ubuntu 18.04, Python 3.7, Tensorflow 2.0

  • Clone this repository

      git clone https://github.com/Adamdad/Samesame.git 
    
  • Network equalization

      python equalization.py
    

    In this code, I default equalize the Inception_v3 implemented by keras.application

  • Network visualization(in visual_weights_per_channel.py)

    • Per-channel convolution kernel weight visualization

        def visual_weight(model)
      
    • Per-channel activation feature map visualization

        def visual_activation(model,x)
      
    • Network architecture visualization

        def visual_graph(model,fig_name='model.png')
      

Quantization

The post-training quantization is implemented with TF-Lite, with two mode of "weight quantization" and "full quantization". See details in def qevaluate

Performance Compare

Imagenet Validation result

Network 32bit 32bit-Equalized 8bit-weight 8bit-Equalized-weight
top1 top5 top1 top5 top1 top5 top1 top5
Inception-v3 76.276 93.032 75.61 92.58

Citation

@article{meller2019same,
  title={Same, same but different-recovering neural network quantization error through weight factorization},
  author={Meller, Eldad and Finkelstein, Alexander and Almog, Uri and Grobman, Mark},
  journal={arXiv preprint arXiv:1902.01917},
  year={2019}
}

samesame's People

Contributors

adamdad avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  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.