{"id":19219975,"url":"https://github.com/zhutmost/neuralzip","last_synced_at":"2025-07-30T10:43:49.699Z","repository":{"id":134840229,"uuid":"300540163","full_name":"zhutmost/neuralzip","owner":"zhutmost","description":"A Out-of-box PyTorch Scaffold for Neural Network Quantization-Aware-Training (QAT) Research. Website: https://github.com/zhutmost/neuralzip","archived":false,"fork":false,"pushed_at":"2022-12-20T07:08:10.000Z","size":96,"stargazers_count":26,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-13T01:08:35.978Z","etag":null,"topics":["deep-learning","neural-network-quantization","pytorch"],"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/zhutmost.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":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-10-02T07:46:37.000Z","updated_at":"2024-08-18T23:07:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"d4a7be9e-53e7-48e4-90b7-34ab4ea58429","html_url":"https://github.com/zhutmost/neuralzip","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/zhutmost%2Fneuralzip","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhutmost%2Fneuralzip/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhutmost%2Fneuralzip/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhutmost%2Fneuralzip/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zhutmost","download_url":"https://codeload.github.com/zhutmost/neuralzip/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253851060,"owners_count":21973673,"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":["deep-learning","neural-network-quantization","pytorch"],"created_at":"2024-11-09T14:33:28.794Z","updated_at":"2025-05-13T01:08:46.854Z","avatar_url":"https://github.com/zhutmost.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=center\u003e NeuralZip \u003c/h1\u003e\n\u003cdiv align=\"center\"\u003e\n\n**Compress Your Neural Network Painlessly**\n\n\u003c/div\u003e\n\n## Introduction\n\nNeuralZip is a out-of-box Python scaffold for neural network quantization-aware training (QAT).\nWith NeuralZip, you can focus on optimizing your quantization algorithm itself without falling into error-prone and dirty jobs.\n\nNeuralZip can:\n- Inject quantizer operators into your network without modification\n- Decouple your quantizer implementation with the network implementation\n- Built-in quantizers, including LSQ/...\n- Evaluate your quantization algorithm on common benchmarks, including ImageNet/CIFAR10/...\n- Automatic accelerate training with multi-thread DistributedDataParallel\n- Checkpoint / TensorBoard visualization / YAML \u0026 CLI configuration / Thorough logs\n\n## Example Cases\n\nHere are some LSQ-based experiment results. Their configuration files can be found in the [conf](./conf) folder.\n\n### LSQ-Net\n\nPlease view [this link](./conf/lsq) for more details (such as experiment setup and CLI commands).\n\n| Network   | Quan. Method | Bitwidth (W/A)  | Top-1 Acc. (%) | Top-5 Acc. (%) |\n|:---------:|:------------:|:---------------:|:--------------:|:--------------:|\n| ResNet-18 |          LSQ |             2/2 |          65.37 |          86.37 |\n| ResNet-18 |          LSQ |             3/3 |          68.75 |          88.91 |\n| ResNet-18 |          LSQ |             4/4 |          69.97 |          89.32 |\n| ResNet-50 |          LSQ |             2/2 |          68.40 |          88.27 |\n| ResNet-50 |          LSQ |             3/3 |          75.42 |          92.62 |\n| ResNet-50 |          LSQ |             4/4 |          76.23 |          92.94 |\n\n## User Guide\n\n### Install Dependencies\n\nInstall library dependencies within an Anaconda environment.\n\n```bash\n# Create a environment with Python 3.10\nconda create -n neuralzip python=3.10\nconda activate neuralzip\n# PyTorch GPU version 1.13\nconda install pytorch torchvision torchaudio pytorch-cuda=11.7 -c pytorch -c nvidia\n# PyTorch Lightning \u0026 its Bolts\npython -m pip install --upgrade lightning lightning-bolts torchmetrics\n# Miscellaneous\nconda install omegaconf\n```\n\n### Run Scripts with Your Configurations\n\nThis program use YAML files as inputs. A template as well as the default configuration is provided as `conf/template.yaml`.\nPlease read it before running Python scripts. It is disallowed to modify this file and use it as your configuration, which may cause severe errors at the runtime.\n\nIf you want to change the behaviour of this program, please copy it somewhere else. And then run the `main.py` with your modified configuration file.\n\n```bash\npython main.py conf_filepath=/path/to/your/config/file.yaml\n```\n\nThe modified options in your YAML file will overwrite the default settings. For details, please read the comments in `conf/template.yaml`.\nYou can also find some example configuration files in the [example](./conf) folder.\n\nYou can also use CLI arguments to configure the program, like this:\n\n```bash\npython main.py conf_filepath=some.yaml optimizer.lr=0.05\n```\n\nThus, the setting `optimizer.lr` in `some.yaml` will be overridden with the CLI input (i.e. 0.05).\n\n## Inspiration \u0026 Contribution\n\nIf you find any bugs in my code or have any ideas to improve the quantization results, please feel free to open an issue. I will be glad to join the discussion.\n\nNeuralZip originates from my another project, [an implementation of LSQ-Net](https://github.com/zhutmost/lsq-net).\n\nIt is powered by [PyTorch](https://pytorch.org), [PyTorch-Lightning](https://www.pytorchlightning.ai) and many other open-source projects.\nThanks for their excellent jobs.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhutmost%2Fneuralzip","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzhutmost%2Fneuralzip","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhutmost%2Fneuralzip/lists"}