Running your first experiment#
Assuming you have installed the full library, you can run your first experiment by calling
PYTHONPATH=. python allenact/main.py minigrid_tutorial -b projects/tutorials -m 8 -o minigrid_output -s 12345
allenact root directory.
-b projects/tutorialswe tell
minigrid_tutorialexperiment config file will be found in the
-m 8we limit the number of subprocesses to 8 (each subprocess will run 16 of the 128 training task samplers).
-o minigrid_outputwe set the output folder into which results and logs will be saved.
-s 12345we set the random seed.
If everything was installed correctly, a simple model will be trained (and validated) in the MiniGrid environment and
a new folder
minigrid_output will be created containing:
checkpoints/MiniGridTutorial/LOCAL_TIME_STR/subfolder with model weight checkpoints,
used_configs/MiniGridTutorial/LOCAL_TIME_STR/subfolder with all used configuration files,
- and a tensorboard log file under
LOCAL_TIME_STR is a string that records the time when the experiment was started (e.g. the string
"2020-08-21_18-19-47" corresponds to an experiment started on August 21st 2020, 47 seconds past 6:19pm.
If we have Tensorboard installed, we can track training progress with
tensorboard --logdir minigrid_output/tb
which will default to the URL http://localhost:6006/.
After 150,000 steps, the script will terminate and several checkpoints will be saved in the output folder. The training curves should look similar to:
If everything went well, the
valid success rate should converge to 1 and the mean episode length to a value below 4.
(For perfectly uniform sampling and complete observation, the expectation for the optimal policy is 3.75 steps.) In the
not-so-unlikely event of the run failing to converge to a near-optimal policy, we can just try to re-run (for example
with a different random seed). The validation curves should look similar to:
A detailed tutorial describing how the
minigrid_tutorial experiment configuration was created can be found
To run your own custom experiment simply define a new experiment configuration in a file
projects/YOUR_PROJECT_NAME/experiments/my_custom_experiment.py after which you may run it with
PYTHONPATH=. python allenact/main.py my_custom_experiment -b projects/YOUR_PROJECT_NAME/experiments.