Sparse Connectivity Recurrent Neural Networks
The keras-spconn git repo is available as PyPi package
pip install keras-spconn
pip install git+ssh://git@github.com/kmedian/keras-spconn.git
Check the examples folder for notebooks.
python3 -m venv .venv
source .venv/bin/activate
pip3 install --upgrade pip
pip3 install -r requirements.txt
pip3 install -r requirements-dev.txt
pip3 install -r requirements-demo.txt
# reinstall TF for better Intel-CPU support
# pip install intel-tensorflow
(If your git repo is stored in a folder with whitespaces, then don't use the subfolder .venv. Use an absolute path without whitespaces.)
Please note that using GPUs for tensorflow.sparse is not adding speed improvements because most tensorflow.sparse functions only support CPU, i.e., the program would switch between GPU and CPU memory all the time what is very slow.
TensorFlow needs the CUDA drivers that available as Python packages only via Conda (Nvidia does not maintain PyPi packages).
conda install pip
conda create --name gpu-venv-keras-spconn python=3.9 pip
conda activate gpu-venv-keras-spconn
conda install -c conda-forge cudatoolkit=11.2 cudnn=8.1.0
pip install -r requirements.txt
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CONDA_PREFIX/lib/Install MiniConda if not exists
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.sh
# prevent conda autostart in shell
# conda config --set auto_activate_base false- Jupyter for the examples:
jupyter lab - Check syntax:
flake8 --ignore=F401 --exclude=$(grep -v '^#' .gitignore | xargs | sed -e 's/ /,/g') - Unit testing:
pytest
Publish
pandoc README.md --from markdown --to rst -s -o README.rst
python setup.py sdist
twine upload -r pypi dist/*
find . -type f -name "*.pyc" | xargs rm
find . -type d -name "__pycache__" | xargs rm -r
rm -r .pytest_cache
rm -r .venv
Please open an issue for support.
- This package depends on the python package sparsity-pattern what is used to generate sparse matrices. If you would like to cite the
sparsity-patternpackage, please use DOI: 10.5281/zenodo.4357290
Please contribute using Github Flow. Create a branch, add commits, and open a pull request.