Git Product home page Git Product logo

zhengyinan-air / fisor Goto Github PK

View Code? Open in Web Editor NEW
53.0 1.0 3.0 13.48 MB

[ICLR 2024] The official implementation of "Safe Offline Reinforcement Learning with Feasibility-Guided Diffusion Model"

Home Page: https://zhengyinan-air.github.io/FISOR/

Python 75.44% Shell 0.68% CSS 4.89% HTML 18.99%
diffusion-models hamilton-jacobi-reachability jax offline-reinforcement-learning safe-reinforcement-learning imitation-learning reinforcement-learning

fisor's Introduction

Safe Offline Reinforcement Learning with Feasibility-Guided Diffusion Model

International Conference on Learning Representation (ICLR), 2024

[Project Page] [Arxiv] [Openreview]

Yinan Zheng*, Jianxiong Li*, Dongjie Yu, Yujie Yang, Shengbo Eben Li, Xianyuan Zhan, Jingjing Liu

The official implementation of FISOR, which represents a pioneering effort in considering hard constraints (Hamilton-Jacobi Reachability) within the safe offline RL setting.

Methods

FISOR transforms the original tightly-coupled safety-constrained offline RL problem into three decoupled simple supervised objectives:

  • Offline identification of the largest feasible region;
  • Optimal advantage learning;
  • Optimal policy extraction via time-independent classifier-guided diffusion model, enhancing both performance and stability.

Branches Overview

Branch name Usage
master FISOR implementation for Point Robot, Safety-Gymnasium and Bullet-Safety-Gym; data quantity experiment; feasible region visualization.
metadrive_imitation FISOR implementation for MetaDrive; data quantity experiment; imitation learning experiment.

Installation

conda create -n env_name python=3.9
conda activate FISOR
git clone https://github.com/ZhengYinan-AIR/FISOR.git
cd FISOR
pip install -r requirements.txt

Main results

Run

# OfflineCarButton1Gymnasium-v0
export XLA_PYTHON_CLIENT_PREALLOCATE=False
python launcher/examples/train_offline.py --env_id 0 --config configs/train_config.py:fisor

where env_id serves as an index for the list of environments.

Data Quantity Experiments

We can run filter_data.py to generate offline data of varying volumes. We also can download the necessary offline datasets (Download link). Then run

python launcher/examples/train_offline.py --env_id 17 --config configs/train_config.py:fisor --ratio 0.1

where ratio refers to the proportion of the processed data to the original dataset.

Feasible Region Visualization

We need to download the necessary offline dataset for Point Robot environment (Download link). Training FISOR in the Point Robot environment

python launcher/examples/train_offline.py --env_id 29 --config configs/train_config.py:fisor

Then visualize the feasible region by running viz_map.py.

Bibtex

If you find our code and paper can help, please cite our paper as:

@inproceedings{
zheng2024safe,
title={Safe Offline Reinforcement Learning with Feasibility-Guided Diffusion Model},
author={Yinan Zheng and Jianxiong Li and Dongjie Yu and Yujie Yang and Shengbo Eben Li and Xianyuan Zhan and Jingjing Liu},
booktitle={The Twelfth International Conference on Learning Representations},
year={2024},
url={https://openreview.net/forum?id=j5JvZCaDM0}
}

Acknowledgements

Parts of this code are adapted from IDQL and DRPO.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.