Ternary Weight Networks

Fengfu Li, Bin Liu, Xiaoxing Wang, Bo Zhang, Junchi Yan
5/16/2016
604 citations
cs.CV

Official code: Thinklab-SJTU/twns (24 stars, Python, last commit 2023-01-19). Most starred: fengfu-chris/caffe-twns, a community implementation (61 stars, C++, last commit 2016-11-29, 2.5× the official stars). 1 more implementation below.

Abstract

We present a memory and computation efficient ternary weight networks (TWNs) - with weights constrained to +1, 0 and -1. The Euclidian distance between full (float or double) precision weights and the ternary weights along with a scaling factor is minimized in training stage.

Show full abstract

Besides, a threshold-based ternary function is optimized to get an approximated solution which can be fast and easily computed. TWNs have shown better expressive abilities than binary precision counterparts. Meanwhile, TWNs achieve up to 16$\times$ model compression rate and need fewer multiplications compared with the float32 precision counterparts. Extensive experiments on MNIST, CIFAR-10, and ImageNet datasets show that the TWNs achieve much better result than the Binary-Weight-Networks (BWNs) and the classification performance on MNIST and CIFAR-10 is very close to the full precision networks. We also verify our method on object detection task and show that TWNs significantly outperforms BWN by more than 10\% mAP on PASCAL VOC dataset. The pytorch version of source code is available at: https://github.com/Thinklab-SJTU/twns.

View on arXivView PDF

Code Implementations(2)

Code implementations of this paper
RepositoryTypeStarsLanguageLicenseLast commit
Thinklab-SJTU/twnsOfficial24Python–2023-01-19
fengfu-chris/caffe-twnsCommunity61C++–2016-11-29
Thinklab-SJTU/twnsOfficial100%
246Python, Jupyter NotebookJan 18, 20233 years ago

Implementation of Ternary Weight Networks In Caffe

6122C++, CudaMay 27, 201610 years ago

Similar Papers

Cite this paper

@article{li2016ternary,
  title  = {Ternary Weight Networks},
  author = {Fengfu Li and Bin Liu and Xiaoxing Wang and Bo Zhang and Junchi Yan},
  year   = {2016},
  eprint = {1605.04711},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/1605.04711}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/1605.04711.svg)](https://codeofpaper.com/paper/1605.04711)

Discussion