created an inference module for RL-Studio

1 minute read

MIGRATION

The scope of this module is to enable extracting the inference in a way that any other program/robot can take benefit of the trained brains.

For that purpose, the python module inference_rlstudio.py was created. What this python module does is:

  • It receives the following parameters during initialization:
    • algorithm that is being used
    • file with the trained algorithm values to be loaded
    • file with the actions for which the algorithm was trained (and actions that are expected as an output of the inference module)
  • It loads the implemented algorithm indicating the file in which the training and expected actions were saved so this “brain” can be used by the caller program.

As it can be seen, the inference module is currenty implemented as a python library. So, what we did to test it was using this python library in our rl-studio environment as it could be used in any other. Two examples of this usage are probided in robot-mesh and f1 problems. The following steps must be performed to launch those two problems in “inference” mode:

  1. train any of those with the configuration yaml “save_model” paramete set to true.
  2. modify the configuration yaml to indicate where are the trained inference and selected_actions files (presumably under rl-studio/logs folder)
  3. launch the main_rlstudio.py with the flag “-m inference” (indicated also in rl-studio README.md)

DEMO

F1 inference module with successfully training