Software product for analysis of activations and specialization in artificial neural networks (ANN), including spiking neural networks (SNN), with the tensor train (TT) decomposition and other gradient-free methods.
-
Install python (version 3.8; you may use anaconda package manager);
-
Create a virtual environment:
conda create --name mango python=3.8 -y
-
Activate the environment:
conda activate mango
-
install pytorch with specific cuda toolkit version
conda install pytorch torchvision torchaudio pytorch-cuda=11.8 -c pytorch -c nvidia
-
(optional) install cupy for cudnn-based GPU acceleration for SNNs
conda install -c conda-forge cupy cudnn cutensor
-
Install dependencies:
pip install jupyterlab "jax[cpu]" optax teneva ttopt protes snntorch spikingjelly matplotlib nevergrad requests urllib3
Run python manager.py ARGS, then see the outputs in the terminal and results in the result folder. Before starting the new calculation, you can completely delete or rename the result folder. A new result folder will be created automatically in this case.
To run the code on the cluster, we used the
zhores_run.shbash script (in this case, the console output will be saved in a filezhores_out.txt).
Supported combinations of the manager.py script arguments:
-
python manager.py --data cifar10 --task check --kind data -
python manager.py --data imagenet --task check --kind data -
python manager.py --data cifar10 --model densenet --task check --kind model --c 0 -
python manager.py --data imagenet --model vgg19 --task check --kind model --c 0 -
python manager.py --data cifar10 --gen vae_vq --model densenet --task train --kind gen -
python manager.py --data cifar10 --gen vae_vq --model densenet --task check --kind gen -
python manager.py --data cifar10 --gen gan_sn --model densenet --task check --kind gen -
python manager.py --data cifar10 --gen vae_vq --model densenet --task am --kind class --c 0Classes may be 0, 1, ..., 9
-
python manager.py --data cifar10 --gen gan_sn --model densenet --task am --kind class --c 0Classes may be 0, 1, ..., 9