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. Currently, the only supported installation is pip (a conda package is planned in the future).
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 (or afterwards),
please consult pytorch's getting started guide.
Afterwards simply run:
pip install bitorch
Note, that you can also request a specific PyTorch version directly, e.g. for CUDA 11.3:
pip install bitorch --extra-index-url https://download.pytorch.org/whl/cu113
To use advanced logging capabilities with tensorboardX, install the optional dependencies as well:
pip install "bitorch[opt]"
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 .
To activate advanced logging with Tensorboard and model summary, install the optional dependencies as well:
pip install -e ".[opt]"
Dali Preprocessing
If you want to use the Nvidia dali preprocessing library,
e.g. with CUDA 11.x, (currently only supported for imagenet)
you need to install the nvidia-dali-cuda110
package by running the following command:
pip install --extra-index-url https://developer.download.nvidia.com/compute/redist --upgrade nvidia-dali-cuda110
Code formatting and typing
Install the dev requirements for (local) development:
pip install -e ".[dev]"
New code should be compatible with Python 3.X versions and be compliant with PEP8. To check the codebase, please run
flake8
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.2.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6fd9ea25b2da0deeade57e513ac66af88a00ed51a4c385084a09ba40c9d0d3b3 |
|
MD5 | f117736992c241b1487e16a319a069e2 |
|
BLAKE2b-256 | 9d9615c9dd6e9821cd2a4d823617b3c69a4cce98b8f45f58bf5b851a827b0729 |