A package for building and training quantized and binary neural networks with Pytorch
Project description
BITorch
BITorch is a library currently under development to simplify building quantized and binary neural networks with PyTorch. This is an early preview version of the library. If you wish to use it and encounter any problems, please create an issue. Our current roadmap contains:
- Extending the model zoo with pre-trained models of state-of-the-art approaches
- Adding examples for advanced training methods with multiple stages, knowledge distillation, etc.
All changes are tracked in the changelog.
Installation
Similar to recent versions of torchvision, you should be using Python 3.8 or newer.
Pip
If you wish to use a specific version of PyTorch for compatibility with certain devices or CUDA versions,
we advise on installing the corresponding versions of pytorch
and torchvision
first,
please consult pytorch's getting started guide.
A good solution to use CUDA 11.x is to install the packages "torch==1.9.0+cu111" "torchvision==0.10.0+cu111"
first.
Install the package with pip (the --find-links
option can be removed if torch and torchvision have already been installed):
pip install bitorch --find-links https://download.pytorch.org/whl/torch_stable.html
To use advanced logging capabilities with tensorboardX, install the optional dependencies as well:
pip install "bitorch[opt]" --find-links https://download.pytorch.org/whl/torch_stable.html
Local and Development Install Options
The package can also be installed locally for editing and development. First, clone the repository, then run:
pip install -e . --find-links https://download.pytorch.org/whl/torch_stable.html
To activate advanced logging with Tensorboard and model summary, install the optional dependencies as well:
pip install -e ".[opt]" --find-links https://download.pytorch.org/whl/torch_stable.html
Make sure the dev option is used for (local) development:
pip install -e ".[dev]" --find-links https://download.pytorch.org/whl/torch_stable.html
Code formatting and typing
New code should be compatible with Python 3.X versions and be compliant with PEP8. To check the codebase, please run
flake8 --config=setup.cfg .
The codebase has type annotations, please make sure to add type hints if required. We use mypy
for type checking:
mypy --config-file mypy.ini
Finally, the tests can be run with:
pytest
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for bitorch-0.1.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b4c34edb9fa1f1865df4176afa0bd38cddb0f4d29c177600a4af5382808d5a6f |
|
MD5 | cf8f12cf14954cf59a9dece66795d6fb |
|
BLAKE2b-256 | fcf6027e6a8c499fadf2afc0636e82021d90335fbe8160afd42a898a15dd7983 |