Skip to content

a015kh/hprl

 
 

Repository files navigation

Hierarchical Programmatic Reinforcement Learning via Learning to Compose Programs

This repository demonstrate the implementation code of Hierarchical Programmatic Reinforcement Learning via Learning to Compose Programs, which is published in ICML 2023. Please visit our project page for more information.

We re-formulate solving a reinforcement learning task as synthesizing a task-solving program that can be executed to interact with the environment and maximize the return. We first learn a program embedding space that continuously parameterizes a diverse set of programs sampled from a program dataset. Then, we train a meta-policy, whose action space is the learned program embedding space, to produce a series of programs (i.e., predict a series of actions) to yield a composed task-solving program.

The experimental results in the Karel domain show that our proposed framework outperforms baseline approaches. The ablation studies confirm the limitations of LEAPS and justify our design choices.

Environments

Karel Environments

Getting Started

pip3 install --upgrade virtualenv
virtualenv hprl
source hprl/bin/activate
pip3 install -r requirements.txt

Usage

HPRL Training

Stage 1: Learning Program Embeddings

  • Download dataset from here

  • Unzip the file

bash run_vae_option_L30.sh

Stage 2: Meta-Policy Training

bash run_meta_policy_new_vae_ppo_64dim.sh

Baseline Scripts of LLM-GS

# The scripts are in scripts/{task}.sh
bash scripts/cleanHouse.sh

Note that the task implementation of LLM-GS, HC, and HPRL are different. This is because the implementation in HC and HPRL have some bugs. In this repository, we follow the implementation of LLM-GS.

We only record the training programs and evaluate the programs using te evaluation from HC.

Cite the paper

@inproceedings{liu2023hierarchical, 
  title={Hierarchical Programmatic Reinforcement Learning via Learning to Compose Programs}, 
  author={Guan-Ting Liu and En-Pei Hu and Pu-Jen Cheng and Hung-Yi Lee and Shao-Hua Sun}, 
  booktitle = {International Conference on Machine Learning}, 
  year={2023} 
}

Authors

Guan-Ting Liu, En-Pei Hu, Pu-Jen Cheng, Hung-Yi Lee, Shao-Hua Sun

About

Hierarchical Programmatic Reinforcement Learning via Learning to Compose Programs (ICML 2023)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 96.8%
  • Shell 3.2%