Visit the Demo page to see the trained Reinforcement Learning agents in action. This page also includes brief explanations of the methods and a short guide to set up the solver backend.
For the standard setup and use case, this should reproduce our results.
git clone https://github.com/peleiden/rl-rubiks
cd rl-rubiks
pip install -r rlrequirements.txt
python runtrain.py --config configs/main_train.ini
python runeval.py --config configs/main_eval.ini
For more instructions on reproducing the training and evaluation, read Installation and Usage below.
To limit the size of this repository, we have kept no models on it. Our trained models are available on the model repository.
-
Clone the repo:
git clone https://github.com/peleiden/rl-rubiks cd rl-rubiks
-
Install requirements (use
pip3
ifpip
is not bound to your Python 3 binary):pip install -r rlrequirements.txt
(There are also some optional dependencies:
GitPython
for saving commits in logs andnetworkx
andimageio
for visualizing values of initial states over time when running with--analysis True
.) -
(Only needed if you get
ImportError
) For the modules to work, you might need to add the main repo folder path to yourPYTHONPATH
environment variable. In *nix-systems, you can run the following to achieve this:export PYTHONPATH=$PYTHONPATH:<path where you cloned>/rl-rubiks
If your shell is
bash
with standard setup, this can be made permenant by running.echo "export PYTHONPATH=\$PYTHONPATH:<path where you cloned>/rl-rubiks" >> ~/.bashrc
On Windows, you can follow some of the instructions in this Stack Overflow thread.
The training can be started using runtrain.py
. From the main repo folder, run
python runtrain.py --help
to show the possible options. In many cases, using the parameters from a configuration file is preferable.
python runtrain.py --config configs/main_train.ini
To evaluate the performance of one or more agents, a solving experiment can be started using runeval.py
. From the main repo folder, run
python runeval.py --help
to show options. This also works with configuration files; an example of which can be seen by running
python runeval.py --config configs/main_eval.ini