{"id":13443251,"url":"https://github.com/microsoft/LQ-Nets","last_synced_at":"2025-03-20T16:30:48.446Z","repository":{"id":39916343,"uuid":"141554397","full_name":"microsoft/LQ-Nets","owner":"microsoft","description":"LQ-Nets: Learned Quantization for Highly Accurate and Compact Deep Neural Networks","archived":true,"fork":false,"pushed_at":"2022-08-30T08:00:20.000Z","size":29,"stargazers_count":242,"open_issues_count":5,"forks_count":69,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-03-13T01:21:15.157Z","etag":null,"topics":["cnn","compression","dnn","quantization"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/microsoft.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null}},"created_at":"2018-07-19T09:14:18.000Z","updated_at":"2025-02-03T13:56:17.000Z","dependencies_parsed_at":"2023-01-16T16:00:58.684Z","dependency_job_id":null,"html_url":"https://github.com/microsoft/LQ-Nets","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2FLQ-Nets","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2FLQ-Nets/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2FLQ-Nets/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2FLQ-Nets/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/microsoft","download_url":"https://codeload.github.com/microsoft/LQ-Nets/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244649727,"owners_count":20487478,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cnn","compression","dnn","quantization"],"created_at":"2024-07-31T03:01:58.123Z","updated_at":"2025-03-20T16:30:47.256Z","avatar_url":"https://github.com/microsoft.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# LQ-Nets\n\nBy [Dongqing Zhang](https://github.com/zdqzeros), [Jiaolong Yang](http://jlyang.org), [Dongqiangzi Ye](https://github.com/EowinYe), [Gang Hua](https://www.microsoft.com/en-us/research/people/ganghua/).\n\nMicrosoft Research Asia (MSRA).\n\n### Introduction\nThis repository contains the training code of LQ-Nets introduced in our ECCV 2018 paper:\n\nD. Zhang*, J. Yang*, D. Ye* and G. Hua. LQ-Nets: Learned Quantization for Highly Accurate and Compact Deep Neural Networks. ECCV 2018 (*: Equal contribution) [PDF](https://arxiv.org/pdf/1807.10029.pdf)\n\n### Dependencies\n\n+ Python 2.7 or 3.3+\n+ Python bindings for OpenCV\n+ TensorFlow \u003e= 1.3.0\n+ [TensorPack](https://github.com/tensorpack/tensorpack)\n\n### Usage\n\nDownload the ImageNet dataset and decompress into the structure like\n\n    dir/\n      train/\n        n01440764/\n          n01440764_10026.JPEG\n          ...\n        ...\n      val/\n        ILSVRC2012_val_00000001.JPEG\n        ...\n\nTo train a quantized \"pre-activation\" ResNet-18, simply run\n\n    python imagenet.py --gpu 0,1,2,3 --data /PATH/TO/IMAGENET --mode preact --depth 18 --qw 1 --qa 2 --logdir_id w1a2 \n\nAfter the training, the result model will be stored in `./train_log/w1a2`.\n\nFor more options, please refer to `python imagenet.py -h`. \n\n### Results\n**ImageNet Experiments**\n\nQuantizing both weight and activation\n\nModel|Bit-width(W/A)|Top-1(%)|Top-5(%)\n:---:|:---:|:---:|:---:\nResNet-18|1/2|62.6|84.3\nResNet-18|2/2|64.9|85.9\nResNet-18|3/3|68.2|87.9\nResNet-18|4/4|69.3|88.8\nResNet-34|1/2|66.6|86.9\nResNet-34|2/2|69.8|89.1\nResNet-34|3/3|71.9|90.2\nResNet-50|1/2|68.7|88.4\nResNet-50|2/2|71.5|90.3\nResNet-50|3/3|74.2|91.6\nResNet-50|4/4|75.1|92.4\nAlexNet|1/2|55.7|78.8\nAlexNet|2/2|57.4|80.1\nDenseNet-121|2/2|69.6|89.1\nVGG-Variant|1/2|67.1|87.6\nVGG-Variant|2/2|68.8|88.6\nGoogLeNet-Variant|1/2|65.6|86.4\nGoogLeNet-Variant|2/2|68.2|88.1\n\nQuantizing weight only\n\nModel|Bit-width(W/A)|Top-1(%)|Top-5(%)\n:---:|:---:|:---:|:---:\nResNet-18|2/32|68.0|88.0\nResNet-18|3/32|69.3|88.8\nResNet-18|4/32|70.0|89.1\nResNet-50|2/32|75.1|92.3\nResNet-50|4/32|76.4|93.1\nAlexNet|2/32|60.5|82.7\n\nMore results can be found in the paper.\n\n### Citation\nIf you use our code or models in your research, please cite our paper with\n\n    @inproceedings{ZhangYangYeECCV2018,\n        author = {Zhang, Dongqing and Yang, Jiaolong and Ye, Dongqiangzi and Hua, Gang},\n        title = {LQ-Nets: Learned Quantization for Highly Accurate and Compact Deep Neural Networks},\n        booktitle = {European Conference on Computer Vision (ECCV)},\n        year = {2018}\n    }\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrosoft%2FLQ-Nets","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmicrosoft%2FLQ-Nets","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrosoft%2FLQ-Nets/lists"}