/PAC-SNOC

PyTorch implementation of our PAC-Bayesian framework for optimal control with stability guarantees.

Primary LanguageJupyter Notebook

PAC-SNOC

PyTorch implementation of our PAC-Bayesian framework for optimal control with stability guarantees.

Installation

git clone https://github.com/DecodEPFL/PAC-SNOC.git

cd PAC-SNOC

python setup.py install

Examples:

Robots

The following gifs show the trajectories of the 2 robots before training (left), and after the training of the empirical controller (middle), and using our approach (right). The agents need to coordinate in order to pass through a narrow passage while avoiding collisions between them. The initial conditions used as training data are marked with ○, consisting of s = 30 samples. The shown trajectories start from a random initial position sampled from the test data and marked with ⬣.

robot_trajectories_before_training robot_trajectories_using_empirical_controller robot_trajectories_using_our_controller

Basic usage

Two environments are proposed to train the controllers with our approach. The two systems are: i) a simple Linear Time-Invariant (LTI) system, and ii) a system of two planar robots navigating to prespecified locations while avoiding collisions.

LTI system

  1. Generate the data by running
python experiments/scalar/generate_data.py
  1. Train the empirical controller by running
python experiments/scalar/run_empirical.py
  1. Train the benchmark controller by running
python experiments/scalar/run_benchmark.py
  1. Train the controllers using our approach by running
python experiments/scalar/run_grid_Gibbs.py

Robots

  1. Generate the data by running
python experiments/robotsX/generate_data.py
  1. Train the empirical controller by running
python experiments/robotsX/run_emp.py
  1. Train the controllers using our approach by running
python experiments/robotsX/run_SVGD.py

Pre-trained models

Pre-trained models of the LTI system and robots can be found in the folders robotsX and scalar, respectively.

License

This work is licensed under a Creative Commons Attribution 4.0 International License.

CC BY 4.0

References

[1] Mahrokh Ghoddousi Boroujeni, Clara Galimberti, Andreas Krause, Giancarlo Ferrari-Trecate. "A PAC-Bayesian Framework for Optimal Control with Stability Guarantees," 2024.