Code and experiments for the paper Combining Gradients and Probabilities for Heterogeneours Approximation of Neural Networks.
agnapprox
allows for the study of neural networks using Approximate Multipliers. It's main purpose is to optimize the assignment of different approximate multipliers to the different layers of a Neural Network.
By learning a perturbation term for each layer, agnapprox finds out which layers are more or less resilient to small errors in the computations. This information is then used to choose accurate/inaccurate approximate multipliers for each layer.
The documentation contains two tutorials on agnapprox' functionality and demonstrates how to optimize a neural network supplied by the user.
Detailed Documentation can be found under: https://etrommer.github.io/agn-approx/
This project is not yet hosted on PyPi. You can install it directly from this repository using pip
:
$ pip install git+https://github.com/etrommer/agn-approx.git
To automatically set up pre-commit, run:
poetry run pre-commit install
Different from CIFAR10 and MNIST which are available through torchvision
, the Tiny ImageNet dataset needs to be downloaded manually:
$ cd <your data dir>
$ wget http://cs231n.stanford.edu/tiny-imagenet-200.zip
$ unzip tiny-imagenet-200.zip
The validation images are provided in a flat folder with labels contained in a separate text file. This needs to be changed to a folder structure where each folder is a class containing the respective images. There is a script that handles the conversion:
$ ./src/agnapprox/datamodules/format_tinyimagenet.py --path <your data dir>/tiny-imagenet-200
- TODO
Interested in contributing? Check out the contributing guidelines. Please note that this project is released with a Code of Conduct. By contributing to this project, you agree to abide by its terms.
agnapprox
was created by Elias Trommer. It is licensed under the terms of the GNU General Public License v3.0 license.
agnapprox
was created withcookiecutter
and thepy-pkgs-cookiecutter
template.- This work was created as part of my Ph.D. research at Infineon Technologies Dresden