SpikeRL: A Highly Scalable Framework for Spiking Reinforcement Learning
SpikeRL is a highly scalable framework designed for implementing and experimenting with spiking reinforcement learning algorithms. Leveraging the power of spiking neural networks, SpikeRL aims to bridge the gap between traditional reinforcement learning and biologically plausible neural computations, offering researchers and developers a robust platform for advanced AI experiments.
- Scalability: Efficiently handles large-scale spiking neural networks.
- Efficiency: Utilizes mixed-precision techniques for optimization and energy efficiency.
- Extensibility: Easily extendable to accommodate new models and environments.
Follow the steps below to set up SpikeRL on your local machine.
- Python 3.7 or higher
- pip package manager
-
Clone the Repository
git clone https://github.com/icl-utk-edu/spike-rl.git cd spike-rl
-
Create a Virtual Environment (Optional but Recommended)
python3 -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install Dependencies
For mpi support with spikeRL, compile PyTorch from source (instructions at https://github.com/pytorch/pytorch) with either
openmpi
ormpich
installation in your system. Ensure you have the required version ofnumpy
andmujoco
as specified in requirements.txt.pip install -r requirements.txt
The project dependencies are listed in the requirements.txt
file:
wheel
setuptools
pybind11
ipython
notebook
pyglet
six
pillow
imageio
scipy
scikit-learn
pandas
matplotlib
gymnasium
networkx
torch
gym
mpi4py
mujoco==2.3.3
numpy==1.24.0
# Using NCCL backend
torchrun --nproc_per_node=8 main.py --env Ant-v4 --hidden_sizes 100 100 --batch_size 100 --epochs 1 --backend nccl
# Using MPI backend
mpiexec -n 8 python main.py --env Ant-v4 --hidden_sizes 100 100 --batch_size 100 --epochs 1 --backend mpi
For any questions or support, please contact [email protected].
Acknowledgements
This work was supported by the U.S. Department of Energy, Office of Science, ASCR under Award Number DE-SC0021419. This material is based upon work supported by the Assistant Secretary of Defense for Research and Engineering under Air Force Contract No. FA8702-15-D-0001. Any opinions, findings, conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the Assistant Secretary of Defense for Research and Engineering.