Skip to content

The official repository for Paper "Learning a Formally Verified Control Barrier Function in Stochastic Environment"

Notifications You must be signed in to change notification settings

tayalmanan28/Stochastic-NCBF

Repository files navigation

Stochastic-Neural CBF: Learning a Formally Verified Control Barrier Function in Stochastic Environment

Manan Tayal, Hongchao Zhang, Pushpak Jagtap, Andrew Clark, Shishir Kolathaya
IISc, Bangalore and WashU, St. Louis

The official repository for Paper "Learning a Formally Verified Control Barrier Function in Stochastic Environment", accepted for presentation at CDC'24 Milan, Italy.

Installation

  • Clone the repository:
git clone https://github.com/tayalmanan28/Stochastic-NCBF

Usage

In main.py, define the system you are interested in:

system = 'uni'  # 'ip' for inverted pendulum, 'di' for double integrator or 'uni' for unicycle model.

In hyper_para.py define the hyperparameters:

N_H_B = 1 # the number of hidden layers for the barrier
D_H_B = 20 # the number of neurons of each hidden layer for the barrier

###########################################
#Barrier function conditions
#########################################

gamma=0; #first condition <= 0
lamda=0.00001; #this is required for strict inequality >= lambda

############################################
# set loss function definition
############################################
TOL_SAFE = 0.0   # tolerance for safe and unsafe conditions
TOL_UNSAFE = 0.000

TOL_LIE = 0.000 #tolerance for the last condition

TOL_DATA_GEN = 1e-16 #for data generation


############################################
#Lipschitz bound for training
lip_h= 1
lip_dh= 1
lip_d2h= 2
############################################
# number of training epochs
############################################
EPOCHS = 500

############################################
############################################
ALPHA=0.1
BETA = 0 # if beta equals 0 then constant rate = alpha
GAMMA = 0 # when beta is nonzero, larger gamma gives faster drop of rate

#weights for loss function

DECAY_LIE = 1 # decay of lie weight 0.1 works, 1 does not work
DECAY_SAFE = 1
DECAY_UNSAFE = 1

Finally, run main.py to start training Stochastic Neural CBF:

python3 main.py

Citation

If you find our work useful in your research, please cite:

@inproceedings{tayal2024learning,
  title={Learning a Formally Verified Control Barrier Function in Stochastic Environment},
  author={Tayal, Manan and Zhang, Hongchao and Jagtap, Pushpak and Clark, Andrew and Kolathaya, Shishir},
  booktitle={2024 63rd IEEE Conference on Decision and Control (CDC)},
  year={2024}
}

Contact

If you have any questions, please feel free to email the authors.

About

The official repository for Paper "Learning a Formally Verified Control Barrier Function in Stochastic Environment"

Topics

Resources

Stars

Watchers

Forks

Languages