Skip to content

heyinUCB/Stability-Analysis-using-Quadratic-Constraints-for-Systems-with-Neural-Network-Controllers

Repository files navigation

Stability-Analysis-using-Quadratic-Constraints-for-Systems-with-Neural-Network-Controllers

This code is to accompany the paper Stability Analysis using Quadratic Constraints for Systems with Neural Network Controllers. It computes an ellipsoidal inner-approximation to the region of attraction of NN controlled-systems.

Authors:

  • He Yin (he_yin at berkeley.edu)
  • Peter Seiler (pseiler at umich.edu)
  • Murat Arcak (arcak at berkeley.edu)

Getting Started

All the code is written in MATLAB.

Prerequisites

There are two packages required:

  • MOSEK: Commercial semidefinite programming solver
  • CVX: Matlab software for convex programming

To plot the computed ROA, two more packages are required:

  • SOSOPT: General SOS optimization utility
  • Multipoly: Package used to represent multivariate polynomials

To run the NN controller generating code

Way of Using the Code for Stability Analysis

  • Interted pendulum example: In the folder Inverted_Pendulum_control_saturation, the actuator saturation is considered; and in the folder Inverted_Pendulum_no_saturation, the actuator saturation is not considered. In both folders, run the file Pendulum_sin_local.m to compute the ROA inner-approximation.
  • vehicle lateral control example: two experiments are includes. In the file Vehicle_Sector_LTIunc.m, the activation functions in the neural network are described only by the sector IQC; in the file Vehicle_Offby1andSector_LTIunc.m, the activation functions are described by both off-by-one and sector IQCs. Run plot_Figure8.m to visualize the results.

Way of Generating the NN controllers

Go to either vehicle_training or pendulum_training, run

python3 train_pg_f18_nobias.py -ep 1000 --discount 0.98 -n 100 -e 3 -l 2 -s 32 -b 6000 -lr 1e-3 -rtg --nn_baseline --exp_name v_b6000_r1e-3

ROA inner-approximation for a control saturated inverted pendulum

pendulum

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published