Giter VIP home page Giter VIP logo

rgg's Introduction

Refining Diffusion Planner for Reliable Behavior Synthesis by Automatic Detection of Infeasible Plans

This repository provides the source codes for our paper Refining Diffusion Planner for Reliable Behavior Synthesis by Automatic Detection of Infeasible Plans in NeurIPS 2023.

Installation

pip install -e .
pip install captum==0.6.0 gtimer
cd third_party/diffuser
pip install -e .

Using pretrained models

We offer pretrained models for gap prediction as well as pre-collected synthetic data. To download and set them up, run the following commands:

bash prepare_pretrained_models.sh
bash prepare_data.sh

Executing these commands will download and extract tar files, placing their contents into the logs/gap_predictor and logs/data directories respectively.

Planning using pretrained models

Evaluate RGG:

python scripts/maze2d/evaluate_rgg.py \
	--logbase ./logs/evaluate \
	--env_name maze2d-large-v1 \
	--task single_task \
	--diffusers_repo leekwoon/maze2d-large-v1-H384-T256 \
	--num_episodes 1000 \
	--spec rgg \
	--gap_predictor_path ./logs/pretrained_gap_predictor/maze2d-large-v1-H384-T256/500000_finish/2023_03_26_03_44_06/seed_0/state_best.pt

Evaluate RGG+:

python scripts/maze2d/evaluate_rggplus.py \
	--logbase ./logs/evaluate \
	--env_name maze2d-large-v1 \
	--task single_task \
	--diffusers_repo leekwoon/maze2d-large-v1-H384-T256 \
	--num_episodes 1000 \
	--spec rggplus \
	--gap_predictor_path ./logs/pretrained_gap_predictor/maze2d-large-v1-H384-T256/500000_finish/2023_03_26_03_44_06/seed_0/state_best.pt

Training from scratch

  1. Generate synthetic data with:
python scripts/maze2d/make_data.py \
	--base_datadir ./logs/data \
	--env_name maze2d-large-v1 \
	--diffusers_repo leekwoon/maze2d-large-v1-H384-T256 \
	--n 500000
  1. Compute restoration gap with:
python scripts/maze2d/compute_restoration_gaps.py \
	--env_name maze2d-large-v1 \
	--data_path ./logs/data/maze2d-large-v1-H384-T256/500000_finish.npz \
	--diffusers_repo leekwoon/maze2d-large-v1-H384-T256 \
	--strength 0.9 \
	--num_plan 10
  1. Train a gap predictor with:
python scripts/train_gap_predictor.py \
	--base_logdir ./logs/gap_predictor \
	--env_name maze2d-large-v1 \
	--data_path ./logs/data/maze2d-large-v1-H384-T256/500000_finish.npz \
	--score_path ./logs/data/maze2d-large-v1-H384-T256/500000_finish_restoration_gaps.npy \
	--seed 0

Attribution map can be inspected using notebooks/maze2d/plot_attribution.ipynb.

Reference

@inproceedings{lee2023refining,
  title={Refining Diffusion Planner for Reliable Behavior Synthesis by Automatic Detection of Infeasible Plans},
  author={Lee, Kyowoon and Kim, Seongun and Choi, Jaesik},
  booktitle={Advances in Neural Information Processing Systems},
  year={2023},
}

License

This repository is released under the MIT license. See LICENSE for additional details.

Acknowledgements

This repository is extended from diffuser and diffusers.

rgg's People

Contributors

leekwoon avatar seongun-kim avatar

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.