text2reward
1.0.0
Paper Text2Rewardのコード:強化学習のための言語モデルでの報酬形状。その他のデモンストレーションと最新の関連リソースについては、プロジェクトページを参照してください。
環境を確立するには、このコードをシェルで実行します。
# set up conda
conda create -n text2reward python=3.7
conda activate text2reward
# set up ManiSkill2 environment
cd ManiSkill2
pip install -e .
pip install stable-baselines3==1.8.0 wandb tensorboard
cd ..
cd run_maniskill
bash download_data.sh
# set up MetaWorld environment
cd ..
cd Metaworld
pip install -e .
# set up code generation
pip install langchain chromadb==0.4.0mujocoをインストールしていない場合は、ここからの指示に従ってインストールしてください。その後、次のコマンドを試して、インストールの成功を確認してください。 $ python3
>>> import mujoco_pyRuntimeError: vk::Instance::enumeratePhysicalDevices: ErrorInitializationFailedSome required Vulkan extension is not present. You may not use the renderer to render, however, CPU resources will be still available.Segmentation fault (core dumped) 実験結果を再実現するには、次のスクリプトを実行できます。
Maniskill2:
bash run_oracle.sh
bash run_zero_shot.sh
bash run_few_shot.sh次の警告に遭遇することは普通です。
[svulkan2] [error] GLFW error: X11: The DISPLAY environment variable is missing
[svulkan2] [warning] Continue without GLFW.Metaworld:
bash run_oracle.sh
bash run_zero_shot.shまず、 .bashrc (または.zshrcなど)に次の環境変数を追加してください。
export PYTHONPATH= $PYTHONPATH : ~ /path/to/text2reward次に、ディレクトリtext2reward/code_generation/single_flowに移動し、次のスクリプトを実行します。
# generate reward code for Maniskill
bash run_maniskill_zeroshot.sh
bash run_maniskill_fewshot.sh
# generate reward code for MetaWorld
bash run_metaworld_zeroshot.shデフォルトでは、上記のrun_oracle.shスクリプトは、環境が提供する専門家が書いた報酬を使用します。 run_zero_shot.shおよびrun_few_shot.shスクリプトは、実験で使用される生成された報酬を使用します。提供する報酬に基づいて新しい実験を実行したい場合は、上記のBashスクリプトに従って、 --reward_pathパラメーターを独自の報酬のパスに変更してください。
私たちの作品が役立つと思われる場合は、私たちを引用してください。
@inproceedings { xietext2reward ,
title = { Text2Reward: Reward Shaping with Language Models for Reinforcement Learning } ,
author = { Xie, Tianbao and Zhao, Siheng and Wu, Chen Henry and Liu, Yitao and Luo, Qian and Zhong, Victor and Yang, Yanchao and Yu, Tao } ,
booktitle = { The Twelfth International Conference on Learning Representations }
}