TBN
TBNv2: Convolutional Neural Network With Ternary Inputs and Binary Weights
Install / Use
/learn @dnvtmf/TBNREADME
TBN
This is the implementation of TBN/TBNv2.
Requirements
- Install PyTorch and torchvision
- Download the ImageNet dataset from http://www.image-net.org/
- Then, and move validation images to labeled subfolders, using the following shell script
Results
| Arch | top-1 accuracy | top-5 accuracy | | ---- | ----- | ------ | | AlexNet (full) | 61.6 | 82.9 | | AlexNet (TBNv2) | 54.9 | 77.8 | | PreActResNet18 (full) | 70.3 | 89.3 | | PreActResNet18 (TBNv2) | 59.7 | 82.1 | | PreActResNet34 (full) | 73.3 | 76.4 | | PreActResNet34 (TBNv2) | 63.4 | 849 | | PreActResNet50 (full) | 76.4 | 93.2 | | PreActResNet50 (TBNv2) | 66.6 | 86.7 |
Evaluate
- Download pretrained model
- run command (see scripts/*)
python3 ./imagenet.py --load pretrained/alexnet_TBNv2.pth -e -a alexnet --gpu 0 ~/data/ImageNet
Train
Please refer pytorch/examples/imagenet
Use --ternary-delta=0.5, --ternary-order=2, --ternary-momentum=0.1 and --ternary-no-scale to set the
hyper-parameter of TBN/TBNv2.
- For TBN, you need
--ternary-no-scaleoption. - when
--ternary-momentum<= 0, the threshold value of ternary is fixed as--ternary-deltarather than calculating based on inputs.
Citation
@InProceedings{Wan_2018_ECCV,
author = {Wan, Diwen and Shen, Fumin and Liu, Li and Zhu, Fan and Qin, Jie and Shao, Ling and Tao Shen, Heng},
title = {TBN: Convolutional Neural Network with Ternary Inputs and Binary Weights},
booktitle = {The European Conference on Computer Vision (ECCV)},
month = {September},
year = {2018}
}
Related Skills
node-connect
349.7kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
109.7kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
349.7kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
349.7kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
